bri-components 1.6.6 → 1.6.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.
@@ -1,251 +1,136 @@
1
1
  <template>
2
2
  <div :class="{
3
3
  uploadList: true,
4
- [`uploadList-${showMode}`]: true
4
+ [`uploadList-${mode}`]: true
5
5
  }">
6
- <!-- 普通文本模式 -->
7
- <template v-if="showMode ==='old'">
8
- <!-- 有值 -->
9
- <div
10
- v-if="files.length"
11
- ref="viewerImage"
12
- :class="[
13
- 'uploadList-list',
14
- `uploadList-list-${subType}`
15
- ]"
6
+ <!-- 有值 -->
7
+ <template v-if="files.length">
8
+ <!-- 框内方式 且 文件类型 -->
9
+ <dsh-dropdown
10
+ v-if="['fileinline'].includes(mode)"
11
+ ref="dshdropdown"
12
+ class="dropdown"
13
+ :list="files"
14
+ trigger="hover"
15
+ @click.native.stop="0"
16
16
  >
17
+ <div :class="{
18
+ 'num': true,
19
+ 'num--edit': canEdit
20
+ }">
21
+ {{ files.length }}个
22
+
23
+ <Icon
24
+ v-if="canEdit"
25
+ type="ios-arrow-down"
26
+ />
27
+ </div>
28
+
17
29
  <div
18
- v-for="(fileItem, fileIndex) in files"
19
- :key="fileItem._key || fileItem._id"
20
- :class="{
21
- 'item': subType !== 'file',
22
- [`item-${subType}`]: true
23
- }"
30
+ slot="dropdownItem"
31
+ slot-scope="{ dropdownItem, dropdownIndex }"
32
+ class="uploadList-fileinline-item"
24
33
  >
25
- <!-- 展示图 -->
26
- <div class="item-show">
27
- <img
28
- v-if="fileItem.mimetype.includes('image')"
29
- :data-original="fileItem.url"
30
- :src="$imageResize(fileItem.url, imageResizeConfig)"
31
- :alt="fileItem.name"
32
- >
33
- <img
34
- v-else
35
- :src="getFileImage(fileItem)"
36
- :alt="fileItem.name"
37
- >
38
- </div>
34
+ <img
35
+ class="item-img"
36
+ :data-original="getImgDataOriginal(dropdownItem)"
37
+ :src="getFileImage(dropdownItem)"
38
+ :alt="dropdownItem.name"
39
+ >
39
40
 
40
- <!-- 展示名称 -->
41
- <p class="item-name">{{ fileItem.name }}</p>
41
+ <p class="item-name">{{ dropdownItem.name }}</p>
42
42
 
43
- <!-- 图标 -->
44
43
  <dsh-icons
45
44
  class="item-action"
46
45
  item-class="item-action-icon"
47
- :list="$getOperationList(getBtns(fileItem))"
48
- @click="$dispatchEvent($event, fileItem, fileIndex)"
46
+ :list="$getOperationList(getBtns(dropdownItem))"
47
+ @click="$dispatchEvent($event, dropdownItem, dropdownIndex)"
49
48
  ></dsh-icons>
50
49
  </div>
51
- </div>
50
+ </dsh-dropdown>
52
51
 
53
- <!-- 无值 -->
54
52
  <div
55
53
  v-else
56
- class="uploadList-old-odata"
57
- >
58
- <span>{{ emptyShowVal }}</span>
59
- </div>
60
- </template>
61
-
62
- <!-- 在表格中展开 -->
63
- <template v-else-if="showMode ==='tableList'">
64
- <!-- 有值 -->
65
- <div
66
- v-if="files.length"
67
54
  ref="viewerImage"
68
- :class="[
69
- 'uploadList-list',
70
- `uploadList-list-${subType}`
71
- ]"
55
+ class="list"
56
+ :style="{
57
+ padding: ['image', 'file'].includes(mode) ? listPadding : undefined
58
+ }"
59
+ @click.stop="0"
72
60
  >
