@lambo-design/upload-file 1.0.0-beta.35 → 1.0.0-beta.36
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 +3 -3
- package/src/index.vue +21 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/upload-file",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"axios": "^0.24.0",
|
|
14
14
|
"axios-cache-plugin": "^0.1.0",
|
|
15
|
-
"@lambo-design/core": "^4.7.1-beta.
|
|
16
|
-
"@lambo-design/shared": "^1.0.0-beta.
|
|
15
|
+
"@lambo-design/core": "^4.7.1-beta.175",
|
|
16
|
+
"@lambo-design/shared": "^1.0.0-beta.335"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"release-upload-file": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
|
package/src/index.vue
CHANGED
|
@@ -24,12 +24,18 @@
|
|
|
24
24
|
<div class="upload-file-list" v-if="showFileList && resultList.length > 0">
|
|
25
25
|
<List v-if="!isTableCell" border size="small">
|
|
26
26
|
<ListItem v-for="item in resultList" :key="item.fileId ? item.fileId : item.fileCode">
|
|
27
|
-
<div span="21">
|
|
27
|
+
<div span="21" v-if="!clickEventMethodName">
|
|
28
28
|
<a :href="item.fileUrl ? item.fileUrl : item.fileId ? (downloadUrl + item.fileId) : (downloadUrl + item.fileCode)">
|
|
29
29
|
{{ item.fileName }}
|
|
30
30
|
<span class="size" style="margin-left: 5px" v-if="item.showSize">({{ item.showSize }})</span>
|
|
31
31
|
</a>
|
|
32
32
|
</div>
|
|
33
|
+
<div span="21" v-else>
|
|
34
|
+
<a @click="clickFile(item)">
|
|
35
|
+
{{ item.fileName }}
|
|
36
|
+
<span class="size" style="margin-left: 5px" v-if="item.showSize">({{ item.showSize }})</span>
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
33
39
|
<div span="3" style="text-align: right">
|
|
34
40
|
<Button v-if="showPreview" @click="previewFile(item)" type="text">预览</Button>
|
|
35
41
|
<Button v-if="!disabled" @click="deleteFile(item.fileId ? item.fileId : item.fileCode)" type="text">删除</Button>
|
|
@@ -38,10 +44,14 @@
|
|
|
38
44
|
</List>
|
|
39
45
|
<div v-else style="display: flex; align-items: center; justify-content: space-between;" v-for="item in resultList" :key="item.fileId ? item.fileId : item.fileCode">
|
|
40
46
|
<Tooltip max-width="200" :content="item.fileName + (item.showSize ? ' (' + item.showSize + ')' : '')" :transfer="true" placement="top">
|
|
41
|
-
<a :href="item.fileUrl ? item.fileUrl : item.fileId ? (downloadUrl + item.fileId) : (downloadUrl + item.fileCode)" :style="{display: 'inline-block', width: disabled ? '180px' : showPreview ? '120px' : '150px', textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', lineHeight: '20px', verticalAlign: 'middle'}">
|
|
47
|
+
<a v-if="!clickEventMethodName" :href="item.fileUrl ? item.fileUrl : item.fileId ? (downloadUrl + item.fileId) : (downloadUrl + item.fileCode)" :style="{display: 'inline-block', width: disabled ? '180px' : showPreview ? '120px' : '150px', textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', lineHeight: '20px', verticalAlign: 'middle'}">
|
|
42
48
|
{{ item.fileName }}
|
|
43
49
|
<span style="margin-left: 5px;" v-if="item.showSize">({{ item.showSize }})</span>
|
|
44
50
|
</a>
|
|
51
|
+
<a v-else @click="clickFile(item)">
|
|
52
|
+
{{ item.fileName }}
|
|
53
|
+
<span class="size" style="margin-left: 5px" v-if="item.showSize">({{ item.showSize }})</span>
|
|
54
|
+
</a>
|
|
45
55
|
</Tooltip>
|
|
46
56
|
<div style="display: flex; align-items: center;">
|
|
47
57
|
<span v-if="showPreview" @click="previewFile(item)" style="margin-right: 5px; cursor: pointer;">预览</span>
|
|
@@ -166,6 +176,12 @@ export default {
|
|
|
166
176
|
type: String,
|
|
167
177
|
default: "/oss/file/get/"
|
|
168
178
|
},
|
|
179
|
+
//文件上传成功后 点击文件名回调事件名称
|
|
180
|
+
clickEventMethodName: {
|
|
181
|
+
type: String,
|
|
182
|
+
required: false,
|
|
183
|
+
default: ""
|
|
184
|
+
},
|
|
169
185
|
//文件预览所需文件流服务host
|
|
170
186
|
fileOnlinePreviewHost: {
|
|
171
187
|
type: String,
|
|
@@ -309,6 +325,9 @@ export default {
|
|
|
309
325
|
window.open(config.fileOnlinePreviewContext + '/onlinePreview?url=' + encodeURIComponent(this.encode64(url)));
|
|
310
326
|
}
|
|
311
327
|
},
|
|
328
|
+
clickFile: function (item) {
|
|
329
|
+
this.$emit(this.clickEventMethodName, item)
|
|
330
|
+
},
|
|
312
331
|
deleteFile: function (fileId) {
|
|
313
332
|
if (fileId) {
|
|
314
333
|
let result = [];
|