n20-common-lib 1.3.0 → 1.3.3

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 (31) hide show
  1. package/package.json +1 -1
  2. package/src/components/ECharts/mixins/resize.js +1 -1
  3. package/src/components/FileImport/index.vue +1 -1
  4. package/src/components/NstcG6Components/Form/DatepickerCustom/index.vue +32 -32
  5. package/src/components/NstcG6Components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +37 -33
  6. package/src/components/NstcG6Components/NstcCharts/mixins/resize.js +1 -1
  7. package/src/components/NstcG6Components/NstcDropdownTree/NstcDropdownTree.vue +141 -137
  8. package/src/components/NstcG6Components/NstcExcelExport/NstcExcelExport.vue +47 -47
  9. package/src/components/NstcG6Components/NstcExcelImport/NstcExcelImport.vue +1 -1
  10. package/src/components/NstcG6Components/NstcExcelImportN/NstcExcelImportN.vue +186 -188
  11. package/src/components/NstcG6Components/NstcFileUpload/NstcFileUpload.vue +429 -451
  12. package/src/components/NstcG6Components/NstcForm/BusinessSpecific/InputMultiple.vue +66 -68
  13. package/src/components/NstcG6Components/NstcForm/CascaderCustom/index.vue +7 -7
  14. package/src/components/NstcG6Components/NstcForm/DatepickerCustom/index.vue +32 -32
  15. package/src/components/NstcG6Components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +1 -1
  16. package/src/components/NstcG6Components/NstcForm/InputCustom/index.vue +1 -1
  17. package/src/components/NstcG6Components/NstcForm/SelectAccount/NstcSelectAccount.vue +1 -1
  18. package/src/components/NstcG6Components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +1 -1
  19. package/src/components/NstcG6Components/NstcForm/SelectCustom/index.vue +1 -1
  20. package/src/components/NstcG6Components/NstcForm/SelectindialogCustom/index.vue +1 -1
  21. package/src/components/NstcG6Components/NstcForm/UploadCustom/index.vue +1 -1
  22. package/src/components/NstcG6Components/NstcSelectTree/NstcSelectTree.vue +172 -172
  23. package/src/components/NstcG6Components/NstcSelectTreeList/NstcSelectTreeList.vue +1 -1
  24. package/src/components/NstcG6Components/NstcSvgIcon/NstcSvgIcon.vue +7 -12
  25. package/src/components/NstcG6Components/NstcTable/NstcTable.vue +145 -145
  26. package/src/components/NstcG6Components/NstcTableSet/NstcTableSet.vue +4 -4
  27. package/src/components/NstcG6Components/NstcWorkBench/NstcWorkBench.vue +45 -36
  28. package/src/components/NstcG6Components/Search/NstcSearch.vue +6 -6
  29. package/src/components/NstcG6Components/approvelTwo/main.vue +1 -1
  30. package/src/components/NstcG6Components/approvelTwo/progress.vue +1 -1
  31. package/src/components/Search/index.vue +8 -8
@@ -5,23 +5,18 @@
5
5
  -->
6
6
  <template>
7
7
  <div
8
- v-if="isExternal"
9
- :style="styleExternalIcon"
10
- class="svg-external-icon svg-icon"
11
- v-on="$listeners"
8
+ v-if="isExternal"
9
+ :style="styleExternalIcon"
10
+ class="svg-external-icon svg-icon"
11
+ v-on="$listeners"
12
12
  />
13
- <svg
14
- v-else
15
- :class="svgClass"
16
- aria-hidden="true"
17
- v-on="$listeners"
18
- >
13
+ <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
19
14
  <use :xlink:href="iconName" />
20
15
  </svg>
21
16
  </template>
22
17
 
23
18
  <script>
24
- import { isExternal } from '@/utils/validate'
19
+ import { isExternal } from '../../../utils/validate'
25
20
 
