agilebuilder-ui 1.1.32 → 1.1.33-sit2
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/lib/{401-572d1150.js → 401-7b6f6bb7.js} +1 -1
- package/lib/{404-442a62d4.js → 404-427a0b5a.js} +1 -1
- package/lib/{iframe-page-1b622fa5.js → iframe-page-89815912.js} +1 -1
- package/lib/index-e2f27581.js +73223 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +94 -94
- package/lib/{tab-content-iframe-index-285c8311.js → tab-content-iframe-index-2619cf03.js} +1 -1
- package/lib/{tab-content-index-ddb9e911.js → tab-content-index-391b0efb.js} +1 -1
- package/lib/{tache-subprocess-history-81e8e4f4.js → tache-subprocess-history-2097ae7f.js} +1 -1
- package/package.json +1 -1
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +5 -1
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +343 -368
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +193 -101
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +74 -62
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +1 -1
- package/packages/organization-input/src/organization-input.vue +11 -0
- package/packages/super-grid/src/dynamic-input.vue +11 -1
- package/packages/super-grid/src/formatter.js +55 -56
- package/packages/super-grid/src/normal-column-content.vue +125 -55
- package/packages/super-grid/src/row-operation.vue +35 -18
- package/packages/super-grid/src/super-grid.vue +135 -97
- package/packages/super-icon/src/index.vue +1 -0
- package/src/i18n/langs/cn.js +2 -1
- package/src/i18n/langs/en.js +2 -1
- package/src/styles/display-layout.scss +1 -1
- package/src/styles/index.scss +7 -1
- package/src/utils/auth-api.js +4 -0
- package/src/utils/common-util.js +3 -0
- package/src/utils/dingtalk-util.ts +37 -0
- package/lib/index-0ffdab4a.js +0 -72771
|
@@ -15,66 +15,44 @@
|
|
|
15
15
|
@chooseFile="pickBrowserFiles"
|
|
16
16
|
@remove="removeFile"
|
|
17
17
|
/>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<template
|
|
19
|
+
v-if="openCameraOrChoosePhoto === 'openChoosePhoto' || openCameraOrChoosePhoto === 'openCameraAndChoosePhoto'"
|
|
20
|
+
>
|
|
21
21
|
<input
|
|
22
|
-
v-if="multiple && !disabled"
|
|
23
22
|
ref="fileRef"
|
|
24
23
|
type="file"
|
|
25
|
-
multiple="
|
|
26
|
-
:capture="'environment'"
|
|
24
|
+
:multiple="multipleUpload"
|
|
27
25
|
name="file"
|
|
28
26
|
:accept="myAccept"
|
|
29
27
|
style="display: none"
|
|
30
28
|
@change="uploadFiles"
|
|
31
29
|
/>
|
|
32
|
-
|
|
33
|
-
v-else-if="!disabled"
|
|
34
|
-
ref="fileRef"
|
|
35
|
-
type="file"
|
|
36
|
-
:capture="'environment'"
|
|
37
|
-
name="file"
|
|
38
|
-
style="display: none"
|
|
39
|
-
:accept="myAccept"
|
|
40
|
-
@change="uploadFiles"
|
|
41
|
-
/>
|
|
42
|
-
<!-- </template>
|
|
30
|
+
</template>
|
|
43
31
|
<template v-else>
|
|
32
|
+
<!-- 由于直接打开capture相机属性的设置为空或者不是user/environment其中的任意一项时会打开的本地捕获音频 麦克风-->
|
|
33
|
+
<!-- 所有使用 template 可查看 https://w3c.github.io/html-media-capture/#introduction -->
|
|
44
34
|
<input
|
|
45
|
-
v-if="multiple && !disabled"
|
|
46
35
|
ref="fileRef"
|
|
47
36
|
type="file"
|
|
48
|
-
multiple="
|
|
37
|
+
:multiple="multipleUpload"
|
|
38
|
+
capture="environment"
|
|
49
39
|
name="file"
|
|
50
40
|
:accept="myAccept"
|
|
51
41
|
style="display: none"
|
|
52
42
|
@change="uploadFiles"
|
|
53
43
|
/>
|
|
54
|
-
|
|
55
|
-
v-else-if="!disabled"
|
|
56
|
-
ref="fileRef"
|
|
57
|
-
type="file"
|
|
58
|
-
name="file"
|
|
59
|
-
style="display: none"
|
|
60
|
-
:accept="myAccept"
|
|
61
|
-
@change="uploadFiles"
|
|
62
|
-
/>
|
|
63
|
-
</template> -->
|
|
44
|
+
</template>
|
|
64
45
|
<el-drawer v-model="fileTypeFlag" direction="btt" @close="fileTypeFlag = false">
|
|
65
|
-
<div><el-button
|
|
66
|
-
link
|
|
67
|
-
@click="confirmFileType('image')"
|
|
68
|
-
>
|
|
69
|
-
{{ $t('fsUpload.image') }}
|
|
70
|
-
</el-button></div>
|
|
71
46
|
<div>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
>
|
|
76
|
-
|
|
77
|
-
|
|
47
|
+
<el-button link @click="confirmFileType('image')">
|
|
48
|
+
{{ $t('fsUpload.image') }}
|
|
49
|
+
</el-button>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<el-button link @click="confirmFileType('video')">
|
|
53
|
+
{{ $t('fsUpload.video') }}
|
|
54
|
+
</el-button>
|
|
55
|
+
</div>
|
|
78
56
|
</el-drawer>
|
|
79
57
|
</div>
|
|
80
58
|
</template>
|
|
@@ -87,6 +65,7 @@ import Compressor from 'compressorjs'
|
|
|
87
65
|
import { ElMessage } from 'element-plus'
|
|
88
66
|
import { useI18n } from 'vue-i18n'
|
|
89
67
|
import FileUploadComponent from './file-upload-component.vue'
|
|
68
|
+
import { isRef } from 'vue'
|
|
90
69
|
|
|
91
70
|
const props = defineProps({
|
|
92
71
|
openFsUpload: {
|
|
@@ -204,6 +183,18 @@ const props = defineProps({
|
|
|
204
183
|
}
|
|
205
184
|
})
|
|
206
185
|
|
|
186
|
+
const multipleUpload = ref<string | null>(null)
|
|
187
|
+
if (props.multiple) {
|
|
188
|
+
multipleUpload.value = 'multiple'
|
|
189
|
+
}
|
|
190
|
+
const isDingTalk = ref(false)
|
|
191
|
+
const authSource = window.localStorage.getItem('auth_source')
|
|
192
|
+
|
|
193
|
+
if (authSource && authSource === 'dingtalk' && window.$dd) {
|
|
194
|
+
// 如果是钉钉环境 并且已经加载了钉钉jsapi
|
|
195
|
+
isDingTalk.value = true
|
|
196
|
+
}
|
|
197
|
+
|
|
207
198
|
const fileListResult = ref(props.fileList)
|
|
208
199
|
|
|
209
200
|
let baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
@@ -230,11 +221,11 @@ if (props.action) {
|
|
|
230
221
|
|
|
231
222
|
defaultAction.value = getReplaceUrlDomain(defaultAction.value)
|
|
232
223
|
|
|
233
|
-
let myAccept = ref(props.accept ? props.accept : '')
|
|
224
|
+
let myAccept = ref(props.accept ? props.accept : 'image/*')
|
|
234
225
|
let tempFileList = ref([])
|
|
235
226
|
let isUploading = ref(false)
|
|
236
227
|
let isFile = ref(false)
|
|
237
|
-
const fileRef = ref(
|
|
228
|
+
const fileRef = ref()
|
|
238
229
|
const fileTypeFlag = ref(false)
|
|
239
230
|
const emits = defineEmits(['remove', 'uploadend'])
|
|
240
231
|
const { t } = useI18n()
|
|
@@ -256,17 +247,21 @@ function isImg(file) {
|
|
|
256
247
|
function removeFile(param) {
|
|
257
248
|
console.log('removeFile----param=', param)
|
|
258
249
|
const file = param.file
|
|
259
|
-
if(file){
|
|
250
|
+
if (file) {
|
|
260
251
|
emits('remove', { rmFiles: [file], serverFiles: fileListResult.value, index: param.index })
|
|
261
252
|
}
|
|
262
253
|
}
|
|
263
254
|
function pickBrowserFiles() {
|
|
264
255
|
// if (props.openCameraOrChoosePhoto && props.openCameraOrChoosePhoto === 'openCamera') {
|
|
265
|
-
|
|
266
|
-
|
|
256
|
+
// 只打开相机
|
|
257
|
+
myAccept.value = 'image/*'
|
|
258
|
+
if (isDingTalk.value) {
|
|
259
|
+
dingtalkChooseImage()
|
|
260
|
+
} else {
|
|
267
261
|
setTimeout(() => {
|
|
268
262
|
fileRef.value.click()
|
|
269
263
|
})
|
|
264
|
+
}
|
|
270
265
|
// } else {
|
|
271
266
|
// // 相机和文件都可以选
|
|
272
267
|
// myAccept.value = '*'
|
|
@@ -299,7 +294,7 @@ async function uploadBrowserFile() {
|
|
|
299
294
|
limitFileSize = 30
|
|
300
295
|
}
|
|
301
296
|
let isCanUpload = false
|
|
302
|
-
|
|
297
|
+
const files = fileRef.value.files
|
|
303
298
|
for (let i = 0; i < files.length; i++) {
|
|
304
299
|
const newFile = files[i]
|
|
305
300
|
isCanUpload = validateCanUploadFile(newFile, limitFileSize)
|
|
@@ -309,18 +304,24 @@ async function uploadBrowserFile() {
|
|
|
309
304
|
break
|
|
310
305
|
}
|
|
311
306
|
}
|
|
312
|
-
|
|
307
|
+
console.error('isCanUpload=', isCanUpload)
|
|
313
308
|
if (isCanUpload) {
|
|
314
309
|
for (let i = 0; i < files.length; i++) {
|
|
315
310
|
const fileObj = files[i]
|
|
316
|
-
|
|
311
|
+
console.error('fileObj.name=', fileObj.name, 'fileNames=', fileNames)
|
|
317
312
|
if (fileNames.indexOf(fileObj.name) >= 0) {
|
|
318
313
|
selectFiles.push(fileObj)
|
|
319
314
|
}
|
|
320
315
|
if (props.beforeUpload && typeof props.beforeUpload === 'function') {
|
|
321
316
|
const isMobile = true
|
|
322
317
|
// eslint-disable-next-line no-useless-call
|
|
323
|
-
isCanUpload = props.beforeUpload({
|
|
318
|
+
isCanUpload = props.beforeUpload({
|
|
319
|
+
fileObj,
|
|
320
|
+
files: selectFiles,
|
|
321
|
+
isMobile,
|
|
322
|
+
pageContext: props.pageContext,
|
|
323
|
+
configureObj: props.configure
|
|
324
|
+
})
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
327
|
}
|
|
@@ -332,7 +333,7 @@ async function uploadBrowserFile() {
|
|
|
332
333
|
console.error('未选择任何文件')
|
|
333
334
|
return
|
|
334
335
|
}
|
|
335
|
-
let uploadFiles = []
|
|
336
|
+
let uploadFiles: File[] = []
|
|
336
337
|
try {
|
|
337
338
|
uploadFiles = await compressionImg(selectFiles)
|
|
338
339
|
} catch (error) {
|
|
@@ -351,44 +352,17 @@ async function uploadBrowserFile() {
|
|
|
351
352
|
} else {
|
|
352
353
|
param.append('file', uploadFiles[0])
|
|
353
354
|
}
|
|
354
|
-
param
|
|
355
|
-
|
|
356
|
-
console.log('上传文件111-----defaultAction.value=',defaultAction.value, 'param=', param, 'uploadFiles=', uploadFiles)
|
|
357
|
-
window.$vueApp.config.globalProperties.$http
|
|
358
|
-
.post(defaultAction.value, param, { headers: { 'Content-Type': 'multipart/form-data', Authorization: getToken() } })
|
|
359
|
-
.then((result) => {
|
|
360
|
-
// result:批量上传时返回的是集合,单选上传时返回的是对象
|
|
361
|
-
console.log('上传后返回值==result=', result)
|
|
362
|
-
if (result) {
|
|
363
|
-
if (props.multiple) {
|
|
364
|
-
if (result.length > 0) {
|
|
365
|
-
// this.tempFileList.push(...result)
|
|
366
|
-
uploadComplete(result)
|
|
367
|
-
} else {
|
|
368
|
-
console.error('多选时上传后返回值异常')
|
|
369
|
-
}
|
|
370
|
-
} else {
|
|
371
|
-
// this.tempFileList.push(result)
|
|
372
|
-
uploadComplete(result)
|
|
373
|
-
}
|
|
374
|
-
} else {
|
|
375
|
-
console.error('上传后返回值异常')
|
|
376
|
-
}
|
|
377
|
-
})
|
|
378
|
-
.catch(() => {
|
|
379
|
-
isUploading.value = false
|
|
380
|
-
})
|
|
355
|
+
uploadFileToServer(param)
|
|
381
356
|
}
|
|
382
357
|
function validateCanUploadFile(file, limitFileSize) {
|
|
383
358
|
let isCanUpload = true
|
|
384
|
-
console.log('上传文件--验证文件大小--file.size=', file.size, '文件线状大小,单位是M,limitFileSize=', limitFileSize)
|
|
385
359
|
if (file.size > limitFileSize * 1024 * 1024) {
|
|
386
360
|
// 超过最大限制
|
|
387
361
|
ElMessage({
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
362
|
+
showClose: true,
|
|
363
|
+
type: 'warning',
|
|
364
|
+
message: t('fileUpload.exceedFileSize', { fileName: file.name, fileSize: limitFileSize })
|
|
365
|
+
})
|
|
392
366
|
// 返回false停止上传
|
|
393
367
|
isCanUpload = false
|
|
394
368
|
}
|
|
@@ -396,35 +370,24 @@ function validateCanUploadFile(file, limitFileSize) {
|
|
|
396
370
|
}
|
|
397
371
|
// 所有文件上传完毕后
|
|
398
372
|
function uploadComplete(result) {
|
|
399
|
-
|
|
400
|
-
if(!fileListResult.value){
|
|
373
|
+
if (!fileListResult.value) {
|
|
401
374
|
fileListResult.value = []
|
|
402
375
|
}
|
|
403
376
|
if (props.multiple) {
|
|
404
|
-
console.log(
|
|
405
|
-
'uploadComplete====fileListResult.value111=',
|
|
406
|
-
JSON.stringify(fileListResult.value),
|
|
407
|
-
'result=',
|
|
408
|
-
result
|
|
409
|
-
)
|
|
410
377
|
fileListResult.value = fileListResult.value.concat(result)
|
|
411
|
-
console.log('uploadComplete====fileListResult.value222=', fileListResult.value)
|
|
412
378
|
} else {
|
|
413
379
|
// 单选时将已选文件移除,然后再替换为新上传的文件
|
|
414
|
-
console.log('uploadComplete====fileListResult.value333=', JSON.stringify(fileListResult.value))
|
|
415
380
|
const rmFiles = JSON.parse(JSON.stringify(fileListResult.value))
|
|
381
|
+
fileListResult.value = []
|
|
416
382
|
fileListResult.value.push(result)
|
|
417
383
|
emits('remove', { rmFiles, serverFiles: fileListResult.value, index: 0 })
|
|
418
|
-
console.log('uploadComplete====fileListResult.value444=', fileListResult.value)
|
|
419
384
|
}
|
|
420
|
-
console.log('uploadComplete====fileListResult.value555=', fileListResult.value)
|
|
421
385
|
|
|
422
386
|
fileRef.value.value = null
|
|
423
387
|
isUploading.value = false
|
|
424
388
|
fileUploadRef.value.changeFileList(fileListResult.value)
|
|
425
389
|
// 表示上传完成
|
|
426
390
|
emits('uploadend', fileListResult.value)
|
|
427
|
-
console.log('uploadComplete====上传完成=')
|
|
428
391
|
}
|
|
429
392
|
function uploadFiles() {
|
|
430
393
|
uploadBrowserFiles()
|
|
@@ -433,8 +396,19 @@ function uploadBrowserFiles() {
|
|
|
433
396
|
console.log('uploadBrowserFiles=====上传开始=')
|
|
434
397
|
const files = fileRef.value.files
|
|
435
398
|
if (files && files.length > 0) {
|
|
436
|
-
|
|
437
|
-
|
|
399
|
+
if (isDingTalk.value && !props.multiple && files.length > 1) {
|
|
400
|
+
// 清除文件列表
|
|
401
|
+
ElMessage({
|
|
402
|
+
showClose: true,
|
|
403
|
+
type: 'warning',
|
|
404
|
+
message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': 1'
|
|
405
|
+
})
|
|
406
|
+
fileRef.value.value = null
|
|
407
|
+
return
|
|
408
|
+
} else {
|
|
409
|
+
isUploading.value = true
|
|
410
|
+
uploadBrowserFile()
|
|
411
|
+
}
|
|
438
412
|
} else {
|
|
439
413
|
uploadNoNewFiles()
|
|
440
414
|
}
|
|
@@ -448,11 +422,11 @@ function uploadNoNewFiles() {
|
|
|
448
422
|
emits('uploadend', fileListResult.value)
|
|
449
423
|
}
|
|
450
424
|
|
|
451
|
-
function compressionImg(selectFiles) {
|
|
452
|
-
const uploadFilesPromises = []
|
|
425
|
+
function compressionImg(selectFiles: File[]): Promise<File[]> {
|
|
426
|
+
const uploadFilesPromises: Promise<File>[] = []
|
|
453
427
|
for (let i = 0; i < selectFiles.length; i++) {
|
|
454
428
|
uploadFilesPromises.push(
|
|
455
|
-
new Promise((resolve, reject) => {
|
|
429
|
+
new Promise<File>((resolve, reject) => {
|
|
456
430
|
console.log(`压缩前 size ${selectFiles[i].size / 1024 / 1024} MB`)
|
|
457
431
|
// eslint-disable-next-line no-new
|
|
458
432
|
new Compressor(selectFiles[i], {
|
|
@@ -475,6 +449,124 @@ function compressionImg(selectFiles) {
|
|
|
475
449
|
}
|
|
476
450
|
return Promise.all(uploadFilesPromises)
|
|
477
451
|
}
|
|
452
|
+
|
|
453
|
+
function dingtalkChooseImage() {
|
|
454
|
+
let sourceType = ['album']
|
|
455
|
+
if (props.openCameraOrChoosePhoto === 'openCameraAndChoosePhoto') {
|
|
456
|
+
sourceType = ['album', 'camera']
|
|
457
|
+
} else if (props.openCameraOrChoosePhoto === 'openChoosePhoto') {
|
|
458
|
+
sourceType = ['album']
|
|
459
|
+
} else if (props.openCameraOrChoosePhoto === 'openCamera') {
|
|
460
|
+
sourceType = ['camera']
|
|
461
|
+
}
|
|
462
|
+
let count = 1
|
|
463
|
+
if (props.multiple) {
|
|
464
|
+
count = 20
|
|
465
|
+
if (props.limit) {
|
|
466
|
+
// 限制上传数量
|
|
467
|
+
if (fileListResult.value && fileListResult.value.length > 0) {
|
|
468
|
+
if (props.limit === fileListResult.value.length) {
|
|
469
|
+
ElMessage({
|
|
470
|
+
showClose: true,
|
|
471
|
+
type: 'warning',
|
|
472
|
+
message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': ' + props.limit
|
|
473
|
+
})
|
|
474
|
+
return
|
|
475
|
+
}
|
|
476
|
+
count = props.limit - fileListResult.value.length
|
|
477
|
+
} else {
|
|
478
|
+
count = props.limit
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
window.top.$dd.biz.util
|
|
483
|
+
.chooseImage({
|
|
484
|
+
sourceType: sourceType,
|
|
485
|
+
count: count
|
|
486
|
+
})
|
|
487
|
+
.then(async (res) => {
|
|
488
|
+
console.log('dingtalkChooseImage res=', res)
|
|
489
|
+
// fileUploadRef.value.changeFileList(fileListResult.value)
|
|
490
|
+
if (res && res.filePaths && res.filePaths.length > 0) {
|
|
491
|
+
fetchDingTalkFile(res.files).then(async (sourceFiles) => {
|
|
492
|
+
let uploadFiles: File[] = []
|
|
493
|
+
try {
|
|
494
|
+
uploadFiles = await compressionImg(sourceFiles)
|
|
495
|
+
} catch (error) {
|
|
496
|
+
console.error('压缩图片失败', error)
|
|
497
|
+
uploadFiles = sourceFiles
|
|
498
|
+
}
|
|
499
|
+
if (uploadFiles && uploadFiles.length > 0) {
|
|
500
|
+
const param = new FormData()
|
|
501
|
+
let limitFileSize = props.limitFileSize
|
|
502
|
+
if (limitFileSize === undefined) {
|
|
503
|
+
// 默认是30M
|
|
504
|
+
limitFileSize = 30
|
|
505
|
+
}
|
|
506
|
+
if (props.multiple) {
|
|
507
|
+
if (fileListResult.value && fileListResult.value.length > 0) {
|
|
508
|
+
if (fileListResult.value.length + uploadFiles.length > props.limit) {
|
|
509
|
+
ElMessage({
|
|
510
|
+
showClose: true,
|
|
511
|
+
type: 'warning',
|
|
512
|
+
message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': ' + props.limit
|
|
513
|
+
})
|
|
514
|
+
return
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
for (let i = 0; i < uploadFiles.length; i++) {
|
|
518
|
+
param.append('files', uploadFiles[i])
|
|
519
|
+
}
|
|
520
|
+
} else {
|
|
521
|
+
param.append('file', uploadFiles[0])
|
|
522
|
+
}
|
|
523
|
+
uploadFileToServer(param)
|
|
524
|
+
}
|
|
525
|
+
})
|
|
526
|
+
}
|
|
527
|
+
})
|
|
528
|
+
}
|
|
529
|
+
async function fetchDingTalkFile(files: any) {
|
|
530
|
+
const uploadFiles: any = []
|
|
531
|
+
for (let index = 0; index < files.length; index++) {
|
|
532
|
+
const file = files[index]
|
|
533
|
+
const response = await fetch(file.path)
|
|
534
|
+
const blob = await response.blob()
|
|
535
|
+
// https://resource/216576ea16afcbee18c392d15814827.image
|
|
536
|
+
const fileName = file.path.replace('https://resource/', '').replace('.image', '')
|
|
537
|
+
// 构造 File 对象
|
|
538
|
+
uploadFiles.push(new File([blob], fileName + '.' + file.fileType, { type: blob.type }))
|
|
539
|
+
}
|
|
540
|
+
return uploadFiles
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function uploadFileToServer(param: FormData) {
|
|
544
|
+
param.append('systemCode', props.systemCode)
|
|
545
|
+
window.$vueApp.config.globalProperties.$http
|
|
546
|
+
.post(defaultAction.value, param, { headers: { 'Content-Type': 'multipart/form-data', Authorization: getToken() } })
|
|
547
|
+
.then((result) => {
|
|
548
|
+
// result:批量上传时返回的是集合,单选上传时返回的是对象
|
|
549
|
+
console.log('上传后返回值==result=', result)
|
|
550
|
+
if (result) {
|
|
551
|
+
if (props.multiple) {
|
|
552
|
+
if (result.length > 0) {
|
|
553
|
+
// this.tempFileList.push(...result)
|
|
554
|
+
uploadComplete(result)
|
|
555
|
+
} else {
|
|
556
|
+
console.error('多选时上传后返回值异常')
|
|
557
|
+
}
|
|
558
|
+
} else {
|
|
559
|
+
// this.tempFileList.push(result)
|
|
560
|
+
uploadComplete(result)
|
|
561
|
+
}
|
|
562
|
+
} else {
|
|
563
|
+
console.error('上传后返回值异常')
|
|
564
|
+
}
|
|
565
|
+
})
|
|
566
|
+
.catch(() => {
|
|
567
|
+
isUploading.value = false
|
|
568
|
+
})
|
|
569
|
+
}
|
|
478
570
|
</script>
|
|
479
571
|
|
|
480
572
|
<style lang="scss" scoped></style>
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<el-input
|
|
4
|
-
|
|
4
|
+
ref="item"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
v-model="fileNames"
|
|
7
|
+
:placeholder="$t('imatrixUIMessage.fileUpload')"
|
|
8
|
+
:readonly="true"
|
|
9
|
+
>
|
|
10
|
+
<template v-slot:append>
|
|
11
|
+
<el-button :icon="Upload" size="default" @click="openAnnexUpload" />
|
|
12
|
+
</template>
|
|
13
|
+
</el-input>
|
|
14
|
+
|
|
15
|
+
<el-dialog
|
|
16
|
+
v-model="annexUploadFlag"
|
|
17
|
+
:append-to-body="true"
|
|
18
|
+
:show-close="true"
|
|
19
|
+
:title="$t('imatrixUIMessage.upload')"
|
|
20
|
+
width="80%"
|
|
21
|
+
@close="annexUploadFlag = false"
|
|
22
|
+
>
|
|
23
|
+
<FileUploadMobile
|
|
24
|
+
ref="fileUploadRef"
|
|
5
25
|
:disabled="disabled"
|
|
6
|
-
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
:
|
|
18
|
-
:
|
|
19
|
-
:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:placeholder="placeholder"
|
|
33
|
-
:action="action"
|
|
34
|
-
:headers="headers"
|
|
35
|
-
:file-list="fileList"
|
|
36
|
-
:beforeUpload="beforeUpload"
|
|
37
|
-
:onSuccess="onSuccess"
|
|
38
|
-
:beforeRemove="beforeRemove"
|
|
39
|
-
:onRemove="onRemove"
|
|
40
|
-
:beforeDownload="beforeDownload"
|
|
41
|
-
:pageContext="pageContext"
|
|
42
|
-
:configure="configure"
|
|
43
|
-
:openFsUpload="openFsUpload"
|
|
44
|
-
:componentId="componentId"
|
|
45
|
-
:componentName="componentName"
|
|
46
|
-
:listCode="listCode"
|
|
47
|
-
:openCameraOrChoosePhoto="openCameraOrChoosePhoto"
|
|
48
|
-
@uploadend="uploadendMobile"
|
|
49
|
-
@remove="removeMobileFile"
|
|
50
|
-
/>
|
|
51
|
-
</el-dialog>
|
|
26
|
+
:fileInfo="fileInfo"
|
|
27
|
+
:systemCode="systemCode"
|
|
28
|
+
:accept="accept"
|
|
29
|
+
:multiple="multiple"
|
|
30
|
+
:limit="limit"
|
|
31
|
+
:limitFileSize="limitFileSize"
|
|
32
|
+
:placeholder="placeholder"
|
|
33
|
+
:action="action"
|
|
34
|
+
:headers="headers"
|
|
35
|
+
:file-list="fileList"
|
|
36
|
+
:beforeUpload="beforeUpload"
|
|
37
|
+
:onSuccess="onSuccess"
|
|
38
|
+
:beforeRemove="beforeRemove"
|
|
39
|
+
:onRemove="onRemove"
|
|
40
|
+
:beforeDownload="beforeDownload"
|
|
41
|
+
:pageContext="pageContext"
|
|
42
|
+
:configure="configure"
|
|
43
|
+
:openFsUpload="openFsUpload"
|
|
44
|
+
:componentId="componentId"
|
|
45
|
+
:componentName="componentName"
|
|
46
|
+
:listCode="listCode"
|
|
47
|
+
:openCameraOrChoosePhoto="openCameraOrChoosePhoto"
|
|
48
|
+
@uploadend="uploadendMobile"
|
|
49
|
+
@remove="removeMobileFile"
|
|
50
|
+
/>
|
|
51
|
+
</el-dialog>
|
|
52
52
|
</div>
|
|
53
53
|
</template>
|
|
54
54
|
|
|
@@ -56,9 +56,7 @@
|
|
|
56
56
|
import { ref, defineEmits } from 'vue'
|
|
57
57
|
import { ElMessage } from 'element-plus'
|
|
58
58
|
import FileUploadMobile from './file-upload.vue'
|
|
59
|
-
import {
|
|
60
|
-
Upload
|
|
61
|
-
} from '@element-plus/icons-vue'
|
|
59
|
+
import { Upload } from '@element-plus/icons-vue'
|
|
62
60
|
|
|
63
61
|
const props = defineProps({
|
|
64
62
|
openFsUpload: {
|
|
@@ -179,43 +177,57 @@ const props = defineProps({
|
|
|
179
177
|
const emits = defineEmits(['remove', 'uploadend'])
|
|
180
178
|
const annexUploadFlag = ref(false)
|
|
181
179
|
const fileNames = ref(null)
|
|
182
|
-
fileNames.value =
|
|
180
|
+
fileNames.value =
|
|
181
|
+
props.fileList && props.fileList.length > 0 ? props.fileList.map((item: any) => item.showName).join(',') : null
|
|
183
182
|
|
|
184
|
-
const openAnnexUpload = ()=>{
|
|
183
|
+
const openAnnexUpload = () => {
|
|
185
184
|
console.log('点击选择文件按钮---')
|
|
186
185
|
annexUploadFlag.value = true
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
function uploadendMobile(fileList) {
|
|
190
|
-
const fileServerPaths = Array.from(props.fileList,({serverPath})=>serverPath)
|
|
191
|
-
console.log(
|
|
192
|
-
|
|
189
|
+
const fileServerPaths = Array.from(props.fileList, ({ serverPath }) => serverPath)
|
|
190
|
+
console.log(
|
|
191
|
+
'uploadendMobile---props.fileList=',
|
|
192
|
+
JSON.stringify(props.fileList),
|
|
193
|
+
'fileServerPaths=',
|
|
194
|
+
fileServerPaths,
|
|
195
|
+
'fileList=',
|
|
196
|
+
JSON.stringify(fileList)
|
|
197
|
+
)
|
|
198
|
+
fileList.forEach((file) => {
|
|
193
199
|
// 如果已经存在就不要重复添加到fileList中了
|
|
194
|
-
if(fileServerPaths.indexOf(file.serverPath) < 0){
|
|
200
|
+
if (fileServerPaths.indexOf(file.serverPath) < 0) {
|
|
195
201
|
props.fileList.push({
|
|
196
202
|
showName: file.name,
|
|
197
203
|
serverPath: file.serverPath
|
|
198
204
|
})
|
|
199
205
|
}
|
|
200
206
|
})
|
|
201
|
-
console.log(
|
|
202
|
-
|
|
207
|
+
console.log(
|
|
208
|
+
'uploadendMobile2222---props.fileList=',
|
|
209
|
+
JSON.stringify(props.fileList),
|
|
210
|
+
'fileServerPaths=',
|
|
211
|
+
fileServerPaths,
|
|
212
|
+
'fileList=',
|
|
213
|
+
JSON.stringify(fileList)
|
|
214
|
+
)
|
|
215
|
+
fileNames.value = props.fileList.map((item: any) => item.showName).join(',')
|
|
203
216
|
console.log('uploadendMobile3333---fileNames.value=', fileNames.value)
|
|
204
217
|
props.onSuccess()
|
|
205
218
|
}
|
|
206
219
|
|
|
207
|
-
|
|
208
220
|
function removeMobileFile(param) {
|
|
209
221
|
// console.log('removeMobileFile---props.fileList=', props.fileList, 'param=', param)
|
|
210
222
|
const deleteFile = param.rmFiles && param.rmFiles.length > 0 ? param.rmFiles[0] : null
|
|
211
|
-
if(deleteFile){
|
|
223
|
+
if (deleteFile) {
|
|
212
224
|
let index = props.fileList.findIndex((item: any) => item.serverPath === deleteFile.serverPath)
|
|
213
225
|
if (index > -1) {
|
|
214
226
|
// eslint-disable-next-line vue/no-mutating-props
|
|
215
227
|
props.fileList.splice(index, 1)
|
|
216
228
|
}
|
|
217
229
|
}
|
|
218
|
-
fileNames.value =props.fileList.map((item: any) => item.showName).join(',')
|
|
230
|
+
fileNames.value = props.fileList.map((item: any) => item.showName).join(',')
|
|
219
231
|
props.onRemove()
|
|
220
232
|
}
|
|
221
233
|
|
|
@@ -241,7 +253,7 @@ function uploadFileDone(data) {
|
|
|
241
253
|
fileUploadRef.value.uploadFileDone(data)
|
|
242
254
|
}
|
|
243
255
|
}
|
|
244
|
-
defineExpose({pickFileDone,uploadFileDone})
|
|
256
|
+
defineExpose({ pickFileDone, uploadFileDone })
|
|
245
257
|
</script>
|
|
246
258
|
|
|
247
259
|
<style lang="scss" scoped></style>
|
|
@@ -411,6 +411,17 @@ export default {
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
return branchDeptIds.join(this.separator)
|
|
414
|
+
} else if (orgDataType === 'divisionManager') {
|
|
415
|
+
let divisionManagerArr = []
|
|
416
|
+
if (isUserTree) {
|
|
417
|
+
if (selectNodeInfo.divisionManager && selectNodeInfo.divisionManager.length > 0) {
|
|
418
|
+
divisionManagerArr = selectNodeInfo.divisionManager
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (divisionManagerArr && divisionManagerArr.length > 0) {
|
|
422
|
+
return divisionManagerArr.join(this.separator)
|
|
423
|
+
}
|
|
424
|
+
return null
|
|
414
425
|
}
|
|
415
426
|
} else {
|
|
416
427
|
// 单选树时
|