Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 打包错误、公共步骤中未禁用分组拖拽导致出现预期之外的结果 #291

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/PublicStepUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ const jump = (id) => {
<el-tab-pane :label="$t('pubSteps.selected')" name="select">
<step-draggable
:is-edit="true"
:is-public-steps="true"
:steps="publicStep.steps"
@set-parent="setParent"
@add-step="addStep"
Expand Down
6 changes: 5 additions & 1 deletion src/components/StepDraggable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
isPublicSteps: {
type: Boolean,
default: false, // 公共步骤可能会引用多个不同case的步骤,不应该允许拖拽更改parentId
},
parentId: Number, // 用于分组拖拽时,更新step数据的parentId
});
const emit = defineEmits([
Expand Down Expand Up @@ -163,7 +167,7 @@ const addStepTotarget = (id, toNext) => {
<VueDraggableNext
tag="div"
:list="steps"
group="case-step"
:group="isPublicSteps ? '' : 'case-step'"
handle=".handle"
animation="200"
force-fallback="true"
Expand Down
45 changes: 25 additions & 20 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import {defineConfig} from 'vite';
import {join} from 'path';
import { defineConfig } from 'vite';
import { join } from 'path';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
server:{
port: 3002
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
}
}
}
},
resolve: {
alias: {
'@': join(__dirname, 'src'),
plugins: [vue()],
server: {
port: 3002,
},
build: {
chunkSizeWarningLimit: 600 * 1024, // 设置警告阈值为600KiB,因为element-plus超过500kb导致打包失败
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString();
}
},
},
},
},
resolve: {
alias: {
'@': join(__dirname, 'src'),
},
},
});
Loading