26
21
  export default {
27
22
  name: 'NstcSvgIcon',
@@ -70,7 +65,7 @@ export default {
70
65
 
71
66
  .svg-external-icon {
72
67
  background-color: currentColor;
73
- mask-size: cover!important;
68
+ mask-size: cover !important;
74
69
  display: inline-block;
75
70
  }
76
71
  </style>
@@ -5,84 +5,84 @@
5
5
  -->
6
6
  <template>
7
7
  <div
8
- :class="[
8
+ :class="[
9
9
  'element-table-custom',
10
- { 'vertical-header-el-table': isVerticalHeader },
10
+ { 'vertical-header-el-table': isVerticalHeader }
11
11
  ]"
12
12
  >
13
13
  <el-table
14
- ref="elTable"
15
- v-bind="$attrs"
16
- :data="data"
17
- :show-summary="!!summaryProps.length"
18
- :summary-method="summaryMethod"
19
- :span-method="objectSpanMethod"
20
- :row-class-name="getRowClass"
21
- style="width: 100%"
22
- :max-height="maxHeight || null"
23
- @row-click="rowClick"
24
- border
25
- v-on="$listeners"
14
+ ref="elTable"
15
+ v-bind="$attrs"
16
+ :data="data"
17
+ :show-summary="!!summaryProps.length"
18
+ :summary-method="summaryMethod"
19
+ :span-method="objectSpanMethod"
20
+ :row-class-name="getRowClass"
21
+ style="width: 100%"
22
+ :max-height="maxHeight || null"
23
+ @row-click="rowClick"
24
+ border
25
+ v-on="$listeners"
26
26
  >
27
27
  <!-- 前部 -->
28
- <slot name="before"/>
28
+ <slot name="before" />
29
29
 
30
30
  <!-- 主体 -->
31
31
  <template v-for="(column, index) in columns">
32
32
  <ElTableColumnCustom
33
- ref="columnRef"
34
- :key="index"
35
- :show-overflow-tooltip="true"
36
- :column="column"
37
- :break-num="column.breakNum || 2"
38
- @sortPropChange="handleSortPropChange"
33
+ ref="columnRef"
34
+ :key="index"
35
+ :show-overflow-tooltip="true"
36
+ :column="column"
37
+ :break-num="column.breakNum || 2"
38
+ @sortPropChange="handleSortPropChange"
39
39
  />
40
40
  </template>
41
41
 
42
42
  <!-- 操作 -->
43
43
  <el-table-column
44
- v-if="showHandlers"
45
- :width="handlersWidth"
46
- fixed="right"
47
- :label="handlersLabel"
48
- header-align="center"
44
+ v-if="showHandlers"
45
+ :width="handlersWidth"
46
+ fixed="right"
47
+ :label="handlersLabel"
48
+ header-align="center"
49
49
  >
50
50
  <template slot-scope="scope">
51
51
  <div class="element-table-custom-handlers">
52
- <slot :row="scope.row" :index="scope.$index"/>
53
- <slot :row="scope.row" name="handlers"/>
52
+ <slot :row="scope.row" :index="scope.$index" />
53
+ <slot :row="scope.row" name="handlers" />
54
54
  </div>
55
55
  </template>
56
56
  </el-table-column>
57
57
  <!-- 尾部 -->
58
- <slot name="after"/>
58
+ <slot name="after" />
59
59
  </el-table>
60
- <slot name="sum"/>
60
+ <slot name="sum" />
61
61
 
62
62
  <NstcPagination
63
- v-if="showPagination && !isVerticalHeader"
64
- v-model="pagination"
65
- :page="pagination.page"
66
- :page-size="pagination.limit"
67
- :total="pagination.total"
68
- :is-inter-face="isInterFace"
69
- @pagination-change="paginationChange"
63
+ v-if="showPagination && !isVerticalHeader"
64
+ v-model="pagination"
65
+ :page="pagination.page"
66
+ :page-size="pagination.limit"
67
+ :total="pagination.total"
68
+ :is-inter-face="isInterFace"
69
+ @pagination-change="paginationChange"
70
70
  />
71
71
  </div>
72
72
  </template>
73
73
 
74
74
  <script>
75
- import ElTableColumnCustom from "./ElTableColumnCustom/index";
76
- import Sortable from "sortablejs";
77
- import NstcPagination from "../NstcPagination/NstcPagination";
78
- import axios from "@/utils/axios";
75
+ import ElTableColumnCustom from './ElTableColumnCustom/index'
76
+ import Sortable from 'sortablejs'
77
+ import NstcPagination from '../NstcPagination/NstcPagination'
78
+ import axios from '../../../utils/axios'
79
79
 
80
80
  export default {
81
- name: "NstcTable",
81
+ name: 'NstcTable',
82
82
 
83
83
  components: {
84
84
  ElTableColumnCustom,
85
- NstcPagination,
85
+ NstcPagination
86
86
  },
87
87
 
88
88
  inheritAttrs: false,
@@ -90,81 +90,81 @@ export default {
90
90
  props: {
91
91
  maxHeight: {
92
92
  type: Number,
93
- default: 0,
93
+ default: 0
94
94
  },
95
95
  styles: {
96
96
  type: Object,
97
- default: () => ({}),
97
+ default: () => ({})
98
98
  },
99
99
 
100
100
  nodata: {
101
101
  default: false,
102
- type: Boolean,
102
+ type: Boolean
103
103
  },
104
104
 
105
105
  canDoLayout: {
106
106
  default: true,
107
- type: Boolean,
107
+ type: Boolean
108
108
  },
109
109
 
110
110
  canDragRow: {
111
111
  default: false,
112
- type: Boolean,
112
+ type: Boolean
113
113
  },
114
114
 
115
115
  dragRowMethod: {
116
116
  default: undefined,
117
- type: Function,
117
+ type: Function
118
118
  },
119
119
 
120
120
  columns: {
121
121
  type: Array,
122
122
  required: true,
123
- default: () => [],
123
+ default: () => []
124
124
  },
125
125
 
126
126
  data: {
127
127
  type: Array,
128
128
  required: true,
129
- default: () => [],
129
+ default: () => []
130
130
  },
131
131
 
132
132
  sortProp: {
133
- default: "",
134
- type: String,
133
+ default: '',
134
+ type: String
135
135
  },
136
136
 
137
137
  sortCustom: {
138
138
  default: false,
139
- type: Boolean,
139
+ type: Boolean
140
140
  },
141
141
 
142
142
  handlersWidth: {
143
- default: "auto",
144
- type: String,
143
+ default: 'auto',
144
+ type: String
145
145
  },
146
146
 
147
147
  handlersLabel: {
148
148
  type: String,
149
149
  default: function () {
150
- return "操作";
151
- },
150
+ return '操作'
151
+ }
152
152
  },
153
153
 
154
154
  isVerticalHeader: {
155
155
  default: false,
156
- type: Boolean,
156
+ type: Boolean
157
157
  },
158
158
 
159
159
  summaryProps: {
160
160
  type: Array,
161
- default: () => [],
161
+ default: () => []
162
162
  },
163
163
 
164
164
  // 分页器是否展示
165
165
  showPagination: {
166
166
  default: true,
167
- type: Boolean,
167
+ type: Boolean
168
168
  },
169
169
 
170
170
  pagination: {
@@ -173,16 +173,16 @@ export default {
173
173
  return {
174
174
  page: 1,
175
175
  limit: 20,
176
- total: 100,
177
- };
178
- },
176
+ total: 100
177
+ }
178
+ }
179
179
  },
180
180
 
181
181
  sumText: {
182
182
  type: String,
183
183
  default: function () {
184
- return "本页合计";
185
- },
184
+ return '本页合计'
185
+ }
186
186
  },
