wl-design-mobile 0.8.19 → 0.8.21
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.
- package/README.md +6 -6
- package/api/doc.js +25 -25
- package/api/x1.js +56 -56
- package/btn/components/lambo-info-btn.vue +123 -123
- package/btn/components/lambo-primary-btn.vue +117 -117
- package/btn/components/lambo-text-btn.vue +116 -116
- package/btn/lambo-btn-divide.vue +35 -120
- package/btn/lambo-btn-group.vue +46 -46
- package/btn/lambo-btn-split-line.vue +41 -41
- package/btn/lambo-btn.vue +68 -68
- package/btn/lambo-extend-btn.vue +121 -121
- package/btn/lambo-icon-btn.vue +82 -82
- package/card-item/card-row-icon.vue +71 -71
- package/card-item/filtrate-row.vue +73 -73
- package/card-item/lambo-card-footer.vue +40 -40
- package/card-item/lambo-card-head.vue +66 -66
- package/card-item/lambo-card-row.vue +59 -59
- package/collapse/lambo-collapse.vue +93 -93
- package/config/config.js +14 -14
- package/detail/lambo-detail-grid.vue +58 -58
- package/detail/lambo-detail-row.vue +59 -59
- package/doc/file/compoents/lambo-file-list.vue +42 -42
- package/doc/file/compoents/lambo-file-row.vue +77 -77
- package/doc/file/lambo-file-upload-collapse.vue +107 -107
- package/doc/file-type/file-type.js +286 -286
- package/doc/img/comonents/lambo-img-grid.vue +109 -109
- package/doc/img/lambo-img-upload-collapse.vue +107 -107
- package/doc/img/styles/css/index.css +3 -3
- package/edit/list/Lambo-edit-list.vue +87 -87
- package/edit/list/lambo-edit-card-group.vue +100 -100
- package/edit/list/styles/css/index.css +39 -39
- package/edit/select/lambo-edit-date-range.vue +147 -147
- package/edit/select/lambo-edit-date-time.vue +122 -122
- package/edit/select/lambo-edit-date.vue +120 -120
- package/edit/select/lambo-edit-input-textarea.vue +91 -91
- package/edit/select/lambo-edit-input.vue +91 -91
- package/edit/select/lambo-edit-multi-select.vue +168 -168
- package/edit/select/lambo-edit-search-single-select.vue +186 -186
- package/edit/select/lambo-edit-single-select.vue +162 -162
- package/edit/select/styles/css/index.css +133 -133
- package/flow/approval/flow-approval.vue +552 -552
- package/flow/comps/flow-attachment-list.vue +230 -230
- package/flow/comps/flow-attachment-modal.vue +194 -194
- package/flow/comps/flow-copy-users.vue +358 -358
- package/flow/comps/flow-node-card.vue +150 -150
- package/flow/comps/flow-node-header.vue +172 -172
- package/flow/comps/flow-util.js +156 -156
- package/flow/comps/icons/approved.svg +11 -11
- package/flow/comps/icons/canceled.svg +11 -11
- package/flow/comps/icons/rejected.svg +11 -11
- package/flow/comps/icons/underway.svg +11 -11
- package/flow/detail/flow-detail.vue +467 -467
- package/flow/index.js +51 -51
- package/flow/lambo-flow-detail.vue +912 -912
- package/flow/lambo-flow-edit.vue +15 -15
- package/flow/submit/flow-submit.vue +383 -383
- package/icon/lambo-required-red-star.vue +47 -47
- package/icon/lambo-vector-icon.vue +71 -71
- package/list/lambo-list.vue +412 -413
- package/nav/lambo-top-nav.vue +81 -81
- package/order/comps/icons/approved.svg +10 -10
- package/order/comps/icons/underway.svg +10 -10
- package/order/comps/order-attachment-list.vue +228 -228
- package/order/comps/order-attachment-modal.vue +194 -194
- package/order/comps/order-node-card.vue +126 -126
- package/order/comps/order-node-header.vue +133 -133
- package/order/comps/order-util.js +132 -132
- package/order/detail/order-detail.vue +432 -432
- package/order/handle/order-handle.vue +517 -517
- package/order/index.js +33 -33
- package/package.json +38 -37
- package/search/lambo-date-range-page.vue +196 -196
- package/search/lambo-date-range.vue +111 -111
- package/search/lambo-date.vue +105 -105
- package/search/lambo-input.vue +74 -74
- package/search/lambo-multi-select.vue +129 -129
- package/search/lambo-org-select-page.vue +109 -109
- package/search/lambo-search-box.vue +61 -61
- package/search/lambo-search-single-select.vue +152 -152
- package/search/lambo-single-select.vue +123 -123
- package/search/lambo-week-date-select.vue +521 -521
- package/search/styles/css/index.css +138 -138
- package/styles/base.less +77 -77
- package/styles/components/btn.less +7 -7
- package/styles/components/search.less +33 -33
- package/styles/components/tag.less +181 -181
- package/styles/index.less +4 -4
- package/table/lambo-ag-table.vue +227 -227
- package/tag/lambo-tag.vue +23 -23
- package/title/lambo-title1.vue +151 -151
- package/title/lambo-title2.vue +37 -37
- package/title/lambo-title3.vue +77 -77
- package/util/assist.js +43 -43
- package/util/axios/cacheconf.js +19 -19
- package/util/axios/index.js +11 -11
- package/util/axios/interceptors.js +101 -101
- package/util/bus.js +4 -4
- package/util/jssdk-sczy.js +104 -104
- package/util/jssdk.js +608 -565
- package/util/math.js +76 -76
- package/util/token.js +36 -36
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="node-header">
|
|
3
|
-
<div class="avatar-wrapper">
|
|
4
|
-
<div class="node-avatar" :class="{ 'avatar-no-image': !nodeInfo.handleUserAvatar }">
|
|
5
|
-
<img v-if="nodeInfo.handleUserAvatar" :src="nodeInfo.handleUserAvatar" alt="" />
|
|
6
|
-
<span v-else>{{ nodeInfo.handleUserName ? nodeInfo.handleUserName.charAt(0) : (nodeIndex + 1) }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="status-badge" :class="'badge-' + getStatusClass(nodeInfo.status)">
|
|
9
|
-
<van-icon :name="getStatusIcon(nodeInfo.status)" :size="badgeIconSize"></van-icon>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="node-info">
|
|
13
|
-
<div class="node-title-row">
|
|
14
|
-
<span class="task-name">{{ nodeInfo.taskName }}</span>
|
|
15
|
-
<slot name="extra"></slot>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="node-user-row" v-if="nodeInfo.handleUserName">
|
|
18
|
-
<span class="user-name">{{ nodeInfo.handleUserName }}</span>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
import { getStatusIcon, getStatusClass } from './order-util.js'
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
name: 'OrderNodeHeader',
|
|
29
|
-
props: {
|
|
30
|
-
nodeInfo: {
|
|
31
|
-
type: Object,
|
|
32
|
-
default: () => ({})
|
|
33
|
-
},
|
|
34
|
-
nodeIndex: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 0
|
|
37
|
-
},
|
|
38
|
-
avatarSize: {
|
|
39
|
-
type: Number,
|
|
40
|
-
default: 40
|
|
41
|
-
},
|
|
42
|
-
badgeIconSize: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: '10'
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
methods: {
|
|
48
|
-
getStatusIcon,
|
|
49
|
-
getStatusClass
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style scoped>
|
|
55
|
-
.node-header {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
margin-bottom: 8px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.avatar-wrapper {
|
|
62
|
-
position: relative;
|
|
63
|
-
margin-right: 12px;
|
|
64
|
-
flex-shrink: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.node-avatar {
|
|
68
|
-
width: 40px;
|
|
69
|
-
height: 40px;
|
|
70
|
-
border-radius: 50%;
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
background: #1989fa;
|
|
75
|
-
color: #fff;
|
|
76
|
-
font-size: 16px;
|
|
77
|
-
overflow: hidden;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.node-avatar img {
|
|
81
|
-
width: 100%;
|
|
82
|
-
height: 100%;
|
|
83
|
-
object-fit: cover;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.avatar-no-image {
|
|
87
|
-
background: #1989fa;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.status-badge {
|
|
91
|
-
position: absolute;
|
|
92
|
-
bottom: -2px;
|
|
93
|
-
right: -2px;
|
|
94
|
-
width: 18px;
|
|
95
|
-
height: 18px;
|
|
96
|
-
border-radius: 50%;
|
|
97
|
-
display: flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
justify-content: center;
|
|
100
|
-
border: 2px solid #fff;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.badge-success { background: #07c160; color: #fff; }
|
|
104
|
-
.badge-process { background: #1989fa; color: #fff; }
|
|
105
|
-
.badge-warning { background: #ff976a; color: #fff; }
|
|
106
|
-
.badge-wait { background: #dcdee0; color: #fff; }
|
|
107
|
-
.badge-error { background: #ee0a24; color: #fff; }
|
|
108
|
-
|
|
109
|
-
.node-info {
|
|
110
|
-
flex: 1;
|
|
111
|
-
min-width: 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.node-title-row {
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.task-name {
|
|
120
|
-
font-size: 15px;
|
|
121
|
-
font-weight: 500;
|
|
122
|
-
color: #323233;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.node-user-row {
|
|
126
|
-
margin-top: 2px;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.user-name {
|
|
130
|
-
font-size: 13px;
|
|
131
|
-
color: #969799;
|
|
132
|
-
}
|
|
133
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="node-header">
|
|
3
|
+
<div class="avatar-wrapper">
|
|
4
|
+
<div class="node-avatar" :class="{ 'avatar-no-image': !nodeInfo.handleUserAvatar }">
|
|
5
|
+
<img v-if="nodeInfo.handleUserAvatar" :src="nodeInfo.handleUserAvatar" alt="" />
|
|
6
|
+
<span v-else>{{ nodeInfo.handleUserName ? nodeInfo.handleUserName.charAt(0) : (nodeIndex + 1) }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="status-badge" :class="'badge-' + getStatusClass(nodeInfo.status)">
|
|
9
|
+
<van-icon :name="getStatusIcon(nodeInfo.status)" :size="badgeIconSize"></van-icon>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="node-info">
|
|
13
|
+
<div class="node-title-row">
|
|
14
|
+
<span class="task-name">{{ nodeInfo.taskName }}</span>
|
|
15
|
+
<slot name="extra"></slot>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="node-user-row" v-if="nodeInfo.handleUserName">
|
|
18
|
+
<span class="user-name">{{ nodeInfo.handleUserName }}</span>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import { getStatusIcon, getStatusClass } from './order-util.js'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'OrderNodeHeader',
|
|
29
|
+
props: {
|
|
30
|
+
nodeInfo: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({})
|
|
33
|
+
},
|
|
34
|
+
nodeIndex: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 0
|
|
37
|
+
},
|
|
38
|
+
avatarSize: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 40
|
|
41
|
+
},
|
|
42
|
+
badgeIconSize: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: '10'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
getStatusIcon,
|
|
49
|
+
getStatusClass
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style scoped>
|
|
55
|
+
.node-header {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
margin-bottom: 8px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.avatar-wrapper {
|
|
62
|
+
position: relative;
|
|
63
|
+
margin-right: 12px;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.node-avatar {
|
|
68
|
+
width: 40px;
|
|
69
|
+
height: 40px;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
background: #1989fa;
|
|
75
|
+
color: #fff;
|
|
76
|
+
font-size: 16px;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.node-avatar img {
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
object-fit: cover;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.avatar-no-image {
|
|
87
|
+
background: #1989fa;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.status-badge {
|
|
91
|
+
position: absolute;
|
|
92
|
+
bottom: -2px;
|
|
93
|
+
right: -2px;
|
|
94
|
+
width: 18px;
|
|
95
|
+
height: 18px;
|
|
96
|
+
border-radius: 50%;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
border: 2px solid #fff;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.badge-success { background: #07c160; color: #fff; }
|
|
104
|
+
.badge-process { background: #1989fa; color: #fff; }
|
|
105
|
+
.badge-warning { background: #ff976a; color: #fff; }
|
|
106
|
+
.badge-wait { background: #dcdee0; color: #fff; }
|
|
107
|
+
.badge-error { background: #ee0a24; color: #fff; }
|
|
108
|
+
|
|
109
|
+
.node-info {
|
|
110
|
+
flex: 1;
|
|
111
|
+
min-width: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.node-title-row {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.task-name {
|
|
120
|
+
font-size: 15px;
|
|
121
|
+
font-weight: 500;
|
|
122
|
+
color: #323233;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.node-user-row {
|
|
126
|
+
margin-top: 2px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.user-name {
|
|
130
|
+
font-size: 13px;
|
|
131
|
+
color: #969799;
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 工单组件公共工具方法(Vant 移动端版)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 获取状态图标
|
|
7
|
-
* @param {string} status - 节点状态
|
|
8
|
-
* @returns {string} Vant 图标名称
|
|
9
|
-
*/
|
|
10
|
-
export function getStatusIcon(status) {
|
|
11
|
-
const iconMap = {
|
|
12
|
-
completed: 'passed',
|
|
13
|
-
processing: 'clock-o',
|
|
14
|
-
transferred: 'replay',
|
|
15
|
-
pending: 'circle'
|
|
16
|
-
}
|
|
17
|
-
return iconMap[status] || iconMap.pending
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 获取状态样式类名
|
|
22
|
-
* @param {string} status - 节点状态
|
|
23
|
-
* @returns {string} 样式类名
|
|
24
|
-
*/
|
|
25
|
-
export function getStatusClass(status) {
|
|
26
|
-
const classMap = {
|
|
27
|
-
completed: 'success',
|
|
28
|
-
processing: 'process',
|
|
29
|
-
transferred: 'warning',
|
|
30
|
-
pending: 'wait'
|
|
31
|
-
}
|
|
32
|
-
return classMap[status] || classMap.pending
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 获取状态文本
|
|
37
|
-
* @param {string} status - 节点状态
|
|
38
|
-
* @returns {string} 状态文本
|
|
39
|
-
*/
|
|
40
|
-
export function getStatusText(status) {
|
|
41
|
-
const textMap = {
|
|
42
|
-
completed: '已完成',
|
|
43
|
-
processing: '处理中',
|
|
44
|
-
transferred: '已转办',
|
|
45
|
-
pending: '待处理'
|
|
46
|
-
}
|
|
47
|
-
return textMap[status] || '待处理'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 获取处理结果样式类名
|
|
52
|
-
* @param {string} handleResult - 处理结果
|
|
53
|
-
* @returns {string} 样式类名
|
|
54
|
-
*/
|
|
55
|
-
export function getHandleResultClass(handleResult) {
|
|
56
|
-
const classMap = {
|
|
57
|
-
'10': 'pending',
|
|
58
|
-
'20': 'processing',
|
|
59
|
-
'30': 'completed'
|
|
60
|
-
}
|
|
61
|
-
return classMap[handleResult] || 'default'
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 获取处理结果文本
|
|
66
|
-
* @param {string} handleResult - 处理结果
|
|
67
|
-
* @returns {string} 结果文本
|
|
68
|
-
*/
|
|
69
|
-
export function getHandleResultText(handleResult) {
|
|
70
|
-
const textMap = {
|
|
71
|
-
'10': '待处理',
|
|
72
|
-
'20': '处理中',
|
|
73
|
-
'30': '已处理'
|
|
74
|
-
}
|
|
75
|
-
return textMap[handleResult] || '处理'
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 获取处理结果图标
|
|
80
|
-
* @param {string} handleResult - 处理结果
|
|
81
|
-
* @returns {string} Vant 图标名称
|
|
82
|
-
*/
|
|
83
|
-
export function getHandleIcon(handleResult) {
|
|
84
|
-
const iconMap = {
|
|
85
|
-
'10': 'clock-o',
|
|
86
|
-
'20': 'replay',
|
|
87
|
-
'30': 'passed'
|
|
88
|
-
}
|
|
89
|
-
return iconMap[handleResult] || 'circle'
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 获取文件图标
|
|
94
|
-
* @param {string} fileName - 文件名
|
|
95
|
-
* @returns {string} 图标名称
|
|
96
|
-
*/
|
|
97
|
-
export function getFileIcon(fileName) {
|
|
98
|
-
if (!fileName) return 'description'
|
|
99
|
-
const ext = (fileName.split('.').pop() || '').toLowerCase()
|
|
100
|
-
const iconMap = {
|
|
101
|
-
pdf: 'pdf',
|
|
102
|
-
doc: 'description',
|
|
103
|
-
docx: 'description',
|
|
104
|
-
xls: 'description',
|
|
105
|
-
xlsx: 'description',
|
|
106
|
-
ppt: 'description',
|
|
107
|
-
pptx: 'description',
|
|
108
|
-
jpg: 'photograph',
|
|
109
|
-
jpeg: 'photograph',
|
|
110
|
-
png: 'photograph',
|
|
111
|
-
gif: 'photograph',
|
|
112
|
-
zip: 'description',
|
|
113
|
-
rar: 'description'
|
|
114
|
-
}
|
|
115
|
-
return iconMap[ext] || 'description'
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 格式化文件大小
|
|
120
|
-
* @param {number} size - 文件大小(字节)
|
|
121
|
-
* @returns {string} 格式化后的大小
|
|
122
|
-
*/
|
|
123
|
-
export function formatFileSize(size) {
|
|
124
|
-
if (!size) return '0 B'
|
|
125
|
-
const units = ['B', 'KB', 'MB', 'GB']
|
|
126
|
-
let index = 0
|
|
127
|
-
while (size >= 1024 && index < units.length - 1) {
|
|
128
|
-
size /= 1024
|
|
129
|
-
index++
|
|
130
|
-
}
|
|
131
|
-
return `${size.toFixed(1)} ${units[index]}`
|
|
132
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 工单组件公共工具方法(Vant 移动端版)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 获取状态图标
|
|
7
|
+
* @param {string} status - 节点状态
|
|
8
|
+
* @returns {string} Vant 图标名称
|
|
9
|
+
*/
|
|
10
|
+
export function getStatusIcon(status) {
|
|
11
|
+
const iconMap = {
|
|
12
|
+
completed: 'passed',
|
|
13
|
+
processing: 'clock-o',
|
|
14
|
+
transferred: 'replay',
|
|
15
|
+
pending: 'circle'
|
|
16
|
+
}
|
|
17
|
+
return iconMap[status] || iconMap.pending
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 获取状态样式类名
|
|
22
|
+
* @param {string} status - 节点状态
|
|
23
|
+
* @returns {string} 样式类名
|
|
24
|
+
*/
|
|
25
|
+
export function getStatusClass(status) {
|
|
26
|
+
const classMap = {
|
|
27
|
+
completed: 'success',
|
|
28
|
+
processing: 'process',
|
|
29
|
+
transferred: 'warning',
|
|
30
|
+
pending: 'wait'
|
|
31
|
+
}
|
|
32
|
+
return classMap[status] || classMap.pending
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 获取状态文本
|
|
37
|
+
* @param {string} status - 节点状态
|
|
38
|
+
* @returns {string} 状态文本
|
|
39
|
+
*/
|
|
40
|
+
export function getStatusText(status) {
|
|
41
|
+
const textMap = {
|
|
42
|
+
completed: '已完成',
|
|
43
|
+
processing: '处理中',
|
|
44
|
+
transferred: '已转办',
|
|
45
|
+
pending: '待处理'
|
|
46
|
+
}
|
|
47
|
+
return textMap[status] || '待处理'
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 获取处理结果样式类名
|
|
52
|
+
* @param {string} handleResult - 处理结果
|
|
53
|
+
* @returns {string} 样式类名
|
|
54
|
+
*/
|
|
55
|
+
export function getHandleResultClass(handleResult) {
|
|
56
|
+
const classMap = {
|
|
57
|
+
'10': 'pending',
|
|
58
|
+
'20': 'processing',
|
|
59
|
+
'30': 'completed'
|
|
60
|
+
}
|
|
61
|
+
return classMap[handleResult] || 'default'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 获取处理结果文本
|
|
66
|
+
* @param {string} handleResult - 处理结果
|
|
67
|
+
* @returns {string} 结果文本
|
|
68
|
+
*/
|
|
69
|
+
export function getHandleResultText(handleResult) {
|
|
70
|
+
const textMap = {
|
|
71
|
+
'10': '待处理',
|
|
72
|
+
'20': '处理中',
|
|
73
|
+
'30': '已处理'
|
|
74
|
+
}
|
|
75
|
+
return textMap[handleResult] || '处理'
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 获取处理结果图标
|
|
80
|
+
* @param {string} handleResult - 处理结果
|
|
81
|
+
* @returns {string} Vant 图标名称
|
|
82
|
+
*/
|
|
83
|
+
export function getHandleIcon(handleResult) {
|
|
84
|
+
const iconMap = {
|
|
85
|
+
'10': 'clock-o',
|
|
86
|
+
'20': 'replay',
|
|
87
|
+
'30': 'passed'
|
|
88
|
+
}
|
|
89
|
+
return iconMap[handleResult] || 'circle'
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 获取文件图标
|
|
94
|
+
* @param {string} fileName - 文件名
|
|
95
|
+
* @returns {string} 图标名称
|
|
96
|
+
*/
|
|
97
|
+
export function getFileIcon(fileName) {
|
|
98
|
+
if (!fileName) return 'description'
|
|
99
|
+
const ext = (fileName.split('.').pop() || '').toLowerCase()
|
|
100
|
+
const iconMap = {
|
|
101
|
+
pdf: 'pdf',
|
|
102
|
+
doc: 'description',
|
|
103
|
+
docx: 'description',
|
|
104
|
+
xls: 'description',
|
|
105
|
+
xlsx: 'description',
|
|
106
|
+
ppt: 'description',
|
|
107
|
+
pptx: 'description',
|
|
108
|
+
jpg: 'photograph',
|
|
109
|
+
jpeg: 'photograph',
|
|
110
|
+
png: 'photograph',
|
|
111
|
+
gif: 'photograph',
|
|
112
|
+
zip: 'description',
|
|
113
|
+
rar: 'description'
|
|
114
|
+
}
|
|
115
|
+
return iconMap[ext] || 'description'
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 格式化文件大小
|
|
120
|
+
* @param {number} size - 文件大小(字节)
|
|
121
|
+
* @returns {string} 格式化后的大小
|
|
122
|
+
*/
|
|
123
|
+
export function formatFileSize(size) {
|
|
124
|
+
if (!size) return '0 B'
|
|
125
|
+
const units = ['B', 'KB', 'MB', 'GB']
|
|
126
|
+
let index = 0
|
|
127
|
+
while (size >= 1024 && index < units.length - 1) {
|
|
128
|
+
size /= 1024
|
|
129
|
+
index++
|
|
130
|
+
}
|
|
131
|
+
return `${size.toFixed(1)} ${units[index]}`
|
|
132
|
+
}
|