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
@@ -6,33 +6,37 @@
6
6
 
7
7
  <template>
8
8
  <div class="form-create-dropdown-tree">
9
- <el-popover placement="bottom-start" trigger="click" v-model="showPopoverFlag">
9
+ <el-popover
10
+ placement="bottom-start"
11
+ trigger="click"
12
+ v-model="showPopoverFlag"
13
+ >
10
14
  <el-input
11
- :ref="inputRefName"
12
- v-model="filterText"
13
- suffix-icon="el-icon-search"
14
- :placeholder="placeholder || placeholderTemp"
15
- :style="{ width: inputWidth }"
16
- @input="inputChange"
17
- @blur="clearFilterText"
18
- @focus="inputFocus"
19
- @change="inputChangeAction"
20
- clearable
21
- />
22
- <el-tree
23
- :ref="treeRefName"
24
- class="filter-tree"
25
- :data="treeData"
26
- :props="defaultProps"
27
- :node-key="nodeKey"
28
- default-expand-all
29
- :show-checkbox="showCheckbox"
30
- :check-strictly="showCheckbox"
31
- v-bind="$attrs"
32
- v-on="$listeners"
33
- @node-click="treeNodeClick"
34
- @check="handleCheckChange"
35
- />
15
+ :ref="inputRefName"
16
+ v-model="filterText"
17
+ suffix-icon="el-icon-search"
18
+ :placeholder="placeholder || placeholderTemp"
19
+ :style="{ width: inputWidth }"
20
+ @input="inputChange"
21
+ @blur="clearFilterText"
22
+ @focus="inputFocus"
23
+ @change="inputChangeAction"
24
+ clearable
25
+ />
26
+ <el-tree
27
+ :ref="treeRefName"
28
+ class="filter-tree"
29
+ :data="treeData"
30
+ :props="defaultProps"
31
+ :node-key="nodeKey"
32
+ default-expand-all
33
+ :show-checkbox="showCheckbox"
34
+ :check-strictly="showCheckbox"
35
+ v-bind="$attrs"
36
+ v-on="$listeners"
37
+ @node-click="treeNodeClick"
38
+ @check="handleCheckChange"
39
+ />
36
40
  <span class="el-dropdown-link" slot="reference">
37
41
  {{ unitNameText }}
38
42
  <i class="el-icon-arrow-down el-icon--right" />
@@ -42,180 +46,180 @@
42
46
  </template>
43
47
 
44
48
  <script>
45
- import axios from "@/utils/axios";
49
+ import axios from '../../../utils/axios'
46
50
  export default {
47
- name: "NstcDropdownTree", // 单位按树模块查询
51
+ name: 'NstcDropdownTree', // 单位按树模块查询
48
52
  props: {
49
53
  value: {
50
54
  type: [String, Number, Array, Object],
51
55
  default: () => {
52
- return "";
53
- },
56
+ return ''
57
+ }
54
58
  },
55
59
 
56
60
  lazy: {
57
61
  type: Boolean,
58
- default: false,
62
+ default: false
59
63
  },
60
64
 
61
65
  inputWidth: {
62
66
  type: String,
63
- default: "",
67
+ default: ''
64
68
  },
65
69
 
66
70
  showCheckbox: {
67
71
  type: Boolean,
68
- default: false,
72
+ default: false
69
73
  },
70
74
 
71
75
  url: {
72
76
  type: String,
73
- default: "",
77
+ default: ''
74
78
  },
75
79
 
76
80
  nodeKey: {
77
81
  type: String,
78
- default: "id",
82
+ default: 'id'
79
83
  },
80
84
 
81
85
  defaultProps: {
82
86
  type: Object,
83
87
  default: () => {
84
88
  return {
85
- children: "children",
86
- label: "label",
87
- };
88
- },
89
+ children: 'children',
90
+ label: 'label'
91
+ }
92
+ }
89
93
  },
90
94
 
91
95
  params: {
92
96
  type: Object,
93
97
  default: () => {
94
- return {};
95
- },
98
+ return {}
99
+ }
96
100
  },
97
101
 
98
102
  queryKey: {
99
103
  type: String,
100
- default: "query",
104
+ default: 'query'
101
105
  },
102
106
 
103
107
  label: {
104
108
  type: [String, Number],
105
- default: "",
109
+ default: ''
106
110
  },
