n20-common-lib 1.2.41 → 1.2.44
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/package.json +1 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/Empty/.DS_Store +0 -0
- package/src/components/Empty/img/.DS_Store +0 -0
- package/src/components/Layout/.DS_Store +0 -0
- package/src/components/Layout/AsideNav/index.vue +1 -0
- package/src/components/LoginTemporary/form.vue +5 -9
- package/src/components/LoginTemporary/index.vue +3 -3
- package/src/components/LoginTemporary/qrcode.vue +90 -90
- package/src/components/LoginTemporary/utils.js +73 -73
- package/src/components/NstcG6Components/.DS_Store +0 -0
- package/src/utils/repairElementUI.js +29 -0
- package/src/components/NstcG6Components/NstcDialog/NstcDialog.vue +0 -185
- package/style/css/normalize.scss +0 -726
- package/style/fonts/element-icons.535877f5.woff +0 -0
- package/style/fonts/element-icons.732389de.ttf +0 -0
- package/style/fonts/iconfont.022f36c4.woff2 +0 -0
- package/style/fonts/iconfont.4a1b2c93.woff +0 -0
- package/style/fonts/iconfont.a9febaa2.ttf +0 -0
- package/style/index.css +0 -4
- package/style/index.css.map +0 -1
- package/style/index.umd.min.js +0 -2
- package/style/index.umd.min.js.map +0 -1
- package/style/pageDemo/demo-1.vue +0 -131
- package/style/pageDemo/demo-2.vue +0 -35
- package/style/pageDemo/demo-3.vue +0 -22
- package/style/pageDemo/seeCode.js +0 -20
- package/style/server-config.jsonc +0 -607
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,7 +293,7 @@ export default {
|
|
|
293
293
|
mobile: type === 'phone' ? this.form[type] : '',
|
|
294
294
|
username: type !== 'phone' ? this.form[type] : ''
|
|
295
295
|
},
|
|
296
|
-
{ loading: false
|
|
296
|
+
{ loading: false }
|
|
297
297
|
)
|
|
298
298
|
.then(() => {
|
|
299
299
|
this.$message.success(
|
|
@@ -303,9 +303,6 @@ export default {
|
|
|
303
303
|
.catch(() => {
|
|
304
304
|
clearTimeout(this.setTimeNum)
|
|
305
305
|
this.codeNum = '验证码'
|
|
306
|
-
this.$message.warning(
|
|
307
|
-
`${typeName}: ${this.form[type]} 验证码发送失败`
|
|
308
|
-
)
|
|
309
306
|
})
|
|
310
307
|
}
|
|
311
308
|
})
|
|
@@ -382,12 +379,9 @@ export default {
|
|
|
382
379
|
this.loadingV = false
|
|
383
380
|
this.theType = 'accountPthon'
|
|
384
381
|
|
|
385
|
-
this.sendMsg('username', '账户')
|
|
386
382
|
this.outTime(60)
|
|
387
383
|
return
|
|
388
|
-
}
|
|
389
|
-
// 签名验签
|
|
390
|
-
else if (cL.data === false) {
|
|
384
|
+
} else if (cL.data === false /* 签名验签 */) {
|
|
391
385
|
// 获取线上签名uDn
|
|
392
386
|
let uDn = await axios.get(
|
|
393
387
|
`/bems/prod_1.0/dssc/sign/getUserDn/${username}/password`,
|
|
@@ -519,7 +513,9 @@ export default {
|
|
|
519
513
|
let username = this.userNo
|
|
520
514
|
let { data } = await axios.get(
|
|
521
515
|
// '/bems/prod_1.0/user/api/userController/userCltAdDep/' + username
|
|
522
|
-
'/bems/prod_1.0/user/api/userController/userCltAdRole/' + username
|
|
516
|
+
'/bems/prod_1.0/user/api/userController/userCltAdRole/' + username,
|
|
517
|
+
null,
|
|
518
|
+
{ loading: false }
|
|
523
519
|
)
|
|
524
520
|
let userInfo = data || { uname: username }
|
|
525
521
|
|
|
@@ -107,8 +107,8 @@ export default {
|
|
|
107
107
|
<style scoped>
|
|
108
108
|
.login-logo-box {
|
|
109
109
|
position: absolute;
|
|
110
|
-
top:
|
|
111
|
-
left:
|
|
110
|
+
top: 88px;
|
|
111
|
+
left: 116px;
|
|
112
112
|
color: #ffffff;
|
|
113
113
|
}
|
|
114
114
|
.login-logo-hr {
|
|
@@ -121,7 +121,7 @@ export default {
|
|
|
121
121
|
}
|
|
122
122
|
.login-form {
|
|
123
123
|
position: absolute;
|
|
124
|
-
top:
|
|
124
|
+
top: 25%;
|
|
125
125
|
right: 10%;
|
|
126
126
|
width: 324px;
|
|
127
127
|
min-height: 360px;
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-loading="loadingV">
|
|
3
|
-
<canvas
|
|
4
|
-
ref="qr-canvas"
|
|
5
|
-
style="display: block; width: 212px; height: 212px; margin: 0 auto"
|
|
6
|
-
></canvas>
|
|
7
|
-
<div
|
|
8
|
-
class="text-r"
|
|
9
|
-
style="font-size: 12px; color: #3d4a57; margin-bottom: -8px"
|
|
10
|
-
>
|
|
11
|
-
请使用网银移动端扫码免Ukey登录<el-button
|
|
12
|
-
class="m-l-s"
|
|
13
|
-
type="text"
|
|
14
|
-
@click="refreshQrCode"
|
|
15
|
-
>
|
|
16
|
-
<i class="el-icon-refresh"></i>
|
|
17
|
-
刷新</el-button
|
|
18
|
-
>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
<script>
|
|
23
|
-
import QRCode from 'qrcode'
|
|
24
|
-
import axios from '../../utils/axios'
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
data() {
|
|
28
|
-
this.timeA = undefined
|
|
29
|
-
return {
|
|
30
|
-
loadingV: false,
|
|
31
|
-
qrCode: ''
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
created() {
|
|
35
|
-
this.getQrcode()
|
|
36
|
-
},
|
|
37
|
-
beforeDestroy() {
|
|
38
|
-
clearTimeout(this.timeA)
|
|
39
|
-
},
|
|
40
|
-
methods: {
|
|
41
|
-
getQrcode() {
|
|
42
|
-
this.loadingV = true
|
|
43
|
-
let loading = () => {
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
this.loadingV = false
|
|
46
|
-
}, 500)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
axios
|
|
50
|
-
.get('/bems/prod_1.0/uas/api/qrCode', null, { loading })
|
|
51
|
-
.then(({ data }) => {
|
|
52
|
-
this.qrCode = data.qrCode
|
|
53
|
-
|
|
54
|
-
let qrCanvas = this.$refs['qr-canvas']
|
|
55
|
-
let width = qrCanvas.clientWidth
|
|
56
|
-
|
|
57
|
-
QRCode.toCanvas(this.$refs['qr-canvas'], this.qrCode, {
|
|
58
|
-
width: width,
|
|
59
|
-
height: width,
|
|
60
|
-
margin: 1
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
this.getQrCodePwd()
|
|
64
|
-
})
|
|
65
|
-
},
|
|
66
|
-
refreshQrCode() {
|
|
67
|
-
this.getQrcode()
|
|
68
|
-
},
|
|
69
|
-
getQrCodePwd() {
|
|
70
|
-
axios
|
|
71
|
-
.get(`/bems/prod_1.0/uas/api/qrCode/${this.qrCode}`, null, {
|
|
72
|
-
loading: false
|
|
73
|
-
})
|
|
74
|
-
.then(({ data }) => {
|
|
75
|
-
clearTimeout(this.timeA)
|
|
76
|
-
if (data.status === 3) {
|
|
77
|
-
this.QrcodeLogin(data)
|
|
78
|
-
} else {
|
|
79
|
-
this.timeA = setTimeout(() => {
|
|
80
|
-
this.getQrCodePwd()
|
|
81
|
-
}, 2000)
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
},
|
|
85
|
-
QrcodeLogin({ userNo, qrcode }) {
|
|
86
|
-
this.$emit('qrcode-login', { userNo, qrcode })
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="loadingV">
|
|
3
|
+
<canvas
|
|
4
|
+
ref="qr-canvas"
|
|
5
|
+
style="display: block; width: 212px; height: 212px; margin: 0 auto"
|
|
6
|
+
></canvas>
|
|
7
|
+
<div
|
|
8
|
+
class="text-r"
|
|
9
|
+
style="font-size: 12px; color: #3d4a57; margin-bottom: -8px"
|
|
10
|
+
>
|
|
11
|
+
请使用网银移动端扫码免Ukey登录<el-button
|
|
12
|
+
class="m-l-s"
|
|
13
|
+
type="text"
|
|
14
|
+
@click="refreshQrCode"
|
|
15
|
+
>
|
|
16
|
+
<i class="el-icon-refresh"></i>
|
|
17
|
+
刷新</el-button
|
|
18
|
+
>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
import QRCode from 'qrcode'
|
|
24
|
+
import axios from '../../utils/axios'
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
data() {
|
|
28
|
+
this.timeA = undefined
|
|
29
|
+
return {
|
|
30
|
+
loadingV: false,
|
|
31
|
+
qrCode: ''
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
created() {
|
|
35
|
+
this.getQrcode()
|
|
36
|
+
},
|
|
37
|
+
beforeDestroy() {
|
|
38
|
+
clearTimeout(this.timeA)
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
getQrcode() {
|
|
42
|
+
this.loadingV = true
|
|
43
|
+
let loading = () => {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
this.loadingV = false
|
|
46
|
+
}, 500)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
axios
|
|
50
|
+
.get('/bems/prod_1.0/uas/api/qrCode', null, { loading })
|
|
51
|
+
.then(({ data }) => {
|
|
52
|
+
this.qrCode = data.qrCode
|
|
53
|
+
|
|
54
|
+
let qrCanvas = this.$refs['qr-canvas']
|
|
55
|
+
let width = qrCanvas.clientWidth
|
|
56
|
+
|
|
57
|
+
QRCode.toCanvas(this.$refs['qr-canvas'], this.qrCode, {
|
|
58
|
+
width: width,
|
|
59
|
+
height: width,
|
|
60
|
+
margin: 1
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
this.getQrCodePwd()
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
refreshQrCode() {
|
|
67
|
+
this.getQrcode()
|
|
68
|
+
},
|
|
69
|
+
getQrCodePwd() {
|
|
70
|
+
axios
|
|
71
|
+
.get(`/bems/prod_1.0/uas/api/qrCode/${this.qrCode}`, null, {
|
|
72
|
+
loading: false
|
|
73
|
+
})
|
|
74
|
+
.then(({ data }) => {
|
|
75
|
+
clearTimeout(this.timeA)
|
|
76
|
+
if (data.status === 3) {
|
|
77
|
+
this.QrcodeLogin(data)
|
|
78
|
+
} else {
|
|
79
|
+
this.timeA = setTimeout(() => {
|
|
80
|
+
this.getQrCodePwd()
|
|
81
|
+
}, 2000)
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
QrcodeLogin({ userNo, qrcode }) {
|
|
86
|
+
this.$emit('qrcode-login', { userNo, qrcode })
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import forEachs from '../../utils/forEachs'
|
|
2
|
-
import list2tree from '../../utils/list2tree'
|
|
3
|
-
|
|
4
|
-
export function siteTree2menus(siteTree) {
|
|
5
|
-
let list_1 = []
|
|
6
|
-
|
|
7
|
-
forEachs(siteTree, (item) => {
|
|
8
|
-
if (item.resType === '1' || item.resType === '2') {
|
|
9
|
-
list_1.push(item)
|
|
10
|
-
}
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
let list_2 = []
|
|
14
|
-
list_1.forEach((item) => {
|
|
15
|
-
let menuObj = {
|
|
16
|
-
menuid: item.menuid,
|
|
17
|
-
pmid: item.pmid,
|
|
18
|
-
sortnum: item.sortnum ? Number(item.sortnum) : item.menuid,
|
|
19
|
-
appNo: item.appNo || undefined,
|
|
20
|
-
title: item.label
|
|
21
|
-
}
|
|
22
|
-
if (/^http(s)?:|\/\//.test(item.pageurl)) {
|
|
23
|
-
menuObj.href = item.pageurl
|
|
24
|
-
} else {
|
|
25
|
-
menuObj.route = item.pageurl
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (/\//.test(item.logo)) {
|
|
29
|
-
menuObj.iconUrl = item.logo
|
|
30
|
-
} else {
|
|
31
|
-
menuObj.iconClass = item.logo
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (item.resType === '2') {
|
|
35
|
-
menuObj.hide = true
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
list_2.push(menuObj)
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
return list2tree(list_2, 'menuid', 'pmid', 'children', 'sortnum')
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function siteTree2RelaNos(siteTree) {
|
|
45
|
-
let relaNos = []
|
|
46
|
-
siteTree.forEach((m) => {
|
|
47
|
-
let oRelaObj = relaNos.find((item) => item.appNo === m.appNo)
|
|
48
|
-
if (oRelaObj) {
|
|
49
|
-
m.treeno && oRelaObj.relaNos.push(m.treeno)
|
|
50
|
-
if (Array.isArray(m.children)) {
|
|
51
|
-
forEachs(m.children, (item) => {
|
|
52
|
-
item.treeno && oRelaObj.relaNos.push(item.treeno)
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
oRelaObj = {
|
|
57
|
-
appNo: m.appNo,
|
|
58
|
-
label: m.label,
|
|
59
|
-
pageurl: m.pageurl,
|
|
60
|
-
relaNos: []
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
m.treeno && oRelaObj.relaNos.push(m.treeno)
|
|
64
|
-
if (Array.isArray(m.children)) {
|
|
65
|
-
forEachs(m.children, (item) => {
|
|
66
|
-
item.treeno && oRelaObj.relaNos.push(item.treeno)
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
relaNos.push(oRelaObj)
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
return relaNos
|
|
73
|
-
}
|
|
1
|
+
import forEachs from '../../utils/forEachs'
|
|
2
|
+
import list2tree from '../../utils/list2tree'
|
|
3
|
+
|
|
4
|
+
export function siteTree2menus(siteTree) {
|
|
5
|
+
let list_1 = []
|
|
6
|
+
|
|
7
|
+
forEachs(siteTree, (item) => {
|
|
8
|
+
if (item.resType === '1' || item.resType === '2') {
|
|
9
|
+
list_1.push(item)
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
let list_2 = []
|
|
14
|
+
list_1.forEach((item) => {
|
|
15
|
+
let menuObj = {
|
|
16
|
+
menuid: item.menuid,
|
|
17
|
+
pmid: item.pmid,
|
|
18
|
+
sortnum: item.sortnum ? Number(item.sortnum) : item.menuid,
|
|
19
|
+
appNo: item.appNo || undefined,
|
|
20
|
+
title: item.label
|
|
21
|
+
}
|
|
22
|
+
if (/^http(s)?:|\/\//.test(item.pageurl)) {
|
|
23
|
+
menuObj.href = item.pageurl
|
|
24
|
+
} else {
|
|
25
|
+
menuObj.route = item.pageurl
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (/\//.test(item.logo)) {
|
|
29
|
+
menuObj.iconUrl = item.logo
|
|
30
|
+
} else {
|
|
31
|
+
menuObj.iconClass = item.logo
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (item.resType === '2') {
|
|
35
|
+
menuObj.hide = true
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
list_2.push(menuObj)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
return list2tree(list_2, 'menuid', 'pmid', 'children', 'sortnum')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function siteTree2RelaNos(siteTree) {
|
|
45
|
+
let relaNos = []
|
|
46
|
+
siteTree.forEach((m) => {
|
|
47
|
+
let oRelaObj = relaNos.find((item) => item.appNo === m.appNo)
|
|
48
|
+
if (oRelaObj) {
|
|
49
|
+
m.treeno && oRelaObj.relaNos.push(m.treeno)
|
|
50
|
+
if (Array.isArray(m.children)) {
|
|
51
|
+
forEachs(m.children, (item) => {
|
|
52
|
+
item.treeno && oRelaObj.relaNos.push(item.treeno)
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
oRelaObj = {
|
|
57
|
+
appNo: m.appNo,
|
|
58
|
+
label: m.label,
|
|
59
|
+
pageurl: m.pageurl,
|
|
60
|
+
relaNos: []
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
m.treeno && oRelaObj.relaNos.push(m.treeno)
|
|
64
|
+
if (Array.isArray(m.children)) {
|
|
65
|
+
forEachs(m.children, (item) => {
|
|
66
|
+
item.treeno && oRelaObj.relaNos.push(item.treeno)
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
relaNos.push(oRelaObj)
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
return relaNos
|
|
73
|
+
}
|
|
Binary file
|
|
@@ -7,6 +7,12 @@ function setPropsDefault(component, props) {
|
|
|
7
7
|
c_props[key] = Object.assign({}, c_props[key], props[key])
|
|
8
8
|
})
|
|
9
9
|
}
|
|
10
|
+
function setMethodsDefault(component, methods) {
|
|
11
|
+
let c_methods = component.methods
|
|
12
|
+
Object.keys(methods).forEach((key) => {
|
|
13
|
+
c_methods[key] = methods[key]
|
|
14
|
+
})
|
|
15
|
+
}
|
|
10
16
|
|
|
11
17
|
function repairPopper() {
|
|
12
18
|
if (!Popper.prototype.repairR) {
|
|
@@ -63,4 +69,27 @@ export default function (ElementUI) {
|
|
|
63
69
|
default: true
|
|
64
70
|
}
|
|
65
71
|
})
|
|
72
|
+
|
|
73
|
+
setMethodsDefault(ElementUI.TableColumn, {
|
|
74
|
+
setColumnWidth(column) {
|
|
75
|
+
if (this.realWidth) {
|
|
76
|
+
column.width = this.realWidth
|
|
77
|
+
}
|
|
78
|
+
if (this.realMinWidth) {
|
|
79
|
+
column.minWidth = this.realMinWidth
|
|
80
|
+
}
|
|
81
|
+
if (!column.minWidth) {
|
|
82
|
+
if (!column.width) {
|
|
83
|
+
let label = column.label || ''
|
|
84
|
+
let sortable = column.sortable ? 24 : 0
|
|
85
|
+
let filters = column.filters ? 16 : 0
|
|
86
|
+
column.minWidth = Math.max(80, label.length * 14 + 22 + sortable + filters)
|
|
87
|
+
} else {
|
|
88
|
+
column.minWidth = 80
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
column.realWidth = column.width === undefined ? column.minWidth : column.width
|
|
92
|
+
return column
|
|
93
|
+
}
|
|
94
|
+
})
|
|
66
95
|
}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
class="Nstc-dialog"
|
|
4
|
-
v-drag
|
|
5
|
-
:visible.sync="dialogVisible"
|
|
6
|
-
v-bind="$attrs"
|
|
7
|
-
:center="center"
|
|
8
|
-
:show-close="showClose"
|
|
9
|
-
:custom-class="customClass"
|
|
10
|
-
:append-to-body="toBody"
|
|
11
|
-
:close-on-click-modal="closeOnClickModal"
|
|
12
|
-
:close-on-press-escape="closeOnPressEscape"
|
|
13
|
-
:before-close="()=>{handleClose()}"
|
|
14
|
-
v-on="$listeners"
|
|
15
|
-
>
|
|
16
|
-
<template slot="title">
|
|
17
|
-
<span class="el-dialog__title">{{ title }}</span>
|
|
18
|
-
<button class="el-dialog__headerbtn" @click="handleClose">
|
|
19
|
-
<i class="el-dialog__close el-icon-close"></i>
|
|
20
|
-
</button>
|
|
21
|
-
</template>
|
|
22
|
-
<slot></slot>
|
|
23
|
-
|
|
24
|
-
<slot name="after"></slot>
|
|
25
|
-
<div
|
|
26
|
-
v-if="showFooter"
|
|
27
|
-
slot="footer"
|
|
28
|
-
class="dialog-footer"
|
|
29
|
-
>
|
|
30
|
-
<el-button
|
|
31
|
-
v-if="footerHandlers.confirm"
|
|
32
|
-
type="primary"
|
|
33
|
-
:disabled="footerHandlers.confirm.disabled || confirmDisabledFlag"
|
|
34
|
-
:class="footerHandlers.confirm.className"
|
|
35
|
-
@click="handleConfirm"
|
|
36
|
-
>
|
|
37
|
-
{{ footerHandlers.confirm.text || '确认' }}
|
|
38
|
-
</el-button>
|
|
39
|
-
<el-button
|
|
40
|
-
v-if="footerHandlers.cancel"
|
|
41
|
-
plain
|
|
42
|
-
:class="footerHandlers.cancel.className"
|
|
43
|
-
@click="handleClose"
|
|
44
|
-
>
|
|
45
|
-
{{ footerHandlers.cancel.text || '取消' }}
|
|
46
|
-
</el-button>
|
|
47
|
-
</div>
|
|
48
|
-
</el-dialog>
|
|
49
|
-
</template>
|
|
50
|
-
|
|
51
|
-
<script>
|
|
52
|
-
export default {
|
|
53
|
-
name: 'NstcDialog',
|
|
54
|
-
props: {
|
|
55
|
-
value: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: false
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
title: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: ''
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
center: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: false
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
footerHandlers: {
|
|
71
|
-
type: Object,
|
|
72
|
-
default: () => {
|
|
73
|
-
return {
|
|
74
|
-
confirm: {
|
|
75
|
-
text: '', //this.$t('common_w_0002')
|
|
76
|
-
className: '',
|
|
77
|
-
disabled: false
|
|
78
|
-
},
|
|
79
|
-
cancel: {
|
|
80
|
-
text: '', // this.t('common_w_0003')
|
|
81
|
-
className: '',
|
|
82
|
-
disabled: false
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
toBody: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
default: true
|
|
91
|
-
},
|
|
92
|
-
customClass: {
|
|
93
|
-
type: String,
|
|
94
|
-
default: ''
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
showFooter: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: true
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
showClose: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: false
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
/** 是否在点击确认按钮后关闭弹窗 */
|
|
108
|
-
closeAfterConfirm: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: true
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
/** 是否在点击确认按钮后立即关闭弹窗 */
|
|
114
|
-
immediateCloseAfterHandler: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: false
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
closeOnClickModal: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
default: false
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
closeOnPressEscape: {
|
|
125
|
-
type: Boolean,
|
|
126
|
-
default: false
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
confirmDisabledFlag: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
default: false
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
computed: {
|
|
135
|
-
dialogVisible: {
|
|
136
|
-
get() {
|
|
137
|
-
return this.value
|
|
138
|
-
},
|
|
139
|
-
set(val) {
|
|
140
|
-
this.$emit('input', val)
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
methods: {
|
|
145
|
-
handleConfirm() {
|
|
146
|
-
this.handleListeners('confirm')
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
handleClose() {
|
|
150
|
-
this.handleListeners('cancel')
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
async handleListeners(type) {
|
|
154
|
-
this.loading = true
|
|
155
|
-
try {
|
|
156
|
-
const listener = this.$listeners[type]
|
|
157
|
-
const closeAfterListener = this.closeAfterConfirm || type === 'cancel'
|
|
158
|
-
|
|
159
|
-
if (this.immediateCloseAfterHandler) {
|
|
160
|
-
if (closeAfterListener) {
|
|
161
|
-
this.dialogVisible = false
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
listener && await listener()
|
|
165
|
-
} else {
|
|
166
|
-
listener && await listener()
|
|
167
|
-
|
|
168
|
-
if (closeAfterListener) {
|
|
169
|
-
this.dialogVisible = false
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
} catch (err) {
|
|
173
|
-
console.error(err)
|
|
174
|
-
|
|
175
|
-
err && err.type === 'VALIDATE_ERROR' && this.$message({
|
|
176
|
-
type: 'warning',
|
|
177
|
-
message: err.msg
|
|
178
|
-
})
|
|
179
|
-
} finally {
|
|
180
|
-
this.loading = false
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
</script>
|