From eeff84b63fb9dc1368f7676e372c50956ac8fcb3 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 29 May 2026 19:32:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes):=20=E4=BC=98=E5=8C=96=20confirm=20?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/_core/profile/modules/user-social.vue | 4 +--- .../src/views/ai/image/manager/index.vue | 4 +--- .../src/views/ai/knowledge/document/index.vue | 4 +--- .../src/views/ai/knowledge/segment/index.vue | 4 +--- .../src/views/ai/music/manager/index.vue | 4 +--- .../crm/business/components/detail-list.vue | 4 +--- .../web-antd/src/views/crm/clue/detail/index.vue | 4 +--- .../views/crm/contact/components/detail-list.vue | 4 +--- .../src/views/crm/customer/detail/index.vue | 16 ++++------------ .../src/views/crm/permission/modules/list.vue | 4 +--- .../src/views/erp/finance/account/index.vue | 4 +--- .../src/views/erp/stock/warehouse/index.vue | 4 +--- .../src/views/infra/apiErrorLog/index.vue | 4 +--- .../device/detail/modules/modbus-config.vue | 2 +- .../device/device/detail/modules/sub-device.vue | 6 ++---- .../src/views/mall/product/comment/index.vue | 4 +--- .../src/views/mall/product/spu/index.vue | 8 ++------ .../mall/promotion/coupon/template/index.vue | 4 +--- .../promotion/kefu/modules/conversation-list.vue | 4 +--- .../mall/promotion/seckill/config/index.vue | 4 +--- .../statistics/product/modules/summary-card.vue | 4 +--- .../mall/statistics/trade/modules/trend-card.vue | 4 +--- .../views/mall/trade/brokerage/user/index.vue | 4 +--- .../src/views/mes/qc/iqc/modules/form.vue | 12 +++++++++--- .../src/views/mes/qc/oqc/modules/form.vue | 15 +++++++++++---- .../src/views/mes/qc/rqc/modules/form.vue | 16 +++++++++++----- apps/web-antd/src/views/pay/app/index.vue | 4 +--- apps/web-antd/src/views/system/user/index.vue | 4 +--- .../views/_core/profile/modules/user-social.vue | 4 +--- .../web-ele/src/views/ai/image/manager/index.vue | 4 +--- .../src/views/ai/knowledge/document/index.vue | 4 +--- .../src/views/ai/knowledge/segment/index.vue | 4 +--- .../web-ele/src/views/ai/music/manager/index.vue | 4 +--- .../crm/business/components/detail-list.vue | 4 +--- apps/web-ele/src/views/crm/clue/detail/index.vue | 4 +--- .../views/crm/contact/components/detail-list.vue | 4 +--- .../src/views/crm/customer/detail/index.vue | 16 ++++------------ .../src/views/crm/permission/modules/list.vue | 4 +--- .../src/views/erp/finance/account/index.vue | 4 +--- .../src/views/erp/stock/warehouse/index.vue | 4 +--- .../src/views/infra/apiErrorLog/index.vue | 4 +--- .../device/detail/modules/modbus-config.vue | 2 +- .../device/device/detail/modules/sub-device.vue | 6 ++---- .../src/views/mall/product/comment/index.vue | 4 +--- .../web-ele/src/views/mall/product/spu/index.vue | 8 ++------ .../mall/promotion/coupon/template/index.vue | 4 +--- .../promotion/kefu/modules/conversation-list.vue | 4 +--- .../mall/promotion/seckill/config/index.vue | 4 +--- .../statistics/product/modules/summary-card.vue | 4 +--- .../mall/statistics/trade/modules/trend-card.vue | 4 +--- .../views/mall/trade/brokerage/user/index.vue | 4 +--- .../src/views/mes/qc/ipqc/modules/form.vue | 14 +++++++++++--- .../src/views/mes/qc/iqc/modules/form.vue | 12 +++++++++--- .../src/views/mes/qc/oqc/modules/form.vue | 14 +++++++++++--- .../src/views/mes/qc/rqc/modules/form.vue | 14 +++++++++++--- apps/web-ele/src/views/pay/app/index.vue | 4 +--- apps/web-ele/src/views/system/user/index.vue | 4 +--- 57 files changed, 133 insertions(+), 196 deletions(-) diff --git a/apps/web-antd/src/views/_core/profile/modules/user-social.vue b/apps/web-antd/src/views/_core/profile/modules/user-social.vue index ddb806567..d0925bac7 100644 --- a/apps/web-antd/src/views/_core/profile/modules/user-social.vue +++ b/apps/web-antd/src/views/_core/profile/modules/user-social.vue @@ -105,9 +105,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ /** 解绑账号 */ function onUnbind(row: SystemSocialUserApi.SocialUser) { - confirm({ - content: `确定解绑[${getDictLabel(DICT_TYPE.SYSTEM_SOCIAL_TYPE, row.type)}]平台的[${row.openid}]账号吗?`, - }).then(async () => { + confirm(`确定解绑[${getDictLabel(DICT_TYPE.SYSTEM_SOCIAL_TYPE, row.type)}]平台的[${row.openid}]账号吗?`).then(async () => { await socialUnbind({ type: row.type, openid: row.openid }); // 提示成功 message.success($t('ui.actionMessage.operationSuccess')); diff --git a/apps/web-antd/src/views/ai/image/manager/index.vue b/apps/web-antd/src/views/ai/image/manager/index.vue index 04d048e80..08e602a68 100644 --- a/apps/web-antd/src/views/ai/image/manager/index.vue +++ b/apps/web-antd/src/views/ai/image/manager/index.vue @@ -39,9 +39,7 @@ async function handleUpdatePublicStatusChange( ): Promise { const text = newStatus ? '公开' : '私有'; try { - await confirm({ - content: `确认要将该图片切换为【${text}】吗?`, - }); + await confirm(`确认要将该图片切换为【${text}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/ai/knowledge/document/index.vue b/apps/web-antd/src/views/ai/knowledge/document/index.vue index 5d21febd3..21db8989a 100644 --- a/apps/web-antd/src/views/ai/knowledge/document/index.vue +++ b/apps/web-antd/src/views/ai/knowledge/document/index.vue @@ -77,9 +77,7 @@ async function handleStatusChange( row: AiKnowledgeDocumentApi.KnowledgeDocument, ): Promise { try { - await confirm({ - content: `你要将${row.name}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`, - }); + await confirm(`你要将${row.name}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/ai/knowledge/segment/index.vue b/apps/web-antd/src/views/ai/knowledge/segment/index.vue index 2f9955e64..519c96eaa 100644 --- a/apps/web-antd/src/views/ai/knowledge/segment/index.vue +++ b/apps/web-antd/src/views/ai/knowledge/segment/index.vue @@ -65,9 +65,7 @@ async function handleStatusChange( row: AiKnowledgeSegmentApi.KnowledgeSegment, ): Promise { try { - await confirm({ - content: `你要将片段 ${row.id} 的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`, - }); + await confirm(`你要将片段 ${row.id} 的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/ai/music/manager/index.vue b/apps/web-antd/src/views/ai/music/manager/index.vue index 6d03547cd..26735dece 100644 --- a/apps/web-antd/src/views/ai/music/manager/index.vue +++ b/apps/web-antd/src/views/ai/music/manager/index.vue @@ -39,9 +39,7 @@ async function handleUpdatePublicStatusChange( ): Promise { const text = newStatus ? '公开' : '私有'; try { - await confirm({ - content: `确认要将该音乐切换为【${text}】吗?`, - }); + await confirm(`确认要将该音乐切换为【${text}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/crm/business/components/detail-list.vue b/apps/web-antd/src/views/crm/business/components/detail-list.vue index 87f36d459..ce2691713 100644 --- a/apps/web-antd/src/views/crm/business/components/detail-list.vue +++ b/apps/web-antd/src/views/crm/business/components/detail-list.vue @@ -75,9 +75,7 @@ async function handleDeleteContactBusinessList() { return; } try { - await confirm({ - content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`, - }); + await confirm(`确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/crm/clue/detail/index.vue b/apps/web-antd/src/views/crm/clue/detail/index.vue index 98117c0e4..1b20c46b0 100644 --- a/apps/web-antd/src/views/crm/clue/detail/index.vue +++ b/apps/web-antd/src/views/crm/clue/detail/index.vue @@ -84,9 +84,7 @@ function handleTransfer() { /** 转化为客户 */ async function handleTransform(): Promise { try { - await confirm({ - content: '确定将该线索转化为客户吗?', - }); + await confirm('确定将该线索转化为客户吗?'); } catch { return false; } diff --git a/apps/web-antd/src/views/crm/contact/components/detail-list.vue b/apps/web-antd/src/views/crm/contact/components/detail-list.vue index 7e408cf3a..d777749f7 100644 --- a/apps/web-antd/src/views/crm/contact/components/detail-list.vue +++ b/apps/web-antd/src/views/crm/contact/components/detail-list.vue @@ -72,9 +72,7 @@ async function handleDeleteContactBusinessList() { return; } try { - await confirm({ - content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`, - }); + await confirm(`确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/crm/customer/detail/index.vue b/apps/web-antd/src/views/crm/customer/detail/index.vue index 8faf13e93..8d4a917e5 100644 --- a/apps/web-antd/src/views/crm/customer/detail/index.vue +++ b/apps/web-antd/src/views/crm/customer/detail/index.vue @@ -102,9 +102,7 @@ function handleTransfer() { /** 锁定客户 */ async function handleLock(lockStatus: boolean): Promise { try { - await confirm({ - content: `确定锁定客户【${customer.value.name}】吗?`, - }); + await confirm(`确定锁定客户【${customer.value.name}】吗?`); } catch { return false; } @@ -118,9 +116,7 @@ async function handleLock(lockStatus: boolean): Promise { /** 领取客户 */ async function handleReceive(): Promise { try { - await confirm({ - content: `确定领取客户【${customer.value.name}】吗?`, - }); + await confirm(`确定领取客户【${customer.value.name}】吗?`); } catch { return false; } @@ -139,9 +135,7 @@ function handleDistributeForm() { /** 客户放入公海 */ async function handlePutPool(): Promise { try { - await confirm({ - content: `确定将客户【${customer.value.name}】放入公海吗?`, - }); + await confirm(`确定将客户【${customer.value.name}】放入公海吗?`); } catch { return false; } @@ -156,9 +150,7 @@ async function handlePutPool(): Promise { async function handleUpdateDealStatus(): Promise { const dealStatus = !customer.value.dealStatus; try { - await confirm({ - content: `确定更新成交状态为【${dealStatus ? '已成交' : '未成交'}】吗?`, - }); + await confirm(`确定更新成交状态为【${dealStatus ? '已成交' : '未成交'}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/crm/permission/modules/list.vue b/apps/web-antd/src/views/crm/permission/modules/list.vue index 2a2789ff9..3cd76ee36 100644 --- a/apps/web-antd/src/views/crm/permission/modules/list.vue +++ b/apps/web-antd/src/views/crm/permission/modules/list.vue @@ -100,9 +100,7 @@ async function handleDelete() { return; } try { - await confirm({ - content: `你要将${checkedRows.value.map((item) => item.nickname).join(',')}移出团队吗?`, - }); + await confirm(`你要将${checkedRows.value.map((item) => item.nickname).join(',')}移出团队吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/erp/finance/account/index.vue b/apps/web-antd/src/views/erp/finance/account/index.vue index 2a91dbe9a..4c74b625e 100644 --- a/apps/web-antd/src/views/erp/finance/account/index.vue +++ b/apps/web-antd/src/views/erp/finance/account/index.vue @@ -67,9 +67,7 @@ async function handleDefaultStatusChange( ): Promise { const text = newStatus ? '设置' : '取消'; try { - await confirm({ - content: `确认要${text}"${row.name}"默认吗?`, - }); + await confirm(`确认要${text}"${row.name}"默认吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/erp/stock/warehouse/index.vue b/apps/web-antd/src/views/erp/stock/warehouse/index.vue index 560918fb5..2ef04503e 100644 --- a/apps/web-antd/src/views/erp/stock/warehouse/index.vue +++ b/apps/web-antd/src/views/erp/stock/warehouse/index.vue @@ -65,9 +65,7 @@ async function handleDefaultStatusChange( ): Promise { const text = newStatus ? '设置' : '取消'; try { - await confirm({ - content: `确认要${text}"${row.name}"默认吗?`, - }); + await confirm(`确认要${text}"${row.name}"默认吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/infra/apiErrorLog/index.vue b/apps/web-antd/src/views/infra/apiErrorLog/index.vue index c84d0d44e..304395b36 100644 --- a/apps/web-antd/src/views/infra/apiErrorLog/index.vue +++ b/apps/web-antd/src/views/infra/apiErrorLog/index.vue @@ -42,9 +42,7 @@ function handleDetail(row: InfraApiErrorLogApi.ApiErrorLog) { /** 处理已处理 / 已忽略的操作 */ async function handleProcess(id: number, processStatus: number) { - await confirm({ - content: `确认标记为${InfraApiErrorLogProcessStatusEnum.DONE ? '已处理' : '已忽略'}?`, - }); + await confirm(`确认标记为${InfraApiErrorLogProcessStatusEnum.DONE ? '已处理' : '已忽略'}?`); const hideLoading = message.loading({ content: '正在处理中...', duration: 0, diff --git a/apps/web-antd/src/views/iot/device/device/detail/modules/modbus-config.vue b/apps/web-antd/src/views/iot/device/device/detail/modules/modbus-config.vue index ce4d907d8..e992978b0 100644 --- a/apps/web-antd/src/views/iot/device/device/detail/modules/modbus-config.vue +++ b/apps/web-antd/src/views/iot/device/device/detail/modules/modbus-config.vue @@ -285,7 +285,7 @@ function handleEditPoint(row: IotDeviceModbusPointApi.ModbusPoint) { /** 删除点位 */ async function handleDeletePoint(row: IotDeviceModbusPointApi.ModbusPoint) { - await confirm({ content: `确定要删除点位【${row.name}】吗?` }); + await confirm(`确定要删除点位【${row.name}】吗?`); await deleteModbusPoint(row.id!); message.success('删除成功'); await gridApi.query(); diff --git a/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue b/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue index 8515630fa..a52097527 100644 --- a/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue +++ b/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue @@ -126,7 +126,7 @@ function handleRowCheckboxChange({ /** 解绑单个设备 */ async function handleUnbind(row: IotDeviceApi.Device) { - await confirm({ content: `确定要解绑子设备【${row.deviceName}】吗?` }); + await confirm(`确定要解绑子设备【${row.deviceName}】吗?`); const hideLoading = message.loading({ content: `正在解绑【${row.deviceName}】...`, duration: 0, @@ -142,9 +142,7 @@ async function handleUnbind(row: IotDeviceApi.Device) { /** 批量解绑 */ async function handleUnbindBatch() { - await confirm({ - content: `确定要解绑选中的 ${checkedIds.value.length} 个子设备吗?`, - }); + await confirm(`确定要解绑选中的 ${checkedIds.value.length} 个子设备吗?`); const hideLoading = message.loading({ content: '正在批量解绑...', duration: 0, diff --git a/apps/web-antd/src/views/mall/product/comment/index.vue b/apps/web-antd/src/views/mall/product/comment/index.vue index e10ae6326..d02d980ad 100644 --- a/apps/web-antd/src/views/mall/product/comment/index.vue +++ b/apps/web-antd/src/views/mall/product/comment/index.vue @@ -65,9 +65,7 @@ async function handleStatusChange( ): Promise { const text = newStatus ? '展示' : '隐藏'; try { - await confirm({ - content: `确认要${text}该评论吗?`, - }); + await confirm(`确认要${text}该评论吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/mall/product/spu/index.vue b/apps/web-antd/src/views/mall/product/spu/index.vue index 205bc8174..2be71cae1 100644 --- a/apps/web-antd/src/views/mall/product/spu/index.vue +++ b/apps/web-antd/src/views/mall/product/spu/index.vue @@ -110,9 +110,7 @@ async function handleStatusChange( // 二次确认 const text = newStatus ? '上架' : '下架'; try { - await confirm({ - content: `确认要${text + row.name}吗?`, - }); + await confirm(`确认要${text + row.name}吗?`); } catch { return false; } @@ -132,9 +130,7 @@ async function handleStatus02Change(row: MallSpuApi.Spu, newStatus: number) { newStatus === ProductSpuStatusEnum.RECYCLE.status ? '加入到回收站' : '恢复到仓库'; - await confirm({ - content: `确认要"${row.name}"${text}吗?`, - }); + await confirm(`确认要"${row.name}"${text}吗?`); const hideLoading = message.loading({ content: `正在${text}中...`, duration: 0, diff --git a/apps/web-antd/src/views/mall/promotion/coupon/template/index.vue b/apps/web-antd/src/views/mall/promotion/coupon/template/index.vue index b6a01d3c7..1d009535c 100644 --- a/apps/web-antd/src/views/mall/promotion/coupon/template/index.vue +++ b/apps/web-antd/src/views/mall/promotion/coupon/template/index.vue @@ -61,9 +61,7 @@ async function handleStatusChange( row: MallCouponTemplateApi.CouponTemplate, ): Promise { try { - await confirm({ - content: `你要将${row.name}的状态切换为【${newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'}】吗?`, - }); + await confirm(`你要将${row.name}的状态切换为【${newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/mall/promotion/kefu/modules/conversation-list.vue b/apps/web-antd/src/views/mall/promotion/kefu/modules/conversation-list.vue index 174d845a3..b8460957b 100644 --- a/apps/web-antd/src/views/mall/promotion/kefu/modules/conversation-list.vue +++ b/apps/web-antd/src/views/mall/promotion/kefu/modules/conversation-list.vue @@ -125,9 +125,7 @@ async function updateConversationPinnedFn(pinned: boolean) { /** 删除会话 */ async function deleteConversationFn() { // 1. 删除会话 - confirm({ - content: '您确定要删除该会话吗?', - }).then(async () => { + confirm('您确定要删除该会话吗?').then(async () => { await deleteConversation(rightClickConversation.value.id); // 2. 关闭右键菜单,更新会话列表 closeRightMenu(); diff --git a/apps/web-antd/src/views/mall/promotion/seckill/config/index.vue b/apps/web-antd/src/views/mall/promotion/seckill/config/index.vue index 61dbd8319..dc3738f8e 100644 --- a/apps/web-antd/src/views/mall/promotion/seckill/config/index.vue +++ b/apps/web-antd/src/views/mall/promotion/seckill/config/index.vue @@ -62,9 +62,7 @@ async function handleStatusChange( // 二次确认 const text = row.status === 0 ? '启用' : '停用'; try { - await confirm({ - content: `确认要${text + row.name}吗?`, - }); + await confirm(`确认要${text + row.name}吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/mall/statistics/product/modules/summary-card.vue b/apps/web-antd/src/views/mall/statistics/product/modules/summary-card.vue index b38b4517a..d0aa5aae6 100644 --- a/apps/web-antd/src/views/mall/statistics/product/modules/summary-card.vue +++ b/apps/web-antd/src/views/mall/statistics/product/modules/summary-card.vue @@ -104,9 +104,7 @@ async function loadProductStatisticsList() { async function handleExport() { try { // 导出的二次确认 - await confirm({ - content: '确认导出商品状况数据吗?', - }); + await confirm('确认导出商品状况数据吗?'); // 发起导出 exportLoading.value = true; const data = await exportProductStatisticsExcel({ diff --git a/apps/web-antd/src/views/mall/statistics/trade/modules/trend-card.vue b/apps/web-antd/src/views/mall/statistics/trade/modules/trend-card.vue index 3d300dfca..d93103565 100644 --- a/apps/web-antd/src/views/mall/statistics/trade/modules/trend-card.vue +++ b/apps/web-antd/src/views/mall/statistics/trade/modules/trend-card.vue @@ -107,9 +107,7 @@ async function loadTradeStatisticsList() { async function handleExport() { try { // 导出的二次确认 - await confirm({ - content: '确认导出交易状况数据吗?', - }); + await confirm('确认导出交易状况数据吗?'); // 发起导出 exportLoading.value = true; const data = await exportTradeStatisticsExcel({ diff --git a/apps/web-antd/src/views/mall/trade/brokerage/user/index.vue b/apps/web-antd/src/views/mall/trade/brokerage/user/index.vue index 26682725d..ddd69bf90 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/user/index.vue +++ b/apps/web-antd/src/views/mall/trade/brokerage/user/index.vue @@ -89,9 +89,7 @@ async function handleBrokerageEnabledChange( ): Promise { const text = newEnabled ? '开通' : '关闭'; try { - await confirm({ - content: `你要将${row.nickname}的推广资格切换为【${text}】吗?`, - }); + await confirm(`你要将${row.nickname}的推广资格切换为【${text}】吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/mes/qc/iqc/modules/form.vue b/apps/web-antd/src/views/mes/qc/iqc/modules/form.vue index c02426f04..ad3f767d9 100644 --- a/apps/web-antd/src/views/mes/qc/iqc/modules/form.vue +++ b/apps/web-antd/src/views/mes/qc/iqc/modules/form.vue @@ -106,9 +106,11 @@ async function handleFinish() { if (!valid) { return; } - await confirm({ - content: '是否完成来料检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成来料检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -135,10 +137,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 message.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -167,6 +171,7 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getIqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); @@ -174,6 +179,7 @@ const [Modal, modalApi] = useVbenModal({ } else if (data?.prefill) { // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } // 记录初始快照,后续 finish 用于判断是否需要再保存 diff --git a/apps/web-antd/src/views/mes/qc/oqc/modules/form.vue b/apps/web-antd/src/views/mes/qc/oqc/modules/form.vue index f6e737cce..f9f4efc58 100644 --- a/apps/web-antd/src/views/mes/qc/oqc/modules/form.vue +++ b/apps/web-antd/src/views/mes/qc/oqc/modules/form.vue @@ -100,9 +100,11 @@ async function handleFinish() { if (!valid) { return; } - await confirm({ - content: '是否完成出货检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成出货检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -121,7 +123,6 @@ async function handleFinish() { } } -// TODO @AI:方法内注释; const [Modal, modalApi] = useVbenModal({ async onConfirm() { if (isDetail.value) { @@ -130,10 +131,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 message.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -149,6 +152,7 @@ const [Modal, modalApi] = useVbenModal({ } formApi.setState({ schema: useFormSchema(formApi) }); subTabsName.value = 'line'; + // 加载数据 const data = modalApi.getData<{ formType: FormType; id?: number; @@ -161,12 +165,15 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getOqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); } } else if (data?.prefill) { + // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } originalSnapshot.value = JSON.stringify(await formApi.getValues()); diff --git a/apps/web-antd/src/views/mes/qc/rqc/modules/form.vue b/apps/web-antd/src/views/mes/qc/rqc/modules/form.vue index 2d8efce96..40e27ce12 100644 --- a/apps/web-antd/src/views/mes/qc/rqc/modules/form.vue +++ b/apps/web-antd/src/views/mes/qc/rqc/modules/form.vue @@ -100,10 +100,11 @@ async function handleFinish() { if (!valid) { return; } - // TODO @AI:这种类型,可以简化成 await confirm('');如果可以,写到 style vue 里;然后把相关的类似情况,都一次性改掉; - await confirm({ - content: '是否完成退货检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成退货检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -122,7 +123,6 @@ async function handleFinish() { } } -// TODO @AI:方法内注释; const [Modal, modalApi] = useVbenModal({ async onConfirm() { if (isDetail.value) { @@ -131,10 +131,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 message.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -150,6 +152,7 @@ const [Modal, modalApi] = useVbenModal({ } formApi.setState({ schema: useFormSchema(formApi) }); subTabsName.value = 'line'; + // 加载数据 const data = modalApi.getData<{ formType: FormType; id?: number; @@ -162,12 +165,15 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getRqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); } } else if (data?.prefill) { + // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } originalSnapshot.value = JSON.stringify(await formApi.getValues()); diff --git a/apps/web-antd/src/views/pay/app/index.vue b/apps/web-antd/src/views/pay/app/index.vue index 92fbc6f64..8ae30bc53 100644 --- a/apps/web-antd/src/views/pay/app/index.vue +++ b/apps/web-antd/src/views/pay/app/index.vue @@ -67,9 +67,7 @@ async function handleStatusChange( ): Promise { const text = newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'; try { - await confirm({ - content: `确认要${text + row.name}应用吗?`, - }); + await confirm(`确认要${text + row.name}应用吗?`); } catch { return false; } diff --git a/apps/web-antd/src/views/system/user/index.vue b/apps/web-antd/src/views/system/user/index.vue index 0da0f2d0d..0f00777aa 100644 --- a/apps/web-antd/src/views/system/user/index.vue +++ b/apps/web-antd/src/views/system/user/index.vue @@ -139,9 +139,7 @@ async function handleStatusChange( row: SystemUserApi.User, ): Promise { try { - await confirm({ - content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`, - }); + await confirm(`你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/_core/profile/modules/user-social.vue b/apps/web-ele/src/views/_core/profile/modules/user-social.vue index ada4186d8..e3555b81b 100644 --- a/apps/web-ele/src/views/_core/profile/modules/user-social.vue +++ b/apps/web-ele/src/views/_core/profile/modules/user-social.vue @@ -105,9 +105,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ /** 解绑账号 */ function onUnbind(row: SystemSocialUserApi.SocialUser) { - confirm({ - content: `确定解绑[${getDictLabel(DICT_TYPE.SYSTEM_SOCIAL_TYPE, row.type)}]平台的[${row.openid}]账号吗?`, - }).then(async () => { + confirm(`确定解绑[${getDictLabel(DICT_TYPE.SYSTEM_SOCIAL_TYPE, row.type)}]平台的[${row.openid}]账号吗?`).then(async () => { await socialUnbind({ type: row.type, openid: row.openid }); // 提示成功 ElMessage.success($t('ui.actionMessage.operationSuccess')); diff --git a/apps/web-ele/src/views/ai/image/manager/index.vue b/apps/web-ele/src/views/ai/image/manager/index.vue index 6544bc146..d2936d416 100644 --- a/apps/web-ele/src/views/ai/image/manager/index.vue +++ b/apps/web-ele/src/views/ai/image/manager/index.vue @@ -38,9 +38,7 @@ async function handleUpdatePublicStatusChange( ): Promise { const text = newStatus ? '公开' : '私有'; try { - await confirm({ - content: `确认要将该图片切换为【${text}】吗?`, - }); + await confirm(`确认要将该图片切换为【${text}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/ai/knowledge/document/index.vue b/apps/web-ele/src/views/ai/knowledge/document/index.vue index 2e8ca97c4..1354763fc 100644 --- a/apps/web-ele/src/views/ai/knowledge/document/index.vue +++ b/apps/web-ele/src/views/ai/knowledge/document/index.vue @@ -76,9 +76,7 @@ async function handleStatusChange( row: AiKnowledgeDocumentApi.KnowledgeDocument, ): Promise { try { - await confirm({ - content: `你要将${row.name}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`, - }); + await confirm(`你要将${row.name}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/ai/knowledge/segment/index.vue b/apps/web-ele/src/views/ai/knowledge/segment/index.vue index b74f75542..528c6b66e 100644 --- a/apps/web-ele/src/views/ai/knowledge/segment/index.vue +++ b/apps/web-ele/src/views/ai/knowledge/segment/index.vue @@ -64,9 +64,7 @@ async function handleStatusChange( row: AiKnowledgeSegmentApi.KnowledgeSegment, ): Promise { try { - await confirm({ - content: `你要将片段 ${row.id} 的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`, - }); + await confirm(`你要将片段 ${row.id} 的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/ai/music/manager/index.vue b/apps/web-ele/src/views/ai/music/manager/index.vue index d4d966d40..719681e4d 100644 --- a/apps/web-ele/src/views/ai/music/manager/index.vue +++ b/apps/web-ele/src/views/ai/music/manager/index.vue @@ -38,9 +38,7 @@ async function handleUpdatePublicStatusChange( ): Promise { const text = newStatus ? '公开' : '私有'; try { - await confirm({ - content: `确认要将该音乐切换为【${text}】吗?`, - }); + await confirm(`确认要将该音乐切换为【${text}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/crm/business/components/detail-list.vue b/apps/web-ele/src/views/crm/business/components/detail-list.vue index c89172b11..6b2af7f38 100644 --- a/apps/web-ele/src/views/crm/business/components/detail-list.vue +++ b/apps/web-ele/src/views/crm/business/components/detail-list.vue @@ -75,9 +75,7 @@ async function handleDeleteContactBusinessList() { return; } try { - await confirm({ - content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`, - }); + await confirm(`确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/crm/clue/detail/index.vue b/apps/web-ele/src/views/crm/clue/detail/index.vue index 0d95f5edb..d723deacd 100644 --- a/apps/web-ele/src/views/crm/clue/detail/index.vue +++ b/apps/web-ele/src/views/crm/clue/detail/index.vue @@ -85,9 +85,7 @@ function handleTransfer() { /** 转化为客户 */ async function handleTransform(): Promise { try { - await confirm({ - content: '确定将该线索转化为客户吗?', - }); + await confirm('确定将该线索转化为客户吗?'); } catch { return false; } diff --git a/apps/web-ele/src/views/crm/contact/components/detail-list.vue b/apps/web-ele/src/views/crm/contact/components/detail-list.vue index 71f65066d..f3a5c1b92 100644 --- a/apps/web-ele/src/views/crm/contact/components/detail-list.vue +++ b/apps/web-ele/src/views/crm/contact/components/detail-list.vue @@ -72,9 +72,7 @@ async function handleDeleteContactBusinessList() { return; } try { - await confirm({ - content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`, - }); + await confirm(`确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/crm/customer/detail/index.vue b/apps/web-ele/src/views/crm/customer/detail/index.vue index 594a7c9a0..9b0d05d96 100644 --- a/apps/web-ele/src/views/crm/customer/detail/index.vue +++ b/apps/web-ele/src/views/crm/customer/detail/index.vue @@ -103,9 +103,7 @@ function handleTransfer() { /** 锁定客户 */ async function handleLock(lockStatus: boolean): Promise { try { - await confirm({ - content: `确定锁定客户【${customer.value.name}】吗?`, - }); + await confirm(`确定锁定客户【${customer.value.name}】吗?`); } catch { return false; } @@ -119,9 +117,7 @@ async function handleLock(lockStatus: boolean): Promise { /** 领取客户 */ async function handleReceive(): Promise { try { - await confirm({ - content: `确定领取客户【${customer.value.name}】吗?`, - }); + await confirm(`确定领取客户【${customer.value.name}】吗?`); } catch { return false; } @@ -140,9 +136,7 @@ function handleDistributeForm() { /** 客户放入公海 */ async function handlePutPool(): Promise { try { - await confirm({ - content: `确定将客户【${customer.value.name}】放入公海吗?`, - }); + await confirm(`确定将客户【${customer.value.name}】放入公海吗?`); } catch { return false; } @@ -157,9 +151,7 @@ async function handlePutPool(): Promise { async function handleUpdateDealStatus(): Promise { const dealStatus = !customer.value.dealStatus; try { - await confirm({ - content: `确定更新成交状态为【${dealStatus ? '已成交' : '未成交'}】吗?`, - }); + await confirm(`确定更新成交状态为【${dealStatus ? '已成交' : '未成交'}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/crm/permission/modules/list.vue b/apps/web-ele/src/views/crm/permission/modules/list.vue index 21eec5726..8235e1975 100644 --- a/apps/web-ele/src/views/crm/permission/modules/list.vue +++ b/apps/web-ele/src/views/crm/permission/modules/list.vue @@ -100,9 +100,7 @@ async function handleDelete() { return; } try { - await confirm({ - content: `你要将${checkedRows.value.map((item) => item.nickname).join(',')}移出团队吗?`, - }); + await confirm(`你要将${checkedRows.value.map((item) => item.nickname).join(',')}移出团队吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/erp/finance/account/index.vue b/apps/web-ele/src/views/erp/finance/account/index.vue index 47c1e45a2..73da766da 100644 --- a/apps/web-ele/src/views/erp/finance/account/index.vue +++ b/apps/web-ele/src/views/erp/finance/account/index.vue @@ -66,9 +66,7 @@ async function handleDefaultStatusChange( ): Promise { const text = newStatus ? '设置' : '取消'; try { - await confirm({ - content: `确认要${text}"${row.name}"默认吗?`, - }); + await confirm(`确认要${text}"${row.name}"默认吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/erp/stock/warehouse/index.vue b/apps/web-ele/src/views/erp/stock/warehouse/index.vue index 5373fc1f2..965beaa0c 100644 --- a/apps/web-ele/src/views/erp/stock/warehouse/index.vue +++ b/apps/web-ele/src/views/erp/stock/warehouse/index.vue @@ -64,9 +64,7 @@ async function handleDefaultStatusChange( ): Promise { const text = newStatus ? '设置' : '取消'; try { - await confirm({ - content: `确认要${text}"${row.name}"默认吗?`, - }); + await confirm(`确认要${text}"${row.name}"默认吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/infra/apiErrorLog/index.vue b/apps/web-ele/src/views/infra/apiErrorLog/index.vue index 964217c5d..de0b677f8 100644 --- a/apps/web-ele/src/views/infra/apiErrorLog/index.vue +++ b/apps/web-ele/src/views/infra/apiErrorLog/index.vue @@ -42,9 +42,7 @@ function handleDetail(row: InfraApiErrorLogApi.ApiErrorLog) { /** 处理已处理 / 已忽略的操作 */ async function handleProcess(id: number, processStatus: number) { - await confirm({ - content: `确认标记为${InfraApiErrorLogProcessStatusEnum.DONE ? '已处理' : '已忽略'}?`, - }); + await confirm(`确认标记为${InfraApiErrorLogProcessStatusEnum.DONE ? '已处理' : '已忽略'}?`); const loadingInstance = ElLoading.service({ text: '正在处理中...', }); diff --git a/apps/web-ele/src/views/iot/device/device/detail/modules/modbus-config.vue b/apps/web-ele/src/views/iot/device/device/detail/modules/modbus-config.vue index 64699dbbe..22709fe0c 100644 --- a/apps/web-ele/src/views/iot/device/device/detail/modules/modbus-config.vue +++ b/apps/web-ele/src/views/iot/device/device/detail/modules/modbus-config.vue @@ -285,7 +285,7 @@ function handleEditPoint(row: IotDeviceModbusPointApi.ModbusPoint) { /** 删除点位 */ async function handleDeletePoint(row: IotDeviceModbusPointApi.ModbusPoint) { - await confirm({ content: `确定要删除点位【${row.name}】吗?` }); + await confirm(`确定要删除点位【${row.name}】吗?`); await deleteModbusPoint(row.id!); ElMessage.success('删除成功'); await gridApi.query(); diff --git a/apps/web-ele/src/views/iot/device/device/detail/modules/sub-device.vue b/apps/web-ele/src/views/iot/device/device/detail/modules/sub-device.vue index 8a5c32479..918440410 100644 --- a/apps/web-ele/src/views/iot/device/device/detail/modules/sub-device.vue +++ b/apps/web-ele/src/views/iot/device/device/detail/modules/sub-device.vue @@ -126,7 +126,7 @@ function handleRowCheckboxChange({ /** 解绑单个设备 */ async function handleUnbind(row: IotDeviceApi.Device) { - await confirm({ content: `确定要解绑子设备【${row.deviceName}】吗?` }); + await confirm(`确定要解绑子设备【${row.deviceName}】吗?`); const loadingInstance = ElLoading.service({ text: `正在解绑【${row.deviceName}】...`, }); @@ -141,9 +141,7 @@ async function handleUnbind(row: IotDeviceApi.Device) { /** 批量解绑 */ async function handleUnbindBatch() { - await confirm({ - content: `确定要解绑选中的 ${checkedIds.value.length} 个子设备吗?`, - }); + await confirm(`确定要解绑选中的 ${checkedIds.value.length} 个子设备吗?`); const loadingInstance = ElLoading.service({ text: '正在批量解绑...', }); diff --git a/apps/web-ele/src/views/mall/product/comment/index.vue b/apps/web-ele/src/views/mall/product/comment/index.vue index ea8baced0..b8b261ca9 100644 --- a/apps/web-ele/src/views/mall/product/comment/index.vue +++ b/apps/web-ele/src/views/mall/product/comment/index.vue @@ -64,9 +64,7 @@ async function handleStatusChange( ): Promise { const text = newStatus ? '展示' : '隐藏'; try { - await confirm({ - content: `确认要${text}该评论吗?`, - }); + await confirm(`确认要${text}该评论吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/mall/product/spu/index.vue b/apps/web-ele/src/views/mall/product/spu/index.vue index 9d436759c..d9fe81cbf 100644 --- a/apps/web-ele/src/views/mall/product/spu/index.vue +++ b/apps/web-ele/src/views/mall/product/spu/index.vue @@ -109,9 +109,7 @@ async function handleStatusChange( // 二次确认 const text = newStatus ? '上架' : '下架'; try { - await confirm({ - content: `确认要${text + row.name}吗?`, - }); + await confirm(`确认要${text + row.name}吗?`); } catch { return false; } @@ -131,9 +129,7 @@ async function handleStatus02Change(row: MallSpuApi.Spu, newStatus: number) { newStatus === ProductSpuStatusEnum.RECYCLE.status ? '加入到回收站' : '恢复到仓库'; - await confirm({ - content: `确认要"${row.name}"${text}吗?`, - }); + await confirm(`确认要"${row.name}"${text}吗?`); const loadingInstance = ElLoading.service({ text: `正在${text}中...`, }); diff --git a/apps/web-ele/src/views/mall/promotion/coupon/template/index.vue b/apps/web-ele/src/views/mall/promotion/coupon/template/index.vue index dcda02261..90719c484 100644 --- a/apps/web-ele/src/views/mall/promotion/coupon/template/index.vue +++ b/apps/web-ele/src/views/mall/promotion/coupon/template/index.vue @@ -60,9 +60,7 @@ async function handleStatusChange( row: MallCouponTemplateApi.CouponTemplate, ): Promise { try { - await confirm({ - content: `你要将${row.name}的状态切换为【${newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'}】吗?`, - }); + await confirm(`你要将${row.name}的状态切换为【${newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/mall/promotion/kefu/modules/conversation-list.vue b/apps/web-ele/src/views/mall/promotion/kefu/modules/conversation-list.vue index 9f22f84b6..ca38ca6bf 100644 --- a/apps/web-ele/src/views/mall/promotion/kefu/modules/conversation-list.vue +++ b/apps/web-ele/src/views/mall/promotion/kefu/modules/conversation-list.vue @@ -125,9 +125,7 @@ async function updateConversationPinnedFn(pinned: boolean) { /** 删除会话 */ async function deleteConversationFn() { // 1. 删除会话 - confirm({ - content: '您确定要删除该会话吗?', - }).then(async () => { + confirm('您确定要删除该会话吗?').then(async () => { await deleteConversation(rightClickConversation.value.id); // 2. 关闭右键菜单,更新会话列表 closeRightMenu(); diff --git a/apps/web-ele/src/views/mall/promotion/seckill/config/index.vue b/apps/web-ele/src/views/mall/promotion/seckill/config/index.vue index 068bf5209..4dc206dd7 100644 --- a/apps/web-ele/src/views/mall/promotion/seckill/config/index.vue +++ b/apps/web-ele/src/views/mall/promotion/seckill/config/index.vue @@ -59,9 +59,7 @@ async function handleStatusChange( // 二次确认 const text = row.status === 0 ? '启用' : '停用'; try { - await confirm({ - content: `确认要${text + row.name}吗?`, - }); + await confirm(`确认要${text + row.name}吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/mall/statistics/product/modules/summary-card.vue b/apps/web-ele/src/views/mall/statistics/product/modules/summary-card.vue index 5d6b9bffe..18584cca4 100644 --- a/apps/web-ele/src/views/mall/statistics/product/modules/summary-card.vue +++ b/apps/web-ele/src/views/mall/statistics/product/modules/summary-card.vue @@ -104,9 +104,7 @@ async function loadProductStatisticsList() { async function handleExport() { try { // 导出的二次确认 - await confirm({ - content: '确认导出商品状况数据吗?', - }); + await confirm('确认导出商品状况数据吗?'); // 发起导出 exportLoading.value = true; const data = await exportProductStatisticsExcel({ diff --git a/apps/web-ele/src/views/mall/statistics/trade/modules/trend-card.vue b/apps/web-ele/src/views/mall/statistics/trade/modules/trend-card.vue index 8dd3f2759..40f928430 100644 --- a/apps/web-ele/src/views/mall/statistics/trade/modules/trend-card.vue +++ b/apps/web-ele/src/views/mall/statistics/trade/modules/trend-card.vue @@ -107,9 +107,7 @@ async function loadTradeStatisticsList() { async function handleExport() { try { // 导出的二次确认 - await confirm({ - content: '确认导出交易状况数据吗?', - }); + await confirm('确认导出交易状况数据吗?'); // 发起导出 exportLoading.value = true; const data = await exportTradeStatisticsExcel({ diff --git a/apps/web-ele/src/views/mall/trade/brokerage/user/index.vue b/apps/web-ele/src/views/mall/trade/brokerage/user/index.vue index a8ad43da0..1a90b9302 100644 --- a/apps/web-ele/src/views/mall/trade/brokerage/user/index.vue +++ b/apps/web-ele/src/views/mall/trade/brokerage/user/index.vue @@ -88,9 +88,7 @@ async function handleBrokerageEnabledChange( ): Promise { const text = newEnabled ? '开通' : '关闭'; try { - await confirm({ - content: `你要将${row.nickname}的推广资格切换为【${text}】吗?`, - }); + await confirm(`你要将${row.nickname}的推广资格切换为【${text}】吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/mes/qc/ipqc/modules/form.vue b/apps/web-ele/src/views/mes/qc/ipqc/modules/form.vue index 9180f1662..7cfcafc38 100644 --- a/apps/web-ele/src/views/mes/qc/ipqc/modules/form.vue +++ b/apps/web-ele/src/views/mes/qc/ipqc/modules/form.vue @@ -107,9 +107,11 @@ async function handleFinish() { if (!valid) { return; } - await confirm({ - content: '是否完成过程检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成过程检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -136,10 +138,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 ElMessage.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -155,6 +159,7 @@ const [Modal, modalApi] = useVbenModal({ } formApi.setState({ schema: useFormSchema(formApi) }); subTabsName.value = 'line'; + // 加载数据 const data = modalApi.getData<{ formType: FormType; id?: number; @@ -167,12 +172,15 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getIpqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); } } else if (data?.prefill) { + // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } originalSnapshot.value = JSON.stringify(await formApi.getValues()); diff --git a/apps/web-ele/src/views/mes/qc/iqc/modules/form.vue b/apps/web-ele/src/views/mes/qc/iqc/modules/form.vue index 74817b7d6..fdb4dcd8c 100644 --- a/apps/web-ele/src/views/mes/qc/iqc/modules/form.vue +++ b/apps/web-ele/src/views/mes/qc/iqc/modules/form.vue @@ -108,9 +108,11 @@ async function handleFinish() { if (!valid) { return; } - await confirm({ - content: '是否完成来料检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成来料检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -137,10 +139,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 ElMessage.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -169,6 +173,7 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getIqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); @@ -176,6 +181,7 @@ const [Modal, modalApi] = useVbenModal({ } else if (data?.prefill) { // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } // 记录初始快照,后续 finish 用于判断是否需要再保存 diff --git a/apps/web-ele/src/views/mes/qc/oqc/modules/form.vue b/apps/web-ele/src/views/mes/qc/oqc/modules/form.vue index 88d95e6ab..c7067df71 100644 --- a/apps/web-ele/src/views/mes/qc/oqc/modules/form.vue +++ b/apps/web-ele/src/views/mes/qc/oqc/modules/form.vue @@ -107,9 +107,11 @@ async function handleFinish() { if (!valid) { return; } - await confirm({ - content: '是否完成出货检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成出货检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -136,10 +138,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 ElMessage.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -155,6 +159,7 @@ const [Modal, modalApi] = useVbenModal({ } formApi.setState({ schema: useFormSchema(formApi) }); subTabsName.value = 'line'; + // 加载数据 const data = modalApi.getData<{ formType: FormType; id?: number; @@ -167,12 +172,15 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getOqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); } } else if (data?.prefill) { + // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } originalSnapshot.value = JSON.stringify(await formApi.getValues()); diff --git a/apps/web-ele/src/views/mes/qc/rqc/modules/form.vue b/apps/web-ele/src/views/mes/qc/rqc/modules/form.vue index bb2e7d6a2..6ff22a90d 100644 --- a/apps/web-ele/src/views/mes/qc/rqc/modules/form.vue +++ b/apps/web-ele/src/views/mes/qc/rqc/modules/form.vue @@ -107,9 +107,11 @@ async function handleFinish() { if (!valid) { return; } - await confirm({ - content: '是否完成退货检验单编制?【完成后将不能更改】', - }); + try { + await confirm('是否完成退货检验单编制?【完成后将不能更改】'); + } catch { + return; + } modalApi.lock(); try { const current = JSON.stringify(await formApi.getValues()); @@ -136,10 +138,12 @@ const [Modal, modalApi] = useVbenModal({ } modalApi.lock(); try { + // 提交表单 const ok = await handleSubmit(); if (!ok) { return; } + // 关闭并提示 ElMessage.success($t('ui.actionMessage.operationSuccess')); await modalApi.close(); emit('success'); @@ -155,6 +159,7 @@ const [Modal, modalApi] = useVbenModal({ } formApi.setState({ schema: useFormSchema(formApi) }); subTabsName.value = 'line'; + // 加载数据 const data = modalApi.getData<{ formType: FormType; id?: number; @@ -167,12 +172,15 @@ const [Modal, modalApi] = useVbenModal({ modalApi.lock(); try { formData.value = await getRqc(data.id); + // 设置到 values await formApi.setValues(formData.value); } finally { modalApi.unlock(); } } else if (data?.prefill) { + // 预填模式:来自待检任务 formData.value = { ...data.prefill }; + // 设置到 values await formApi.setValues(data.prefill); } originalSnapshot.value = JSON.stringify(await formApi.getValues()); diff --git a/apps/web-ele/src/views/pay/app/index.vue b/apps/web-ele/src/views/pay/app/index.vue index c538e16bd..2f291e463 100644 --- a/apps/web-ele/src/views/pay/app/index.vue +++ b/apps/web-ele/src/views/pay/app/index.vue @@ -66,9 +66,7 @@ async function handleStatusChange( ): Promise { const text = newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'; try { - await confirm({ - content: `确认要${text + row.name}应用吗?`, - }); + await confirm(`确认要${text + row.name}应用吗?`); } catch { return false; } diff --git a/apps/web-ele/src/views/system/user/index.vue b/apps/web-ele/src/views/system/user/index.vue index 2c0ebcbb6..cc22c1a6f 100644 --- a/apps/web-ele/src/views/system/user/index.vue +++ b/apps/web-ele/src/views/system/user/index.vue @@ -137,9 +137,7 @@ async function handleStatusChange( row: SystemUserApi.User, ): Promise { try { - await confirm({ - content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`, - }); + await confirm(`你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`); } catch { return false; }