n20-common-lib 1.2.5 → 1.2.8

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.
@@ -0,0 +1,443 @@
1
+ {
2
+ "id": "2782772",
3
+ "name": "N20PC组件库",
4
+ "font_family": "core-lib-iconfont",
5
+ "css_prefix_text": "n20-icon-",
6
+ "description": "",
7
+ "glyphs": [
8
+ {
9
+ "icon_id": "29079842",
10
+ "name": "倒序",
11
+ "font_class": "daoxu",
12
+ "unicode": "e61c",
13
+ "unicode_decimal": 58908
14
+ },
15
+ {
16
+ "icon_id": "29079843",
17
+ "name": "顺序",
18
+ "font_class": "shunxu",
19
+ "unicode": "e61d",
20
+ "unicode_decimal": 58909
21
+ },
22
+ {
23
+ "icon_id": "29012251",
24
+ "name": "菜单收起",
25
+ "font_class": "caidanshouqi",
26
+ "unicode": "e61b",
27
+ "unicode_decimal": 58907
28
+ },
29
+ {
30
+ "icon_id": "28927755",
31
+ "name": "流程",
32
+ "font_class": "liucheng",
33
+ "unicode": "e661",
34
+ "unicode_decimal": 58977
35
+ },
36
+ {
37
+ "icon_id": "28885219",
38
+ "name": "成功",
39
+ "font_class": "chenggong",
40
+ "unicode": "e640",
41
+ "unicode_decimal": 58944
42
+ },
43
+ {
44
+ "icon_id": "28885221",
45
+ "name": "4.down",
46
+ "font_class": "a-4down",
47
+ "unicode": "e642",
48
+ "unicode_decimal": 58946
49
+ },
50
+ {
51
+ "icon_id": "28885222",
52
+ "name": "编 辑",
53
+ "font_class": "a-bianji",
54
+ "unicode": "e643",
55
+ "unicode_decimal": 58947
56
+ },
57
+ {
58
+ "icon_id": "28885223",
59
+ "name": "单选框-未选中",
60
+ "font_class": "danxuankuang-weixuanzhong",
61
+ "unicode": "e644",
62
+ "unicode_decimal": 58948
63
+ },
64
+ {
65
+ "icon_id": "28885224",
66
+ "name": "错误",
67
+ "font_class": "cuowu",
68
+ "unicode": "e645",
69
+ "unicode_decimal": 58949
70
+ },
71
+ {
72
+ "icon_id": "28885227",
73
+ "name": "单选框-已选中",
74
+ "font_class": "danxuankuang-yixuanzhong",
75
+ "unicode": "e648",
76
+ "unicode_decimal": 58952
77
+ },
78
+ {
79
+ "icon_id": "28885229",
80
+ "name": "多选框-未选悬停",
81
+ "font_class": "duoxuankuang-weixuanxuanting",
82
+ "unicode": "e64a",
83
+ "unicode_decimal": 58954
84
+ },
85
+ {
86
+ "icon_id": "28885238",
87
+ "name": "反馈-成功空心",
88
+ "font_class": "fankui-chenggongkongxin",
89
+ "unicode": "e655",
90
+ "unicode_decimal": 58965
91
+ },
92
+ {
93
+ "icon_id": "28885240",
94
+ "name": "年份切换-右侧",
95
+ "font_class": "nianfenqiehuan-youce",
96
+ "unicode": "e657",
97
+ "unicode_decimal": 58967
98
+ },
99
+ {
100
+ "icon_id": "28885241",
101
+ "name": "反馈-信息空心",
102
+ "font_class": "fankui-xinxikongxin",
103
+ "unicode": "e658",
104
+ "unicode_decimal": 58968
105
+ },
106
+ {
107
+ "icon_id": "28885242",
108
+ "name": "关闭-默认",
109
+ "font_class": "guanbi-moren",
110
+ "unicode": "e659",
111
+ "unicode_decimal": 58969
112
+ },
113
+ {
114
+ "icon_id": "28885246",
115
+ "name": "减号",
116
+ "font_class": "jianhao",
117
+ "unicode": "e65d",
118
+ "unicode_decimal": 58973
119
+ },
120
+ {
121
+ "icon_id": "28885251",
122
+ "name": "可关闭错误",
123
+ "font_class": "keguanbicuowu",
124
+ "unicode": "e663",
125
+ "unicode_decimal": 58979
126
+ },
127
+ {
128
+ "icon_id": "28885252",
129
+ "name": "年份切换-左侧",
130
+ "font_class": "nianfenqiehuan-zuoce",
131
+ "unicode": "e664",
132
+ "unicode_decimal": 58980
133
+ },
134
+ {
135
+ "icon_id": "28885253",
136
+ "name": "默认",
137
+ "font_class": "moren",
138
+ "unicode": "e665",
139
+ "unicode_decimal": 58981
140
+ },
141
+ {
142
+ "icon_id": "28885256",
143
+ "name": "搜索框-搜索弹窗",
144
+ "font_class": "sousuokuang-sousuodanchuang",
145
+ "unicode": "e668",
146
+ "unicode_decimal": 58984
147
+ },
148
+ {
149
+ "icon_id": "28885258",
150
+ "name": "提示",
151
+ "font_class": "tishi",
152
+ "unicode": "e66a",
153
+ "unicode_decimal": 58986
154
+ },
155
+ {
156
+ "icon_id": "28885260",
157
+ "name": "下拉-默认",
158
+ "font_class": "xiala-moren",
159
+ "unicode": "e66c",
160
+ "unicode_decimal": 58988
161
+ },
162
+ {
163
+ "icon_id": "28885261",
164
+ "name": "日期选择-日历",
165
+ "font_class": "riqixuanze-rili",
166
+ "unicode": "e66d",
167
+ "unicode_decimal": 58989
168
+ },
169
+ {
170
+ "icon_id": "28885262",
171
+ "name": "卡片(选中)",
172
+ "font_class": "a-kapianxuanzhong1",
173
+ "unicode": "e66e",
174
+ "unicode_decimal": 58990
175
+ },
176
+ {
177
+ "icon_id": "28885263",
178
+ "name": "新增",
179
+ "font_class": "xinzeng",
180
+ "unicode": "e66f",
181
+ "unicode_decimal": 58991
182
+ },
183
+ {
184
+ "icon_id": "28885265",
185
+ "name": "文件",
186
+ "font_class": "wenjian",
187
+ "unicode": "e671",
188
+ "unicode_decimal": 58993
189
+ },
190
+ {
191
+ "icon_id": "28885268",
192
+ "name": "信息",
193
+ "font_class": "xinxi",
194
+ "unicode": "e674",
195
+ "unicode_decimal": 58996
196
+ },
197
+ {
198
+ "icon_id": "28885269",
199
+ "name": "图标和文本提示",
200
+ "font_class": "tubiaohewenbentishi",
201
+ "unicode": "e675",
202
+ "unicode_decimal": 58997
203
+ },
204
+ {
205
+ "icon_id": "28885270",
206
+ "name": "下载-默认",
207
+ "font_class": "xiazai-moren",
208
+ "unicode": "e676",
209
+ "unicode_decimal": 58998
210
+ },
211
+ {
212
+ "icon_id": "28885271",
213
+ "name": "文件上传",
214
+ "font_class": "wenjianshangchuan",
215
+ "unicode": "e677",
216
+ "unicode_decimal": 58999
217
+ },
218
+ {
219
+ "icon_id": "28885273",
220
+ "name": "信息提示",
221
+ "font_class": "xinxitishi",
222
+ "unicode": "e679",
223
+ "unicode_decimal": 59001
224
+ },
225
+ {
226
+ "icon_id": "28885274",
227
+ "name": "选择框-下拉展开",
228
+ "font_class": "xuanzekuang-xialazhankai",
229
+ "unicode": "e67a",
230
+ "unicode_decimal": 59002
231
+ },
232
+ {
233
+ "icon_id": "28885275",
234
+ "name": "选择框-下拉",
235
+ "font_class": "xuanzekuang-xiala",
236
+ "unicode": "e67b",
237
+ "unicode_decimal": 59003
238
+ },
239
+ {
240
+ "icon_id": "28885277",
241
+ "name": "月份切换-右侧",
242
+ "font_class": "yuefenqiehuan-youce",
243
+ "unicode": "e67d",
244
+ "unicode_decimal": 59005
245
+ },
246
+ {
247
+ "icon_id": "28885279",
248
+ "name": "预览-默认",
249
+ "font_class": "yulan-moren",
250
+ "unicode": "e67f",
251
+ "unicode_decimal": 59007
252
+ },
253
+ {
254
+ "icon_id": "28885280",
255
+ "name": "月份切换-左侧",
256
+ "font_class": "yuefenqiehuan-zuoce",
257
+ "unicode": "e680",
258
+ "unicode_decimal": 59008
259
+ },
260
+ {
261
+ "icon_id": "28885284",
262
+ "name": "搜索框-搜索",
263
+ "font_class": "sousuokuang-sousuo",
264
+ "unicode": "e684",
265
+ "unicode_decimal": 59012
266
+ },
267
+ {
268
+ "icon_id": "28882629",
269
+ "name": "刷新",
270
+ "font_class": "shuaxin",
271
+ "unicode": "e634",
272
+ "unicode_decimal": 58932
273
+ },
274
+ {
275
+ "icon_id": "672036",
276
+ "name": "下拉",
277
+ "font_class": "xiala",
278
+ "unicode": "e6b9",
279
+ "unicode_decimal": 59065
280
+ },
281
+ {
282
+ "icon_id": "27964179",
283
+ "name": "编辑选中",
284
+ "font_class": "bianjixuanzhong",
285
+ "unicode": "e607",
286
+ "unicode_decimal": 58887
287
+ },
288
+ {
289
+ "icon_id": "27964193",
290
+ "name": "表格(选中)",
291
+ "font_class": "a-biaogexuanzhong",
292
+ "unicode": "e608",
293
+ "unicode_decimal": 58888
294
+ },
295
+ {
296
+ "icon_id": "27964199",
297
+ "name": "卡片(选中)",
298
+ "font_class": "a-kapianxuanzhong",
299
+ "unicode": "e609",
300
+ "unicode_decimal": 58889
301
+ },
302
+ {
303
+ "icon_id": "27964207",
304
+ "name": "全节点(选中)",
305
+ "font_class": "a-quanjiedianxuanzhong",
306
+ "unicode": "e60a",
307
+ "unicode_decimal": 58890
308
+ },
309
+ {
310
+ "icon_id": "27964212",
311
+ "name": "删除(选中)",
312
+ "font_class": "a-shanchuxuanzhong",
313
+ "unicode": "e60b",
314
+ "unicode_decimal": 58891
315
+ },
316
+ {
317
+ "icon_id": "27964230",
318
+ "name": "自身办理节点",
319
+ "font_class": "zishenbanlijiedian",
320
+ "unicode": "e60e",
321
+ "unicode_decimal": 58894
322
+ },
323
+ {
324
+ "icon_id": "27964102",
325
+ "name": "票面(选中)",
326
+ "font_class": "a-piaomianxuanzhong",
327
+ "unicode": "e605",
328
+ "unicode_decimal": 58885
329
+ },
330
+ {
331
+ "icon_id": "11372694",
332
+ "name": "设置",
333
+ "font_class": "shezhi",
334
+ "unicode": "e8b7",
335
+ "unicode_decimal": 59575
336
+ },
337
+ {
338
+ "icon_id": "26396703",
339
+ "name": "总金额",
340
+ "font_class": "zongjine",
341
+ "unicode": "e64e",
342
+ "unicode_decimal": 58958
343
+ },
344
+ {
345
+ "icon_id": "577398",
346
+ "name": "向下1",
347
+ "font_class": "xiangxia1",
348
+ "unicode": "e771",
349
+ "unicode_decimal": 59249
350
+ },
351
+ {
352
+ "icon_id": "4765723",
353
+ "name": "Dollar",
354
+ "font_class": "Dollar",
355
+ "unicode": "e77d",
356
+ "unicode_decimal": 59261
357
+ },
358
+ {
359
+ "icon_id": "6301055",
360
+ "name": "禁止",
361
+ "font_class": "jinzhi",
362
+ "unicode": "e654",
363
+ "unicode_decimal": 58964
364
+ },
365
+ {
366
+ "icon_id": "6829304",
367
+ "name": "ic_bank",
368
+ "font_class": "ic_bank",
369
+ "unicode": "e6b3",
370
+ "unicode_decimal": 59059
371
+ },
372
+ {
373
+ "icon_id": "12003265",
374
+ "name": "Bill A",
375
+ "font_class": "BillA",
376
+ "unicode": "ea71",
377
+ "unicode_decimal": 60017
378
+ },
379
+ {
380
+ "icon_id": "1986988",
381
+ "name": "删除",
382
+ "font_class": "n-shanchu",
383
+ "unicode": "e625",
384
+ "unicode_decimal": 58917
385
+ },
386
+ {
387
+ "icon_id": "6446147",
388
+ "name": "消息",
389
+ "font_class": "tianchongxing",
390
+ "unicode": "e633",
391
+ "unicode_decimal": 58931
392
+ },
393
+ {
394
+ "icon_id": "552270",
395
+ "name": "shaixuan",
396
+ "font_class": "iconfontshaixuan",
397
+ "unicode": "e60d",
398
+ "unicode_decimal": 58893
399
+ },
400
+ {
401
+ "icon_id": "8361853",
402
+ "name": "眼睛1",
403
+ "font_class": "yanjing",
404
+ "unicode": "e6cf",
405
+ "unicode_decimal": 59087
406
+ },
407
+ {
408
+ "icon_id": "1301374",
409
+ "name": "上传",
410
+ "font_class": "shangchuan",
411
+ "unicode": "e660",
412
+ "unicode_decimal": 58976
413
+ },
414
+ {
415
+ "icon_id": "7404517",
416
+ "name": "删除",
417
+ "font_class": "shanchu",
418
+ "unicode": "e785",
419
+ "unicode_decimal": 59269
420
+ },
421
+ {
422
+ "icon_id": "4880417",
423
+ "name": "拖动",
424
+ "font_class": "tuodong",
425
+ "unicode": "e604",
426
+ "unicode_decimal": 58884
427
+ },
428
+ {
429
+ "icon_id": "24101213",
430
+ "name": "user",
431
+ "font_class": "user",
432
+ "unicode": "e603",
433
+ "unicode_decimal": 58883
434
+ },
435
+ {
436
+ "icon_id": "24027681",
437
+ "name": "date",
438
+ "font_class": "date",
439
+ "unicode": "e602",
440
+ "unicode_decimal": 58882
441
+ }
442
+ ]
443
+ }
Binary file
@@ -0,0 +1,174 @@
1
+ <template>
2
+ <div style="display: none">
3
+ <el-dialog
4
+ v-drag
5
+ :visible.sync="pgsV"
6
+ title="文件导出"
7
+ width="432px"
8
+ top="calc(50vh - 92px)"
9
+ append-to-body
10
+ :close-on-click-modal="false"
11
+ :close-on-press-escape="false"
12
+ :before-close="exportCancel"
13
+ >
14
+ <div class="flex-box m-b">
15
+ <span class="m-r">导出文件</span>
16
+ <span class="flex-item">{{ fileName }}</span>
17
+ </div>
18
+ <div class="flex-box m-b">
19
+ <span class="m-r">导出进度</span>
20
+ <el-progress
21
+ class="flex-item"
22
+ :percentage="pgsVal"
23
+ :status="pgsStatus"
24
+ style="margin-right: -10px"
25
+ />
26
+ </div>
27
+ <span slot="footer">
28
+ <el-button plain @click="exportCancel">取消</el-button>
29
+ </span>
30
+ </el-dialog>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import downloadBlob from '../../utils/downloadBlob'
36
+ export default {
37
+ name: 'FileExportAsync',
38
+ props: {
39
+ fileName: {
40
+ type: String,
41
+ default: undefined
42
+ },
43
+ stepTime: {
44
+ type: Number,
45
+ default: 1000
46
+ },
47
+ waitTime: {
48
+ type: Number,
49
+ default: 10000
50
+ }
51
+ },
52
+ data() {
53
+ return {
54
+ pgsV: false,
55
+ pgsVal: 0,
56
+ status: undefined, //init progress success error
57
+ timer: undefined,
58
+ elapsedTimeout: 0,
59
+ waitPopV: false
60
+ }
61
+ },
62
+ computed: {
63
+ pgsStatus() {
64
+ if (this.status === 'error') {
65
+ return 'exception'
66
+ } else {
67
+ return undefined
68
+ }
69
+ }
70
+ },
71
+ methods: {
72
+ export() {
73
+ this.pgsVal = 0
74
+ this.status = 'init'
75
+ clearTimeout(this.timer)
76
+ this.elapsedTimeout = 0
77
+ this.waitPopV = false
78
+
79
+ this.pgsV = true
80
+ this.exportReq()
81
+ },
82
+ // 导出请求
83
+ exportReq() {
84
+ this.status = 'progress'
85
+
86
+ this.$emit('export-req', this.exportPgs)
87
+ },
88
+ // 导出进度
89
+ exportPgs() {
90
+ if (this.status !== 'progress') return
91
+
92
+ this.$emit('export-pgs', (pgs, error) => {
93
+ if (error) {
94
+ this.status = 'error'
95
+ console.error('导出失败')
96
+ return
97
+ }
98
+
99
+ if (pgs < 100) {
100
+ this.pgsVal = parseInt(pgs)
101
+ this.status = 'progress'
102
+
103
+ clearTimeout(this.timer)
104
+ this.timer = setTimeout(() => {
105
+ this.elapsedTimeout = this.elapsedTimeout + this.stepTime
106
+ this.exportPgs()
107
+ }, this.stepTime)
108
+ } else {
109
+ this.pgsVal = parseInt(pgs)
110
+ this.status = 'success'
111
+
112
+ this.exportRes()
113
+ }
114
+ this.waitPop()
115
+ })
116
+ },
117
+ // 导出响应
118
+ exportRes() {
119
+ this.$emit('export-res', (data, error) => {
120
+ if (error) {
121
+ this.status = 'error'
122
+ console.error('导出失败')
123
+ return
124
+ }
125
+
126
+ this.status = 'success'
127
+ this.pgsVal = 100
128
+
129
+ downloadBlob(data, this.fileName)
130
+ this.pgsV = false
131
+ })
132
+ },
133
+ // 导出取消
134
+ exportCancel() {
135
+ if (this.status === 'error') {
136
+ this.pgsV = false
137
+ return
138
+ }
139
+
140
+ this.$msgboxPor({
141
+ title: '确定取消',
142
+ message: '取消后,数据导出将中断,是否确定取消导出?',
143
+ type: 'warning',
144
+ customClass: 'question',
145
+ confirmButtonText: '确定',
146
+ cancelButtonText: '取消'
147
+ }).then(() => {
148
+ clearTimeout(this.timer)
149
+ this.pgsV = false
150
+ this.$emit('export-cancel')
151
+ })
152
+ },
153
+ // 时间太长提示
154
+ waitPop() {
155
+ if (!this.waitPopV && this.elapsedTimeout > this.waitTime) {
156
+ this.waitPopV = true
157
+
158
+ this.$msgboxPor({
159
+ title: '提示',
160
+ message: '您的数据导出时间可能会比较长,是否继续导出?',
161
+ type: 'warning',
162
+ customClass: 'question',
163
+ confirmButtonText: '继续导出',
164
+ cancelButtonText: '取消'
165
+ }).catch(() => {
166
+ clearTimeout(this.timer)
167
+ this.pgsV = false
168
+ this.$emit('export-cancel')
169
+ })
170
+ }
171
+ }
172
+ }
173
+ }
174
+ </script>
@@ -357,6 +357,12 @@ export default {
357
357
  if (elPoppers.length <= 1) {
358
358
  this.showPop = false
359
359
  }
360
+ },
361
+ setOptions(key, opts) {
362
+ let item = this.filterList.find((f) => f.value === key)
363
+ if (item) {
364
+ item.options = opts || []
365
+ }
360
366
  }
361
367
  }
362
368
  }