From 91ce6a597d7e18b9bee24c131843d4f91b1b9fa3 Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Mon, 1 Dec 2025 16:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/customerService/account/index.ts | 4 +- src/api/customerService/product/index.ts | 11 +- src/api/customerService/report/index.ts | 4 +- src/api/customerService/script/index.ts | 2 +- src/components/editor/index.vue | 105 +++++++--- .../{editRole.vue => editAccount.vue} | 0 src/views/customerService/account/index.vue | 189 ++++++++++++------ .../product/component/editRole.vue | 38 ++-- src/views/customerService/product/index.vue | 65 +++++- src/views/customerService/report/index.vue | 69 +++++-- .../script/component/editRole.vue | 109 ++++------ src/views/customerService/script/index.vue | 31 +-- 12 files changed, 402 insertions(+), 225 deletions(-) rename src/views/customerService/account/component/{editRole.vue => editAccount.vue} (100%) diff --git a/src/api/customerService/account/index.ts b/src/api/customerService/account/index.ts index 2746012..76b41d9 100644 --- a/src/api/customerService/account/index.ts +++ b/src/api/customerService/account/index.ts @@ -5,7 +5,7 @@ export function getaccountList(data: object) { return newService({ url: '/customerService/customer/service/account/list', method: 'get', - data: data, + params: data, }); } @@ -21,7 +21,7 @@ export function getaccountAdd(data: object) { //禁用账号 export function updatestate(data: object) { return newService({ - url: '/customerService/customer/service/account/delete', + url: '/customerService/customer/service/account/toggleStatus', method: 'post', data: data, }); diff --git a/src/api/customerService/product/index.ts b/src/api/customerService/product/index.ts index c3abe24..7fd10dc 100644 --- a/src/api/customerService/product/index.ts +++ b/src/api/customerService/product/index.ts @@ -23,16 +23,7 @@ export function getList(data: object) { return newService({ url: '/customerService/product/list', method: 'get', - data: data, - }); -} - -//获取产品详情 -export function getproductOne(data: object) { - return newService({ - url: '/customerService/product/one', - method: 'post', - data: data, + params: data, }); } diff --git a/src/api/customerService/report/index.ts b/src/api/customerService/report/index.ts index 0eac38b..43ce7ad 100644 --- a/src/api/customerService/report/index.ts +++ b/src/api/customerService/report/index.ts @@ -3,8 +3,8 @@ import request, { newService } from '/@/utils/request'; //获取数据列表 export function getDataList(data: object) { return newService({ - url: '/customerService/data/list', + url: '/customerService/data/statistics/list', method: 'get', - data: data, + params: data, }); } diff --git a/src/api/customerService/script/index.ts b/src/api/customerService/script/index.ts index 333834b..f4a5ebc 100644 --- a/src/api/customerService/script/index.ts +++ b/src/api/customerService/script/index.ts @@ -5,7 +5,7 @@ export function getscriptList(data: object) { return newService({ url: '/customerService/speechcraft/list', method: 'get', - data: data, + params: data, }); } diff --git a/src/components/editor/index.vue b/src/components/editor/index.vue index 78e5726..d9d0f32 100644 --- a/src/components/editor/index.vue +++ b/src/components/editor/index.vue @@ -6,7 +6,7 @@ - - diff --git a/src/views/customerService/script/index.vue b/src/views/customerService/script/index.vue index 67a27f1..e8fb9e2 100644 --- a/src/views/customerService/script/index.vue +++ b/src/views/customerService/script/index.vue @@ -106,24 +106,31 @@ const tableData = reactive({ * @param time 时间字符串或时间戳 * @returns 格式化后的时间字符串 */ -const formatTime = (time: string | number): string => { +const formatTime = (time: string | number | Date): string => { if (!time) return '-'; try { - // 如果是时间戳格式 - let timestamp = typeof time === 'string' ? parseInt(time) : time; + let date: Date; - // 如果是毫秒时间戳,需要判断是否需要转换 - if (timestamp > 1000000000000) { - // 已经是毫秒时间戳 - } else if (timestamp > 1000000000) { - // 秒时间戳,转换为毫秒 - timestamp = timestamp * 1000; + if (time instanceof Date) { + date = time; + } else if (typeof time === 'string') { + // 直接使用字符串创建Date对象,ISO格式会自动识别 + date = new Date(time); + } else { + // 处理时间戳 + let timestamp = time; + if (timestamp > 1000000000000) { + // 已经是毫秒时间戳 + } else if (timestamp > 1000000000) { + // 秒时间戳,转换为毫秒 + timestamp = timestamp * 1000; + } + date = new Date(timestamp); } - const date = new Date(timestamp); if (isNaN(date.getTime())) { - return String(time); // 返回原始值 + return String(time); } const year = date.getFullYear(); @@ -136,7 +143,7 @@ const formatTime = (time: string | number): string => { return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; } catch (error) { console.error('时间格式化错误:', error); - return String(time); // 返回原始值 + return String(time); } };