73
61
  <div
74
62
  v-for="(fileItem, fileIndex) in files"
75
63
  :key="fileItem._key || fileItem._id"
76
- :class="{
77
- 'item': subType !== 'file',
78
- [`item-${subType}`]: true
79
- }"
64
+ class="item"
80
65
  >
81
- <!-- 展示图 -->
82
- <div class="item-show">
83
- <img
84
- v-if="fileItem.mimetype.includes('image')"
85
- :data-original="fileItem.url"
86
- :src="$imageResize(fileItem.url, imageResizeConfig)"
87
- :alt="fileItem.name"
88
- >
89
- <img
90
- v-else
91
- :src="getFileImage(fileItem)"
92
- :alt="fileItem.name"
93
- >
66
+ <!-- 展示图 / 视频 -->
67
+ <div v-if="fileItem.mimetype.includes('video/mp4') && ['single'].includes(mode)">
68
+ <dsh-video-player :src="fileItem.url"></dsh-video-player>
94
69
  </div>
70
+ <img
71
+ v-else
72
+ class="item-img"
73
+ :data-original="getImgDataOriginal(fileItem)"
74
+ :src="getFileImage(fileItem)"
75
+ :alt="fileItem.name"
76
+ >
95
77
 
96
78
  <!-- 展示名称 -->
97
- <p class="item-name">{{ fileItem.name }}</p>
79
+ <p
80
+ v-if="['image', 'file'].includes(mode)"
81
+ class="item-name"
82
+ >{{ fileItem.name }}</p>
98
83
 
99
84
  <!-- 图标 -->
100
85
  <dsh-icons
101
- class="item-action"
86
+ :class="{
87
+ 'item-action': true,
88
+ 'item-action-top': fileItem.mimetype.includes('video/mp4') && ['single'].includes(mode)
89
+ }"
102
90
  item-class="item-action-icon"
103
91
  :list="$getOperationList(getBtns(fileItem))"
104
92
  @click="$dispatchEvent($event, fileItem, fileIndex)"
105
93
  ></dsh-icons>
106
94
  </div>
107
95
  </div>
108
-
109
- <!-- 无值 -->
110
- <div
111
- v-else
112
- class="uploadList-inline-nodata"
113
- >
114
- <span>{{ emptyShowVal }}</span>
115
- </div>
116
96
  </template>
117
97
 
