n20-common-lib 2.4.5 → 2.4.7
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/Layout/HeaderWrap/indexN.vue +1 -1
- package/src/components/Layout/indexN.vue +1 -2
- package/src/components/LoginTemporary/indexN.vue +12 -2
- package/src/components/TableOperateColumn/index.vue +1 -1
- 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
|
@@ -4,49 +4,24 @@
|
|
|
4
4
|
<div class="form-group-custom-body-ap" v-if="anchorPoint">
|
|
5
5
|
<el-tabs v-model="activeName" :tab-position="tabPosition" @tab-click="tabClickAction">
|
|
6
6
|
<el-tab-pane
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
v-for="(item, index) in anchorPointArr.filter((item) => item.title)"
|
|
8
|
+
:key="index"
|
|
9
|
+
:label="item.name || item.title"
|
|
10
10
|
/>
|
|
11
11
|
</el-tabs>
|
|
12
12
|
</div>
|
|
13
|
-
<div :class="{ 'form-group-custom-body-form': true, 'form-group-custom-body-form-anchor-point': anchorPoint}">
|
|
13
|
+
<div :class="{ 'form-group-custom-body-form': true, 'form-group-custom-body-form-anchor-point': anchorPoint }">
|
|
14
14
|
<slot name="before" />
|
|
15
15
|
|
|
16
16
|
<div
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
v-for="(form, index) in innerConfig"
|
|
18
|
+
:key="index"
|
|
19
|
+
:class="['form-group-item', { 'is-upload': getIsUpload(form) }]"
|
|
20
20
|
>
|
|
21
21
|
<template v-if="form.renderable !== false">
|
|
22
22
|
<a :id="`nstc-form-group-${form.anchorPoint}`" />
|
|
23
|
-
<ExpandCollapse
|
|
24
|
-
v-if="form.title"
|
|
25
|
-
:is-can-collapse="isCanCollapse"
|
|
26
|
-
>
|
|
23
|
+
<ExpandCollapse v-if="form.title" :is-can-collapse="isCanCollapse">
|
|
27
24
|
<NstcForm
|
|
28
|
-
:ref="`formCustom${index}`"
|
|
29
|
-
v-model="model[index]"
|
|
30
|
-
:reset.sync="form.formReset"
|
|
31
|
-
:config="form.formConfig"
|
|
32
|
-
:mount-and-query="false"
|
|
33
|
-
:rules="rules"
|
|
34
|
-
:disabled="disabled"
|
|
35
|
-
pureable
|
|
36
|
-
:label-width="labelWidth"
|
|
37
|
-
:show-mode="showMode"
|
|
38
|
-
/>
|
|
39
|
-
<template v-slot:title>
|
|
40
|
-
<template v-if="typeof form.title === 'object'">
|
|
41
|
-
<component :is="compile(form.title.component, form, model[index])" v-if="'template' in form.title.component" />
|
|
42
|
-
<component :is="form.title.component" v-else />
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<span v-else>{{ form.title }}</span>
|
|
46
|
-
</template>
|
|
47
|
-
</ExpandCollapse>
|
|
48
|
-
<NstcForm
|
|
49
|
-
v-else
|
|
50
25
|
:ref="`formCustom${index}`"
|
|
51
26
|
v-model="model[index]"
|
|
52
27
|
:reset.sync="form.formReset"
|
|
@@ -57,6 +32,31 @@
|
|
|
57
32
|
pureable
|
|
58
33
|
:label-width="labelWidth"
|
|
59
34
|
:show-mode="showMode"
|
|
35
|
+
/>
|
|
36
|
+
<template v-slot:title>
|
|
37
|
+
<template v-if="typeof form.title === 'object'">
|
|
38
|
+
<component
|
|
39
|
+
:is="compile(form.title.component, form, model[index])"
|
|
40
|
+
v-if="'template' in form.title.component"
|
|
41
|
+
/>
|
|
42
|
+
<component :is="form.title.component" v-else />
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<span v-else>{{ form.title }}</span>
|
|
46
|
+
</template>
|
|
47
|
+
</ExpandCollapse>
|
|
48
|
+
<NstcForm
|
|
49
|
+
v-else
|
|
50
|
+
:ref="`formCustom${index}`"
|
|
51
|
+
v-model="model[index]"
|
|
52
|
+
:reset.sync="form.formReset"
|
|
53
|
+
:config="form.formConfig"
|
|
54
|
+
:mount-and-query="false"
|
|
55
|
+
:rules="rules"
|
|
56
|
+
:disabled="disabled"
|
|
57
|
+
pureable
|
|
58
|
+
:label-width="labelWidth"
|
|
59
|
+
:show-mode="showMode"
|
|
60
60
|
/>
|
|
61
61
|
</template>
|
|
62
62
|
</div>
|
|
@@ -65,48 +65,40 @@
|
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
|
|
68
|
-
<div
|
|
69
|
-
v-if="customSubmit"
|
|
70
|
-
:class="[
|
|
71
|
-
isFix ? 'form-group-footer form-group-footer-form' : 'form-group-footer' ]"
|
|
72
|
-
>
|
|
68
|
+
<div v-if="customSubmit" :class="[isFix ? 'form-group-footer form-group-footer-form' : 'form-group-footer']">
|
|
73
69
|
<slot name="submit" />
|
|
74
70
|
</div>
|
|
75
71
|
|
|
76
72
|
<div
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
isFix ? 'form-group-footer form-group-footer-form' : 'form-group-footer' ]"
|
|
73
|
+
v-if="!customSubmit && showFooter"
|
|
74
|
+
:class="[isFix ? 'form-group-footer form-group-footer-form' : 'form-group-footer']"
|
|
80
75
|
>
|
|
81
76
|
<el-button
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
v-if="handlers.submit"
|
|
78
|
+
type="primary"
|
|
79
|
+
:loading="loading.submit"
|
|
80
|
+
:class="handlers.submit.className || ''"
|
|
81
|
+
@click="handleQuery('submit')"
|
|
87
82
|
>
|
|
88
83
|
{{ handlers.submit.label }}
|
|
89
84
|
</el-button>
|
|
90
85
|
<el-button
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
v-if="handlers.save"
|
|
87
|
+
:loading="loading.save"
|
|
88
|
+
:class="handlers.save.className || ''"
|
|
89
|
+
@click="handleQuery('save')"
|
|
95
90
|
>
|
|
96
91
|
{{ handlers.save.label }}
|
|
97
92
|
</el-button>
|
|
98
93
|
<el-button
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
v-if="handlers.reset"
|
|
95
|
+
class="assist-button"
|
|
96
|
+
@click="handleReset"
|
|
97
|
+
:class="handlers.reset.className || ''"
|
|
103
98
|
>
|
|
104
99
|
{{ handlers.reset.label }}
|
|
105
100
|
</el-button>
|
|
106
|
-
<el-button
|
|
107
|
-
v-if="handlers.cancel"
|
|
108
|
-
@click="handleCancel('cancel')"
|
|
109
|
-
>
|
|
101
|
+
<el-button v-if="handlers.cancel" @click="handleCancel('cancel')">
|
|
110
102
|
{{ handlers.cancel.label }}
|
|
111
103
|
</el-button>
|
|
112
104
|
</div>
|
|
@@ -218,7 +210,7 @@ export default {
|
|
|
218
210
|
},
|
|
219
211
|
|
|
220
212
|
// 重置
|
|
221
|
-
reset:{
|
|
213
|
+
reset: {
|
|
222
214
|
type: Boolean,
|
|
223
215
|
default: false
|
|
224
216
|
}
|
|
@@ -240,7 +232,7 @@ export default {
|
|
|
240
232
|
// validateObj: {
|
|
241
233
|
// inputwithunit: validInputWithUnit
|
|
242
234
|
// },
|
|
243
|
-
|
|
235
|
+
validateObj: {
|
|
244
236
|
inputwithunit: validInputWithUnit
|
|
245
237
|
},
|
|
246
238
|
// 表单配置更新
|
|
@@ -253,11 +245,15 @@ export default {
|
|
|
253
245
|
|
|
254
246
|
computed: {
|
|
255
247
|
getIsUpload() {
|
|
256
|
-
return form => {
|
|
257
|
-
return
|
|
258
|
-
|
|
248
|
+
return (form) => {
|
|
249
|
+
return (
|
|
250
|
+
form.formConfig &&
|
|
251
|
+
form.formConfig[0] &&
|
|
252
|
+
(form.formConfig[0].mold === 'nstcupload' ||
|
|
253
|
+
(form.formConfig[0].length && form.formConfig[0][0].mold === 'nstcupload'))
|
|
254
|
+
)
|
|
259
255
|
}
|
|
260
|
-
}
|
|
256
|
+
}
|
|
261
257
|
},
|
|
262
258
|
|
|
263
259
|
watch: {
|
|
@@ -271,7 +267,7 @@ export default {
|
|
|
271
267
|
config: {
|
|
272
268
|
immediate: true,
|
|
273
269
|
deep: true,
|
|
274
|
-
handler(val,oldValue) {
|
|
270
|
+
handler(val, oldValue) {
|
|
275
271
|
this.$bus.$emit('nstc_custom_form_config_update', val)
|
|
276
272
|
if (val !== oldValue) {
|
|
277
273
|
this.init(val)
|
|
@@ -291,14 +287,14 @@ export default {
|
|
|
291
287
|
// console.log('00')
|
|
292
288
|
this.loading[action] = true
|
|
293
289
|
// 动态更新 formCustom 的 config 文件时 form[0]可能为空
|
|
294
|
-
this.rules && await Promise.all(Object.values(this.$refs).map(form => form[0] && form[0].validate()))
|
|
290
|
+
this.rules && (await Promise.all(Object.values(this.$refs).map((form) => form[0] && form[0].validate())))
|
|
295
291
|
// console.log('11')
|
|
296
292
|
|
|
297
293
|
if (this.$listeners.query) {
|
|
298
|
-
|
|
294
|
+
// console.log('22')
|
|
299
295
|
// this.$listeners.query需返回promise
|
|
300
296
|
await this.$listeners.query(JSON.parse(JSON.stringify(this.model)), action)
|
|
301
|
-
|
|
297
|
+
// console.log('33')
|
|
302
298
|
}
|
|
303
299
|
// console.log('444',err,JSON.parse(JSON.stringify(this.model)),action,form)
|
|
304
300
|
} catch (err) {
|
|
@@ -328,7 +324,7 @@ export default {
|
|
|
328
324
|
async triggerQuery(action) {
|
|
329
325
|
try {
|
|
330
326
|
this.loading[action] = true
|
|
331
|
-
this.rules && await Promise.all(Object.values(this.$refs).map(form => form[0].validate()))
|
|
327
|
+
this.rules && (await Promise.all(Object.values(this.$refs).map((form) => form[0].validate())))
|
|
332
328
|
// if (this.$listeners.query) {
|
|
333
329
|
// // this.$listeners.query需返回promise
|
|
334
330
|
// await this.$listeners.query(JSON.parse(JSON.stringify(this.model)), action)
|
|
@@ -353,9 +349,11 @@ export default {
|
|
|
353
349
|
},
|
|
354
350
|
|
|
355
351
|
async handleReset() {
|
|
356
|
-
this.innerConfig.forEach(item => {
|
|
352
|
+
this.innerConfig.forEach((item) => {
|
|
353
|
+
item.formReset = true
|
|
354
|
+
})
|
|
357
355
|
await this.$nextTick()
|
|
358
|
-
Object.values(this.$refs).forEach(form => form[0] && form[0].clearValidate())
|
|
356
|
+
Object.values(this.$refs).forEach((form) => form[0] && form[0].clearValidate())
|
|
359
357
|
|
|
360
358
|
if (this.$listeners.reset) {
|
|
361
359
|
await this.$listeners.reset(JSON.parse(JSON.stringify(this.model)))
|
|
@@ -363,7 +361,7 @@ export default {
|
|
|
363
361
|
},
|
|
364
362
|
|
|
365
363
|
setModel(index, model) {
|
|
366
|
-
Object.keys(model).map(k => {
|
|
364
|
+
Object.keys(model).map((k) => {
|
|
367
365
|
this.$set(this.model[index], k, model[k])
|
|
368
366
|
})
|
|
369
367
|
},
|
|
@@ -375,14 +373,12 @@ export default {
|
|
|
375
373
|
}
|
|
376
374
|
this.getRules()
|
|
377
375
|
this.$nextTick(() => {
|
|
378
|
-
this.innerConfig = config.map(item => ({
|
|
376
|
+
this.innerConfig = config.map((item) => ({
|
|
379
377
|
...item,
|
|
380
378
|
formReset: false,
|
|
381
|
-
anchorPoint: `ap-${Math.random()
|
|
382
|
-
.toString(36)
|
|
383
|
-
.slice(2)}`
|
|
379
|
+
anchorPoint: `ap-${Math.random().toString(36).slice(2)}`
|
|
384
380
|
}))
|
|
385
|
-
this.anchorPointArr = this.innerConfig.map(item => ({
|
|
381
|
+
this.anchorPointArr = this.innerConfig.map((item) => ({
|
|
386
382
|
title: item.name || item.title,
|
|
387
383
|
anchorPoint: item[`anchorPoint`]
|
|
388
384
|
}))
|
|
@@ -418,58 +414,45 @@ export default {
|
|
|
418
414
|
* 获取表单验证规则
|
|
419
415
|
*/
|
|
420
416
|
getRules() {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
.
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
//
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
trigger: isInput ? 'blur' : 'change',
|
|
461
|
-
...(hasSpecificValid ? { validator: hasSpecificValid } : {})
|
|
462
|
-
// whitespace: isInput || undefined,
|
|
463
|
-
// ...isInput
|
|
464
|
-
// ? {
|
|
465
|
-
// transform(val) {
|
|
466
|
-
// return typeof val === 'string' ? val.trim() : val
|
|
467
|
-
// }
|
|
468
|
-
// }
|
|
469
|
-
// : {}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}, {})
|
|
417
|
+
const that = this
|
|
418
|
+
const tempConfig = JSON.parse(JSON.stringify(this.config))
|
|
419
|
+
this.rules = {}
|
|
420
|
+
this.rules = tempConfig
|
|
421
|
+
.reduce((prev, next) => [...prev, ...next.formConfig], [])
|
|
422
|
+
.reduce((prev, next) => [...prev, ...(Array.isArray(next) ? next : [next])], [])
|
|
423
|
+
.reduce((prev, next) => {
|
|
424
|
+
if (next.link) {
|
|
425
|
+
const links = next.link.filter((item) => !!item.mold)
|
|
426
|
+
|
|
427
|
+
return [...prev, next, ...links]
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return [...prev, next]
|
|
431
|
+
}, [])
|
|
432
|
+
.filter((item) => item.isRequired)
|
|
433
|
+
.reduce((res, curr) => {
|
|
434
|
+
const isInput = curr.mold === 'input' || curr.prop === 'dueDate' || curr.prop === 'lastShipmentDate'
|
|
435
|
+
|
|
436
|
+
// 自定义校验
|
|
437
|
+
const hasSpecificValid = that.validateObj[curr.mold]
|
|
438
|
+
return {
|
|
439
|
+
...res,
|
|
440
|
+
[curr.prop]: {
|
|
441
|
+
required: true,
|
|
442
|
+
[`${hasSpecificValid ? 'nstc-' : ''}message`]: `请${isInput ? '输入' : '选择'}${curr.name}`,
|
|
443
|
+
trigger: isInput ? 'blur' : 'change',
|
|
444
|
+
...(hasSpecificValid ? { validator: hasSpecificValid } : {})
|
|
445
|
+
// whitespace: isInput || undefined,
|
|
446
|
+
// ...isInput
|
|
447
|
+
// ? {
|
|
448
|
+
// transform(val) {
|
|
449
|
+
// return typeof val === 'string' ? val.trim() : val
|
|
450
|
+
// }
|
|
451
|
+
// }
|
|
452
|
+
// : {}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}, {})
|
|
473
456
|
},
|
|
474
457
|
|
|
475
458
|
/**
|
|
@@ -500,25 +483,25 @@ export default {
|
|
|
500
483
|
border-radius: 10px;
|
|
501
484
|
padding-bottom: 30px;
|
|
502
485
|
height: 100%;
|
|
503
|
-
&-body{
|
|
486
|
+
&-body {
|
|
504
487
|
display: flex;
|
|
505
488
|
flex-direction: row;
|
|
506
489
|
height: 100%;
|
|
507
|
-
&-ap{
|
|
490
|
+
&-ap {
|
|
508
491
|
width: 152px;
|
|
509
492
|
margin-right: 20px;
|
|
510
|
-
.el-tabs__header{
|
|
493
|
+
.el-tabs__header {
|
|
511
494
|
width: 100%;
|
|
512
495
|
}
|
|
513
496
|
}
|
|
514
|
-
&-form{
|
|
497
|
+
&-form {
|
|
515
498
|
flex: 1;
|
|
516
499
|
overflow-y: auto;
|
|
517
500
|
}
|
|
518
501
|
&-form-anchor-point {
|
|
519
502
|
.form-group-item:nth-child(1) {
|
|
520
503
|
margin-top: 0;
|
|
521
|
-
padding-top: 0!important;
|
|
504
|
+
padding-top: 0 !important;
|
|
522
505
|
}
|
|
523
506
|
}
|
|
524
507
|
}
|
|
@@ -530,10 +513,10 @@ export default {
|
|
|
530
513
|
font-size: 14px;
|
|
531
514
|
}
|
|
532
515
|
> i {
|
|
533
|
-
color: #
|
|
516
|
+
color: #f5f5f5;
|
|
534
517
|
// margin-left: 19px;
|
|
535
518
|
}
|
|
536
|
-
&::after{
|
|
519
|
+
&::after {
|
|
537
520
|
content: '';
|
|
538
521
|
flex: 1;
|
|
539
522
|
}
|
|
@@ -548,10 +531,10 @@ export default {
|
|
|
548
531
|
width: 400px;
|
|
549
532
|
}
|
|
550
533
|
.form-item:nth-child(1) {
|
|
551
|
-
margin-left: calc((50% - 400px)* 0.64);
|
|
534
|
+
margin-left: calc((50% - 400px) * 0.64);
|
|
552
535
|
}
|
|
553
536
|
.form-item:nth-child(2) {
|
|
554
|
-
margin-left: calc((50% - 400px)* 0.745);
|
|
537
|
+
margin-left: calc((50% - 400px) * 0.745);
|
|
555
538
|
}
|
|
556
539
|
}
|
|
557
540
|
.form-custom {
|
|
@@ -592,7 +575,7 @@ export default {
|
|
|
592
575
|
height: 61px;
|
|
593
576
|
transition: width 0.3s;
|
|
594
577
|
background-color: #fff;
|
|
595
|
-
box-shadow: 0px -2px 6px 0px rgba(92,100,113,0.11);
|
|
578
|
+
box-shadow: 0px -2px 6px 0px rgba(92, 100, 113, 0.11);
|
|
596
579
|
.sider-close {
|
|
597
580
|
background-color: #fff;
|
|
598
581
|
width: calc(100% - 103px) !important;
|
|
@@ -633,7 +616,5 @@ export default {
|
|
|
633
616
|
border: 1px solid #dcdfe6;
|
|
634
617
|
color: #606266;
|
|
635
618
|
}
|
|
636
|
-
|
|
637
619
|
}
|
|
638
|
-
|
|
639
620
|
</style>
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
* 占位 不校验
|
|
3
3
|
*/
|
|
4
4
|
export function notValid(rule, value, callback) {
|
|
5
|
-
|
|
5
|
+
callback()
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* 校验 【融资】 - 【期限】
|
|
11
10
|
*/
|
|
12
11
|
export function validInputWithUnit(rule, value, callback) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
12
|
+
if (value[0] && value[1]) {
|
|
13
|
+
// if (/^[0-9]*$/.test(value[0])) {
|
|
14
|
+
callback()
|
|
15
|
+
// } else {
|
|
16
|
+
// callback(new Error('请输入正整数'))
|
|
17
|
+
// }
|
|
18
|
+
} else {
|
|
19
|
+
callback(new Error('请输入期限'))
|
|
20
|
+
}
|
|
21
|
+
}
|