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