Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 76da2d4

Browse files
authored
Merge pull request #291 from YeungHoiChiu/vite-config
fix: 打包错误、公共步骤中未禁用分组拖拽导致出现预期之外的结果
2 parents 89effa6 + b0b3b02 commit 76da2d4

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

src/components/PublicStepUpdate.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ const jump = (id) => {
291291
<el-tab-pane :label="$t('pubSteps.selected')" name="select">
292292
<step-draggable
293293
:is-edit="true"
294+
:is-public-steps="true"
294295
:steps="publicStep.steps"
295296
@set-parent="setParent"
296297
@add-step="addStep"

src/components/StepDraggable.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ const props = defineProps({
3737
type: Boolean,
3838
default: false,
3939
},
40+
isPublicSteps: {
41+
type: Boolean,
42+
default: false, // 公共步骤可能会引用多个不同case的步骤,不应该允许拖拽更改parentId
43+
},
4044
parentId: Number, // 用于分组拖拽时,更新step数据的parentId
4145
});
4246
const emit = defineEmits([
@@ -163,7 +167,7 @@ const addStepTotarget = (id, toNext) => {
163167
<VueDraggableNext
164168
tag="div"
165169
:list="steps"
166-
group="case-step"
170+
:group="isPublicSteps ? '' : 'case-step'"
167171
handle=".handle"
168172
animation="200"
169173
force-fallback="true"

vite.config.js

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
import {defineConfig} from 'vite';
2-
import {join} from 'path';
1+
import { defineConfig } from 'vite';
2+
import { join } from 'path';
33
import vue from '@vitejs/plugin-vue';
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7-
plugins: [vue()],
8-
server:{
9-
port: 3002
10-
},
11-
build: {
12-
rollupOptions: {
13-
output: {
14-
manualChunks(id) {
15-
if (id.includes('node_modules')) {
16-
return id.toString().split('node_modules/')[1].split('/')[0].toString();
17-
}
18-
}
19-
}
20-
}
21-
},
22-
resolve: {
23-
alias: {
24-
'@': join(__dirname, 'src'),
7+
plugins: [vue()],
8+
server: {
9+
port: 3002,
10+
},
11+
build: {
12+
chunkSizeWarningLimit: 600 * 1024, // 设置警告阈值为600KiB,因为element-plus超过500kb导致打包失败
13+
rollupOptions: {
14+
output: {
15+
manualChunks(id) {
16+
if (id.includes('node_modules')) {
17+
return id
18+
.toString()
19+
.split('node_modules/')[1]
20+
.split('/')[0]
21+
.toString();
22+
}
2523
},
24+
},
25+
},
26+
},
27+
resolve: {
28+
alias: {
29+
'@': join(__dirname, 'src'),
2630
},
31+
},
2732
});

0 commit comments

Comments
 (0)