From abd56663ec5395143e1509dab84e9379ee0ca36d Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期六, 15 八月 2026 17:47:19 +0800
Subject: [PATCH] fix: 日期格式化

---
 src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue |   79 +++++++++++++++++++++++++++------------
 1 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue b/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
index d094c13..d2566fd 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
@@ -270,9 +270,7 @@
 
         <el-descriptions-item label="鍒涘缓浜�">{{ detailRow.createdUserName || "鈥�" }}</el-descriptions-item>
 
-        <el-descriptions-item label="鍒涘缓鏃堕棿">{{ formatDisplayTime(detailRow.createdTime) }}</el-descriptions-item>
-
-        <el-descriptions-item label="鏇存柊鏃堕棿">{{ formatDisplayTime(detailRow.updatedTime) }}</el-descriptions-item>
+        <el-descriptions-item label="鍒涘缓鏃堕棿">{{ formatDisplayDate(detailRow.createdTime) }}</el-descriptions-item>
 
       </el-descriptions>
 
@@ -380,23 +378,18 @@
 
       <template v-if="detailAttachments.length">
 
-        <el-tag
-
-          v-for="(f, i) in detailAttachments"
-
-          :key="i"
-
-          class="detail-attachment-tag"
-
-          type="info"
-
-          effect="plain"
-
-        >
-
-          {{ attachmentDisplayName(f) }}
-
-        </el-tag>
+        <div class="detail-attachment-list">
+          <div
+            v-for="(f, i) in detailAttachments"
+            :key="i"
+            class="detail-attachment-item"
+            @click="openAttachmentFile(f)"
+          >
+            <el-icon class="attachment-icon"><Document /></el-icon>
+            <span class="attachment-name">{{ attachmentDisplayName(f) }}</span>
+            <el-icon class="attachment-download"><Download /></el-icon>
+          </div>
+        </div>
 
       </template>
 
@@ -422,7 +415,7 @@
 
 <script setup>
 
-import { ArrowRight, Plus, RefreshRight } from "@element-plus/icons-vue";
+import { ArrowRight, Document, Download, Plus, RefreshRight } from "@element-plus/icons-vue";
 
 import { ElMessage } from "element-plus";
 
@@ -436,7 +429,7 @@
 
 import TemplateFlowEditor from "./components/TemplateFlowEditor.vue";
 
-import { formatDisplayTime, mapAttachmentsFromApi } from "./approveTemplateConstants.js";
+import { formatDisplayDate, mapAttachmentsFromApi } from "./approveTemplateConstants.js";
 
 import { formatDefaultValueDisplay, formFieldTypeLabel, parseFormConfigToData } from "./formConfigUtils.js";
 import { selectOptionSourceLabel } from "./selectOptionSource.js";
@@ -525,6 +518,14 @@
 
 }
 
+function openAttachmentFile(file) {
+  const url = file?.url || file?.previewURL || file?.downloadURL || file?.previewUrl || "";
+  if (url) {
+    window.open(url, "_blank");
+  } else {
+    ElMessage.warning("鏃犳硶鎵撳紑璇ラ檮浠�");
+  }
+}
 
 
 function unwrapArray(payload) {
@@ -795,10 +796,40 @@
 
 }
 
-.detail-attachment-tag {
+.detail-attachment-list {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 8px;
+}
 
-  margin: 0 8px 8px 0;
+.detail-attachment-item {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  padding: 8px 12px;
+  background: var(--el-fill-color-light);
+  border-radius: 6px;
+  cursor: pointer;
+  transition: background 0.2s;
+}
 
+.detail-attachment-item:hover {
+  background: var(--el-fill-color);
+}
+
+.attachment-icon {
+  font-size: 16px;
+  color: var(--el-text-color-regular);
+}
+
+.attachment-name {
+  font-size: 14px;
+  color: var(--el-text-color-primary);
+}
+
+.attachment-download {
+  font-size: 14px;
+  color: var(--el-text-color-secondary);
 }
 
 .text-muted {

--
Gitblit v1.9.3