agilebuilder-ui 1.0.71 → 1.0.72
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/super-ui.css +1 -1
- package/lib/super-ui.js +29640 -27931
- package/lib/super-ui.umd.cjs +95 -87
- package/package.json +2 -1
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +249 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +484 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +220 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +3 -2
- package/packages/fs-upload-new/src/fs-drag-upload.vue +2 -6
- package/packages/fs-upload-new/src/fs-preview-new.vue +30 -13
- package/packages/fs-upload-new/src/fs-upload-new.vue +88 -8
- package/src/i18n/langs/cn.js +2 -0
- package/src/i18n/langs/en.js +2 -0
- package/src/utils/common-util.js +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FsUploadList
|
|
3
|
-
v-if="displayType === 'input'"
|
|
3
|
+
v-if="!isMobile && displayType === 'input'"
|
|
4
4
|
:value="props.fileInfo.showName"
|
|
5
5
|
:row="entity"
|
|
6
6
|
:disabled="disabled"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@delete-success="onInputDeleteSuccess"
|
|
12
12
|
/>
|
|
13
13
|
<fs-button-upload
|
|
14
|
-
v-else-if="displayType === 'button'"
|
|
14
|
+
v-else-if="!isMobile && displayType === 'button'"
|
|
15
15
|
:disabled="disabled"
|
|
16
16
|
:fileInfo="fileInfo"
|
|
17
17
|
:systemCode="systemCode"
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
:action="action"
|
|
24
24
|
:headers="headers"
|
|
25
25
|
:file-list="fileList"
|
|
26
|
-
:
|
|
26
|
+
:beforeUpload="beforeUpload"
|
|
27
27
|
:onSuccess="onSuccess"
|
|
28
28
|
:beforeRemove="beforeRemove"
|
|
29
29
|
:onRemove="onRemove"
|
|
30
30
|
:beforeDownload="beforeDownload"
|
|
31
31
|
:pageContext="pageContext"
|
|
32
32
|
:configure="configure"
|
|
33
|
-
|
|
33
|
+
:openFsUpload="openFsUpload"
|
|
34
34
|
/>
|
|
35
35
|
<fs-drag-upload
|
|
36
|
-
v-else-if="displayType === 'drag'"
|
|
36
|
+
v-else-if="!isMobile && displayType === 'drag'"
|
|
37
37
|
:disabled="disabled"
|
|
38
38
|
:fileInfo="fileInfo"
|
|
39
39
|
:systemCode="systemCode"
|
|
@@ -45,20 +45,68 @@
|
|
|
45
45
|
:action="action"
|
|
46
46
|
:headers="headers"
|
|
47
47
|
:file-list="fileList"
|
|
48
|
-
:
|
|
48
|
+
:beforeUpload="beforeUpload"
|
|
49
49
|
:onSuccess="onSuccess"
|
|
50
50
|
:beforeRemove="beforeRemove"
|
|
51
51
|
:onRemove="onRemove"
|
|
52
52
|
:beforeDownload="beforeDownload"
|
|
53
53
|
:pageContext="pageContext"
|
|
54
54
|
:configure="configure"
|
|
55
|
-
|
|
55
|
+
:openFsUpload="openFsUpload"
|
|
56
|
+
/>
|
|
57
|
+
<FileUploadInputMobile
|
|
58
|
+
v-else-if="isMobile && displayType === 'input'"
|
|
59
|
+
:disabled="disabled"
|
|
60
|
+
:fileInfo="fileInfo"
|
|
61
|
+
:systemCode="systemCode"
|
|
62
|
+
:accept="accept"
|
|
63
|
+
:multiple="multiple"
|
|
64
|
+
:limit="limit"
|
|
65
|
+
:limitFileSize="limitFileSize"
|
|
66
|
+
:placeholder="placeholder"
|
|
67
|
+
:action="action"
|
|
68
|
+
:headers="headers"
|
|
69
|
+
:file-list="fileList"
|
|
70
|
+
:beforeUpload="beforeUpload"
|
|
71
|
+
:onSuccess="onSuccess"
|
|
72
|
+
:beforeRemove="beforeRemove"
|
|
73
|
+
:onRemove="onRemove"
|
|
74
|
+
:beforeDownload="beforeDownload"
|
|
75
|
+
:pageContext="pageContext"
|
|
76
|
+
:configure="configure"
|
|
77
|
+
:openFsUpload="openFsUpload"
|
|
78
|
+
/>
|
|
79
|
+
<FileUploadMobile v-else-if="isMobile"
|
|
80
|
+
:disabled="disabled"
|
|
81
|
+
:fileInfo="fileInfo"
|
|
82
|
+
:systemCode="systemCode"
|
|
83
|
+
:accept="accept"
|
|
84
|
+
:multiple="multiple"
|
|
85
|
+
:limit="limit"
|
|
86
|
+
:limitFileSize="limitFileSize"
|
|
87
|
+
:placeholder="placeholder"
|
|
88
|
+
:action="action"
|
|
89
|
+
:headers="headers"
|
|
90
|
+
:file-list="fileList"
|
|
91
|
+
:beforeUpload="beforeUpload"
|
|
92
|
+
:onSuccess="onSuccess"
|
|
93
|
+
:beforeRemove="beforeRemove"
|
|
94
|
+
:onRemove="onRemove"
|
|
95
|
+
:beforeDownload="beforeDownload"
|
|
96
|
+
:pageContext="pageContext"
|
|
97
|
+
:configure="configure"
|
|
98
|
+
:openFsUpload="openFsUpload"
|
|
99
|
+
@uploadend="uploadendMobile"
|
|
100
|
+
@remove="removeMobileFile"
|
|
56
101
|
/>
|
|
57
102
|
</template>
|
|
58
103
|
<script setup lang="ts">
|
|
59
104
|
import FsDragUpload from './fs-drag-upload.vue'
|
|
60
105
|
import FsButtonUpload from './fs-button-upload.vue'
|
|
106
|
+
import FileUploadMobile from './file-upload-mobile/file-upload.vue'
|
|
107
|
+
import FileUploadInputMobile from './file-upload-mobile/file-upload-input.vue'
|
|
61
108
|
import { ref, defineProps } from 'vue'
|
|
109
|
+
import { getReplaceUrlDomain, isMobileBrowser, isPlateSys } from '../../../src/utils/common-util'
|
|
62
110
|
const props = defineProps({
|
|
63
111
|
openFsUpload:{
|
|
64
112
|
type: Object,
|
|
@@ -118,7 +166,7 @@ const props = defineProps({
|
|
|
118
166
|
type: Array<{ showName: string; serverPath: string }>,
|
|
119
167
|
default: () => []
|
|
120
168
|
},
|
|
121
|
-
|
|
169
|
+
beforeUpload: {
|
|
122
170
|
type: Function,
|
|
123
171
|
default: () => {}
|
|
124
172
|
},
|
|
@@ -147,6 +195,9 @@ const props = defineProps({
|
|
|
147
195
|
default: () => ({})
|
|
148
196
|
}
|
|
149
197
|
})
|
|
198
|
+
const isMobile = ref(isMobileBrowser())
|
|
199
|
+
const pageType = ref(props.pageContext.pageType)
|
|
200
|
+
console.log('附件上传控件---fs-upload-new---isMobile=', isMobile.value, 'pageType=', pageType.value , 'systemCode=', props.systemCode ,'configure=', props.configure, 'props.pageContext=', props.pageContext)
|
|
150
201
|
const listFileLabel = ref<string>('')
|
|
151
202
|
if (props.displayType === 'input') {
|
|
152
203
|
listFileLabel.value = props.fileInfo.showName || ''
|
|
@@ -179,4 +230,33 @@ const onInputDeleteSuccess = (res: any) => {
|
|
|
179
230
|
listFileLabel.value = props.fileList.map((item: any) => item.showName).join(',')
|
|
180
231
|
props.onRemove()
|
|
181
232
|
}
|
|
233
|
+
|
|
234
|
+
function uploadendMobile(fileList) {
|
|
235
|
+
const fileServerPaths = Array.from(props.fileList,({serverPath})=>serverPath)
|
|
236
|
+
// console.log('uploadendMobile---props.fileList=', props.fileList,'fileServerPaths=',fileServerPaths, 'fileList=', fileList)
|
|
237
|
+
fileList.forEach(file=>{
|
|
238
|
+
// 如果已经存在就不要重复添加到fileList中了
|
|
239
|
+
if(fileServerPaths.indexOf(file.serverPath) < 0){
|
|
240
|
+
props.fileList.push({
|
|
241
|
+
showName: file.name,
|
|
242
|
+
serverPath: file.serverPath
|
|
243
|
+
})
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
props.onSuccess()
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
function removeMobileFile(param) {
|
|
251
|
+
// console.log('removeMobileFile---props.fileList=', props.fileList, 'param=', param)
|
|
252
|
+
const deleteFile = param.rmFiles && param.rmFiles.length > 0 ? param.rmFiles[0] : null
|
|
253
|
+
if(deleteFile){
|
|
254
|
+
let index = props.fileList.findIndex((item: any) => item.serverPath === deleteFile.serverPath)
|
|
255
|
+
if (index > -1) {
|
|
256
|
+
// eslint-disable-next-line vue/no-mutating-props
|
|
257
|
+
props.fileList.splice(index, 1)
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
props.onRemove()
|
|
261
|
+
}
|
|
182
262
|
</script>
|
package/src/i18n/langs/cn.js
CHANGED
package/src/i18n/langs/en.js
CHANGED
|
@@ -269,6 +269,8 @@ const en = {
|
|
|
269
269
|
uploadSucceeded: 'Upload succeeded',
|
|
270
270
|
theNumberOfUploadsExceedsTheLimitTheLimitIs:
|
|
271
271
|
'The number of uploads exceeds the limit. The limit is',
|
|
272
|
+
image: 'Image',
|
|
273
|
+
video: 'Video'
|
|
272
274
|
},
|
|
273
275
|
messageVideo: {
|
|
274
276
|
attemptingToIdentify: 'Attempting to identify',
|
package/src/utils/common-util.js
CHANGED
|
@@ -535,12 +535,12 @@ function isOpenMobileGateway () {
|
|
|
535
535
|
export function getReplaceUrlDomain (url) {
|
|
536
536
|
const isOpenMobileGatewayCache = isOpenMobileGateway()
|
|
537
537
|
console.log('===getReplaceUrlDomain==isOpenMobileGatewayCache=', isOpenMobileGatewayCache)
|
|
538
|
-
if (isOpenMobileGatewayCache === 'true' && url !== undefined &&
|
|
538
|
+
if (isOpenMobileGatewayCache === 'true' && url !== undefined && window.$vueApp.config.globalProperties.replaceUrl) {
|
|
539
539
|
// 表示需要替换url中的"https://域名"
|
|
540
|
-
const baseApi =
|
|
541
|
-
if ((url + '').indexOf(
|
|
540
|
+
const baseApi = uswindow.$vueApp.config.globalProperties.baseAPI
|
|
541
|
+
if ((url + '').indexOf(uswindow.$vueApp.config.globalProperties.replaceUrl + '/') < 0 && (url + '').indexOf('://') > 0) {
|
|
542
542
|
// 表示路径还未替换
|
|
543
|
-
console.log('===getReplaceUrlDomain==url.indexOf(
|
|
543
|
+
console.log('===getReplaceUrlDomain==url.indexOf(uswindow.$vueApp.config.globalProperties.replaceUrl) !== 0')
|
|
544
544
|
const prefixUrl1 = baseApi.substring(0, baseApi.indexOf('://'))
|
|
545
545
|
const urlSuffix1 = baseApi.substring(baseApi.indexOf('://') + 3)
|
|
546
546
|
const domainUrl1 = urlSuffix1.substring(0, urlSuffix1.indexOf('/'))
|
|
@@ -551,7 +551,7 @@ export function getReplaceUrlDomain (url) {
|
|
|
551
551
|
const prefixUrl = prefixUrl2 + '://' + domainUrl2
|
|
552
552
|
if (prefixUrl === prefixUrlBase) {
|
|
553
553
|
urlSuffix = urlSuffix.substring(urlSuffix.indexOf('/'))
|
|
554
|
-
url =
|
|
554
|
+
url = uswindow.$vueApp.config.globalProperties.replaceUrl + urlSuffix
|
|
555
555
|
console.log('===getReplaceUrlDomain==url=', url)
|
|
556
556
|
}
|
|
557
557
|
} else {
|