@kyfe/fms-vue2-components 0.0.2-beta.0
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/assets/css/fms-ks-decrypt.css +1 -0
- package/dist/fms-copy-box/index.js +69 -0
- package/dist/fms-copy-box/style.css +1 -0
- package/dist/fms-empty/index.js +42 -0
- package/dist/fms-empty/style.css +1 -0
- package/dist/fms-ks-decrypt/index.js +9 -0
- package/dist/fms-ks-decrypt.bcc12f44.js +335 -0
- package/dist/fms-ks-file-upload/index.js +148 -0
- package/dist/fms-ks-file-upload/style.css +1 -0
- package/dist/fms-ks-file-view/index.js +286 -0
- package/dist/fms-ks-file-view/style.css +1 -0
- package/dist/fms-scroll-list/index.js +241 -0
- package/dist/fms-scroll-list/style.css +1 -0
- package/dist/index.js +37 -0
- package/dist/plugin-vue2_normalizer.ed7092a9.js +30 -0
- package/package.json +31 -0
- package/src/assets/images/code.png +0 -0
- package/src/assets/images/copy-icon.png +0 -0
- package/src/assets/images/tag-gkbk.png +0 -0
- package/src/assets/style/common.less +62 -0
- package/src/components/fms-copy-box/fms-copy-box.vue +97 -0
- package/src/components/fms-copy-box/index.js +7 -0
- package/src/components/fms-copy-box//345/244/215/345/210/266.md +0 -0
- package/src/components/fms-empty/assets/default.png +0 -0
- package/src/components/fms-empty/assets/search.png +0 -0
- package/src/components/fms-empty/fms-empty.vue +57 -0
- package/src/components/fms-empty/index.js +7 -0
- package/src/components/fms-ks-decrypt/component/call/index.vue +283 -0
- package/src/components/fms-ks-decrypt/component/call/mixin.less +50 -0
- package/src/components/fms-ks-decrypt/component/custom-call/index.vue +50 -0
- package/src/components/fms-ks-decrypt/fms-ks-decrypt.vue +257 -0
- package/src/components/fms-ks-decrypt/index.js +7 -0
- package/src/components/fms-ks-decrypt/phone.svg +24 -0
- package/src/components/fms-ks-decrypt//346/225/217/346/204/237/347/233/221/346/216/247/347/273/204/344/273/266.md +140 -0
- package/src/components/fms-ks-file-upload/assets/icon_close.png +0 -0
- package/src/components/fms-ks-file-upload/fms-ks-file-upload.vue +254 -0
- package/src/components/fms-ks-file-upload/index.js +7 -0
- package/src/components/fms-ks-file-upload//344/270/212/344/274/240/347/273/204/344/273/266.md +0 -0
- package/src/components/fms-ks-file-view/assets/icon_default.svg +23 -0
- package/src/components/fms-ks-file-view/assets/icon_default_new.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_excel.svg +20 -0
- package/src/components/fms-ks-file-view/assets/icon_excel_new.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_file.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_pdf_new.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_ppt.svg +20 -0
- package/src/components/fms-ks-file-view/assets/icon_ppt_new.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_preview_file.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_txt.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_word.svg +19 -0
- package/src/components/fms-ks-file-view/assets/icon_word_new.png +0 -0
- package/src/components/fms-ks-file-view/assets/icon_xmind.png +0 -0
- package/src/components/fms-ks-file-view/components/attachment.vue +343 -0
- package/src/components/fms-ks-file-view/fms-ks-file-view.vue +165 -0
- package/src/components/fms-ks-file-view/index.js +7 -0
- package/src/components/fms-ks-file-view/utils/index.js +27 -0
- package/src/components/fms-ks-file-view//346/226/207/344/273/266/351/242/204/350/247/210.md +23 -0
- package/src/components/fms-scroll-list/Waterfall.js +91 -0
- package/src/components/fms-scroll-list/fms-scroll-list.vue +294 -0
- package/src/components/fms-scroll-list/index.js +7 -0
- package/src/components/fms-scroll-list//346/273/232/345/212/250.md +0 -0
- package/src/index.js +37 -0
- package/vite.config.js +82 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<van-popup :value="value"
|
|
4
|
+
class="kts-call"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
round
|
|
8
|
+
@closed="onClosed"
|
|
9
|
+
get-container="body"
|
|
10
|
+
position="bottom"
|
|
11
|
+
:safe-area-inset-bottom="true">
|
|
12
|
+
<div class="call-content">
|
|
13
|
+
<div class="call-title">
|
|
14
|
+
<slot name="title">请输入您的号码</slot>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="call-tips">
|
|
17
|
+
<slot name="tips">提示:本次通话记录将会被监控</slot>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="call-input">
|
|
20
|
+
<van-field v-model="cellphone"
|
|
21
|
+
:maxlength="maxlength"
|
|
22
|
+
type="tel"
|
|
23
|
+
:clearable="clearable"
|
|
24
|
+
label="" />
|
|
25
|
+
</div>
|
|
26
|
+
<div class="call-btns">
|
|
27
|
+
<van-button plain
|
|
28
|
+
type="default"
|
|
29
|
+
@click="onClose">取消</van-button>
|
|
30
|
+
<van-button type="primary"
|
|
31
|
+
@click="callPhone">呼叫</van-button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</van-popup>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
export default {
|
|
39
|
+
name: "call",
|
|
40
|
+
props: {
|
|
41
|
+
value: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: true,
|
|
44
|
+
default: () => false
|
|
45
|
+
},
|
|
46
|
+
maxlength: {
|
|
47
|
+
type: [Number, String],
|
|
48
|
+
default: 11
|
|
49
|
+
},
|
|
50
|
+
clearable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
// 表单model
|
|
55
|
+
model: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({})
|
|
58
|
+
},
|
|
59
|
+
// 字段key
|
|
60
|
+
modelKey: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '',
|
|
63
|
+
},
|
|
64
|
+
// 传入的虚拟号解密入参
|
|
65
|
+
decrypt: {
|
|
66
|
+
type: Object,
|
|
67
|
+
default: () => {
|
|
68
|
+
// return {
|
|
69
|
+
// dataId: '',
|
|
70
|
+
// moduleCode: '',
|
|
71
|
+
// fieldName: '',
|
|
72
|
+
// fieldNameStr: '',
|
|
73
|
+
// buttonName: '',
|
|
74
|
+
// }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
// 传入的本机号码
|
|
78
|
+
phone: {
|
|
79
|
+
type: [String, Number],
|
|
80
|
+
default: () => ''
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
data () {
|
|
84
|
+
return {
|
|
85
|
+
cellphone: ''
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
watch: {
|
|
89
|
+
value (val) {
|
|
90
|
+
if (val) {
|
|
91
|
+
if (this.phone) {
|
|
92
|
+
this.cellphone = this.phone
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
/**
|
|
99
|
+
* @description 支持多层级获取对象内属性值
|
|
100
|
+
* @param {Object} model
|
|
101
|
+
* @param {String} key 如'res[0]' 'res[0].a' 'res[0].c[2]'
|
|
102
|
+
* @returns {*}
|
|
103
|
+
*/
|
|
104
|
+
getModelValue (model, key) {
|
|
105
|
+
if (!key) {
|
|
106
|
+
return ''
|
|
107
|
+
}
|
|
108
|
+
if (key.indexOf('.') > 0) {
|
|
109
|
+
let arr = key.split('.')
|
|
110
|
+
let length = arr.length - 1
|
|
111
|
+
return arr.reduce((s, k, i) => {
|
|
112
|
+
let index = k.indexOf('[')
|
|
113
|
+
if (i === length) {
|
|
114
|
+
if (index > 0) {
|
|
115
|
+
return (s[k.substr(0, index)] || [])[+k.substring(index + 1, k.length - 1)]
|
|
116
|
+
}
|
|
117
|
+
return s[k]
|
|
118
|
+
} else {
|
|
119
|
+
if (index > 0) {
|
|
120
|
+
return (s[k.substr(0, index)] || [])[+k.substring(index + 1, k.length - 1)] || {}
|
|
121
|
+
}
|
|
122
|
+
return s[k] || {}
|
|
123
|
+
}
|
|
124
|
+
}, model)
|
|
125
|
+
}
|
|
126
|
+
let index = key.indexOf('[')
|
|
127
|
+
if (index > 0) {
|
|
128
|
+
return (model[key.substr(0, index)] || [])[+key.substring(index + 1, key.length - 1)]
|
|
129
|
+
}
|
|
130
|
+
return model[key]
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* @desciption 拨打电话
|
|
134
|
+
*/
|
|
135
|
+
async callPhone () {
|
|
136
|
+
const reg = /^1[0-9]{10}$/
|
|
137
|
+
if (reg.test(this.cellphone)) {
|
|
138
|
+
const phone = await this.decryptPhone(this.model)
|
|
139
|
+
if (phone) {
|
|
140
|
+
location.href = "tel:" + phone
|
|
141
|
+
return this.$emit('success', this.cellphone, phone)
|
|
142
|
+
}
|
|
143
|
+
return vant.Toast('未找到对应手机号!')
|
|
144
|
+
}
|
|
145
|
+
return vant.Toast('请输入正确手机号!')
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* @desciption 解密虚拟号
|
|
149
|
+
* @param {Object} model 解密model
|
|
150
|
+
* @param {Object} decrypt 解密配置
|
|
151
|
+
* @returns {String} 解密手机号
|
|
152
|
+
*/
|
|
153
|
+
async decryptPhone (model) {
|
|
154
|
+
const virtual = this.getModelValue(model, `${this.modelKey}Virtual`)
|
|
155
|
+
if (virtual) {
|
|
156
|
+
return await this.decryptVirtual(model, virtual)
|
|
157
|
+
} else {
|
|
158
|
+
const mask = this.getModelValue(model, `${this.modelKey}Mask`)
|
|
159
|
+
if (mask) {
|
|
160
|
+
return await this.decryptMask(mask)
|
|
161
|
+
} else {
|
|
162
|
+
const maskSec = this.getModelValue(model, `${this.modelKey}MaskSec`)
|
|
163
|
+
console.log(maskSec, this.modelKey, 'maskSec')
|
|
164
|
+
if (!maskSec) {
|
|
165
|
+
return this.getModelValue(model, this.modelKey)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* @desciption 解密虚拟号
|
|
172
|
+
* @param {Object} model 解密model
|
|
173
|
+
* @param {String} virtual 虚拟号加密字符串
|
|
174
|
+
* @returns {String} 解密数据
|
|
175
|
+
*/
|
|
176
|
+
async decryptVirtual (model, virtual) {
|
|
177
|
+
try {
|
|
178
|
+
const data = await this.$http('basevirtual.virtualPhone.getVirtualNumber', 55041, {
|
|
179
|
+
...this.decrypt,
|
|
180
|
+
fieldContent: virtual,
|
|
181
|
+
calloutPhone: this.cellphone,
|
|
182
|
+
callinPhone: this.getModelValue(model, this.modelKey)
|
|
183
|
+
})
|
|
184
|
+
return data
|
|
185
|
+
} catch (error) {
|
|
186
|
+
return ''
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* @desciption 解密敏感
|
|
191
|
+
* @param {String} mask 敏感加密字符串
|
|
192
|
+
* @returns {String} 解密数据
|
|
193
|
+
*/
|
|
194
|
+
async decryptMask (mask) {
|
|
195
|
+
try {
|
|
196
|
+
const data = await this.$http('syslog.sensitiveFieldViewLog.save', 10135, {
|
|
197
|
+
...this.decrypt,
|
|
198
|
+
fieldContent: mask,
|
|
199
|
+
})
|
|
200
|
+
return data
|
|
201
|
+
} catch (error) {
|
|
202
|
+
return ''
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
/**
|
|
206
|
+
* @desciption 关闭弹窗
|
|
207
|
+
*/
|
|
208
|
+
onClose () {
|
|
209
|
+
this.$emit('input', false)
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* @desciption 弹窗关闭后data所有值reset
|
|
213
|
+
*/
|
|
214
|
+
onClosed () {
|
|
215
|
+
Object.assign(this.$data, this.$options.data())
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
</script>
|
|
220
|
+
|
|
221
|
+
<style lang="less" scope>
|
|
222
|
+
@import "./mixin.less";
|
|
223
|
+
.kts-call {
|
|
224
|
+
width: 100%;
|
|
225
|
+
background-color: #ffffff;
|
|
226
|
+
.call-content {
|
|
227
|
+
width: 100%;
|
|
228
|
+
padding: 28 / @px 17 / @px 0;
|
|
229
|
+
box-sizing: border-box;
|
|
230
|
+
.call-title {
|
|
231
|
+
width: 100%;
|
|
232
|
+
height: 28 / @px;
|
|
233
|
+
font-size: 20 / @px;
|
|
234
|
+
font-weight: 500;
|
|
235
|
+
text-align: center;
|
|
236
|
+
color: #03050d;
|
|
237
|
+
line-height: 28 / @px;
|
|
238
|
+
}
|
|
239
|
+
.call-tips {
|
|
240
|
+
width: 100%;
|
|
241
|
+
height: 21 / @px;
|
|
242
|
+
font-size: 15 / @px;
|
|
243
|
+
font-weight: 400;
|
|
244
|
+
text-align: center;
|
|
245
|
+
color: #b0b3bf;
|
|
246
|
+
line-height: 21 / @px;
|
|
247
|
+
}
|
|
248
|
+
.call-input {
|
|
249
|
+
width: 100%;
|
|
250
|
+
margin-top: 32 / @px;
|
|
251
|
+
display: flex;
|
|
252
|
+
justify-content: center;
|
|
253
|
+
.borderHalf(#ebedf5, bottom);
|
|
254
|
+
.van-field {
|
|
255
|
+
width: 326 / @px;
|
|
256
|
+
font-size: 20 / @px;
|
|
257
|
+
.van-field__control {
|
|
258
|
+
text-align: center;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
.call-btns {
|
|
263
|
+
box-sizing: border-box;
|
|
264
|
+
padding: 23 / @px 0;
|
|
265
|
+
display: flex;
|
|
266
|
+
justify-content: space-between;
|
|
267
|
+
.van-button {
|
|
268
|
+
height: 50 / @px;
|
|
269
|
+
flex: 1;
|
|
270
|
+
border-radius: 8 / @px;
|
|
271
|
+
&:first-of-type {
|
|
272
|
+
border: none;
|
|
273
|
+
color: #7972fe;
|
|
274
|
+
background-color: #f1f3f7;
|
|
275
|
+
}
|
|
276
|
+
&:not(:last-of-type) {
|
|
277
|
+
margin-right: 20 / @px;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
@px: 1px; // 12/@px
|
|
3
|
+
.subclass (@color) {
|
|
4
|
+
position: absolute;
|
|
5
|
+
content: ' ';
|
|
6
|
+
text-indent: -999rem;
|
|
7
|
+
// overflow: hidden;
|
|
8
|
+
background-color: @color;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 0.5px边框
|
|
12
|
+
* @color 颜色
|
|
13
|
+
* @direction 方向(top, bottom, left, right)
|
|
14
|
+
*/
|
|
15
|
+
.borderHalf (@color, @direction: bottom) when (@direction = top), (@direction = bottom) {
|
|
16
|
+
position: relative;
|
|
17
|
+
&::after {
|
|
18
|
+
.subclass(@color);
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
height: 1px;
|
|
22
|
+
@{direction}: 0;
|
|
23
|
+
transform: scaleY(0.5);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.borderHalf (@color, @direction) when (@direction = left), (@direction = right) {
|
|
27
|
+
position: relative;
|
|
28
|
+
&::after {
|
|
29
|
+
.subclass(@color);
|
|
30
|
+
top: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
width: 1px;
|
|
33
|
+
border-top-width: 1px;
|
|
34
|
+
border-top-style: solid;
|
|
35
|
+
border-top-color: @color;
|
|
36
|
+
@{direction}: 0;
|
|
37
|
+
transform: scaleX(0.5);
|
|
38
|
+
}
|
|
39
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
|
40
|
+
position: relative;
|
|
41
|
+
&::after {
|
|
42
|
+
.subclass(@color);
|
|
43
|
+
top: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
width: 1px;
|
|
46
|
+
@{direction}: 0;
|
|
47
|
+
transform: scaleX(0.5);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<call
|
|
3
|
+
@success="onSuccess"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
v-bind="{
|
|
6
|
+
...$attrs,
|
|
7
|
+
phone: $attrs.phone ? $attrs.phone : phone,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</call>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import call from '../call/index.vue'
|
|
16
|
+
export default {
|
|
17
|
+
name: 'custom-call',
|
|
18
|
+
components: {
|
|
19
|
+
call,
|
|
20
|
+
},
|
|
21
|
+
watch: {
|
|
22
|
+
$attrs () {
|
|
23
|
+
this.getMobile()
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
data () {
|
|
27
|
+
return {
|
|
28
|
+
phone: '',
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
/**
|
|
33
|
+
* @description 获取本机号码
|
|
34
|
+
*/
|
|
35
|
+
getMobile () {
|
|
36
|
+
let { user = {} } = window.ksui
|
|
37
|
+
this.phone =
|
|
38
|
+
localStorage.getItem('mobile') ||
|
|
39
|
+
user.companyMobile ||
|
|
40
|
+
user.privateMobile
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* @description 保存拨打成功的号码
|
|
44
|
+
*/
|
|
45
|
+
onSuccess (cellphone) {
|
|
46
|
+
localStorage.setItem('mobile', cellphone)
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="kts-decrypt">
|
|
3
|
+
<!-- 表单场景结构 -->
|
|
4
|
+
<van-field
|
|
5
|
+
v-if="isField"
|
|
6
|
+
v-model="value"
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
@blur="handleBlur"
|
|
9
|
+
@input="handleInput"
|
|
10
|
+
@clear="handleClear"
|
|
11
|
+
@focus="handleFocus"
|
|
12
|
+
@click-left-icon="clickLeftIcon"
|
|
13
|
+
@click-right-icon="clickRightIcon"
|
|
14
|
+
>
|
|
15
|
+
<!-- 监控 支持解密 -->
|
|
16
|
+
<div
|
|
17
|
+
v-if="maskFiled.mask"
|
|
18
|
+
slot="input"
|
|
19
|
+
class="kts-mobile-decrypt ks-mobile-decrypt"
|
|
20
|
+
@click="decryptBtn"
|
|
21
|
+
>
|
|
22
|
+
{{ value }}
|
|
23
|
+
</div>
|
|
24
|
+
<!-- 敏感 不可解密 -->
|
|
25
|
+
<div v-else-if="maskFiled.maskSec" class="kts-mobile-decrypt" slot="input">
|
|
26
|
+
{{ maskSecDefault }}
|
|
27
|
+
</div>
|
|
28
|
+
<!-- 虚拟号 支持拨打虚拟号码 -->
|
|
29
|
+
<div v-else-if="maskFiled.virtual" slot="input" class="kts-mobile-decrypt">
|
|
30
|
+
{{ value }}
|
|
31
|
+
<img class="phone-img" src="./phone.svg" @click="showCall" />
|
|
32
|
+
</div>
|
|
33
|
+
</van-field>
|
|
34
|
+
<!-- 非表单场景结构 -->
|
|
35
|
+
<template v-else>
|
|
36
|
+
<!-- 虚拟号 支持拨打虚拟号码 -->
|
|
37
|
+
<div v-if="maskFiled.virtual" slot="input" class="kts-mobile-decrypt">
|
|
38
|
+
{{ value }}
|
|
39
|
+
<img class="phone-img" src="./phone.svg" @click="showCall" />
|
|
40
|
+
</div>
|
|
41
|
+
<!-- 监控or敏感 -->
|
|
42
|
+
<span
|
|
43
|
+
v-else
|
|
44
|
+
:class="maskFiled.mask ? 'ks-mobile-decrypt' : ''"
|
|
45
|
+
@click="decryptBtn"
|
|
46
|
+
>{{ maskFiled.maskSec ? maskSecDefault : numberSplitInt(value) }}</span
|
|
47
|
+
>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<!-- 拨打虚拟号电话弹窗 -->
|
|
51
|
+
<CustomCall
|
|
52
|
+
v-model="callShow"
|
|
53
|
+
:decrypt="callDecrypt"
|
|
54
|
+
:model="formData"
|
|
55
|
+
:modelKey="fieldName"
|
|
56
|
+
></CustomCall>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
<script>
|
|
60
|
+
// 拨打虚拟号电话弹窗组件
|
|
61
|
+
import CustomCall from './component/custom-call/index.vue'
|
|
62
|
+
import { numberSplitInt } from '@kyfe/fms-utils/filter.js'
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'FmsKsDecrypt',
|
|
66
|
+
components: {
|
|
67
|
+
CustomCall,
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* formData 表单数据@必填
|
|
71
|
+
* fieldName 对应的后端字段名@必填
|
|
72
|
+
* fieldNameStr 和label名称一致
|
|
73
|
+
* maskSecDefault 敏感字段默认显示的内容
|
|
74
|
+
* isField 是否是在表单中使用 默认为否
|
|
75
|
+
* idKey 解密时的dataId 作为列表数据的唯一标识
|
|
76
|
+
* menuCode: {
|
|
77
|
+
* moduleCode 解密时菜单ID@必填
|
|
78
|
+
* moduleName 当前模块名@必填
|
|
79
|
+
* }
|
|
80
|
+
*/
|
|
81
|
+
props: {
|
|
82
|
+
value: [String, Number],
|
|
83
|
+
formData: Object,
|
|
84
|
+
// 绑定属性、字段
|
|
85
|
+
fieldName: String,
|
|
86
|
+
// 字段中文名
|
|
87
|
+
fieldNameStr: String,
|
|
88
|
+
maskSecDefault: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: '✽✽✽',
|
|
91
|
+
},
|
|
92
|
+
isField: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
idKey: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: 'id',
|
|
99
|
+
},
|
|
100
|
+
menuCode: {
|
|
101
|
+
type: Object,
|
|
102
|
+
default: () => ({
|
|
103
|
+
moduleCode: window.ksui?.menu?.id,
|
|
104
|
+
moduleName: window.ksui?.menu?.title,
|
|
105
|
+
}),
|
|
106
|
+
},
|
|
107
|
+
isMoney: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
data() {
|
|
113
|
+
return {
|
|
114
|
+
callShow: false, // 是否展示打电话弹窗
|
|
115
|
+
callDecrypt: {}, // 虚拟号解密信息
|
|
116
|
+
menuCode() {},
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
computed: {
|
|
120
|
+
maskFiled() {
|
|
121
|
+
let mask = null
|
|
122
|
+
let maskSec = null
|
|
123
|
+
let virtual = null
|
|
124
|
+
if (this.formData) {
|
|
125
|
+
let tempModel = this.formData
|
|
126
|
+
// 付款公司监控字段显示为客户编码,不包含***
|
|
127
|
+
// if (tempModel[this.fieldName + 'Mask'] && this.value.includes('***')) {
|
|
128
|
+
if (tempModel[this.fieldName + 'Mask']) {
|
|
129
|
+
mask = tempModel[this.fieldName + 'Mask']
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// formData无直接返回该字段,且只有formData[字段+MaskSec]时 才是敏感字段?
|
|
133
|
+
if (
|
|
134
|
+
!tempModel[this.fieldName] &&
|
|
135
|
+
tempModel.hasOwnProperty(this.fieldName + 'MaskSec')
|
|
136
|
+
) {
|
|
137
|
+
maskSec = 'maskSec'
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 虚拟号
|
|
141
|
+
if (tempModel.hasOwnProperty(this.fieldName + 'Virtual')) {
|
|
142
|
+
virtual = tempModel[this.fieldName + 'Virtual']
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
tempModel = tempModel[this.fieldName]
|
|
146
|
+
}
|
|
147
|
+
return { mask, maskSec, virtual }
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
methods: {
|
|
151
|
+
numberSplitInt(value) {
|
|
152
|
+
const { isMoney } = this
|
|
153
|
+
return isMoney ? numberSplitInt(value) : value
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* @description 拨打电话
|
|
157
|
+
*/
|
|
158
|
+
showCall() {
|
|
159
|
+
this.callDecrypt = {
|
|
160
|
+
dataId: this.formData[this.idKey] || this.createUuid(),
|
|
161
|
+
moduleCode: this.menuCode.moduleCode || 'kts-h5',
|
|
162
|
+
fieldName: this.fieldName,
|
|
163
|
+
fieldNameStr: this.fieldNameStr,
|
|
164
|
+
}
|
|
165
|
+
this.callShow = true
|
|
166
|
+
},
|
|
167
|
+
isEmpty(val) {
|
|
168
|
+
return val === '' || val === null || val === undefined
|
|
169
|
+
},
|
|
170
|
+
// 创建随机ID 保证解密唯一值
|
|
171
|
+
createUuid() {
|
|
172
|
+
return Math.random().toString(36).substr(3)
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* @description 监控字段 解密操作
|
|
176
|
+
*/
|
|
177
|
+
decryptBtn() {
|
|
178
|
+
if (!this.maskFiled.mask) {
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
vant.Dialog.confirm({
|
|
182
|
+
title: '温馨提示',
|
|
183
|
+
message: `如非必要请勿查看,此操作会联动风控系统监控!`,
|
|
184
|
+
})
|
|
185
|
+
.then(() => {
|
|
186
|
+
this.decrypt()
|
|
187
|
+
})
|
|
188
|
+
.catch(() => {})
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* @description 监控字段 解密操作
|
|
192
|
+
*/
|
|
193
|
+
async decrypt() {
|
|
194
|
+
try {
|
|
195
|
+
let params = {
|
|
196
|
+
dataId: this.formData[this.idKey] || this.createUuid(),
|
|
197
|
+
moduleCode: this.menuCode.moduleCode,
|
|
198
|
+
fieldName: this.fieldName,
|
|
199
|
+
fieldContent: this.formData[this.fieldName + 'Mask'],
|
|
200
|
+
fieldNameStr: this.fieldNameStr,
|
|
201
|
+
buttonName: this.menuCode.moduleName,
|
|
202
|
+
}
|
|
203
|
+
let res = await this.$http('syslog.sensitiveFieldViewLog.save', '10135', params)
|
|
204
|
+
this.value = this.isMoney ? numberSplitInt(res) : res
|
|
205
|
+
this.$emit('input', res)
|
|
206
|
+
// 解密之后去掉监控状态,避免再次可点击
|
|
207
|
+
this.$set(this.formData, this.fieldName, res)
|
|
208
|
+
this.$set(this.formData, this.fieldName + 'Mask', undefined)
|
|
209
|
+
if (this.idKey !== '') {
|
|
210
|
+
this.$emit('decryptData', res, this.fieldName, this.formData[this.idKey])
|
|
211
|
+
}
|
|
212
|
+
} catch (err) {
|
|
213
|
+
console.log(err)
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
handleBlur() {
|
|
217
|
+
this.$emit('blur')
|
|
218
|
+
},
|
|
219
|
+
handleInput(val) {
|
|
220
|
+
this.$emit('input', val)
|
|
221
|
+
},
|
|
222
|
+
handleFocus(val) {
|
|
223
|
+
this.$emit('focus', val)
|
|
224
|
+
},
|
|
225
|
+
handleClear() {
|
|
226
|
+
this.$emit('clear')
|
|
227
|
+
},
|
|
228
|
+
clickLeftIcon() {
|
|
229
|
+
this.$emit('click-left-icon')
|
|
230
|
+
},
|
|
231
|
+
clickRightIcon() {
|
|
232
|
+
this.$emit('click-left-icon')
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
</script>
|
|
237
|
+
<style lang="less" scoped>
|
|
238
|
+
.kts-decrypt {
|
|
239
|
+
display: inline-block;
|
|
240
|
+
.ks-mobile-decrypt {
|
|
241
|
+
color: #7972fe;
|
|
242
|
+
}
|
|
243
|
+
/* 使加密字段靠左展示 */
|
|
244
|
+
.kts-mobile-decrypt {
|
|
245
|
+
width: 100%;
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
}
|
|
249
|
+
.phone-img {
|
|
250
|
+
width: 25px;
|
|
251
|
+
margin-left: 6px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/deep/ .van-field__control--right .kts-mobile-decrypt {
|
|
255
|
+
justify-content: flex-end;
|
|
256
|
+
}
|
|
257
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="17px" height="17px" viewBox="0 0 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>-mockplus-</title>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient x1="54.2285156%" y1="-5.81542969%" x2="54.2285156%" y2="100%" id="linearGradient-1">
|
|
6
|
+
<stop stop-color="#9D98FF" offset="0%"></stop>
|
|
7
|
+
<stop stop-color="#6E66FB" offset="100%"></stop>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
<g id="220627_下单管理-【详情】最新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
11
|
+
<g id="订单详情-未报单" transform="translate(-203.000000, -232.000000)">
|
|
12
|
+
<g id="编组-19" transform="translate(10.000000, 218.000000)">
|
|
13
|
+
<g id="ic_details_waybill_phone" transform="translate(193.000000, 14.000000)">
|
|
14
|
+
<rect id="形状结合" fill="#7972FE" opacity="0.100000001" x="0" y="0" width="17" height="17" rx="8.5"></rect>
|
|
15
|
+
<g id="-mockplus-" transform="translate(4.000000, 4.000000)" fill="url(#linearGradient-1)" fill-rule="nonzero">
|
|
16
|
+
<g id="icon-telephone" transform="translate(0.562500, 0.562500)">
|
|
17
|
+
<path d="M2.95096251,4.92836852 C3.29102971,5.26581039 3.77628321,5.60277158 3.77628321,5.60277158 C3.77628321,5.60277158 4.40769739,6.08441938 4.84471786,5.79504615 C5.81571204,5.21726106 5.81571204,4.97691785 6.30145274,5.26581039 C8.00032717,6.18055666 7.90337391,6.80641039 7.85465368,6.99916564 C7.70898019,7.57695073 6.59279972,8.10666717 5.37869158,7.76970598 C4.11635041,7.4327448 2.90272948,6.80641039 1.97996832,5.89166412 C1.05769436,4.97691785 0.37804715,3.77279836 0.0867001737,2.52061022 C-0.204646803,1.31697141 0.28060669,0.209469884 0.912020873,0.0162339413 C1.05769436,-0.0318347013 1.68862134,-0.0799033438 2.65961553,1.55779531 C2.95096251,2.03896242 2.70833576,2.03896242 2.12564181,3.00225802 C1.83429483,3.43583717 2.32003553,4.0616909 2.32003553,4.0616909 C2.32003553,4.0616909 2.6113825,4.59140734 2.95096251,4.92836852 L2.95096251,4.92836852 Z" id="路径"></path>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|