118
- <!-- 新展示方式 -->
119
- <template v-else>
120
- <!-- 文件类型 -->
121
- <div
122
- v-if="subType === 'file'"
123
- ref="viewerImage"
124
- >
125
- <!-- 有值 -->
126
- <template v-if="files.length">
127
- <dsh-dropdown
128
- :list="files"
129
- trigger="hover"
130
- class="uploadList-inline-dropdown"
131
- >
132
- <div :class="{
133
- 'uploadList-inline-dropdown-fileName': true,
134
- 'uploadList-inline-dropdown-fileName-edit': canEdit
135
- }">
136
- {{ files.length }}个
137
- <Icon
138
- v-if="canEdit"
139
- type="ios-arrow-down"
140
- />
141
- </div>
142
-
143
- <div
144
- slot="dropdownItem"
145
- slot-scope="{ dropdownItem, dropdownIndex }"
146
- class="uploadList-inline-dropdown-item"
147
- >
148
- <img
149
- v-if="dropdownItem.mimetype.includes('image')"
150
- :data-original="dropdownItem.url"
151
- :src="$imageResize(dropdownItem.url, imageResizeConfig)"
152
- :alt="dropdownItem.name"
153
- class="item-img"
154
- >
155
- <img
156
- v-else
157
- :src="getFileImage(dropdownItem)"
158
- :alt="dropdownItem.name"
159
- class="item-img"
160
- >
161
-
162
- <p class="item-name">{{ dropdownItem.name }}</p>
163
-
164
- <dsh-icons
165
- class="item-action"
166
- item-class="item-action-icon"
167
- :list="$getOperationList(getBtns(dropdownItem))"
168
- @click="$dispatchEvent($event, dropdownItem, dropdownIndex)"
169
- ></dsh-icons>
170
- </div>
171
- </dsh-dropdown>
172
- </template>
173
-
174
- <!-- 无值 -->
175
- <span
176
- v-else
177
- class="uploadList-inline-nodata"
178
- >
179
- {{ emptyShowVal }}
180
- </span>
181
- </div>
182
-
183
- <!-- 图片类型 -->
184
- <template v-else>
185
- <!-- 有值 -->
186
- <div
187
- v-if="files.length"
188
- ref="viewerImage"
189
- class="uploadList-inline-list"
190
- >
191
- <div
192
- v-for="(fileItem, fileIndex) in files"
193
- :key="fileItem.url"
194
- class="item"
195
- >
196
- <img
197
- v-if="fileItem.mimetype.includes('image')"
198
- :data-original="fileItem.url"
199
- :src="$imageResize(fileItem.url, imageResizeConfig)"
200
- :alt="fileItem.name"
201
- >
202
- <img
203
- v-else
204
- :src="getFileImage(fileItem)"
205
- :alt="fileItem.name"
206
- >
207
-
208
- <dsh-icons
209
- class="item-action"
210
- item-class="item-action-icon"
211
- :list="$getOperationList(getBtns(fileItem))"
212
- @click="$dispatchEvent($event, fileItem, fileIndex)"
213
- ></dsh-icons>
214
- </div>
215
- </div>
216
-
217
- <!-- 无值 -->
218
- <span
219
- v-else
220
- class="uploadList-inline-nodata"
221
- >
222
- {{ emptyShowVal }}
223
- </span>
224
- </template>
225
- </template>
98
+ <!-- 无值 -->
99
+ <div
100
+ v-else
101
+ :class="{
102
+ 'uploadList-nodata': !mode.includes('inline'),
103
+ 'uploadList-nodata-inline': mode.includes('inline')
104
+ }"
105
+ >
106
+ <span>{{ emptyShowVal }}</span>
107
+ </div>
226
108
  </div>
227
109
  </template>
228
110
 
229
111
  <script>
230
112
  import Viewer from "viewerjs";
231
113
  import axios from "axios";
232
- // import DshVideoPlayer from "../../../other/DshVideoPlayer.vue";
114
+ import DshVideoPlayer from "../../../other/DshVideoPlayer.vue";
233
115
 
