From adcdf4f03e73d5b053fd12f65333eafc2e95e424 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Sat, 30 Nov 2024 01:26:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BF=AE=E5=A4=8D=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E7=AD=9B=E9=80=89=E7=BB=84=E4=BB=B6=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98=E5=92=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4banner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/role.ts | 4 ++-- src/components/cu-date-query/index.vue | 13 +++++++++++++ src/pages/index/index.vue | 10 ++-------- src/pages/login/index.vue | 21 ++++++--------------- src/pages/work/index.vue | 2 +- src/pages/work/log/index.vue | 3 ++- src/pages/work/role/index.vue | 5 ++--- src/pages/work/user/index.vue | 5 ++++- 8 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/api/system/role.ts b/src/api/system/role.ts index d375936..c0dca59 100644 --- a/src/api/system/role.ts +++ b/src/api/system/role.ts @@ -108,7 +108,7 @@ export interface RolePageVO { /** 角色编码 */ code?: string; /** 角色ID */ - id?: number; + id: number; /** 角色名称 */ name?: string; /** 排序 */ @@ -132,7 +132,7 @@ export interface RoleForm { /** 角色名称 */ name?: string; /** 排序 */ - sort?: number; + sort: number; /** 角色状态(1-正常;0-停用) */ status?: number; } diff --git a/src/components/cu-date-query/index.vue b/src/components/cu-date-query/index.vue index 330d722..8f94561 100644 --- a/src/components/cu-date-query/index.vue +++ b/src/components/cu-date-query/index.vue @@ -35,6 +35,19 @@ watch( (val) => { if (Array.isArray(val) && val.length === 2 && val[0] && val[1]) { dateRange.value = val.map((item) => new Date(item).getTime()); + } else if (typeof val === "string" && val.includes(",")) { + const [startDate, endDate] = val.split(","); + + if ( + startDate && + endDate && + !isNaN(new Date(startDate).getTime()) && + !isNaN(new Date(endDate).getTime()) + ) { + dateRange.value = [new Date(startDate).getTime(), new Date(endDate).getTime()]; + } else { + dateRange.value = null; + } } else { dateRange.value = null; } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ff257ff..5806204 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,6 +1,6 @@