107
111
 
108
112
  // 额外的查询参数
109
113
  query: {
110
114
  type: Object,
111
115
  default: () => {
112
- return {};
113
- },
116
+ return {}
117
+ }
114
118
  },
115
119
 
116
120
  // 组件的大小
117
121
  size: {
118
122
  type: String,
119
123
  default: () => {
120
- return "normal";
121
- },
124
+ return 'normal'
125
+ }
122
126
  },
123
127
  //是否添加 无
124
128
  showNull: {
125
129
  type: Boolean,
126
- default: false,
130
+ default: false
127
131
  },
128
132
  dropUnitName: {
129
133
  type: String,
130
- default: "全部单位",
134
+ default: '全部单位'
131
135
  },
132
136
  placeholderTemp: {
133
137
  type: String,
134
- default: "请输入关键字进行过滤",
135
- },
138
+ default: '请输入关键字进行过滤'
139
+ }
136
140
  },
137
141
  data() {
138
142
  return {
139
143
  showPopoverFlag: false,
140
144
  filterText: null,
141
145
  treeData: [],
142
- treeRefName: "",
146
+ treeRefName: '',
143
147
  inputRefName: this.getRefName(),
144
148
  queryFlag: true,
145
- placeholder: "",
149
+ placeholder: '',
146
150
  windowEventFlag: false,
147
151
  timeTemp: null,
148
- unitNameText: "全部单位",
149
- };
152
+ unitNameText: '全部单位'
153
+ }
150
154
  },
151
155
  computed: {
152
156
  _value: {
153
157
  get() {
154
- return this.value;
158
+ return this.value
155
159
  },
156
160
  set(val) {
157
- this.$emit("input", val);
158
- },
159
- },
161
+ this.$emit('input', val)
162
+ }
163
+ }
160
164
  },
161
165
  watch: {
162
166
  label(val) {
163
- this.filterText = val;
167
+ this.filterText = val
164
168
  },
165
169
  value(val) {
166
- if (["", null].includes(val)) {
167
- this.filterText = null;
168
- this.placeholder = null;
170
+ if (['', null].includes(val)) {
171
+ this.filterText = null
172
+ this.placeholder = null
169
173
  }
170
174
  },
171
175
  dropUnitName: {
172
176
  handler(val) {
173
- this.unitNameText = val;
177
+ this.unitNameText = val
174
178
  },
175
- deep: true,
176
- },
179
+ deep: true
180
+ }
177
181
  },
178
182
 
179
183
  created() {
180
184
  //
181
- this.treeRefName = this.getRefName();
182
- this.unitNameText = this.dropUnitName;
185
+ this.treeRefName = this.getRefName()
186
+ this.unitNameText = this.dropUnitName
183
187
  // 默认加载一次
184
- this.remoteMethod();
188
+ this.remoteMethod()
185
189
 
186
- this.filterText = this.label;
190
+ this.filterText = this.label
187
191
 
188
192
  // 点击其他地方关闭关闭下拉
189
- const that = this;
193
+ const that = this
190
194
  document.documentElement.onclick = function () {
191
- that.windowEventFlag && that.clearFilterText();
192
- };
195
+ that.windowEventFlag && that.clearFilterText()
196
+ }
193
197
  },
194
198
  methods: {
195
199
  /**
196
200
  * input 输入框变化事件
197
201
  */
198
202
  inputChange() {
199
- const that = this;
200
- this.timeTemp && clearTimeout(that.timeTemp);
203
+ const that = this
204
+ this.timeTemp && clearTimeout(that.timeTemp)
201
205
  this.timeTemp = setTimeout(() => {
202
- console.log("input change", this.filterText);
203
- this.queryFlag && this.remoteMethod();
204
- this.queryFlag = true;
205
- }, 300);
206
+ console.log('input change', this.filterText)
207
+ this.queryFlag && this.remoteMethod()
208
+ this.queryFlag = true
209
+ }, 300)
206
210
  },
207
211
 
208
212
  inputChangeAction(val) {
209
- console.log("change");
210
- this.$emit("inputChangeAction", val);
213
+ console.log('change')
214
+ this.$emit('inputChangeAction', val)
211
215
  },
212
216
 
213
217
  /**
214
218
  * 本地模糊查询
215
219
  */
