From 20f9a8a49704808c8fbd69a67883e90d18a57a85 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Fri, 16 Jan 2026 10:45:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(tenant):=20=E4=BF=AE=E5=A4=8D=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E4=B8=AD=E6=97=A5=E6=9C=9F=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=BD=AC=E6=8D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将DatePicker绑定值从string改为Dayjs类型,并在提交时转换为string格式 使用window.modal代替Modal直接调用,移除冗余的iconType配置 --- apps/web-antd/src/views/dashboard/analytics/change.md | 1 + apps/web-antd/src/views/system/tenant/index.vue | 6 ++---- apps/web-antd/src/views/system/tenant/tenant-drawer.vue | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/views/dashboard/analytics/change.md b/apps/web-antd/src/views/dashboard/analytics/change.md index b0afe4ed..fedd529c 100644 --- a/apps/web-antd/src/views/dashboard/analytics/change.md +++ b/apps/web-antd/src/views/dashboard/analytics/change.md @@ -10,6 +10,7 @@ - 支持颜色与变体 需要绿色按钮?不用再写css了[Button 组件](https://ant.design/components/button-cn#button-demo-color-variant) - 支持颜色选择器[ColorPicker 组件](https://ant.design/components/color-picker-cn) 这个也是从antd5就开始有了 vue一直没有 - 一些xxxItem组件 如`DescriotionsItem` `MenuItem` `TimeLineItem` 已经移除 使用对应父组件的`items`属性代替 +- DatePicker等必须绑定为`Dayjs`类型 不再支持`string`格式的绑定 相应需要提交自己转为string提交 ## 框架级别的变化 diff --git a/apps/web-antd/src/views/system/tenant/index.vue b/apps/web-antd/src/views/system/tenant/index.vue index 2114789a..8ae70e25 100644 --- a/apps/web-antd/src/views/system/tenant/index.vue +++ b/apps/web-antd/src/views/system/tenant/index.vue @@ -134,9 +134,8 @@ const isSuperAdmin = computed(() => { }); function handleSyncTenantDict() { - Modal.confirm({ + window.modal.confirm({ title: '提示', - iconType: 'warning', content: '确认同步租户字典?', onOk: async () => { await dictSyncTenant(); @@ -146,9 +145,8 @@ function handleSyncTenantDict() { } function handleSyncTenantConfig() { - Modal.confirm({ + window.modal.confirm({ title: '提示', - iconType: 'warning', content: '确认同步租户参数配置?', onOk: async () => { await syncTenantConfig(); diff --git a/apps/web-antd/src/views/system/tenant/tenant-drawer.vue b/apps/web-antd/src/views/system/tenant/tenant-drawer.vue index f63ed4d9..09e66fc5 100644 --- a/apps/web-antd/src/views/system/tenant/tenant-drawer.vue +++ b/apps/web-antd/src/views/system/tenant/tenant-drawer.vue @@ -7,6 +7,7 @@ import { $t } from '@vben/locales'; import { cloneDeep } from '@vben/utils'; import { Button, Skeleton } from 'antdv-next'; +import dayjs from 'dayjs'; import { useVbenForm } from '#/adapter/form'; import { tenantAdd, tenantInfo, tenantUpdate } from '#/api/system/tenant'; @@ -136,6 +137,10 @@ async function handleConfirm() { return; } const data = cloneDeep(await formApi.getValues()); + // dayjs转string + if (data.expireTime) { + data.expireTime = dayjs(data.expireTime).format('YYYY-MM-DD HH:mm:ss'); + } await (isUpdate.value ? tenantUpdate(data) : tenantAdd(data)); resetInitialized(); emit('reload');