wl-design-mobile 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,16 @@
|
|
|
5
5
|
<van-icon name="cross" class="close-icon" @click="handleClose"></van-icon>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="modal-content" v-show="visible">
|
|
8
|
-
|
|
8
|
+
<!-- 图片预览 -->
|
|
9
|
+
<div v-if="isImage" class="image-preview">
|
|
10
|
+
<img :src="fileUrl" alt="图片预览" />
|
|
11
|
+
</div>
|
|
12
|
+
<!-- TXT 文本预览 -->
|
|
13
|
+
<div v-else-if="fileType === 'txt'" class="text-preview">
|
|
14
|
+
<pre>{{ textContent }}</pre>
|
|
15
|
+
</div>
|
|
16
|
+
<!-- 其他文件-->
|
|
17
|
+
<div v-else class="preview-placeholder">
|
|
9
18
|
<van-icon name="description" size="64" color="#ccc"></van-icon>
|
|
10
19
|
<p>{{ fileName }}</p>
|
|
11
20
|
</div>
|
|
@@ -38,10 +47,26 @@ export default {
|
|
|
38
47
|
default: '320px'
|
|
39
48
|
}
|
|
40
49
|
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
textContent: '' // 存放 TXT 内容
|
|
53
|
+
}
|
|
54
|
+
},
|
|
41
55
|
computed: {
|
|
42
56
|
fileType() {
|
|
43
57
|
if (!this.fileName) return ''
|
|
44
58
|
return this.fileName.split('.').pop().toLowerCase()
|
|
59
|
+
},
|
|
60
|
+
isImage() {
|
|
61
|
+
const imgTypes = ['jpg', 'jpeg', 'png', 'gif', 'webp']
|
|
62
|
+
return imgTypes.includes(this.fileType)
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
watch: {
|
|
66
|
+
visible(val) {
|
|
67
|
+
if (val) {
|
|
68
|
+
this.loadPreview()
|
|
69
|
+
}
|
|
45
70
|
}
|
|
46
71
|
},
|
|
47
72
|
methods: {
|
|
@@ -66,6 +91,18 @@ export default {
|
|
|
66
91
|
document.body.appendChild(link)
|
|
67
92
|
link.click()
|
|
68
93
|
document.body.removeChild(link)
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// 加载 TXT 预览
|
|
97
|
+
async loadPreview() {
|
|
98
|
+
if (this.fileType === 'txt') {
|
|
99
|
+
try {
|
|
100
|
+
const res = await fetch(this.fileUrl)
|
|
101
|
+
this.textContent = await res.text()
|
|
102
|
+
} catch (e) {
|
|
103
|
+
this.textContent = '文本加载失败'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
69
106
|
}
|
|
70
107
|
}
|
|
71
108
|
}
|
|
@@ -129,4 +166,29 @@ export default {
|
|
|
129
166
|
justify-content: flex-end;
|
|
130
167
|
gap: 12px;
|
|
131
168
|
}
|
|
169
|
+
|
|
170
|
+
/* 图片预览 */
|
|
171
|
+
.image-preview {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
}
|
|
176
|
+
.image-preview img {
|
|
177
|
+
max-width: 100%;
|
|
178
|
+
max-height: 60vh;
|
|
179
|
+
object-fit: contain;
|
|
180
|
+
border-radius: 4px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* TXT 预览 */
|
|
184
|
+
.text-preview {
|
|
185
|
+
padding: 10px;
|
|
186
|
+
background: #f7f8fa;
|
|
187
|
+
border-radius: 4px;
|
|
188
|
+
max-height: 60vh;
|
|
189
|
+
overflow-y: auto;
|
|
190
|
+
white-space: pre-wrap;
|
|
191
|
+
font-size: 14px;
|
|
192
|
+
line-height: 1.6;
|
|
193
|
+
}
|
|
132
194
|
</style>
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
<div class="detail-grid">
|
|
8
8
|
<div class="detail-item">
|
|
9
9
|
<span class="detail-label">{{ isApplyNode ? '发起时间:' : '审批时间:' }}</span>
|
|
10
|
-
<span class="detail-value">{{ (isApplyNode ? nodeInfo.
|
|
10
|
+
<span class="detail-value">{{ (isApplyNode ? nodeInfo.applyTime : nodeInfo.auditTime) || '-' }}</span>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="detail-item">
|
|
13
13
|
<span class="detail-label">{{ isApplyNode ? '发起人:' : '审批人:' }}</span>
|
|
14
|
-
<span class="detail-value">{{ (isApplyNode ? nodeInfo.
|
|
14
|
+
<span class="detail-value">{{ (isApplyNode ? nodeInfo.applyUserName : nodeInfo.auditUserName) || '-' }}</span>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
<div class="detail-grid" style="margin-top: 8px" v-if="!isApplyNode && (nodeInfo.startTime || nodeInfo.endTime)">
|
package/flow/comps/flow-util.js
CHANGED
|
@@ -58,9 +58,9 @@ export function getStatusText(status) {
|
|
|
58
58
|
export function getAuditResultClass(auditResult) {
|
|
59
59
|
const classMap = {
|
|
60
60
|
'30': 'pass',
|
|
61
|
-
'40': '
|
|
62
|
-
'50': '
|
|
63
|
-
'60': '
|
|
61
|
+
'40': 'return',
|
|
62
|
+
'50': 'reject',
|
|
63
|
+
'60': 'transfer'
|
|
64
64
|
}
|
|
65
65
|
return classMap[auditResult] || 'default'
|
|
66
66
|
}
|
|
@@ -73,9 +73,9 @@ export function getAuditResultClass(auditResult) {
|
|
|
73
73
|
export function getAuditResultText(auditResult) {
|
|
74
74
|
const textMap = {
|
|
75
75
|
'30': '同意',
|
|
76
|
-
'40': '
|
|
77
|
-
'50': '
|
|
78
|
-
'60': '
|
|
76
|
+
'40': '退回',
|
|
77
|
+
'50': '驳回',
|
|
78
|
+
'60': '转办'
|
|
79
79
|
}
|
|
80
80
|
return textMap[auditResult] || '审批'
|
|
81
81
|
}
|
|
@@ -88,9 +88,9 @@ export function getAuditResultText(auditResult) {
|
|
|
88
88
|
export function getAuditIcon(auditResult) {
|
|
89
89
|
const iconMap = {
|
|
90
90
|
'30': 'passed',
|
|
91
|
-
'40': '
|
|
92
|
-
'50': '
|
|
93
|
-
'60': '
|
|
91
|
+
'40': 'undo',
|
|
92
|
+
'50': 'cross',
|
|
93
|
+
'60': 'replay'
|
|
94
94
|
}
|
|
95
95
|
return iconMap[auditResult] || 'circle'
|
|
96
96
|
}
|
|
@@ -238,6 +238,7 @@ export default {
|
|
|
238
238
|
return this.enableCollapse && this.sortedFlowNodes.length > 4
|
|
239
239
|
},
|
|
240
240
|
shouldShowNode(index) {
|
|
241
|
+
if (!this.enableCollapse) return true
|
|
241
242
|
const total = this.sortedFlowNodes.length
|
|
242
243
|
if (total <= 4) return true
|
|
243
244
|
return index < 2 || index >= total - 2
|