234
116
  export default {
235
117
  name: "uploadList",
236
118
  mixins: [],
237
119
  components: {
238
- // DshVideoPlayer
120
+ DshVideoPlayer
239
121
  },
240
122
  props: {
123
+ mode: {
124
+ type: String,
125
+ default: "file",
126
+ validator (val) {
127
+ return ["single", "image", "file", "imageinline", "fileinline"].includes(val);
128
+ }
129
+ },
241
130
  canEdit: {
242
131
  type: Boolean,
243
132
  default: true
244
133
  },
245
- showMode: {
246
- type: String,
247
- default: "old" // old, tableList, inline
248
- },
249
134
  files: {
250
135
  type: Array,
251
136
  default () {
@@ -258,19 +143,23 @@
258
143
  return {};
259
144
  }
260
145
  },
146
+ listPadding: String,
261
147
  isShowEditIcon: Boolean,
262
148
  emptyShowVal: String
263
149
  },
264
150
  data () {
265
151
  return {
266
- imageResizeConfig: {}
152
+ canPreviewMimeTypes: [
153
+ "image", "video/mp4",
154
+ "application/pdf", "wordprocessingml.document", "spreadsheetml.sheet", // excel
155
+ "text/plain", "application/json", "application/octet-stream", // 日志.log
156
+ // "text/csv", // 好像是便签,如果预览会直接下载
157
+ // "application/zip",
158
+ "application/msword", "application/vnd.ms-powerpoint", "presentationml.presentation"
159
+ ]
267
160
  };
268
161
  },
269
162
  computed: {
270
- subType () {
271
- return this.propsObj._fileType;
272
- },
273
-
274
163
  allOperationMap () {
275
164
  return {
276
165
  canDelete: {
@@ -278,11 +167,14 @@
278
167
  type: "canDelete",
279
168
  customIcon: "bico-shanchu",
280
169
  size: "14",
170
+ style: {
171
+ color: "#ed4014"
172
+ },
281
173
  event: "clickDeleteItem"
282
174
  },
283
- canEdit: {
175
+ canUpdateName: {
284
176
  name: "编辑",
285
- type: "canEdit",
177
+ type: "canUpdateName",
286
178
  customIcon: "bico-bianji",
287
179
  size: "14",
288
180
  event: "clickEdit"
@@ -308,7 +200,7 @@
308
200
  // comp_web图标前缀与其他不同,需特殊处理
309
201
  if (this.propsObj._pageType === "comp") {
310
202
  operations.canDelete.customIcon = "bri-shanchu";
311
- operations.canEdit.customIcon = "bri-bianji";
203
+ operations.canUpdateName.customIcon = "bri-bianji";
312
204
  operations.canDownload.customIcon = "bri-xiazai";
313
205
  operations.canPreview.customIcon = "bri-keshi";
314
206
  }
@@ -317,12 +209,12 @@
317
209
  ? this.$categoryMapToMap(
318
210
  operations,
319
211
  undefined,
320
- this.isShowEditIcon ? [] : ["canEdit"]
212
+ this.isShowEditIcon ? [] : ["canUpdateName"]
321
213
  )
322
214
  : this.$categoryMapToMap(
323
215
  operations,
324
216
  undefined,
325
- ["canDelete", "canEdit"]
217
+ ["canDelete", "canUpdateName"]
326
218
  );
327
219
  }
328
220
  },
@@ -334,7 +226,7 @@
334
226
  // 点击文件预览 -file服务器的数据列表
335
227
  clickPreview (operationItem, fileItem, fileIndex) {
336
228
  if (fileItem.mimetype.includes("image")) {
337
- const viewerImage = this.$refs.viewerImage;
229
+ const viewerImage = this.$refs.viewerImage || this.$refs.dshdropdown.$refs.listPanelDom;
338
230
  const findIndex = this.files
339
231
  .filter(valItem => valItem.mimetype.includes("image"))
340
232
  .findIndex(valItem => valItem.url === fileItem.url);
@@ -349,7 +241,8 @@
349
241
  zIndex: 2147483647
350
242
  });
351
243
  viewer.show();
352
- } else {
244
+ }
245
+ else {
353
246
  window.open(fileItem.url);
354
247
  }
355
248
  },
@@ -415,250 +308,226 @@
415
308
  });
416
309
  },
417
310
 
311
+ /* 加工方法 */
418
312
  // 获取不同类型文件的图片
