From e5bbaf5f9a8840ce00eb3dfa3f4939f68300b4d4 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Fri, 16 Jan 2026 09:36:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86):=20=E4=BC=98=E5=8C=96=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加默认客户端ID常量 - 重构密钥输入组件使用SpaceCompact布局 - 替换TableSwitch为ApiSwitch并优化状态切换逻辑 --- .../src/views/system/client/index.vue | 20 +++++++++++---- .../src/views/system/client/secret-input.vue | 25 +++++++++++-------- packages/constants/src/core.ts | 5 ++++ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/apps/web-antd/src/views/system/client/index.vue b/apps/web-antd/src/views/system/client/index.vue index 90dcf3d1..7e3f0c52 100644 --- a/apps/web-antd/src/views/system/client/index.vue +++ b/apps/web-antd/src/views/system/client/index.vue @@ -6,6 +6,7 @@ import type { Client } from '#/api/system/client/model'; import { useAccess } from '@vben/access'; import { Page, useVbenDrawer } from '@vben/common-ui'; +import { DEFAULT_CLIENT_ID, EnableStatus } from '@vben/constants'; import { Modal, Popconfirm, Space } from 'antdv-next'; @@ -16,7 +17,7 @@ import { clientList, clientRemove, } from '#/api/system/client'; -import { TableSwitch } from '#/components/table'; +import { ApiSwitch } from '#/components/global'; import { commonDownloadExcel } from '#/utils/file/download'; import clientDrawer from './client-drawer.vue'; @@ -108,6 +109,12 @@ function handleDownloadExcel() { } const { hasAccessByCodes } = useAccess(); +async function handleChangeStatus(checked: boolean, row: Client) { + await clientChangeStatus({ + clientId: row.id, + status: checked ? EnableStatus.Enable : EnableStatus.Disable, + }); +}