agilebuilder-ui 1.1.32 → 1.1.33
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-7193e896.js} +1 -1
- package/lib/{404-442a62d4.js → 404-2852bd20.js} +1 -1
- package/lib/{iframe-page-1b622fa5.js → iframe-page-bcc25b1c.js} +1 -1
- package/lib/{index-0ffdab4a.js → index-d502d8fe.js} +10367 -10359
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +62 -62
- package/lib/{tab-content-iframe-index-285c8311.js → tab-content-iframe-index-48b3b846.js} +1 -1
- package/lib/{tab-content-index-ddb9e911.js → tab-content-index-d25e4873.js} +1 -1
- package/lib/{tache-subprocess-history-81e8e4f4.js → tache-subprocess-history-a72dd967.js} +1 -1
- package/package.json +1 -1
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +96 -74
- 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/src/i18n/langs/cn.js +2 -1
- package/src/i18n/langs/en.js +2 -1
- package/src/utils/dingtalk-util.ts +37 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { openBlock as r, createElementBlock as t, createCommentVNode as o } from "vue";
|
|
2
|
-
import { _ as s } from "./index-
|
|
2
|
+
import { _ as s } from "./index-d502d8fe.js";
|
|
3
3
|
const u = ["src"], f = s({ data: () => ({ src: null }), watch: { $route(n, c) {
|
|
4
4
|
this.src = this.$route.query.src;
|
|
5
5
|
} }, mounted() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as f, c as _, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-
|
|
1
|
+
import { _ as f, c as _, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-d502d8fe.js";
|
|
2
2
|
import { resolveComponent as u, openBlock as d, createBlock as b, withCtx as g, createVNode as v, TransitionGroup as L, createElementBlock as p, Fragment as T, renderList as C, createElementVNode as m, toDisplayString as w, normalizeClass as S, createCommentVNode as y } from "vue";
|
|
3
3
|
const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ levelList: null }), computed: { levelListWithTitle() {
|
|
4
4
|
return this.levelList.filter((e) => e.meta.title !== void 0 && e.meta.title !== null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveComponent as t, openBlock as a, createElementBlock as s, createElementVNode as y, createVNode as l, withCtx as r, createTextVNode as n, toDisplayString as p, createCommentVNode as c, createBlock as h } from "vue";
|
|
2
|
-
import { _ as I } from "./index-
|
|
2
|
+
import { _ as I } from "./index-d502d8fe.js";
|
|
3
3
|
const g = { style: { "padding-bottom": "10px" } }, k = { key: 0, class: "graphDiv" }, N = I({ name: "TacheSubprocessHistory", data: () => ({ type: "graph", workflowId: null }), created() {
|
|
4
4
|
const o = this.$route.query.workflowId;
|
|
5
5
|
o && (this.workflowId = parseInt(o));
|
package/package.json
CHANGED
|
@@ -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>
|
|
@@ -203,6 +181,15 @@ const props = defineProps({
|
|
|
203
181
|
default: () => {}
|
|
204
182
|
}
|
|
205
183
|
})
|
|
184
|
+
const multipleUpload = ref<string | null>(null)
|
|
185
|
+
if (props.multiple) {
|
|
186
|
+
multipleUpload.value = 'multiple'
|
|
187
|
+
}
|
|
188
|
+
const isDingTalk = ref(false)
|
|
189
|
+
const authSource = window.localStorage.getItem('auth_source')
|
|
190
|
+
if (authSource && authSource === 'dingtalk') {
|
|
191
|
+
isDingTalk.value = true
|
|
192
|
+
}
|
|
206
193
|
|
|
207
194
|
const fileListResult = ref(props.fileList)
|
|
208
195
|
|
|
@@ -230,11 +217,11 @@ if (props.action) {
|
|
|
230
217
|
|
|
231
218
|
defaultAction.value = getReplaceUrlDomain(defaultAction.value)
|
|
232
219
|
|
|
233
|
-
let myAccept = ref(props.accept ? props.accept : '')
|
|
220
|
+
let myAccept = ref(props.accept ? props.accept : 'image/*')
|
|
234
221
|
let tempFileList = ref([])
|
|
235
222
|
let isUploading = ref(false)
|
|
236
223
|
let isFile = ref(false)
|
|
237
|
-
const fileRef = ref(
|
|
224
|
+
const fileRef = ref()
|
|
238
225
|
const fileTypeFlag = ref(false)
|
|
239
226
|
const emits = defineEmits(['remove', 'uploadend'])
|
|
240
227
|
const { t } = useI18n()
|
|
@@ -256,17 +243,21 @@ function isImg(file) {
|
|
|
256
243
|
function removeFile(param) {
|
|
257
244
|
console.log('removeFile----param=', param)
|
|
258
245
|
const file = param.file
|
|
259
|
-
if(file){
|
|
246
|
+
if (file) {
|
|
260
247
|
emits('remove', { rmFiles: [file], serverFiles: fileListResult.value, index: param.index })
|
|
261
248
|
}
|
|
262
249
|
}
|
|
263
250
|
function pickBrowserFiles() {
|
|
264
251
|
// if (props.openCameraOrChoosePhoto && props.openCameraOrChoosePhoto === 'openCamera') {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
252
|
+
// 只打开相机
|
|
253
|
+
myAccept.value = 'image/*'
|
|
254
|
+
// if (isDingTalk.value) {
|
|
255
|
+
// dingtalkChooseImage()
|
|
256
|
+
// } else {
|
|
257
|
+
setTimeout(() => {
|
|
258
|
+
fileRef.value.click()
|
|
259
|
+
})
|
|
260
|
+
// }
|
|
270
261
|
// } else {
|
|
271
262
|
// // 相机和文件都可以选
|
|
272
263
|
// myAccept.value = '*'
|
|
@@ -299,7 +290,7 @@ async function uploadBrowserFile() {
|
|
|
299
290
|
limitFileSize = 30
|
|
300
291
|
}
|
|
301
292
|
let isCanUpload = false
|
|
302
|
-
|
|
293
|
+
const files = fileRef.value.files
|
|
303
294
|
for (let i = 0; i < files.length; i++) {
|
|
304
295
|
const newFile = files[i]
|
|
305
296
|
isCanUpload = validateCanUploadFile(newFile, limitFileSize)
|
|
@@ -309,18 +300,24 @@ async function uploadBrowserFile() {
|
|
|
309
300
|
break
|
|
310
301
|
}
|
|
311
302
|
}
|
|
312
|
-
|
|
303
|
+
console.error('isCanUpload=', isCanUpload)
|
|
313
304
|
if (isCanUpload) {
|
|
314
305
|
for (let i = 0; i < files.length; i++) {
|
|
315
306
|
const fileObj = files[i]
|
|
316
|
-
|
|
307
|
+
console.error('fileObj.name=', fileObj.name, 'fileNames=', fileNames)
|
|
317
308
|
if (fileNames.indexOf(fileObj.name) >= 0) {
|
|
318
309
|
selectFiles.push(fileObj)
|
|
319
310
|
}
|
|
320
311
|
if (props.beforeUpload && typeof props.beforeUpload === 'function') {
|
|
321
312
|
const isMobile = true
|
|
322
313
|
// eslint-disable-next-line no-useless-call
|
|
323
|
-
isCanUpload = props.beforeUpload({
|
|
314
|
+
isCanUpload = props.beforeUpload({
|
|
315
|
+
fileObj,
|
|
316
|
+
files: selectFiles,
|
|
317
|
+
isMobile,
|
|
318
|
+
pageContext: props.pageContext,
|
|
319
|
+
configureObj: props.configure
|
|
320
|
+
})
|
|
324
321
|
}
|
|
325
322
|
}
|
|
326
323
|
}
|
|
@@ -353,7 +350,6 @@ async function uploadBrowserFile() {
|
|
|
353
350
|
}
|
|
354
351
|
param.append('systemCode', props.systemCode)
|
|
355
352
|
|
|
356
|
-
console.log('上传文件111-----defaultAction.value=',defaultAction.value, 'param=', param, 'uploadFiles=', uploadFiles)
|
|
357
353
|
window.$vueApp.config.globalProperties.$http
|
|
358
354
|
.post(defaultAction.value, param, { headers: { 'Content-Type': 'multipart/form-data', Authorization: getToken() } })
|
|
359
355
|
.then((result) => {
|
|
@@ -381,14 +377,13 @@ async function uploadBrowserFile() {
|
|
|
381
377
|
}
|
|
382
378
|
function validateCanUploadFile(file, limitFileSize) {
|
|
383
379
|
let isCanUpload = true
|
|
384
|
-
console.log('上传文件--验证文件大小--file.size=', file.size, '文件线状大小,单位是M,limitFileSize=', limitFileSize)
|
|
385
380
|
if (file.size > limitFileSize * 1024 * 1024) {
|
|
386
381
|
// 超过最大限制
|
|
387
382
|
ElMessage({
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
383
|
+
showClose: true,
|
|
384
|
+
type: 'warning',
|
|
385
|
+
message: t('fileUpload.exceedFileSize', { fileName: file.name, fileSize: limitFileSize })
|
|
386
|
+
})
|
|
392
387
|
// 返回false停止上传
|
|
393
388
|
isCanUpload = false
|
|
394
389
|
}
|
|
@@ -396,35 +391,23 @@ function validateCanUploadFile(file, limitFileSize) {
|
|
|
396
391
|
}
|
|
397
392
|
// 所有文件上传完毕后
|
|
398
393
|
function uploadComplete(result) {
|
|
399
|
-
|
|
400
|
-
if(!fileListResult.value){
|
|
394
|
+
if (!fileListResult.value) {
|
|
401
395
|
fileListResult.value = []
|
|
402
396
|
}
|
|
403
397
|
if (props.multiple) {
|
|
404
|
-
console.log(
|
|
405
|
-
'uploadComplete====fileListResult.value111=',
|
|
406
|
-
JSON.stringify(fileListResult.value),
|
|
407
|
-
'result=',
|
|
408
|
-
result
|
|
409
|
-
)
|
|
410
398
|
fileListResult.value = fileListResult.value.concat(result)
|
|
411
|
-
console.log('uploadComplete====fileListResult.value222=', fileListResult.value)
|
|
412
399
|
} else {
|
|
413
400
|
// 单选时将已选文件移除,然后再替换为新上传的文件
|
|
414
|
-
console.log('uploadComplete====fileListResult.value333=', JSON.stringify(fileListResult.value))
|
|
415
401
|
const rmFiles = JSON.parse(JSON.stringify(fileListResult.value))
|
|
416
402
|
fileListResult.value.push(result)
|
|
417
403
|
emits('remove', { rmFiles, serverFiles: fileListResult.value, index: 0 })
|
|
418
|
-
console.log('uploadComplete====fileListResult.value444=', fileListResult.value)
|
|
419
404
|
}
|
|
420
|
-
console.log('uploadComplete====fileListResult.value555=', fileListResult.value)
|
|
421
405
|
|
|
422
406
|
fileRef.value.value = null
|
|
423
407
|
isUploading.value = false
|
|
424
408
|
fileUploadRef.value.changeFileList(fileListResult.value)
|
|
425
409
|
// 表示上传完成
|
|
426
410
|
emits('uploadend', fileListResult.value)
|
|
427
|
-
console.log('uploadComplete====上传完成=')
|
|
428
411
|
}
|
|
429
412
|
function uploadFiles() {
|
|
430
413
|
uploadBrowserFiles()
|
|
@@ -433,8 +416,19 @@ function uploadBrowserFiles() {
|
|
|
433
416
|
console.log('uploadBrowserFiles=====上传开始=')
|
|
434
417
|
const files = fileRef.value.files
|
|
435
418
|
if (files && files.length > 0) {
|
|
436
|
-
|
|
437
|
-
|
|
419
|
+
if (isDingTalk.value && !props.multiple && files.length > 1) {
|
|
420
|
+
// 清除文件列表
|
|
421
|
+
ElMessage({
|
|
422
|
+
showClose: true,
|
|
423
|
+
type: 'warning',
|
|
424
|
+
message: '文件最大上传数量: 1'
|
|
425
|
+
})
|
|
426
|
+
fileRef.value.value = null
|
|
427
|
+
return
|
|
428
|
+
} else {
|
|
429
|
+
isUploading.value = true
|
|
430
|
+
uploadBrowserFile()
|
|
431
|
+
}
|
|
438
432
|
} else {
|
|
439
433
|
uploadNoNewFiles()
|
|
440
434
|
}
|
|
@@ -475,6 +469,34 @@ function compressionImg(selectFiles) {
|
|
|
475
469
|
}
|
|
476
470
|
return Promise.all(uploadFilesPromises)
|
|
477
471
|
}
|
|
472
|
+
|
|
473
|
+
function dingtalkChooseImage() {
|
|
474
|
+
let sourceType = ['album']
|
|
475
|
+
if (props.openCameraOrChoosePhoto === 'openCameraAndChoosePhoto') {
|
|
476
|
+
sourceType = ['album', 'camera']
|
|
477
|
+
} else if (props.openCameraOrChoosePhoto === 'openChoosePhoto') {
|
|
478
|
+
sourceType = ['album']
|
|
479
|
+
} else if (props.openCameraOrChoosePhoto === 'openCamera') {
|
|
480
|
+
sourceType = ['camera']
|
|
481
|
+
}
|
|
482
|
+
let count = 1
|
|
483
|
+
if (props.multiple) {
|
|
484
|
+
count = 20
|
|
485
|
+
if (props.limit) {
|
|
486
|
+
count = props.limit
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
window.top.$dd.biz.util
|
|
490
|
+
.chooseImage({
|
|
491
|
+
sourceType: sourceType,
|
|
492
|
+
count: count
|
|
493
|
+
})
|
|
494
|
+
.then((res) => {
|
|
495
|
+
//
|
|
496
|
+
if (res && res.filePaths && res.filePaths.length > 0) {
|
|
497
|
+
}
|
|
498
|
+
})
|
|
499
|
+
}
|
|
478
500
|
</script>
|
|
479
501
|
|
|
480
502
|
<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>
|
package/src/i18n/langs/cn.js
CHANGED
|
@@ -276,7 +276,8 @@ const cn = {
|
|
|
276
276
|
uploadSucceeded: '上传成功',
|
|
277
277
|
theNumberOfUploadsExceedsTheLimitTheLimitIs: '上传数量超过限制,限制数量为',
|
|
278
278
|
image: '图片',
|
|
279
|
-
video: '视频'
|
|
279
|
+
video: '视频',
|
|
280
|
+
updateSuccess: '更新成功'
|
|
280
281
|
},
|
|
281
282
|
messageVideo: {
|
|
282
283
|
attemptingToIdentify: '正在尝试识别....',
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -275,7 +275,8 @@ const en = {
|
|
|
275
275
|
uploadSucceeded: 'Upload succeeded',
|
|
276
276
|
theNumberOfUploadsExceedsTheLimitTheLimitIs: 'The number of uploads exceeds the limit. The limit is',
|
|
277
277
|
image: 'Image',
|
|
278
|
-
video: 'Video'
|
|
278
|
+
video: 'Video',
|
|
279
|
+
updateSuccess: 'Update success'
|
|
279
280
|
},
|
|
280
281
|
messageVideo: {
|
|
281
282
|
attemptingToIdentify: 'Attempting to identify',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function checkDingtalkEnvironment() {
|
|
2
|
+
const authSource = window.localStorage.getItem('auth_source')
|
|
3
|
+
let isDingTalk = false
|
|
4
|
+
if (authSource && authSource === 'dingtalk') {
|
|
5
|
+
isDingTalk = true
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (isDingTalk) {
|
|
9
|
+
let dd: any = null
|
|
10
|
+
import('dingtalk-jsapi').then((module) => {
|
|
11
|
+
dd = module.default
|
|
12
|
+
window.$dd = dd
|
|
13
|
+
const nonceStr = '1234567890' // 必填,自定义固定字符串。
|
|
14
|
+
const timeStamp = new Date().getTime() // 必填,生成签名的时间戳
|
|
15
|
+
window.$http
|
|
16
|
+
.post(window.$vueApp.config.globalProperties.baseAPI + '/component/dingtalk/jsticket-sign', {
|
|
17
|
+
nonceStr: nonceStr, // 必填,自定义固定字符串。
|
|
18
|
+
timeStamp: timeStamp, // 必填,生成签名的时间戳
|
|
19
|
+
url: window.location.href // 必填,当前页面的url
|
|
20
|
+
})
|
|
21
|
+
.then((response: any) => {
|
|
22
|
+
dd.config({
|
|
23
|
+
agentId: response.agentId, // 必填,授权应用的agentid
|
|
24
|
+
corpId: response.corpId, //必填,企业ID
|
|
25
|
+
timeStamp: timeStamp, // 必填,生成签名的时间戳
|
|
26
|
+
nonceStr: nonceStr, // 必填,自定义固定字符串。
|
|
27
|
+
signature: response.signature, // 必填,签名
|
|
28
|
+
type: 0, //选填。0表示微应用的jsapi,1表示服务窗的jsapi;不填默认为0。该参数从dingtalk.js的0.8.3版本开始支持
|
|
29
|
+
jsApiList: ['biz.util.chooseImage'] // 必填,需要使用的jsapi列表,注意:不要带dd。
|
|
30
|
+
})
|
|
31
|
+
dd.error(function (err) {
|
|
32
|
+
console.error('dd error: ' + JSON.stringify(err))
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
}
|