419
313
  getFileImage (fileItem) {
420
- if (!fileItem.mimetype) {
421
- return this.$imageSrcMap.fileType.other;
422
- } else if (fileItem.mimetype.includes("image")) {
423
- return fileItem.url; // 压缩图片:将图片最长的边限制在100像素,短边按比例处理
424
- } else if (fileItem.mimetype.includes("text/plain")) {
425
- return this.$imageSrcMap.fileType.text;
426
- } else if (fileItem.mimetype.includes("application/pdf")) {
427
- return this.$imageSrcMap.fileType.pdf;
428
- } else if (fileItem.mimetype.includes("wordprocessingml.document") || fileItem.mimetype.includes("application/msword")) {
429
- return this.$imageSrcMap.fileType.doc;
430
- } else if (fileItem.mimetype.includes("presentationml.presentation") || fileItem.mimetype.includes("application/vnd.ms-powerpoint")) {
431
- return this.$imageSrcMap.fileType.ppt;
432
- } else if (fileItem.mimetype.includes("spreadsheetml.sheet")) {
433
- return this.$imageSrcMap.fileType.excel;
434
- } else if (fileItem.mimetype.includes("application/x-zip-compressed")) {
435
- return this.$imageSrcMap.fileType.zip;
436
- } else if (fileItem.mimetype.includes("application/x-rar-compressed")) {
437
- return this.$imageSrcMap.fileType.rar;
314
+ const arrList = [
315
+ ["image", fileItem.url], // 压缩图片:将图片最长的边限制在100像素,短边按比例处理
316
+ ["text/plain", "text"],
317
+ ["application/pdf", "pdf"],
318
+ ["wordprocessingml.document", "doc"],
319
+ ["application/msword", "doc"],
320
+ ["presentationml.presentation", "ppt"],
321
+ ["application/vnd.ms-powerpoint", "ppt"],
322
+ ["spreadsheetml.sheet", "excel"],
323
+ ["application/x-zip-compressed", "zip"],
324
+ ["application/x-rar-compressed", "rar"]
325
+ ];
326
+ if (fileItem.mimetype) {
327
+ const arrItem = arrList.find(arrItem => fileItem.mimetype.includes(arrItem[0])) || ["other", "other"];
328
+ return arrItem[0] === "image"
329
+ ? fileItem.url
330
+ : this.$imageSrcMap.fileType[arrItem[1]];
438
331
  } else {
439
332
  return this.$imageSrcMap.fileType.other;
440
333
  }
441
334
  },
335
+ getImgDataOriginal (fileItem) {
336
+ return fileItem.mimetype.includes("image")
337
+ ? fileItem.url
338
+ : undefined;
339
+ },
442
340
  getBtns (fileItem) {
443
- return [
444
- "image", "video/mp4",
445
- "text/plain",
446
- // "text/csv", // 好像是便签,如果预览会直接下载
447
- "application/pdf", "wordprocessingml.document", "spreadsheetml.sheet", // excel
448
- "application/octet-stream", // 日志 .log
449
- // "application/zip",
450
- "application/msword",
451
- "application/vnd.ms-powerpoint",
452
- "presentationml.presentation"
453
- ].some(type => fileItem.mimetype.includes(type))
454
- ? undefined
455
- : ["canDelete", "canEdit", "canDownload"];
341
+ return ["single"].includes(this.mode)
342
+ ? ["canDelete", "canDownload", "canPreview"]
343
+ : this.canPreviewMimeTypes.some(type => fileItem.mimetype.includes(type))
344
+ ? ["canDelete", "canUpdateName", "canDownload", "canPreview"]
345
+ : ["canDelete", "canUpdateName", "canDownload"];
456
346
  }
457
347
  }
458
348
  };
459
349
  </script>
460
350
 
461
351
  <style lang="less" scoped>