216
220
  filterNode(value, data) {
217
- if (!value) return true;
218
- return data.label.indexOf(value) !== -1;
221
+ if (!value) return true
222
+ return data.label.indexOf(value) !== -1
219
223
  },
220
224
 
221
225
  /**
@@ -224,47 +228,47 @@ export default {
224
228
  getRefName() {
225
229
  return `ref_${new Date().getTime()}_${Math.random()
226
230
  .toString()
227
- .slice(5, 13)}`;
231
+ .slice(5, 13)}`
228
232
  },
229
233
 
230
234
  /**
231
235
  * 远程查询
232
236
  */
233
237
  remoteMethod() {
234
- const that = this;
238
+ const that = this
235
239
  //担保的需求化,默认是树,搜索时为列表
236
240
  // if(this.filterText){
237
241
  // this.params.resultType = 0
238
242
  // }else{
239
243
  // this.params.resultType = 1
240
244
  // }
241
- console.log(this.params, "this.params");
245
+ console.log(this.params, 'this.params')
242
246
  axios({
243
247
  url: that.url,
244
- method: "get",
248
+ method: 'get',
245
249
  loading: false,
246
250
  params: {
247
251
  [that.queryKey]: that.filterText,
248
- ...that.params,
249
- },
252
+ ...that.params
253
+ }
250
254
  })
251
255
  .then((data) => {
252
- that.treeData = data.list ? data.list : data;
256
+ that.treeData = data.list ? data.list : data
253
257
  if (that.showNull) {
254
258
  let map = {
255
- treeNo: "",
256
- unitName: "全部单位",
257
- unitNo: "",
258
- };
259
+ treeNo: '',
260
+ unitName: '全部单位',
261
+ unitNo: ''
262
+ }
259
263
  // eslint-disable-next-line no-debugger
260
264
  // debugger;
261
- that.treeData.unshift(map);
265
+ that.treeData.unshift(map)
262
266
  }
263
267
  that.$nextTick(() => {
264
- that.$forceUpdate();
265
- });
268
+ that.$forceUpdate()
269
+ })
266
270
  })
267
- .catch(() => {});
271
+ .catch(() => {})
268
272
  },
269
273
 
270
274
  /**
@@ -273,20 +277,20 @@ export default {
273
277
  */
274
278
  treeNodeClick(data) {
275
279
  if (!this.showCheckbox) {
276
- this.queryFlag = false;
280
+ this.queryFlag = false
277
281
 
278
- const k = this.defaultProps.label || "label";
282
+ const k = this.defaultProps.label || 'label'
279
283
 
280
- this.filterText = data[k];
281
- this.unitNameText = data[k];
282
- this.placeholder = this.filterText;
284
+ this.filterText = data[k]
285
+ this.unitNameText = data[k]
286
+ this.placeholder = this.filterText
283
287
 
284
- this._value = data[this.nodeKey];
288
+ this._value = data[this.nodeKey]
285
289
 
286
290
  // 主动让input框失去交单
287
- this.$refs[this.inputRefName].blur();
288
- this.showPopoverFlag = false;
289
- this.$emit("treeNodeClick", data);
291
+ this.$refs[this.inputRefName].blur()
292
+ this.showPopoverFlag = false
293
+ this.$emit('treeNodeClick', data)
290
294
  }
291
295
  },
292
296
 
