From ede20247eeffd34e0fe9517122aea256eb220759 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Thu, 25 Sep 2025 09:28:55 +0800 Subject: [PATCH 01/13] =?UTF-8?q?refactor(main):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E8=87=AA=E5=8A=A8=E6=B3=A8=E5=86=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除了通过遍历对象自动注册指令的代码 - 简化了应用启动时的初始化流程- 提高了代码可读性和维护性 --- src/main.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 150a597..2d50c2f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,7 +28,6 @@ const app = createApp(App); app.component('NoData', NoData); app.component('SvgIcon', SvgIcon); -(Object.keys(directives) as Array).forEach((k) => app.use(directives[k])); // 注册指令 app.use(store); app.use(router); From 0afab0aa1949e95665ebb2c8dedf6816263faf96 Mon Sep 17 00:00:00 2001 From: lq <121091329@qq.com> Date: Thu, 25 Sep 2025 10:36:56 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 2 +- .../components/date-selector.vue | 1 - .../components/raw-material-drawer.vue | 36 ++++++++++++------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index d3fce1d..cdeae8a 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@types/nprogress": "^0.2.0", "@vueuse/core": "^9.12.0", "ali-oss": "^6.17.1", - "ant-design-vue": "~4.2.6", + "ant-design-vue": "^4.2.6", "ant-design-x-vue": "^1.3.2", "axios": "^1.3.0", "dayjs": "^1.11.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08b48c0..039060a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,7 +27,7 @@ importers: specifier: ^6.17.1 version: 6.20.0 ant-design-vue: - specifier: ~4.2.6 + specifier: ^4.2.6 version: 4.2.6(vue@3.5.18(typescript@4.9.5)) ant-design-x-vue: specifier: ^1.3.2 diff --git a/src/views/property-marketing/assignment-management/components/date-selector.vue b/src/views/property-marketing/assignment-management/components/date-selector.vue index 9ad0dbb..b358c98 100644 --- a/src/views/property-marketing/assignment-management/components/date-selector.vue +++ b/src/views/property-marketing/assignment-management/components/date-selector.vue @@ -240,7 +240,6 @@ watch( dayModel.value = newVal.dayModel || new Date(); weekModel.value = newVal.weekModel || new Date(); monthModel.value = newVal.monthModel || new Date(); - emitChange(); } }, { deep: true }, diff --git a/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue b/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue index df5253f..919e3b0 100644 --- a/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue +++ b/src/views/property-marketing/assignment-management/components/raw-material-drawer.vue @@ -6,6 +6,7 @@ placement="right" :visible="visible" @after-visible-change="onAfterVisibleChange" + @close="handleClose" @cancel="handleCancel" width="904px" class="task-drawer" @@ -246,25 +247,18 @@ const getStatus = (status: number) => { } }; -// 抽屉显示状态变化处理 -const onAfterVisibleChange = (visible: boolean) => { - emit('after-visible-change', visible); - if (visible) { - // 当抽屉显示时,使用最新参数请求数据 - fetchProductData(); - } else { - // 关闭时清空数据 - materialData.value = []; - selectedRowKeys.value = []; - choseText.value = ''; - choseImgArray.value = []; - } +// 抽屉关闭事件处理(右上角关闭按钮) +const handleClose = () => { + console.log('关闭'); + emit('cancel'); + emit('update:visible', false); }; // 取消按钮处理 const handleCancel = () => { console.log('取消'); emit('cancel'); + emit('update:visible', false); }; // 确定按钮处理 @@ -282,6 +276,22 @@ const handleOk = () => { }); emit('update:visible', false); }; + +// 抽屉显示状态变化处理 +const onAfterVisibleChange = (visible: boolean) => { + emit('after-visible-change', visible); + if (visible) { + // 当抽屉显示时,使用最新参数请求数据 + fetchProductData(); + } else { + // 关闭时清空数据 + materialData.value = []; + selectedRowKeys.value = []; + choseText.value = ''; + choseImgArray.value = []; + } +}; +