187
187
 
188
188
  /**
@@ -191,32 +191,32 @@ export default {
191
191
  mergeSpan: {
192
192
  type: Array,
193
193
  default: () => {
194
- return [];
195
- },
194
+ return []
195
+ }
196
196
  },
197
197
  // 更具行内数据更改样式
198
198
  rowClass: {
199
199
  type: Object,
200
200
  default: () => {
201
201
  return {
202
- key: "",
203
- list: [],
204
- };
205
- },
202
+ key: '',
203
+ list: []
204
+ }
205
+ }
206
206
  },
207
207
  // 分页是否固定在页面底部
208
208
  isFixed: {
209
209
  type: Boolean,
210
- default: false,
210
+ default: false
211
211
  },
212
212
  // 是否是主界面
213
213
  isInterFace: {
214
214
  type: Boolean,
215
- default: false,
215
+ default: false
216
216
  },
217
217
  rowClick: {
218
218
  type: [Object, Function],
219
- default: () => ({}),
219
+ default: () => ({})
220
220
  }
221
221
  },
222
222
 
@@ -227,100 +227,100 @@ export default {
227
227
  sortable: null, // 拖拽表格库实例
228
228
  // 表格合并
229
229
  mergeSpanCol: [],
230
- mergeSpanRow: [],
231
- };
230
+ mergeSpanRow: []
231
+ }
232
232
  },
233
233
 
234
234
  computed: {
235
235
  showHandlers() {
236
- return this.$scopedSlots.default || this.$scopedSlots.handlers;
237
- },
236
+ return this.$scopedSlots.default || this.$scopedSlots.handlers
237
+ }
238
238
  },
239
239
 
240
240
  watch: {},
241
241
 
242
242
  mounted() {
243
- this.init();
243
+ this.init()
244
244
  },
245
245
 
246
246
  beforeDestroy() {
247
247
  if (this.sortable) {
248
- this.sortable.destroy();
249
- this.sortable = null;
248
+ this.sortable.destroy()
249
+ this.sortable = null
250
250
  }
251
251
  },
252
252
 
253
253
  methods: {
254
254
  down() {
255
- const url = "/api/nstc-ers/1.0/elecBill/file/download";
255
+ const url = '/api/nstc-ers/1.0/elecBill/file/download'
256
256
  axios({
257
257
  url: url,
258
- method: "get",
259
- responseType: "blob",
258
+ method: 'get',
259
+ responseType: 'blob'
260
260
  }).then((res) => {
261
- console.log(res);
262
- const content = res;
263
- const blob = new Blob([content]);
264
- if ("download" in document.createElement("a")) {
265
- const link = document.createElement("a");
266
- link.download = "1.txt";
267
- link.style.display = "none";
268
- link.href = URL.createObjectURL(blob);
269
- document.body.appendChild(link);
270
- link.click();
271
- URL.revokeObjectURL(link.href);
272
- document.body.removeChild(link);
261
+ console.log(res)
262
+ const content = res
263
+ const blob = new Blob([content])
264
+ if ('download' in document.createElement('a')) {
265
+ const link = document.createElement('a')
266
+ link.download = '1.txt'
267
+ link.style.display = 'none'
268
+ link.href = URL.createObjectURL(blob)
269
+ document.body.appendChild(link)
270
+ link.click()
271
+ URL.revokeObjectURL(link.href)
272
+ document.body.removeChild(link)
273
273
  } else {
274
- navigator.msSaveBlob(blob, "1.txt");
274
+ navigator.msSaveBlob(blob, '1.txt')
275
275
  }
276
- });
276
+ })
277
277
  },
278
278
  paginationChange(data) {
279
279
  // this._pagination = { ...data }
280
- console.log(data);
280
+ console.log(data)
281
281
 
282
- this.$emit("pagination-change", data);
282
+ this.$emit('pagination-change', data)
283
283
  },
284
284
  doLayout() {
285
- this.$refs.table.doLayout();
285
+ this.$refs.table.doLayout()
286
286
  },
287
287
 
288
288
  handleSortPropChange(prop) {
289
- this.$emit("update:sortProp", prop);
290
- this.$emit("sortPropChange", prop);
289
+ this.$emit('update:sortProp', prop)
290
+ this.$emit('sortPropChange', prop)
291
291
 
292
- this.eleSort();
292
+ this.eleSort()
293
293
  },
294
294
 
295
295
  eleSort() {
296
296
  !this.sortCustom &&
297
- this.sortProp &&
298
- this.$refs.table.sort(this.sortProp, "descending");
297
+ this.sortProp &&
298
+ this.$refs.table.sort(this.sortProp, 'descending')
299
299
  },
300
300
 
301
301
  // 合计
302
- summaryMethod({columns, data}) {
303
- return columns.reduce((sums, {property}, index) => {
302
+ summaryMethod({ columns, data }) {
303
+ return columns.reduce((sums, { property }, index) => {
304
304
  if (this.summaryProps.includes(property)) {
305
305
  const sum = data.reduce((prev, curr) => {
306
- const value = Number(curr[property]);
306
+ const value = Number(curr[property])
307
307
 
308
- return isNaN(value) ? prev : prev + value;
309
- }, 0);
308
+ return isNaN(value) ? prev : prev + value
309
+ }, 0)
310
310
 
311
- return [...sums, sum];
311
+ return [...sums, sum]
312
312
  }
313
- return [...sums, index === 0 ? this.sumText : "-"];
314
- }, []);
313
+ return [...sums, index === 0 ? this.sumText : '-']
314
+ }, [])
315
315
  },
316
316
  // 根据行中某个字段,显示添加不同的样式
317
317
  getRowClass(row) {
318
318
  if (!this.rowClass.key) {
319
- return "";
319
+ return ''
320
320
  } else {
321
321
  for (let i = 0; i < this.rowClass.list.length; i++) {
322
- if (row.row[this.rowClass.key] === this.rowClass.list[i]["value"]) {
323
- return this.rowClass.list[i]["name"];
322
+ if (row.row[this.rowClass.key] === this.rowClass.list[i]['value']) {
323
+ return this.rowClass.list[i]['name']
324
324
  }
325
325
  }
326
326
  }
@@ -335,34 +335,34 @@ export default {
335
335
  * @returns {*|{colspan: number, rowspan: number}}
336
336
  */