@@ -295,28 +299,28 @@ export default {
295
299
  * 回调参数: data, node, tree
296
300
  */
297
301
  handleCheckChange(checkedNodes, checkedKeys) {
298
- console.log(checkedNodes, checkedKeys);
302
+ console.log(checkedNodes, checkedKeys)
299
303
 
300
- this.queryFlag = false;
304
+ this.queryFlag = false
301
305
 
302
306
  // const k = this.defaultProps.label || "label";
303
307
  // this.filterText = checkedKeys[k];
304
- let newText = [];
305
- checkedKeys["checkedNodes"].forEach((item) => {
306
- checkedKeys["checkedKeys"].forEach((el) => {
308
+ let newText = []
309
+ checkedKeys['checkedNodes'].forEach((item) => {
310
+ checkedKeys['checkedKeys'].forEach((el) => {
307
311
  if (item.unitNo === el) {
308
- newText.push(item.unitName);
312
+ newText.push(item.unitName)
309
313
  }
310
- });
311
- });
314
+ })
315
+ })
312
316
 
313
- this.filterText = newText.toString();
317
+ this.filterText = newText.toString()
314
318
 
315
- this.placeholder = this.filterText;
319
+ this.placeholder = this.filterText
316
320
 
317
- this._value = checkedKeys["checkedKeys"];
321
+ this._value = checkedKeys['checkedKeys']
318
322
 
319
- this.$emit("checkedClick", checkedKeys);
323
+ this.$emit('checkedClick', checkedKeys)
320
324
  },
321
325
 
322
326
  /**
@@ -324,18 +328,18 @@ export default {
324
328
  */
325
329
  clearFilterText() {
326
330
  if (!this.showCheckbox) {
327
- this.filterText = this.placeholder;
328
- this.placeholder = null;
329
- this.showPopoverFlag = false;
331
+ this.filterText = this.placeholder
332
+ this.placeholder = null
333
+ this.showPopoverFlag = false
330
334
  this.$nextTick(() => {
331
- this.$forceUpdate();
332
- });
333
- this.$emit("filterText", this.filterText);
335
+ this.$forceUpdate()
336
+ })
337
+ this.$emit('filterText', this.filterText)
334
338
  console.log(
335
- "TreeSelect关闭弹框...",
339
+ 'TreeSelect关闭弹框...',
336
340
  this.showPopoverFlag,
337
341
  this.filterText
338
- );
342
+ )
339
343
  }
340
344
  },
341
345
 
@@ -344,17 +348,17 @@ export default {
344
348
  */
345
349
  inputFocus() {
346
350
  if (!this.showCheckbox) {
347
- this.timeTemp && clearTimeout(this.timeTemp);
348
- this.windowEventFlag = false;
349
- this.placeholder = this.filterText;
350
- this.filterText = "";
351
- this.queryFlag = true;
352
- console.log("input focus...");
353
- this.remoteMethod();
351
+ this.timeTemp && clearTimeout(this.timeTemp)
352
+ this.windowEventFlag = false
353
+ this.placeholder = this.filterText
354
+ this.filterText = ''
355
+ this.queryFlag = true
356
+ console.log('input focus...')
357
+ this.remoteMethod()
354
358
  }
355
- },
356
- },
357
- };
359
+ }
360
+ }
361
+ }
358
362
  </script>
359
363
 
360
364
  <style lang="scss">
@@ -5,51 +5,51 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import * as Export2Excel from "@/utils/vendor/Export2Excel";
8
+ import * as Export2Excel from '../../../utils/vendor/Export2Excel'
9
9
  export default {
10
- name: "NstcExcelExport",
10
+ name: 'NstcExcelExport',
11
11
  props: {
12
12
  data: {
13
13
  type: Object,
14
14
  default: function () {
15
15
  return {
16
- childKey: "", //指定childKey时,会更具childKey递归取数据
16
+ childKey: '', //指定childKey时,会更具childKey递归取数据
17
17
  head: [], //表头数据,未指定childKey时,必须传字符串数组,指定childKey时,表头为对象数组,{key:'key',value:'value'},方便表格行取对应数据
18
18
  data: [], //行数据,未指定childKey时,必须传与表头对应的字符串数组,指定childKey时,传与表头对应的对象数组
19
- fileName: "列表",
20
- };
21
- },
19
+ fileName: '列表'
20
+ }
21
+ }
22
22
  },
23
23
  // 导入执行动作
24
24
  executeExportFlag: {
25
25
  type: [Number, String],
26
26
  default: () => {
27
- return "";
28
- },
27
+ return ''
28
+ }
29
29
  },
30
30
  // 单元格样式
31
31
  cellStyle: {
32
32
  type: Object,
33
33
  default: () => {
34
- return {};
35
- },
34
+ return {}
35
+ }
36
36
  },
37
37
  merges: {
38
38
  type: Array,
39
39
  default: () => {
40
- return [];
41
- },
42
- },
40
+ return []
41
+ }
42
+ }
43
43
  },
44
44
  watch: {
45
45
  executeExportFlag(newValue) {
46
46
  if (newValue) {
47
- this.excelExportAction();
47
+ this.excelExportAction()
48
48
  }
49
- },
49
+ }
50
50
  },
51
51
  data() {
52
- return {};
52
+ return {}
53
53
  },