352
+ @keyframes toTop {
353
+ from {
354
+ top: 100%;
355
+ }
356
+
357
+ to {
358
+ top: 0;
359
+ }
360
+ }
361
+
462
362
  .uploadList {
463
363
  width: 100%;
464
- overflow: auto;
364
+ height: 100%;
465
365
 
466
- &-list {
467
- display: flex;
468
- flex-wrap: nowrap;
469
-
470
- .item {
471
- flex: 0 0 120px;
472
- height: 120px;
473
- margin-right: 10px;
474
- border-radius: @borderRadius;
475
- background: #f4f5fa;
476
- text-align: center;
366
+ // 单个
367
+ &-single {
368
+ .list {
369
+ width: 100%;
370
+ height: 100%;
477
371
  overflow: hidden;
478
- display: inline-flex;
479
- flex-direction: column;
480
- justify-content: space-between;
481
- position: relative;
482
372
 
483
- &-show {
484
- display: flex;
485
- overflow: hidden;
486
- align-items: center;
487
- justify-content: center;
488
- flex: 2;
489
- min-height: 50px;
373
+ .item {
374
+ width: 100%;
375
+ height: 100%;
376
+ position: relative;
490
377
 
491
- img {
492
- max-width: 100%;
493
- max-height: 100%;
378
+ &-img {
379
+ width: 100%;
494
380
  }
495
- }
496
381
 
497
- &-name {
498
- padding: 0 8px;
499
- overflow: hidden;
500
- text-overflow: ellipsis;
501
- white-space: nowrap;
502
- color: @themeColor;
503
- }
504
-
505
- &-action {
506
- position: absolute;
507
- right: 0px;
508
- top: 0px;
509
- left: 0px;
510
- bottom: 0px;
511
- background-color: @placeholderColor;
512
- display: none !important;
513
- align-items: center;
514
- justify-content: center;
382
+ &-action {
383
+ display: none;
384
+ position: absolute;
385
+ top: 0px;
386
+ bottom: 0px;
387
+ left: 0px;
388
+ right: 0px;
389
+ background-color: @placeholderColor;
515
390
 
516
- &-icon {
517
- width: 22px;
518
- height: 22px;
519
- line-height: 22px;
520
- color: #fff;
391
+ &-top {
392
+ bottom: calc(100% - 50px);
393
+ }
521
394
  }
522
- }
523
395
 
524
- &:hover {
525
- .item-action {
526
- display: flex !important;
396
+ &:hover {
397
+ .item-action {
398
+ display: flex;
399
+ justify-content: center;
400
+ align-items: center;
401
+
402
+ &-top {
403
+ justify-content: flex-end;
404
+ }
405
+ }
527
406
  }
528
407
  }
529
408
  }
409
+ }
530
410
 
531
- // file 模式
532
- &-file {
533
- flex-direction: column;
411
+ // 图片类型时
412
+ &-image {
413
+ .list {
414
+ width: 100%;
415
+ height: 100%;
416
+ overflow: auto;
417
+ display: flex;
418
+ flex-wrap: wrap;
419
+ align-content: flex-start;
534
420
 
535
- .item-file {
536
- flex: 0 0 100%;
537
- height: auto;
538
- display: flex;
539
- flex-direction: row;
421
+ .item {
422
+ flex: 0 0 120px;
423
+ height: 120px;
424
+ margin-right: 10px;
425
+ border-radius: @borderRadius;
426
+ background: #f4f5fa;
427
+ text-align: center;
428
+ overflow: hidden;
429
+ display: inline-flex;
430
+ flex-direction: column;
540
431
  justify-content: space-between;
541
- align-items: center;
542
- border-radius: 0px;
543
- margin: 0px;
544
- padding: 2px 0;
545
- background: transparent;
546
-
547
- .item {
548
- &-show {
549
- flex: 0 0 22px;
550
- min-height: 20px;
551
- img {
552
- width: 22px;
553
- height: 22px;
554
- }
555
- }
432
+ position: relative;
556
433
 
557
- &-name {
558
- flex: 1;
559
- text-align: left;
560
- color: @textColor;
561
- }
434
+ &-img {
435
+ flex: 1;
436
+ min-height: 50px;
437
+ }
562
438
 
563
- &-action {
564
- position: static;
565
- display: flex !important;
566
- background: transparent;
567
- white-space: nowrap;
439
+ &-name {
440
+ padding: 2px 8px;
441
+ color: @themeColor;
442
+ white-space: nowrap;
443
+ text-overflow: ellipsis;
444
+ overflow: hidden;
445
+ }
568
446
 
569
- &-icon {
570
- color: @contentColor;
571
- width: 16px;
572
- }
573
- }
447
+ &-action {
448
+ display: none;
449
+ position: absolute;
450
+ right: 0px;
451
+ top: 0px;
452
+ left: 0px;
453
+ bottom: 0px;
454
+ background-color: @placeholderColor;
574
455
  }
575
456
 
576
457
  &:hover {
577
- background: #f4f5fa;
458
+ .item-action {
459
+ display: flex;
460
+ justify-content: center;
461
+ align-items: center;
462
+ }
578
463
  }
579
464
  }
580
465
  }
581
466
  }
582
467
 
583
- // 普通文件
584
- &-old {
585
- margin: 16px;
586
-
587
- &-nodata {
468
+ // 其它子类型时
469
+ &-file {
470
+ .list {
588
471
  width: 100%;
589
472
  height: 100%;
590
- text-align: center;
591
- line-height: 120px;
592
- color: @placeholderColor;
593
- white-space: nowrap;
594
-
595
- span {
596
- margin-left: 5px;
597
- }
598
- }
599
- }
600
-
601
- &-inline {
602
- height: 32px;
603
- line-height: 32px;
604
-
605
- &-dropdown {
606
- width: 100%;
607
-
608
- &-fileName {
609
- cursor: pointer;
473
+ overflow: auto;
610
474
 
611
- &-edit {
612
- padding: 0 8px;
613
- display: flex;
614
- justify-content: space-between;
615
- align-items: center;
616
- }
617
- }
618
-
619
- &-item {
620
- width: 100%;
475
+ .item {
476
+ flex: 0 0 100%;
477
+ height: auto;
478
+ margin: 0px;
479
+ padding: 4px 8px;
480
+ border-radius: 0px;
481
+ background: transparent;
621
482
  display: flex;
483
+ flex-direction: row;
622
484
  justify-content: space-between;
623
485
  align-items: center;
624
486
 
625
- .item {
626
- &-img {
627
- width: 22px;
628
- height: 22px;
629
- }
487
+ &-img {
488
+ width: 22px;
489
+ height: 22px;
490
+ }
630
491
 
631
- &-name {
632
- white-space: nowrap;
633
- overflow: hidden;
634
- text-overflow: ellipsis;
635
- margin: 0 8px;
636
- flex: 1;
637
- text-align: left;
638
- }
492
+ &-name {
493
+ flex: 1;
494
+ min-width: 80px;
495
+ padding: 2px 8px;
496
+ text-align: left;
497
+ color: @textColor;
498
+ white-space: normal;
499
+ word-wrap: break-word; /* 或 overflow-wrap: break-word; */
500
+ word-break: break-all; /* 这会在任何字符边界处断行 */
501
+ overflow: hidden;
502
+ }
639
503
 
640
- &-action {
641
- display: flex;
642
- align-items: center;
643
- justify-content: flex-end;
504
+ &-action {
505
+ background: transparent;
506
+ white-space: nowrap;
507
+ position: static;
508
+ display: flex !important;
509
+ }
644
510
 
645
- &-icon {
646
- width: 16px;
647
- color: @contentColor;
648
- }
649
- }
511
+ &:hover {
512
+ background: #f4f5fa;
650
513
  }
651
514
  }
652
515
  }
516
+ }
653
517
 
654
- &-list {
518
+ &-imageinline {
519
+ width: 100%;
520
+ height: 32px;
521
+ line-height: 32px;
522
+
523
+ .list {
655
524
  width: 100%;
656
525
  height: 100%;
657
526
  padding-left: 3px;
658
- display: flex;
659
- flex-wrap: nowrap;
660
527
  overflow-x: auto;
661
528
  overflow-y: hidden;
529
+ display: flex;
530
+ flex-wrap: nowrap;
662
531
 
663
532
  .item {
664
533
  flex: 0 0 32px;
@@ -668,53 +537,65 @@
668
537
  text-align: center;
669
538
  position: relative;
670
539
 
671
- img {
540
+ &-img {
672
541
  max-width: 100%;
673
542
  max-height: 100%;
674
543
  margin: auto;
675
544
  }
676
545
 
677
546
  &-action {
547
+ display: none !important;
678
548
  position: absolute;
679
549
  left: 0;
680
550
  right: 0;
681
551
  top: 0;
682
552
  bottom: 0;
683
- display: none !important;
684
553
  background-color: @placeholderColor;
685
554
  color: #fff;
686
- align-items: center;
687
- justify-content: center;
688
- flex-wrap: wrap;
689
-
690
- &-icon {
691
- width: 16px;
692
- height: 16px;
693
- font-size: 16px !important;
694
- margin: 0px;
695
- }
696
- }
697
-
698
- @keyframes toTop {
699
- from {
700
- top: 100%;
701
- }
702
-
703
- to {
704
- top: 0;
705
- }
706
555
  }
707
556
 
708
557
  &:hover {
709
558
  .item-action {
710
559
  display: flex !important;
560
+ align-items: center;
561
+ justify-content: center;
562
+ flex-wrap: wrap;
711
563
  animation: toTop 0.1s;
712
564
  }
713
565
  }
714
566
  }
715
567
  }
568
+ }
569
+
570
+ &-fileinline {
571
+ height: 32px;
572
+ line-height: 32px;
716
573
 
717
- &-nodata {
574
+ .dropdown {
575
+ width: 100%;
576
+
577
+ .num {
578
+ padding: 0 8px;
579
+ cursor: pointer;
580
+
581
+ &--edit {
582
+ display: flex;
583
+ justify-content: space-between;
584
+ align-items: center;
585
+ }
586
+ }
587
+ }
588
+ }
589
+
590
+ &-nodata {
591
+ width: 100%;
592
+ height: 100%;
593
+ text-align: center;
594
+ line-height: 120px;
595
+ color: @placeholderColor;
596
+ white-space: nowrap;
597
+
598
+ &-inline {
718
599
  padding-left: 7px;
719
600
  line-height: 32px;
720
601
  color: @placeholderColor;
@@ -722,3 +603,97 @@
722
603
  }
723
604
  }
724
605
  </style>
606
+ <style lang="less">
607
+ .uploadList {
608
+ &-single {
609
+ .item {
610
+ &-action {
611
+ &-icon {
612
+ width: 40px;
613
+ height: 40px;
614
+ line-height: 40px;
615
+ font-size: 24px !important;
616
+ color: #fff;
617
+ }
618
+ }
619
+ }
620
+ }
621
+
622
+ &-image {
623
+ .item {
624
+ &-action {
625
+ &-icon {
626
+ width: 22px;
627
+ height: 22px;
628
+ line-height: 22px;
629
+ font-size: 18px !important;
630
+ color: #fff;
631
+ }
632
+ }
633
+ }
634
+ }
635
+
636
+ &-file {
637
+ .item {
638
+ &-action {
639
+ &-icon {
640
+ width: 16px;
641
+ height: 16px;
642
+ // line-height: 16px;
643
+ // font-size: 16px !important;
644
+ color: @themeColor;
645
+ }
646
+ }
647
+ }
648
+ }
649
+
650
+ &-imageinline {
651
+ .item {
652
+ &-action {
653
+ &-icon {
654
+ width: 16px;
655
+ height: 16px;
656
+ margin: 0px;
657
+ line-height: 16px;
658
+ font-size: 14px !important;
659
+ }
660
+ }
661
+ }
662
+ }
663
+
664
+ &-fileinline-item {
665
+ width: 100%;
666
+ display: flex;
667
+ justify-content: space-between;
668
+ align-items: center;
669
+
670
+ .item {
671
+ &-img {
672
+ width: 22px;
673
+ height: 22px;
674
+ }
675
+
676
+ &-name {
677
+ flex: 1;
678
+ margin: 0 8px;
679
+ text-align: left;
680
+ white-space: normal;
681
+ word-wrap: break-word; /* 或 overflow-wrap: break-word; */
682
+ word-break: break-all; /* 这会在任何字符边界处断行 */
683
+ overflow: hidden;
684
+ }
685
+
686
+ &-action {
687
+ display: flex;
688
+ align-items: center;
689
+ justify-content: flex-end;
690
+
691
+ &-icon {
692
+ width: 16px;
693
+ color: @themeColor;
694
+ }
695
+ }
696
+ }
697
+ }
698
+ }
699
+ </style>