From cb1dbb52b42fda06ca5a11be2adebe7d85b87948 Mon Sep 17 00:00:00 2001 From: czl231 <3286836406@qq.com> Date: Mon, 10 Aug 2026 20:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A1=E6=A0=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=BC=B9=E7=AA=97=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/shared/CrudListPage.vue | 15 +++++++++++++-- .../gas_admin/src/views/shared/CrudListPage.vue | 15 +++++++++++++-- .../src/views/shared/CrudListPage.vue | 15 +++++++++++++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/frontend/delivery_admin/src/views/shared/CrudListPage.vue b/frontend/delivery_admin/src/views/shared/CrudListPage.vue index 129b08c..49aa9a4 100644 --- a/frontend/delivery_admin/src/views/shared/CrudListPage.vue +++ b/frontend/delivery_admin/src/views/shared/CrudListPage.vue @@ -841,6 +841,14 @@ async function submitDetailAction() { Message.warning('请填写必填字段'); return; } + // 审核状态未变化时不重复请求,避免产生无意义的状态更新和审计记录。 + if ( + action.resource.endsWith('/:identity/status') && + Number(actionForm.status) === Number(detail.value.status) + ) { + Message.warning('审核状态未发生变化'); + return; + } await executeDetailAction(action); } @@ -909,9 +917,9 @@ async function save() { } } -function openStatus(row: Row) { +async function openStatus(row: Row) { detail.value = row; - openDetailAction({ + await openDetailAction({ name: '审核状态', resource: `${props.definition.resource}/:identity/status`, method: 'PATCH', @@ -928,6 +936,9 @@ function openStatus(row: Row) { }, ], }); + // 仅回显下拉框支持的审核状态;待审核等状态仍由审核人主动选择。 + const currentStatus = Number(row.status); + actionForm.status = [1, 2].includes(currentStatus) ? currentStatus : undefined; } function confirmArchive(row: Row) { diff --git a/frontend/gas_admin/src/views/shared/CrudListPage.vue b/frontend/gas_admin/src/views/shared/CrudListPage.vue index 129b08c..49aa9a4 100644 --- a/frontend/gas_admin/src/views/shared/CrudListPage.vue +++ b/frontend/gas_admin/src/views/shared/CrudListPage.vue @@ -841,6 +841,14 @@ async function submitDetailAction() { Message.warning('请填写必填字段'); return; } + // 审核状态未变化时不重复请求,避免产生无意义的状态更新和审计记录。 + if ( + action.resource.endsWith('/:identity/status') && + Number(actionForm.status) === Number(detail.value.status) + ) { + Message.warning('审核状态未发生变化'); + return; + } await executeDetailAction(action); } @@ -909,9 +917,9 @@ async function save() { } } -function openStatus(row: Row) { +async function openStatus(row: Row) { detail.value = row; - openDetailAction({ + await openDetailAction({ name: '审核状态', resource: `${props.definition.resource}/:identity/status`, method: 'PATCH', @@ -928,6 +936,9 @@ function openStatus(row: Row) { }, ], }); + // 仅回显下拉框支持的审核状态;待审核等状态仍由审核人主动选择。 + const currentStatus = Number(row.status); + actionForm.status = [1, 2].includes(currentStatus) ? currentStatus : undefined; } function confirmArchive(row: Row) { diff --git a/frontend/platform_admin/src/views/shared/CrudListPage.vue b/frontend/platform_admin/src/views/shared/CrudListPage.vue index 7ae4389..9fd9a38 100644 --- a/frontend/platform_admin/src/views/shared/CrudListPage.vue +++ b/frontend/platform_admin/src/views/shared/CrudListPage.vue @@ -898,6 +898,14 @@ async function submitDetailAction() { Message.warning('请填写必填字段'); return; } + // 审核状态未变化时不重复请求,避免产生无意义的状态更新和审计记录。 + if ( + action.resource.endsWith('/:identity/status') && + Number(actionForm.status) === Number(detail.value.status) + ) { + Message.warning('审核状态未发生变化'); + return; + } if (hasInvalidPassword(action.fields ?? [], actionForm)) { Message.warning(ACCOUNT_PASSWORD_LENGTH_MESSAGE); return; @@ -974,9 +982,9 @@ async function save() { } } -function openStatus(row: Row) { +async function openStatus(row: Row) { detail.value = row; - openDetailAction({ + await openDetailAction({ name: '审核状态', resource: `${props.definition.resource}/:identity/status`, method: 'PATCH', @@ -993,6 +1001,9 @@ function openStatus(row: Row) { }, ], }); + // 仅回显下拉框支持的审核状态;待审核等状态仍由审核人主动选择。 + const currentStatus = Number(row.status); + actionForm.status = [1, 2].includes(currentStatus) ? currentStatus : undefined; } function confirmArchive(row: Row) {