54
54
  methods: {
55
55
  /**
@@ -61,32 +61,32 @@ export default {
61
61
  * @param childKey 子节点的key
62
62
  */
63
63
  flatChild(item, dataTemp, level, str, childKey) {
64
- let subStr = "";
64
+ let subStr = ''
65
65
  for (var i = 0; i < level; i++) {
66
- subStr += str;
66
+ subStr += str
67
67
  }
68
- item[this.data.head[0].key] = subStr + item[this.data.head[0].key];
69
- dataTemp.push(item);
70
- level++;
68
+ item[this.data.head[0].key] = subStr + item[this.data.head[0].key]
69
+ dataTemp.push(item)
70
+ level++
71
71
  // eslint-disable-next-line no-debugger
72
72
  if (item[childKey] && item[childKey].length > 0) {
73
73
  item[childKey].forEach((child) => {
74
- this.flatChild(child, dataTemp, level, str, childKey);
75
- });
74
+ this.flatChild(child, dataTemp, level, str, childKey)
75
+ })
76
76
  }
77
77
  },
78
78
  /**
79
79
  * 导出动作
80
80
  */
81
81
  excelExportAction() {
82
- this.excelDownloadLoading = true;
83
- let that = this;
82
+ this.excelDownloadLoading = true
83
+ let that = this
84
84
  if (this.data.head.length < 1 || this.data.data.length < 1) {
85
85
  this.$message({
86
- type: "warning",
87
- message: "表格数据不足!",
88
- });
89
- return;
86
+ type: 'warning',
87
+ message: '表格数据不足!'
88
+ })
89
+ return
90
90
  }
91
91
  // console.log('Export2Excel', import('@/utils/vendor/Export2Excel'))
92
92
  // import('@/utils/vendor/Export2Excel').then(excel => {
@@ -98,29 +98,29 @@ export default {
98
98
  // })
99
99
  // that.excelDownloadLoading = false
100
100
  // })
101
- let str = " "; //子节点添加的符号
102
- let level = 0; //当前行的等级
103
- let dataTemp = []; //暂存扁平化数据
101
+ let str = ' ' //子节点添加的符号
102
+ let level = 0 //当前行的等级
103
+ let dataTemp = [] //暂存扁平化数据
104
104
  if (this.data.childKey) {
105
105
  this.data.data.forEach((item) => {
106
- level = 0;
107
- this.flatChild(item, dataTemp, level, str, this.data.childKey);
108
- });
106
+ level = 0
107
+ this.flatChild(item, dataTemp, level, str, this.data.childKey)
108
+ })
109
109
 
110
110
  //扁平化数据转化为表数据
111
111
  dataTemp = dataTemp.map((d) => {
112
- let temp = [];
112
+ let temp = []
113
113
  this.data.head.forEach((h) => {
114
- temp.push(d[h.key]);
115
- });
116
- return temp;
117
- });
114
+ temp.push(d[h.key])
115
+ })
116
+ return temp
117
+ })
118
118
  // eslint-disable-next-line no-debugger
119
119
  // debugger;
120
120
 
121
121
  //重置表数据为转化后的数据
122
- this.data.head = this.data.head.map((item) => item.value);
123
- this.data.data = dataTemp;
122
+ this.data.head = this.data.head.map((item) => item.value)
123
+ this.data.data = dataTemp
124
124
  }
125
125
 
126
126
  Export2Excel.export_json_to_excel(
@@ -131,11 +131,11 @@ export default {
131
131
  merges: this.merges
132
132
  },
133
133
  this.cellStyle
134
- );
135
- that.excelDownloadLoading = false;
136
- },
137
- },
138
- };
134
+ )
135
+ that.excelDownloadLoading = false
136
+ }
137
+ }
138
+ }
139
139
  </script>
140
140
 
141
141
  <style lang="scss">
@@ -109,7 +109,7 @@
109
109
  import NstcUploadExcel from '../NstcUploadExcel/NstcUploadExcel'
110
110
  import NstcDialog from '../NstcDialog/NstcDialog'
111
111
  import uploadImg from './img/upload@2x.png'
112
- import axios from '@/utils/axios';
112
+ import axios from '../../../utils/axios';
113
113
  export default {
114
114
  name: 'NstcExcelImport',
115
115
  components: {