From 9f3bc47b98cbc51df7cfcea94d4aa0c35f40cbc5 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 13 十月 2026 14:09:06 +0800
Subject: [PATCH] feat: 添加数字格式化工具,支持去掉小数末尾多余的 0 和四舍五入功能
---
src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue | 103 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 78 insertions(+), 25 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue b/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
index 59850e2..fb38a8f 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
@@ -114,7 +114,13 @@
<el-form-item label="妯℃澘鍚嶇О" prop="templateName">
- <el-input v-model="form.templateName" placeholder="濡傦細椤圭洰绔嬮」瀹℃壒" maxlength="50" show-word-limit />
+ <el-input
+ v-model="form.templateName"
+ placeholder="濡傦細椤圭洰绔嬮」瀹℃壒"
+ maxlength="50"
+ show-word-limit
+ :disabled="isEditingBuiltin"
+ />
</el-form-item>
@@ -124,7 +130,12 @@
<el-form-item label="妯℃澘绫诲瀷" prop="businessType">
- <el-select v-model="form.businessType" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-select
+ v-model="form.businessType"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ :disabled="isEditingBuiltin"
+ >
<el-option
@@ -178,7 +189,12 @@
<el-form-item label="濉姤閰嶇疆">
- <FormConfigEditor v-model="form.formConfigData" />
+ <FormConfigEditor
+ v-model="form.formConfigData"
+ :exclude-template-id="form.id"
+ :disable-import="isEditingBuiltin"
+ :locked-field-uids="isEditingBuiltin ? form.lockedFormFieldUids : []"
+ />
<p class="flow-tip">閰嶇疆鎻愪氦瀹℃壒鏃堕渶濉啓鐨勮〃鍗曢」锛屼繚瀛樺悗鍐欏叆 formConfig锛圝SON锛夈��</p>
@@ -186,7 +202,7 @@
<el-form-item label="瀹℃壒娴佺▼" required>
- <TemplateFlowEditor v-model="form.flowNodes" :user-options="flowUserOptions" />
+ <TemplateFlowEditor v-model="form.flowNodes" :user-options="flowUserOptions" :type-name="form.templateName" />
<p class="flow-tip">
@@ -320,7 +336,7 @@
<div class="detail-node-head">
- <span class="detail-node-order">鑺傜偣 {{ index + 1 }}</span>
+ <span class="detail-node-order">{{ nodeDisplayName(detailRow.templateName, index) }}</span>
<el-tag size="small" :type="node.signMode === 'or_sign' ? 'warning' : 'primary'">
@@ -364,23 +380,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>
@@ -406,7 +417,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";
@@ -441,6 +452,8 @@
nodeSignModeLabel,
+ nodeDisplayName,
+
searchForm,
tableLoading,
@@ -458,6 +471,8 @@
formRef,
formRules,
+
+ isEditingBuiltin,
detailDialog,
@@ -507,6 +522,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) {
@@ -777,10 +800,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