agilebuilder-ui 1.1.4-temp6 → 1.1.4-temp7
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/package.json
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
<div style="width: 100%">
|
|
3
|
+
<el-upload
|
|
4
|
+
v-if="!disabled"
|
|
5
|
+
ref="buttonUploadRef"
|
|
6
|
+
class="upload-demo"
|
|
7
|
+
:accept="accept"
|
|
8
|
+
:show-file-list="false"
|
|
9
|
+
auto-upload
|
|
10
|
+
:headers="headers"
|
|
11
|
+
:disabled="!openFsUpload"
|
|
12
|
+
:action="defaultAction"
|
|
13
|
+
:multiple="multiple"
|
|
14
|
+
:before-upload="handleBeforeUpload"
|
|
15
|
+
:before-remove="beforeRemove"
|
|
16
|
+
:on-success="onSuccess"
|
|
17
|
+
>
|
|
18
|
+
<el-button size="small" type="primary">{{ placeholder }}</el-button>
|
|
19
|
+
<template #tip>
|
|
20
|
+
<el-text size="small">
|
|
21
|
+
{{ accept }}
|
|
22
|
+
{{ $t('imatrixUIMessage.uploadFileTip', { fileSize: limitFileSize }) }}</el-text
|
|
23
|
+
>
|
|
24
|
+
</template>
|
|
25
|
+
</el-upload>
|
|
26
|
+
</div>
|
|
22
27
|
<template v-if="fileList && fileList.length > 0">
|
|
23
28
|
<fs-preview-new
|
|
24
29
|
:disabled="disabled"
|
|
@@ -38,6 +43,7 @@ import { getSystemFrontendUrl, isPlateSys } from '../../../src/utils/common-util
|
|
|
38
43
|
import { getToken } from '../../../src/utils/auth'
|
|
39
44
|
import type { UploadFile, UploadFiles } from 'element-plus'
|
|
40
45
|
import fsPreviewNew from './fs-preview-new.vue'
|
|
46
|
+
import { ElMessage } from 'element-plus'
|
|
41
47
|
const props = defineProps({
|
|
42
48
|
openFsUpload: {
|
|
43
49
|
type: Boolean,
|
|
@@ -64,10 +70,6 @@ const props = defineProps({
|
|
|
64
70
|
type: Boolean,
|
|
65
71
|
default: false
|
|
66
72
|
},
|
|
67
|
-
limit: {
|
|
68
|
-
type: Number,
|
|
69
|
-
default: 1
|
|
70
|
-
},
|
|
71
73
|
limitFileSize: {
|
|
72
74
|
type: Number,
|
|
73
75
|
default: 30
|
|
@@ -120,7 +122,7 @@ const props = defineProps({
|
|
|
120
122
|
const baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
121
123
|
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
122
124
|
const defaultAction = ref<string>('')
|
|
123
|
-
|
|
125
|
+
const buttonUploadRef = ref()
|
|
124
126
|
if (props.action) {
|
|
125
127
|
defaultAction.value = props.action
|
|
126
128
|
} else {
|
|
@@ -145,6 +147,7 @@ const handleBeforeUpload = (file: File) => {
|
|
|
145
147
|
})
|
|
146
148
|
}
|
|
147
149
|
const onSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
|
150
|
+
ElMessage.success('上传成功')
|
|
148
151
|
// eslint-disable-next-line vue/no-mutating-props
|
|
149
152
|
props.fileList.push({
|
|
150
153
|
showName: response.name,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-upload
|
|
3
3
|
v-if="!disabled"
|
|
4
|
+
class="upload-demo"
|
|
4
5
|
style="width: 100%"
|
|
5
6
|
:accept="accept"
|
|
6
|
-
:limit="limit"
|
|
7
7
|
:show-file-list="false"
|
|
8
8
|
drag
|
|
9
|
-
auto-upload
|
|
10
9
|
:headers="headers"
|
|
11
10
|
:action="defaultAction"
|
|
12
11
|
:multiple="multiple"
|
|
13
|
-
:
|
|
14
|
-
:before-upload="handleBeforeUpload"
|
|
12
|
+
:on-success="onUploadSuccess"
|
|
15
13
|
:before-remove="beforeRemove"
|
|
16
|
-
:on-success="onSuccess"
|
|
17
14
|
>
|
|
18
15
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
19
16
|
<div class="el-upload__text">{{ placeholder }}</div>
|
|
20
17
|
<template #tip>
|
|
21
|
-
<el-text size="small">
|
|
18
|
+
<el-text size="small">
|
|
19
|
+
{{ accept }}
|
|
20
|
+
{{ $t('imatrixUIMessage.uploadFileTip', { fileSize: limitFileSize }) }}
|
|
21
|
+
</el-text>
|
|
22
22
|
</template>
|
|
23
23
|
</el-upload>
|
|
24
24
|
<template v-if="fileList && fileList.length > 0">
|
|
@@ -40,6 +40,7 @@ import { getSystemFrontendUrl, isPlateSys } from '../../../src/utils/common-util
|
|
|
40
40
|
import { getToken } from '../../../src/utils/auth'
|
|
41
41
|
import type { UploadFile, UploadFiles } from 'element-plus'
|
|
42
42
|
import fsPreviewNew from './fs-preview-new.vue'
|
|
43
|
+
import { ElMessage } from 'element-plus'
|
|
43
44
|
const props = defineProps({
|
|
44
45
|
openFsUpload: {
|
|
45
46
|
type: Boolean,
|
|
@@ -66,10 +67,6 @@ const props = defineProps({
|
|
|
66
67
|
type: Boolean,
|
|
67
68
|
default: false
|
|
68
69
|
},
|
|
69
|
-
limit: {
|
|
70
|
-
type: Number,
|
|
71
|
-
default: 1
|
|
72
|
-
},
|
|
73
70
|
limitFileSize: {
|
|
74
71
|
type: Number,
|
|
75
72
|
default: 30
|
|
@@ -122,7 +119,6 @@ const props = defineProps({
|
|
|
122
119
|
const baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
123
120
|
const baseAPI = window.$vueApp.config.globalProperties.baseAPI
|
|
124
121
|
const defaultAction = ref<string>('')
|
|
125
|
-
|
|
126
122
|
if (props.action) {
|
|
127
123
|
defaultAction.value = props.action
|
|
128
124
|
} else {
|
|
@@ -139,7 +135,8 @@ if (!props.headers || !props.headers['Authorization']) {
|
|
|
139
135
|
const handleBeforeUpload = (file: File) => {
|
|
140
136
|
return props.beforeUpload(file)
|
|
141
137
|
}
|
|
142
|
-
const
|
|
138
|
+
const onUploadSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
|
139
|
+
ElMessage.success('上传成功')
|
|
143
140
|
// eslint-disable-next-line vue/no-mutating-props
|
|
144
141
|
props.fileList.push({
|
|
145
142
|
showName: response.name,
|