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
|
@@ -9,20 +9,12 @@
|
|
|
9
9
|
:show-pagination="showPagination"
|
|
10
10
|
:pagination.sync="_pagination"
|
|
11
11
|
@selection-change="handleSelectionChange"
|
|
12
|
-
@pagination-change="val => $emit('pagination-change', val)"
|
|
12
|
+
@pagination-change="(val) => $emit('pagination-change', val)"
|
|
13
13
|
>
|
|
14
14
|
<template v-if="!multiple" v-slot:before>
|
|
15
|
-
<el-table-column
|
|
16
|
-
:width="45"
|
|
17
|
-
align="center"
|
|
18
|
-
header-align="center"
|
|
19
|
-
>
|
|
15
|
+
<el-table-column :width="45" align="center" header-align="center">
|
|
20
16
|
<template v-slot="{ row, $index }">
|
|
21
|
-
<el-radio
|
|
22
|
-
v-model="_value"
|
|
23
|
-
:label="$index"
|
|
24
|
-
:disabled="row.disabled"
|
|
25
|
-
>{{ '' }}</el-radio>
|
|
17
|
+
<el-radio v-model="_value" :label="$index" :disabled="row.disabled">{{ '' }}</el-radio>
|
|
26
18
|
</template>
|
|
27
19
|
</el-table-column>
|
|
28
20
|
</template>
|
|
@@ -98,16 +90,14 @@ export default {
|
|
|
98
90
|
|
|
99
91
|
data() {
|
|
100
92
|
return {
|
|
101
|
-
key: `TableRadioCustomID-${Math.random()
|
|
102
|
-
.toString(36)
|
|
103
|
-
.slice(2)}`
|
|
93
|
+
key: `TableRadioCustomID-${Math.random().toString(36).slice(2)}`
|
|
104
94
|
}
|
|
105
95
|
},
|
|
106
96
|
|
|
107
97
|
computed: {
|
|
108
98
|
_value: {
|
|
109
99
|
get() {
|
|
110
|
-
return this.data.findIndex(row => this.value && row[this.valueKey] === this.value[this.valueKey])
|
|
100
|
+
return this.data.findIndex((row) => this.value && row[this.valueKey] === this.value[this.valueKey])
|
|
111
101
|
},
|
|
112
102
|
set(val) {
|
|
113
103
|
const row = this.data[val]
|
|
@@ -125,12 +115,12 @@ export default {
|
|
|
125
115
|
_columns() {
|
|
126
116
|
return this.multiple
|
|
127
117
|
? [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
118
|
+
{
|
|
119
|
+
type: 'selection',
|
|
120
|
+
width: 35
|
|
121
|
+
},
|
|
122
|
+
...this.columns
|
|
123
|
+
]
|
|
134
124
|
: this.columns
|
|
135
125
|
},
|
|
136
126
|
|
|
@@ -157,15 +147,16 @@ export default {
|
|
|
157
147
|
|
|
158
148
|
methods: {
|
|
159
149
|
setSelectedRow(data) {
|
|
160
|
-
this.value &&
|
|
161
|
-
|
|
150
|
+
this.value &&
|
|
151
|
+
this.value.forEach((item) => {
|
|
152
|
+
const index = data.findIndex((row) => row[this.valueKey] === item[this.valueKey])
|
|
162
153
|
|
|
163
|
-
|
|
164
|
-
|
|
154
|
+
this.$refs.tableSelect.$refs.elTable.toggleRowSelection(data[index], true)
|
|
155
|
+
})
|
|
165
156
|
},
|
|
166
157
|
|
|
167
158
|
handleSelectionChange(val) {
|
|
168
|
-
const res = val.map(item => ({
|
|
159
|
+
const res = val.map((item) => ({
|
|
169
160
|
...item,
|
|
170
161
|
[this.valueKey]: item[this.valueKey],
|
|
171
162
|
[this.labelKey]: item[this.labelKey]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span class="text-custom" :style="{width:parseFloat(width) + 'px'}">{{ getValue(value) }}</span>
|
|
2
|
+
<span class="text-custom" :style="{ width: parseFloat(width) + 'px' }">{{ getValue(value) }}</span>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
|
|
21
21
|
methods: {
|
|
22
22
|
getValue(value) {
|
|
23
|
-
if(value instanceof Array) {
|
|
23
|
+
if (value instanceof Array) {
|
|
24
24
|
return value.toString().replace(/,/g, '')
|
|
25
25
|
} else {
|
|
26
26
|
return value
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:key="key"
|
|
4
|
-
:class="['upload-custom',{ 'is-multiple': multiple || valueClassification.img.length }]"
|
|
4
|
+
:class="['upload-custom', { 'is-multiple': multiple || valueClassification.img.length }]"
|
|
5
5
|
:style="{ width: `${_width}px` }"
|
|
6
6
|
>
|
|
7
|
-
<input
|
|
8
|
-
v-if="isChoosing"
|
|
9
|
-
ref="fileInput"
|
|
10
|
-
type="file"
|
|
11
|
-
:multiple="multiple"
|
|
12
|
-
@change="handleFileChange"
|
|
13
|
-
>
|
|
7
|
+
<input v-if="isChoosing" ref="fileInput" type="file" :multiple="multiple" @change="handleFileChange" />
|
|
14
8
|
<el-button
|
|
15
9
|
v-if="!isView"
|
|
16
10
|
:loading="loading"
|
|
@@ -24,60 +18,28 @@
|
|
|
24
18
|
|
|
25
19
|
<template v-if="showFile">
|
|
26
20
|
<template v-if="!multiple && valueClassification.other.length">
|
|
27
|
-
<div
|
|
28
|
-
v-if="fileName"
|
|
29
|
-
class="upload-file-name"
|
|
30
|
-
:title="fileName"
|
|
31
|
-
>
|
|
21
|
+
<div v-if="fileName" class="upload-file-name" :title="fileName">
|
|
32
22
|
{{ fileName }}
|
|
33
23
|
</div>
|
|
34
|
-
<el-button
|
|
35
|
-
v-if="fileName"
|
|
36
|
-
class="upload-file-delete"
|
|
37
|
-
type="text"
|
|
38
|
-
@click="handleClickFileBtn"
|
|
39
|
-
>
|
|
24
|
+
<el-button v-if="fileName" class="upload-file-delete" type="text" @click="handleClickFileBtn">
|
|
40
25
|
{{ fileBtnName }}
|
|
41
26
|
</el-button>
|
|
42
27
|
</template>
|
|
43
28
|
<template v-else>
|
|
44
29
|
<div class="upload-file-other">
|
|
45
|
-
<div
|
|
46
|
-
|
|
47
|
-
:key="index"
|
|
48
|
-
class="upload-file-other-item"
|
|
49
|
-
>
|
|
50
|
-
<div
|
|
51
|
-
class="upload-file-name"
|
|
52
|
-
:title="item.fileName"
|
|
53
|
-
>
|
|
30
|
+
<div v-for="(item, index) in valueClassification.other" :key="index" class="upload-file-other-item">
|
|
31
|
+
<div class="upload-file-name" :title="item.fileName">
|
|
54
32
|
{{ item.fileName }}
|
|
55
33
|
</div>
|
|
56
|
-
<el-button
|
|
57
|
-
class="upload-file-other-delete"
|
|
58
|
-
type="text"
|
|
59
|
-
@click="handleClickFileBtn(item) "
|
|
60
|
-
>
|
|
34
|
+
<el-button class="upload-file-other-delete" type="text" @click="handleClickFileBtn(item)">
|
|
61
35
|
{{ fileBtnName }}
|
|
62
36
|
</el-button>
|
|
63
37
|
</div>
|
|
64
38
|
</div>
|
|
65
39
|
<div class="upload-file-img">
|
|
66
|
-
<div
|
|
67
|
-
|
|
68
|
-
:
|
|
69
|
-
class="upload-file-img-item"
|
|
70
|
-
>
|
|
71
|
-
<el-image
|
|
72
|
-
:src="item.fileUrl"
|
|
73
|
-
:preview-src-list="getPreviewSrcList(index)"
|
|
74
|
-
/>
|
|
75
|
-
<img
|
|
76
|
-
v-if="!isView"
|
|
77
|
-
:src="closeImg"
|
|
78
|
-
alt="#"
|
|
79
|
-
@click="handleDelete(item)"
|
|
80
|
-
>
|
|
40
|
+
<div v-for="(item, index) in valueClassification.img" :key="index" class="upload-file-img-item">
|
|
41
|
+
<el-image :src="item.fileUrl" :preview-src-list="getPreviewSrcList(index)" />
|
|
42
|
+
<img v-if="!isView" :src="closeImg" alt="#" @click="handleDelete(item)" />
|
|
81
43
|
</div>
|
|
82
44
|
</div>
|
|
83
45
|
</template>
|
|
@@ -109,37 +71,44 @@ export default {
|
|
|
109
71
|
default: undefined
|
|
110
72
|
},
|
|
111
73
|
|
|
112
|
-
value: {
|
|
74
|
+
value: {
|
|
75
|
+
// 值格式为单选{ fileName,fileUrl }/{ fileName,file },或者多选[{ fileName,fileUrl }]/[{ fileName,file }]
|
|
113
76
|
type: [Object, Array],
|
|
114
77
|
default: null
|
|
115
78
|
},
|
|
116
79
|
|
|
117
|
-
valueIsFileUrl: {
|
|
80
|
+
valueIsFileUrl: {
|
|
81
|
+
// true时,值返回格式为{ fileName,fileUrl };false时,值返回格式为{ fileName,file }(file为文件类型)
|
|
118
82
|
type: Boolean,
|
|
119
83
|
default: false
|
|
120
84
|
},
|
|
121
85
|
|
|
122
|
-
url: {
|
|
86
|
+
url: {
|
|
87
|
+
// 上传到自定义服务器的url
|
|
123
88
|
type: String,
|
|
124
89
|
default: null
|
|
125
90
|
},
|
|
126
91
|
|
|
127
|
-
disabled: {
|
|
92
|
+
disabled: {
|
|
93
|
+
// 是否禁用
|
|
128
94
|
type: Boolean,
|
|
129
95
|
default: false
|
|
130
96
|
},
|
|
131
97
|
|
|
132
|
-
showFile: {
|
|
98
|
+
showFile: {
|
|
99
|
+
// 是否展示长传结果
|
|
133
100
|
type: Boolean,
|
|
134
101
|
default: true
|
|
135
102
|
},
|
|
136
103
|
|
|
137
|
-
validator: {
|
|
104
|
+
validator: {
|
|
105
|
+
// 上传前的验证,参数为typeCode(文件头前8位,用于检测文件真实格式), raw(文件buffer对象)
|
|
138
106
|
type: Function,
|
|
139
107
|
default: null
|
|
140
108
|
},
|
|
141
109
|
|
|
142
|
-
beforeChooseFile: {
|
|
110
|
+
beforeChooseFile: {
|
|
111
|
+
// 选择文件前的前置函数
|
|
143
112
|
type: Function,
|
|
144
113
|
default: null
|
|
145
114
|
},
|
|
@@ -149,22 +118,26 @@ export default {
|
|
|
149
118
|
default: undefined
|
|
150
119
|
},
|
|
151
120
|
|
|
152
|
-
max: {
|
|
121
|
+
max: {
|
|
122
|
+
// 多选时,最大上传文件个数
|
|
153
123
|
type: Number,
|
|
154
124
|
default: 5
|
|
155
125
|
},
|
|
156
126
|
|
|
157
|
-
multiple: {
|
|
127
|
+
multiple: {
|
|
128
|
+
// 是否支持多选
|
|
158
129
|
type: Boolean,
|
|
159
130
|
default: false
|
|
160
131
|
},
|
|
161
132
|
|
|
162
|
-
isView: {
|
|
133
|
+
isView: {
|
|
134
|
+
// 是否仅查看
|
|
163
135
|
type: Boolean,
|
|
164
136
|
default: false
|
|
165
137
|
},
|
|
166
138
|
|
|
167
|
-
storeAsPrefix: {
|
|
139
|
+
storeAsPrefix: {
|
|
140
|
+
// ali-oss上传路径前缀
|
|
168
141
|
type: String,
|
|
169
142
|
default: ''
|
|
170
143
|
}
|
|
@@ -172,9 +145,7 @@ export default {
|
|
|
172
145
|
|
|
173
146
|
data() {
|
|
174
147
|
return {
|
|
175
|
-
key: `UploadCustomID-${Math.random()
|
|
176
|
-
.toString(36)
|
|
177
|
-
.slice(2)}`,
|
|
148
|
+
key: `UploadCustomID-${Math.random().toString(36).slice(2)}`,
|
|
178
149
|
|
|
179
150
|
loading: false,
|
|
180
151
|
isChoosing: false,
|
|
@@ -195,9 +166,7 @@ export default {
|
|
|
195
166
|
},
|
|
196
167
|
|
|
197
168
|
fileName() {
|
|
198
|
-
return !this.multiple && this._value && this._value.fileName
|
|
199
|
-
? this._value.fileName
|
|
200
|
-
: ''
|
|
169
|
+
return !this.multiple && this._value && this._value.fileName ? this._value.fileName : ''
|
|
201
170
|
},
|
|
202
171
|
|
|
203
172
|
_width() {
|
|
@@ -216,36 +185,39 @@ export default {
|
|
|
216
185
|
const _value = this.multiple ? this._value : this._value ? [this._value] : []
|
|
217
186
|
const reg = /\.(png|jpg|gif|jpeg)$/
|
|
218
187
|
|
|
219
|
-
return _value.reduce(
|
|
220
|
-
|
|
221
|
-
|
|
188
|
+
return _value.reduce(
|
|
189
|
+
(prev, file, index) => {
|
|
190
|
+
if (reg.test(file.fileName)) {
|
|
191
|
+
let fileUrl = ''
|
|
222
192
|
|
|
223
|
-
|
|
224
|
-
|
|
193
|
+
if (file.fileUrl) {
|
|
194
|
+
fileUrl = file.fileUrl
|
|
195
|
+
} else {
|
|
196
|
+
fileUrl = window.URL.createObjectURL(file.file)
|
|
197
|
+
this.revokeObjectURL.push(fileUrl)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
prev.img.push({
|
|
201
|
+
fileUrl,
|
|
202
|
+
index,
|
|
203
|
+
...file
|
|
204
|
+
})
|
|
225
205
|
} else {
|
|
226
|
-
|
|
227
|
-
|
|
206
|
+
prev.other.push({
|
|
207
|
+
...file,
|
|
208
|
+
index
|
|
209
|
+
})
|
|
228
210
|
}
|
|
229
211
|
|
|
230
|
-
prev
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
})
|
|
235
|
-
} else {
|
|
236
|
-
prev.other.push({
|
|
237
|
-
...file,
|
|
238
|
-
index
|
|
239
|
-
})
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return prev
|
|
243
|
-
}, { img: [], other: [] })
|
|
212
|
+
return prev
|
|
213
|
+
},
|
|
214
|
+
{ img: [], other: [] }
|
|
215
|
+
)
|
|
244
216
|
},
|
|
245
217
|
|
|
246
218
|
getPreviewSrcList() {
|
|
247
|
-
return index => {
|
|
248
|
-
const imgUrls = this.valueClassification.img.map(item => item.fileUrl)
|
|
219
|
+
return (index) => {
|
|
220
|
+
const imgUrls = this.valueClassification.img.map((item) => item.fileUrl)
|
|
249
221
|
|
|
250
222
|
return imgUrls.slice(index).concat(imgUrls.slice(0, index))
|
|
251
223
|
}
|
|
@@ -257,14 +229,14 @@ export default {
|
|
|
257
229
|
},
|
|
258
230
|
|
|
259
231
|
beforeDestroy() {
|
|
260
|
-
this.revokeObjectURL.forEach(fileUrl => window.URL.revokeObjectURL(fileUrl))
|
|
232
|
+
this.revokeObjectURL.forEach((fileUrl) => window.URL.revokeObjectURL(fileUrl))
|
|
261
233
|
},
|
|
262
234
|
|
|
263
235
|
methods: {
|
|
264
236
|
async chooseFile() {
|
|
265
237
|
try {
|
|
266
238
|
this.isChoosing = true
|
|
267
|
-
this.beforeChooseFile && await this.beforeChooseFile()
|
|
239
|
+
this.beforeChooseFile && (await this.beforeChooseFile())
|
|
268
240
|
|
|
269
241
|
await this.$nextTick()
|
|
270
242
|
|
|
@@ -283,13 +255,11 @@ export default {
|
|
|
283
255
|
const files = Array.from(e.target.files)
|
|
284
256
|
|
|
285
257
|
await this.fileMaxCheck(files)
|
|
286
|
-
await Promise.all(files.map(file => this.fileTypeCheck(file)))
|
|
258
|
+
await Promise.all(files.map((file) => this.fileTypeCheck(file)))
|
|
287
259
|
|
|
288
|
-
const value = await Promise.all(files.map(file => this.singleFileUpload(file)))
|
|
260
|
+
const value = await Promise.all(files.map((file) => this.singleFileUpload(file)))
|
|
289
261
|
|
|
290
|
-
this._value = this.multiple
|
|
291
|
-
? [...this._value, ...value]
|
|
292
|
-
: value[0]
|
|
262
|
+
this._value = this.multiple ? [...this._value, ...value] : value[0]
|
|
293
263
|
} catch (err) {
|
|
294
264
|
// this.$$message(err.reason || '上传失败')
|
|
295
265
|
}
|
|
@@ -376,7 +346,7 @@ export default {
|
|
|
376
346
|
return new Promise((resolve, reject) => {
|
|
377
347
|
const reader = new FileReader()
|
|
378
348
|
|
|
379
|
-
reader.onload = async function(r) {
|
|
349
|
+
reader.onload = async function (r) {
|
|
380
350
|
try {
|
|
381
351
|
const buffer = r.target.result
|
|
382
352
|
const dataview = new DataView(buffer)
|
|
@@ -407,7 +377,7 @@ export default {
|
|
|
407
377
|
|
|
408
378
|
fileMaxCheck(files) {
|
|
409
379
|
return new Promise((resolve, reject) => {
|
|
410
|
-
if (this.multiple &&
|
|
380
|
+
if (this.multiple && files.length + this._value.length > this.max) {
|
|
411
381
|
reject({ reason: `最多上传文件数:${this.max}` })
|
|
412
382
|
}
|
|
413
383
|
|
|
@@ -419,88 +389,88 @@ export default {
|
|
|
419
389
|
</script>
|
|
420
390
|
|
|
421
391
|
<style lang="scss">
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
392
|
+
.upload-custom {
|
|
393
|
+
display: inline-flex;
|
|
394
|
+
align-items: center;
|
|
395
|
+
position: relative;
|
|
396
|
+
padding-right: 32px;
|
|
397
|
+
&.is-multiple {
|
|
398
|
+
display: inline-block;
|
|
399
|
+
}
|
|
430
400
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
401
|
+
.button-cancel {
|
|
402
|
+
flex: none;
|
|
403
|
+
padding: 0 15px 0 12px;
|
|
404
|
+
width: auto;
|
|
405
|
+
display: inline-flex;
|
|
406
|
+
align-items: center;
|
|
407
|
+
i {
|
|
408
|
+
margin-right: 6px;
|
|
409
|
+
font-size: 9px;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
442
412
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
413
|
+
input {
|
|
414
|
+
display: none;
|
|
415
|
+
}
|
|
446
416
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
417
|
+
.upload-file {
|
|
418
|
+
&-name {
|
|
419
|
+
font-size: 14px;
|
|
420
|
+
padding-left: 10px;
|
|
421
|
+
flex: auto;
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
white-space: nowrap;
|
|
424
|
+
text-overflow: ellipsis;
|
|
425
|
+
}
|
|
456
426
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
427
|
+
&-delete {
|
|
428
|
+
position: absolute;
|
|
429
|
+
top: 9px;
|
|
430
|
+
right: 0;
|
|
431
|
+
}
|
|
462
432
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
433
|
+
&-other {
|
|
434
|
+
display: flex;
|
|
435
|
+
flex-wrap: wrap;
|
|
436
|
+
margin-top: 5px;
|
|
437
|
+
&-item {
|
|
438
|
+
flex: none;
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: center;
|
|
441
|
+
margin-right: 40px;
|
|
442
|
+
.upload-file-name {
|
|
443
|
+
padding-left: 0;
|
|
444
|
+
padding-right: 10px;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
478
448
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
& > img {
|
|
495
|
-
position: absolute;
|
|
496
|
-
right: 0;
|
|
497
|
-
top: 0;
|
|
498
|
-
width: 16px;
|
|
499
|
-
height: 16px;
|
|
500
|
-
cursor: pointer;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
449
|
+
&-img {
|
|
450
|
+
display: flex;
|
|
451
|
+
margin-top: 5px;
|
|
452
|
+
flex-wrap: wrap;
|
|
453
|
+
&-item {
|
|
454
|
+
flex: none;
|
|
455
|
+
margin-right: 10px;
|
|
456
|
+
position: relative;
|
|
457
|
+
.el-image {
|
|
458
|
+
width: 72px;
|
|
459
|
+
height: 72px;
|
|
460
|
+
background-color: #fff;
|
|
461
|
+
border-radius: 2px;
|
|
462
|
+
border: #cfd8e6;
|
|
504
463
|
}
|
|
464
|
+
& > img {
|
|
465
|
+
position: absolute;
|
|
466
|
+
right: 0;
|
|
467
|
+
top: 0;
|
|
468
|
+
width: 16px;
|
|
469
|
+
height: 16px;
|
|
470
|
+
cursor: pointer;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
505
473
|
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
506
476
|
</style>
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
// const FormTooltips = () => ('../FormCreate/component/FormTooltips')
|
|
19
19
|
// const nstcselecttreeCustom = () => import('../SelectTree/src/main')
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
import DatepickerCustom from './DatepickerCustom'
|
|
23
22
|
import InputCustom from './InputCustom'
|
|
24
23
|
import IntervalinputCustom from './IntervalinputCustom'
|
|
@@ -45,7 +44,6 @@ import selectsubjectCustom from '^/Form/SelectSubject'
|
|
|
45
44
|
import payeePersonSelect from '^/Form/payeePersonSelect'
|
|
46
45
|
import inputAndDialog from '^/Form/InputAndDialog'
|
|
47
46
|
|
|
48
|
-
|
|
49
47
|
// 定义支持的类型
|
|
50
48
|
export const SUPPORT_TYPE = [
|
|
51
49
|
'datepicker',
|
|
@@ -108,7 +106,7 @@ export function getDefaultValue({ mold, multiple, type, default: def }) {
|
|
|
108
106
|
case 'nstcBankBanchTree':
|
|
109
107
|
case 'selecttreedialog':
|
|
110
108
|
_def = {
|
|
111
|
-
value: isEmpty(def) ? multiple ? [] : null : def
|
|
109
|
+
value: isEmpty(def) ? (multiple ? [] : null) : def
|
|
112
110
|
}
|
|
113
111
|
break
|
|
114
112
|
|
|
@@ -127,13 +125,7 @@ export function getDefaultValue({ mold, multiple, type, default: def }) {
|
|
|
127
125
|
|
|
128
126
|
case 'upload':
|
|
129
127
|
_def = {
|
|
130
|
-
value: isEmpty(def)
|
|
131
|
-
? multiple
|
|
132
|
-
? []
|
|
133
|
-
: null
|
|
134
|
-
: multiple
|
|
135
|
-
? [...def]
|
|
136
|
-
: def
|
|
128
|
+
value: isEmpty(def) ? (multiple ? [] : null) : multiple ? [...def] : def
|
|
137
129
|
}
|
|
138
130
|
break
|
|
139
131
|
|
|
@@ -158,9 +150,7 @@ export function getDefaultValue({ mold, multiple, type, default: def }) {
|
|
|
158
150
|
case 'datewmqy':
|
|
159
151
|
case 'datepicker':
|
|
160
152
|
_def = {
|
|
161
|
-
value: type && type.includes('range')
|
|
162
|
-
? isEmpty(def) ? [] : [...def]
|
|
163
|
-
: isEmpty(def) ? null : def
|
|
153
|
+
value: type && type.includes('range') ? (isEmpty(def) ? [] : [...def]) : isEmpty(def) ? null : def
|
|
164
154
|
}
|
|
165
155
|
break
|
|
166
156
|
|
|
@@ -188,4 +178,3 @@ export function getDefaultValue({ mold, multiple, type, default: def }) {
|
|
|
188
178
|
export function isEmpty(def) {
|
|
189
179
|
return def === null || def === undefined
|
|
190
180
|
}
|
|
191
|
-
|