@kyfe/fms-vue2-components 0.0.8 → 0.0.11
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/dist/{date-picker-bottom.08bb5468.js → date-picker-bottom.deb0334b.js} +1 -1
- package/dist/{date-picker-dropdown.6bdf8884.js → date-picker-dropdown.8820ef37.js} +1 -1
- package/dist/{date-picker-right.0b16e9e5.js → date-picker-right.90fb4b93.js} +1 -1
- package/dist/{date-picker-top.bb84a0cf.js → date-picker-top.535bf0c5.js} +1 -1
- package/dist/{date-week-month.7ac3a67e.js → date-week-month.f258023a.js} +1 -1
- package/dist/fms-approval-header/index.js +100 -0
- package/dist/fms-approval-header/style.css +1 -0
- package/dist/fms-copy-box/index.js +1 -1
- package/dist/fms-ks-clamp-text/index.js +2 -2
- package/dist/fms-ks-components/index.js +2 -2
- package/dist/{fms-ks-components.53289d17.js → fms-ks-components.c4804aac.js} +121 -121
- package/dist/fms-ks-decrypt/index.js +2 -2
- package/dist/{fms-ks-decrypt.2f88e659.js → fms-ks-decrypt.e9bc1873.js} +1 -1
- package/dist/fms-ks-form-grid/index.js +1 -1
- package/dist/fms-ks-select/index.js +2 -2
- package/dist/fms-ks-select-box/index.js +2 -2
- package/dist/fms-ks-uploader/index.js +350 -0
- package/dist/fms-ks-uploader/style.css +1 -0
- package/dist/index.js +70 -33
- package/dist/{mixin.7a8d8392.js → mixin.ce520697.js} +1 -1
- package/dist/oa-datetime-picker-new/style.css +1 -1
- package/package.json +2 -2
- package/src/components/fms-approval-header/fms-approval-header.vue +258 -0
- package/src/components/fms-approval-header/index.js +7 -0
- package/src/components/fms-approval-header//345/256/241/346/240/270/345/244/264/351/203/250.md +0 -0
- package/src/components/fms-ks-uploader/fms-ks-uploader.vue +570 -0
- package/src/components/fms-ks-uploader/index.js +7 -0
- package/src/index.js +34 -2
- /package/dist/{filter.c93f4ddb.js → filter.8157a654.js} +0 -0
- /package/dist/{fms-ks-clamp-text.24eb5e8d.js → fms-ks-clamp-text.29353cc2.js} +0 -0
- /package/dist/{fms-ks-select-box.a00f0f08.js → fms-ks-select-box.b75cf9d8.js} +0 -0
- /package/dist/{fms-ks-select.59416fd8.js → fms-ks-select.002b6536.js} +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="private-approval">
|
|
3
|
+
<div class="prior-approval">
|
|
4
|
+
<div v-for="item in displayConfig"
|
|
5
|
+
:key="item.key"
|
|
6
|
+
class="cell">
|
|
7
|
+
<div class="label">{{ item.label }}</div>
|
|
8
|
+
<div class="content">
|
|
9
|
+
<component v-if="isJsxFormatter(item)"
|
|
10
|
+
:is="getJsxComponent(item)" />
|
|
11
|
+
<template v-else>
|
|
12
|
+
{{ getContent(item) }}
|
|
13
|
+
</template>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import { get } from 'lodash'
|
|
22
|
+
import * as filters from '@kyfe/fms-utils/filter'
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'FmsApprovalHeader',
|
|
26
|
+
props: {
|
|
27
|
+
// 数据对象
|
|
28
|
+
data: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: () => ({})
|
|
31
|
+
},
|
|
32
|
+
// 配置项数组
|
|
33
|
+
config: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
},
|
|
37
|
+
// 自定义过滤器
|
|
38
|
+
customFilters: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => ({})
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
// 显示的配置项(过滤掉show: false的)
|
|
45
|
+
displayConfig () {
|
|
46
|
+
return this.config.filter(item => item.show !== false)
|
|
47
|
+
},
|
|
48
|
+
// 合并过滤器
|
|
49
|
+
allFilters () {
|
|
50
|
+
return {
|
|
51
|
+
...filters,
|
|
52
|
+
...this.customFilters
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
/**
|
|
58
|
+
* 获取格式化器参数
|
|
59
|
+
*/
|
|
60
|
+
getFormatterArgs(item) {
|
|
61
|
+
const { key } = item
|
|
62
|
+
const value = get(this.data, key, '')
|
|
63
|
+
return {
|
|
64
|
+
value,
|
|
65
|
+
data: this.data,
|
|
66
|
+
h: this.$createElement // 传入 h 函数
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* 判断是否是JSX格式化器
|
|
71
|
+
*/
|
|
72
|
+
isJsxFormatter(item) {
|
|
73
|
+
const { formatter } = item
|
|
74
|
+
if (typeof formatter !== 'function') return false
|
|
75
|
+
const args = this.getFormatterArgs(item)
|
|
76
|
+
const result = formatter(args.h, {
|
|
77
|
+
value: args.value,
|
|
78
|
+
data: args.data
|
|
79
|
+
})
|
|
80
|
+
// 检查是否是 JSX 元素(JSX 会编译成 VNode)
|
|
81
|
+
return result && (
|
|
82
|
+
result.__v_isVNode === true ||
|
|
83
|
+
(typeof result === 'object' && result.tag) ||
|
|
84
|
+
(typeof result === 'object' && result.type) // Vue 3
|
|
85
|
+
)
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 获取 JSX 组件
|
|
90
|
+
*/
|
|
91
|
+
getJsxComponent(item) {
|
|
92
|
+
const { formatter } = item
|
|
93
|
+
const args = this.getFormatterArgs(item)
|
|
94
|
+
const jsxResult = formatter(args.h, {
|
|
95
|
+
value: args.value,
|
|
96
|
+
data: args.data
|
|
97
|
+
})
|
|
98
|
+
// 如果是 JSX 元素(VNode),包装成组件
|
|
99
|
+
if (jsxResult && (jsxResult.__v_isVNode || jsxResult.tag)) {
|
|
100
|
+
return {
|
|
101
|
+
render: () => jsxResult
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// 如果已经是组件配置,直接返回
|
|
105
|
+
if (jsxResult && (jsxResult.render || jsxResult.template)) {
|
|
106
|
+
return jsxResult
|
|
107
|
+
}
|
|
108
|
+
// 默认返回空组件
|
|
109
|
+
return {
|
|
110
|
+
render: () => this.$createElement('span', '渲染错误')
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* 获取显示内容
|
|
115
|
+
*/
|
|
116
|
+
getContent (item) {
|
|
117
|
+
const { key, filter, lookupCode } = item
|
|
118
|
+
// 获取原始值
|
|
119
|
+
let value = get(this.data, key, '')
|
|
120
|
+
// 如果值为空,直接返回
|
|
121
|
+
if (value === undefined || value === null || value === '') {
|
|
122
|
+
return ''
|
|
123
|
+
}
|
|
124
|
+
// 使用字典映射
|
|
125
|
+
if (lookupCode) {
|
|
126
|
+
return filters.lookupLabelByValue(String(value), lookupCode)
|
|
127
|
+
}
|
|
128
|
+
// 使用过滤器
|
|
129
|
+
if (filter) {
|
|
130
|
+
if (typeof filter === 'function') {
|
|
131
|
+
return filter(value, this.data)
|
|
132
|
+
} else if (typeof filter === 'string' && this.allFilters[filter]) {
|
|
133
|
+
return this.allFilters[filter](value)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// 直接返回原始值
|
|
137
|
+
return value
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</script>
|
|
142
|
+
<style lang="less" scoped>
|
|
143
|
+
// 审批详情样式
|
|
144
|
+
.prior-approval {
|
|
145
|
+
margin: 0 16px;
|
|
146
|
+
padding: 4px 0 16px 0;
|
|
147
|
+
border-radius: 0px 0px 6px 6px;
|
|
148
|
+
background: #ffffff;
|
|
149
|
+
|
|
150
|
+
.cell {
|
|
151
|
+
display: flex;
|
|
152
|
+
margin-bottom: 10px;
|
|
153
|
+
min-height: 20px;
|
|
154
|
+
line-height: 20px;
|
|
155
|
+
padding: 0 16px;
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
|
|
158
|
+
&:last-child {
|
|
159
|
+
margin-bottom: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.label {
|
|
163
|
+
color: #858793;
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
width: 72px;
|
|
166
|
+
word-break: break-all;
|
|
167
|
+
|
|
168
|
+
&-click {
|
|
169
|
+
color: #7972fe;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.content {
|
|
174
|
+
flex: 1;
|
|
175
|
+
margin-left: 14px;
|
|
176
|
+
color: #03050d;
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
text-align: left;
|
|
179
|
+
word-break: break-all;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.form-title {
|
|
184
|
+
position: relative;
|
|
185
|
+
padding: 8px 0 0 26px;
|
|
186
|
+
margin-bottom: 12px;
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
font-weight: 600;
|
|
189
|
+
height: 28px;
|
|
190
|
+
line-height: 28px;
|
|
191
|
+
background: #ffffff;
|
|
192
|
+
color: #333333;
|
|
193
|
+
|
|
194
|
+
&::before {
|
|
195
|
+
content: "";
|
|
196
|
+
position: absolute;
|
|
197
|
+
top: 15px;
|
|
198
|
+
left: 16px;
|
|
199
|
+
width: 2px;
|
|
200
|
+
height: 14px;
|
|
201
|
+
background: #7972fe;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&::after {
|
|
205
|
+
position: absolute;
|
|
206
|
+
content: " ";
|
|
207
|
+
pointer-events: none;
|
|
208
|
+
right: 0;
|
|
209
|
+
top: 0;
|
|
210
|
+
left: 16px;
|
|
211
|
+
right: 16px;
|
|
212
|
+
border-bottom: 1px solid #ebedf5;
|
|
213
|
+
-webkit-transform: scaleY(0.5);
|
|
214
|
+
transform: scaleY(0.5);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.form-title-no-after {
|
|
219
|
+
position: relative;
|
|
220
|
+
padding: 8px 0 0 26px;
|
|
221
|
+
margin-bottom: 12px;
|
|
222
|
+
font-size: 14px;
|
|
223
|
+
font-weight: 600;
|
|
224
|
+
height: 28px;
|
|
225
|
+
line-height: 28px;
|
|
226
|
+
background: #ffffff;
|
|
227
|
+
color: #333333;
|
|
228
|
+
|
|
229
|
+
&::before {
|
|
230
|
+
content: "";
|
|
231
|
+
position: absolute;
|
|
232
|
+
top: 15px;
|
|
233
|
+
left: 16px;
|
|
234
|
+
width: 2px;
|
|
235
|
+
height: 14px;
|
|
236
|
+
background: #7972fe;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.line {
|
|
241
|
+
height: 1px;
|
|
242
|
+
background-color: #eee;
|
|
243
|
+
margin: 6px 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.upload-detail {
|
|
247
|
+
.van-uploader__wrapper {
|
|
248
|
+
.van-uploader__preview-delete {
|
|
249
|
+
display: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.van-uploader__upload {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
</style>
|
package/src/components/fms-approval-header//345/256/241/346/240/270/345/244/264/351/203/250.md
ADDED
|
File without changes
|