vue2-client 1.15.61 → 1.15.63

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 (134) hide show
  1. package/package.json +110 -110
  2. package/src/base-client/components/common/XButtons/XButtons.vue +3 -12
  3. package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
  4. package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
  5. package/src/components/FileImageItem/FileItem.vue +321 -305
  6. package/src/pages/WorkflowDetail/WorkflowDetail.vue +391 -379
  7. package/src/pages/WorkflowDetail/WorkflowPageDetail/worklog.vue +97 -0
  8. package/.history/public/his/editor/editor_20250606134713.html +0 -51
  9. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +0 -509
  10. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +0 -524
  11. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +0 -524
  12. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +0 -524
  13. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +0 -207
  14. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +0 -211
  15. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +0 -212
  16. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +0 -212
  17. package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +0 -1320
  18. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +0 -1332
  19. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +0 -1331
  20. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +0 -1331
  21. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +0 -1331
  22. package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +0 -1339
  23. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +0 -731
  24. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +0 -748
  25. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +0 -748
  26. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +0 -1071
  27. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +0 -1078
  28. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +0 -1077
  29. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +0 -1077
  30. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +0 -1077
  31. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +0 -442
  32. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +0 -442
  33. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +0 -442
  34. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +0 -475
  35. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +0 -475
  36. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +0 -475
  37. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +0 -477
  38. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +0 -477
  39. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +0 -477
  40. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +0 -473
  41. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +0 -473
  42. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +0 -473
  43. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +0 -473
  44. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +0 -473
  45. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +0 -473
  46. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +0 -473
  47. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +0 -473
  48. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +0 -473
  49. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +0 -473
  50. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +0 -474
  51. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +0 -474
  52. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +0 -474
  53. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +0 -472
  54. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +0 -472
  55. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +0 -472
  56. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +0 -472
  57. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +0 -472
  58. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +0 -472
  59. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +0 -501
  60. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +0 -501
  61. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +0 -501
  62. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +0 -504
  63. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +0 -504
  64. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +0 -504
  65. package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +0 -131
  66. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +0 -160
  67. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +0 -160
  68. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +0 -160
  69. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +0 -158
  70. package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +0 -173
  71. package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +0 -222
  72. package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +0 -229
  73. package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +0 -229
  74. package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +0 -229
  75. package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +0 -241
  76. package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +0 -241
  77. package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +0 -241
  78. package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +0 -245
  79. package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +0 -245
  80. package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +0 -245
  81. package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +0 -255
  82. package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +0 -255
  83. package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +0 -255
  84. package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +0 -270
  85. package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +0 -270
  86. package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +0 -270
  87. package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +0 -270
  88. package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +0 -294
  89. package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +0 -294
  90. package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +0 -294
  91. package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +0 -303
  92. package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +0 -303
  93. package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +0 -303
  94. package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +0 -288
  95. package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +0 -288
  96. package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +0 -288
  97. package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +0 -317
  98. package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +0 -306
  99. package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +0 -306
  100. package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +0 -306
  101. package/.history/src/base-client/components/his/XList/XList_20250704142024.vue +0 -495
  102. package/.history/src/base-client/components/his/XList/XList_20250704142033.vue +0 -495
  103. package/.history/src/base-client/components/his/XList/XList_20250704142040.vue +0 -494
  104. package/.history/src/base-client/components/his/XList/XList_20250704142211.vue +0 -494
  105. package/.history/src/base-client/components/his/XList/XList_20250704142214.vue +0 -494
  106. package/.history/src/base-client/components/his/XList/XList_20250704143010.vue +0 -495
  107. package/.history/src/base-client/components/his/XList/XList_20250704143203.vue +0 -495
  108. package/.history/src/base-client/components/his/XList/XList_20250707095101.vue +0 -492
  109. package/.history/src/base-client/components/his/XList/XList_20250707100152.vue +0 -492
  110. package/.history/src/base-client/components/his/XList/XList_20250707100200.vue +0 -485
  111. package/.history/src/base-client/components/his/XList/XList_20250707100208.vue +0 -485
  112. package/.history/src/base-client/components/his/XList/XList_20250707100259.vue +0 -488
  113. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250609151519.vue +0 -222
  114. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155514.vue +0 -183
  115. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155556.vue +0 -183
  116. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155600.vue +0 -183
  117. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181609.vue +0 -206
  118. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181629.vue +0 -209
  119. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095553.vue +0 -242
  120. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095610.vue +0 -242
  121. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095612.vue +0 -242
  122. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100041.vue +0 -251
  123. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100047.vue +0 -251
  124. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100054.vue +0 -250
  125. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100105.vue +0 -250
  126. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100107.vue +0 -250
  127. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100114.vue +0 -250
  128. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140844.vue +0 -238
  129. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140910.vue +0 -238
  130. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140912.vue +0 -238
  131. package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +0 -36
  132. package/src/base-client/components/TreeList/TreeList.vue +0 -91
  133. package/src/base-client/components/TreeList/TreeNode.vue +0 -81
  134. package/src/base-client/components/common/XCardSet/XTiltle.vue +0 -191
