cloud-web-corejs 1.0.241 → 1.0.243

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/utils/vab.js +158 -174
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.241",
4
+ "version": "1.0.243",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
package/src/utils/vab.js CHANGED
@@ -1,10 +1,6 @@
1
1
  /**version-1.0*/
2
2
  let install = {};
3
3
 
4
- function reqImg(a) {
5
- return require("@/resources/images/" + a);
6
- }
7
-
8
4
  import request from "./request";
9
5
  import * as lodash from "lodash";
10
6
  import { Loading, Message, MessageBox, Notification, Form } from "element-ui";
@@ -30,6 +26,156 @@ let imFun = {
30
26
  prefixConfig,
31
27
  };
32
28
 
29
+ function reqImg(a) {
30
+ return require("@/resources/images/" + a);
31
+ }
32
+
33
+ const FILE_ICON_NAME_MAP = {
34
+ word: "ico-wrod.svg",
35
+ excel: "ico-excel.svg",
36
+ ppt: "ico-ppt.svg",
37
+ pdf: "ico-pdf.svg",
38
+ picture: "ico-photo.svg",
39
+ video: "ico-video.svg",
40
+ audio: "ico-music.svg",
41
+ html: "ico-html.svg",
42
+ txt: "ico-txt.svg",
43
+ java: "ico-java.svg",
44
+ vue: "ico-vue.svg",
45
+ ftl: "ico-ftl.svg",
46
+ xml: "ico-xml.svg",
47
+ flash: "ico-flash.svg",
48
+ zip: "ico-yasuobao.svg",
49
+ exe: "ico-ext.svg",
50
+ psd: "ico-psd.svg",
51
+ folder: "ico-wenjianjia.svg",
52
+ other: "ico-default_wenjian.svg",
53
+ };
54
+
55
+ const FILE_ICON_TYPE_MAP = {
56
+ doc: "word",
57
+ docx: "word",
58
+ xls: "excel",
59
+ xlsx: "excel",
60
+ ppt: "ppt",
61
+ pptx: "ppt",
62
+ pdf: "pdf",
63
+ jpg: "picture",
64
+ jpeg: "picture",
65
+ png: "picture",
66
+ gif: "picture",
67
+ mp3: "video",
68
+ mp4: "video",
69
+ mpg: "video",
70
+ mkv: "video",
71
+ rmvb: "video",
72
+ avi: "video",
73
+ mov: "video",
74
+ wav: "audio",
75
+ html: "html",
76
+ htm: "html",
77
+ txt: "txt",
78
+ java: "java",
79
+ vue: "vue",
80
+ ftl: "ftl",
81
+ xml: "xml",
82
+ swf: "flash",
83
+ zip: "zip",
84
+ rar: "zip",
85
+ "7z": "zip",
86
+ // exe: 'exe',
87
+ psd: "psd",
88
+ };
89
+
90
+ let typeList = [
91
+ "doc",
92
+ "docx",
93
+ "xls",
94
+ "xlsx",
95
+ "ppt",
96
+ "pptx",
97
+ "csv",
98
+ "wps",
99
+ "dps",
100
+ "et",
101
+ "ett",
102
+ "wpt",
103
+ "vsd",
104
+ "vsdx",
105
+ "wmf",
106
+ "emf",
107
+ "psd",
108
+ "eps",
109
+ "pdf",
110
+ "xmind",
111
+ "obj",
112
+ "3ds",
113
+ "stl",
114
+ "ply",
115
+ "gltf",
116
+ "glb",
117
+ "off",
118
+ "3dm",
119
+ "fbx",
120
+ "dae",
121
+ "wrl",
122
+ "3mf",
123
+ "ifc",
124
+ "brep",
125
+ "step",
126
+ "iges",
127
+ "fcstd",
128
+ "bim",
129
+ "dwg",
130
+ "dxf",
131
+ "dwf",
132
+ "iges",
133
+ "igs",
134
+ "dwt",
135
+ "dng",
136
+ "ifc",
137
+ "dwfx",
138
+ "stl",
139
+ "cf2",
140
+ "plt",
141
+ "txt",
142
+ "xml",
143
+ "md",
144
+ "java",
145
+ "php",
146
+ "py",
147
+ "js",
148
+ "css",
149
+ "zip",
150
+ "rar",
151
+ "jar",
152
+ "tar",
153
+ "gzip",
154
+ "7z",
155
+ "mp3",
156
+ "wav",
157
+ "mp4",
158
+ "flv",
159
+ "avi",
160
+ "rm",
161
+ "mkv",
162
+ "mpeg",
163
+ "mpg",
164
+ "rmvb",
165
+ "wmv",
166
+ "3gp",
167
+ "swf",
168
+ "drawio",
169
+ "tif",
170
+ "tiff",
171
+ "jfif",
172
+ "webp",
173
+ "tga",
174
+ "svg",
175
+ "vue",
176
+ "ftl",
177
+ ];
178
+
33
179
  const accessToken = imFun.store.getters["user/token"];
34
180
 
35
181
  const loadingText = "";
