n20-common-lib 2.4.4 → 2.4.6
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 +1 -1
- package/nstc-g6/components/Calendar/index.js +5 -5
- package/nstc-g6/components/Calendar/src/basic/month-table.vue +12 -20
- package/nstc-g6/components/Calendar/src/basic/year-table.vue +18 -22
- package/nstc-g6/components/Calendar/src/main.vue +1 -5
- package/nstc-g6/components/DialogForm/index.js +5 -5
- package/nstc-g6/components/DialogForm/src/demo/index.vue +18 -27
- package/nstc-g6/components/DialogForm/src/main.vue +15 -21
- package/nstc-g6/components/Form/A_DEMO/component/originalForm.vue +35 -50
- package/nstc-g6/components/Form/A_DEMO/config/config_3.js +1115 -1110
- package/nstc-g6/components/Form/A_DEMO/index.vue +7 -29
- package/nstc-g6/components/Form/AutocompleteCustom/index.vue +3 -5
- package/nstc-g6/components/Form/BusinessSpecific/InputMultiple.vue +60 -62
- package/nstc-g6/components/Form/BusinessSpecific/InputWithUnit.vue +12 -35
- package/nstc-g6/components/Form/BusinessSpecific/SelectTreeDialog.vue +77 -77
- package/nstc-g6/components/Form/CascaderCustom/index.vue +4 -4
- package/nstc-g6/components/Form/CheckboxCustom/index.vue +5 -11
- package/nstc-g6/components/Form/Component.vue +56 -78
- package/nstc-g6/components/Form/ComponentSecond.vue +55 -77
- package/nstc-g6/components/Form/InputAndDialog/index.js +5 -5
- package/nstc-g6/components/Form/InputAndDialog/src/main.vue +130 -153
- package/nstc-g6/components/Form/InputCustom/demo/index.vue +4 -12
- package/nstc-g6/components/Form/InputCustom/index.vue +51 -54
- package/nstc-g6/components/Form/IntervalinputCustom/demo/index.vue +1 -3
- package/nstc-g6/components/Form/IntervalinputCustom/index.vue +19 -41
- package/nstc-g6/components/Form/Item.vue +15 -30
- package/nstc-g6/components/Form/ItemSecond.vue +7 -22
- package/nstc-g6/components/Form/List.vue +12 -28
- package/nstc-g6/components/Form/ListSecond.vue +11 -27
- package/nstc-g6/components/Form/RadioCustom/index.vue +5 -23
- package/nstc-g6/components/Form/SelectAccount/index.js +5 -5
- package/nstc-g6/components/Form/SelectAccount/src/demo/index.vue +34 -28
- package/nstc-g6/components/Form/SelectAccount/src/main.vue +112 -83
- package/nstc-g6/components/Form/SelectAndDialog/index.js +5 -5
- package/nstc-g6/components/Form/SelectAndDialog/src/main.vue +126 -149
- package/nstc-g6/components/Form/SelectCashFlow/index.js +5 -5
- package/nstc-g6/components/Form/SelectCashFlow/src/demo/index.vue +18 -19
- package/nstc-g6/components/Form/SelectCashFlow/src/main.vue +52 -41
- package/nstc-g6/components/Form/SelectCustom/demo/index.vue +14 -16
- package/nstc-g6/components/Form/SelectCustom/index.vue +129 -139
- package/nstc-g6/components/Form/SelectSubject/index.js +5 -5
- package/nstc-g6/components/Form/SelectSubject/src/demo/index.vue +42 -48
- package/nstc-g6/components/Form/SelectSubject/src/main.vue +83 -86
- package/nstc-g6/components/Form/SelectindialogCustom/demo/index.vue +34 -35
- package/nstc-g6/components/Form/SelectindialogCustom/index.vue +133 -148
- package/nstc-g6/components/Form/SelectindialogCustom/install.js +3 -3
- package/nstc-g6/components/Form/TableRadioCustom/demo/index.vue +1 -7
- package/nstc-g6/components/Form/TableRadioCustom/index.vue +17 -26
- package/nstc-g6/components/Form/TextCustom/index.vue +2 -2
- package/nstc-g6/components/Form/UploadCustom/demo/index.vue +1 -3
- package/nstc-g6/components/Form/UploadCustom/index.vue +143 -173
- package/nstc-g6/components/Form/configs.js +3 -14
- package/nstc-g6/components/Form/configsSecond.js +3 -16
- package/nstc-g6/components/Form/index.js +1 -1
- package/nstc-g6/components/Form/payeePersonSelect/index.js +5 -5
- package/nstc-g6/components/Form/payeePersonSelect/src/demo/index.vue +50 -44
- package/nstc-g6/components/Form/payeePersonSelect/src/main.vue +73 -82
- package/nstc-g6/components/FormGroup/index.js +5 -5
- package/nstc-g6/components/FormGroup/src/demo/config.js +18 -19
- package/nstc-g6/components/FormGroup/src/demo/index.vue +14 -22
- package/nstc-g6/components/FormGroup/src/main.vue +122 -141
- package/nstc-g6/components/FormGroup/src/validate.js +11 -13
- package/nstc-g6/components/InputTag/InputTag.vue +78 -111
- package/nstc-g6/components/NstcBackToTop/NstcBackToTop.vue +24 -24
- package/nstc-g6/components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +4 -13
- package/nstc-g6/components/NstcCharts/NstcCharts.vue +9 -18
- package/nstc-g6/components/NstcCharts/define.js +1 -6
- package/nstc-g6/components/NstcConfirm/NstcConfirm.vue +6 -21
- package/nstc-g6/components/NstcConfirm/index.js +21 -19
- package/nstc-g6/components/NstcDialog/NstcDialog.vue +34 -38
- package/nstc-g6/components/NstcDialogForm/NstcDialogForm.vue +17 -21
- package/nstc-g6/components/NstcDialogTable/NstcDialogTable.vue +4 -17
- package/nstc-g6/components/NstcDropdown/NstcDropdown.vue +2 -12
- package/nstc-g6/components/NstcDropdownTree/NstcDropdownTree.vue +3 -13
- package/nstc-g6/components/NstcElectronicFile/NstcElectronicFile.vue +18 -78
- package/nstc-g6/components/NstcExcelCustomImport/NstcExcelCustomImport.vue +121 -147
- package/nstc-g6/components/NstcExcelImport/NstcExcelImport.vue +9 -31
- package/nstc-g6/components/NstcExcelImportN/NstcExcelImportN.vue +10 -33
- package/nstc-g6/components/NstcExpandCollapse/NstcExpandCollapse.vue +12 -16
- package/nstc-g6/components/NstcFileUpload/NstcFileUpload.vue +19 -75
- package/nstc-g6/components/NstcForm/A_DEMO/component/originalForm.vue +35 -50
- package/nstc-g6/components/NstcForm/A_DEMO/config/config_3.js +1115 -1110
- package/nstc-g6/components/NstcForm/A_DEMO/index.vue +340 -354
- package/nstc-g6/components/NstcForm/AutocompleteCustom/index.vue +2 -2
- package/nstc-g6/components/NstcForm/BusinessSpecific/InputWithUnit.vue +11 -34
- package/nstc-g6/components/NstcForm/BusinessSpecific/SelectTreeDialog.vue +77 -77
- package/nstc-g6/components/NstcForm/CheckboxCustom/index.vue +5 -11
- package/nstc-g6/components/NstcForm/Component.vue +17 -62
- package/nstc-g6/components/NstcForm/ComponentSecond.vue +55 -77
- package/nstc-g6/components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +6 -24
- package/nstc-g6/components/NstcForm/InputCustom/index.vue +2 -8
- package/nstc-g6/components/NstcForm/IntervalInputCustom/index.vue +4 -21
- package/nstc-g6/components/NstcForm/Item.vue +3 -15
- package/nstc-g6/components/NstcForm/ItemSecond.vue +7 -22
- package/nstc-g6/components/NstcForm/List.vue +12 -28
- package/nstc-g6/components/NstcForm/ListSecond.vue +11 -27
- package/nstc-g6/components/NstcForm/RadioCustom/index.vue +5 -23
- package/nstc-g6/components/NstcForm/SelectAccount/NstcSelectAccount.vue +4 -24
- package/nstc-g6/components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +7 -30
- package/nstc-g6/components/NstcForm/SelectCashFlow/NstcSelectCashFlow.vue +50 -38
- package/nstc-g6/components/NstcForm/SelectCustom/index.vue +6 -16
- package/nstc-g6/components/NstcForm/SelectSubject/NstcSelectSubject.vue +72 -82
- package/nstc-g6/components/NstcForm/SelectindialogCustom/index.vue +6 -20
- package/nstc-g6/components/NstcForm/TableRadioCustom/index.vue +17 -26
- package/nstc-g6/components/NstcForm/TextCustom/index.vue +2 -2
- package/nstc-g6/components/NstcForm/UploadCustom/index.vue +13 -60
- package/nstc-g6/components/NstcForm/configs.js +3 -14
- package/nstc-g6/components/NstcForm/configsSecond.js +3 -16
- package/nstc-g6/components/NstcForm/index.js +1 -1
- package/nstc-g6/components/NstcForm/payeePersonSelect/NstcPayeePerson.vue +57 -73
- package/nstc-g6/components/NstcPagination/NstcPagination.vue +2 -12
- package/nstc-g6/components/NstcScreenFull/NstcScreenFull.vue +2 -3
- package/nstc-g6/components/NstcSelectTree/NstcSelectTree.vue +4 -15
- package/nstc-g6/components/NstcSelectTreeList/NstcSelectTreeList.vue +5 -20
- package/nstc-g6/components/NstcSticky/NstcSticky.vue +10 -4
- package/nstc-g6/components/NstcSvgIcon/NstcSvgIcon.vue +1 -7
- package/nstc-g6/components/NstcTab/NstcTab.vue +8 -20
- package/nstc-g6/components/NstcTabWithBadge/NstcTabWithBadge.vue +7 -7
- package/nstc-g6/components/NstcTable/ElTableColumnCustom/index.vue +88 -126
- package/nstc-g6/components/NstcTable/NstcTable.vue +4 -17
- package/nstc-g6/components/NstcTableSet/NstcTableSet.vue +27 -72
- package/nstc-g6/components/NstcThemePicker/NstcThemePicker.vue +13 -14
- package/nstc-g6/components/NstcUploadCustomExcel/NstcUploadCustomExcel.vue +3 -13
- package/nstc-g6/components/NstcUploadExcel/NstcUploadExcel.vue +21 -22
- package/nstc-g6/components/NstcWorkBench/NstcWorkBench.vue +4 -17
- package/nstc-g6/components/Search/NstcSearch.vue +12 -47
- package/nstc-g6/components/Search/src/demo/index copy.vue +28 -28
- package/nstc-g6/components/Search/src/demo/index.vue +36 -36
- package/nstc-g6/components/Search/src/main copy.vue +169 -204
- package/nstc-g6/components/approvelTwo/main.vue +2 -6
- package/nstc-g6/components/approvelTwo/progress.vue +7 -29
- package/nstc-g6/directives/VCopy/index.js +52 -54
- package/nstc-g6/directives/VNstcNumber/index.js +1 -1
- package/nstc-g6/directives/VNstcNumber/temp.js +357 -362
- package/nstc-g6/utils/mapper_aims.js +774 -775
- package/nstc-g6/utils/parseTime.js +38 -36
- package/nstc-g6/utils/validate/index.js +2 -2
- package/nstc-g6/utils/vendor/Export2Excel.js +110 -111
- package/nstc-g6/utils/vendor/Export2Zip.js +12 -7
- package/nstc-g6/utils/vue-bus.js +1 -1
- package/package.json +1 -1
- package/src/assets/iconFont/demo_index.html +1 -1
- package/src/assets/iconFont/iconfont.js +66 -1
- package/src/assets/iconFont2/demo_index.html +277 -286
- package/src/assets/iconFont2/iconfont.js +66 -1
- package/src/components/Button/button-group.vue +1 -1
- package/src/components/LoginTemporary/indexN.vue +12 -2
- package/src/components/TableOperateColumn/index.vue +1 -1
- package/src/i18n.json +2 -2
- package/src/plugins/Print/print-js/README.md +5 -5
- package/src/plugins/Print/print-js/package.json +2 -2
- package/src/plugins/Print/print-js/src/index.d.ts +36 -36
- package/src/plugins/Print/print-js/src/js/browser.js +3 -1
- package/src/plugins/Print/print-js/src/js/functions.js +16 -10
- package/src/plugins/Print/print-js/src/js/html.js +2 -2
- package/src/plugins/Print/print-js/src/js/image.js +1 -1
- package/src/plugins/Print/print-js/src/js/init.js +15 -7
- package/src/plugins/Print/print-js/src/js/json.js +14 -4
- package/src/plugins/Print/print-js/src/js/modal.js +16 -15
- package/src/plugins/Print/print-js/src/js/pdf.js +1 -1
- package/src/plugins/Print/print-js/src/js/print.js +6 -6
- package/src/plugins/Sign/NetSM3/InfosecNetSignCNGAgent.min.js +1825 -1592
- package/src/plugins/Sign/cfca/index.js +525 -520
- package/src/plugins/Sign/sign.js +128 -128
- package/style/index.css +1 -1
- package/style/index.css.map +1 -1
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
|
@@ -3,17 +3,12 @@
|
|
|
3
3
|
v-model="_value"
|
|
4
4
|
v-bind="$attrs"
|
|
5
5
|
class="checkbox-group"
|
|
6
|
-
:style="{width:parseFloat(width) + 'px'}"
|
|
6
|
+
:style="{ width: parseFloat(width) + 'px' }"
|
|
7
7
|
v-on="$listeners"
|
|
8
8
|
>
|
|
9
9
|
<template v-for="item in options">
|
|
10
|
-
<el-checkbox-button
|
|
11
|
-
|
|
12
|
-
:key="item.value"
|
|
13
|
-
:label="item.value"
|
|
14
|
-
:disabled="item.disabled"
|
|
15
|
-
>
|
|
16
|
-
{{ item.label}}
|
|
10
|
+
<el-checkbox-button v-if="type === 'button'" :key="item.value" :label="item.value" :disabled="item.disabled">
|
|
11
|
+
{{ item.label }}
|
|
17
12
|
</el-checkbox-button>
|
|
18
13
|
<el-checkbox
|
|
19
14
|
v-else
|
|
@@ -42,7 +37,7 @@ export default {
|
|
|
42
37
|
|
|
43
38
|
type: {
|
|
44
39
|
default: 'normal',
|
|
45
|
-
validator: function(val) {
|
|
40
|
+
validator: function (val) {
|
|
46
41
|
return ['normal', 'border', 'button'].includes(val)
|
|
47
42
|
}
|
|
48
43
|
},
|
|
@@ -61,7 +56,6 @@ export default {
|
|
|
61
56
|
type: Boolean,
|
|
62
57
|
default: false
|
|
63
58
|
}
|
|
64
|
-
|
|
65
59
|
},
|
|
66
60
|
|
|
67
61
|
computed: {
|
|
@@ -78,7 +72,7 @@ export default {
|
|
|
78
72
|
</script>
|
|
79
73
|
|
|
80
74
|
<style scoped>
|
|
81
|
-
.checkbox-group /deep/ .el-checkbox{
|
|
75
|
+
.checkbox-group /deep/ .el-checkbox {
|
|
82
76
|
margin-right: 40px;
|
|
83
77
|
}
|
|
84
78
|
</style>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
:popper-class="computedPopperClass"
|
|
24
24
|
:formData="formData"
|
|
25
25
|
:show-mode="showMode"
|
|
26
|
-
@after-leave="val => $emit('after-leave', val)"
|
|
26
|
+
@after-leave="(val) => $emit('after-leave', val)"
|
|
27
27
|
@query-click="handleExpectQuery"
|
|
28
28
|
@add-click="$emit('add-click')"
|
|
29
29
|
@other-click="$emit('other-click')"
|
|
@@ -31,19 +31,8 @@
|
|
|
31
31
|
@tree-node-click="(prop, data, node) => $emit('tree-node-click', prop, data, node)"
|
|
32
32
|
/>
|
|
33
33
|
|
|
34
|
-
<div
|
|
35
|
-
v-
|
|
36
|
-
:class="[
|
|
37
|
-
`form-item`,
|
|
38
|
-
`form-item-button`
|
|
39
|
-
]"
|
|
40
|
-
>
|
|
41
|
-
<el-button
|
|
42
|
-
v-bind="queryBtn"
|
|
43
|
-
:loading="queryLoading"
|
|
44
|
-
:disabled="disableds.querybutton"
|
|
45
|
-
@click="handleExpectQuery"
|
|
46
|
-
>
|
|
34
|
+
<div v-if="isVertical && queryBtn" :class="[`form-item`, `form-item-button`]">
|
|
35
|
+
<el-button v-bind="queryBtn" :loading="queryLoading" :disabled="disableds.querybutton" @click="handleExpectQuery">
|
|
47
36
|
{{ queryBtn.name || '查询' }}
|
|
48
37
|
</el-button>
|
|
49
38
|
</div>
|
|
@@ -121,7 +110,7 @@ export default {
|
|
|
121
110
|
// 样式 : 水平 | 垂直
|
|
122
111
|
mode: {
|
|
123
112
|
default: 'horizontal',
|
|
124
|
-
validator: function(val) {
|
|
113
|
+
validator: function (val) {
|
|
125
114
|
return ['horizontal', 'vertical'].includes(val)
|
|
126
115
|
}
|
|
127
116
|
},
|
|
@@ -177,9 +166,7 @@ export default {
|
|
|
177
166
|
querybutton: false
|
|
178
167
|
},
|
|
179
168
|
|
|
180
|
-
formID: `formID-${Math.random()
|
|
181
|
-
.toString(36)
|
|
182
|
-
.slice(2)}`,
|
|
169
|
+
formID: `formID-${Math.random().toString(36).slice(2)}`,
|
|
183
170
|
|
|
184
171
|
linkItems: [],
|
|
185
172
|
unwatchers: [],
|
|
@@ -219,15 +206,14 @@ export default {
|
|
|
219
206
|
innerLabelWidth() {
|
|
220
207
|
return (this.labelWidth + '').replace(/px/, '') + 'px'
|
|
221
208
|
}
|
|
222
|
-
|
|
223
209
|
},
|
|
224
210
|
|
|
225
211
|
watch: {
|
|
226
212
|
config: {
|
|
227
213
|
deep: true,
|
|
228
214
|
immediate: true,
|
|
229
|
-
handler: function(newVal) {
|
|
230
|
-
if (!this.isRendering
|
|
215
|
+
handler: function (newVal) {
|
|
216
|
+
if (!this.isRendering && newVal.length) {
|
|
231
217
|
this.init()
|
|
232
218
|
}
|
|
233
219
|
}
|
|
@@ -236,7 +222,7 @@ export default {
|
|
|
236
222
|
value: {
|
|
237
223
|
deep: true,
|
|
238
224
|
immediate: true,
|
|
239
|
-
handler: function(newVal) {
|
|
225
|
+
handler: function (newVal) {
|
|
240
226
|
if (!this.isEmptyObject(newVal) && !this.isRendering && this.innerMountAndQuery) {
|
|
241
227
|
this.innerMountAndQuery = false
|
|
242
228
|
this.handleExpectQuery()
|
|
@@ -292,10 +278,7 @@ export default {
|
|
|
292
278
|
querybutton: this.disabled
|
|
293
279
|
}
|
|
294
280
|
|
|
295
|
-
const {
|
|
296
|
-
querybutton,
|
|
297
|
-
normalItems = []
|
|
298
|
-
} = this.separateAdvanceAndNormal(this.config)
|
|
281
|
+
const { querybutton, normalItems = [] } = this.separateAdvanceAndNormal(this.config)
|
|
299
282
|
this.normalConfig = normalItems
|
|
300
283
|
|
|
301
284
|
this.generateFormModel(normalItems)
|
|
@@ -314,15 +297,15 @@ export default {
|
|
|
314
297
|
|
|
315
298
|
generateFormModel(config) {
|
|
316
299
|
if (Array.isArray(config)) {
|
|
317
|
-
config.forEach(item => {
|
|
300
|
+
config.forEach((item) => {
|
|
318
301
|
if (Array.isArray(item)) {
|
|
319
302
|
this.generateFormModel(item)
|
|
320
303
|
} else {
|
|
321
304
|
if (!item.mold) {
|
|
322
305
|
throw Error(
|
|
323
|
-
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat(
|
|
324
|
-
'
|
|
325
|
-
)
|
|
306
|
+
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat('querybutton').join(
|
|
307
|
+
'|'
|
|
308
|
+
)}`
|
|
326
309
|
)
|
|
327
310
|
}
|
|
328
311
|
|
|
@@ -342,9 +325,7 @@ export default {
|
|
|
342
325
|
|
|
343
326
|
if (!config.mold) {
|
|
344
327
|
throw Error(
|
|
345
|
-
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat(
|
|
346
|
-
'querybutton'
|
|
347
|
-
).join('|')}`
|
|
328
|
+
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat('querybutton').join('|')}`
|
|
348
329
|
)
|
|
349
330
|
}
|
|
350
331
|
|
|
@@ -359,7 +340,7 @@ export default {
|
|
|
359
340
|
this.unwatchers.pop()()
|
|
360
341
|
}
|
|
361
342
|
|
|
362
|
-
this.linkItems.map(item => {
|
|
343
|
+
this.linkItems.map((item) => {
|
|
363
344
|
this.setWatchers(item)
|
|
364
345
|
})
|
|
365
346
|
|
|
@@ -373,7 +354,8 @@ export default {
|
|
|
373
354
|
setModel(item) {
|
|
374
355
|
let { prop, mold } = item
|
|
375
356
|
|
|
376
|
-
if (this.pureable) {
|
|
357
|
+
if (this.pureable) {
|
|
358
|
+
// 纯净模式
|
|
377
359
|
if (item.renderable === false) {
|
|
378
360
|
this.$delete(this.model, prop)
|
|
379
361
|
return
|
|
@@ -398,19 +380,18 @@ export default {
|
|
|
398
380
|
setWatchers(item) {
|
|
399
381
|
const { link, prop: itemProp } = item
|
|
400
382
|
let isOneToLinkAll = false
|
|
401
|
-
let links
|
|
383
|
+
let links
|
|
384
|
+
let isComplex
|
|
402
385
|
|
|
403
386
|
if (Array.isArray(link)) {
|
|
404
387
|
links = link
|
|
405
|
-
isOneToLinkAll = links.every(item => item.mold)
|
|
406
|
-
isComplex = !!(links.find(item => item.mold) && links.find(item => !item.mold))
|
|
388
|
+
isOneToLinkAll = links.every((item) => item.mold)
|
|
389
|
+
isComplex = !!(links.find((item) => item.mold) && links.find((item) => !item.mold))
|
|
407
390
|
} else {
|
|
408
391
|
links = [link]
|
|
409
392
|
}
|
|
410
393
|
|
|
411
|
-
links.forEach(link =>
|
|
412
|
-
this.setSingleLinkWatch(link, itemProp, isOneToLinkAll, isComplex, link.mold)
|
|
413
|
-
)
|
|
394
|
+
links.forEach((link) => this.setSingleLinkWatch(link, itemProp, isOneToLinkAll, isComplex, link.mold))
|
|
414
395
|
},
|
|
415
396
|
|
|
416
397
|
setSingleLinkWatch(link, itemProp, isOneToLinkAll, isComplex, isModelEverGenerated) {
|
|
@@ -446,7 +427,7 @@ export default {
|
|
|
446
427
|
const unwatcher = this.$watch(`model.${targetProp}`, {
|
|
447
428
|
immediate: true,
|
|
448
429
|
deep: true,
|
|
449
|
-
handler: async function(newVal, oldVal) {
|
|
430
|
+
handler: async function (newVal, oldVal) {
|
|
450
431
|
if (watchedProp) {
|
|
451
432
|
if (!deepEquals(newVal, oldVal)) {
|
|
452
433
|
const defaultAndOptions = await handler(newVal)
|
|
@@ -514,7 +495,7 @@ export default {
|
|
|
514
495
|
if (prop) {
|
|
515
496
|
this.resets[prop] = val
|
|
516
497
|
} else {
|
|
517
|
-
Object.keys(this.resets).forEach(key => {
|
|
498
|
+
Object.keys(this.resets).forEach((key) => {
|
|
518
499
|
this.resets[key] = val
|
|
519
500
|
})
|
|
520
501
|
}
|
|
@@ -527,7 +508,7 @@ export default {
|
|
|
527
508
|
if (prop) {
|
|
528
509
|
this.disableds[prop] = val
|
|
529
510
|
} else {
|
|
530
|
-
Object.keys(this.disableds).forEach(key => {
|
|
511
|
+
Object.keys(this.disableds).forEach((key) => {
|
|
531
512
|
this.disableds[key] = val
|
|
532
513
|
})
|
|
533
514
|
}
|
|
@@ -536,40 +517,41 @@ export default {
|
|
|
536
517
|
separateAdvanceAndNormal(config = this.config) {
|
|
537
518
|
const isVertical = this.isVertical
|
|
538
519
|
|
|
539
|
-
const reducer = config =>
|
|
540
|
-
(
|
|
541
|
-
|
|
542
|
-
|
|
520
|
+
const reducer = (config) =>
|
|
521
|
+
config.reduce(
|
|
522
|
+
(prev, item) => {
|
|
523
|
+
if (Array.isArray(item)) {
|
|
524
|
+
const { normalItems, ...rest } = reducer(item)
|
|
543
525
|
|
|
544
|
-
|
|
526
|
+
normalItems.length && prev.normalItems.push(normalItems)
|
|
545
527
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
528
|
+
return {
|
|
529
|
+
...prev,
|
|
530
|
+
...rest
|
|
531
|
+
}
|
|
532
|
+
} else {
|
|
533
|
+
const { mold } = item
|
|
534
|
+
// if (mold === "upload") {
|
|
535
|
+
// this.uploadKeys.add(prop);
|
|
536
|
+
// }
|
|
537
|
+
|
|
538
|
+
if (isVertical) {
|
|
539
|
+
if (mold === 'querybutton') {
|
|
540
|
+
prev[mold] = item
|
|
541
|
+
} else {
|
|
542
|
+
prev.normalItems.push(item)
|
|
543
|
+
}
|
|
559
544
|
} else {
|
|
560
545
|
prev.normalItems.push(item)
|
|
561
546
|
}
|
|
562
|
-
} else {
|
|
563
|
-
prev.normalItems.push(item)
|
|
564
547
|
}
|
|
565
|
-
}
|
|
566
548
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
549
|
+
return prev
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
normalItems: []
|
|
553
|
+
}
|
|
554
|
+
)
|
|
573
555
|
|
|
574
556
|
return reducer(config)
|
|
575
557
|
},
|
|
@@ -606,9 +588,7 @@ export default {
|
|
|
606
588
|
|
|
607
589
|
await this.$listeners.query(model, config)
|
|
608
590
|
} else {
|
|
609
|
-
throw new Error(
|
|
610
|
-
'must specify @query event when there is a query button'
|
|
611
|
-
)
|
|
591
|
+
throw new Error('must specify @query event when there is a query button')
|
|
612
592
|
}
|
|
613
593
|
} catch (err) {
|
|
614
594
|
console.error('form custom error -> handleExpectQuery:', err)
|
|
@@ -648,14 +628,12 @@ export default {
|
|
|
648
628
|
* 生成formId
|
|
649
629
|
*/
|
|
650
630
|
createFormId() {
|
|
651
|
-
return `formID-${Math.random()
|
|
652
|
-
.toString(36)
|
|
653
|
-
.slice(2)}`
|
|
631
|
+
return `formID-${Math.random().toString(36).slice(2)}`
|
|
654
632
|
}
|
|
655
633
|
}
|
|
656
634
|
}
|
|
657
635
|
</script>
|
|
658
636
|
|
|
659
637
|
<style lang="scss">
|
|
660
|
-
@import
|
|
638
|
+
@import 'index';
|
|
661
639
|
</style>
|
|
@@ -22,26 +22,15 @@
|
|
|
22
22
|
:disableds="disableds"
|
|
23
23
|
:popper-class="computedPopperClass"
|
|
24
24
|
:from="from"
|
|
25
|
-
@after-leave="val => $emit('after-leave', val)"
|
|
25
|
+
@after-leave="(val) => $emit('after-leave', val)"
|
|
26
26
|
@query-click="handleExpectQuery"
|
|
27
27
|
@add-click="$emit('add-click')"
|
|
28
28
|
@other-click="$emit('other-click')"
|
|
29
29
|
@enter-click="handleExpectQuery"
|
|
30
30
|
/>
|
|
31
31
|
|
|
32
|
-
<div
|
|
33
|
-
v-
|
|
34
|
-
:class="[
|
|
35
|
-
`form-item`,
|
|
36
|
-
`form-item-button`
|
|
37
|
-
]"
|
|
38
|
-
>
|
|
39
|
-
<el-button
|
|
40
|
-
v-bind="queryBtn"
|
|
41
|
-
:loading="queryLoading"
|
|
42
|
-
:disabled="disableds.querybutton"
|
|
43
|
-
@click="handleExpectQuery"
|
|
44
|
-
>
|
|
32
|
+
<div v-if="isVertical && queryBtn" :class="[`form-item`, `form-item-button`]">
|
|
33
|
+
<el-button v-bind="queryBtn" :loading="queryLoading" :disabled="disableds.querybutton" @click="handleExpectQuery">
|
|
45
34
|
{{ queryBtn.name || '查询' }}
|
|
46
35
|
</el-button>
|
|
47
36
|
</div>
|
|
@@ -115,7 +104,7 @@ export default {
|
|
|
115
104
|
// 样式 : 水平 | 垂直
|
|
116
105
|
mode: {
|
|
117
106
|
default: 'horizontal',
|
|
118
|
-
validator: function(val) {
|
|
107
|
+
validator: function (val) {
|
|
119
108
|
return ['horizontal', 'vertical'].includes(val)
|
|
120
109
|
}
|
|
121
110
|
},
|
|
@@ -165,9 +154,7 @@ export default {
|
|
|
165
154
|
querybutton: false
|
|
166
155
|
},
|
|
167
156
|
|
|
168
|
-
formID: `formID-${Math.random()
|
|
169
|
-
.toString(36)
|
|
170
|
-
.slice(2)}`,
|
|
157
|
+
formID: `formID-${Math.random().toString(36).slice(2)}`,
|
|
171
158
|
|
|
172
159
|
linkItems: [],
|
|
173
160
|
unwatchers: [],
|
|
@@ -207,14 +194,13 @@ export default {
|
|
|
207
194
|
innerLabelWidth() {
|
|
208
195
|
return (this.labelWidth + '').replace(/px/, '') + 'px'
|
|
209
196
|
}
|
|
210
|
-
|
|
211
197
|
},
|
|
212
198
|
|
|
213
199
|
watch: {
|
|
214
200
|
config: {
|
|
215
201
|
deep: true,
|
|
216
202
|
immediate: true,
|
|
217
|
-
handler: function(newVal, oldVal) {
|
|
203
|
+
handler: function (newVal, oldVal) {
|
|
218
204
|
if (!this.isRendering && newVal !== oldVal && newVal.length) {
|
|
219
205
|
this.init()
|
|
220
206
|
}
|
|
@@ -224,7 +210,7 @@ export default {
|
|
|
224
210
|
value: {
|
|
225
211
|
deep: true,
|
|
226
212
|
immediate: true,
|
|
227
|
-
handler: function(newVal) {
|
|
213
|
+
handler: function (newVal) {
|
|
228
214
|
if (!this.isEmptyObject(newVal) && !this.isRendering && this.innerMountAndQuery) {
|
|
229
215
|
this.innerMountAndQuery = false
|
|
230
216
|
this.handleExpectQuery()
|
|
@@ -280,10 +266,7 @@ export default {
|
|
|
280
266
|
querybutton: this.disabled
|
|
281
267
|
}
|
|
282
268
|
|
|
283
|
-
const {
|
|
284
|
-
querybutton,
|
|
285
|
-
normalItems = []
|
|
286
|
-
} = this.separateAdvanceAndNormal(this.config)
|
|
269
|
+
const { querybutton, normalItems = [] } = this.separateAdvanceAndNormal(this.config)
|
|
287
270
|
|
|
288
271
|
this.normalConfig = normalItems
|
|
289
272
|
|
|
@@ -303,15 +286,15 @@ export default {
|
|
|
303
286
|
|
|
304
287
|
generateFormModel(config) {
|
|
305
288
|
if (Array.isArray(config)) {
|
|
306
|
-
config.forEach(item => {
|
|
289
|
+
config.forEach((item) => {
|
|
307
290
|
if (Array.isArray(item)) {
|
|
308
291
|
this.generateFormModel(item)
|
|
309
292
|
} else {
|
|
310
293
|
if (!item.mold) {
|
|
311
294
|
throw Error(
|
|
312
|
-
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat(
|
|
313
|
-
'
|
|
314
|
-
)
|
|
295
|
+
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat('querybutton').join(
|
|
296
|
+
'|'
|
|
297
|
+
)}`
|
|
315
298
|
)
|
|
316
299
|
}
|
|
317
300
|
|
|
@@ -331,9 +314,7 @@ export default {
|
|
|
331
314
|
|
|
332
315
|
if (!config.mold) {
|
|
333
316
|
throw Error(
|
|
334
|
-
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat(
|
|
335
|
-
'querybutton'
|
|
336
|
-
).join('|')}`
|
|
317
|
+
`Each config's child must has a 'mold' prop, it could be ${SUPPORT_TYPE.concat('querybutton').join('|')}`
|
|
337
318
|
)
|
|
338
319
|
}
|
|
339
320
|
|
|
@@ -348,7 +329,7 @@ export default {
|
|
|
348
329
|
this.unwatchers.pop()()
|
|
349
330
|
}
|
|
350
331
|
|
|
351
|
-
this.linkItems.map(item => {
|
|
332
|
+
this.linkItems.map((item) => {
|
|
352
333
|
this.setWatchers(item)
|
|
353
334
|
})
|
|
354
335
|
|
|
@@ -362,7 +343,8 @@ export default {
|
|
|
362
343
|
setModel(item) {
|
|
363
344
|
let { prop, mold } = item
|
|
364
345
|
|
|
365
|
-
if (this.pureable) {
|
|
346
|
+
if (this.pureable) {
|
|
347
|
+
// 纯净模式
|
|
366
348
|
if (item.renderable === false) {
|
|
367
349
|
this.$delete(this.model, prop)
|
|
368
350
|
return
|
|
@@ -387,19 +369,18 @@ export default {
|
|
|
387
369
|
setWatchers(item) {
|
|
388
370
|
const { link, prop: itemProp } = item
|
|
389
371
|
let isOneToLinkAll = false
|
|
390
|
-
let links
|
|
372
|
+
let links
|
|
373
|
+
let isComplex
|
|
391
374
|
|
|
392
375
|
if (Array.isArray(link)) {
|
|
393
376
|
links = link
|
|
394
|
-
isOneToLinkAll = links.every(item => item.mold)
|
|
395
|
-
isComplex = !!(links.find(item => item.mold) && links.find(item => !item.mold))
|
|
377
|
+
isOneToLinkAll = links.every((item) => item.mold)
|
|
378
|
+
isComplex = !!(links.find((item) => item.mold) && links.find((item) => !item.mold))
|
|
396
379
|
} else {
|
|
397
380
|
links = [link]
|
|
398
381
|
}
|
|
399
382
|
|
|
400
|
-
links.forEach(link =>
|
|
401
|
-
this.setSingleLinkWatch(link, itemProp, isOneToLinkAll, isComplex, link.mold)
|
|
402
|
-
)
|
|
383
|
+
links.forEach((link) => this.setSingleLinkWatch(link, itemProp, isOneToLinkAll, isComplex, link.mold))
|
|
403
384
|
},
|
|
404
385
|
|
|
405
386
|
setSingleLinkWatch(link, itemProp, isOneToLinkAll, isComplex, isModelEverGenerated) {
|
|
@@ -435,7 +416,7 @@ export default {
|
|
|
435
416
|
const unwatcher = this.$watch(`model.${targetProp}`, {
|
|
436
417
|
immediate: true,
|
|
437
418
|
deep: true,
|
|
438
|
-
handler: async function(newVal, oldVal) {
|
|
419
|
+
handler: async function (newVal, oldVal) {
|
|
439
420
|
if (watchedProp) {
|
|
440
421
|
if (!deepEquals(newVal, oldVal)) {
|
|
441
422
|
const defaultAndOptions = await handler(newVal)
|
|
@@ -503,7 +484,7 @@ export default {
|
|
|
503
484
|
if (prop) {
|
|
504
485
|
this.resets[prop] = val
|
|
505
486
|
} else {
|
|
506
|
-
Object.keys(this.resets).forEach(key => {
|
|
487
|
+
Object.keys(this.resets).forEach((key) => {
|
|
507
488
|
this.resets[key] = val
|
|
508
489
|
})
|
|
509
490
|
}
|
|
@@ -516,7 +497,7 @@ export default {
|
|
|
516
497
|
if (prop) {
|
|
517
498
|
this.disableds[prop] = val
|
|
518
499
|
} else {
|
|
519
|
-
Object.keys(this.disableds).forEach(key => {
|
|
500
|
+
Object.keys(this.disableds).forEach((key) => {
|
|
520
501
|
this.disableds[key] = val
|
|
521
502
|
})
|
|
522
503
|
}
|
|
@@ -525,40 +506,41 @@ export default {
|
|
|
525
506
|
separateAdvanceAndNormal(config = this.config) {
|
|
526
507
|
const isVertical = this.isVertical
|
|
527
508
|
|
|
528
|
-
const reducer = config =>
|
|
529
|
-
(
|
|
530
|
-
|
|
531
|
-
|
|
509
|
+
const reducer = (config) =>
|
|
510
|
+
config.reduce(
|
|
511
|
+
(prev, item) => {
|
|
512
|
+
if (Array.isArray(item)) {
|
|
513
|
+
const { normalItems, ...rest } = reducer(item)
|
|
532
514
|
|
|
533
|
-
|
|
515
|
+
normalItems.length && prev.normalItems.push(normalItems)
|
|
534
516
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
517
|
+
return {
|
|
518
|
+
...prev,
|
|
519
|
+
...rest
|
|
520
|
+
}
|
|
521
|
+
} else {
|
|
522
|
+
const { mold } = item
|
|
523
|
+
// if (mold === "upload") {
|
|
524
|
+
// this.uploadKeys.add(prop);
|
|
525
|
+
// }
|
|
526
|
+
|
|
527
|
+
if (isVertical) {
|
|
528
|
+
if (mold === 'querybutton') {
|
|
529
|
+
prev[mold] = item
|
|
530
|
+
} else {
|
|
531
|
+
prev.normalItems.push(item)
|
|
532
|
+
}
|
|
548
533
|
} else {
|
|
549
534
|
prev.normalItems.push(item)
|
|
550
535
|
}
|
|
551
|
-
} else {
|
|
552
|
-
prev.normalItems.push(item)
|
|
553
536
|
}
|
|
554
|
-
}
|
|
555
537
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
538
|
+
return prev
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
normalItems: []
|
|
542
|
+
}
|
|
543
|
+
)
|
|
562
544
|
|
|
563
545
|
return reducer(config)
|
|
564
546
|
},
|
|
@@ -595,9 +577,7 @@ export default {
|
|
|
595
577
|
|
|
596
578
|
await this.$listeners.query(model, config)
|
|
597
579
|
} else {
|
|
598
|
-
throw new Error(
|
|
599
|
-
'must specify @query event when there is a query button'
|
|
600
|
-
)
|
|
580
|
+
throw new Error('must specify @query event when there is a query button')
|
|
601
581
|
}
|
|
602
582
|
} catch (err) {
|
|
603
583
|
console.error('form custom error -> handleExpectQuery:', err)
|
|
@@ -637,14 +617,12 @@ export default {
|
|
|
637
617
|
* 生成formId
|
|
638
618
|
*/
|
|
639
619
|
createFormId() {
|
|
640
|
-
return `formID-${Math.random()
|
|
641
|
-
.toString(36)
|
|
642
|
-
.slice(2)}`
|
|
620
|
+
return `formID-${Math.random().toString(36).slice(2)}`
|
|
643
621
|
}
|
|
644
622
|
}
|
|
645
623
|
}
|
|
646
624
|
</script>
|
|
647
625
|
|
|
648
626
|
<style lang="scss">
|
|
649
|
-
@import
|
|
627
|
+
@import 'index';
|
|
650
628
|
</style>
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* @Description: 下拉+弹窗
|
|
7
7
|
* @FilePath: \nstc_g6_common\packages\Form\SelectAndDialog\index.js
|
|
8
8
|
*/
|
|
9
|
-
import NstcInputAndDialog from
|
|
9
|
+
import NstcInputAndDialog from './src/main.vue'
|
|
10
10
|
|
|
11
|
-
NstcInputAndDialog.install = function(Vue) {
|
|
12
|
-
Vue.component(NstcInputAndDialog.name, NstcInputAndDialog)
|
|
13
|
-
}
|
|
11
|
+
NstcInputAndDialog.install = function (Vue) {
|
|
12
|
+
Vue.component(NstcInputAndDialog.name, NstcInputAndDialog)
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
export default NstcInputAndDialog
|
|
15
|
+
export default NstcInputAndDialog
|