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.
Files changed (175) hide show
  1. package/README.md +1 -1
  2. package/nstc-g6/components/Calendar/index.js +5 -5
  3. package/nstc-g6/components/Calendar/src/basic/month-table.vue +12 -20
  4. package/nstc-g6/components/Calendar/src/basic/year-table.vue +18 -22
  5. package/nstc-g6/components/Calendar/src/main.vue +1 -5
  6. package/nstc-g6/components/DialogForm/index.js +5 -5
  7. package/nstc-g6/components/DialogForm/src/demo/index.vue +18 -27
  8. package/nstc-g6/components/DialogForm/src/main.vue +15 -21
  9. package/nstc-g6/components/Form/A_DEMO/component/originalForm.vue +35 -50
  10. package/nstc-g6/components/Form/A_DEMO/config/config_3.js +1115 -1110
  11. package/nstc-g6/components/Form/A_DEMO/index.vue +7 -29
  12. package/nstc-g6/components/Form/AutocompleteCustom/index.vue +3 -5
  13. package/nstc-g6/components/Form/BusinessSpecific/InputMultiple.vue +60 -62
  14. package/nstc-g6/components/Form/BusinessSpecific/InputWithUnit.vue +12 -35
  15. package/nstc-g6/components/Form/BusinessSpecific/SelectTreeDialog.vue +77 -77
  16. package/nstc-g6/components/Form/CascaderCustom/index.vue +4 -4
  17. package/nstc-g6/components/Form/CheckboxCustom/index.vue +5 -11
  18. package/nstc-g6/components/Form/Component.vue +56 -78
  19. package/nstc-g6/components/Form/ComponentSecond.vue +55 -77
  20. package/nstc-g6/components/Form/InputAndDialog/index.js +5 -5
  21. package/nstc-g6/components/Form/InputAndDialog/src/main.vue +130 -153
  22. package/nstc-g6/components/Form/InputCustom/demo/index.vue +4 -12
  23. package/nstc-g6/components/Form/InputCustom/index.vue +51 -54
  24. package/nstc-g6/components/Form/IntervalinputCustom/demo/index.vue +1 -3
  25. package/nstc-g6/components/Form/IntervalinputCustom/index.vue +19 -41
  26. package/nstc-g6/components/Form/Item.vue +15 -30
  27. package/nstc-g6/components/Form/ItemSecond.vue +7 -22
  28. package/nstc-g6/components/Form/List.vue +12 -28
  29. package/nstc-g6/components/Form/ListSecond.vue +11 -27
  30. package/nstc-g6/components/Form/RadioCustom/index.vue +5 -23
  31. package/nstc-g6/components/Form/SelectAccount/index.js +5 -5
  32. package/nstc-g6/components/Form/SelectAccount/src/demo/index.vue +34 -28
  33. package/nstc-g6/components/Form/SelectAccount/src/main.vue +112 -83
  34. package/nstc-g6/components/Form/SelectAndDialog/index.js +5 -5
  35. package/nstc-g6/components/Form/SelectAndDialog/src/main.vue +126 -149
  36. package/nstc-g6/components/Form/SelectCashFlow/index.js +5 -5
  37. package/nstc-g6/components/Form/SelectCashFlow/src/demo/index.vue +18 -19
  38. package/nstc-g6/components/Form/SelectCashFlow/src/main.vue +52 -41
  39. package/nstc-g6/components/Form/SelectCustom/demo/index.vue +14 -16
  40. package/nstc-g6/components/Form/SelectCustom/index.vue +129 -139
  41. package/nstc-g6/components/Form/SelectSubject/index.js +5 -5
  42. package/nstc-g6/components/Form/SelectSubject/src/demo/index.vue +42 -48
  43. package/nstc-g6/components/Form/SelectSubject/src/main.vue +83 -86
  44. package/nstc-g6/components/Form/SelectindialogCustom/demo/index.vue +34 -35
  45. package/nstc-g6/components/Form/SelectindialogCustom/index.vue +133 -148
  46. package/nstc-g6/components/Form/SelectindialogCustom/install.js +3 -3
  47. package/nstc-g6/components/Form/TableRadioCustom/demo/index.vue +1 -7
  48. package/nstc-g6/components/Form/TableRadioCustom/index.vue +17 -26
  49. package/nstc-g6/components/Form/TextCustom/index.vue +2 -2
  50. package/nstc-g6/components/Form/UploadCustom/demo/index.vue +1 -3
  51. package/nstc-g6/components/Form/UploadCustom/index.vue +143 -173
  52. package/nstc-g6/components/Form/configs.js +3 -14
  53. package/nstc-g6/components/Form/configsSecond.js +3 -16
  54. package/nstc-g6/components/Form/index.js +1 -1
  55. package/nstc-g6/components/Form/payeePersonSelect/index.js +5 -5
  56. package/nstc-g6/components/Form/payeePersonSelect/src/demo/index.vue +50 -44
  57. package/nstc-g6/components/Form/payeePersonSelect/src/main.vue +73 -82
  58. package/nstc-g6/components/FormGroup/index.js +5 -5
  59. package/nstc-g6/components/FormGroup/src/demo/config.js +18 -19
  60. package/nstc-g6/components/FormGroup/src/demo/index.vue +14 -22
  61. package/nstc-g6/components/FormGroup/src/main.vue +122 -141
  62. package/nstc-g6/components/FormGroup/src/validate.js +11 -13
  63. package/nstc-g6/components/InputTag/InputTag.vue +78 -111
  64. package/nstc-g6/components/NstcBackToTop/NstcBackToTop.vue +24 -24
  65. package/nstc-g6/components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +4 -13
  66. package/nstc-g6/components/NstcCharts/NstcCharts.vue +9 -18
  67. package/nstc-g6/components/NstcCharts/define.js +1 -6
  68. package/nstc-g6/components/NstcConfirm/NstcConfirm.vue +6 -21
  69. package/nstc-g6/components/NstcConfirm/index.js +21 -19
  70. package/nstc-g6/components/NstcDialog/NstcDialog.vue +34 -38
  71. package/nstc-g6/components/NstcDialogForm/NstcDialogForm.vue +17 -21
  72. package/nstc-g6/components/NstcDialogTable/NstcDialogTable.vue +4 -17
  73. package/nstc-g6/components/NstcDropdown/NstcDropdown.vue +2 -12
  74. package/nstc-g6/components/NstcDropdownTree/NstcDropdownTree.vue +3 -13
  75. package/nstc-g6/components/NstcElectronicFile/NstcElectronicFile.vue +18 -78
  76. package/nstc-g6/components/NstcExcelCustomImport/NstcExcelCustomImport.vue +121 -147
  77. package/nstc-g6/components/NstcExcelImport/NstcExcelImport.vue +9 -31
  78. package/nstc-g6/components/NstcExcelImportN/NstcExcelImportN.vue +10 -33
  79. package/nstc-g6/components/NstcExpandCollapse/NstcExpandCollapse.vue +12 -16
  80. package/nstc-g6/components/NstcFileUpload/NstcFileUpload.vue +19 -75
  81. package/nstc-g6/components/NstcForm/A_DEMO/component/originalForm.vue +35 -50
  82. package/nstc-g6/components/NstcForm/A_DEMO/config/config_3.js +1115 -1110
  83. package/nstc-g6/components/NstcForm/A_DEMO/index.vue +340 -354
  84. package/nstc-g6/components/NstcForm/AutocompleteCustom/index.vue +2 -2
  85. package/nstc-g6/components/NstcForm/BusinessSpecific/InputWithUnit.vue +11 -34
  86. package/nstc-g6/components/NstcForm/BusinessSpecific/SelectTreeDialog.vue +77 -77
  87. package/nstc-g6/components/NstcForm/CheckboxCustom/index.vue +5 -11
  88. package/nstc-g6/components/NstcForm/Component.vue +17 -62
  89. package/nstc-g6/components/NstcForm/ComponentSecond.vue +55 -77
  90. package/nstc-g6/components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +6 -24
  91. package/nstc-g6/components/NstcForm/InputCustom/index.vue +2 -8
  92. package/nstc-g6/components/NstcForm/IntervalInputCustom/index.vue +4 -21
  93. package/nstc-g6/components/NstcForm/Item.vue +3 -15
  94. package/nstc-g6/components/NstcForm/ItemSecond.vue +7 -22
  95. package/nstc-g6/components/NstcForm/List.vue +12 -28
  96. package/nstc-g6/components/NstcForm/ListSecond.vue +11 -27
  97. package/nstc-g6/components/NstcForm/RadioCustom/index.vue +5 -23
  98. package/nstc-g6/components/NstcForm/SelectAccount/NstcSelectAccount.vue +4 -24
  99. package/nstc-g6/components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +7 -30
  100. package/nstc-g6/components/NstcForm/SelectCashFlow/NstcSelectCashFlow.vue +50 -38
  101. package/nstc-g6/components/NstcForm/SelectCustom/index.vue +6 -16
  102. package/nstc-g6/components/NstcForm/SelectSubject/NstcSelectSubject.vue +72 -82
  103. package/nstc-g6/components/NstcForm/SelectindialogCustom/index.vue +6 -20
  104. package/nstc-g6/components/NstcForm/TableRadioCustom/index.vue +17 -26
  105. package/nstc-g6/components/NstcForm/TextCustom/index.vue +2 -2
  106. package/nstc-g6/components/NstcForm/UploadCustom/index.vue +13 -60
  107. package/nstc-g6/components/NstcForm/configs.js +3 -14
  108. package/nstc-g6/components/NstcForm/configsSecond.js +3 -16
  109. package/nstc-g6/components/NstcForm/index.js +1 -1
  110. package/nstc-g6/components/NstcForm/payeePersonSelect/NstcPayeePerson.vue +57 -73
  111. package/nstc-g6/components/NstcPagination/NstcPagination.vue +2 -12
  112. package/nstc-g6/components/NstcScreenFull/NstcScreenFull.vue +2 -3
  113. package/nstc-g6/components/NstcSelectTree/NstcSelectTree.vue +4 -15
  114. package/nstc-g6/components/NstcSelectTreeList/NstcSelectTreeList.vue +5 -20
  115. package/nstc-g6/components/NstcSticky/NstcSticky.vue +10 -4
  116. package/nstc-g6/components/NstcSvgIcon/NstcSvgIcon.vue +1 -7
  117. package/nstc-g6/components/NstcTab/NstcTab.vue +8 -20
  118. package/nstc-g6/components/NstcTabWithBadge/NstcTabWithBadge.vue +7 -7
  119. package/nstc-g6/components/NstcTable/ElTableColumnCustom/index.vue +88 -126
  120. package/nstc-g6/components/NstcTable/NstcTable.vue +4 -17
  121. package/nstc-g6/components/NstcTableSet/NstcTableSet.vue +27 -72
  122. package/nstc-g6/components/NstcThemePicker/NstcThemePicker.vue +13 -14
  123. package/nstc-g6/components/NstcUploadCustomExcel/NstcUploadCustomExcel.vue +3 -13
  124. package/nstc-g6/components/NstcUploadExcel/NstcUploadExcel.vue +21 -22
  125. package/nstc-g6/components/NstcWorkBench/NstcWorkBench.vue +4 -17
  126. package/nstc-g6/components/Search/NstcSearch.vue +12 -47
  127. package/nstc-g6/components/Search/src/demo/index copy.vue +28 -28
  128. package/nstc-g6/components/Search/src/demo/index.vue +36 -36
  129. package/nstc-g6/components/Search/src/main copy.vue +169 -204
  130. package/nstc-g6/components/approvelTwo/main.vue +2 -6
  131. package/nstc-g6/components/approvelTwo/progress.vue +7 -29
  132. package/nstc-g6/directives/VCopy/index.js +52 -54
  133. package/nstc-g6/directives/VNstcNumber/index.js +1 -1
  134. package/nstc-g6/directives/VNstcNumber/temp.js +357 -362
  135. package/nstc-g6/utils/mapper_aims.js +774 -775
  136. package/nstc-g6/utils/parseTime.js +38 -36
  137. package/nstc-g6/utils/validate/index.js +2 -2
  138. package/nstc-g6/utils/vendor/Export2Excel.js +110 -111
  139. package/nstc-g6/utils/vendor/Export2Zip.js +12 -7
  140. package/nstc-g6/utils/vue-bus.js +1 -1
  141. package/package.json +1 -1
  142. package/src/assets/iconFont/demo_index.html +1 -1
  143. package/src/assets/iconFont/iconfont.js +66 -1
  144. package/src/assets/iconFont2/demo_index.html +277 -286
  145. package/src/assets/iconFont2/iconfont.js +66 -1
  146. package/src/components/Button/button-group.vue +1 -1
  147. package/src/components/Layout/HeaderWrap/indexN.vue +1 -1
  148. package/src/components/Layout/indexN.vue +1 -2
  149. package/src/components/LoginTemporary/indexN.vue +12 -2
  150. package/src/components/TableOperateColumn/index.vue +1 -1
  151. package/src/plugins/Print/print-js/README.md +5 -5
  152. package/src/plugins/Print/print-js/package.json +2 -2
  153. package/src/plugins/Print/print-js/src/index.d.ts +36 -36
  154. package/src/plugins/Print/print-js/src/js/browser.js +3 -1
  155. package/src/plugins/Print/print-js/src/js/functions.js +16 -10
  156. package/src/plugins/Print/print-js/src/js/html.js +2 -2
  157. package/src/plugins/Print/print-js/src/js/image.js +1 -1
  158. package/src/plugins/Print/print-js/src/js/init.js +15 -7
  159. package/src/plugins/Print/print-js/src/js/json.js +14 -4
  160. package/src/plugins/Print/print-js/src/js/modal.js +16 -15
  161. package/src/plugins/Print/print-js/src/js/pdf.js +1 -1
  162. package/src/plugins/Print/print-js/src/js/print.js +6 -6
  163. package/src/plugins/Sign/NetSM3/InfosecNetSignCNGAgent.min.js +1825 -1592
  164. package/src/plugins/Sign/cfca/index.js +525 -520
  165. package/src/plugins/Sign/sign.js +128 -128
  166. package/style/index.css +1 -1
  167. package/style/index.css.map +1 -1
  168. package/theme/blue.css +1 -1
  169. package/theme/cctcRed.css +1 -1
  170. package/theme/green.css +1 -1
  171. package/theme/lightBlue.css +1 -1
  172. package/theme/orange.css +1 -1
  173. package/theme/purple.css +1 -1
  174. package/theme/red.css +1 -1
  175. 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
