bri-components 1.2.23 → 1.2.24
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/bri-components.min.js +7 -7
- package/package.json +1 -1
- package/src/components/controls/base/BriUpload/BriUpload.vue +82 -74
- package/src/components/controls/base/BriUpload/uploadList.vue +74 -112
- package/src/components/controls/controlMixin.js +1 -1
- package/src/components/small/DshDropdown.vue +1 -1
- package/src/components/unit/DshFormUnit.vue +1 -1
- package/src/components/unit/DshListUnit.vue +1 -1
- package/src/components/unit/unitMixin.js +6 -4
- package/src/styles/components/controls/base/DshEditor.less +12 -3
package/package.json
CHANGED
|
@@ -6,20 +6,19 @@
|
|
|
6
6
|
@change="change"
|
|
7
7
|
></bri-upload-image>
|
|
8
8
|
|
|
9
|
+
<!-- 上传 -->
|
|
9
10
|
<div
|
|
10
11
|
v-else
|
|
11
|
-
:class="
|
|
12
|
-
prefixCls,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
]"
|
|
12
|
+
:class="{
|
|
13
|
+
[prefixCls]: true,
|
|
14
|
+
'BriUpload': true,
|
|
15
|
+
'BriUpload-disabled': canEdit && !finalCanEdit,
|
|
16
|
+
'BriUpload-readonly': !canEdit,
|
|
17
|
+
'BriUpload-unit': !canEdit && isInTable,
|
|
18
|
+
[`BriUpload-${showType}`]: true,
|
|
19
|
+
}"
|
|
21
20
|
>
|
|
22
|
-
<!--
|
|
21
|
+
<!-- 编辑 -->
|
|
23
22
|
<div
|
|
24
23
|
v-if="finalCanEdit"
|
|
25
24
|
:class="classes"
|
|
@@ -35,43 +34,47 @@
|
|
|
35
34
|
type="file"
|
|
36
35
|
:accept="accept"
|
|
37
36
|
:multiple="multipleMode"
|
|
37
|
+
:disabled="!finalCanEdit || percent > 0"
|
|
38
38
|
:webkitdirectory="false"
|
|
39
|
-
:disabled="finalCanEdit && percent > 0"
|
|
40
39
|
@change="handleChange"
|
|
41
40
|
>
|
|
42
41
|
|
|
43
42
|
<slot>
|
|
44
43
|
<div :class="`BriUpload-${showType}-imageadd`">
|
|
44
|
+
<!-- 上传 -->
|
|
45
45
|
<i-circle
|
|
46
46
|
v-if="percent"
|
|
47
47
|
:class="`BriUpload-${showType}-circle`"
|
|
48
48
|
:percent="percent"
|
|
49
49
|
:stroke-color="percentColor"
|
|
50
50
|
>
|
|
51
|
+
<!-- 上传完 -->
|
|
51
52
|
<Icon
|
|
52
53
|
v-if="percent === 100"
|
|
53
54
|
type="ios-checkmark"
|
|
54
55
|
></Icon>
|
|
56
|
+
<!-- 上传中 -->
|
|
55
57
|
<span v-else-if="showType === 'old'">
|
|
56
58
|
{{ percent }}%
|
|
57
59
|
</span>
|
|
58
60
|
</i-circle>
|
|
59
61
|
|
|
62
|
+
<!-- 未上传 -->
|
|
60
63
|
<template v-else>
|
|
61
64
|
<dsh-icons
|
|
62
|
-
:list="$getOperationList([
|
|
65
|
+
:list="$getOperationList([subType === 'image' ? 'add' : 'upload'])"
|
|
63
66
|
@click="clickUpload"
|
|
64
67
|
></dsh-icons>
|
|
65
68
|
|
|
66
69
|
<span v-if="showType !== 'inline'">
|
|
67
|
-
点击上传{{
|
|
70
|
+
点击上传{{ subType === 'image' ? "图片" : "文件" }}
|
|
68
71
|
</span>
|
|
69
72
|
</template>
|
|
70
73
|
</div>
|
|
71
74
|
</slot>
|
|
72
75
|
</div>
|
|
73
76
|
|
|
74
|
-
<!-- 列表 -->
|
|
77
|
+
<!-- 编辑和查看 列表 -->
|
|
75
78
|
<slot name="list">
|
|
76
79
|
<upload-list
|
|
77
80
|
:canEdit="finalCanEdit"
|
|
@@ -92,6 +95,19 @@
|
|
|
92
95
|
import uploadList from "./uploadList.vue";
|
|
93
96
|
|
|
94
97
|
const prefixCls = "ivu-upload";
|
|
98
|
+
const imageType = ["jpg", "png", "gif", "jpeg", "tiff", "swf"];
|
|
99
|
+
const documentType = ["txt", "doc", "xls", "ppt", "docx", "xlsx", "pptx", "pdf"];
|
|
100
|
+
const videoType = ["flv", "rmvb", "mp4", "mvb"];
|
|
101
|
+
const audioType = ["wma", "mp3", "m4a"];
|
|
102
|
+
const packageType = ["rar", "zip"];
|
|
103
|
+
const fileTypes = [
|
|
104
|
+
...documentType,
|
|
105
|
+
...imageType,
|
|
106
|
+
...videoType,
|
|
107
|
+
...audioType,
|
|
108
|
+
...packageType
|
|
109
|
+
];
|
|
110
|
+
|
|
95
111
|
export default {
|
|
96
112
|
name: "BriUpload",
|
|
97
113
|
mixins: [
|
|
@@ -107,18 +123,17 @@
|
|
|
107
123
|
type: String,
|
|
108
124
|
default: "drag"
|
|
109
125
|
},
|
|
110
|
-
format: {
|
|
111
|
-
type: Array,
|
|
112
|
-
default () {
|
|
113
|
-
return [];
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
126
|
maxSize: {
|
|
117
|
-
type: Number
|
|
127
|
+
type: Number,
|
|
128
|
+
default: 1024
|
|
118
129
|
}
|
|
119
130
|
},
|
|
120
131
|
data () {
|
|
121
132
|
return {
|
|
133
|
+
prefixCls: prefixCls,
|
|
134
|
+
dragOver: false,
|
|
135
|
+
tempIndex: 1,
|
|
136
|
+
|
|
122
137
|
operationMap: {
|
|
123
138
|
upload: {
|
|
124
139
|
customIcon: "bico-upload1"
|
|
@@ -126,73 +141,69 @@
|
|
|
126
141
|
add: {
|
|
127
142
|
icon: "md-add"
|
|
128
143
|
}
|
|
129
|
-
}
|
|
130
|
-
prefixCls: prefixCls,
|
|
131
|
-
dragOver: false,
|
|
132
|
-
tempIndex: 1
|
|
144
|
+
}
|
|
133
145
|
};
|
|
134
146
|
},
|
|
135
147
|
computed: {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
148
|
+
selfPropsObj () {
|
|
149
|
+
return {
|
|
150
|
+
_fileType: "file",
|
|
151
|
+
_showType: this.isFullRow && !this.isInTable ? "old" : "inline", // 宽度为100%、且不在级联表格或内部表格里的 显示老版
|
|
152
|
+
// _multiple: true,
|
|
153
|
+
_format: [],
|
|
154
|
+
|
|
155
|
+
...this.propsObj,
|
|
156
|
+
...this.commonDealPropsObj,
|
|
157
|
+
|
|
158
|
+
_multiple: true // TODO: 解决后端返回的配置数据里,内部表格里的上传字段有脏属性_multiple且为false,早晚要删除这行用上面的那行
|
|
159
|
+
};
|
|
141
160
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return this.propsObj._fileType;
|
|
161
|
+
subType () {
|
|
162
|
+
return this.selfPropsObj._fileType;
|
|
145
163
|
},
|
|
146
|
-
|
|
147
|
-
return this.
|
|
164
|
+
showType () {
|
|
165
|
+
return this.selfPropsObj._showType;
|
|
166
|
+
},
|
|
167
|
+
format () {
|
|
168
|
+
return this.selfPropsObj._format;
|
|
148
169
|
},
|
|
149
170
|
|
|
171
|
+
// 限制文件格式
|
|
150
172
|
accept () {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const audioType = ["wma", "mp3", "m4a"];
|
|
155
|
-
const packageType = ["rar", "zip"];
|
|
156
|
-
|
|
157
|
-
// 限制文件格式
|
|
158
|
-
return (
|
|
159
|
-
this.fileType === "image"
|
|
160
|
-
? imageType
|
|
161
|
-
: [
|
|
162
|
-
...documentType,
|
|
163
|
-
...imageType,
|
|
164
|
-
...videoType,
|
|
165
|
-
...audioType,
|
|
166
|
-
...packageType
|
|
167
|
-
]
|
|
168
|
-
).map(item => `.${item}`).join();
|
|
173
|
+
return (this.subType === "image" ? imageType : fileTypes)
|
|
174
|
+
.map(type => `.${type}`)
|
|
175
|
+
.join();
|
|
169
176
|
},
|
|
170
177
|
classes () {
|
|
171
|
-
return
|
|
172
|
-
`${prefixCls}
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
];
|
|
178
|
+
return {
|
|
179
|
+
[`${prefixCls}`]: true,
|
|
180
|
+
[`${prefixCls}-select`]: this.type === "select",
|
|
181
|
+
[`${prefixCls}-drag`]: this.type === "drag",
|
|
182
|
+
[`${prefixCls}-dragOver`]: this.type === "drag" && this.dragOver,
|
|
183
|
+
[`BriUpload-${this.showType}-wrapper`]: true
|
|
184
|
+
};
|
|
180
185
|
}
|
|
181
186
|
},
|
|
182
187
|
methods: {
|
|
183
188
|
clickUpload () {
|
|
184
189
|
this.$refs.input.click();
|
|
185
190
|
},
|
|
186
|
-
clickDeteItem (fileItem) {
|
|
187
|
-
this.curValList.splice(
|
|
191
|
+
clickDeteItem (fileItem, fileIndex) {
|
|
192
|
+
this.curValList.splice(fileIndex, 1);
|
|
188
193
|
this.curValList = [...this.curValList];
|
|
189
194
|
},
|
|
190
195
|
successCb (res, data) {
|
|
191
196
|
if (data.res === 0) {
|
|
192
|
-
this.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
if (this.multipleMode) {
|
|
198
|
+
this.curValList = [
|
|
199
|
+
...this.curValList,
|
|
200
|
+
data.data
|
|
201
|
+
];
|
|
202
|
+
} else {
|
|
203
|
+
this.curValList = [
|
|
204
|
+
data.data
|
|
205
|
+
];
|
|
206
|
+
}
|
|
196
207
|
} else {
|
|
197
208
|
this.$Message.error({
|
|
198
209
|
content: `操作失败!${this.$getMsgText(data.msg)}`,
|
|
@@ -223,12 +234,9 @@
|
|
|
223
234
|
|
|
224
235
|
postFiles.forEach(fileItem => {
|
|
225
236
|
if (
|
|
226
|
-
|
|
227
|
-
(
|
|
237
|
+
!this.format.every(item => item.toLocaleLowerCase() !== fileItem.name.split(".").pop().toLocaleLowerCase()) &&
|
|
238
|
+
(fileItem.size <= this.maxSize * 1024)
|
|
228
239
|
) {
|
|
229
|
-
return false;
|
|
230
|
-
} else {
|
|
231
|
-
// 上传接口
|
|
232
240
|
this.handlePost(fileItem);
|
|
233
241
|
}
|
|
234
242
|
});
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
class="uploadList-list"
|
|
13
13
|
>
|
|
14
14
|
<div
|
|
15
|
-
v-for="fileItem in files"
|
|
15
|
+
v-for="(fileItem, fileIndex) in files"
|
|
16
16
|
:key="fileItem._key || fileItem._id"
|
|
17
17
|
class="item"
|
|
18
18
|
>
|
|
19
19
|
<!-- 展示图 -->
|
|
20
20
|
<div class="item-show">
|
|
21
21
|
<img
|
|
22
|
-
v-if="
|
|
22
|
+
v-if="fileItem.mimetype.includes('image')"
|
|
23
23
|
:data-original="fileItem.url"
|
|
24
24
|
:src="$imageResize(fileItem.url, imageResizeConfig)"
|
|
25
25
|
:alt="fileItem.name"
|
|
@@ -32,23 +32,14 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<!-- 展示名称 -->
|
|
35
|
-
<
|
|
36
|
-
v-if="propsObj._fileType != 'image'"
|
|
37
|
-
class="item-name"
|
|
38
|
-
:content="fileItem.name"
|
|
39
|
-
:transfer="true"
|
|
40
|
-
placement="top-start"
|
|
41
|
-
max-width="300"
|
|
42
|
-
>
|
|
43
|
-
<p class="item-name-title">{{ fileItem.name }}</p>
|
|
44
|
-
</bri-tooltip>
|
|
35
|
+
<p class="item-name-title">{{ fileItem.name }}</p>
|
|
45
36
|
|
|
46
37
|
<!-- 图标 -->
|
|
47
38
|
<dsh-icons
|
|
48
39
|
class="item-action"
|
|
49
40
|
item-class="item-action-icon"
|
|
50
|
-
:list="$getOperationList(getBtns(
|
|
51
|
-
@click="$dispatchEvent($event,fileItem)"
|
|
41
|
+
:list="$getOperationList(getBtns(fileItem))"
|
|
42
|
+
@click="$dispatchEvent($event, fileItem, fileIndex)"
|
|
52
43
|
></dsh-icons>
|
|
53
44
|
</div>
|
|
54
45
|
</div>
|
|
@@ -63,7 +54,7 @@
|
|
|
63
54
|
</div>
|
|
64
55
|
</template>
|
|
65
56
|
|
|
66
|
-
<!--
|
|
57
|
+
<!-- 新展示方式 -->
|
|
67
58
|
<template v-else>
|
|
68
59
|
<!-- 有值 -->
|
|
69
60
|
<div
|
|
@@ -72,12 +63,12 @@
|
|
|
72
63
|
class="uploadList-inline-list"
|
|
73
64
|
>
|
|
74
65
|
<div
|
|
75
|
-
v-for="fileItem in files"
|
|
66
|
+
v-for="(fileItem, fileIndex) in files"
|
|
76
67
|
:key="fileItem.url"
|
|
77
68
|
class="item"
|
|
78
69
|
>
|
|
79
70
|
<img
|
|
80
|
-
v-if="
|
|
71
|
+
v-if="fileItem.mimetype.includes('image')"
|
|
81
72
|
:data-original="fileItem.url"
|
|
82
73
|
:src="$imageResize(fileItem.url, imageResizeConfig)"
|
|
83
74
|
:alt="fileItem.name"
|
|
@@ -91,8 +82,8 @@
|
|
|
91
82
|
<dsh-icons
|
|
92
83
|
class="item-action"
|
|
93
84
|
item-class="item-action-icon"
|
|
94
|
-
:list="$getOperationList(getBtns(
|
|
95
|
-
@click="$dispatchEvent($event,fileItem)"
|
|
85
|
+
:list="$getOperationList(getBtns(fileItem))"
|
|
86
|
+
@click="$dispatchEvent($event, fileItem, fileIndex)"
|
|
96
87
|
></dsh-icons>
|
|
97
88
|
</div>
|
|
98
89
|
</div>
|
|
@@ -138,91 +129,83 @@
|
|
|
138
129
|
}
|
|
139
130
|
},
|
|
140
131
|
computed: {
|
|
141
|
-
|
|
132
|
+
imageResizeConfig () {
|
|
133
|
+
return {};
|
|
134
|
+
},
|
|
135
|
+
noText () {
|
|
136
|
+
return this.canEdit
|
|
137
|
+
? `未上传${this.propsObj._fileType === "image" ? "图片" : "文件"}`
|
|
138
|
+
: this.emptyShowVal;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
allOperationMap () {
|
|
142
142
|
return {
|
|
143
|
-
|
|
143
|
+
canDelete: {
|
|
144
144
|
name: "删除",
|
|
145
|
+
type: "canDelete",
|
|
145
146
|
icon: "ios-trash-outline",
|
|
146
147
|
size: "16",
|
|
147
|
-
event: "clickDeleteItem"
|
|
148
|
-
canShow: this.canEdit
|
|
148
|
+
event: "clickDeleteItem"
|
|
149
149
|
},
|
|
150
|
-
|
|
150
|
+
canDownload: {
|
|
151
151
|
name: "下载",
|
|
152
|
+
type: "canDownload",
|
|
152
153
|
icon: "ios-cloud-download-outline",
|
|
153
154
|
size: "14",
|
|
154
|
-
event: "handleDownload"
|
|
155
|
-
canShow: true
|
|
155
|
+
event: "handleDownload"
|
|
156
156
|
},
|
|
157
|
-
|
|
157
|
+
canPreview: {
|
|
158
158
|
name: "预览",
|
|
159
|
+
type: "canPreview",
|
|
159
160
|
icon: "ios-eye-outline",
|
|
160
161
|
size: "22",
|
|
161
|
-
|
|
162
|
-
event: "clickPreview",
|
|
163
|
-
canShow: undefined
|
|
162
|
+
event: "clickPreview"
|
|
164
163
|
}
|
|
165
164
|
};
|
|
166
165
|
},
|
|
167
|
-
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return `未上传${this.propsObj._fileType === "image" ? "图片" : "文件"} `;
|
|
176
|
-
} else {
|
|
177
|
-
return this.emptyShowVal;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
166
|
+
operationMap () {
|
|
167
|
+
return this.canEdit
|
|
168
|
+
? this.allOperationMap
|
|
169
|
+
: this.$categoryMapToMap(
|
|
170
|
+
this.allOperationMap,
|
|
171
|
+
undefined,
|
|
172
|
+
["canDelete"]
|
|
173
|
+
);
|
|
180
174
|
}
|
|
181
175
|
},
|
|
182
176
|
data () {
|
|
183
177
|
return {};
|
|
184
178
|
},
|
|
185
179
|
methods: {
|
|
186
|
-
getBtns (canPreview) {
|
|
187
|
-
this.operationMap.preview.canShow = canPreview;
|
|
188
|
-
return Object.keys(this.operationMap).filter(attr => this.operationMap[attr].canShow);
|
|
189
|
-
},
|
|
190
|
-
|
|
191
180
|
// 点击删除某项
|
|
192
|
-
clickDeleteItem (operationItem, fileItem) {
|
|
193
|
-
this.$emit("deleteItem", fileItem);
|
|
181
|
+
clickDeleteItem (operationItem, fileItem, fileIndex) {
|
|
182
|
+
this.$emit("deleteItem", fileItem, fileIndex);
|
|
194
183
|
},
|
|
195
184
|
// 点击文件预览 -file服务器的数据列表
|
|
196
|
-
clickPreview (operationItem, fileItem) {
|
|
197
|
-
if (
|
|
198
|
-
this.
|
|
199
|
-
|
|
200
|
-
|
|
185
|
+
clickPreview (operationItem, fileItem, fileIndex) {
|
|
186
|
+
if (fileItem.mimetype.includes("image")) {
|
|
187
|
+
const viewerImage = this.$refs.viewerImage;
|
|
188
|
+
const findIndex = this.files
|
|
189
|
+
.filter(valItem => valItem.mimetype.includes("image"))
|
|
190
|
+
.findIndex(valItem => valItem.url === fileItem.url);
|
|
191
|
+
|
|
192
|
+
const viewer = new Viewer(viewerImage, {
|
|
193
|
+
url: "data-original",
|
|
194
|
+
hidden: function () {
|
|
195
|
+
viewer.destroy();
|
|
196
|
+
},
|
|
197
|
+
loop: false,
|
|
198
|
+
initialViewIndex: findIndex,
|
|
199
|
+
zIndex: 2147483647
|
|
200
|
+
});
|
|
201
|
+
viewer.show();
|
|
201
202
|
} else {
|
|
202
203
|
window.open(fileItem.url);
|
|
203
204
|
}
|
|
204
205
|
},
|
|
205
|
-
// 图片预览
|
|
206
|
-
previewImage (src) {
|
|
207
|
-
let viewerImage = this.$refs.viewerImage;
|
|
208
|
-
let findIndex = this.files
|
|
209
|
-
.filter(valItem => valItem.mimetype.indexOf("image") > -1)
|
|
210
|
-
.findIndex(valItem => valItem.url === src);
|
|
211
206
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
hidden: function () {
|
|
215
|
-
viewer.destroy();
|
|
216
|
-
},
|
|
217
|
-
loop: false,
|
|
218
|
-
initialViewIndex: findIndex,
|
|
219
|
-
zIndex: 2147483647
|
|
220
|
-
});
|
|
221
|
-
viewer.show();
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
// 下载
|
|
225
|
-
handleDownload (operationItem, fileItem) {
|
|
207
|
+
// 接口 -下载
|
|
208
|
+
handleDownload (operationItem, fileItem, fileIndex) {
|
|
226
209
|
axios
|
|
227
210
|
.get(fileItem.url, {
|
|
228
211
|
responseType: "blob"
|
|
@@ -243,55 +226,34 @@
|
|
|
243
226
|
}
|
|
244
227
|
});
|
|
245
228
|
},
|
|
246
|
-
|
|
247
|
-
// format (fileItem) {
|
|
248
|
-
// const format = fileItem.name.split(".").pop().toLocaleLowerCase() || "";
|
|
249
|
-
// let type = "ios-document-outline";
|
|
250
|
-
|
|
251
|
-
// if (["gif", "jpg", "jpeg", "png", "bmp", "webp"].indexOf(format) > -1) {
|
|
252
|
-
// type = "ios-image";
|
|
253
|
-
// }
|
|
254
|
-
// if (["mp4", "m3u8", "rmvb", "avi", "swf", "3gp", "mkv", "flv"].indexOf(format) > -1) {
|
|
255
|
-
// type = "ios-film";
|
|
256
|
-
// }
|
|
257
|
-
// if (["mp3", "wav", "wma", "ogg", "aac", "flac"].indexOf(format) > -1) {
|
|
258
|
-
// type = "ios-musical-notes";
|
|
259
|
-
// }
|
|
260
|
-
// if (["doc", "txt", "docx", "pages", "epub", "pdf"].indexOf(format) > -1) {
|
|
261
|
-
// type = "md-document";
|
|
262
|
-
// }
|
|
263
|
-
// if (["numbers", "csv", "xls", "xlsx"].indexOf(format) > -1) {
|
|
264
|
-
// type = "ios-stats";
|
|
265
|
-
// }
|
|
266
|
-
// if (["keynote", "ppt", "pptx"].indexOf(format) > -1) {
|
|
267
|
-
// type = "ios-videocam";
|
|
268
|
-
// }
|
|
269
|
-
|
|
270
|
-
// return type;
|
|
271
|
-
// },
|
|
272
229
|
// 获取不同类型文件的图片
|
|
273
|
-
getFileImage (
|
|
274
|
-
if (!
|
|
230
|
+
getFileImage (fileItem) {
|
|
231
|
+
if (!fileItem.mimetype) {
|
|
275
232
|
return this.$imageSrcMap.fileType.other;
|
|
276
|
-
} else if (
|
|
277
|
-
return
|
|
278
|
-
} else if (
|
|
233
|
+
} else if (fileItem.mimetype.includes("image")) {
|
|
234
|
+
return fileItem.url; // 压缩图片:将图片最长的边限制在100像素,短边按比例处理
|
|
235
|
+
} else if (fileItem.mimetype.includes("text/plain")) {
|
|
279
236
|
return this.$imageSrcMap.fileType.text;
|
|
280
|
-
} else if (
|
|
237
|
+
} else if (fileItem.mimetype.includes("application/pdf")) {
|
|
281
238
|
return this.$imageSrcMap.fileType.pdf;
|
|
282
|
-
} else if (
|
|
239
|
+
} else if (fileItem.mimetype.includes("wordprocessingml.document") || fileItem.mimetype.includes("application/msword")) {
|
|
283
240
|
return this.$imageSrcMap.fileType.doc;
|
|
284
|
-
} else if (
|
|
241
|
+
} else if (fileItem.mimetype.includes("presentationml.presentation") || fileItem.mimetype.includes("application/vnd.ms-powerpoint")) {
|
|
285
242
|
return this.$imageSrcMap.fileType.ppt;
|
|
286
|
-
} else if (
|
|
243
|
+
} else if (fileItem.mimetype.includes("spreadsheetml.sheet")) {
|
|
287
244
|
return this.$imageSrcMap.fileType.excel;
|
|
288
|
-
} else if (
|
|
245
|
+
} else if (fileItem.mimetype.includes("application/x-zip-compressed")) {
|
|
289
246
|
return this.$imageSrcMap.fileType.zip;
|
|
290
|
-
} else if (
|
|
247
|
+
} else if (fileItem.mimetype.includes("application/x-rar-compressed")) {
|
|
291
248
|
return this.$imageSrcMap.fileType.rar;
|
|
292
249
|
} else {
|
|
293
250
|
return this.$imageSrcMap.fileType.other;
|
|
294
251
|
}
|
|
252
|
+
},
|
|
253
|
+
getBtns (fileItem) {
|
|
254
|
+
return ["image", "application/pdf", "text/plain"].some(type => fileItem.mimetype.includes(type))
|
|
255
|
+
? undefined
|
|
256
|
+
: ["canDelete", "canDownload"];
|
|
295
257
|
}
|
|
296
258
|
}
|
|
297
259
|
};
|
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
|
|
85
85
|
},
|
|
86
86
|
multipleMode () {
|
|
87
|
-
return !!this.propsObj._multiple;
|
|
87
|
+
return this.selfPropsObj ? !!this.selfPropsObj._multiple : !!this.propsObj._multiple;
|
|
88
88
|
},
|
|
89
89
|
commonDealPropsObj () {
|
|
90
90
|
const selectControlTypes = ["date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "coordinates", "users", "departments"];
|
|
@@ -21,11 +21,13 @@ export default {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
data () {
|
|
24
|
-
return {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
return {};
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
curComponentName () {
|
|
28
|
+
return componentNameMap[this.formItem._type] || "DshUndeveloped";
|
|
29
|
+
}
|
|
27
30
|
},
|
|
28
|
-
computed: {},
|
|
29
31
|
created () { },
|
|
30
32
|
methods: {
|
|
31
33
|
change (...params) {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
.DshEditor {
|
|
2
2
|
width: 100%;
|
|
3
|
+
|
|
3
4
|
#show {
|
|
5
|
+
white-space: pre-wrap;
|
|
6
|
+
word-break: break-word;
|
|
7
|
+
|
|
4
8
|
p {
|
|
5
9
|
font-size: 14px !important;
|
|
6
10
|
}
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
min-height: 32px;
|
|
25
29
|
padding: 4px 7px;
|
|
26
30
|
border-radius: @borderRadius;
|
|
27
|
-
|
|
31
|
+
|
|
28
32
|
&.bri-control-nodata {
|
|
29
33
|
line-height: 24px;
|
|
30
34
|
}
|
|
@@ -38,13 +42,14 @@
|
|
|
38
42
|
&-toolbar {
|
|
39
43
|
margin-top: 5px;
|
|
40
44
|
}
|
|
41
|
-
|
|
45
|
+
|
|
42
46
|
&-text {
|
|
43
47
|
min-height: 130px;
|
|
48
|
+
|
|
44
49
|
ul li {
|
|
45
50
|
list-style: disc;
|
|
46
51
|
}
|
|
47
|
-
|
|
52
|
+
|
|
48
53
|
ol li {
|
|
49
54
|
list-style: auto;
|
|
50
55
|
}
|
|
@@ -62,5 +67,9 @@
|
|
|
62
67
|
|
|
63
68
|
&-show {
|
|
64
69
|
#show();
|
|
70
|
+
|
|
71
|
+
&-nodata {
|
|
72
|
+
.bri-control-nodata();
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
75
|
}
|