cloud-web-corejs 1.0.284 → 1.0.286
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 +1 -1
- package/src/components/VabUpload/mixins.js +126 -19
- package/src/components/VabUpload/view.vue +248 -209
- package/src/components/mobile/wf/addTaskUserdialog.vue +100 -80
- package/src/components/mobile/wf/content.vue +1705 -1556
- package/src/components/mobile/wf/deleteTaskUserDialog.vue +73 -54
- package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +8 -6
- package/src/components/mobile/wf/selectUserDialog.vue +118 -0
- package/src/components/mobile/wf/setCandidateDialog.vue +69 -48
- package/src/components/mobile/wf/urgingDialog.vue +75 -52
- package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
- package/src/components/table/index.js +5 -2
- package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +528 -0
- package/src/components/xform/docs/2026-08 xform H5 P1 /345/256/236/347/216/260/350/247/204/346/240/274.md" +412 -0
- package/src/components/xform/docs/2026-08 xform H5 P2 /345/256/236/347/216/260/350/247/204/346/240/274.md" +287 -0
- package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +400 -0
- package/src/components/xform/form-designer/designer.js +5 -0
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +1 -0
- package/src/components/xform/form-designer/form-widget/container-widget/detail-h5-widget.vue +243 -227
- package/src/components/xform/form-designer/form-widget/container-widget/h5-card-pane-widget.vue +228 -207
- package/src/components/xform/form-designer/form-widget/container-widget/h5-card-widget.vue +165 -136
- package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +2 -3
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +3 -3
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +2 -3
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +39 -1
- package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +3 -2
- package/src/components/xform/form-designer/indexMixin.js +35 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +20 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +19 -5
- package/src/components/xform/form-designer/setting-panel/property-editor/h5Span-editor.vue +51 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/itemStyle-editor.vue +39 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +10 -0
- package/src/components/xform/form-designer/toolbar-panel/index.vue +6 -1
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +13 -0
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +22 -6
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +58 -3
- package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -0
- package/src/components/xform/form-render/container-item/detail-h5-item.vue +204 -34
- package/src/components/xform/form-render/container-item/h5-card-pane-item.vue +160 -140
- package/src/components/xform/form-render/container-item/list-h5-item.vue +1917 -1700
- package/src/components/xform/form-render/index.vue +7 -1
- package/src/components/xform/form-render/indexMixin.js +42 -4
- package/src/components/xform/lang/en-US.js +10 -0
- package/src/components/xform/lang/zh-CN.js +10 -0
- package/src/components/xform/styles/h5.scss +2305 -0
- package/src/directive/append-to-body/index.js +48 -0
- package/src/index.js +4 -0
- package/src/views/bd/setting/form_template/edit.vue +25 -3
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
- package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
- package/src/views/bd/setting/form_template/list.vue +1 -0
- package/src/views/bd/setting/form_template/mixins/edit.js +64 -0
- package/src/views/bd/setting/form_template/mixins/list.js +27 -0
- package/src/views/user/form/vform/designer.vue +3 -1
- package/src/components/xform/form-render/container-item/list-h5-item2.vue +0 -1340
package/package.json
CHANGED
|
@@ -114,6 +114,8 @@ tmixins = {
|
|
|
114
114
|
showPrivateProfileDialog: false,
|
|
115
115
|
pasteList: [],
|
|
116
116
|
pasteAreaStatus: false,
|
|
117
|
+
pasteAreaDragging: false,
|
|
118
|
+
pasteAreaDragDepth: 0,
|
|
117
119
|
option: {},
|
|
118
120
|
editFileIndex: -1,
|
|
119
121
|
showFileNameDialog: false,
|
|
@@ -380,6 +382,8 @@ tmixins = {
|
|
|
380
382
|
this.clearFileInfo();
|
|
381
383
|
this.initPickUploadMode();
|
|
382
384
|
this.pasteAreaStatus = false;
|
|
385
|
+
this.pasteAreaDragging = false;
|
|
386
|
+
this.pasteAreaDragDepth = 0;
|
|
383
387
|
this.dialogFormVisible = true;
|
|
384
388
|
/*document.removeEventListener('paste', this.pasteEvent);
|
|
385
389
|
document.addEventListener('paste', this.pasteEvent);*/
|
|
@@ -1212,27 +1216,93 @@ tmixins = {
|
|
|
1212
1216
|
if (!(e.clipboardData && e.clipboardData.items)) {
|
|
1213
1217
|
return;
|
|
1214
1218
|
}
|
|
1215
|
-
|
|
1219
|
+
this.appendPasteFiles(Array.from(e.clipboardData.files));
|
|
1220
|
+
},
|
|
1221
|
+
/* 追加原始文件到左侧待确认列表(粘贴、拖拽共用) */
|
|
1222
|
+
appendPasteFiles(files) {
|
|
1223
|
+
if (!files || !files.length) {
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1216
1226
|
let getFileSuffix = this.$commonFileUtil.getFileSuffix;
|
|
1217
|
-
|
|
1218
|
-
let
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1227
|
+
let fileList = files.map((rawFile) => {
|
|
1228
|
+
let name = rawFile.name;
|
|
1229
|
+
let index = name.lastIndexOf(".");
|
|
1230
|
+
let fileSuffix = getFileSuffix(name);
|
|
1231
|
+
let fileName =
|
|
1232
|
+
index >= 0 ? name.substring(0, index).toString() : name.toString();
|
|
1233
|
+
let file = {
|
|
1234
|
+
name: rawFile.name,
|
|
1235
|
+
size: rawFile.size,
|
|
1236
|
+
raw: rawFile,
|
|
1237
|
+
showUrl: URL.createObjectURL(rawFile),
|
|
1238
|
+
fileName: fileName,
|
|
1239
|
+
fileSuffix: fileSuffix,
|
|
1240
|
+
};
|
|
1241
|
+
return file;
|
|
1242
|
+
});
|
|
1243
|
+
this.pasteList.push(...fileList);
|
|
1244
|
+
},
|
|
1245
|
+
isFileDragEvent(e) {
|
|
1246
|
+
let dataTransfer = e.dataTransfer;
|
|
1247
|
+
if (!dataTransfer || !dataTransfer.types) return false;
|
|
1248
|
+
return Array.prototype.indexOf.call(dataTransfer.types, "Files") >= 0;
|
|
1249
|
+
},
|
|
1250
|
+
handlePasteAreaDragEnter(e) {
|
|
1251
|
+
if (!this.isFileDragEvent(e)) return;
|
|
1252
|
+
e.preventDefault();
|
|
1253
|
+
e.stopPropagation();
|
|
1254
|
+
this.pasteAreaDragDepth++;
|
|
1255
|
+
this.pasteAreaDragging = true;
|
|
1256
|
+
},
|
|
1257
|
+
handlePasteAreaDragOver(e) {
|
|
1258
|
+
if (!this.isFileDragEvent(e)) return;
|
|
1259
|
+
e.preventDefault();
|
|
1260
|
+
e.stopPropagation();
|
|
1261
|
+
e.dataTransfer.dropEffect = "copy";
|
|
1262
|
+
this.pasteAreaDragging = true;
|
|
1263
|
+
},
|
|
1264
|
+
handlePasteAreaDragLeave(e) {
|
|
1265
|
+
if (!this.isFileDragEvent(e)) return;
|
|
1266
|
+
e.preventDefault();
|
|
1267
|
+
e.stopPropagation();
|
|
1268
|
+
this.pasteAreaDragDepth--;
|
|
1269
|
+
if (this.pasteAreaDragDepth <= 0) {
|
|
1270
|
+
this.pasteAreaDragDepth = 0;
|
|
1271
|
+
this.pasteAreaDragging = false;
|
|
1272
|
+
}
|
|
1273
|
+
},
|
|
1274
|
+
handlePasteAreaDrop(e) {
|
|
1275
|
+
this.pasteAreaDragDepth = 0;
|
|
1276
|
+
this.pasteAreaDragging = false;
|
|
1277
|
+
if (!this.isFileDragEvent(e)) return;
|
|
1278
|
+
e.preventDefault();
|
|
1279
|
+
e.stopPropagation();
|
|
1280
|
+
/* 拖入即视为选中该区域,与粘贴保持一致 */
|
|
1281
|
+
this.pasteAreaStatus = true;
|
|
1282
|
+
let dataTransfer = e.dataTransfer;
|
|
1283
|
+
let items = dataTransfer.items ? Array.from(dataTransfer.items) : [];
|
|
1284
|
+
let hasDirectory = false;
|
|
1285
|
+
let files = Array.from(dataTransfer.files || []).filter(
|
|
1286
|
+
(rawFile, index) => {
|
|
1287
|
+
let item = items[index];
|
|
1288
|
+
let getAsEntry = item && item.webkitGetAsEntry;
|
|
1289
|
+
let entry = getAsEntry ? item.webkitGetAsEntry() : null;
|
|
1290
|
+
if (entry && entry.isDirectory) {
|
|
1291
|
+
hasDirectory = true;
|
|
1292
|
+
return false;
|
|
1293
|
+
}
|
|
1294
|
+
return true;
|
|
1295
|
+
}
|
|
1296
|
+
);
|
|
1297
|
+
if (hasDirectory) {
|
|
1298
|
+
this.$message({
|
|
1299
|
+
message: this.$t1("不支持上传文件夹,已自动忽略"),
|
|
1300
|
+
type: "warning",
|
|
1301
|
+
showClose: true,
|
|
1302
|
+
duration: 3000,
|
|
1233
1303
|
});
|
|
1234
|
-
this.pasteList.push(...fileList);
|
|
1235
1304
|
}
|
|
1305
|
+
this.appendPasteFiles(files);
|
|
1236
1306
|
},
|
|
1237
1307
|
deletePasteFile(index) {
|
|
1238
1308
|
this.pasteList.splice(index, 1);
|
|
@@ -1385,6 +1455,10 @@ tViewMixins = {
|
|
|
1385
1455
|
chooseIndex: 0,
|
|
1386
1456
|
fileServerInfo: {},
|
|
1387
1457
|
model: null,
|
|
1458
|
+
// H5 非图片文件预览弹框,见 openFilePreviewDialog
|
|
1459
|
+
showFilePreviewDialog: false,
|
|
1460
|
+
previewFileUrl: null,
|
|
1461
|
+
previewFileName: null,
|
|
1388
1462
|
};
|
|
1389
1463
|
},
|
|
1390
1464
|
computed: {
|
|
@@ -1745,8 +1819,41 @@ tViewMixins = {
|
|
|
1745
1819
|
fileServerPreviewEnabled &&
|
|
1746
1820
|
this.$commonFileUtil.isPreviewFile(url)
|
|
1747
1821
|
) {
|
|
1748
|
-
|
|
1822
|
+
/* 非图片文件:PC 走 $openFilePreview —— 它拿到预览地址后是 openInNewTab
|
|
1823
|
+
(见 utils/vab.js),在 H5 上等于跳出应用、返回全靠浏览器后退,体验断裂。
|
|
1824
|
+
H5 改成本组件内的全屏弹框套 iframe。开关由宿主传 h5Preview(xform 的
|
|
1825
|
+
vabUpload-widget 按 formConfig.layoutType === 'H5' 给),不传则维持原样。 */
|
|
1826
|
+
if (this.$attrs.h5Preview === true || this.$attrs.h5Preview === "true") {
|
|
1827
|
+
this.openFilePreviewDialog(url, this.getAttachmentName(attachment));
|
|
1828
|
+
} else {
|
|
1829
|
+
this.$openFilePreview(url);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
},
|
|
1833
|
+
/**
|
|
1834
|
+
* H5 的非图片文件预览:取预览地址后用弹框里的 iframe 承载。
|
|
1835
|
+
* 取址接口与 $openFilePreview 完全一致,只是不跳新标签页。
|
|
1836
|
+
*/
|
|
1837
|
+
openFilePreviewDialog(url, name) {
|
|
1838
|
+
let fileSuffix = this.$commonFileUtil.getFileSuffix(url);
|
|
1839
|
+
if (!this.$commonFileUtil.isPreviewFile(url)) {
|
|
1840
|
+
return;
|
|
1749
1841
|
}
|
|
1842
|
+
this.$http({
|
|
1843
|
+
url: USER_PREFIX + "/sf_common/getFilePreviewUrl",
|
|
1844
|
+
method: "post",
|
|
1845
|
+
data: {
|
|
1846
|
+
url: url,
|
|
1847
|
+
},
|
|
1848
|
+
isLoading: true,
|
|
1849
|
+
success: (res) => {
|
|
1850
|
+
if (!res.objx) return;
|
|
1851
|
+
this.previewFileUrl = res.objx;
|
|
1852
|
+
// 名字取不到就退回后缀,别让标题栏空着
|
|
1853
|
+
this.previewFileName = name || fileSuffix || "";
|
|
1854
|
+
this.showFilePreviewDialog = true;
|
|
1855
|
+
},
|
|
1856
|
+
});
|
|
1750
1857
|
},
|
|
1751
1858
|
getAttachmentName(attachment) {
|
|
1752
1859
|
let name = null;
|
|
@@ -1,209 +1,248 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div id="uploadImage" :class="classList">
|
|
4
|
-
<div
|
|
5
|
-
class="upload-list"
|
|
6
|
-
model="singer"
|
|
7
|
-
v-for="(attachment, index) in attachments"
|
|
8
|
-
:key="index"
|
|
9
|
-
style="display: inline-block; vertical-align: middle; float: left"
|
|
10
|
-
>
|
|
11
|
-
<template v-if="$attrs.hideInfo !== true && $attrs.hideInfo !== 'true'">
|
|
12
|
-
<div class="upload-box">
|
|
13
|
-
<ul class="el-upload-list el-upload-list--picture">
|
|
14
|
-
<li tabindex="0" class="el-upload-list__item">
|
|
15
|
-
<div>
|
|
16
|
-
<div class="el-upload-list__item-thumbnail">
|
|
17
|
-
<div
|
|
18
|
-
class="show-video"
|
|
19
|
-
v-if="hasPreview(attachment)"
|
|
20
|
-
@click="openPreview(attachment, index)"
|
|
21
|
-
>
|
|
22
|
-
<i class="icon-chakan"></i>
|
|
23
|
-
</div>
|
|
24
|
-
<p>
|
|
25
|
-
<el-image
|
|
26
|
-
:src="getShowUrl(attachment)"
|
|
27
|
-
@click="openPreview(attachment, index)"
|
|
28
|
-
:z-index="999999"
|
|
29
|
-
/>
|
|
30
|
-
</p>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="el-upload-list__item-name">
|
|
33
|
-
<el-tooltip
|
|
34
|
-
:enterable="false"
|
|
35
|
-
class="item"
|
|
36
|
-
effect="dark"
|
|
37
|
-
:content="getAttachmentName(attachment)"
|
|
38
|
-
placement="top"
|
|
39
|
-
>
|
|
40
|
-
<p v-if="$attrs.hideName !== true">
|
|
41
|
-
{{ getAttachmentName(attachment) }}
|
|
42
|
-
</p>
|
|
43
|
-
</el-tooltip>
|
|
44
|
-
<p v-if="$attrs.showSize === true || $attrs.showSize === 'true'">
|
|
45
|
-
{{ formatFileSize(attachment.fileSize) }}
|
|
46
|
-
</p>
|
|
47
|
-
<!-- <p v-if="$attrs.showSortInput !== true && !dataType && $attrs.createBy !== false">
|
|
48
|
-
{{ attachment.createBy }}</p>-->
|
|
49
|
-
<p
|
|
50
|
-
v-if="
|
|
51
|
-
$attrs.showSortInput !== true &&
|
|
52
|
-
!dataType &&
|
|
53
|
-
$attrs.createDate !== false
|
|
54
|
-
"
|
|
55
|
-
>
|
|
56
|
-
{{ attachment.createDate }}
|
|
57
|
-
</p>
|
|
58
|
-
</div>
|
|
59
|
-
<div class="el-upload-input" v-if="$attrs.showSortInput">
|
|
60
|
-
<base-input-number
|
|
61
|
-
v-model="attachment.orders"
|
|
62
|
-
class="button-sty"
|
|
63
|
-
:placeholder="$t2('序号', 'components.VabUpload.orders')"
|
|
64
|
-
:scale="0"
|
|
65
|
-
@change="handleChange"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
<div class="el-upload-input" v-if="$attrs.showNameInput">
|
|
69
|
-
<el-input
|
|
70
|
-
v-model="attachment.name"
|
|
71
|
-
class="button-sty"
|
|
72
|
-
:placeholder="$t2('请输入名称', 'components.VabUpload.name')"
|
|
73
|
-
:scale="0"
|
|
74
|
-
@change="handleChange"
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="el-upload-list__item-status-label">
|
|
78
|
-
<i class="el-icon-upload-success el-icon-check"></i>
|
|
79
|
-
</div>
|
|
80
|
-
<div
|
|
81
|
-
class="el-icon-close"
|
|
82
|
-
@click="deleteFile(index)"
|
|
83
|
-
v-if="
|
|
84
|
-
$attrs.edit !== false &&
|
|
85
|
-
$attrs.edit !== 'false' &&
|
|
86
|
-
attachment.h5 !== 1 &&
|
|
87
|
-
$attrs.remove !== false
|
|
88
|
-
"
|
|
89
|
-
>
|
|
90
|
-
<i
|
|
91
|
-
class="el-tooltip iconfont iconshanchu"
|
|
92
|
-
aria-describedby="el-tooltip-6144"
|
|
93
|
-
tabindex="0"
|
|
94
|
-
></i>
|
|
95
|
-
</div>
|
|
96
|
-
<div class="el-icon-tagEdit" v-if="attachment.h5 !== 1">
|
|
97
|
-
<el-tooltip
|
|
98
|
-
class="item"
|
|
99
|
-
effect="dark"
|
|
100
|
-
:content="$t2('下载', 'system.button.download')"
|
|
101
|
-
placement="top"
|
|
102
|
-
>
|
|
103
|
-
<i class="el-icon-download" @click="downloadFile(attachment)"></i>
|
|
104
|
-
</el-tooltip>
|
|
105
|
-
<el-tooltip
|
|
106
|
-
class="item"
|
|
107
|
-
effect="dark"
|
|
108
|
-
:content="$t2('详情', 'components.VabUpload.detail')"
|
|
109
|
-
placement="top"
|
|
110
|
-
v-if="
|
|
111
|
-
attachment &&
|
|
112
|
-
attachment.id &&
|
|
113
|
-
$attrs.showProperties !== false &&
|
|
114
|
-
!dataType
|
|
115
|
-
"
|
|
116
|
-
>
|
|
117
|
-
<i
|
|
118
|
-
class="iconfont icon-shuxing"
|
|
119
|
-
@click="openPropertiesDialog(attachment)"
|
|
120
|
-
></i>
|
|
121
|
-
</el-tooltip>
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
</li>
|
|
125
|
-
</ul>
|
|
126
|
-
</div>
|
|
127
|
-
</template>
|
|
128
|
-
<template v-else>
|
|
129
|
-
<a>
|
|
130
|
-
<el-image
|
|
131
|
-
:src="getShowUrl(attachment)"
|
|
132
|
-
@click="openPreview(attachment, index)"
|
|
133
|
-
:z-index="999999"
|
|
134
|
-
/>
|
|
135
|
-
</a>
|
|
136
|
-
<a
|
|
137
|
-
href="javascript:void(0);"
|
|
138
|
-
class="del"
|
|
139
|
-
@click="deleteFile(index)"
|
|
140
|
-
v-if="$attrs.edit !== false && $attrs.edit !== 'false' &&
|
|
141
|
-
$attrs.remove !== false"
|
|
142
|
-
><i class="el-icon-error"></i
|
|
143
|
-
></a>
|
|
144
|
-
</template>
|
|
145
|
-
</div>
|
|
146
|
-
<div
|
|
147
|
-
class="el-upload el-upload--picture"
|
|
148
|
-
style="vertical-align: middle; display: inline-block; float: left"
|
|
149
|
-
v-if="$attrs.edit !== false && $attrs.edit !== 'false'"
|
|
150
|
-
>
|
|
151
|
-
<button
|
|
152
|
-
type="button"
|
|
153
|
-
class="avatar-uploader"
|
|
154
|
-
v-if="showUploadBtn"
|
|
155
|
-
@keyup.prevent
|
|
156
|
-
@keydown.enter.prevent
|
|
157
|
-
@click="openUploadDialog()"
|
|
158
|
-
@mouseenter="uploadEnterOver()"
|
|
159
|
-
@mouseleave="uploadEnterLeave()"
|
|
160
|
-
>
|
|
161
|
-
<i class="el-icon-plus avatar-uploader-icon"></i>
|
|
162
|
-
</button>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
<propertiesDialog
|
|
166
|
-
v-if="showPropertiesDialog"
|
|
167
|
-
:visiable.sync="showPropertiesDialog"
|
|
168
|
-
:editAttachment.sync="editAttachment"
|
|
169
|
-
:edit.sync="$attrs.edit"
|
|
170
|
-
></propertiesDialog>
|
|
171
|
-
<el-image-viewer
|
|
172
|
-
v-if="showViewer"
|
|
173
|
-
:on-close="closeViewer"
|
|
174
|
-
:initial-index.sync="chooseIndex"
|
|
175
|
-
:url-list="previewList"
|
|
176
|
-
/>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div id="uploadImage" :class="classList">
|
|
4
|
+
<div
|
|
5
|
+
class="upload-list"
|
|
6
|
+
model="singer"
|
|
7
|
+
v-for="(attachment, index) in attachments"
|
|
8
|
+
:key="index"
|
|
9
|
+
style="display: inline-block; vertical-align: middle; float: left"
|
|
10
|
+
>
|
|
11
|
+
<template v-if="$attrs.hideInfo !== true && $attrs.hideInfo !== 'true'">
|
|
12
|
+
<div class="upload-box">
|
|
13
|
+
<ul class="el-upload-list el-upload-list--picture">
|
|
14
|
+
<li tabindex="0" class="el-upload-list__item">
|
|
15
|
+
<div>
|
|
16
|
+
<div class="el-upload-list__item-thumbnail">
|
|
17
|
+
<div
|
|
18
|
+
class="show-video"
|
|
19
|
+
v-if="hasPreview(attachment)"
|
|
20
|
+
@click="openPreview(attachment, index)"
|
|
21
|
+
>
|
|
22
|
+
<i class="icon-chakan"></i>
|
|
23
|
+
</div>
|
|
24
|
+
<p>
|
|
25
|
+
<el-image
|
|
26
|
+
:src="getShowUrl(attachment)"
|
|
27
|
+
@click="openPreview(attachment, index)"
|
|
28
|
+
:z-index="999999"
|
|
29
|
+
/>
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="el-upload-list__item-name">
|
|
33
|
+
<el-tooltip
|
|
34
|
+
:enterable="false"
|
|
35
|
+
class="item"
|
|
36
|
+
effect="dark"
|
|
37
|
+
:content="getAttachmentName(attachment)"
|
|
38
|
+
placement="top"
|
|
39
|
+
>
|
|
40
|
+
<p v-if="$attrs.hideName !== true">
|
|
41
|
+
{{ getAttachmentName(attachment) }}
|
|
42
|
+
</p>
|
|
43
|
+
</el-tooltip>
|
|
44
|
+
<p v-if="$attrs.showSize === true || $attrs.showSize === 'true'">
|
|
45
|
+
{{ formatFileSize(attachment.fileSize) }}
|
|
46
|
+
</p>
|
|
47
|
+
<!-- <p v-if="$attrs.showSortInput !== true && !dataType && $attrs.createBy !== false">
|
|
48
|
+
{{ attachment.createBy }}</p>-->
|
|
49
|
+
<p
|
|
50
|
+
v-if="
|
|
51
|
+
$attrs.showSortInput !== true &&
|
|
52
|
+
!dataType &&
|
|
53
|
+
$attrs.createDate !== false
|
|
54
|
+
"
|
|
55
|
+
>
|
|
56
|
+
{{ attachment.createDate }}
|
|
57
|
+
</p>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="el-upload-input" v-if="$attrs.showSortInput">
|
|
60
|
+
<base-input-number
|
|
61
|
+
v-model="attachment.orders"
|
|
62
|
+
class="button-sty"
|
|
63
|
+
:placeholder="$t2('序号', 'components.VabUpload.orders')"
|
|
64
|
+
:scale="0"
|
|
65
|
+
@change="handleChange"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="el-upload-input" v-if="$attrs.showNameInput">
|
|
69
|
+
<el-input
|
|
70
|
+
v-model="attachment.name"
|
|
71
|
+
class="button-sty"
|
|
72
|
+
:placeholder="$t2('请输入名称', 'components.VabUpload.name')"
|
|
73
|
+
:scale="0"
|
|
74
|
+
@change="handleChange"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="el-upload-list__item-status-label">
|
|
78
|
+
<i class="el-icon-upload-success el-icon-check"></i>
|
|
79
|
+
</div>
|
|
80
|
+
<div
|
|
81
|
+
class="el-icon-close"
|
|
82
|
+
@click="deleteFile(index)"
|
|
83
|
+
v-if="
|
|
84
|
+
$attrs.edit !== false &&
|
|
85
|
+
$attrs.edit !== 'false' &&
|
|
86
|
+
attachment.h5 !== 1 &&
|
|
87
|
+
$attrs.remove !== false
|
|
88
|
+
"
|
|
89
|
+
>
|
|
90
|
+
<i
|
|
91
|
+
class="el-tooltip iconfont iconshanchu"
|
|
92
|
+
aria-describedby="el-tooltip-6144"
|
|
93
|
+
tabindex="0"
|
|
94
|
+
></i>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="el-icon-tagEdit" v-if="attachment.h5 !== 1">
|
|
97
|
+
<el-tooltip
|
|
98
|
+
class="item"
|
|
99
|
+
effect="dark"
|
|
100
|
+
:content="$t2('下载', 'system.button.download')"
|
|
101
|
+
placement="top"
|
|
102
|
+
>
|
|
103
|
+
<i class="el-icon-download" @click="downloadFile(attachment)"></i>
|
|
104
|
+
</el-tooltip>
|
|
105
|
+
<el-tooltip
|
|
106
|
+
class="item"
|
|
107
|
+
effect="dark"
|
|
108
|
+
:content="$t2('详情', 'components.VabUpload.detail')"
|
|
109
|
+
placement="top"
|
|
110
|
+
v-if="
|
|
111
|
+
attachment &&
|
|
112
|
+
attachment.id &&
|
|
113
|
+
$attrs.showProperties !== false &&
|
|
114
|
+
!dataType
|
|
115
|
+
"
|
|
116
|
+
>
|
|
117
|
+
<i
|
|
118
|
+
class="iconfont icon-shuxing"
|
|
119
|
+
@click="openPropertiesDialog(attachment)"
|
|
120
|
+
></i>
|
|
121
|
+
</el-tooltip>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</li>
|
|
125
|
+
</ul>
|
|
126
|
+
</div>
|
|
127
|
+
</template>
|
|
128
|
+
<template v-else>
|
|
129
|
+
<a>
|
|
130
|
+
<el-image
|
|
131
|
+
:src="getShowUrl(attachment)"
|
|
132
|
+
@click="openPreview(attachment, index)"
|
|
133
|
+
:z-index="999999"
|
|
134
|
+
/>
|
|
135
|
+
</a>
|
|
136
|
+
<a
|
|
137
|
+
href="javascript:void(0);"
|
|
138
|
+
class="del"
|
|
139
|
+
@click="deleteFile(index)"
|
|
140
|
+
v-if="$attrs.edit !== false && $attrs.edit !== 'false' &&
|
|
141
|
+
$attrs.remove !== false"
|
|
142
|
+
><i class="el-icon-error"></i
|
|
143
|
+
></a>
|
|
144
|
+
</template>
|
|
145
|
+
</div>
|
|
146
|
+
<div
|
|
147
|
+
class="el-upload el-upload--picture"
|
|
148
|
+
style="vertical-align: middle; display: inline-block; float: left"
|
|
149
|
+
v-if="$attrs.edit !== false && $attrs.edit !== 'false'"
|
|
150
|
+
>
|
|
151
|
+
<button
|
|
152
|
+
type="button"
|
|
153
|
+
class="avatar-uploader"
|
|
154
|
+
v-if="showUploadBtn"
|
|
155
|
+
@keyup.prevent
|
|
156
|
+
@keydown.enter.prevent
|
|
157
|
+
@click="openUploadDialog()"
|
|
158
|
+
@mouseenter="uploadEnterOver()"
|
|
159
|
+
@mouseleave="uploadEnterLeave()"
|
|
160
|
+
>
|
|
161
|
+
<i class="el-icon-plus avatar-uploader-icon"></i>
|
|
162
|
+
</button>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
<propertiesDialog
|
|
166
|
+
v-if="showPropertiesDialog"
|
|
167
|
+
:visiable.sync="showPropertiesDialog"
|
|
168
|
+
:editAttachment.sync="editAttachment"
|
|
169
|
+
:edit.sync="$attrs.edit"
|
|
170
|
+
></propertiesDialog>
|
|
171
|
+
<el-image-viewer
|
|
172
|
+
v-if="showViewer"
|
|
173
|
+
:on-close="closeViewer"
|
|
174
|
+
:initial-index.sync="chooseIndex"
|
|
175
|
+
:url-list="previewList"
|
|
176
|
+
/>
|
|
177
|
+
<!-- H5 非图片文件预览:结构与 mobile/wf/content.vue 的流程图预览一致,
|
|
178
|
+
样式走 xform/styles/h5.scss 块 L 的 .pop-box(全屏 fixed + 内部 flex)。
|
|
179
|
+
只在宿主传了 h5Preview 时才会被 openPreview 打开,PC 上永远不渲染。 -->
|
|
180
|
+
<el-dialog
|
|
181
|
+
title="文件预览"
|
|
182
|
+
:modal-append-to-body="false"
|
|
183
|
+
:close-on-click-modal="false"
|
|
184
|
+
:visible.sync="showFilePreviewDialog"
|
|
185
|
+
:modal="false"
|
|
186
|
+
custom-class="dialog-style h5view-dialog"
|
|
187
|
+
width="100%"
|
|
188
|
+
top="0px"
|
|
189
|
+
v-el-drag-dialog
|
|
190
|
+
v-el-dialog-center
|
|
191
|
+
:append-to-body ="true"
|
|
192
|
+
:destroy-on-close="true"
|
|
193
|
+
>
|
|
194
|
+
<div class="flex">
|
|
195
|
+
<div class="form-box">
|
|
196
|
+
<div class="tit">
|
|
197
|
+
<span>{{ previewFileName }}</span>
|
|
198
|
+
</div>
|
|
199
|
+
<iframe
|
|
200
|
+
style="width: 100%; flex: 1; border: none"
|
|
201
|
+
:src="previewFileUrl"
|
|
202
|
+
></iframe>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
<span slot="footer" class="dialog-footer">
|
|
206
|
+
<el-button
|
|
207
|
+
type="primary"
|
|
208
|
+
plain
|
|
209
|
+
class="button-sty"
|
|
210
|
+
icon="el-icon-close"
|
|
211
|
+
@click="showFilePreviewDialog = false"
|
|
212
|
+
>{{$t2('关 闭', 'system.button.close2')}}</el-button
|
|
213
|
+
>
|
|
214
|
+
</span>
|
|
215
|
+
</el-dialog>
|
|
216
|
+
</div>
|
|
217
|
+
</template>
|
|
218
|
+
|
|
219
|
+
<script>
|
|
220
|
+
import { viewMixins } from "./mixins";
|
|
221
|
+
|
|
222
|
+
export default {
|
|
223
|
+
mixins: [viewMixins],
|
|
224
|
+
components: {
|
|
225
|
+
propertiesDialog: () => import("./propertiesDialog.vue"),
|
|
226
|
+
ElImageViewer: () => import("./image-viewer"),
|
|
227
|
+
},
|
|
228
|
+
computed: {
|
|
229
|
+
classList() {
|
|
230
|
+
// 'upload-img': this.dataType || (this.$attrs.hideInfo == true || this.$attrs.hideInfo == 'true')
|
|
231
|
+
let arr = [];
|
|
232
|
+
if (
|
|
233
|
+
this.dataType ||
|
|
234
|
+
this.$attrs.hideInfo == true ||
|
|
235
|
+
this.$attrs.hideInfo == "true"
|
|
236
|
+
) {
|
|
237
|
+
arr.push("upload-img");
|
|
238
|
+
}
|
|
239
|
+
let widgetSize = this.$attrs.widgetSize || 2;
|
|
240
|
+
if (widgetSize) {
|
|
241
|
+
let str1 = "widgetSize-" + widgetSize;
|
|
242
|
+
arr.push(str1);
|
|
243
|
+
}
|
|
244
|
+
return arr;
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
</script>
|