337
337
  // eslint-disable-next-line no-unused-vars
338
- objectSpanMethod({row, column, rowIndex, columnIndex}) {
338
+ objectSpanMethod({ row, column, rowIndex, columnIndex }) {
339
339
  if (this.mergeSpan.length === 0) {
340
340
  return {
341
341
  rowspan: 1,
342
- colspan: 1,
343
- };
342
+ colspan: 1
343
+ }
344
344
  } else {
345
345
  // 格式化数据
346
346
  if (this.mergeSpanCol.length === 0) {
347
347
  for (let i = 0; i < this.mergeSpan.length; i++) {
348
- this.mergeSpanCol.push(this.mergeSpan[i][`col`]);
349
- this.mergeSpanRow.push(this.mergeSpan[i][`row`]);
348
+ this.mergeSpanCol.push(this.mergeSpan[i][`col`])
349
+ this.mergeSpanRow.push(this.mergeSpan[i][`row`])
350
350
  }
351
351
  }
352
352
  if (
353
- this.mergeSpanCol.includes(columnIndex) &&
354
- this.mergeSpanRow.includes(rowIndex)
353
+ this.mergeSpanCol.includes(columnIndex) &&
354
+ this.mergeSpanRow.includes(rowIndex)
355
355
  ) {
356
356
  const temp = this.mergeSpan.filter((i) => {
357
- return i.col === columnIndex && i.row === rowIndex;
358
- });
357
+ return i.col === columnIndex && i.row === rowIndex
358
+ })
359
359
  if (temp.length === 1) {
360
- return temp[0][`span`];
360
+ return temp[0][`span`]
361
361
  } else {
362
362
  return {
363
363
  rowspan: 1,
364
- colspan: 1,
365
- };
364
+ colspan: 1
365
+ }
366
366
  }