@@ -245,93 +391,6 @@ install = (Vue, opts = {}) => {
245
391
  /* 全局事件总线 */
246
392
  Vue.prototype.$baseEventBus = new Vue();
247
393
 
248
- let typeList = [
249
- "doc",
250
- "docx",
251
- "xls",
252
- "xlsx",
253
- "ppt",
254
- "pptx",
255
- "csv",
256
- "wps",
257
- "dps",
258
- "et",
259
- "ett",
260
- "wpt",
261
- "vsd",
262
- "vsdx",
263
- "wmf",
264
- "emf",
265
- "psd",
266
- "eps",
267
- "pdf",
268
- "xmind",
269
- "obj",
270
- "3ds",
271
- "stl",
272
- "ply",
273
- "gltf",
274
- "glb",
275
- "off",
276
- "3dm",
277
- "fbx",
278
- "dae",
279
- "wrl",
280
- "3mf",
281
- "ifc",
282
- "brep",
283
- "step",
284
- "iges",
285
- "fcstd",
286
- "bim",
287
- "dwg",
288
- "dxf",
289
- "dwf",
290
- "iges",
291
- "igs",
292
- "dwt",
293
- "dng",
294
- "ifc",
295
- "dwfx",
296
- "stl",
297
- "cf2",
298
- "plt",
299
- "txt",
300
- "xml",
301
- "md",
302
- "java",
303
- "php",
304
- "py",
305
- "js",
306
- "css",
307
- "zip",
308
- "rar",
309
- "jar",
310
- "tar",
311
- "gzip",
312
- "7z",
313
- "mp3",
314
- "wav",
315
- "mp4",
316
- "flv",
317
- "avi",
318
- "rm",
319
- "mkv",
320
- "mpeg",
321
- "mpg",
322
- "rmvb",
323
- "wmv",
324
- "3gp",
325
- "swf",
326
- "drawio",
327
- "tif",
328
- "tiff",
329
- "jfif",
330
- "webp",
331
- "tga",
332
- "svg",
333
- "vue",
334
- ];
335
394
  Vue.prototype.$commonFileUtil = {
336
395
  // 文件类型获取与判断接口
337
396
  getFileSuffix: function (name) {
@@ -537,102 +596,27 @@ install = (Vue, opts = {}) => {
537
596
  return this.getFileIconRequire(filename);
538
597
  }
539
598
  },
540
- getFileIconRequire: function (name, showType) {
541
- let iconType = this.getDiyFileIconType(name);
542
- if (!iconType) {
543
- iconType = "other";
544
- }
545
- let fileIconNameMap = {
546
- word: "ico-wrod.svg",
547
- excel: "ico-excel.svg",
548
- ppt: "ico-ppt.svg",
549
- pdf: "ico-pdf.svg",
550
- picture: "ico-photo.svg",
551
- video: "ico-video.svg",
552
- audio: "ico-music.svg",
553
- html: "ico-html.svg",
554
- txt: "ico-txt.svg",
555
- flash: "ico-flash.svg",
556
- zip: "ico-yasuobao.svg",
557
- exe: "ico-ext.svg",
558
- psd: "ico-psd.svg",
559
- folder: "ico-wenjianjia.svg",
560
- other: "ico-default_wenjian.svg",
561
- };
599
+ resolveFileIconName: function (name, showType) {
600
+ let iconType = this.getDiyFileIconType(name) || "other";
562
601
  if (showType) {
563
602
  iconType = showType;
564
603
  }
565
- let fileIcenName = fileIconNameMap[iconType];
566
- return reqImg(fileIcenName);
604
+ return FILE_ICON_NAME_MAP[iconType];
605
+ },
606
+ getFileIconRequire: function (name, showType) {
607
+ return reqImg(this.resolveFileIconName(name, showType));
567
608
  },
568
609
  getFileIconPath: function (name, showType) {
569
- let iconType = this.getDiyFileIconType(name);
570
- if (!iconType) {
571
- iconType = "other";
572
- }
573
- let fileIconNameMap = {
574
- word: "ico-wrod.svg",
575
- excel: "ico-excel.svg",
576
- ppt: "ico-ppt.svg",
577
- pdf: "ico-pdf.svg",
578
- picture: "ico-photo.svg",
579
- video: "ico-video.svg",
580
- audio: "ico-music.svg",
581
- html: "ico-html.svg",
582
- txt: "ico-txt.svg",
583
- flash: "ico-flash.svg",
584
- zip: "ico-yasuobao.svg",
585
- exe: "ico-ext.svg",
586
- psd: "ico-psd.svg",
587
- folder: "ico-wenjianjia.svg",
588
- other: "ico-default_wenjian.svg",
589
- };
590
- if (showType) {
591
- iconType = showType;
592
- }
593
- let fileIcenName = fileIconNameMap[iconType];
594
- let path = "/resources/images/" + fileIcenName;
595
- return path;
610
+ return "/resources/images/" + this.resolveFileIconName(name, showType);
596
611
  },
597
612
  getDiyFileIconType: function (name) {
598
- let fileIconTypeMap = {
599
- doc: "word",
600
- docx: "word",
601
- xls: "excel",
602
- xlsx: "excel",
603
- ppt: "ppt",
604
- pptx: "ppt",
605
- pdf: "pdf",
606
- jpg: "picture",
607
- jpeg: "picture",
608
- png: "picture",
609
- gif: "picture",
610
- mp3: "video",
611
- mp4: "video",
612
- mpg: "video",
613
- mkv: "video",
614
- rmvb: "video",
615
- avi: "video",
616
- mov: "video",
617
- wav: "audio",
618
- html: "html",
619
- htm: "html",
620
- txt: "txt",
621
- swf: "flash",
622
- zip: "zip",
623
- rar: "zip",
624
- "7z": "zip",
625
- // exe: 'exe',
626
- psd: "psd",
627
- };
628
-
629
613
  let suffix = this.getFileSuffix(name);
630
614
  if (suffix === "") {
631
615
  // 默认是文本类型
632
616
  return "";
633
617
  }
634
618
 
635
- let iconType = fileIconTypeMap[suffix];
619
+ let iconType = FILE_ICON_TYPE_MAP[suffix];
636
620
  if (undefined === iconType) {
637
621
  return "";
638
622
  }