bri-components 1.5.22 → 1.6.0

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 (153) hide show
  1. package/README.md +83 -83
  2. package/lib/styles/bundle.css +12 -12
  3. package/lib/styles/font/fontello.svg +31 -31
  4. package/package.json +125 -125
  5. package/src/components/Error/Error403.vue +42 -42
  6. package/src/components/Error/Error404.vue +40 -40
  7. package/src/components/Error/Error500.vue +51 -51
  8. package/src/components/Error/error.less +162 -162
  9. package/src/components/Error/errorBack.vue +40 -40
  10. package/src/components/controls/DshControlInput.vue +195 -195
  11. package/src/components/controls/base/BriUpload/BriUpload.vue +434 -434
  12. package/src/components/controls/base/BriUpload/BriUploadImage.vue +377 -377
  13. package/src/components/controls/base/BriUpload/uploadList.vue +727 -727
  14. package/src/components/controls/base/BriUpload/uploadMixin.js +446 -446
  15. package/src/components/controls/base/DshCascader/DshCascader.vue +215 -215
  16. package/src/components/controls/base/DshCascader/components/cascaderModal.vue +366 -366
  17. package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +416 -416
  18. package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -141
  19. package/src/components/controls/base/DshCascader/components/cascaderTree.vue +151 -151
  20. package/src/components/controls/base/DshCoordinates.vue +585 -585
  21. package/src/components/controls/base/DshDate/DshDate.vue +191 -191
  22. package/src/components/controls/base/DshDate/DshDaterange.vue +186 -186
  23. package/src/components/controls/base/DshDivider.vue +201 -201
  24. package/src/components/controls/base/DshEditor.vue +274 -274
  25. package/src/components/controls/base/DshInput/BriInputs.vue +166 -166
  26. package/src/components/controls/base/DshInput/DshInput.vue +260 -260
  27. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +435 -435
  28. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -34
  29. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -14
  30. package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -322
  31. package/src/components/controls/base/DshNumber/DshNumber.vue +143 -143
  32. package/src/components/controls/base/DshNumber/DshNumberange.vue +109 -109
  33. package/src/components/controls/base/DshSelect/DshCheckbox.vue +168 -168
  34. package/src/components/controls/base/DshSelect/DshSelect.vue +180 -180
  35. package/src/components/controls/base/DshSelect/DshSelectAll.vue +269 -269
  36. package/src/components/controls/base/DshSwitch/DshSwitch.vue +115 -115
  37. package/src/components/controls/control.less +324 -324
  38. package/src/components/controls/controlMap.js +117 -117
  39. package/src/components/controls/extra/DshColor.vue +81 -81
  40. package/src/components/controls/extra/DshThemeColor.vue +100 -100
  41. package/src/components/controls/extra/DshThemeIcon.vue +122 -122
  42. package/src/components/controls/mixins/cascaderMixin.js +325 -325
  43. package/src/components/controls/mixins/cascaderPickerMixin.js +227 -227
  44. package/src/components/controls/mixins/cascaderTableMixin.js +130 -130
  45. package/src/components/controls/mixins/controlMixin.js +393 -393
  46. package/src/components/controls/mixins/dateMixin.js +149 -149
  47. package/src/components/controls/mixins/flatTableMixin.js +111 -111
  48. package/src/components/controls/mixins/numberMixin.js +112 -112
  49. package/src/components/controls/mixins/selectMixin.js +233 -233
  50. package/src/components/controls/mixins/switchMixin.js +87 -87
  51. package/src/components/controls/mixins/userAndDepartMixin.js +260 -260
  52. package/src/components/controls/senior/DshLabels.vue +333 -333
  53. package/src/components/controls/senior/DshPackage.vue +57 -57
  54. package/src/components/controls/senior/cascaderTable.vue +213 -213
  55. package/src/components/controls/senior/correlation.vue +135 -135
  56. package/src/components/controls/senior/flatTable.vue +138 -138
  57. package/src/components/controls/senior/selectDepartments.vue +399 -399
  58. package/src/components/controls/senior/selectUsers/departMenu.vue +293 -293
  59. package/src/components/controls/senior/selectUsers/selectUsers.vue +712 -712
  60. package/src/components/controls/special/DshBack.vue +42 -42
  61. package/src/components/controls/special/DshUndeveloped.vue +41 -41
  62. package/src/components/form/DshAdvSearch.vue +510 -510
  63. package/src/components/form/DshDefaultSearch.vue +260 -260
  64. package/src/components/form/DshForm.vue +494 -494
  65. package/src/components/form/searchMixin.js +376 -376
  66. package/src/components/list/BriCard.vue +95 -95
  67. package/src/components/list/BriTable.vue +205 -205
  68. package/src/components/list/BriTree.vue +529 -529
  69. package/src/components/list/BriTreeItem.vue +163 -163
  70. package/src/components/list/DshBox/DshBox.vue +219 -219
  71. package/src/components/list/DshBox/DshCard.vue +446 -446
  72. package/src/components/list/DshBox/DshCrossTable.vue +827 -827
  73. package/src/components/list/DshBox/DshList.vue +404 -404
  74. package/src/components/list/DshBox/DshPanel.vue +669 -669
  75. package/src/components/list/DshBox/DshSingleData.vue +119 -119
  76. package/src/components/list/DshBox/DshTable.vue +239 -239
  77. package/src/components/list/DshCascaderTable.vue +115 -115
  78. package/src/components/list/DshFlatTable.vue +337 -337
  79. package/src/components/list/DshPage.vue +194 -194
  80. package/src/components/list/DshTreeTable.vue +113 -113
  81. package/src/components/list/common/importModal.vue +243 -243
  82. package/src/components/list/common/quoteListModal.vue +206 -206
  83. package/src/components/list/mixins/DshCascaderTableMixin.js +278 -278
  84. package/src/components/list/mixins/DshFlatTableMixin.js +509 -509
  85. package/src/components/list/mixins/DshTreeTableMixin.js +286 -286
  86. package/src/components/list/mixins/tableBaseMixin.js +1653 -1653
  87. package/src/components/list/mixins/treeTableBaseMixin.js +145 -145
  88. package/src/components/other/BriAvatar.vue +166 -166
  89. package/src/components/other/BriCode.vue +125 -125
  90. package/src/components/other/BriCollapseTree.vue +207 -207
  91. package/src/components/other/BriGantt.vue +1087 -1087
  92. package/src/components/other/BriIframe.vue +116 -116
  93. package/src/components/other/BriLoading.vue +171 -171
  94. package/src/components/other/BriSvg.vue +27 -27
  95. package/src/components/other/DshColorPanel.vue +128 -128
  96. package/src/components/other/DshMenuNav.vue +188 -188
  97. package/src/components/small/BriButton.vue +71 -71
  98. package/src/components/small/BriDrawer.vue +169 -169
  99. package/src/components/small/BriTooltip.vue +87 -87
  100. package/src/components/small/DshBtnModal.vue +68 -68
  101. package/src/components/small/DshButtons.vue +324 -324
  102. package/src/components/small/DshDropdown.vue +225 -225
  103. package/src/components/small/DshIcons.vue +59 -59
  104. package/src/components/small/DshListRender.js +21 -21
  105. package/src/components/small/DshModal.vue +160 -160
  106. package/src/components/small/DshSteps.vue +141 -141
  107. package/src/components/small/DshTabs.vue +598 -598
  108. package/src/components/small/DshTabsSet.vue +309 -309
  109. package/src/components/small/DshTags.vue +251 -251
  110. package/src/components/small/DshTitle.vue +50 -50
  111. package/src/components/small/render.js +20 -20
  112. package/src/components/unit/DshFormUnit.vue +398 -398
  113. package/src/components/unit/DshListUnit.vue +115 -115
  114. package/src/components/unit/unitMixin.js +86 -86
  115. package/src/data/index.js +4 -4
  116. package/src/index.js +285 -285
  117. package/src/styles/bundle.css +12 -12
  118. package/src/styles/components/BriButton.less +307 -307
  119. package/src/styles/components/BriTable.less +344 -344
  120. package/src/styles/components/DshModal.less +257 -257
  121. package/src/styles/components/index.less +3 -3
  122. package/src/styles/global/animate.less +11 -11
  123. package/src/styles/global/base.less +45 -45
  124. package/src/styles/global/box.less +186 -186
  125. package/src/styles/global/control.less +122 -122
  126. package/src/styles/global/flex.less +282 -282
  127. package/src/styles/global/global.less +8 -8
  128. package/src/styles/global/text.less +59 -59
  129. package/src/styles/global/variables.less +85 -85
  130. package/src/styles/iconfont/iconfont.css +254 -254
  131. package/src/styles/iconfont/iconfont.json +422 -422
  132. package/src/styles/iconfont/iconfont.svg +137 -137
  133. package/src/styles/index.less +26 -26
  134. package/src/styles/reset-easytable.less +21 -21
  135. package/src/styles/reset-iview-controls.less +145 -145
  136. package/src/styles/reset-iview-other.less +49 -49
  137. package/src/styles/reset-iview-variables.less +43 -43
  138. package/src/styles/reset.less +45 -45
  139. package/src/utils/index.js +3 -5
  140. package/lib/0.bri-components.min.js +0 -1
  141. package/lib/1.bri-components.min.js +0 -1
  142. package/lib/10.bri-components.min.js +0 -1
  143. package/lib/11.bri-components.min.js +0 -1
  144. package/lib/2.bri-components.min.js +0 -1
  145. package/lib/3.bri-components.min.js +0 -1
  146. package/lib/4.bri-components.min.js +0 -1
  147. package/lib/5.bri-components.min.js +0 -1
  148. package/lib/6.bri-components.min.js +0 -1
  149. package/lib/7.bri-components.min.js +0 -1
  150. package/lib/8.bri-components.min.js +0 -1
  151. package/lib/9.bri-components.min.js +0 -1
  152. package/lib/bri-components.min.js +0 -18
  153. package/src/utils/table.js +0 -175
