agilebuilder-ui 1.1.3 → 1.1.4-temp2
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 +23173 -23950
- package/lib/super-ui.umd.cjs +71 -70
- package/package.json +1 -1
- package/packages/fs-preview/src/fs-preview.vue +20 -12
- package/packages/fs-upload-list/src/fs-upload-list.vue +22 -19
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +2 -2
- package/packages/fs-upload-new/src/fs-button-upload.vue +24 -3
- package/packages/fs-upload-new/src/fs-drag-upload.vue +21 -7
- package/packages/fs-upload-new/src/fs-preview-new.vue +37 -38
- package/packages/fs-upload-new/src/fs-upload-new.vue +46 -26
- package/packages/organization-input/src/organization-input.vue +55 -19
- package/packages/super-grid/src/custom-formatter.js +14 -8
- package/packages/super-grid/src/dynamic-input.vue +123 -8
- package/packages/super-grid/src/normal-column-content.vue +5 -0
- package/packages/super-grid/src/normal-column.vue +1 -0
- package/packages/super-grid/src/super-grid.vue +28 -0
- package/src/styles/index.scss +32 -0
- package/src/styles/table.scss +3 -3
- package/src/styles/theme/dark-blue/dark-blue-var.scss +1 -0
- package/src/styles/theme/green/green.scss +1 -0
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -0
- package/src/utils/jump-page-utils.js +9 -0
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<el-table-column>
|
|
54
54
|
<template v-slot="scope">
|
|
55
55
|
<el-tooltip :content="$t('imatrixUIPublicModel.download')" class="item" effect="dark" placement="top">
|
|
56
|
-
<el-icon @click="donwloadFile(scope.$index, fileList)" style="cursor: pointer"
|
|
56
|
+
<el-icon v-if="downloadable" @click="donwloadFile(scope.$index, fileList)" style="cursor: pointer"
|
|
57
57
|
><el-icon-download
|
|
58
58
|
/></el-icon>
|
|
59
59
|
</el-tooltip>
|
|
@@ -110,10 +110,14 @@ export default {
|
|
|
110
110
|
showPreviewSingleImage: false,
|
|
111
111
|
showPreviewMulti: false,
|
|
112
112
|
previewImageInfo: {},
|
|
113
|
-
fileList: []
|
|
113
|
+
fileList: [],
|
|
114
|
+
downloadable: true
|
|
114
115
|
}
|
|
115
116
|
},
|
|
116
117
|
created() {
|
|
118
|
+
if (this.fileSetObj && this.fileSetObj.downloadable !== undefined && this.fileSetObj.downloadable !== null) {
|
|
119
|
+
this.downloadable = this.fileSetObj.downloadable
|
|
120
|
+
}
|
|
117
121
|
// let fileList = []
|
|
118
122
|
// if (this.column.fileSet && this.column.fileSet !== '' && (this.column.componentType === 'annex' || this.column.componentType === 'multipartUpload')) {
|
|
119
123
|
// const fileSetObj = JSON.parse(this.column.fileSet)
|
|
@@ -154,22 +158,26 @@ export default {
|
|
|
154
158
|
previewMuti() {
|
|
155
159
|
const keyValueParam = this.analysisFileSetObj(this.fileSetObj, this.isSql)
|
|
156
160
|
let serverPath = null
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
if (this.fileInfo.showName && this.fileInfo.serverPath) {
|
|
162
|
+
serverPath = this.fileInfo.serverPath
|
|
159
163
|
} else if (this.entity) {
|
|
160
164
|
serverPath = getEntityFieldValue(this.entity, keyValueParam.serverPath)
|
|
161
165
|
}
|
|
162
166
|
if (serverPath) {
|
|
163
167
|
const uuids = serverPath.split(',')
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
const baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
169
|
+
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
170
|
+
const tempAction = baseURL + '/common/fs-upload/search-file-names'
|
|
171
|
+
if (isPlateSys(window.$vueApp.config.globalProperties.systemCode)) {
|
|
172
|
+
tempAction = baseAPI + '/api/search-file-names'
|
|
173
|
+
}
|
|
174
|
+
this.$http.post(tempAction, uuids).then((result) => {
|
|
175
|
+
this.fileList = []
|
|
176
|
+
uuids.forEach((uuid) => {
|
|
177
|
+
this.fileList.push({ showName: result[uuid], serverPath: uuid })
|
|
172
178
|
})
|
|
179
|
+
this.showPreviewMulti = true
|
|
180
|
+
})
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
// var that = this
|
|
@@ -139,7 +139,6 @@ import FsPreview from '../../fs-preview/src/fs-preview.vue'
|
|
|
139
139
|
import { packageFile } from '../../super-grid/src/utils'
|
|
140
140
|
import FileUploadInputMobile from '../../fs-upload-new/src/file-upload-mobile/file-upload-input.vue'
|
|
141
141
|
|
|
142
|
-
|
|
143
142
|
export default {
|
|
144
143
|
name: 'FsUploadList',
|
|
145
144
|
props: {
|
|
@@ -196,9 +195,9 @@ export default {
|
|
|
196
195
|
type: Boolean,
|
|
197
196
|
default: false
|
|
198
197
|
},
|
|
199
|
-
openFsUpload:{
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
openFsUpload: {
|
|
199
|
+
type: Boolean,
|
|
200
|
+
default: true
|
|
202
201
|
},
|
|
203
202
|
pageContext: {
|
|
204
203
|
type: Object,
|
|
@@ -220,7 +219,7 @@ export default {
|
|
|
220
219
|
defaultAction = window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/uploads'
|
|
221
220
|
}
|
|
222
221
|
const isMobile = isMobileBrowser()
|
|
223
|
-
const systemCode = this.pageContext && this.pageContext.systemCode? this.pageContext.systemCode: null
|
|
222
|
+
const systemCode = this.pageContext && this.pageContext.systemCode ? this.pageContext.systemCode : null
|
|
224
223
|
return {
|
|
225
224
|
deleteUuids: [],
|
|
226
225
|
headers,
|
|
@@ -247,9 +246,9 @@ export default {
|
|
|
247
246
|
mounted() {},
|
|
248
247
|
methods: {
|
|
249
248
|
openAnnexUpload() {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
if (this.openFsUpload) {
|
|
250
|
+
this.annexUploadFlag = true
|
|
251
|
+
}
|
|
253
252
|
},
|
|
254
253
|
handleBeforeUpload(file) {
|
|
255
254
|
let limitFileSize = this.fileSetObj.limitFileSize
|
|
@@ -307,15 +306,19 @@ export default {
|
|
|
307
306
|
preview() {
|
|
308
307
|
this.fileList.length = 0
|
|
309
308
|
const uuids = this.fileInfo.serverPath.split(',')
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
309
|
+
const baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
310
|
+
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
311
|
+
const tempAction = baseURL + '/common/fs-upload/search-file-names'
|
|
312
|
+
if (isPlateSys(this.systemCode)) {
|
|
313
|
+
tempAction = baseAPI + '/api/search-file-names'
|
|
314
|
+
}
|
|
315
|
+
this.$http.post(tempAction, uuids).then((result) => {
|
|
316
|
+
uuids.forEach((uuid) => {
|
|
317
|
+
this.fileList.push({ showName: result[uuid], serverPath: uuid })
|
|
318
318
|
})
|
|
319
|
+
this.showFileList = this.fileList
|
|
320
|
+
this.showPreviewMulti = true
|
|
321
|
+
})
|
|
319
322
|
},
|
|
320
323
|
previewSingle(fileInfo) {
|
|
321
324
|
fileInfo = packageFile(fileInfo.showName, fileInfo.serverPath)
|
|
@@ -402,15 +405,15 @@ export default {
|
|
|
402
405
|
$emit(this, 'upload-success', this.fileList)
|
|
403
406
|
},
|
|
404
407
|
// 移动端删除附件
|
|
405
|
-
onRemoveMobile(){
|
|
408
|
+
onRemoveMobile() {
|
|
406
409
|
console.log('onRemoveMobile-------this.fileList=', this.fileList)
|
|
407
410
|
$emit(this, 'delete', this.fileList)
|
|
408
411
|
},
|
|
409
|
-
pickFileDone(data){
|
|
412
|
+
pickFileDone(data) {
|
|
410
413
|
console.log('fs-upload-list------pickFileDone-------data=', data)
|
|
411
414
|
this.$refs.fileUploadRef.pickFileDone(data)
|
|
412
415
|
},
|
|
413
|
-
uploadFileDone(data){
|
|
416
|
+
uploadFileDone(data) {
|
|
414
417
|
this.$refs.fileUploadRef.uploadFileDone(data)
|
|
415
418
|
}
|
|
416
419
|
},
|
|
@@ -205,7 +205,7 @@ if (userAgentOrg.indexOf(' uni-app ') > 0) {
|
|
|
205
205
|
|
|
206
206
|
// 点击确定(上传)按钮的回调方法
|
|
207
207
|
function uploadedFile(fileList) {
|
|
208
|
-
|
|
208
|
+
emits('uploadend', fileList)
|
|
209
209
|
}
|
|
210
210
|
function deleteServerFiles() {
|
|
211
211
|
return window.$vueApp.config.globalProperties.$http.post(deleteServerFileUrl, rmFileServerPaths.value)
|
|
@@ -249,7 +249,7 @@ function clearTempFile() {
|
|
|
249
249
|
fileUploadRef.value.clearQueenFile()
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
defineExpose({pickFileDone,uploadFileDone})
|
|
252
|
+
defineExpose({ pickFileDone, uploadFileDone })
|
|
253
253
|
</script>
|
|
254
254
|
|
|
255
255
|
<style lang="scss" scoped></style>
|
|
@@ -16,11 +16,21 @@
|
|
|
16
16
|
>
|
|
17
17
|
<el-button size="small" type="primary">{{ placeholder }}</el-button>
|
|
18
18
|
<template #tip>
|
|
19
|
-
<el-text size="small">
|
|
19
|
+
<el-text size="small">
|
|
20
|
+
{{ accept }} {{ $t('imatrixUIMessage.uploadFileTip', { fileSzie: limitFileSize }) }}</el-text
|
|
21
|
+
>
|
|
20
22
|
</template>
|
|
21
23
|
</el-upload>
|
|
22
24
|
<template v-if="fileList && fileList.length > 0">
|
|
23
|
-
<fs-preview-new
|
|
25
|
+
<fs-preview-new
|
|
26
|
+
:disabled="disabled"
|
|
27
|
+
:file-list="fileList"
|
|
28
|
+
:system-code="systemCode"
|
|
29
|
+
:before-remove="beforeRemove"
|
|
30
|
+
:on-remove="onRemove"
|
|
31
|
+
:before-download="beforeDownload"
|
|
32
|
+
:downloadable="downloadable"
|
|
33
|
+
/>
|
|
24
34
|
</template>
|
|
25
35
|
</template>
|
|
26
36
|
|
|
@@ -43,6 +53,11 @@ const props = defineProps({
|
|
|
43
53
|
type: Boolean,
|
|
44
54
|
default: false
|
|
45
55
|
},
|
|
56
|
+
// 可下载
|
|
57
|
+
downloadable: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true
|
|
60
|
+
},
|
|
46
61
|
accept: {
|
|
47
62
|
type: String,
|
|
48
63
|
default: ''
|
|
@@ -123,7 +138,13 @@ if (!props.headers || !props.headers['Authorization']) {
|
|
|
123
138
|
}
|
|
124
139
|
const handleBeforeUpload = (file: File) => {
|
|
125
140
|
const isMobile = false
|
|
126
|
-
return props.beforeUpload({
|
|
141
|
+
return props.beforeUpload({
|
|
142
|
+
fileObj: file,
|
|
143
|
+
files: [file],
|
|
144
|
+
isMobile,
|
|
145
|
+
pageContext: props.pageContext,
|
|
146
|
+
configureObj: props.configure
|
|
147
|
+
})
|
|
127
148
|
}
|
|
128
149
|
const onSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
|
129
150
|
// eslint-disable-next-line vue/no-mutating-props
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:headers="headers"
|
|
11
11
|
:action="defaultAction"
|
|
12
12
|
:multiple="multiple"
|
|
13
|
-
|
|
13
|
+
:disabled="!openFsUpload"
|
|
14
14
|
:before-upload="handleBeforeUpload"
|
|
15
15
|
:before-remove="beforeRemove"
|
|
16
16
|
:on-success="onSuccess"
|
|
@@ -18,11 +18,20 @@
|
|
|
18
18
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
19
19
|
<div class="el-upload__text">{{ placeholder }}</div>
|
|
20
20
|
<template #tip>
|
|
21
|
-
<el-text size="small">
|
|
21
|
+
<el-text size="small">
|
|
22
|
+
{{ accept }} {{ $t('imatrixUIMessage.uploadFileTip', { fileSzie: limitFileSize }) }}</el-text
|
|
23
|
+
>
|
|
22
24
|
</template>
|
|
23
25
|
</el-upload>
|
|
24
26
|
<template v-if="fileList && fileList.length > 0">
|
|
25
|
-
<fs-preview-new
|
|
27
|
+
<fs-preview-new
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
:file-list="fileList"
|
|
30
|
+
:system-code="systemCode"
|
|
31
|
+
:before-remove="beforeRemove"
|
|
32
|
+
:on-remove="onRemove"
|
|
33
|
+
:before-download="beforeDownload"
|
|
34
|
+
/>
|
|
26
35
|
</template>
|
|
27
36
|
</template>
|
|
28
37
|
|
|
@@ -34,10 +43,10 @@ import { getToken } from '../../../src/utils/auth'
|
|
|
34
43
|
import type { UploadFile, UploadFiles } from 'element-plus'
|
|
35
44
|
import fsPreviewNew from './fs-preview-new.vue'
|
|
36
45
|
const props = defineProps({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
openFsUpload: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
41
50
|
systemCode: {
|
|
42
51
|
type: String,
|
|
43
52
|
default: ''
|
|
@@ -46,6 +55,11 @@ const props = defineProps({
|
|
|
46
55
|
type: Boolean,
|
|
47
56
|
default: false
|
|
48
57
|
},
|
|
58
|
+
// 可下载
|
|
59
|
+
downloadable: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
49
63
|
accept: {
|
|
50
64
|
type: String,
|
|
51
65
|
default: ''
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="!isMobile">
|
|
4
|
+
<div v-for="(file, index) in fileList" :key="index" style="width: 100%">
|
|
5
5
|
<el-tag>
|
|
6
6
|
<el-tooltip content="预览" placement="top">
|
|
7
7
|
<span style="cursor: pointer" @click="preview(file.showName, file.serverPath)">
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</span>
|
|
11
11
|
</el-tooltip>
|
|
12
12
|
<el-tooltip v-if="!disabled" content="下载" placement="top">
|
|
13
|
-
<el-icon
|
|
13
|
+
<el-icon @click="handleDownload(file)">
|
|
14
14
|
<Download />
|
|
15
15
|
</el-icon>
|
|
16
16
|
</el-tooltip>
|
|
@@ -19,34 +19,26 @@
|
|
|
19
19
|
</el-tooltip>
|
|
20
20
|
</el-tag>
|
|
21
21
|
</div>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@click="
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</span>
|
|
38
|
-
<span
|
|
39
|
-
v-if="!disabled"
|
|
40
|
-
class="el-upload-list__item-delete"
|
|
41
|
-
@click="handleOnRemove(file)"
|
|
42
|
-
>
|
|
43
|
-
<el-icon><Delete /></el-icon>
|
|
22
|
+
</div>
|
|
23
|
+
<span v-else class="el-upload-list__item-actions mobile-item-action">
|
|
24
|
+
<span
|
|
25
|
+
v-if="isPreview(file.showName ? file.showName : file.name)"
|
|
26
|
+
class="el-upload-list__item-preview"
|
|
27
|
+
@click="preview(file.showName ? file.showName : file.name, file.serverPath)"
|
|
28
|
+
>
|
|
29
|
+
<el-icon><zoom-in /></el-icon>
|
|
30
|
+
</span>
|
|
31
|
+
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
|
32
|
+
<el-icon><Download /></el-icon>
|
|
33
|
+
</span>
|
|
34
|
+
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleOnRemove(file)">
|
|
35
|
+
<el-icon><Delete /></el-icon>
|
|
36
|
+
</span>
|
|
44
37
|
</span>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</
|
|
49
|
-
</div>
|
|
38
|
+
<el-dialog v-model="dialogVisible" title="预览" width="500">
|
|
39
|
+
<el-image :preview-src-list="previewSrcList" :src="previewImageInfo.src" />
|
|
40
|
+
</el-dialog>
|
|
41
|
+
</div>
|
|
50
42
|
</template>
|
|
51
43
|
<style scoped>
|
|
52
44
|
/* .el-upload-list--picture-card .el-upload-list__item-actions, */
|
|
@@ -69,6 +61,11 @@ const props = defineProps({
|
|
|
69
61
|
type: Boolean,
|
|
70
62
|
default: false
|
|
71
63
|
},
|
|
64
|
+
// 可下载
|
|
65
|
+
downloadable: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true
|
|
68
|
+
},
|
|
72
69
|
fileList: {
|
|
73
70
|
type: Array<{ showName: string; serverPath: string }>,
|
|
74
71
|
default: () => []
|
|
@@ -102,7 +99,7 @@ const props = defineProps({
|
|
|
102
99
|
default: null
|
|
103
100
|
}
|
|
104
101
|
})
|
|
105
|
-
const baseURL = props.baseURL ? props.baseURL: window.$vueApp.config.globalProperties.baseURL
|
|
102
|
+
const baseURL = props.baseURL ? props.baseURL : window.$vueApp.config.globalProperties.baseURL
|
|
106
103
|
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
107
104
|
|
|
108
105
|
const dialogVisible = ref<boolean>(false)
|
|
@@ -129,7 +126,7 @@ const handleDownload = (file: any) => {
|
|
|
129
126
|
}
|
|
130
127
|
const download = (file: any) => {
|
|
131
128
|
const token = getToken()
|
|
132
|
-
const fileName = file.showName ? file.showName: file.name
|
|
129
|
+
const fileName = file.showName ? file.showName : file.name
|
|
133
130
|
const showName = fileName.replace('#', '~~').replace('?', '~$').replace('&', '$')
|
|
134
131
|
let url =
|
|
135
132
|
baseURL +
|
|
@@ -157,14 +154,16 @@ const handleOnRemove = (file: any) => {
|
|
|
157
154
|
const isMobile = true
|
|
158
155
|
isCanRemove = props.beforeRemove(props.pageContext, props.configure, file, isMobile)
|
|
159
156
|
}
|
|
160
|
-
if (isCanRemove!==undefined && !isCanRemove) {
|
|
157
|
+
if (isCanRemove !== undefined && !isCanRemove) {
|
|
161
158
|
// 不能删除文件
|
|
162
159
|
return
|
|
163
160
|
}
|
|
164
|
-
const index = props.fileList.findIndex(
|
|
161
|
+
const index = props.fileList.findIndex(
|
|
162
|
+
(item: any) => item.serverPath === file.uuid || item.serverPath === file.serverPath
|
|
163
|
+
)
|
|
165
164
|
console.log('handleOnRemove----props.fileList=', props.fileList, 'index=', index)
|
|
166
165
|
props.fileList.splice(index, 1)
|
|
167
|
-
emits('remove', {file, index: index})
|
|
166
|
+
emits('remove', { file, index: index })
|
|
168
167
|
props.onRemove(file)
|
|
169
168
|
}
|
|
170
169
|
|
|
@@ -182,7 +181,7 @@ const preview = (showName: string, serverPath: string) => {
|
|
|
182
181
|
previewImageInfo.value.src = getPreviewSrc(showName, serverPath)
|
|
183
182
|
const srcList: string[] = []
|
|
184
183
|
props.fileList.forEach((item: any) => {
|
|
185
|
-
const fileName = item.showName ? item.showName: item.name
|
|
184
|
+
const fileName = item.showName ? item.showName : item.name
|
|
186
185
|
srcList.push(getPreviewSrc(fileName, item.serverPath))
|
|
187
186
|
})
|
|
188
187
|
previewSrcList.value = srcList
|
|
@@ -253,7 +252,7 @@ const formatName = (showName: string) => {
|
|
|
253
252
|
}
|
|
254
253
|
|
|
255
254
|
const isPreview = (fileName: string) => {
|
|
256
|
-
if(isMobile.value){
|
|
255
|
+
if (isMobile.value) {
|
|
257
256
|
if (fileName && isImage(fileName)) {
|
|
258
257
|
// 移动端时,只能预览图片
|
|
259
258
|
return true
|
|
@@ -5,8 +5,14 @@
|
|
|
5
5
|
:row="entity"
|
|
6
6
|
:disabled="disabled"
|
|
7
7
|
:fileInfo="fileInfo"
|
|
8
|
-
|
|
9
|
-
:fileSetObj="{
|
|
8
|
+
:openFsUpload="openFsUpload"
|
|
9
|
+
:fileSetObj="{
|
|
10
|
+
accept: accept,
|
|
11
|
+
multiple: multiple,
|
|
12
|
+
limitFileSize: limitFileSize,
|
|
13
|
+
limit: limitNum,
|
|
14
|
+
downloadable: downloadable
|
|
15
|
+
}"
|
|
10
16
|
@upload-success="onInputUploadSuccess"
|
|
11
17
|
@delete-success="onInputDeleteSuccess"
|
|
12
18
|
/>
|
|
@@ -30,7 +36,7 @@
|
|
|
30
36
|
:beforeDownload="beforeDownload"
|
|
31
37
|
:pageContext="pageContext"
|
|
32
38
|
:configure="configure"
|
|
33
|
-
|
|
39
|
+
:openFsUpload="openFsUpload"
|
|
34
40
|
/>
|
|
35
41
|
<fs-drag-upload
|
|
36
42
|
v-else-if="!isMobile && displayType === 'drag'"
|
|
@@ -52,7 +58,7 @@
|
|
|
52
58
|
:beforeDownload="beforeDownload"
|
|
53
59
|
:pageContext="pageContext"
|
|
54
60
|
:configure="configure"
|
|
55
|
-
|
|
61
|
+
:openFsUpload="openFsUpload"
|
|
56
62
|
/>
|
|
57
63
|
<FileUploadInputMobile
|
|
58
64
|
v-else-if="isMobile && displayType === 'input'"
|
|
@@ -75,13 +81,14 @@
|
|
|
75
81
|
:beforeDownload="beforeDownload"
|
|
76
82
|
:pageContext="pageContext"
|
|
77
83
|
:configure="configure"
|
|
78
|
-
|
|
84
|
+
:openFsUpload="openFsUpload"
|
|
79
85
|
:componentId="componentId"
|
|
80
86
|
:componentName="componentName"
|
|
81
87
|
:listCode="listCode"
|
|
82
88
|
:openCameraOrChoosePhoto="openCameraOrChoosePhoto"
|
|
83
89
|
/>
|
|
84
|
-
<FileUploadMobile
|
|
90
|
+
<FileUploadMobile
|
|
91
|
+
v-else-if="isMobile"
|
|
85
92
|
ref="fileUploadRef"
|
|
86
93
|
:disabled="disabled"
|
|
87
94
|
:fileInfo="fileInfo"
|
|
@@ -101,7 +108,7 @@
|
|
|
101
108
|
:beforeDownload="beforeDownload"
|
|
102
109
|
:pageContext="pageContext"
|
|
103
110
|
:configure="configure"
|
|
104
|
-
|
|
111
|
+
:openFsUpload="openFsUpload"
|
|
105
112
|
:componentId="componentId"
|
|
106
113
|
:componentName="componentName"
|
|
107
114
|
:listCode="listCode"
|
|
@@ -117,11 +124,12 @@ import FileUploadMobile from './file-upload-mobile/file-upload.vue'
|
|
|
117
124
|
import FileUploadInputMobile from './file-upload-mobile/file-upload-input.vue'
|
|
118
125
|
import { ref, defineProps } from 'vue'
|
|
119
126
|
import { getReplaceUrlDomain, isMobileBrowser, isPlateSys } from '../../../src/utils/common-util'
|
|
127
|
+
import { Download } from '@element-plus/icons-vue/dist/types'
|
|
120
128
|
const props = defineProps({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
openFsUpload: {
|
|
130
|
+
type: Object,
|
|
131
|
+
default: true
|
|
132
|
+
},
|
|
125
133
|
entity: {
|
|
126
134
|
type: Object,
|
|
127
135
|
default: () => {
|
|
@@ -144,6 +152,11 @@ const props = defineProps({
|
|
|
144
152
|
type: Boolean,
|
|
145
153
|
default: false
|
|
146
154
|
},
|
|
155
|
+
// 可下载
|
|
156
|
+
downloadable: {
|
|
157
|
+
type: Boolean,
|
|
158
|
+
default: true
|
|
159
|
+
},
|
|
147
160
|
accept: {
|
|
148
161
|
type: String,
|
|
149
162
|
default: ''
|
|
@@ -231,18 +244,27 @@ const props = defineProps({
|
|
|
231
244
|
})
|
|
232
245
|
const isMobile = ref(isMobileBrowser())
|
|
233
246
|
const pageType = ref(props.pageContext.pageType)
|
|
234
|
-
console.log(
|
|
247
|
+
console.log(
|
|
248
|
+
'附件上传控件---fs-upload-new---isMobile=',
|
|
249
|
+
isMobile.value,
|
|
250
|
+
'pageType=',
|
|
251
|
+
pageType.value,
|
|
252
|
+
'systemCode=',
|
|
253
|
+
props.systemCode,
|
|
254
|
+
'configure=',
|
|
255
|
+
props.configure,
|
|
256
|
+
'props.pageContext=',
|
|
257
|
+
props.pageContext
|
|
258
|
+
)
|
|
235
259
|
const listFileLabel = ref<string>('')
|
|
236
260
|
if (props.displayType === 'input') {
|
|
237
261
|
listFileLabel.value = props.fileInfo.showName || ''
|
|
238
262
|
}
|
|
239
|
-
let limitNum = ref(
|
|
240
|
-
if(props.limit){
|
|
263
|
+
let limitNum = ref(1)
|
|
264
|
+
if (props.limit) {
|
|
241
265
|
limitNum.value = props.limit
|
|
242
|
-
} else if(props.multiple){
|
|
266
|
+
} else if (props.multiple) {
|
|
243
267
|
limitNum.value = 9
|
|
244
|
-
} else {
|
|
245
|
-
limitNum.value = 1
|
|
246
268
|
}
|
|
247
269
|
const onInputUploadSuccess = (res: any) => {
|
|
248
270
|
if (listFileLabel.value) {
|
|
@@ -274,11 +296,11 @@ const onInputDeleteSuccess = (res: any) => {
|
|
|
274
296
|
}
|
|
275
297
|
|
|
276
298
|
function uploadendMobile(fileList) {
|
|
277
|
-
const fileServerPaths = Array.from(props.fileList,({serverPath})=>serverPath)
|
|
299
|
+
const fileServerPaths = Array.from(props.fileList, ({ serverPath }) => serverPath)
|
|
278
300
|
// console.log('uploadendMobile---props.fileList=', props.fileList,'fileServerPaths=',fileServerPaths, 'fileList=', fileList)
|
|
279
|
-
fileList.forEach(file=>{
|
|
301
|
+
fileList.forEach((file) => {
|
|
280
302
|
// 如果已经存在就不要重复添加到fileList中了
|
|
281
|
-
if(fileServerPaths.indexOf(file.serverPath) < 0){
|
|
303
|
+
if (fileServerPaths.indexOf(file.serverPath) < 0) {
|
|
282
304
|
props.fileList.push({
|
|
283
305
|
showName: file.name,
|
|
284
306
|
serverPath: file.serverPath
|
|
@@ -288,11 +310,10 @@ function uploadendMobile(fileList) {
|
|
|
288
310
|
props.onSuccess()
|
|
289
311
|
}
|
|
290
312
|
|
|
291
|
-
|
|
292
313
|
function removeMobileFile(param) {
|
|
293
314
|
// console.log('removeMobileFile---props.fileList=', props.fileList, 'param=', param)
|
|
294
315
|
const deleteFile = param.rmFiles && param.rmFiles.length > 0 ? param.rmFiles[0] : null
|
|
295
|
-
if(deleteFile){
|
|
316
|
+
if (deleteFile) {
|
|
296
317
|
let index = props.fileList.findIndex((item: any) => item.serverPath === deleteFile.serverPath)
|
|
297
318
|
if (index > -1) {
|
|
298
319
|
// eslint-disable-next-line vue/no-mutating-props
|
|
@@ -302,9 +323,8 @@ function removeMobileFile(param) {
|
|
|
302
323
|
props.onRemove()
|
|
303
324
|
}
|
|
304
325
|
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
const fileUploadRef = ref(null)
|
|
326
|
+
const userAgent = ref<string | null>(null)
|
|
327
|
+
const fileUploadRef = ref()
|
|
308
328
|
const userAgentOrg = navigator.userAgent
|
|
309
329
|
if (userAgentOrg.indexOf(' uni-app ') > 0) {
|
|
310
330
|
// 表示uni-app中访问的
|
|
@@ -325,5 +345,5 @@ function uploadFileDone(data) {
|
|
|
325
345
|
fileUploadRef.value.uploadFileDone(data)
|
|
326
346
|
}
|
|
327
347
|
}
|
|
328
|
-
defineExpose({pickFileDone,uploadFileDone})
|
|
348
|
+
defineExpose({ pickFileDone, uploadFileDone })
|
|
329
349
|
</script>
|