- type: 'selection',
130
- width: 35
131
- },
132
- ...this.columns
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 && this.value.forEach((item) => {
161
- const index = data.findIndex(row => row[this.valueKey] === item[this.valueKey])
150
+ this.value &&
151
+ this.value.forEach((item) => {
152
+ const index = data.findIndex((row) => row[this.valueKey] === item[this.valueKey])
162
153
 
163
- this.$refs.tableSelect.$refs.elTable.toggleRowSelection(data[index], true)
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
@@ -26,6 +26,4 @@ export default {
26
26
  }
27
27
  </script>
28
28
 
29
- <style scoped>
30
-
31
- </style>
29
+ <style scoped></style>
@@ -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
- v-for="(item,index) in valueClassification.other"
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
- v-for="(item,index) in valueClassification.img"
68
- :key="index"
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: { // 值格式为单选{ fileName,fileUrl }/{ fileName,file },或者多选[{ fileName,fileUrl }]/[{ fileName,file }]
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: { // true时,值返回格式为{ fileName,fileUrl };false时,值返回格式为{ fileName,file }(file为文件类型)
80
+ valueIsFileUrl: {
81
+ // true时,值返回格式为{ fileName,fileUrl };false时,值返回格式为{ fileName,file }(file为文件类型)
118
82
  type: Boolean,
119
83
  default: false
120
84
  },
121
85
 
122
- url: { // 上传到自定义服务器的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: { // 上传前的验证,参数为typeCode(文件头前8位,用于检测文件真实格式), raw(文件buffer对象)
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: { // ali-oss上传路径前缀
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((prev, file, index) => {
220
- if (reg.test(file.fileName)) {
221
- let fileUrl = ''
188
+ return _value.reduce(
189
+ (prev, file, index) => {
190
+ if (reg.test(file.fileName)) {
191
+ let fileUrl = ''
222
192
 
223
- if (file.fileUrl) {
224
- fileUrl = file.fileUrl
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
- fileUrl = window.URL.createObjectURL(file.file)
227
- this.revokeObjectURL.push(fileUrl)
206
+ prev.other.push({
207
+ ...file,
208
+ index
209
+ })
228
210
  }
229
211
 
230
- prev.img.push({
231
- fileUrl,
232
- index,
233
- ...file
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 && (files.length + this._value.length > this.max)) {
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
- .upload-custom {
423
- display: inline-flex;
424
- align-items: center;
425
- position: relative;
426
- padding-right: 32px;
427
- &.is-multiple {
428
- display: inline-block;
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
- .button-cancel {
432
- flex: none;
433
- padding: 0 15px 0 12px;
434
- width: auto;
435
- display: inline-flex;
436
- align-items: center;
437
- i {
438
- margin-right: 6px;
439
- font-size: 9px;
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
- input {
444
- display: none;
445
- }
413
+ input {
414
+ display: none;
415
+ }
446
416
 
447
- .upload-file {
448
- &-name {
449
- font-size: 14px;
450
- padding-left: 10px;
451
- flex: auto;
452
- overflow: hidden;
453
- white-space: nowrap;
454
- text-overflow: ellipsis;
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
- &-delete {
458
- position: absolute;
459
- top: 9px;
460
- right: 0;
461
- }
427
+ &-delete {
428
+ position: absolute;
429
+ top: 9px;
430
+ right: 0;
431
+ }
462
432
 
463
- &-other {
464
- display: flex;
465
- flex-wrap: wrap;
466
- margin-top: 5px;
467
- &-item {
468
- flex: none;
469
- display: flex;
470
- align-items: center;
471
- margin-right: 40px;
472
- .upload-file-name {
473
- padding-left: 0;
474
- padding-right: 10px;
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
- &-img {
480
- display: flex;
481
- margin-top: 5px;
482
- flex-wrap: wrap;
483
- &-item {
484
- flex: none;
485
- margin-right: 10px;
486
- position: relative;
487
- .el-image {
488
- width: 72px;
489
- height: 72px;
490
- background-color: #fff;
491
- border-radius: 2px;
492
- border: #CFD8E6;
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
-