@@ -1,727 +1,727 @@
1
- <template>
2
- <div :class="{
3
- uploadList: true,
4
- [`uploadList-${showMode}`]: true,
5
- [`uploadList-${subType}`]: true
6
- }">
7
- <!-- 普通文本模式 -->
8
- <template v-if="showMode ==='old'">
9
- <!-- 有值 -->
10
- <div
11
- v-if="files.length"
12
- ref="viewerImage"
13
- :class="{
14
- 'uploadList-list': true,
15
- [`uploadList-list-${subType}`]: true
16
- }"
17
- >
18
- <div
19
- v-for="(fileItem, fileIndex) in files"
20
- :key="fileItem._key || fileItem._id"
21
- :class="{
22
- 'item': subType === 'image',
23
- [`item-${subType}`]: true
24
- }"
25
- >
26
- <!-- 展示图 -->
27
- <div class="item-show">
28
- <img
29
- v-if="fileItem.mimetype.includes('image')"
30
- :data-original="fileItem.url"
31
- :src="$imageResize(fileItem.url, imageResizeConfig)"
32
- :alt="fileItem.name"
33
- >
34
- <img
35
- v-else
36
- :src="getFileImage(fileItem)"
37
- :alt="fileItem.name"
38
- >
39
- </div>
40
-
41
- <!-- 展示名称 -->
42
- <p class="item-name-title">{{ fileItem.name }}</p>
43
-
44
- <!-- 图标 -->
45
- <dsh-icons
46
- class="item-action"
47
- item-class="item-action-icon"
48
- :list="$getOperationList(getBtns(fileItem))"
49
- @click="$dispatchEvent($event, fileItem, fileIndex)"
50
- ></dsh-icons>
51
- </div>
52
- </div>
53
-
54
- <!-- 无值 -->
55
- <div
56
- v-else
57
- class="uploadList-nodata"
58
- >
59
- <span>{{ emptyShowVal }}</span>
60
- </div>
61
- </template>
62
-
63
- <!-- 在表格中展开 -->
64
- <template v-else-if="showMode ==='tableList'">
65
- <!-- 有值 -->
66
- <div
67
- v-if="files.length"
68
- ref="viewerImage"
69
- :class="[
70
- 'uploadList-list',
71
- `uploadList-list-${subType}`
72
- ]"
73
- >
74
- <div
75
- v-for="(fileItem, fileIndex) in files"
76
- :key="fileItem._key || fileItem._id"
77
- :class="{
78
- 'item': subType === 'image',
79
- [`item-${subType}`]: true
80
- }"
81
- >
82
- <!-- 展示图 -->
83
- <div class="item-show">
84
- <img
85
- v-if="fileItem.mimetype.includes('image')"
86
- :data-original="fileItem.url"
87
- :src="$imageResize(fileItem.url, imageResizeConfig)"
88
- :alt="fileItem.name"
89
- >
90
- <img
91
- v-else
92
- :src="getFileImage(fileItem)"
93
- :alt="fileItem.name"
94
- >
95
- </div>
96
-
97
- <!-- 展示名称 -->
98
- <p class="item-name-title">{{ fileItem.name }}</p>
99
-
100
- <!-- 图标 -->
101
- <dsh-icons
102
- class="item-action"
103
- item-class="item-action-icon"
104
- :list="$getOperationList(getBtns(fileItem))"
105
- @click="$dispatchEvent($event, fileItem, fileIndex)"
106
- ></dsh-icons>
107
- </div>
108
- </div>
109
-
110
- <!-- 无值 -->
111
- <div
112
- v-else
113
- class="uploadList-inline-nodata"
114
- >
115
- <span>{{ emptyShowVal }}</span>
116
- </div>
117
- </template>
118
-
119
- <!-- 新展示方式 -->
120
- <template v-else>
121
- <!-- 文件类型 -->
122
- <div
123
- v-if="subType === 'file'"
124
- ref="viewerImage"
125
- >
126
- <!-- 有值 -->
127
- <template v-if="files.length">
128
- <dsh-dropdown
129
- :list="files"
130
- trigger="hover"
131
- class="uploadList-fileList"
132
- >
133
- <div :class="{
134
- 'uploadList-fileList-fileName': true,
135
- 'uploadList-fileList-fileName-edit': canEdit
136
- }">
137
- {{ files.length }}个
138
- <Icon
139
- v-if="canEdit"
140
- type="ios-arrow-down"
141
- />
142
- </div>
143
-
144
- <div
145
- slot="dropdownItem"
146
- slot-scope="{ dropdownItem, dropdownIndex }"
147
- class="uploadList-fileList-fileItem"
148
- >
149
- <img
150
- v-if="dropdownItem.mimetype.includes('image')"
151
- :data-original="dropdownItem.url"
152
- :src="$imageResize(dropdownItem.url, imageResizeConfig)"
153
- :alt="dropdownItem.name"
154
- class="fileItem-img"
155
- >
156
- <img
157
- v-else
158
- :src="getFileImage(dropdownItem)"
159
- :alt="dropdownItem.name"
160
- class="fileItem-img"
161
- >
162
-
163
- <p class="fileItem-name-title">{{ dropdownItem.name }}</p>
164
-
165
- <dsh-icons
166
- class="fileItem-action"
167
- item-class="fileItem-action-icon"
168
- :list="$getOperationList(getBtns(dropdownItem))"
169
- @click="$dispatchEvent($event, dropdownItem, dropdownIndex)"
170
- ></dsh-icons>
171
- </div>
172
- </dsh-dropdown>
173
-
174
- <div
175
- v-for="(fileItem) in files"
176
- :key="fileItem._key || fileItem._id"
177
- :class="{
178
- 'item': subType === 'image',
179
- [`item-${subType}`]: true
180
- }"
181
- >
182
- <img
183
- v-if="fileItem.mimetype.includes('image')"
184
- :data-original="fileItem.url"
185
- :src="$imageResize(fileItem.url, imageResizeConfig)"
186
- :alt="fileItem.name"
187
- style="display: none;"
188
- >
189
- </div>
190
- </template>
191
-
192
- <!-- 无值 -->
193
- <span
194
- v-else
195
- class="uploadList-inline-nodata"
196
- >
197
- {{ emptyShowVal }}
198
- </span>
199
- </div>
200
-
201
- <!-- 图片类型 -->
202
- <template v-else>
203
- <!-- 有值 -->
204
- <div
205
- v-if="files.length"
206
- ref="viewerImage"
207
- class="uploadList-inline-list"
208
- >
209
- <div
210
- v-for="(fileItem, fileIndex) in files"
211
- :key="fileItem.url"
212
- class="item"
213
- >
214
- <img
215
- v-if="fileItem.mimetype.includes('image')"
216
- :data-original="fileItem.url"
217
- :src="$imageResize(fileItem.url, imageResizeConfig)"
218
- :alt="fileItem.name"
219
- >
220
- <img
221
- v-else
222
- :src="getFileImage(fileItem)"
223
- :alt="fileItem.name"
224
- >
225
-
226
- <dsh-icons
227
- class="item-action"
228
- item-class="item-action-icon"
229
- :list="$getOperationList(getBtns(fileItem))"
230
- @click="$dispatchEvent($event, fileItem, fileIndex)"
231
- ></dsh-icons>
232
- </div>
233
- </div>
234
-
235
- <!-- 无值 -->
236
- <span
237
- v-else
238
- class="uploadList-inline-nodata"
239
- >
240
- {{ emptyShowVal }}
241
- </span>
242
- </template>
243
- </template>
244
- </div>
245
- </template>
246
-
247
- <script>
248
- import Viewer from "viewerjs";
249
- import axios from "axios";
250
-
251
- export default {
252
- name: "uploadList",
253
- props: {
254
- showMode: {
255
- type: String,
256
- default: "old" // inline, old, normal
257
- },
258
- canEdit: {
259
- type: Boolean,
260
- default: true
261
- },
262
- files: {
263
- type: Array,
264
- default () {
265
- return [];
266
- }
267
- },
268
- propsObj: {
269
- type: Object,
270
- default () {
271
- return {};
272
- }
273
- },
274
- isShowEditIcon: Boolean,
275
- emptyShowVal: String
276
- },
277
- data () {
278
- return {
279
- imageResizeConfig: {}
280
- };
281
- },
282
- computed: {
283
- subType () {
284
- return this.propsObj._fileType;
285
- },
286
-
287
- allOperationMap () {
288
- return {
289
- canDelete: {
290
- name: "删除",
291
- type: "canDelete",
292
- customIcon: "bico-shanchu",
293
- size: "14",
294
- event: "clickDeleteItem"
295
- },
296
- canEdit: {
297
- name: "编辑",
298
- type: "canEdit",
299
- customIcon: "bico-bianji",
300
- size: "14",
301
- event: "clickEdit"
302
- },
303
- canDownload: {
304
- name: "下载",
305
- type: "canDownload",
306
- customIcon: "bico-xiazai1",
307
- size: "14",
308
- event: "handleDownload"
309
- },
310
- canPreview: {
311
- name: "预览",
312
- type: "canPreview",
313
- customIcon: "bico-yulan",
314
- size: "16",
315
- event: "clickPreview"
316
- }
317
- };
318
- },
319
- operationMap () {
320
- let operations = { ...this.allOperationMap };
321
- // comp_web图标前缀与其他不同,需特殊处理
322
- if (this.propsObj._pageType === "comp") {
323
- operations.canDelete.customIcon = "bri-shanchu";
324
- operations.canEdit.customIcon = "bri-bianji";
325
- operations.canDownload.customIcon = "bri-xiazai";
326
- operations.canPreview.customIcon = "bri-keshi";
327
- }
328
- return this.canEdit
329
- ? this.$categoryMapToMap(
330
- operations,
331
- undefined,
332
- this.isShowEditIcon ? [] : ["canEdit"]
333
- )
334
- : this.$categoryMapToMap(
335
- operations,
336
- undefined,
337
- ["canDelete", "canEdit"]
338
- );
339
- }
340
- },
341
- methods: {
342
- // 点击删除某项
343
- clickDeleteItem (operationItem, fileItem, fileIndex) {
344
- this.$emit("deleteItem", fileItem, fileIndex);
345
- },
346
- // 点击文件预览 -file服务器的数据列表
347
- clickPreview (operationItem, fileItem, fileIndex) {
348
- if (fileItem.mimetype.includes("image")) {
349
- const viewerImage = this.$refs.viewerImage;
350
- const findIndex = this.files
351
- .filter(valItem => valItem.mimetype.includes("image"))
352
- .findIndex(valItem => valItem.url === fileItem.url);
353
-
354
- const viewer = new Viewer(viewerImage, {
355
- url: "data-original",
356
- hidden: function () {
357
- viewer.destroy();
358
- },
359
- loop: false,
360
- initialViewIndex: findIndex,
361
- zIndex: 2147483647
362
- });
363
- viewer.show();
364
- } else {
365
- window.open(fileItem.url);
366
- }
367
- },
368
- // 点击文件编辑
369
- clickEdit (operationItem, fileItem) {
370
- let fileName = fileItem.name;
371
- const lastIndex = fileName.lastIndexOf(".");
372
- const formate = fileName.substring(lastIndex);
373
- fileName = fileName.substring(0, lastIndex);
374
-
375
- this.$Modal.confirm({
376
- title: "修改名称",
377
- render: (h) => {
378
- // // 第二种方式
379
- // const lastIndex = fileName.lastIndexOf(".");
380
- // const formate = fileName.substring(lastIndex);
381
-
382
- return h("Input", {
383
- props: {
384
- // value: fileItem.name.substring(0, lastIndex),
385
- value: fileName,
386
- autofocus: true,
387
- placeholder: "请输入名称"
388
- },
389
- scopedSlots: {
390
- append: formate
391
- },
392
- on: {
393
- input: (val) => {
394
- // fileItem.name = val + formate;
395
- fileName = val;
396
- }
397
- }
398
- });
399
- },
400
- onOk: () => {
401
- fileItem.name = fileName + formate;
402
- this.$emit("editItemName", fileItem);
403
- },
404
- onCancel: () => {}
405
- });
406
- },
407
- // 接口 -下载
408
- handleDownload (operationItem, fileItem, fileIndex) {
409
- axios
410
- .get(fileItem.downloadUrl, {
411
- responseType: "blob"
412
- })
413
- .then((res) => {
414
- if (window.navigator.msSaveOrOpenBlob) {
415
- // 兼容IE10
416
- navigator.msSaveBlob(res, fileItem.name);
417
- } else {
418
- const href = URL.createObjectURL(res.data); // 创建新的URL表示指定的blob对象
419
- const a = document.createElement("a");
420
- a.style.display = "none";
421
- a.href = href; // 指定下载链接
422
- a.download = fileItem.name; // 指定下载文件名
423
- a.click();
424
- URL.revokeObjectURL(a.href); // 释放URL对象
425
- a.remove();
426
- }
427
- });
428
- },
429
- // 获取不同类型文件的图片
430
- getFileImage (fileItem) {
431
- if (!fileItem.mimetype) {
432
- return this.$imageSrcMap.fileType.other;
433
- } else if (fileItem.mimetype.includes("image")) {
434
- return fileItem.url; // 压缩图片:将图片最长的边限制在100像素,短边按比例处理
435
- } else if (fileItem.mimetype.includes("text/plain")) {
436
- return this.$imageSrcMap.fileType.text;
437
- } else if (fileItem.mimetype.includes("application/pdf")) {
438
- return this.$imageSrcMap.fileType.pdf;
439
- } else if (fileItem.mimetype.includes("wordprocessingml.document") || fileItem.mimetype.includes("application/msword")) {
440
- return this.$imageSrcMap.fileType.doc;
441
- } else if (fileItem.mimetype.includes("presentationml.presentation") || fileItem.mimetype.includes("application/vnd.ms-powerpoint")) {
442
- return this.$imageSrcMap.fileType.ppt;
443
- } else if (fileItem.mimetype.includes("spreadsheetml.sheet")) {
444
- return this.$imageSrcMap.fileType.excel;
445
- } else if (fileItem.mimetype.includes("application/x-zip-compressed")) {
446
- return this.$imageSrcMap.fileType.zip;
447
- } else if (fileItem.mimetype.includes("application/x-rar-compressed")) {
448
- return this.$imageSrcMap.fileType.rar;
449
- } else {
450
- return this.$imageSrcMap.fileType.other;
451
- }
452
- },
453
- getBtns (fileItem) {
454
- return ["image", "application/pdf", "text/plain"].some(type => fileItem.mimetype.includes(type)) ||
455
- fileItem.mimetype.includes("wordprocessingml.document") ||
456
- fileItem.mimetype.includes("application/msword") ||
457
- fileItem.mimetype.includes("presentationml.presentation") ||
458
- fileItem.mimetype.includes("application/vnd.ms-powerpoint") ||
459
- fileItem.mimetype.includes("spreadsheetml.sheet")
460
- ? undefined
461
- : ["canDelete", "canEdit", "canDownload"];
462
- }
463
- }
464
- };
465
- </script>
466
-
467
- <style lang="less">
468
- .uploadList {
469
- width: 100%;
470
- overflow: auto;
471
-
472
- // 普通文件
473
- &-old {
474
- margin: 16px;
475
- }
476
-
477
- &-nodata {
478
- width: 100%;
479
- height: 100%;
480
- text-align: center;
481
- line-height: 120px;
482
- color: @placeholderColor;
483
- white-space: nowrap;
484
-
485
- span {
486
- margin-left: 5px;
487
- }
488
- }
489
-
490
- &-list {
491
- display: flex;
492
- flex-wrap: nowrap;
493
-
494
- .item {
495
- flex: 0 0 120px;
496
- height: 120px;
497
- margin-right: 10px;
498
- border-radius: @borderRadius;
499
- background: #f4f5fa;
500
- text-align: center;
501
- overflow: hidden;
502
- display: inline-flex;
503
- flex-direction: column;
504
- justify-content: space-between;
505
- position: relative;
506
-
507
- &:hover {
508
- .item-action {
509
- display: flex !important;
510
- }
511
- }
512
-
513
- &-show {
514
- display: flex;
515
- overflow: hidden;
516
- align-items: center;
517
- justify-content: center;
518
- flex: 2;
519
- min-height: 50px;
520
-
521
- img {
522
- max-width: 100%;
523
- max-height: 100%;
524
- }
525
- }
526
-
527
- &-name {
528
- flex: 1;
529
- display: flex;
530
- max-height: 32px;
531
-
532
- &-title {
533
- padding: 0 8px;
534
- overflow: hidden;
535
- text-overflow: ellipsis;
536
- white-space: nowrap;
537
- color: @themeColor;
538
- }
539
- }
540
-
541
- &-action {
542
- position: absolute;
543
- right: 0px;
544
- top: 0px;
545
- left: 0px;
546
- bottom: 0px;
547
- background-color: @placeholderColor;
548
- display: none !important;
549
- align-items: center;
550
- justify-content: center;
551
-
552
- &-icon {
553
- width: 22px;
554
- height: 22px;
555
- line-height: 22px;
556
- color: #fff;
557
- }
558
- }
559
- }
560
-
561
- // file 模式
562
- &-file {
563
- flex-direction: column;
564
- .item-file {
565
- flex: 0 0 100%;
566
- height: auto;
567
- display: flex;
568
- flex-direction: row;
569
- justify-content: space-between;
570
- align-items: center;
571
- border-radius: 0px;
572
- margin: 0px;
573
- padding: 2px 0;
574
- background: transparent;
575
- &:hover {
576
- background: #f4f5fa;
577
- }
578
- .item-show {
579
- flex: 0 0 22px;
580
- min-height: 20px;
581
- img {
582
- width: 22px;
583
- height: 22px;
584
- }
585
- }
586
- .item-name-title {
587
- color: @textColor;
588
- flex: 1;
589
- text-align: left;
590
- }
591
- .item-action {
592
- position: static;
593
- display: flex !important;
594
- background: transparent;
595
- white-space: nowrap;
596
- &-icon {
597
- color: @contentColor;
598
- width: 16px;
599
- }
600
- }
601
- }
602
- }
603
- }
604
-
605
- &-inline {
606
- height: 32px;
607
- line-height: 32px;
608
-
609
- &-list {
610
- width: 100%;
611
- height: 100%;
612
- padding-left: 3px;
613
- display: flex;
614
- flex-wrap: nowrap;
615
- overflow-x: auto;
616
- overflow-y: hidden;
617
-
618
- .item {
619
- flex: 0 0 32px;
620
- margin-right: 3px;
621
- border-radius: @borderRadius;
622
- background: #f4f5fa;
623
- text-align: center;
624
- position: relative;
625
-
626
- img {
627
- max-width: 100%;
628
- max-height: 100%;
629
- margin: auto;
630
- }
631
-
632
- &-action {
633
- position: absolute;
634
- left: 0;
635
- right: 0;
636
- top: 0;
637
- bottom: 0;
638
- display: none !important;
639
- background-color: @placeholderColor;
640
- color: #fff;
641
- align-items: center;
642
- justify-content: center;
643
- flex-wrap: wrap;
644
-
645
- &-icon {
646
- width: 16px;
647
- height: 16px;
648
- font-size: 16px !important;
649
- margin: 0px;
650
- }
651
- }
652
-
653
- @keyframes toTop {
654
- from {
655
- top: 100%;
656
- }
657
-
658
- to {
659
- top: 0;
660
- }
661
- }
662
-
663
- &:hover {
664
- .item-action {
665
- display: flex !important;
666
- animation: toTop 0.1s;
667
- }
668
- }
669
- }
670
- }
671
-
672
- &-nodata {
673
- padding-left: 7px;
674
- line-height: 32px;
675
- color: @placeholderColor;
676
- }
677
- }
678
-
679
- &-fileList {
680
- width: 100%;
681
-
682
- &-fileName {
683
- cursor: pointer;
684
-
685
- &-edit {
686
- padding: 0 8px;
687
- display: flex;
688
- justify-content: space-between;
689
- align-items: center;
690
- }
691
- }
692
- }
693
- }
694
-
695
- .DshDropdown {
696
- .uploadList-fileList-fileItem {
697
- width: 100%;
698
- display: flex;
699
- justify-content: space-between;
700
- align-items: center;
701
- .fileItem {
702
- &-img {
703
- width: 22px;
704
- height: 22px;
705
- }
706
- &-name-title {
707
- white-space: nowrap;
708
- overflow: hidden;
709
- text-overflow: ellipsis;
710
- margin: 0 8px;
711
- flex: 1;
712
- text-align: left;
713
- }
714
- &-action {
715
- display: flex;
716
- align-items: center;
717
- justify-content: flex-end;
718
- &-icon {
719
- width: 16px;
720
- color: @contentColor;
721
- }
722
- }
723
- }
724
-
725
- }
726
- }
727
- </style>
1
+ <template>
2
+ <div :class="{
3
+ uploadList: true,
4
+ [`uploadList-${showMode}`]: true,
5
+ [`uploadList-${subType}`]: true
6
+ }">
7
+ <!-- 普通文本模式 -->
8
+ <template v-if="showMode ==='old'">
9
+ <!-- 有值 -->
10
+ <div
11
+ v-if="files.length"
12
+ ref="viewerImage"
13
+ :class="{
14
+ 'uploadList-list': true,
15
+ [`uploadList-list-${subType}`]: true
16
+ }"
17
+ >
18
+ <div
19
+ v-for="(fileItem, fileIndex) in files"
20
+ :key="fileItem._key || fileItem._id"
21
+ :class="{
22
+ 'item': subType === 'image',
23
+ [`item-${subType}`]: true
24
+ }"
25
+ >
26
+ <!-- 展示图 -->
27
+ <div class="item-show">
28
+ <img
29
+ v-if="fileItem.mimetype.includes('image')"
30
+ :data-original="fileItem.url"
31
+ :src="$imageResize(fileItem.url, imageResizeConfig)"
32
+ :alt="fileItem.name"
33
+ >
34
+ <img
35
+ v-else
36
+ :src="getFileImage(fileItem)"
37
+ :alt="fileItem.name"
38
+ >
39
+ </div>
40
+
41
+ <!-- 展示名称 -->
42
+ <p class="item-name-title">{{ fileItem.name }}</p>
43
+
44
+ <!-- 图标 -->
45
+ <dsh-icons
46
+ class="item-action"
47
+ item-class="item-action-icon"
48
+ :list="$getOperationList(getBtns(fileItem))"
49
+ @click="$dispatchEvent($event, fileItem, fileIndex)"
50
+ ></dsh-icons>
51
+ </div>
52
+ </div>
53
+
54
+ <!-- 无值 -->
55
+ <div
56
+ v-else
57
+ class="uploadList-nodata"
58
+ >
59
+ <span>{{ emptyShowVal }}</span>
60
+ </div>
61
+ </template>
62
+
63
+ <!-- 在表格中展开 -->
64
+ <template v-else-if="showMode ==='tableList'">
65
+ <!-- 有值 -->
66
+ <div
67
+ v-if="files.length"
68
+ ref="viewerImage"
69
+ :class="[
70
+ 'uploadList-list',
71
+ `uploadList-list-${subType}`
72
+ ]"
73
+ >
74
+ <div
75
+ v-for="(fileItem, fileIndex) in files"
76
+ :key="fileItem._key || fileItem._id"
77
+ :class="{
78
+ 'item': subType === 'image',
79
+ [`item-${subType}`]: true
80
+ }"
81
+ >
82
+ <!-- 展示图 -->
83
+ <div class="item-show">
84
+ <img
85
+ v-if="fileItem.mimetype.includes('image')"
86
+ :data-original="fileItem.url"
87
+ :src="$imageResize(fileItem.url, imageResizeConfig)"
88
+ :alt="fileItem.name"
89
+ >
90
+ <img
91
+ v-else
92
+ :src="getFileImage(fileItem)"
93
+ :alt="fileItem.name"
94
+ >
95
+ </div>
96
+
97
+ <!-- 展示名称 -->
98
+ <p class="item-name-title">{{ fileItem.name }}</p>
99
+
100
+ <!-- 图标 -->
101
+ <dsh-icons
102
+ class="item-action"
103
+ item-class="item-action-icon"
104
+ :list="$getOperationList(getBtns(fileItem))"
105
+ @click="$dispatchEvent($event, fileItem, fileIndex)"
106
+ ></dsh-icons>
107
+ </div>
108
+ </div>
109
+
110
+ <!-- 无值 -->
111
+ <div
112
+ v-else
113
+ class="uploadList-inline-nodata"
114
+ >
115
+ <span>{{ emptyShowVal }}</span>
116
+ </div>
117
+ </template>
118
+
119
+ <!-- 新展示方式 -->
120
+ <template v-else>
121
+ <!-- 文件类型 -->
122
+ <div
123
+ v-if="subType === 'file'"
124
+ ref="viewerImage"
125
+ >
126
+ <!-- 有值 -->
127
+ <template v-if="files.length">
128
+ <dsh-dropdown
129
+ :list="files"
130
+ trigger="hover"
131
+ class="uploadList-fileList"
132
+ >
133
+ <div :class="{
134
+ 'uploadList-fileList-fileName': true,
135
+ 'uploadList-fileList-fileName-edit': canEdit
136
+ }">
137
+ {{ files.length }}个
138
+ <Icon
139
+ v-if="canEdit"
140
+ type="ios-arrow-down"
141
+ />
142
+ </div>
143
+
144
+ <div
145
+ slot="dropdownItem"
146
+ slot-scope="{ dropdownItem, dropdownIndex }"
147
+ class="uploadList-fileList-fileItem"
148
+ >
149
+ <img
150
+ v-if="dropdownItem.mimetype.includes('image')"
151
+ :data-original="dropdownItem.url"
152
+ :src="$imageResize(dropdownItem.url, imageResizeConfig)"
153
+ :alt="dropdownItem.name"
154
+ class="fileItem-img"
155
+ >
156
+ <img
157
+ v-else
158
+ :src="getFileImage(dropdownItem)"
159
+ :alt="dropdownItem.name"
160
+ class="fileItem-img"
161
+ >
162
+
163
+ <p class="fileItem-name-title">{{ dropdownItem.name }}</p>
164
+
165
+ <dsh-icons
166
+ class="fileItem-action"
167
+ item-class="fileItem-action-icon"
168
+ :list="$getOperationList(getBtns(dropdownItem))"
169
+ @click="$dispatchEvent($event, dropdownItem, dropdownIndex)"
170
+ ></dsh-icons>
171
+ </div>
172
+ </dsh-dropdown>
173
+
174
+ <div
175
+ v-for="(fileItem) in files"
176
+ :key="fileItem._key || fileItem._id"
177
+ :class="{
178
+ 'item': subType === 'image',
179
+ [`item-${subType}`]: true
180
+ }"
181
+ >
182
+ <img
183
+ v-if="fileItem.mimetype.includes('image')"
184
+ :data-original="fileItem.url"
185
+ :src="$imageResize(fileItem.url, imageResizeConfig)"
186
+ :alt="fileItem.name"
187
+ style="display: none;"
188
+ >
189
+ </div>
190
+ </template>
191
+
192
+ <!-- 无值 -->
193
+ <span
194
+ v-else
195
+ class="uploadList-inline-nodata"
196
+ >
197
+ {{ emptyShowVal }}
198
+ </span>
199
+ </div>
200
+
201
+ <!-- 图片类型 -->
202
+ <template v-else>
203
+ <!-- 有值 -->
204
+ <div
205
+ v-if="files.length"
206
+ ref="viewerImage"
207
+ class="uploadList-inline-list"
208
+ >
209
+ <div
210
+ v-for="(fileItem, fileIndex) in files"
211
+ :key="fileItem.url"
212
+ class="item"
213
+ >
214
+ <img
215
+ v-if="fileItem.mimetype.includes('image')"
216
+ :data-original="fileItem.url"
217
+ :src="$imageResize(fileItem.url, imageResizeConfig)"
218
+ :alt="fileItem.name"
219
+ >
220
+ <img
221
+ v-else
222
+ :src="getFileImage(fileItem)"
223
+ :alt="fileItem.name"
224
+ >
225
+
226
+ <dsh-icons
227
+ class="item-action"
228
+ item-class="item-action-icon"
229
+ :list="$getOperationList(getBtns(fileItem))"
230
+ @click="$dispatchEvent($event, fileItem, fileIndex)"
231
+ ></dsh-icons>
232
+ </div>
233
+ </div>
234
+
235
+ <!-- 无值 -->
236
+ <span
237
+ v-else
238
+ class="uploadList-inline-nodata"
239
+ >
240
+ {{ emptyShowVal }}
241
+ </span>
242
+ </template>
243
+ </template>
244
+ </div>
245
+ </template>
246
+
247
+ <script>
248
+ import Viewer from "viewerjs";
249
+ import axios from "axios";
250
+
251
+ export default {
252
+ name: "uploadList",
253
+ props: {
254
+ showMode: {
255
+ type: String,
256
+ default: "old" // inline, old, normal
257
+ },
258
+ canEdit: {
259
+ type: Boolean,
260
+ default: true
261
+ },
262
+ files: {
263
+ type: Array,
264
+ default () {
265
+ return [];
266
+ }
267
+ },
268
+ propsObj: {
269
+ type: Object,
270
+ default () {
271
+ return {};
272
+ }
273
+ },
274
+ isShowEditIcon: Boolean,
275
+ emptyShowVal: String
276
+ },
277
+ data () {
278
+ return {
279
+ imageResizeConfig: {}
280
+ };
281
+ },
282
+ computed: {
283
+ subType () {
284
+ return this.propsObj._fileType;
285
+ },
286
+
287
+ allOperationMap () {
288
+ return {
289
+ canDelete: {
290
+ name: "删除",
291
+ type: "canDelete",
292
+ customIcon: "bico-shanchu",
293
+ size: "14",
294
+ event: "clickDeleteItem"
295
+ },
296
+ canEdit: {
297
+ name: "编辑",
298
+ type: "canEdit",
299
+ customIcon: "bico-bianji",
300
+ size: "14",
301
+ event: "clickEdit"
302
+ },
303
+ canDownload: {
304
+ name: "下载",
305
+ type: "canDownload",
306
+ customIcon: "bico-xiazai1",
307
+ size: "14",
308
+ event: "handleDownload"
309
+ },
310
+ canPreview: {
311
+ name: "预览",
312
+ type: "canPreview",
313
+ customIcon: "bico-yulan",
314
+ size: "16",
315
+ event: "clickPreview"
316
+ }
317
+ };
318
+ },
319
+ operationMap () {
320
+ let operations = { ...this.allOperationMap };
321
+ // comp_web图标前缀与其他不同,需特殊处理
322
+ if (this.propsObj._pageType === "comp") {
323
+ operations.canDelete.customIcon = "bri-shanchu";
324
+ operations.canEdit.customIcon = "bri-bianji";
325
+ operations.canDownload.customIcon = "bri-xiazai";
326
+ operations.canPreview.customIcon = "bri-keshi";
327
+ }
328
+ return this.canEdit
329
+ ? this.$categoryMapToMap(
330
+ operations,
331
+ undefined,
332
+ this.isShowEditIcon ? [] : ["canEdit"]
333
+ )
334
+ : this.$categoryMapToMap(
335
+ operations,
336
+ undefined,
337
+ ["canDelete", "canEdit"]
338
+ );
339
+ }
340
+ },
341
+ methods: {
342
+ // 点击删除某项
343
+ clickDeleteItem (operationItem, fileItem, fileIndex) {
344
+ this.$emit("deleteItem", fileItem, fileIndex);
345
+ },
346
+ // 点击文件预览 -file服务器的数据列表
347
+ clickPreview (operationItem, fileItem, fileIndex) {
348
+ if (fileItem.mimetype.includes("image")) {
349
+ const viewerImage = this.$refs.viewerImage;
350
+ const findIndex = this.files
351
+ .filter(valItem => valItem.mimetype.includes("image"))
352
+ .findIndex(valItem => valItem.url === fileItem.url);
353
+
354
+ const viewer = new Viewer(viewerImage, {
355
+ url: "data-original",
356
+ hidden: function () {
357
+ viewer.destroy();
358
+ },
359
+ loop: false,
360
+ initialViewIndex: findIndex,
361
+ zIndex: 2147483647
362
+ });
363
+ viewer.show();
364
+ } else {
365
+ window.open(fileItem.url);
366
+ }
367
+ },
368
+ // 点击文件编辑
369
+ clickEdit (operationItem, fileItem) {
370
+ let fileName = fileItem.name;
371
+ const lastIndex = fileName.lastIndexOf(".");
372
+ const formate = fileName.substring(lastIndex);
373
+ fileName = fileName.substring(0, lastIndex);
374
+
375
+ this.$Modal.confirm({
376
+ title: "修改名称",
377
+ render: (h) => {
378
+ // // 第二种方式
379
+ // const lastIndex = fileName.lastIndexOf(".");
380
+ // const formate = fileName.substring(lastIndex);
381
+
382
+ return h("Input", {
383
+ props: {
384
+ // value: fileItem.name.substring(0, lastIndex),
385
+ value: fileName,
386
+ autofocus: true,
387
+ placeholder: "请输入名称"
388
+ },
389
+ scopedSlots: {
390
+ append: formate
391
+ },
392
+ on: {
393
+ input: (val) => {
394
+ // fileItem.name = val + formate;
395
+ fileName = val;
396
+ }
397
+ }
398
+ });
399
+ },
400
+ onOk: () => {
401
+ fileItem.name = fileName + formate;
402
+ this.$emit("editItemName", fileItem);
403
+ },
404
+ onCancel: () => {}
405
+ });
406
+ },
407
+ // 接口 -下载
408
+ handleDownload (operationItem, fileItem, fileIndex) {
409
+ axios
410
+ .get(fileItem.downloadUrl, {
411
+ responseType: "blob"
412
+ })
413
+ .then((res) => {
414
+ if (window.navigator.msSaveOrOpenBlob) {
415
+ // 兼容IE10
416
+ navigator.msSaveBlob(res, fileItem.name);
417
+ } else {
418
+ const href = URL.createObjectURL(res.data); // 创建新的URL表示指定的blob对象
419
+ const a = document.createElement("a");
420
+ a.style.display = "none";
421
+ a.href = href; // 指定下载链接
422
+ a.download = fileItem.name; // 指定下载文件名
423
+ a.click();
424
+ URL.revokeObjectURL(a.href); // 释放URL对象
425
+ a.remove();
426
+ }
427
+ });
428
+ },
429
+ // 获取不同类型文件的图片
430
+ getFileImage (fileItem) {
431
+ if (!fileItem.mimetype) {
432
+ return this.$imageSrcMap.fileType.other;
433
+ } else if (fileItem.mimetype.includes("image")) {
434
+ return fileItem.url; // 压缩图片:将图片最长的边限制在100像素,短边按比例处理
435
+ } else if (fileItem.mimetype.includes("text/plain")) {
436
+ return this.$imageSrcMap.fileType.text;
437
+ } else if (fileItem.mimetype.includes("application/pdf")) {
438
+ return this.$imageSrcMap.fileType.pdf;
439
+ } else if (fileItem.mimetype.includes("wordprocessingml.document") || fileItem.mimetype.includes("application/msword")) {
440
+ return this.$imageSrcMap.fileType.doc;
441
+ } else if (fileItem.mimetype.includes("presentationml.presentation") || fileItem.mimetype.includes("application/vnd.ms-powerpoint")) {
442
+ return this.$imageSrcMap.fileType.ppt;
443
+ } else if (fileItem.mimetype.includes("spreadsheetml.sheet")) {
444
+ return this.$imageSrcMap.fileType.excel;
445
+ } else if (fileItem.mimetype.includes("application/x-zip-compressed")) {
446
+ return this.$imageSrcMap.fileType.zip;
447
+ } else if (fileItem.mimetype.includes("application/x-rar-compressed")) {
448
+ return this.$imageSrcMap.fileType.rar;
449
+ } else {
450
+ return this.$imageSrcMap.fileType.other;
451
+ }
452
+ },
453
+ getBtns (fileItem) {
454
+ return ["image", "application/pdf", "text/plain"].some(type => fileItem.mimetype.includes(type)) ||
455
+ fileItem.mimetype.includes("wordprocessingml.document") ||
456
+ fileItem.mimetype.includes("application/msword") ||
457
+ fileItem.mimetype.includes("presentationml.presentation") ||
458
+ fileItem.mimetype.includes("application/vnd.ms-powerpoint") ||
459
+ fileItem.mimetype.includes("spreadsheetml.sheet")
460
+ ? undefined
461
+ : ["canDelete", "canEdit", "canDownload"];
462
+ }
463
+ }
464
+ };
465
+ </script>
466
+
467
+ <style lang="less">
468
+ .uploadList {
469
+ width: 100%;
470
+ overflow: auto;
471
+
472
+ // 普通文件
473
+ &-old {
474
+ margin: 16px;
475
+ }
476
+
477
+ &-nodata {
478
+ width: 100%;
479
+ height: 100%;
480
+ text-align: center;
481
+ line-height: 120px;
482
+ color: @placeholderColor;
483
+ white-space: nowrap;
484
+
485
+ span {
486
+ margin-left: 5px;
487
+ }
488
+ }
489
+
490
+ &-list {
491
+ display: flex;
492
+ flex-wrap: nowrap;
493
+
494
+ .item {
495
+ flex: 0 0 120px;
496
+ height: 120px;
497
+ margin-right: 10px;
498
+ border-radius: @borderRadius;
499
+ background: #f4f5fa;
500
+ text-align: center;
501
+ overflow: hidden;
502
+ display: inline-flex;
503
+ flex-direction: column;
504
+ justify-content: space-between;
505
+ position: relative;
506
+
507
+ &:hover {
508
+ .item-action {
509
+ display: flex !important;
510
+ }
511
+ }
512
+
513
+ &-show {
514
+ display: flex;
515
+ overflow: hidden;
516
+ align-items: center;
517
+ justify-content: center;
518
+ flex: 2;
519
+ min-height: 50px;
520
+
521
+ img {
522
+ max-width: 100%;
523
+ max-height: 100%;
524
+ }
525
+ }
526
+
527
+ &-name {
528
+ flex: 1;
529
+ display: flex;
530
+ max-height: 32px;
531
+
532
+ &-title {
533
+ padding: 0 8px;
534
+ overflow: hidden;
535
+ text-overflow: ellipsis;
536
+ white-space: nowrap;
537
+ color: @themeColor;
538
+ }
539
+ }
540
+
541
+ &-action {
542
+ position: absolute;
543
+ right: 0px;
544
+ top: 0px;
545
+ left: 0px;
546
+ bottom: 0px;
547
+ background-color: @placeholderColor;
548
+ display: none !important;
549
+ align-items: center;
550
+ justify-content: center;
551
+
552
+ &-icon {
553
+ width: 22px;
554
+ height: 22px;
555
+ line-height: 22px;
556
+ color: #fff;
557
+ }
558
+ }
559
+ }
560
+
561
+ // file 模式
562
+ &-file {
563
+ flex-direction: column;
564
+ .item-file {
565
+ flex: 0 0 100%;
566
+ height: auto;
567
+ display: flex;
568
+ flex-direction: row;
569
+ justify-content: space-between;
570
+ align-items: center;
571
+ border-radius: 0px;
572
+ margin: 0px;
573
+ padding: 2px 0;
574
+ background: transparent;
575
+ &:hover {
576
+ background: #f4f5fa;
577
+ }
578
+ .item-show {
579
+ flex: 0 0 22px;
580
+ min-height: 20px;
581
+ img {
582
+ width: 22px;
583
+ height: 22px;
584
+ }
585
+ }
586
+ .item-name-title {
587
+ color: @textColor;
588
+ flex: 1;
589
+ text-align: left;
590
+ }
591
+ .item-action {
592
+ position: static;
593
+ display: flex !important;
594
+ background: transparent;
595
+ white-space: nowrap;
596
+ &-icon {
597
+ color: @contentColor;
598
+ width: 16px;
599
+ }
600
+ }
601
+ }
602
+ }
603
+ }
604
+
605
+ &-inline {
606
+ height: 32px;
607
+ line-height: 32px;
608
+
609
+ &-list {
610
+ width: 100%;
611
+ height: 100%;
612
+ padding-left: 3px;
613
+ display: flex;
614
+ flex-wrap: nowrap;
615
+ overflow-x: auto;
616
+ overflow-y: hidden;
617
+
618
+ .item {
619
+ flex: 0 0 32px;
620
+ margin-right: 3px;
621
+ border-radius: @borderRadius;
622
+ background: #f4f5fa;
623
+ text-align: center;
624
+ position: relative;
625
+
626
+ img {
627
+ max-width: 100%;
628
+ max-height: 100%;
629
+ margin: auto;
630
+ }
631
+
632
+ &-action {
633
+ position: absolute;
634
+ left: 0;
635
+ right: 0;
636
+ top: 0;
637
+ bottom: 0;
638
+ display: none !important;
639
+ background-color: @placeholderColor;
640
+ color: #fff;
641
+ align-items: center;
642
+ justify-content: center;
643
+ flex-wrap: wrap;
644
+
645
+ &-icon {
646
+ width: 16px;
647
+ height: 16px;
648
+ font-size: 16px !important;
649
+ margin: 0px;
650
+ }
651
+ }
652
+
653
+ @keyframes toTop {
654
+ from {
655
+ top: 100%;
656
+ }
657
+
658
+ to {
659
+ top: 0;
660
+ }
661
+ }
662
+
663
+ &:hover {
664
+ .item-action {
665
+ display: flex !important;
666
+ animation: toTop 0.1s;
667
+ }
668
+ }
669
+ }
670
+ }
671
+
672
+ &-nodata {
673
+ padding-left: 7px;
674
+ line-height: 32px;
675
+ color: @placeholderColor;
676
+ }
677
+ }
678
+
679
+ &-fileList {
680
+ width: 100%;
681
+
682
+ &-fileName {
683
+ cursor: pointer;
684
+
685
+ &-edit {
686
+ padding: 0 8px;
687
+ display: flex;
688
+ justify-content: space-between;
689
+ align-items: center;
690
+ }
691
+ }
692
+ }
693
+ }
694
+
695
+ .DshDropdown {
696
+ .uploadList-fileList-fileItem {
697
+ width: 100%;
698
+ display: flex;
699
+ justify-content: space-between;
700
+ align-items: center;
701
+ .fileItem {
702
+ &-img {
703
+ width: 22px;
704
+ height: 22px;
705
+ }
706
+ &-name-title {
707
+ white-space: nowrap;
708
+ overflow: hidden;
709
+ text-overflow: ellipsis;
710
+ margin: 0 8px;
711
+ flex: 1;
712
+ text-align: left;
713
+ }
714
+ &-action {
715
+ display: flex;
716
+ align-items: center;
717
+ justify-content: flex-end;
718
+ &-icon {
719
+ width: 16px;
720
+ color: @contentColor;
721
+ }
722
+ }
723
+ }
724
+
725
+ }
726
+ }
727
+ </style>