n20-common-lib 1.1.98
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 +27 -0
- package/package.json +87 -0
- package/src/_qiankun/index.js +113 -0
- package/src/_qiankun/postMessage.js +48 -0
- package/src/assets/css/_coreLib.scss +35 -0
- package/src/assets/css/cl-anchor.scss +24 -0
- package/src/assets/css/cl-approve-card.scss +58 -0
- package/src/assets/css/cl-dialog.scss +99 -0
- package/src/assets/css/cl-drag-list.scss +22 -0
- package/src/assets/css/cl-empty.scss +10 -0
- package/src/assets/css/cl-expandable-pane.scss +25 -0
- package/src/assets/css/cl-expandable.scss +23 -0
- package/src/assets/css/cl-file-upload-table.scss +11 -0
- package/src/assets/css/cl-filter.scss +4 -0
- package/src/assets/css/cl-flow-step.scss +186 -0
- package/src/assets/css/cl-footer-box.scss +10 -0
- package/src/assets/css/cl-form-item.scss +322 -0
- package/src/assets/css/cl-general-card.scss +12 -0
- package/src/assets/css/cl-layout-aside.scss +88 -0
- package/src/assets/css/cl-layout-content.scss +16 -0
- package/src/assets/css/cl-layout-header.scss +73 -0
- package/src/assets/css/cl-layout-tabs.scss +87 -0
- package/src/assets/css/cl-layout.scss +97 -0
- package/src/assets/css/cl-login-temporary.scss +37 -0
- package/src/assets/css/cl-message.scss +75 -0
- package/src/assets/css/cl-more-tab.scss +98 -0
- package/src/assets/css/cl-nav-menu.scss +5 -0
- package/src/assets/css/cl-pagination.scss +65 -0
- package/src/assets/css/cl-secondary-tab.scss +39 -0
- package/src/assets/css/cl-showcolumn.scss +23 -0
- package/src/assets/css/cl-sifting.scss +51 -0
- package/src/assets/css/cl-statis.scss +42 -0
- package/src/assets/css/cl-step.scss +73 -0
- package/src/assets/css/cl-suspend.scss +19 -0
- package/src/assets/css/cl-tertiary-tab.scss +9 -0
- package/src/assets/css/cl-upload.scss +41 -0
- package/src/assets/css/cl-worn-pagination.scss +50 -0
- package/src/assets/css/el-button.scss +169 -0
- package/src/assets/css/el-table.scss +79 -0
- package/src/assets/css/element-variables.scss +1061 -0
- package/src/assets/css/element.dev.scss +21 -0
- package/src/assets/css/font-icon.scss +26 -0
- package/src/assets/css/index.dev.scss +4 -0
- package/src/assets/css/index.scss +11 -0
- package/src/assets/css/normalize.scss +723 -0
- package/src/assets/css/rootvar.scss +139 -0
- package/src/assets/css/select.scss +26 -0
- package/src/assets/css/title-pop.scss +4 -0
- package/src/assets/getJsonc.js +50 -0
- package/src/assets/realUrl.js +12 -0
- package/src/components/Anchor/AnchorItem.vue +30 -0
- package/src/components/Anchor/index.vue +185 -0
- package/src/components/ApprovalButtons/index.vue +232 -0
- package/src/components/ApprovalCard/index.vue +128 -0
- package/src/components/ApprovalRecord/approvalImg.vue +39 -0
- package/src/components/ApprovalRecord/index.vue +59 -0
- package/src/components/Button/button-group.vue +150 -0
- package/src/components/Button/icon-group-button.vue +61 -0
- package/src/components/Button/index.vue +56 -0
- package/src/components/ContentLoading/index.vue +41 -0
- package/src/components/ContentNull/index.vue +19 -0
- package/src/components/DatePicker/index.vue +27 -0
- package/src/components/DatePicker/por.vue +169 -0
- package/src/components/Dialog/index.vue +26 -0
- package/src/components/Dialog/indexO.vue +116 -0
- package/src/components/DragList/index.vue +68 -0
- package/src/components/Empty/img/404.png +0 -0
- package/src/components/Empty/img/abnormal.svg +109 -0
- package/src/components/Empty/img/dispose.svg +72 -0
- package/src/components/Empty/img/empty.svg +58 -0
- package/src/components/Empty/img/general.svg +59 -0
- package/src/components/Empty/img/lock.svg +58 -0
- package/src/components/Empty/img/network.svg +60 -0
- package/src/components/Empty/img/relevant.svg +69 -0
- package/src/components/Empty/img/search.svg +73 -0
- package/src/components/Empty/index.vue +92 -0
- package/src/components/Expandable/index.vue +49 -0
- package/src/components/Expandable/main.vue +52 -0
- package/src/components/FileUploadTable/index.vue +484 -0
- package/src/components/Filters/index.vue +358 -0
- package/src/components/Filters/indexO.vue +104 -0
- package/src/components/FlowStep/index.vue +69 -0
- package/src/components/FooterBox/index.vue +21 -0
- package/src/components/GeneralCard/index.vue +15 -0
- package/src/components/InputNumber/index.vue +153 -0
- package/src/components/InputNumber/numberRange.vue +47 -0
- package/src/components/InputSearch/index.vue +75 -0
- package/src/components/Layout/AsideNav/index.vue +144 -0
- package/src/components/Layout/HeaderWrap/changePwd.vue +215 -0
- package/src/components/Layout/HeaderWrap/index.vue +336 -0
- package/src/components/Layout/HeaderWrap/noticePop.vue +300 -0
- package/src/components/Layout/SubContent/index.vue +131 -0
- package/src/components/Layout/TabsNav/index.vue +170 -0
- package/src/components/Layout/index.vue +529 -0
- package/src/components/Layout/utils.js +12 -0
- package/src/components/LoginTemporary/form.vue +511 -0
- package/src/components/LoginTemporary/index.vue +122 -0
- package/src/components/LoginTemporary/qr.png +0 -0
- package/src/components/LoginTemporary/qrcode.vue +90 -0
- package/src/components/LoginTemporary/qrt.png +0 -0
- package/src/components/LoginTemporary/retrievePw.vue +28 -0
- package/src/components/LoginTemporary/utils.js +73 -0
- package/src/components/MicroApp/index.js +67 -0
- package/src/components/MicroFrame/index.vue +95 -0
- package/src/components/MoreTab/index.vue +232 -0
- package/src/components/NavMenu/index.vue +60 -0
- package/src/components/NstcG6Components/NstcApprovel/NstcApprovel.vue +13 -0
- package/src/components/NstcG6Components/NstcDialog/NstcDialog.vue +185 -0
- package/src/components/NstcG6Components/Progress/progress.vue +134 -0
- package/src/components/PageLayout/page.vue +15 -0
- package/src/components/Pagination/index.vue +96 -0
- package/src/components/SecondaryTab/index.vue +58 -0
- package/src/components/SelectLazy/index.vue +75 -0
- package/src/components/SelectTree/SelectTreeLazy.vue +241 -0
- package/src/components/SelectTree/index.vue +208 -0
- package/src/components/ShowColumn/index.vue +188 -0
- package/src/components/Sifting/index.vue +99 -0
- package/src/components/Statis/index.vue +97 -0
- package/src/components/Statis/statisItem.vue +54 -0
- package/src/components/Statis/statisPopover.vue +55 -0
- package/src/components/Step/index.vue +38 -0
- package/src/components/Suspend/index.vue +72 -0
- package/src/components/Table/index.vue +131 -0
- package/src/components/Table/indexO.vue +149 -0
- package/src/components/Task/index.vue +26 -0
- package/src/components/TertiaryTab/index.vue +53 -0
- package/src/components/TimePicker/index.vue +28 -0
- package/src/components/Upload/index.vue +242 -0
- package/src/components/WornPagination/index.vue +73 -0
- package/src/directives/VClickOutside/index.js +19 -0
- package/src/directives/VDrag/index.js +72 -0
- package/src/directives/VHas/index.js +27 -0
- package/src/directives/VMove/index.js +42 -0
- package/src/directives/VTitle/index.js +56 -0
- package/src/directives/VTitle/tooltip.vue +21 -0
- package/src/index.js +225 -0
- package/src/plugins/CompatibleOld/index.js +57 -0
- package/src/plugins/Print/index.js +4 -0
- package/src/plugins/Print/print-js/.babelrc +12 -0
- package/src/plugins/Print/print-js/LICENSE +21 -0
- package/src/plugins/Print/print-js/README.md +98 -0
- package/src/plugins/Print/print-js/dist/print.css +97 -0
- package/src/plugins/Print/print-js/dist/print.js +991 -0
- package/src/plugins/Print/print-js/dist/print.map +1 -0
- package/src/plugins/Print/print-js/package.json +60 -0
- package/src/plugins/Print/print-js/src/index.d.ts +45 -0
- package/src/plugins/Print/print-js/src/index.js +10 -0
- package/src/plugins/Print/print-js/src/js/browser.js +33 -0
- package/src/plugins/Print/print-js/src/js/functions.js +103 -0
- package/src/plugins/Print/print-js/src/js/html.js +70 -0
- package/src/plugins/Print/print-js/src/js/image.js +48 -0
- package/src/plugins/Print/print-js/src/js/init.js +168 -0
- package/src/plugins/Print/print-js/src/js/json.js +109 -0
- package/src/plugins/Print/print-js/src/js/modal.js +62 -0
- package/src/plugins/Print/print-js/src/js/pdf.js +62 -0
- package/src/plugins/Print/print-js/src/js/print.js +102 -0
- package/src/plugins/Print/print-js/src/js/raw-html.js +15 -0
- package/src/plugins/Print/print-js/src/sass/index.scss +14 -0
- package/src/plugins/Print/print-js/src/sass/modules/_colors.scss +10 -0
- package/src/plugins/Print/print-js/src/sass/partials/_modal.scss +41 -0
- package/src/plugins/Print/print-js/src/sass/partials/_spinner.scss +46 -0
- package/src/plugins/Print/print.js +2 -0
- package/src/plugins/Print/print.scss +1 -0
- package/src/plugins/SetMenuTree/index.vue +41 -0
- package/src/plugins/SetMenuTree/logoIcon.vue +37 -0
- package/src/plugins/SetMenuTree/setmenutree.vue +427 -0
- package/src/plugins/SetMenuTree/utils.js +74 -0
- package/src/plugins/Sign/InfosecNetSignCNGAgent.min.js +2000 -0
- package/src/plugins/Sign/index.js +65 -0
- package/src/plugins/Sign/sign.js +1 -0
- package/src/plugins/setTabsForSub.js +2 -0
- package/src/utils/auth.js +53 -0
- package/src/utils/axios.js +203 -0
- package/src/utils/downloadBlob.js +19 -0
- package/src/utils/forEachs.js +16 -0
- package/src/utils/getScrollContainer.js +43 -0
- package/src/utils/i18n/cn2hk.json +1270 -0
- package/src/utils/i18n/index.js +54 -0
- package/src/utils/list2tree.js +36 -0
- package/src/utils/msgboxPor.js +26 -0
- package/src/utils/print.js +161 -0
- package/src/utils/relaNo.js +35 -0
- package/src/utils/repairElementUI.js +66 -0
- package/src/utils/urlToGo.js +82 -0
- package/style/css/normalize.scss +723 -0
- package/style/fonts/element-icons.535877f5.woff +0 -0
- package/style/fonts/element-icons.732389de.ttf +0 -0
- package/style/index.css +3 -0
- package/style/index.css.map +1 -0
- package/style/index.umd.min.js +2 -0
- package/style/index.umd.min.js.map +1 -0
- package/style/pageDemo/demo-1.vue +130 -0
- package/style/pageDemo/demo-2.vue +35 -0
- package/style/pageDemo/demo-3.vue +22 -0
- package/style/pageDemo/seeCode.js +20 -0
- package/style/server-config.jsonc +663 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="n20-num-w">
|
|
3
|
+
<el-input
|
|
4
|
+
v-if="showStr"
|
|
5
|
+
class="n20-stc"
|
|
6
|
+
:class="{ 'n20-num--rate': type === 'rate' }"
|
|
7
|
+
:value="valueStr"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
:placeholder="$attrs.placeholder"
|
|
10
|
+
@focus="focusFn"
|
|
11
|
+
/>
|
|
12
|
+
<el-input-number
|
|
13
|
+
v-else
|
|
14
|
+
ref="input-number"
|
|
15
|
+
class="n20-num"
|
|
16
|
+
:class="{ 'n20-num--rate': type === 'rate' }"
|
|
17
|
+
:controls="false"
|
|
18
|
+
v-bind="$attrs"
|
|
19
|
+
:value="valueNum"
|
|
20
|
+
v-on="listeners"
|
|
21
|
+
@blur="blurFn"
|
|
22
|
+
@change="changeFn"
|
|
23
|
+
/>
|
|
24
|
+
<span v-if="type === 'rate'" class="el-input__suffix">
|
|
25
|
+
<span class="el-input__icon" style="display: inline-block">{{
|
|
26
|
+
suffix
|
|
27
|
+
}}</span>
|
|
28
|
+
</span>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import numerify from 'numerify'
|
|
34
|
+
export default {
|
|
35
|
+
name: 'InputNumber',
|
|
36
|
+
props: {
|
|
37
|
+
value: {
|
|
38
|
+
type: [Number, String],
|
|
39
|
+
default: undefined
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'money',
|
|
44
|
+
validator(v) {
|
|
45
|
+
return ['money', 'rate'].includes(v)
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: undefined
|
|
51
|
+
},
|
|
52
|
+
clearable: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
dNum: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: undefined
|
|
59
|
+
},
|
|
60
|
+
format: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: undefined
|
|
63
|
+
},
|
|
64
|
+
suffix: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: '%'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
data() {
|
|
70
|
+
this.listeners = Object.assign({}, this.$listeners, { input: () => {} })
|
|
71
|
+
return {
|
|
72
|
+
valueStr: '',
|
|
73
|
+
valueNum: undefined,
|
|
74
|
+
showStr: true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
watch: {
|
|
78
|
+
value: {
|
|
79
|
+
handler(val) {
|
|
80
|
+
if (val && typeof val === 'string' && val.includes(',')) {
|
|
81
|
+
return this.$emit('input', Number(val.replace(/,/g, '')))
|
|
82
|
+
}
|
|
83
|
+
this.valueStr = this.num2str(val)
|
|
84
|
+
},
|
|
85
|
+
immediate: true
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
num2str(val = '') {
|
|
90
|
+
if (val === '' || val === null) {
|
|
91
|
+
return ''
|
|
92
|
+
}
|
|
93
|
+
switch (this.type) {
|
|
94
|
+
case 'rate':
|
|
95
|
+
return numerify(val, this.format || '0.00[00]')
|
|
96
|
+
case 'money':
|
|
97
|
+
default:
|
|
98
|
+
return numerify(val, this.format || '0,0.00')
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
focusFn() {
|
|
102
|
+
if (!this.disabled) {
|
|
103
|
+
this.showStr = false
|
|
104
|
+
this.valueNum =
|
|
105
|
+
this.value === null || this.value === '' ? undefined : this.value
|
|
106
|
+
this.$nextTick(() => {
|
|
107
|
+
this.$refs['input-number'].focus()
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
blurFn() {
|
|
112
|
+
this.showStr = true
|
|
113
|
+
},
|
|
114
|
+
changeFn(val) {
|
|
115
|
+
if (!val && val !== 0) {
|
|
116
|
+
return this.$emit('input', val)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
switch (this.type) {
|
|
120
|
+
case 'rate':
|
|
121
|
+
{
|
|
122
|
+
let varStr = val.toString() + '.'
|
|
123
|
+
let varDLen = varStr.length - varStr.indexOf('.') - 1
|
|
124
|
+
let dNum = this.dNum !== undefined ? this.dNum : 4
|
|
125
|
+
let nVar = Number(val.toFixed(Math.min(varDLen, dNum)))
|
|
126
|
+
if (this.valueNum === nVar) {
|
|
127
|
+
this.valueNum = 0
|
|
128
|
+
}
|
|
129
|
+
this.$nextTick(() => {
|
|
130
|
+
this.valueNum = nVar
|
|
131
|
+
this.$emit('input', nVar)
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
break
|
|
135
|
+
case 'money':
|
|
136
|
+
default:
|
|
137
|
+
{
|
|
138
|
+
let dNum = this.dNum !== undefined ? this.dNum : 2
|
|
139
|
+
let nVar = Number(val.toFixed(dNum))
|
|
140
|
+
if (this.valueNum === nVar) {
|
|
141
|
+
this.valueNum = 0
|
|
142
|
+
}
|
|
143
|
+
this.$nextTick(() => {
|
|
144
|
+
this.valueNum = nVar
|
|
145
|
+
this.$emit('input', nVar)
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
break
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="n20-num-w">
|
|
3
|
+
<inputNumber
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:value="startValue"
|
|
6
|
+
:max="endValue || endValue === 0 ? endValue : $attrs.max"
|
|
7
|
+
:type="type"
|
|
8
|
+
style="width: calc(50% - 8px)"
|
|
9
|
+
@input="(val) => $emit('update:start-value', val)"
|
|
10
|
+
/>
|
|
11
|
+
<span class="numbre-range text-c" style="display: inline-block; width: 16px"
|
|
12
|
+
>-</span
|
|
13
|
+
>
|
|
14
|
+
<inputNumber
|
|
15
|
+
v-bind="$attrs"
|
|
16
|
+
:value="endValue"
|
|
17
|
+
:min="startValue || startValue === 0 ? startValue : $attrs.min"
|
|
18
|
+
:type="type"
|
|
19
|
+
style="width: calc(50% - 8px)"
|
|
20
|
+
@input="(val) => $emit('update:end-value', val)"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import inputNumber from './index.vue'
|
|
27
|
+
export default {
|
|
28
|
+
name: 'InputNumberRange',
|
|
29
|
+
components: {
|
|
30
|
+
inputNumber
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
startValue: {
|
|
34
|
+
type: [String, Number],
|
|
35
|
+
default: undefined
|
|
36
|
+
},
|
|
37
|
+
endValue: {
|
|
38
|
+
type: [String, Number],
|
|
39
|
+
default: undefined
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'money'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-input
|
|
3
|
+
v-if="!select"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:value="value"
|
|
6
|
+
v-on="$listeners"
|
|
7
|
+
@change="searchFn"
|
|
8
|
+
>
|
|
9
|
+
<i
|
|
10
|
+
slot="suffix"
|
|
11
|
+
class="is-search el-input__icon el-icon-search"
|
|
12
|
+
@click.stop="searchFn"
|
|
13
|
+
></i>
|
|
14
|
+
</el-input>
|
|
15
|
+
<div v-else class="n20-input-search">
|
|
16
|
+
<el-select
|
|
17
|
+
ref="input-search"
|
|
18
|
+
v-bind="$attrs"
|
|
19
|
+
:value="value"
|
|
20
|
+
:filterable="select"
|
|
21
|
+
:multiple="multiple"
|
|
22
|
+
:allow-create="true"
|
|
23
|
+
v-on="$listeners"
|
|
24
|
+
@change="changeFn"
|
|
25
|
+
@visible-change="visibleChangeFn"
|
|
26
|
+
>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</el-select>
|
|
29
|
+
<span class="el-input__suffix">
|
|
30
|
+
<span
|
|
31
|
+
class="is-search el-input__icon el-icon-search"
|
|
32
|
+
@click.stop="searchFn"
|
|
33
|
+
></span>
|
|
34
|
+
</span>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
export default {
|
|
40
|
+
name: 'InputSearch',
|
|
41
|
+
props: {
|
|
42
|
+
value: {
|
|
43
|
+
type: [String, Number, Object, Array],
|
|
44
|
+
default: undefined
|
|
45
|
+
},
|
|
46
|
+
select: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
multiple: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
this.listeners = Object.assign({}, this.$listeners, { input: () => {} })
|
|
57
|
+
return {}
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
visibleChangeFn(val) {
|
|
61
|
+
if (val && !this.$refs['input-search']['multiple']) {
|
|
62
|
+
this.$refs['input-search']['selectedLabel'] =
|
|
63
|
+
this.$refs['input-search']['currentPlaceholder']
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
changeFn(val) {
|
|
67
|
+
this.$emit('input', val)
|
|
68
|
+
this.$emit('change', val)
|
|
69
|
+
},
|
|
70
|
+
searchFn() {
|
|
71
|
+
this.$emit('search', this.value)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-menu
|
|
3
|
+
class="layout-aside flex-column"
|
|
4
|
+
:collapse="collapse"
|
|
5
|
+
:default-active="activeNav"
|
|
6
|
+
background-color="#3d4b6a"
|
|
7
|
+
text-color="#fefefea6"
|
|
8
|
+
active-text-color="#ffffff"
|
|
9
|
+
>
|
|
10
|
+
<template v-for="omenus in menus">
|
|
11
|
+
<template v-for="item in omenus.menu">
|
|
12
|
+
<!-- 一级菜单 -->
|
|
13
|
+
<el-menu-item
|
|
14
|
+
v-if="!item.children"
|
|
15
|
+
:key="item.title"
|
|
16
|
+
:index="item.uuid"
|
|
17
|
+
@click="linkFn(item)"
|
|
18
|
+
>
|
|
19
|
+
<i
|
|
20
|
+
v-if="item.iconUrl"
|
|
21
|
+
class="el-icon- icon-url"
|
|
22
|
+
:style="{ backgroundImage: `url(${item.iconUrl})` }"
|
|
23
|
+
></i>
|
|
24
|
+
<i v-else :class="item.iconClass"></i>
|
|
25
|
+
<span v-if="!item.href" slot="title">{{ item | titleF }}</span>
|
|
26
|
+
<a
|
|
27
|
+
v-else
|
|
28
|
+
slot="title"
|
|
29
|
+
:href="item.href"
|
|
30
|
+
target="_blank"
|
|
31
|
+
:rel="/^\//.test(item.href) ? 'opener' : undefined"
|
|
32
|
+
>{{ item | titleF }}</a
|
|
33
|
+
>
|
|
34
|
+
</el-menu-item>
|
|
35
|
+
<el-submenu
|
|
36
|
+
v-else
|
|
37
|
+
:key="item.title"
|
|
38
|
+
:index="item.title"
|
|
39
|
+
popper-class="nav-menu-pop"
|
|
40
|
+
>
|
|
41
|
+
<template slot="title">
|
|
42
|
+
<i
|
|
43
|
+
v-if="item.iconUrl"
|
|
44
|
+
class="el-icon- icon-url"
|
|
45
|
+
:style="{ backgroundImage: `url(${item.iconUrl})` }"
|
|
46
|
+
></i>
|
|
47
|
+
<i v-else :class="item.iconClass"></i>
|
|
48
|
+
<span>{{ item | titleF }}</span>
|
|
49
|
+
</template>
|
|
50
|
+
<template v-for="itemc in item.children">
|
|
51
|
+
<!-- 二级菜单 -->
|
|
52
|
+
<el-menu-item
|
|
53
|
+
v-if="!itemc.children"
|
|
54
|
+
:key="itemc.title"
|
|
55
|
+
:index="itemc.uuid"
|
|
56
|
+
@click="linkFn(itemc)"
|
|
57
|
+
>
|
|
58
|
+
<i
|
|
59
|
+
v-if="itemc.iconUrl"
|
|
60
|
+
class="el-icon- icon-url"
|
|
61
|
+
:style="{ backgroundImage: `url(${itemc.iconUrl})` }"
|
|
62
|
+
></i>
|
|
63
|
+
<i v-else :class="itemc.iconClass"></i>
|
|
64
|
+
<span slot="title">{{ itemc | titleF }}</span>
|
|
65
|
+
</el-menu-item>
|
|
66
|
+
<el-submenu
|
|
67
|
+
v-else
|
|
68
|
+
:key="itemc.title"
|
|
69
|
+
:index="itemc.title"
|
|
70
|
+
popper-class="nav-menu-pop"
|
|
71
|
+
>
|
|
72
|
+
<template slot="title">
|
|
73
|
+
<i
|
|
74
|
+
v-if="itemc.iconUrl"
|
|
75
|
+
class="el-icon- icon-url"
|
|
76
|
+
:style="{ backgroundImage: `url(${itemc.iconUrl})` }"
|
|
77
|
+
></i>
|
|
78
|
+
<i v-else :class="itemc.iconClass"></i>
|
|
79
|
+
<span>{{ itemc | titleF }}</span>
|
|
80
|
+
</template>
|
|
81
|
+
<template v-for="itemcc in itemc.children">
|
|
82
|
+
<!-- 三级菜单 -->
|
|
83
|
+
<el-menu-item
|
|
84
|
+
:key="itemcc.title"
|
|
85
|
+
:index="itemcc.uuid"
|
|
86
|
+
@click="linkFn(itemcc)"
|
|
87
|
+
>
|
|
88
|
+
<i
|
|
89
|
+
v-if="itemcc.iconUrl"
|
|
90
|
+
class="el-icon- icon-url"
|
|
91
|
+
:style="{ backgroundImage: `url(${itemcc.iconUrl})` }"
|
|
92
|
+
></i>
|
|
93
|
+
<i v-else :class="itemcc.iconClass"></i>
|
|
94
|
+
<span slot="title">{{ itemcc | titleF }}</span>
|
|
95
|
+
</el-menu-item>
|
|
96
|
+
</template>
|
|
97
|
+
</el-submenu>
|
|
98
|
+
</template>
|
|
99
|
+
</el-submenu>
|
|
100
|
+
</template>
|
|
101
|
+
</template>
|
|
102
|
+
<span class="flex-item"></span>
|
|
103
|
+
<div class="open-collapsed-btn">
|
|
104
|
+
<span :class="collapse ? 'n20-icon-caidanshouqi f-s-l rotate-icon':'n20-icon-caidanshouqi f-s-l' " @click="setCollapse"></span>
|
|
105
|
+
</div>
|
|
106
|
+
</el-menu>
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<script>
|
|
110
|
+
import { labelF } from '../utils'
|
|
111
|
+
export default {
|
|
112
|
+
filters: {
|
|
113
|
+
titleF: labelF
|
|
114
|
+
},
|
|
115
|
+
props: {
|
|
116
|
+
menus: {
|
|
117
|
+
type: Array,
|
|
118
|
+
default: () => []
|
|
119
|
+
},
|
|
120
|
+
activeNav: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: undefined
|
|
123
|
+
},
|
|
124
|
+
collapse: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
data() {
|
|
130
|
+
return {}
|
|
131
|
+
},
|
|
132
|
+
methods: {
|
|
133
|
+
linkFn(menu, base) {
|
|
134
|
+
if (!menu.href) {
|
|
135
|
+
this.$emit('menu-click', menu, base)
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
setCollapse() {
|
|
139
|
+
this.$emit('update:collapse', !this.collapse)
|
|
140
|
+
window.localStorage.setItem('aside-nav-collapse', !this.collapse)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
</script>
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="laoding">
|
|
3
|
+
<el-form
|
|
4
|
+
ref="cp-form"
|
|
5
|
+
:model="form"
|
|
6
|
+
label-width="6em"
|
|
7
|
+
@submit.native.prevent
|
|
8
|
+
>
|
|
9
|
+
<el-form-item label="账号">
|
|
10
|
+
<el-input :value="form.username" disabled />
|
|
11
|
+
</el-form-item>
|
|
12
|
+
<el-form-item
|
|
13
|
+
label="原始密码"
|
|
14
|
+
prop="orginPassword"
|
|
15
|
+
:rules="[
|
|
16
|
+
{ required: true, message: '请输入原始密码', trigger: 'blur' },
|
|
17
|
+
{ validator: orginPasswordVd, trigger: 'blur' }
|
|
18
|
+
]"
|
|
19
|
+
>
|
|
20
|
+
<el-input
|
|
21
|
+
v-model="form.orginPassword"
|
|
22
|
+
type="password"
|
|
23
|
+
placeholder="请输入原始密码"
|
|
24
|
+
/>
|
|
25
|
+
</el-form-item>
|
|
26
|
+
<el-form-item
|
|
27
|
+
label="新密码"
|
|
28
|
+
prop="newPassword"
|
|
29
|
+
:rules="[
|
|
30
|
+
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
|
31
|
+
{ validator: newPasswordVd, trigger: 'blur' }
|
|
32
|
+
]"
|
|
33
|
+
>
|
|
34
|
+
<el-input
|
|
35
|
+
v-model="form.newPassword"
|
|
36
|
+
placeholder="请输入新密码"
|
|
37
|
+
show-password
|
|
38
|
+
@change="newPwdChange"
|
|
39
|
+
/>
|
|
40
|
+
</el-form-item>
|
|
41
|
+
<el-form-item
|
|
42
|
+
label="确认密码"
|
|
43
|
+
prop="validatePassword"
|
|
44
|
+
:rules="[
|
|
45
|
+
{ required: true, message: '请确认新密码', trigger: 'blur' },
|
|
46
|
+
{ validator: validatePasswordVd, trigger: 'blur' }
|
|
47
|
+
]"
|
|
48
|
+
>
|
|
49
|
+
<el-input
|
|
50
|
+
v-model="form.validatePassword"
|
|
51
|
+
:disabled="!form.newPassword"
|
|
52
|
+
placeholder="请确认新密码"
|
|
53
|
+
show-password
|
|
54
|
+
/>
|
|
55
|
+
</el-form-item>
|
|
56
|
+
</el-form>
|
|
57
|
+
|
|
58
|
+
<div class="dialog-footer">
|
|
59
|
+
<el-button type="primary" @click="confirmFn">确认</el-button>
|
|
60
|
+
<el-button @click="closeFn">取消</el-button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
import auth from '../../../utils/auth'
|
|
67
|
+
import axios from '../../../utils/axios'
|
|
68
|
+
export default {
|
|
69
|
+
props: {
|
|
70
|
+
visible: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
pwdMin: undefined,
|
|
78
|
+
pwdMax: undefined,
|
|
79
|
+
pwdRE: undefined,
|
|
80
|
+
pwdReMsg: undefined,
|
|
81
|
+
form: {
|
|
82
|
+
username: sessionStorage.getItem('userNo'),
|
|
83
|
+
orginPassword: '',
|
|
84
|
+
newPassword: '',
|
|
85
|
+
validatePassword: ''
|
|
86
|
+
},
|
|
87
|
+
laoding: false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
watch: {
|
|
91
|
+
visible(v) {
|
|
92
|
+
if (!v) {
|
|
93
|
+
this.$refs['cp-form'].resetFields()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
created() {
|
|
98
|
+
this.getPwdRule()
|
|
99
|
+
},
|
|
100
|
+
methods: {
|
|
101
|
+
getPwdRule() {
|
|
102
|
+
axios
|
|
103
|
+
.post('/bems/prod_1.0/user/api/userController/use')
|
|
104
|
+
.then(({ data }) => {
|
|
105
|
+
let { minLength, maxLength, passwordStrength } = data
|
|
106
|
+
this.pwdMin = minLength
|
|
107
|
+
this.pwdMax = maxLength
|
|
108
|
+
switch (passwordStrength) {
|
|
109
|
+
case '0':
|
|
110
|
+
this.pwdRE = [/[A-z0-9]+/]
|
|
111
|
+
this.pwdReMsg = `密码只能为字母数字`
|
|
112
|
+
break
|
|
113
|
+
case '1':
|
|
114
|
+
this.pwdRE = [/[A-z]+/, /[0-9]+/]
|
|
115
|
+
this.pwdReMsg = `密码只能包含数字 + 字母`
|
|
116
|
+
break
|
|
117
|
+
case '2':
|
|
118
|
+
this.pwdRE = [/[A-Z]+/, /[a-z]+/, /[0-9]+/]
|
|
119
|
+
this.pwdReMsg = `密码只能包含数字 + 大写字母 + 小写字母`
|
|
120
|
+
break
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
orginPasswordVd(r, value, callback) {
|
|
126
|
+
axios
|
|
127
|
+
.post(
|
|
128
|
+
'/bems/prod_1.0/uas/api/authorization/password/validate',
|
|
129
|
+
{
|
|
130
|
+
username: this.form.username,
|
|
131
|
+
password: value
|
|
132
|
+
},
|
|
133
|
+
{ noMsg: true, loading: false }
|
|
134
|
+
)
|
|
135
|
+
.then(() => {
|
|
136
|
+
callback()
|
|
137
|
+
})
|
|
138
|
+
.catch(() => {
|
|
139
|
+
callback(new Error('原始密码与旧密码不一致'))
|
|
140
|
+
})
|
|
141
|
+
},
|
|
142
|
+
newPasswordVd(r, value, callback) {
|
|
143
|
+
let _re_1 = new RegExp(`^.{${this.pwdMin},${this.pwdMax}}$`)
|
|
144
|
+
if (!_re_1.test(value)) {
|
|
145
|
+
callback(new Error(`密码长度范围:${this.pwdMin}-${this.pwdMax}位`))
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (this.pwdRE) {
|
|
149
|
+
this.pwdRE.some((re) => {
|
|
150
|
+
if (!re.test(value)) {
|
|
151
|
+
callback(new Error(this.pwdReMsg))
|
|
152
|
+
return true
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
callback()
|
|
157
|
+
},
|
|
158
|
+
validatePasswordVd(r, value, callback) {
|
|
159
|
+
if (value === this.form.newPassword) {
|
|
160
|
+
callback()
|
|
161
|
+
} else {
|
|
162
|
+
callback(new Error('两次输入密码不一致!'))
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
newPwdChange(val) {
|
|
166
|
+
if (!val) {
|
|
167
|
+
this.form.validatePassword = ''
|
|
168
|
+
this.$refs['cp-form'].clearValidate('validatePassword')
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
confirmFn() {
|
|
172
|
+
this.$refs['cp-form'].validate((v) => {
|
|
173
|
+
if (v) {
|
|
174
|
+
if (this.form.newPassword === this.form.orginPassword) {
|
|
175
|
+
this.$message.error('新密码不能与旧密码相同!')
|
|
176
|
+
this.form.newPassword = ''
|
|
177
|
+
this.form.validatePassword = ''
|
|
178
|
+
return
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
this.laoding = true
|
|
182
|
+
axios
|
|
183
|
+
.post(
|
|
184
|
+
'/bems/prod_1.0/uas/api/authorization/password/update',
|
|
185
|
+
{
|
|
186
|
+
username: this.form.username,
|
|
187
|
+
newPassword: this.form.newPassword
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
loading: () => {
|
|
191
|
+
this.laoding = false
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
.then(() => {
|
|
196
|
+
this.confirmFnThen()
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
},
|
|
201
|
+
confirmFnThen() {
|
|
202
|
+
this.$message({
|
|
203
|
+
message: '密码修改成功!',
|
|
204
|
+
type: 'success'
|
|
205
|
+
})
|
|
206
|
+
this.closeFn()
|
|
207
|
+
|
|
208
|
+
auth.removeToken()
|
|
209
|
+
},
|
|
210
|
+
closeFn() {
|
|
211
|
+
this.$emit('update:visible', false)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
</script>
|