@@ -1,305 +1,321 @@
1
- <template>
2
- <div class="file-list">
3
- <div class="file-grid">
4
- <div v-for="file in files" :key="file.id" class="file-item">
5
- <div class="file-info">
6
- <div class="file-icon-wrapper" :class="getFileTypeClass(file.name)">
7
- <a-icon :type="getFileIcon(file.name)" class="file-icon" />
8
- </div>
9
- <div class="file-content">
10
- <div class="file-header">
11
- <span class="file-name">{{ file.real_name ? file.real_name : file.name }}</span>
12
- <span class="file-type">{{ getFileType(file.name) }}</span>
13
- </div>
14
- <div class="file-footer">
15
- <span class="file-size" v-if="file.size">{{ formatFileSize(file.size) }}</span>
16
- <span class="file-time" v-if="file.upload_time">{{ file.upload_time }}</span>
17
- </div>
18
- </div>
19
- </div>
20
- <div class="file-actions">
21
- <a-tooltip title="预览文件">
22
- <a-button type="link" class="action-btn preview-btn" @click="handlePreview(file.url)">
23
- <a-icon type="eye" />
24
- </a-button>
25
- </a-tooltip>
26
- <a-tooltip v-if="downloadable" title="下载文件">
27
- <a-button type="link" class="action-btn download-btn" @click="download(file)">
28
- <a-icon type="download" />
29
- </a-button>
30
- </a-tooltip>
31
- </div>
32
- </div>
33
- </div>
34
- <!-- 文件预览弹窗 -->
35
- <a-modal
36
- v-model="previewVisible"
37
- :footer="null"
38
- :dialog-style="{ top: '20px' }"
39
- width="85%"
40
- :z-index="1001"
41
- title="文件预览"
42
- @cancel="handlePreviewClose"
43
- >
44
- <file-preview :path="previewPath" />
45
- </a-modal>
46
- </div>
47
- </template>
48
-
49
- <script>
50
- import FilePreview from '@vue2-client/components/FilePreview'
51
-
52
- export default {
53
- name: 'FileImageItem',
54
- components: {
55
- FilePreview
56
- },
57
- props: {
58
- files: {
59
- type: Array,
60
- required: true
61
- },
62
- downloadable: {
63
- type: Boolean,
64
- required: false,
65
- default: true
66
- }
67
- },
68
- data () {
69
- return {
70
- previewVisible: false,
71
- previewPath: ''
72
- }
73
- },
74
- methods: {
75
- handlePreview (path) {
76
- this.previewPath = path
77
- this.previewVisible = true
78
- },
79
- handlePreviewClose () {
80
- this.previewVisible = false
81
- this.previewPath = ''
82
- },
83
- download (file) {
84
- const a = document.createElement('a')
85
- a.href = file.url
86
- a.download = file.name
87
- a.click()
88
- },
89
- formatFileSize (size) {
90
- if (!size) return ''
91
- // 如果小于1M,转换为KB显示
92
- if (size < 1) {
93
- const kbSize = size * 1024
94
- return `${kbSize.toFixed(1)} KB`
95
- }
96
- // 大于等于1M,保持M为单位
97
- return `${size.toFixed(1)} MB`
98
- },
99
- getFileType (filename) {
100
- const ext = filename.split('.').pop().toLowerCase()
101
- const typeMap = {
102
- pdf: 'PDF文档',
103
- doc: 'Word文档',
104
- docx: 'Word文档',
105
- xls: 'Excel表格',
106
- xlsx: 'Excel表格',
107
- ppt: 'PPT演示',
108
- pptx: 'PPT演示',
109
- jpg: '图片',
110
- jpeg: '图片',
111
- png: '图片',
112
- gif: '图片',
113
- txt: '文本文件',
114
- zip: '压缩文件',
115
- rar: '压缩文件'
116
- }
117
- return typeMap[ext] || '文件'
118
- },
119
- getFileIcon (filename) {
120
- const ext = filename.split('.').pop().toLowerCase()
121
- const iconMap = {
122
- pdf: 'file-pdf',
123
- doc: 'file-word',
124
- docx: 'file-word',
125
- xls: 'file-excel',
126
- xlsx: 'file-excel',
127
- ppt: 'file-ppt',
128
- pptx: 'file-ppt',
129
- jpg: 'file-image',
130
- jpeg: 'file-image',
131
- png: 'file-image',
132
- gif: 'file-image',
133
- txt: 'file-text',
134
- zip: 'file-zip',
135
- rar: 'file-zip'
136
- }
137
- return iconMap[ext] || 'file'
138
- },
139
- getFileTypeClass (filename) {
140
- const ext = filename.split('.').pop().toLowerCase()
141
- return `file-type-${ext}`
142
- }
143
- }
144
- }
145
- </script>
146
-
147
- <style lang="less" scoped>
148
- .file-list {
149
- .file-grid {
150
- display: grid;
151
- grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
152
- gap: 16px;
153
- }
154
-
155
- .file-item {
156
- display: flex;
157
- align-items: center;
158
- justify-content: space-between;
159
- padding: 16px;
160
- background: #fff;
161
- border-radius: 12px;
162
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
163
- border: 1px solid rgba(0, 0, 0, 0.06);
164
-
165
- &:hover {
166
- transform: translateY(-2px);
167
- border-color: @primary-2;
168
- background: rgba(24, 144, 255, 0.02);
169
- }
170
-
171
- .file-info {
172
- display: flex;
173
- align-items: center;
174
- flex: 1;
175
- min-width: 0;
176
-
177
- .file-icon-wrapper {
178
- display: flex;
179
- align-items: center;
180
- justify-content: center;
181
- width: 48px;
182
- height: 48px;
183
- margin-right: 16px;
184
- border-radius: 12px;
185
- transition: all 0.3s;
186
-
187
- &.file-type-pdf {
188
- background: linear-gradient(135deg, #ff4d4f, #ff7875);
189
- }
190
- &.file-type-doc, &.file-type-docx {
191
- background: linear-gradient(135deg, #1890ff, #69c0ff);
192
- }
193
- &.file-type-xls, &.file-type-xlsx {
194
- background: linear-gradient(135deg, #52c41a, #95de64);
195
- }
196
- &.file-type-ppt, &.file-type-pptx {
197
- background: linear-gradient(135deg, #fa8c16, #ffc069);
198
- }
199
- &.file-type-jpg, &.file-type-jpeg, &.file-type-png, &.file-type-gif {
200
- background: linear-gradient(135deg, #722ed1, #b37feb);
201
- }
202
- &.file-type-txt {
203
- background: linear-gradient(135deg, #13c2c2, #5cdbd3);
204
- }
205
- &.file-type-zip, &.file-type-rar {
206
- background: linear-gradient(135deg, #eb2f96, #ff85c0);
207
- }
208
-
209
- .file-icon {
210
- font-size: 24px;
211
- color: #fff;
212
- }
213
- }
214
-
215
- .file-content {
216
- display: flex;
217
- flex-direction: column;
218
- min-width: 0;
219
- flex: 1;
220
-
221
- .file-header {
222
- display: flex;
223
- align-items: center;
224
- margin-bottom: 4px;
225
-
226
- .file-name {
227
- color: rgba(0, 0, 0, 0.85);
228
- font-size: 15px;
229
- font-weight: 500;
230
- overflow: hidden;
231
- text-overflow: ellipsis;
232
- white-space: nowrap;
233
- margin-right: 8px;
234
- width: 0;
235
- flex: 1;
236
- }
237
-
238
- .file-type {
239
- color: rgba(0, 0, 0, 0.45);
240
- font-size: 12px;
241
- padding: 2px 6px;
242
- background: rgba(0, 0, 0, 0.04);
243
- border-radius: 4px;
244
- }
245
- }
246
-
247
- .file-footer {
248
- display: flex;
249
- align-items: center;
250
- color: rgba(0, 0, 0, 0.45);
251
- font-size: 12px;
252
-
253
- .file-size {
254
- margin-right: 12px;
255
- }
256
-
257
- .file-time {
258
- position: relative;
259
- padding-left: 12px;
260
-
261
- &::before {
262
- content: '';
263
- position: absolute;
264
- left: 0;
265
- top: 50%;
266
- transform: translateY(-50%);
267
- width: 4px;
268
- height: 4px;
269
- background: rgba(0, 0, 0, 0.25);
270
- border-radius: 50%;
271
- }
272
- }
273
- }
274
- }
275
- }
276
-
277
- .file-actions {
278
- display: flex;
279
- align-items: center;
280
- margin-left: 16px;
281
-
282
- .action-btn {
283
- width: 36px;
284
- height: 36px;
285
- padding: 0;
286
- margin-left: 8px;
287
- border-radius: 8px;
288
- color: rgba(0, 0, 0, 0.45);
289
- background: transparent;
290
- transition: all 0.3s;
291
-
292
- &:hover {
293
- color: #fff;
294
- background: @primary-color;
295
- transform: scale(1.05);
296
- }
297
-
298
- .anticon {
299
- font-size: 16px;
300
- }
301
- }
302
- }
303
- }
304
- }
305
- </style>
1
+ <template>
2
+ <div class="file-list">
3
+ <div class="file-grid">
4
+ <div v-for="file in files" :key="file.id" class="file-item">
5
+ <div class="file-info">
6
+ <div class="file-icon-wrapper" :class="getFileTypeClass(file.name)">
7
+ <template v-if="isImageType(file.name)">
8
+ <img :src="file.url" class="file-thumb" />
9
+ </template>
10
+ <template v-else>
11
+ <a-icon :type="getFileIcon(file.name)" class="file-icon" />
12
+ </template>
13
+ </div>
14
+ <div class="file-content">
15
+ <div class="file-header">
16
+ <span class="file-name">{{ file.real_name ? file.real_name : file.name }}</span>
17
+ <span class="file-type">{{ getFileType(file.name) }}</span>
18
+ </div>
19
+ <div class="file-footer">
20
+ <span class="file-size" v-if="file.size">{{ formatFileSize(file.size) }}</span>
21
+ <span class="file-time" v-if="file.upload_time">{{ file.upload_time }}</span>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div class="file-actions">
26
+ <a-tooltip title="预览文件">
27
+ <a-button type="link" class="action-btn preview-btn" @click="handlePreview(file.url)">
28
+ <a-icon type="eye" />
29
+ </a-button>
30
+ </a-tooltip>
31
+ <a-tooltip v-if="downloadable" title="下载文件">
32
+ <a-button type="link" class="action-btn download-btn" @click="download(file)">
33
+ <a-icon type="download" />
34
+ </a-button>
35
+ </a-tooltip>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <!-- 文件预览弹窗 -->
40
+ <a-modal
41
+ v-model="previewVisible"
42
+ :footer="null"
43
+ :dialog-style="{ top: '20px' }"
44
+ width="85%"
45
+ :z-index="1001"
46
+ title="文件预览"
47
+ @cancel="handlePreviewClose"
48
+ >
49
+ <file-preview :path="previewPath" />
50
+ </a-modal>
51
+ </div>
52
+ </template>
53
+
54
+ <script>
55
+ import FilePreview from '@vue2-client/components/FilePreview'
56
+
57
+ export default {
58
+ name: 'FileImageItem',
59
+ components: {
60
+ FilePreview
61
+ },
62
+ props: {
63
+ files: {
64
+ type: Array,
65
+ required: true
66
+ },
67
+ downloadable: {
68
+ type: Boolean,
69
+ required: false,
70
+ default: true
71
+ }
72
+ },
73
+ data () {
74
+ return {
75
+ previewVisible: false,
76
+ previewPath: ''
77
+ }
78
+ },
79
+ methods: {
80
+ handlePreview (path) {
81
+ this.previewPath = path
82
+ this.previewVisible = true
83
+ },
84
+ handlePreviewClose () {
85
+ this.previewVisible = false
86
+ this.previewPath = ''
87
+ },
88
+ download (file) {
89
+ const a = document.createElement('a')
90
+ a.href = file.url
91
+ a.download = file.name
92
+ a.click()
93
+ },
94
+ formatFileSize (size) {
95
+ if (!size) return ''
96
+ // 如果小于1M,转换为KB显示
97
+ if (size < 1) {
98
+ const kbSize = size * 1024
99
+ return `${kbSize.toFixed(1)} KB`
100
+ }
101
+ // 大于等于1M,保持M为单位
102
+ return `${size.toFixed(1)} MB`
103
+ },
104
+ getFileType (filename) {
105
+ const ext = filename.split('.').pop().toLowerCase()
106
+ const typeMap = {
107
+ pdf: 'PDF文档',
108
+ doc: 'Word文档',
109
+ docx: 'Word文档',
110
+ xls: 'Excel表格',
111
+ xlsx: 'Excel表格',
112
+ ppt: 'PPT演示',
113
+ pptx: 'PPT演示',
114
+ jpg: '图片',
115
+ jpeg: '图片',
116
+ png: '图片',
117
+ gif: '图片',
118
+ txt: '文本文件',
119
+ zip: '压缩文件',
120
+ rar: '压缩文件'
121
+ }
122
+ return typeMap[ext] || '文件'
123
+ },
124
+ getFileIcon (filename) {
125
+ const ext = filename.split('.').pop().toLowerCase()
126
+ const iconMap = {
127
+ pdf: 'file-pdf',
128
+ doc: 'file-word',
129
+ docx: 'file-word',
130
+ xls: 'file-excel',
131
+ xlsx: 'file-excel',
132
+ ppt: 'file-ppt',
133
+ pptx: 'file-ppt',
134
+ jpg: 'file-image',
135
+ jpeg: 'file-image',
136
+ png: 'file-image',
137
+ gif: 'file-image',
138
+ txt: 'file-text',
139
+ zip: 'file-zip',
140
+ rar: 'file-zip'
141
+ }
142
+ return iconMap[ext] || 'file'
143
+ },
144
+ getFileTypeClass (filename) {
145
+ const ext = filename.split('.').pop().toLowerCase()
146
+ return `file-type-${ext}`
147
+ },
148
+ isImageType (filename) {
149
+ const ext = filename.split('.').pop().toLowerCase()
150
+ return ['jpg', 'jpeg', 'png', 'gif'].includes(ext)
151
+ }
152
+ }
153
+ }
154
+ </script>
155
+
156
+ <style lang="less" scoped>
157
+ .file-list {
158
+ .file-grid {
159
+ display: grid;
160
+ grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
161
+ gap: 16px;
162
+ }
163
+
164
+ .file-item {
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: space-between;
168
+ padding: 16px;
169
+ background: #fff;
170
+ border-radius: 12px;
171
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
172
+ border: 1px solid rgba(0, 0, 0, 0.06);
173
+
174
+ &:hover {
175
+ transform: translateY(-2px);
176
+ border-color: @primary-2;
177
+ background: rgba(24, 144, 255, 0.02);
178
+ }
179
+
180
+ .file-info {
181
+ display: flex;
182
+ align-items: center;
183
+ flex: 1;
184
+ min-width: 0;
185
+
186
+ .file-icon-wrapper {
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: center;
190
+ width: 48px;
191
+ height: 48px;
192
+ margin-right: 16px;
193
+ border-radius: 12px;
194
+ transition: all 0.3s;
195
+
196
+ &.file-type-pdf {
197
+ background: linear-gradient(135deg, #ff4d4f, #ff7875);
198
+ }
199
+ &.file-type-doc, &.file-type-docx {
200
+ background: linear-gradient(135deg, #1890ff, #69c0ff);
201
+ }
202
+ &.file-type-xls, &.file-type-xlsx {
203
+ background: linear-gradient(135deg, #52c41a, #95de64);
204
+ }
205
+ &.file-type-ppt, &.file-type-pptx {
206
+ background: linear-gradient(135deg, #fa8c16, #ffc069);
207
+ }
208
+ &.file-type-jpg, &.file-type-jpeg, &.file-type-png, &.file-type-gif {
209
+ background: linear-gradient(135deg, #722ed1, #b37feb);
210
+ }
211
+ &.file-type-txt {
212
+ background: linear-gradient(135deg, #13c2c2, #5cdbd3);
213
+ }
214
+ &.file-type-zip, &.file-type-rar {
215
+ background: linear-gradient(135deg, #eb2f96, #ff85c0);
216
+ }
217
+
218
+ .file-icon {
219
+ font-size: 24px;
220
+ color: #fff;
221
+ }
222
+ .file-thumb {
223
+ width: 40px;
224
+ height: 40px;
225
+ object-fit: cover;
226
+ border-radius: 8px;
227
+ box-shadow: 0 1px 4px rgba(0,0,0,0.08);
228
+ }
229
+ }
230
+
231
+ .file-content {
232
+ display: flex;
233
+ flex-direction: column;
234
+ min-width: 0;
235
+ flex: 1;
236
+
237
+ .file-header {
238
+ display: flex;
239
+ align-items: center;
240
+ margin-bottom: 4px;
241
+
242
+ .file-name {
243
+ color: rgba(0, 0, 0, 0.85);
244
+ font-size: 15px;
245
+ font-weight: 500;
246
+ overflow: hidden;
247
+ text-overflow: ellipsis;
248
+ white-space: nowrap;
249
+ margin-right: 8px;
250
+ width: 0;
251
+ flex: 1;
252
+ }
253
+
254
+ .file-type {
255
+ color: rgba(0, 0, 0, 0.45);
256
+ font-size: 12px;
257
+ padding: 2px 6px;
258
+ background: rgba(0, 0, 0, 0.04);
259
+ border-radius: 4px;
260
+ }
261
+ }
262
+
263
+ .file-footer {
264
+ display: flex;
265
+ align-items: center;
266
+ color: rgba(0, 0, 0, 0.45);
267
+ font-size: 12px;
268
+
269
+ .file-size {
270
+ margin-right: 12px;
271
+ }
272
+
273
+ .file-time {
274
+ position: relative;
275
+ padding-left: 12px;
276
+
277
+ &::before {
278
+ content: '';
279
+ position: absolute;
280
+ left: 0;
281
+ top: 50%;
282
+ transform: translateY(-50%);
283
+ width: 4px;
284
+ height: 4px;
285
+ background: rgba(0, 0, 0, 0.25);
286
+ border-radius: 50%;
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
292
+
293
+ .file-actions {
294
+ display: flex;
295
+ align-items: center;
296
+ margin-left: 16px;
297
+
298
+ .action-btn {
299
+ width: 36px;
300
+ height: 36px;
301
+ padding: 0;
302
+ margin-left: 8px;
303
+ border-radius: 8px;
304
+ color: rgba(0, 0, 0, 0.45);
305
+ background: transparent;
306
+ transition: all 0.3s;
307
+
308
+ &:hover {
309
+ color: #fff;
310
+ background: @primary-color;
311
+ transform: scale(1.05);
312
+ }
313
+
314
+ .anticon {
315
+ font-size: 16px;
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ </style>