agilebuilder-ui 1.0.18 → 1.0.19-beta2
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.
- package/.eslintrc.cjs +28 -0
- package/.prettierrc.json +12 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +7050 -6479
- package/lib/super-ui.umd.cjs +55 -55
- package/package.json +1 -1
- package/packages/fs-preview/src/fs-preview.vue +50 -78
- package/packages/fs-upload-list/src/fs-upload-list.vue +334 -375
- package/packages/fs-upload-new/index.ts +6 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +129 -0
- package/packages/fs-upload-new/src/fs-drag-upload.vue +132 -0
- package/packages/fs-upload-new/src/fs-preview-new.vue +199 -0
- package/packages/fs-upload-new/src/fs-upload-new.vue +149 -0
- package/packages/index.js +5 -2
- package/packages/super-grid/src/apis.js +11 -11
- package/packages/super-grid/src/super-grid.vue +4 -4
|
@@ -1,392 +1,351 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@click="openAnnexUpload"
|
|
17
|
-
/>
|
|
18
|
-
<el-button :icon="ElIconZoomIn" size="default" @click="preview"/>
|
|
19
|
-
</template>
|
|
20
|
-
</el-input>
|
|
2
|
+
<div>
|
|
3
|
+
<template v-if="!disabled">
|
|
4
|
+
<el-input
|
|
5
|
+
ref="item"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:model-value="value"
|
|
8
|
+
:placeholder="$t('imatrixUIMessage.fileUpload')"
|
|
9
|
+
:readonly="true"
|
|
10
|
+
>
|
|
11
|
+
<template v-slot:append>
|
|
12
|
+
<el-button v-if="!disabled" :icon="ElIconUpload2" size="default" @click="openAnnexUpload" />
|
|
13
|
+
<el-button :icon="ElIconZoomIn" size="default" @click="preview" />
|
|
14
|
+
</template>
|
|
15
|
+
</el-input>
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
17
|
+
<el-dialog
|
|
18
|
+
v-model="annexUploadFlag"
|
|
19
|
+
:append-to-body="true"
|
|
20
|
+
:show-close="true"
|
|
21
|
+
:title="$t('imatrixUIMessage.tips')"
|
|
22
|
+
width="30%"
|
|
23
|
+
>
|
|
24
|
+
<el-upload
|
|
25
|
+
v-if="annexUploadFlag"
|
|
26
|
+
:accept="fileSetObj.accept ? fileSetObj.accept : null"
|
|
27
|
+
:action="defaultAction"
|
|
28
|
+
:before-upload="handleBeforeUpload"
|
|
29
|
+
:headers="headers"
|
|
30
|
+
:on-success="uploadOnSuccess"
|
|
31
|
+
:with-credentials="true"
|
|
32
|
+
name="file"
|
|
33
|
+
>
|
|
34
|
+
<el-button>{{ $t('imatrixUIMessage.upload') }}</el-button>
|
|
35
|
+
</el-upload>
|
|
36
|
+
</el-dialog>
|
|
37
|
+
<el-dialog
|
|
38
|
+
v-model="showPreviewSingleImage"
|
|
39
|
+
:append-to-body="true"
|
|
40
|
+
:show-close="true"
|
|
41
|
+
:title="$t('imatrixUIPublicModel.previewImage')"
|
|
42
|
+
@close="$emit('close')"
|
|
43
|
+
>
|
|
44
|
+
<template v-slot:title>
|
|
50
45
|
<span
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
>{{ $t('imatrixUIPublicModel.previewImage') }}
|
|
47
|
+
<!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
|
|
48
|
+
<!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
|
|
54
49
|
</span>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
</template>
|
|
51
|
+
<el-image
|
|
52
|
+
v-if="previewImageInfo && previewImageInfo.isImg"
|
|
53
|
+
:preview-src-list="[previewImageInfo.src]"
|
|
54
|
+
:src="previewImageInfo.src"
|
|
55
|
+
/>
|
|
56
|
+
</el-dialog>
|
|
57
|
+
<el-dialog
|
|
58
|
+
v-model="showPreviewMulti"
|
|
59
|
+
:append-to-body="true"
|
|
60
|
+
:show-close="true"
|
|
61
|
+
:title="$t('imatrixUIPublicModel.preview')"
|
|
62
|
+
width="30%"
|
|
63
|
+
@close="$emit('close')"
|
|
64
|
+
>
|
|
65
|
+
<template v-slot:title>
|
|
71
66
|
<span
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
>{{ $t('imatrixUIPublicModel.preview') }}
|
|
68
|
+
<!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
|
|
69
|
+
<!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
|
|
75
70
|
</span>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
</el-tooltip>
|
|
105
|
-
</template>
|
|
106
|
-
</el-table-column>
|
|
107
|
-
</el-table>
|
|
108
|
-
</el-dialog>
|
|
109
|
-
</template>
|
|
110
|
-
<template v-else>
|
|
111
|
-
<fs-preview
|
|
112
|
-
:entity="row"
|
|
113
|
-
:file-set-obj="fileSetObj"
|
|
114
|
-
:is-sql="isSql"
|
|
115
|
-
:label="value"
|
|
116
|
-
/>
|
|
117
|
-
</template>
|
|
118
|
-
</div>
|
|
71
|
+
</template>
|
|
72
|
+
<el-table :data="showFileList" :show-header="false">
|
|
73
|
+
<el-table-column prop="showName" width="300" />
|
|
74
|
+
<el-table-column align="right">
|
|
75
|
+
<template v-slot="scope">
|
|
76
|
+
<el-tooltip :content="$t('imatrixUIPublicModel.preview')" class="item" effect="dark" placement="top">
|
|
77
|
+
<el-icon style="cursor: pointer" @click="previewSingle(scope.row)">
|
|
78
|
+
<el-icon-view />
|
|
79
|
+
</el-icon>
|
|
80
|
+
</el-tooltip>
|
|
81
|
+
</template>
|
|
82
|
+
</el-table-column>
|
|
83
|
+
<el-table-column v-if="!disabled">
|
|
84
|
+
<template v-slot="scope">
|
|
85
|
+
<el-tooltip :content="$t('imatrixUIPublicModel.delete')" class="item" effect="dark" placement="top">
|
|
86
|
+
<el-icon style="cursor: pointer" @click="deleteRow(scope.$index)">
|
|
87
|
+
<el-icon-delete />
|
|
88
|
+
</el-icon>
|
|
89
|
+
</el-tooltip>
|
|
90
|
+
</template>
|
|
91
|
+
</el-table-column>
|
|
92
|
+
</el-table>
|
|
93
|
+
</el-dialog>
|
|
94
|
+
</template>
|
|
95
|
+
<template v-else>
|
|
96
|
+
<fs-preview :entity="row" :file-set-obj="fileSetObj" :is-sql="isSql" :label="value" />
|
|
97
|
+
</template>
|
|
98
|
+
</div>
|
|
119
99
|
</template>
|
|
120
100
|
|
|
121
101
|
<script>
|
|
122
102
|
import {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
103
|
+
Delete as ElIconDelete,
|
|
104
|
+
Upload as ElIconUpload2,
|
|
105
|
+
View as ElIconView,
|
|
106
|
+
ZoomIn as ElIconZoomIn
|
|
127
107
|
} from '@element-plus/icons-vue'
|
|
128
|
-
import {$emit} from '../../utils/gogocodeTransfer'
|
|
108
|
+
import { $emit } from '../../utils/gogocodeTransfer'
|
|
129
109
|
|
|
130
|
-
import {getToken} from '../../../src/utils/auth'
|
|
131
|
-
import {isImage} from '../../../src/utils/util'
|
|
132
|
-
import {getSystemFrontendUrl, isPlateSys
|
|
110
|
+
import { getToken } from '../../../src/utils/auth'
|
|
111
|
+
import { isImage } from '../../../src/utils/util'
|
|
112
|
+
import { getSystemFrontendUrl, isPlateSys } from '../../../src/utils/common-util'
|
|
133
113
|
import FsPreview from '../../fs-preview/src/fs-preview.vue'
|
|
134
|
-
import {packageFile} from '../../super-grid/src/utils'
|
|
114
|
+
import { packageFile } from '../../super-grid/src/utils'
|
|
135
115
|
|
|
136
116
|
export default {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
$emit(this, 'delete', [], index)
|
|
371
|
-
} else {
|
|
372
|
-
this.fileInfo.showName = nameArr.join(',')
|
|
373
|
-
this.fileInfo.serverPath = pathArr.join(',')
|
|
374
|
-
$emit(this, 'delete-success', {
|
|
375
|
-
deleteFile: deleteFile,
|
|
376
|
-
all: this.showFileList,
|
|
377
|
-
})
|
|
378
|
-
$emit(this, 'delete', this.showFileList, index)
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
emits: [
|
|
383
|
-
'close',
|
|
384
|
-
'upload-success',
|
|
385
|
-
'delete-success',
|
|
386
|
-
'delete',
|
|
387
|
-
'update:value',
|
|
388
|
-
'close',
|
|
389
|
-
'update:value',
|
|
390
|
-
],
|
|
117
|
+
data() {
|
|
118
|
+
const headers = { Authorization: getToken() }
|
|
119
|
+
let defaultAction = window.$vueApp.config.globalProperties.baseURL + '/common/fs-upload'
|
|
120
|
+
if (isPlateSys(window.$vueApp.config.globalProperties.systemCode)) {
|
|
121
|
+
defaultAction = window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/uploads'
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
deleteUuids: [],
|
|
125
|
+
headers,
|
|
126
|
+
defaultAction,
|
|
127
|
+
annexUploadFlag: false,
|
|
128
|
+
showPreviewSingleImage: false,
|
|
129
|
+
showPreviewMulti: false,
|
|
130
|
+
lastFileName: null,
|
|
131
|
+
previewImageInfo: {},
|
|
132
|
+
showFileList: this.fileList,
|
|
133
|
+
ElIconUpload2,
|
|
134
|
+
ElIconZoomIn
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
components: {
|
|
138
|
+
FsPreview,
|
|
139
|
+
ElIconView,
|
|
140
|
+
ElIconDelete
|
|
141
|
+
},
|
|
142
|
+
name: 'FsUploadList',
|
|
143
|
+
props: {
|
|
144
|
+
value: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: null
|
|
147
|
+
},
|
|
148
|
+
// name ','分隔的名称 和serverPath
|
|
149
|
+
fileInfo: {
|
|
150
|
+
type: Object,
|
|
151
|
+
default: () => {
|
|
152
|
+
return {
|
|
153
|
+
name: null,
|
|
154
|
+
serverPath: null
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
fileSetObj: {
|
|
159
|
+
type: Object,
|
|
160
|
+
default: () => {
|
|
161
|
+
return { limitFileSize: 30, multiple: false, accept: null }
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
customViewUrl: {
|
|
165
|
+
type: Boolean,
|
|
166
|
+
default: false
|
|
167
|
+
},
|
|
168
|
+
disabled: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
default: false
|
|
171
|
+
},
|
|
172
|
+
uploadAble: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: true
|
|
175
|
+
},
|
|
176
|
+
deletaAble: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: true
|
|
179
|
+
},
|
|
180
|
+
// 文件详细消息
|
|
181
|
+
fileList: {
|
|
182
|
+
type: Array,
|
|
183
|
+
default: () => {
|
|
184
|
+
return []
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
row: {
|
|
188
|
+
type: Object,
|
|
189
|
+
default: () => {
|
|
190
|
+
return {}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
isSql: {
|
|
194
|
+
type: Boolean,
|
|
195
|
+
default: false
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
created() {},
|
|
199
|
+
mounted() {},
|
|
200
|
+
methods: {
|
|
201
|
+
openAnnexUpload() {
|
|
202
|
+
this.annexUploadFlag = true
|
|
203
|
+
},
|
|
204
|
+
handleBeforeUpload(file) {
|
|
205
|
+
let limitFileSize = this.fileSetObj.limitFileSize
|
|
206
|
+
if (limitFileSize === undefined) {
|
|
207
|
+
// 默认是30M
|
|
208
|
+
limitFileSize = 30
|
|
209
|
+
}
|
|
210
|
+
if (file.size > limitFileSize * 1024 * 1024) {
|
|
211
|
+
// 超过最大限制
|
|
212
|
+
this.$message({
|
|
213
|
+
type: 'warning',
|
|
214
|
+
message: this.$t('imatrixUIMessage.exceedFileSize', {
|
|
215
|
+
fileSize: limitFileSize
|
|
216
|
+
}),
|
|
217
|
+
showClose: true
|
|
218
|
+
})
|
|
219
|
+
// 返回false停止上传
|
|
220
|
+
return false
|
|
221
|
+
}
|
|
222
|
+
const beforeUpload = this.fileSetObj.beforeUpload
|
|
223
|
+
if (beforeUpload) {
|
|
224
|
+
const result = beforeUpload.call(this, {
|
|
225
|
+
pageContext: this.fileSetObj.pageContext,
|
|
226
|
+
configureObj: this.fileSetObj.configureObj,
|
|
227
|
+
file: file
|
|
228
|
+
})
|
|
229
|
+
if (result !== undefined && result !== null && result !== true) {
|
|
230
|
+
return false
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
// 上传成功
|
|
235
|
+
uploadOnSuccess(response, file) {
|
|
236
|
+
if (response) {
|
|
237
|
+
$emit(this, 'upload-success', {
|
|
238
|
+
showName: response.name,
|
|
239
|
+
serverPath: response.serverPath
|
|
240
|
+
})
|
|
241
|
+
if (this.fileSetObj.multiple) {
|
|
242
|
+
if (this.fileInfo.showName) {
|
|
243
|
+
this.fileInfo.showName = this.fileInfo.showName + ',' + response.name
|
|
244
|
+
this.fileInfo.serverPath = this.fileInfo.serverPath + ',' + response.serverPath
|
|
245
|
+
} else {
|
|
246
|
+
this.fileInfo.showName = response.name
|
|
247
|
+
this.fileInfo.serverPath = response.serverPath
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
this.fileInfo.showName = response.name
|
|
251
|
+
this.fileInfo.serverPath = response.serverPath
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
this.annexUploadFlag = false
|
|
255
|
+
},
|
|
256
|
+
preview() {
|
|
257
|
+
this.fileList.length = 0
|
|
258
|
+
const uuids = this.fileInfo.serverPath.split(',')
|
|
259
|
+
this.$http
|
|
260
|
+
.post(window.$vueApp.config.globalProperties.baseURL + '/common/fs-upload/search-file-names', uuids)
|
|
261
|
+
.then((result) => {
|
|
262
|
+
uuids.forEach((uuid) => {
|
|
263
|
+
this.fileList.push({ showName: result[uuid], serverPath: uuid })
|
|
264
|
+
})
|
|
265
|
+
this.showFileList = this.fileList
|
|
266
|
+
this.showPreviewMulti = true
|
|
267
|
+
})
|
|
268
|
+
},
|
|
269
|
+
previewSingle(fileInfo) {
|
|
270
|
+
fileInfo = packageFile(fileInfo.showName, fileInfo.serverPath)
|
|
271
|
+
if (isImage(fileInfo.showName)) {
|
|
272
|
+
this.previewImageInfo = fileInfo
|
|
273
|
+
this.showPreviewSingleImage = true
|
|
274
|
+
} else {
|
|
275
|
+
this.previewDoc(fileInfo)
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
previewDoc(file) {
|
|
279
|
+
const showName = file.showName.replace('#', '~~').replace('?', '~$').replace('&', '$')
|
|
280
|
+
const token = getToken()
|
|
281
|
+
if (window.$vueApp.config.globalProperties.customPreviewUrl) {
|
|
282
|
+
window.open(
|
|
283
|
+
getSystemFrontendUrl(window.$vueApp.config.globalProperties.portalUrl) +
|
|
284
|
+
'/#/file-service/preview?serverPath=' +
|
|
285
|
+
file.serverPath +
|
|
286
|
+
'&showName=' +
|
|
287
|
+
encodeURI(showName),
|
|
288
|
+
file.showName
|
|
289
|
+
)
|
|
290
|
+
} else {
|
|
291
|
+
let previewUrl
|
|
292
|
+
const myShowName = showName
|
|
293
|
+
const uuid = file.serverPath
|
|
294
|
+
let baseUrl = window.$vueApp.config.globalProperties.baseURL
|
|
295
|
+
if (isPlateSys(window.$vueApp.config.globalProperties.systemCode)) {
|
|
296
|
+
baseUrl = window.$vueApp.config.globalProperties.baseAPI
|
|
297
|
+
}
|
|
298
|
+
if (window.$vueApp.config.globalProperties.kkFileViewUrl) {
|
|
299
|
+
const originUrl =
|
|
300
|
+
baseUrl +
|
|
301
|
+
'/common/super-form/downloads?jwt=' +
|
|
302
|
+
token +
|
|
303
|
+
'&showName=' +
|
|
304
|
+
encodeURI(myShowName) +
|
|
305
|
+
'&serverPath=' +
|
|
306
|
+
uuid
|
|
307
|
+
//要预览文件的访问地址
|
|
308
|
+
const myPreviewUrl = originUrl + '&fullfilename=' + myShowName
|
|
309
|
+
// http://127.0.0.1:8012/onlinePreview
|
|
310
|
+
previewUrl =
|
|
311
|
+
window.$vueApp.config.globalProperties.kkFileViewUrl +
|
|
312
|
+
'?url=' +
|
|
313
|
+
encodeURIComponent(Base64.encode(myPreviewUrl))
|
|
314
|
+
} else {
|
|
315
|
+
previewUrl = baseUrl + '/common/fs-upload/preview?jwt=' + token
|
|
316
|
+
previewUrl = previewUrl + '&showName=' + encodeURI(myShowName) + '&serverPath=' + uuid
|
|
317
|
+
}
|
|
318
|
+
window.open(previewUrl, myShowName)
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
deleteRow(index) {
|
|
322
|
+
const deleteFile = this.showFileList[index]
|
|
323
|
+
// this.fileList.splice(index, 1)
|
|
324
|
+
const nameArr = []
|
|
325
|
+
const pathArr = []
|
|
326
|
+
for (let i = 0; i < this.showFileList.length; i++) {
|
|
327
|
+
if (i !== index) {
|
|
328
|
+
nameArr.push(this.showFileList[i].showName)
|
|
329
|
+
pathArr.push(this.showFileList[i].serverPath)
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (nameArr.length === 0) {
|
|
333
|
+
this.fileInfo.showName = null
|
|
334
|
+
this.fileInfo.serverPath = null
|
|
335
|
+
this.showFileList = []
|
|
336
|
+
$emit(this, 'delete-success', { deleteFile: deleteFile, all: [] })
|
|
337
|
+
$emit(this, 'delete', [], index)
|
|
338
|
+
} else {
|
|
339
|
+
this.fileInfo.showName = nameArr.join(',')
|
|
340
|
+
this.fileInfo.serverPath = pathArr.join(',')
|
|
341
|
+
$emit(this, 'delete-success', {
|
|
342
|
+
deleteFile: deleteFile,
|
|
343
|
+
all: this.showFileList
|
|
344
|
+
})
|
|
345
|
+
$emit(this, 'delete', this.showFileList, index)
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
emits: ['close', 'upload-success', 'delete-success', 'delete', 'update:value', 'close', 'update:value']
|
|
391
350
|
}
|
|
392
351
|
</script>
|