agilebuilder-ui 1.0.621 → 1.0.962
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 +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -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 +246 -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 +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -1,32 +1,65 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<el-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="!isMobile">
|
|
4
|
+
<div v-for="(file, index) in fileList" :key="index" style="width: 100%">
|
|
5
|
+
<el-tag>
|
|
6
|
+
<el-tooltip content="预览" placement="top">
|
|
7
|
+
<span style="cursor: pointer" @click="preview(file.showName, file.serverPath)">
|
|
8
|
+
<el-icon><Paperclip /></el-icon>
|
|
9
|
+
<span style="margin-left: 6.5px">{{ file.showName }}</span>
|
|
10
|
+
</span>
|
|
11
|
+
</el-tooltip>
|
|
12
|
+
<el-tooltip v-if="!disabled" content="下载" placement="top">
|
|
13
|
+
<el-icon @click="handleDownload(file)">
|
|
14
|
+
<Download />
|
|
15
|
+
</el-icon>
|
|
16
|
+
</el-tooltip>
|
|
17
|
+
<el-tooltip v-if="!disabled" content="移除" placement="top">
|
|
18
|
+
<el-icon @click="handleOnRemove(file)"><Close /></el-icon>
|
|
19
|
+
</el-tooltip>
|
|
20
|
+
</el-tag>
|
|
21
|
+
</div>
|
|
22
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
|
|
32
|
+
v-if="!disabled"
|
|
33
|
+
class="el-upload-list__item-delete"
|
|
34
|
+
@click="handleDownload(file)"
|
|
35
|
+
>
|
|
36
|
+
<el-icon><Download /></el-icon>
|
|
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>
|
|
44
|
+
</span>
|
|
45
|
+
</span>
|
|
46
|
+
<el-dialog v-model="dialogVisible" title="预览" width="500">
|
|
47
|
+
<el-image :preview-src-list="previewSrcList" :src="previewImageInfo.src" />
|
|
48
|
+
</el-dialog>
|
|
49
|
+
</div>
|
|
23
50
|
</template>
|
|
24
|
-
|
|
51
|
+
<style scoped>
|
|
52
|
+
/* .el-upload-list--picture-card .el-upload-list__item-actions, */
|
|
53
|
+
.mobile-item-action {
|
|
54
|
+
z-index: 2000;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
25
57
|
<script setup lang="ts">
|
|
26
58
|
import { Close, Paperclip, Download } from '@element-plus/icons-vue'
|
|
27
59
|
import { ref, defineProps } from 'vue'
|
|
28
|
-
import { getSystemFrontendUrl, isPlateSys } from '../../../src/utils/common-util'
|
|
60
|
+
import { getSystemFrontendUrl, isPlateSys, isMobileBrowser, getReplaceUrlDomain } from '../../../src/utils/common-util'
|
|
29
61
|
import { getToken } from '../../../src/utils/auth'
|
|
62
|
+
import { isImage } from '../../../src/utils/util'
|
|
30
63
|
const props = defineProps({
|
|
31
64
|
systemCode: {
|
|
32
65
|
type: String,
|
|
@@ -59,15 +92,24 @@ const props = defineProps({
|
|
|
59
92
|
beforeDownload: {
|
|
60
93
|
type: Function,
|
|
61
94
|
default: () => {}
|
|
95
|
+
},
|
|
96
|
+
file: {
|
|
97
|
+
type: Object,
|
|
98
|
+
default: null
|
|
99
|
+
},
|
|
100
|
+
baseURL: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: null
|
|
62
103
|
}
|
|
63
104
|
})
|
|
64
|
-
const baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
105
|
+
const baseURL = props.baseURL ? props.baseURL: window.$vueApp.config.globalProperties.baseURL
|
|
65
106
|
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
66
107
|
|
|
67
108
|
const dialogVisible = ref<boolean>(false)
|
|
68
109
|
const previewImageInfo = ref<any>({})
|
|
69
110
|
const previewSrcList = ref<string[]>([])
|
|
70
|
-
|
|
111
|
+
const isMobile = ref(isMobileBrowser())
|
|
112
|
+
const emits = defineEmits(['remove'])
|
|
71
113
|
const handleDownload = (file: any) => {
|
|
72
114
|
if (isPromise(props.beforeDownload)) {
|
|
73
115
|
props.beforeDownload(props.pageContext, props.configure, file).then((res: any) => {
|
|
@@ -87,7 +129,8 @@ const handleDownload = (file: any) => {
|
|
|
87
129
|
}
|
|
88
130
|
const download = (file: any) => {
|
|
89
131
|
const token = getToken()
|
|
90
|
-
const
|
|
132
|
+
const fileName = file.showName ? file.showName: file.name
|
|
133
|
+
const showName = fileName.replace('#', '~~').replace('?', '~$').replace('&', '$')
|
|
91
134
|
let url =
|
|
92
135
|
baseURL +
|
|
93
136
|
'/common/super-form/downloads?showName=' +
|
|
@@ -109,10 +152,19 @@ const download = (file: any) => {
|
|
|
109
152
|
window.location.href = url
|
|
110
153
|
}
|
|
111
154
|
const handleOnRemove = (file: any) => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
155
|
+
let isCanRemove = true
|
|
156
|
+
if (props.beforeRemove && typeof props.beforeRemove === 'function') {
|
|
157
|
+
const isMobile = true
|
|
158
|
+
isCanRemove = props.beforeRemove(props.pageContext, props.configure, file, isMobile)
|
|
159
|
+
}
|
|
160
|
+
if (isCanRemove!==undefined && !isCanRemove) {
|
|
161
|
+
// 不能删除文件
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
const index = props.fileList.findIndex((item: any) => (item.serverPath === file.uuid || item.serverPath === file.serverPath))
|
|
165
|
+
console.log('handleOnRemove----props.fileList=', props.fileList, 'index=', index)
|
|
166
|
+
props.fileList.splice(index, 1)
|
|
167
|
+
emits('remove', {file, index: index})
|
|
116
168
|
props.onRemove(file)
|
|
117
169
|
}
|
|
118
170
|
|
|
@@ -120,21 +172,23 @@ const isPromise = (p: any) => {
|
|
|
120
172
|
return p && Object.prototype.toString.call(p) === '[object Promise]'
|
|
121
173
|
}
|
|
122
174
|
const preview = (showName: string, serverPath: string) => {
|
|
123
|
-
console.log('preview')
|
|
175
|
+
console.log('preview----props.fileList=', props.fileList)
|
|
124
176
|
|
|
125
|
-
let
|
|
126
|
-
if (showName &&
|
|
127
|
-
|
|
177
|
+
let isImg = false
|
|
178
|
+
if (showName && isImage(showName)) {
|
|
179
|
+
isImg = true
|
|
128
180
|
}
|
|
129
|
-
if (
|
|
181
|
+
if (isImg) {
|
|
130
182
|
previewImageInfo.value.src = getPreviewSrc(showName, serverPath)
|
|
131
183
|
const srcList: string[] = []
|
|
132
184
|
props.fileList.forEach((item: any) => {
|
|
133
|
-
|
|
185
|
+
const fileName = item.showName ? item.showName: item.name
|
|
186
|
+
srcList.push(getPreviewSrc(fileName, item.serverPath))
|
|
134
187
|
})
|
|
135
188
|
previewSrcList.value = srcList
|
|
136
189
|
dialogVisible.value = true
|
|
137
190
|
} else {
|
|
191
|
+
// 移动端时不能预览文档
|
|
138
192
|
previweDoc(showName, serverPath)
|
|
139
193
|
}
|
|
140
194
|
}
|
|
@@ -184,9 +238,10 @@ function getPreviewSrc(showName: string, serverPath: string) {
|
|
|
184
238
|
showName = formatName(showName)
|
|
185
239
|
const token = getToken()
|
|
186
240
|
let url = baseURL + '/common/super-form/downloads?jwt=' + token
|
|
187
|
-
if (
|
|
241
|
+
if (isPlateSys(props.systemCode)) {
|
|
188
242
|
url = baseAPI + '/component/super-form/downloads?jwt=' + token
|
|
189
243
|
}
|
|
244
|
+
url = getReplaceUrlDomain(url)
|
|
190
245
|
return url + '&showName=' + encodeURI(showName) + '&serverPath=' + serverPath
|
|
191
246
|
}
|
|
192
247
|
|
|
@@ -196,4 +251,16 @@ const formatName = (showName: string) => {
|
|
|
196
251
|
}
|
|
197
252
|
return showName
|
|
198
253
|
}
|
|
254
|
+
|
|
255
|
+
const isPreview = (fileName: string) => {
|
|
256
|
+
if(isMobile.value){
|
|
257
|
+
if (fileName && isImage(fileName)) {
|
|
258
|
+
// 移动端时,只能预览图片
|
|
259
|
+
return true
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
return true
|
|
263
|
+
}
|
|
264
|
+
return false
|
|
265
|
+
}
|
|
199
266
|
</script>
|
|
@@ -1,64 +1,122 @@
|
|
|
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"
|
|
7
7
|
:fileInfo="fileInfo"
|
|
8
|
-
|
|
9
|
-
:fileSetObj="{ accept: accept, multiple: multiple, limitFileSize: limitFileSize }"
|
|
8
|
+
:openFsUpload="openFsUpload"
|
|
9
|
+
:fileSetObj="{ accept: accept, multiple: multiple, limitFileSize: limitFileSize, limit: limitNum }"
|
|
10
10
|
@upload-success="onInputUploadSuccess"
|
|
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"
|
|
18
18
|
:accept="accept"
|
|
19
19
|
:multiple="multiple"
|
|
20
|
-
:limit="
|
|
20
|
+
:limit="limitNum"
|
|
21
21
|
:limitFileSize="limitFileSize"
|
|
22
22
|
:placeholder="placeholder"
|
|
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"
|
|
40
40
|
:accept="accept"
|
|
41
41
|
:multiple="multiple"
|
|
42
|
-
:limit="
|
|
42
|
+
:limit="limitNum"
|
|
43
43
|
:limitFileSize="limitFileSize"
|
|
44
44
|
:placeholder="placeholder"
|
|
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
|
+
ref="fileUploadRef"
|
|
60
|
+
:disabled="disabled"
|
|
61
|
+
:fileInfo="fileInfo"
|
|
62
|
+
:systemCode="systemCode"
|
|
63
|
+
:accept="accept"
|
|
64
|
+
:multiple="multiple"
|
|
65
|
+
:limit="limitNum"
|
|
66
|
+
:limitFileSize="limitFileSize"
|
|
67
|
+
:placeholder="placeholder"
|
|
68
|
+
:action="action"
|
|
69
|
+
:headers="headers"
|
|
70
|
+
:file-list="fileList"
|
|
71
|
+
:beforeUpload="beforeUpload"
|
|
72
|
+
:onSuccess="onSuccess"
|
|
73
|
+
:beforeRemove="beforeRemove"
|
|
74
|
+
:onRemove="onRemove"
|
|
75
|
+
:beforeDownload="beforeDownload"
|
|
76
|
+
:pageContext="pageContext"
|
|
77
|
+
:configure="configure"
|
|
78
|
+
:openFsUpload="openFsUpload"
|
|
79
|
+
:componentId="componentId"
|
|
80
|
+
:componentName="componentName"
|
|
81
|
+
:listCode="listCode"
|
|
82
|
+
:openCameraOrChoosePhoto="openCameraOrChoosePhoto"
|
|
83
|
+
/>
|
|
84
|
+
<FileUploadMobile v-else-if="isMobile"
|
|
85
|
+
ref="fileUploadRef"
|
|
86
|
+
:disabled="disabled"
|
|
87
|
+
:fileInfo="fileInfo"
|
|
88
|
+
:systemCode="systemCode"
|
|
89
|
+
:accept="accept"
|
|
90
|
+
:multiple="multiple"
|
|
91
|
+
:limit="limitNum"
|
|
92
|
+
:limitFileSize="limitFileSize"
|
|
93
|
+
:placeholder="placeholder"
|
|
94
|
+
:action="action"
|
|
95
|
+
:headers="headers"
|
|
96
|
+
:file-list="fileList"
|
|
97
|
+
:beforeUpload="beforeUpload"
|
|
98
|
+
:onSuccess="onSuccess"
|
|
99
|
+
:beforeRemove="beforeRemove"
|
|
100
|
+
:onRemove="onRemove"
|
|
101
|
+
:beforeDownload="beforeDownload"
|
|
102
|
+
:pageContext="pageContext"
|
|
103
|
+
:configure="configure"
|
|
104
|
+
:openFsUpload="openFsUpload"
|
|
105
|
+
:componentId="componentId"
|
|
106
|
+
:componentName="componentName"
|
|
107
|
+
:listCode="listCode"
|
|
108
|
+
:openCameraOrChoosePhoto="openCameraOrChoosePhoto"
|
|
109
|
+
@uploadend="uploadendMobile"
|
|
110
|
+
@remove="removeMobileFile"
|
|
56
111
|
/>
|
|
57
112
|
</template>
|
|
58
113
|
<script setup lang="ts">
|
|
59
114
|
import FsDragUpload from './fs-drag-upload.vue'
|
|
60
115
|
import FsButtonUpload from './fs-button-upload.vue'
|
|
116
|
+
import FileUploadMobile from './file-upload-mobile/file-upload.vue'
|
|
117
|
+
import FileUploadInputMobile from './file-upload-mobile/file-upload-input.vue'
|
|
61
118
|
import { ref, defineProps } from 'vue'
|
|
119
|
+
import { getReplaceUrlDomain, isMobileBrowser, isPlateSys } from '../../../src/utils/common-util'
|
|
62
120
|
const props = defineProps({
|
|
63
121
|
openFsUpload:{
|
|
64
122
|
type: Object,
|
|
@@ -96,7 +154,7 @@ const props = defineProps({
|
|
|
96
154
|
},
|
|
97
155
|
limit: {
|
|
98
156
|
type: Number,
|
|
99
|
-
default:
|
|
157
|
+
default: null
|
|
100
158
|
},
|
|
101
159
|
limitFileSize: {
|
|
102
160
|
type: Number,
|
|
@@ -118,7 +176,7 @@ const props = defineProps({
|
|
|
118
176
|
type: Array<{ showName: string; serverPath: string }>,
|
|
119
177
|
default: () => []
|
|
120
178
|
},
|
|
121
|
-
|
|
179
|
+
beforeUpload: {
|
|
122
180
|
type: Function,
|
|
123
181
|
default: () => {}
|
|
124
182
|
},
|
|
@@ -145,12 +203,47 @@ const props = defineProps({
|
|
|
145
203
|
configure: {
|
|
146
204
|
type: Object,
|
|
147
205
|
default: () => ({})
|
|
206
|
+
},
|
|
207
|
+
// 组件id,在表单或列表中应该唯一,一般传字段名即可
|
|
208
|
+
componentId: {
|
|
209
|
+
type: String,
|
|
210
|
+
default: function () {
|
|
211
|
+
return 'file-upload'
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
// 组件名称,一般是字段label
|
|
215
|
+
componentName: {
|
|
216
|
+
type: String,
|
|
217
|
+
default: function () {
|
|
218
|
+
return 'file-upload'
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
// 列表编码
|
|
222
|
+
listCode: {
|
|
223
|
+
type: String,
|
|
224
|
+
default: null
|
|
225
|
+
},
|
|
226
|
+
// 打开相机和相册选项,默认是都可以打开
|
|
227
|
+
openCameraOrChoosePhoto: {
|
|
228
|
+
type: String,
|
|
229
|
+
default: 'openCameraAndChoosePhoto'
|
|
148
230
|
}
|
|
149
231
|
})
|
|
232
|
+
const isMobile = ref(isMobileBrowser())
|
|
233
|
+
const pageType = ref(props.pageContext.pageType)
|
|
234
|
+
console.log('附件上传控件---fs-upload-new---isMobile=', isMobile.value, 'pageType=', pageType.value , 'systemCode=', props.systemCode ,'configure=', props.configure, 'props.pageContext=', props.pageContext)
|
|
150
235
|
const listFileLabel = ref<string>('')
|
|
151
236
|
if (props.displayType === 'input') {
|
|
152
237
|
listFileLabel.value = props.fileInfo.showName || ''
|
|
153
238
|
}
|
|
239
|
+
let limitNum = ref(null)
|
|
240
|
+
if(props.limit){
|
|
241
|
+
limitNum.value = props.limit
|
|
242
|
+
} else if(props.multiple){
|
|
243
|
+
limitNum.value = 9
|
|
244
|
+
} else {
|
|
245
|
+
limitNum.value = 1
|
|
246
|
+
}
|
|
154
247
|
const onInputUploadSuccess = (res: any) => {
|
|
155
248
|
if (listFileLabel.value) {
|
|
156
249
|
listFileLabel.value = listFileLabel.value + ',' + res.showName
|
|
@@ -179,4 +272,58 @@ const onInputDeleteSuccess = (res: any) => {
|
|
|
179
272
|
listFileLabel.value = props.fileList.map((item: any) => item.showName).join(',')
|
|
180
273
|
props.onRemove()
|
|
181
274
|
}
|
|
275
|
+
|
|
276
|
+
function uploadendMobile(fileList) {
|
|
277
|
+
const fileServerPaths = Array.from(props.fileList,({serverPath})=>serverPath)
|
|
278
|
+
// console.log('uploadendMobile---props.fileList=', props.fileList,'fileServerPaths=',fileServerPaths, 'fileList=', fileList)
|
|
279
|
+
fileList.forEach(file=>{
|
|
280
|
+
// 如果已经存在就不要重复添加到fileList中了
|
|
281
|
+
if(fileServerPaths.indexOf(file.serverPath) < 0){
|
|
282
|
+
props.fileList.push({
|
|
283
|
+
showName: file.name,
|
|
284
|
+
serverPath: file.serverPath
|
|
285
|
+
})
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
props.onSuccess()
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
function removeMobileFile(param) {
|
|
293
|
+
// console.log('removeMobileFile---props.fileList=', props.fileList, 'param=', param)
|
|
294
|
+
const deleteFile = param.rmFiles && param.rmFiles.length > 0 ? param.rmFiles[0] : null
|
|
295
|
+
if(deleteFile){
|
|
296
|
+
let index = props.fileList.findIndex((item: any) => item.serverPath === deleteFile.serverPath)
|
|
297
|
+
if (index > -1) {
|
|
298
|
+
// eslint-disable-next-line vue/no-mutating-props
|
|
299
|
+
props.fileList.splice(index, 1)
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
props.onRemove()
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
const userAgent = ref(null)
|
|
307
|
+
const fileUploadRef = ref(null)
|
|
308
|
+
const userAgentOrg = navigator.userAgent
|
|
309
|
+
if (userAgentOrg.indexOf(' uni-app ') > 0) {
|
|
310
|
+
// 表示uni-app中访问的
|
|
311
|
+
userAgent.value = 'app'
|
|
312
|
+
} else {
|
|
313
|
+
// 表示手机浏览器访问的
|
|
314
|
+
userAgent.value = 'browser'
|
|
315
|
+
}
|
|
316
|
+
// 移动端选择文件结束
|
|
317
|
+
function pickFileDone(data) {
|
|
318
|
+
if (userAgent.value === 'app') {
|
|
319
|
+
fileUploadRef.value.pickFileDone(data)
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// 移动端上传文件结束
|
|
323
|
+
function uploadFileDone(data) {
|
|
324
|
+
if (userAgent.value === 'app') {
|
|
325
|
+
fileUploadRef.value.uploadFileDone(data)
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
defineExpose({pickFileDone,uploadFileDone})
|
|
182
329
|
</script>
|
package/packages/index.js
CHANGED
|
@@ -37,6 +37,9 @@ import DepartmentTreeMobile from './department-tree-mobile'
|
|
|
37
37
|
import DepartmentUserTreeMobile from './department-user-tree-mobile'
|
|
38
38
|
import SuperIcon from './super-icon'
|
|
39
39
|
import FsUploadNew from './fs-upload-new'
|
|
40
|
+
import ScanCodeInputBrowser from './scan-code-input-browser'
|
|
41
|
+
import WorkgroupTreeMobile from './workgroup-tree-mobile'
|
|
42
|
+
import RowForm from './row-form'
|
|
40
43
|
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
|
|
41
44
|
// 将所有组件都存储起来,方便后续统一注册
|
|
42
45
|
const components = [
|
|
@@ -73,7 +76,10 @@ const components = [
|
|
|
73
76
|
DepartmentTreeMobile,
|
|
74
77
|
DepartmentUserTreeMobile,
|
|
75
78
|
SuperIcon,
|
|
76
|
-
FsUploadNew
|
|
79
|
+
FsUploadNew,
|
|
80
|
+
ScanCodeInputBrowser,
|
|
81
|
+
WorkgroupTreeMobile,
|
|
82
|
+
RowForm
|
|
77
83
|
]
|
|
78
84
|
|
|
79
85
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
@@ -131,7 +137,10 @@ export {
|
|
|
131
137
|
DepartmentTreeMobile,
|
|
132
138
|
DepartmentUserTreeMobile,
|
|
133
139
|
SuperIcon,
|
|
134
|
-
FsUploadNew
|
|
140
|
+
FsUploadNew,
|
|
141
|
+
ScanCodeInputBrowser,
|
|
142
|
+
WorkgroupTreeMobile,
|
|
143
|
+
RowForm
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
export default {
|