From c952123dc401b7d480dddeecc8cdad56ca4cf6c3 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期六, 22 八月 2026 17:16:03 +0800
Subject: [PATCH] refactor(collaborativeApproval): 统一日期格式化展示
---
src/views/collaborativeApproval/knowledgeBase/index.vue | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/views/collaborativeApproval/knowledgeBase/index.vue b/src/views/collaborativeApproval/knowledgeBase/index.vue
index 0c31e24..b0c50fb 100644
--- a/src/views/collaborativeApproval/knowledgeBase/index.vue
+++ b/src/views/collaborativeApproval/knowledgeBase/index.vue
@@ -296,7 +296,7 @@
<span v-else style="color: #909399">-</span>
</template>
</el-table-column>
- <el-table-column prop="createTime" label="涓婁紶鏃堕棿" width="180" />
+ <el-table-column prop="createTime" label="涓婁紶鏃堕棿" width="120" :formatter="formatDate" />
<el-table-column label="鎿嶄綔" width="150" align="center">
<template #default="{ row }">
<el-button
@@ -386,6 +386,10 @@
import useUserStore from '@/store/modules/user';
import { userListNoPageByTenantId } from '@/api/system/user.js';
import { getToken } from "@/utils/auth";
+import { parseDate } from "@/utils/ruoyi";
+
+// 鏃ユ湡鍥炴樉鏍煎紡鍖栵紙YYYY-MM-DD锛�
+const formatDate = (row, column, cellValue) => parseDate(cellValue) || '-';
// 琛ㄥ崟楠岃瘉瑙勫垯
const rules = {
@@ -555,6 +559,7 @@
label: "鍒涘缓鏃堕棿",
prop: "createTime",
width: 180,
+ dataType:"date"
},
{
dataType: "action",
@@ -1142,11 +1147,24 @@
// ============ 鐭ヨ瘑搴撻棶绛旂浉鍏� ============
+// 鐢熸垚UUID鐨刦allback鏂规
+const generateUUID = () => {
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
+ return crypto.randomUUID();
+ }
+ // fallback: 鍏煎涓嶆敮鎸� crypto.randomUUID 鐨勭幆澧�
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+ const r = Math.random() * 16 | 0;
+ const v = c === 'x' ? r : (r & 0x3 | 0x8);
+ return v.toString(16);
+ });
+};
+
// 鎵撳紑闂瓟寮圭獥
const openChatDialog = (row) => {
currentKnowledgeBase.value = row;
chatDialogVisible.value = true;
- memoryId.value = crypto.randomUUID();
+ memoryId.value = generateUUID();
messages.value = [];
inputQuestion.value = "";
};
@@ -1240,7 +1258,7 @@
}
).then(() => {
messages.value = [];
- memoryId.value = crypto.randomUUID(); // 閲嶆柊鐢熸垚浼氳瘽ID
+ memoryId.value = generateUUID(); // 閲嶆柊鐢熸垚浼氳瘽ID
ElMessage.success("瀵硅瘽宸叉竻绌�");
}).catch(() => {
// 鐢ㄦ埛鍙栨秷
--
Gitblit v1.9.3