367
367
  }
368
368
  }
@@ -370,35 +370,35 @@ export default {
370
370
 
371
371
  setDrag() {
372
372
  const $tbody = this.$refs.elTable.$el.querySelectorAll(
373
- ".el-table__body-wrapper > table > tbody"
374
- )[0];
373
+ '.el-table__body-wrapper > table > tbody'
374
+ )[0]
375
375
 
376
376
  this.sortable = Sortable.create($tbody, {
377
- ghostClass: "sortable-ghost", // Class name for the drop placeholder,
377
+ ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
378
378
  setData: function (dataTransfer) {
379
379
  // to avoid Firefox bug
380
380
  // Detail see : https://github.com/RubaXa/Sortable/issues/1012
381
- dataTransfer.setData("Text", "");
381
+ dataTransfer.setData('Text', '')
382
382
  },
383
383
  onEnd: (evt) => {
384
384
  // this.dragRowMethod && this.dragRowMethod(evt)
385
- const targetRow = this.data.splice(evt.oldIndex, 1)[0];
385
+ const targetRow = this.data.splice(evt.oldIndex, 1)[0]
386
386
  this.$nextTick(() => {
387
387
  this.$nextTick(() => {
388
- this.data.splice(evt.newIndex, 0, targetRow);
389
- });
390
- });
391
- },
392
- });
388
+ this.data.splice(evt.newIndex, 0, targetRow)
389
+ })
390
+ })
391
+ }
392
+ })
393
393
  },
394
394
 
395
395
  init() {
396
396
  this.$nextTick(() => {
397
- this.canDragRow && this.setDrag();
398
- });
399
- },
400
- },
401
- };
397
+ this.canDragRow && this.setDrag()
398
+ })
399
+ }
400
+ }
401
+ }
402
402
  </script>
403
403
 
404
404
  <style lang="scss">
@@ -101,9 +101,9 @@
101
101
  </template>
102
102
 
103
103
  <script>
104
- import NstcDialog from '@/components/NstcG6Components/NstcDialog/NstcDialog'
105
- import CheckboxCustom from '@/components/NstcG6Components/Form/CheckboxCustom'
106
- import axios from '@/utils/axios'
104
+ import NstcDialog from '../NstcDialog/NstcDialog'
105
+ import CheckboxCustom from '../NstcForm/CheckboxCustom/index.vue'
106
+ import axios from '../../../utils/axios'
107
107
  import Sortable from 'sortablejs'
108
108
 
109
109
  export default {
@@ -522,7 +522,7 @@ export default {
522
522
  this.excelExportList = data
523
523
  this.excelDownloadLoading = true
524
524
  let that = this
525
- import('@/utils/vendor/Export2Excel').then((excel) => {
525
+ import('../../../utils/vendor/Export2Excel').then((excel) => {
526
526
  const tHeader = this.result.map((i) => {
527
527
  return i[`name`]
528
528
  })