cloud-web-corejs 1.1.0-dev.82 → 1.1.0-dev.84
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 +5 -0
- package/src/components/VabUpload/view.vue +4 -0
- package/src/components/baseAttachment/index.vue +1 -0
- package/src/components/baseAttachment/mixins.js +17 -0
- package/src/components/baseAttachment/showList.vue +12 -2
- package/src/components/baseAttachment/uploadDialog.vue +2 -1
- package/src/components/hiprint/hiprint.bundle.js +5 -1
- package/src/components/table/vxeFilter/mixin.js +326 -326
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +7 -0
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +186 -153
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +22 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +13 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/showDownloadButton-editor.vue +29 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +3 -0
- package/src/components/xform/form-render/container-item/data-table-item.vue +1 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +116 -0
- package/src/microRouter/index.js +5 -0
- package/src/store/modules/permission.js +2 -0
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
resultType="Array"
|
|
35
35
|
:edit="!field.options.disabled && !isReadMode"
|
|
36
36
|
:remove="!field.options.hideRemoveButton && !isReadMode"
|
|
37
|
+
:showDownload="field.options.showDownload !== false"
|
|
37
38
|
@callback="submitFile"
|
|
38
39
|
:hideInfo="field.options.hideFileInfo"
|
|
39
40
|
:hideName="field.options.hideFileName"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
tabindex="0"
|
|
78
78
|
></i>
|
|
79
79
|
</div>
|
|
80
|
-
<div class="el-icon-tagEdit">
|
|
80
|
+
<div class="el-icon-tagEdit" v-if="field.options.showDownload !== false">
|
|
81
81
|
<el-tooltip
|
|
82
82
|
class="item"
|
|
83
83
|
effect="dark"
|
|
@@ -130,6 +130,7 @@ import i18n from "../../../../../components/xform/utils/i18n";
|
|
|
130
130
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
131
131
|
import settingConfig from "@/settings.js";
|
|
132
132
|
|
|
133
|
+
const SINGLE_UPLOAD_API = "/api/v1.0/FileOperation/UploadFilesFromPortal";
|
|
133
134
|
const BATCH_UPLOAD_API = "/api/v1.0/FileOperation/BatchUploadFilesFromPortal";
|
|
134
135
|
/** 全部处理完显示 100 后,再停一会儿关闭加载。 */
|
|
135
136
|
const HX_UPLOAD_DONE_DELAY = 200;
|
|
@@ -145,17 +146,31 @@ function parseJsonValue(value) {
|
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
/**
|
|
150
|
+
* 单文件用 UploadFilesFromPortal,多文件用 BatchUploadFilesFromPortal。
|
|
151
|
+
* 配置只返回其中一个时,按名称推出另一个,不互相覆盖。
|
|
152
|
+
*/
|
|
153
|
+
function resolveHisenseUploadUrls(domain, uploadApi) {
|
|
154
|
+
const api = uploadApi || "";
|
|
155
|
+
const base = domain || "";
|
|
156
|
+
const isBatch = /BatchUploadFilesFromPortal/i.test(api);
|
|
157
|
+
const isSingle = !isBatch && /UploadFilesFromPortal/i.test(api);
|
|
158
|
+
let singleApi = api;
|
|
159
|
+
let batchApi = api;
|
|
160
|
+
if (isBatch) {
|
|
161
|
+
singleApi = api.replace(/BatchUploadFilesFromPortal/i, "UploadFilesFromPortal");
|
|
162
|
+
} else if (isSingle) {
|
|
163
|
+
batchApi = api.replace(/UploadFilesFromPortal/i, "BatchUploadFilesFromPortal");
|
|
164
|
+
} else if (!api) {
|
|
165
|
+
singleApi = SINGLE_UPLOAD_API;
|
|
166
|
+
batchApi = BATCH_UPLOAD_API;
|
|
167
|
+
} else {
|
|
168
|
+
batchApi = BATCH_UPLOAD_API;
|
|
157
169
|
}
|
|
158
|
-
return
|
|
170
|
+
return {
|
|
171
|
+
singleUploadUrl: base + singleApi,
|
|
172
|
+
batchUploadUrl: base + batchApi,
|
|
173
|
+
};
|
|
159
174
|
}
|
|
160
175
|
|
|
161
176
|
/** settings.hxFileLocalProxyEnabled 打开且处于 npm run dev 时,把海信绝对地址改写到本地 /hx-file。 */
|
|
@@ -179,17 +194,18 @@ function toDevProxyUrl(absoluteUrl) {
|
|
|
179
194
|
}
|
|
180
195
|
|
|
181
196
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
197
|
+
* 单上传 data 是一个文件对象。
|
|
198
|
+
* 批量上传外层 code=1000 只表示批次受理,再看每条明细的 code;外层非 1000 整批失败。
|
|
184
199
|
*/
|
|
185
200
|
function adaptHisenseBatchUploadResponse(responseData) {
|
|
186
201
|
const body = responseData || {};
|
|
187
202
|
const outerCode = Number(body.code);
|
|
188
203
|
const fail = (message) => ({
|
|
189
204
|
success: false,
|
|
190
|
-
message: message ||
|
|
205
|
+
message: message || "上传失败",
|
|
191
206
|
fullResponse: body,
|
|
192
207
|
data: null,
|
|
208
|
+
files: [],
|
|
193
209
|
});
|
|
194
210
|
if (outerCode !== 1000) {
|
|
195
211
|
return fail(body.message);
|
|
@@ -201,24 +217,35 @@ function adaptHisenseBatchUploadResponse(responseData) {
|
|
|
201
217
|
message: body.message || "ok",
|
|
202
218
|
fullResponse: body,
|
|
203
219
|
data: parsed,
|
|
220
|
+
files: [parsed],
|
|
204
221
|
};
|
|
205
222
|
}
|
|
206
223
|
if (!Array.isArray(parsed) || !parsed.length) {
|
|
207
224
|
return fail(body.message);
|
|
208
225
|
}
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
const files = [];
|
|
227
|
+
const errors = [];
|
|
228
|
+
parsed.forEach((item) => {
|
|
229
|
+
if (Number(item && item.code) !== 1000) {
|
|
230
|
+
errors.push((item && item.message) || body.message || "上传失败");
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const fileInfo = parseJsonValue(item.data);
|
|
234
|
+
if (!fileInfo) {
|
|
235
|
+
errors.push((item && item.message) || body.message || "上传失败");
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
files.push(fileInfo);
|
|
239
|
+
});
|
|
240
|
+
if (!files.length) {
|
|
241
|
+
return fail(errors.filter(Boolean).join(";") || body.message);
|
|
216
242
|
}
|
|
217
243
|
return {
|
|
218
|
-
success:
|
|
219
|
-
message:
|
|
244
|
+
success: errors.length === 0,
|
|
245
|
+
message: errors.filter(Boolean).join(";") || "ok",
|
|
220
246
|
fullResponse: body,
|
|
221
|
-
data:
|
|
247
|
+
data: files[0],
|
|
248
|
+
files,
|
|
222
249
|
};
|
|
223
250
|
}
|
|
224
251
|
|
|
@@ -268,6 +295,8 @@ export default {
|
|
|
268
295
|
isH5: false,
|
|
269
296
|
|
|
270
297
|
uploadUrl: null,
|
|
298
|
+
singleUploadUrl: null,
|
|
299
|
+
batchUploadUrl: null,
|
|
271
300
|
|
|
272
301
|
token: null,
|
|
273
302
|
deleteUrl: null,
|
|
@@ -531,9 +560,10 @@ export default {
|
|
|
531
560
|
let token = objx.apiToken;
|
|
532
561
|
if (token) {
|
|
533
562
|
this.token = token;
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
);
|
|
563
|
+
const uploadUrls = resolveHisenseUploadUrls(objx.domain, objx.uploadApi);
|
|
564
|
+
this.singleUploadUrl = toDevProxyUrl(uploadUrls.singleUploadUrl);
|
|
565
|
+
this.batchUploadUrl = toDevProxyUrl(uploadUrls.batchUploadUrl);
|
|
566
|
+
this.uploadUrl = this.singleUploadUrl;
|
|
537
567
|
this.deleteUrl = toDevProxyUrl(objx.domain + objx.deleteApi);
|
|
538
568
|
// https://crm-dev.hisense.com/api/v1.0/fileoperation/GetFile?fileName=e24a1ad9-6821-41c3-957c-0916077bb97f.jpg
|
|
539
569
|
this.viewApiUrl = toDevProxyUrl(objx.domain + objx.viewApi);
|
|
@@ -588,156 +618,159 @@ export default {
|
|
|
588
618
|
Math.random() * 100000 + Math.random() * 20000 + Math.random() * 5000
|
|
589
619
|
);
|
|
590
620
|
},
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
let
|
|
607
|
-
|
|
608
|
-
var form = new FormData();
|
|
609
|
-
// 一个文件一次请求,索引固定为 0
|
|
610
|
-
const fieldPrefix = "requests[0].";
|
|
611
|
-
form.append(fieldPrefix + "File", fileObj);
|
|
612
|
-
|
|
613
|
-
let customParam = {};
|
|
614
|
-
let entityId = this.formDataId;
|
|
615
|
-
customParam = {
|
|
621
|
+
// 同一轮选择的文件先收齐:1 个走单上传,多个走一次批量上传
|
|
622
|
+
uploadSectionFile(param, isCustom, uploadConfig) {
|
|
623
|
+
if (!this.hxPendingUploads) {
|
|
624
|
+
this.hxPendingUploads = [];
|
|
625
|
+
}
|
|
626
|
+
this.hxPendingUploads.push({ param, isCustom, uploadConfig });
|
|
627
|
+
if (this.hxFlushScheduled) return;
|
|
628
|
+
this.hxFlushScheduled = true;
|
|
629
|
+
setTimeout(() => {
|
|
630
|
+
this.hxFlushScheduled = false;
|
|
631
|
+
const pending = this.hxPendingUploads.splice(0);
|
|
632
|
+
this.flushHxUpload(pending);
|
|
633
|
+
}, 0);
|
|
634
|
+
},
|
|
635
|
+
buildHxUploadParam(fileObj) {
|
|
636
|
+
let customParam = {
|
|
616
637
|
fileName: fileObj.name,
|
|
617
638
|
entityName: "msdyn_workorder",
|
|
618
|
-
entityId,
|
|
639
|
+
entityId: this.formDataId,
|
|
619
640
|
backendwriteback: "10",
|
|
620
641
|
fileCategory: "工单",
|
|
621
642
|
user: window.$vueRoot.$store.getters.nickName,
|
|
622
|
-
// user: "1",
|
|
623
643
|
};
|
|
624
644
|
let uploadParam =
|
|
625
645
|
this.handleCustomEvent(this.field.options.vabupload2_uploadParam) || {};
|
|
626
646
|
Object.assign(customParam, uploadParam);
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
let isLoading = uploadConfig?.isLoading === true;
|
|
643
|
-
var uploadUrl = this.uploadUrl;
|
|
647
|
+
return customParam;
|
|
648
|
+
},
|
|
649
|
+
appendHxUploadFields(form, fileObj, prefix) {
|
|
650
|
+
form.append(prefix ? prefix + "File" : "file", fileObj);
|
|
651
|
+
let customParam = this.buildHxUploadParam(fileObj);
|
|
652
|
+
Object.keys(customParam).forEach((key) => {
|
|
653
|
+
if (key === "file" || key === "File") return;
|
|
654
|
+
let fieldKey = prefix && key.indexOf("requests[") !== 0 ? prefix + key : key;
|
|
655
|
+
form.append(fieldKey, customParam[key]);
|
|
656
|
+
});
|
|
657
|
+
},
|
|
658
|
+
flushHxUpload(pending) {
|
|
659
|
+
if (!pending.length || this.componentDestroyed) return;
|
|
660
|
+
let isCustom = !!pending[0].isCustom;
|
|
661
|
+
let target = this.$refs.upload;
|
|
644
662
|
if (!isCustom && !this.showUploadBtn) {
|
|
645
663
|
target && target.clearFiles();
|
|
646
664
|
return;
|
|
647
665
|
}
|
|
648
|
-
target.clearFiles();
|
|
649
|
-
if (uploadUrl) {
|
|
650
|
-
let fileOrder = 0;
|
|
651
|
-
if (!isCustom) {
|
|
652
|
-
if (this.uploadingCount === 0) {
|
|
653
|
-
this.hxUploadTotal = 0;
|
|
654
|
-
this.openHxUploadLoading();
|
|
655
|
-
}
|
|
656
|
-
this.uploadingCount++;
|
|
657
|
-
this.hxUploadTotal++;
|
|
658
|
-
fileOrder = this.hxUploadTotal;
|
|
659
|
-
}
|
|
660
|
-
var abort;
|
|
666
|
+
target && target.clearFiles();
|
|
661
667
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
}), */
|
|
676
|
-
onUploadProgress: (progressEvent) => {
|
|
677
|
-
const percent = progressEvent.total
|
|
678
|
-
? Math.floor((progressEvent.loaded * 100) / progressEvent.total)
|
|
679
|
-
: 0;
|
|
680
|
-
if (isCustom || file) {
|
|
681
|
-
progressEvent.percent = percent;
|
|
682
|
-
}
|
|
683
|
-
if (!isCustom) {
|
|
684
|
-
this.setHxUploadProgress(fileOrder, percent);
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
failMsg: false,
|
|
688
|
-
}; //添加请求头
|
|
668
|
+
let fileObjs = pending.map((item) => item.param && item.param.file).filter(Boolean);
|
|
669
|
+
if (!isCustom && this.uploadLimit) {
|
|
670
|
+
let remain = this.uploadLimit - this.attachmentCount - this.uploadingCount;
|
|
671
|
+
if (remain <= 0) return;
|
|
672
|
+
fileObjs = fileObjs.slice(0, remain);
|
|
673
|
+
}
|
|
674
|
+
if (!fileObjs.length) return;
|
|
675
|
+
|
|
676
|
+
const batch = fileObjs.length > 1;
|
|
677
|
+
const uploadUrl = batch
|
|
678
|
+
? this.batchUploadUrl
|
|
679
|
+
: this.singleUploadUrl || this.uploadUrl;
|
|
680
|
+
if (!uploadUrl) return;
|
|
689
681
|
|
|
690
|
-
|
|
691
|
-
|
|
682
|
+
let customEnabled = this.customEnabled || false;
|
|
683
|
+
const form = new FormData();
|
|
684
|
+
fileObjs.forEach((fileObj, index) => {
|
|
685
|
+
this.appendHxUploadFields(form, fileObj, batch ? `requests[${index}].` : "");
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
let fileOrder = 0;
|
|
689
|
+
if (!isCustom) {
|
|
690
|
+
if (this.uploadingCount === 0) {
|
|
691
|
+
this.hxUploadTotal = 0;
|
|
692
|
+
this.openHxUploadLoading();
|
|
692
693
|
}
|
|
694
|
+
this.uploadingCount++;
|
|
695
|
+
this.hxUploadTotal++;
|
|
696
|
+
fileOrder = this.hxUploadTotal;
|
|
697
|
+
}
|
|
693
698
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
+
let config = {
|
|
700
|
+
useToken: false,
|
|
701
|
+
isLoading: false,
|
|
702
|
+
headers: {
|
|
703
|
+
"Content-Type": "multipart/form-data",
|
|
704
|
+
Authorization: `Bearer ${this.token}`,
|
|
705
|
+
},
|
|
706
|
+
onUploadProgress: (progressEvent) => {
|
|
707
|
+
const percent = progressEvent.total
|
|
708
|
+
? Math.floor((progressEvent.loaded * 100) / progressEvent.total)
|
|
709
|
+
: 0;
|
|
699
710
|
if (!isCustom) {
|
|
700
|
-
this.setHxUploadProgress(fileOrder,
|
|
711
|
+
this.setHxUploadProgress(fileOrder, percent);
|
|
701
712
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
713
|
+
},
|
|
714
|
+
failMsg: false,
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
if (customEnabled && config?.httpConfig) {
|
|
718
|
+
config = extendDeeply(config, config.httpConfig);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
this.enqueueHxUpload(() => {
|
|
722
|
+
if (this.componentDestroyed || !this.getFormRef()) {
|
|
723
|
+
this.finishHxUpload(!isCustom);
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
if (!isCustom) {
|
|
727
|
+
this.setHxUploadProgress(fileOrder, 0);
|
|
728
|
+
}
|
|
729
|
+
let batchDone = false;
|
|
730
|
+
return this.getFormRef()
|
|
731
|
+
.$http.post(uploadUrl, form, config)
|
|
732
|
+
.then((res1) => {
|
|
733
|
+
if (this.componentDestroyed) return;
|
|
734
|
+
const isLast = !isCustom && this.uploadingCount <= 1;
|
|
735
|
+
if (isLast) {
|
|
736
|
+
this.setHxUploadPercentText(99);
|
|
737
|
+
}
|
|
738
|
+
pending.forEach((item) => {
|
|
739
|
+
item.uploadConfig &&
|
|
740
|
+
item.uploadConfig.callback &&
|
|
741
|
+
item.uploadConfig.callback(res1, item.param && item.param.file);
|
|
742
|
+
});
|
|
712
743
|
|
|
713
|
-
|
|
744
|
+
const adaptedResponse = this.responseAdapter(res1);
|
|
745
|
+
const files = Array.isArray(adaptedResponse.files)
|
|
746
|
+
? adaptedResponse.files
|
|
747
|
+
: adaptedResponse.data
|
|
748
|
+
? [adaptedResponse.data]
|
|
749
|
+
: [];
|
|
714
750
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
this.closeHxUploadLoading();
|
|
730
|
-
}
|
|
731
|
-
// param.onError(new Error(res1.content || '上传异常'));
|
|
751
|
+
if (!isCustom) {
|
|
752
|
+
files.forEach((data) => {
|
|
753
|
+
this.appendUploadedFile({
|
|
754
|
+
...data,
|
|
755
|
+
showUrl: null,
|
|
756
|
+
});
|
|
757
|
+
});
|
|
758
|
+
if (files.length && adaptedResponse.success) {
|
|
759
|
+
batchDone = isLast;
|
|
760
|
+
} else {
|
|
761
|
+
if (isLast) {
|
|
762
|
+
this.closeHxUploadLoading();
|
|
763
|
+
}
|
|
764
|
+
if (adaptedResponse.message) {
|
|
732
765
|
this.$baseAlert(adaptedResponse.message);
|
|
733
766
|
}
|
|
734
767
|
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
768
|
+
}
|
|
769
|
+
})
|
|
770
|
+
.finally(() => {
|
|
771
|
+
return this.finishHxUpload(!isCustom, batchDone);
|
|
772
|
+
});
|
|
773
|
+
});
|
|
741
774
|
},
|
|
742
775
|
/**
|
|
743
776
|
* 同一控件内串行上传。上一次请求结束后立刻发下一次,
|
|
@@ -30,22 +30,35 @@
|
|
|
30
30
|
<el-form-item :label="i18nt('隐藏删除按钮')">
|
|
31
31
|
<el-switch v-model="optionModel.hideRemoveButton"></el-switch>
|
|
32
32
|
</el-form-item>
|
|
33
|
+
<el-form-item :label="i18nt('隐藏下载按钮')">
|
|
34
|
+
<el-switch :value="hideDownloadButton" @change="handleHideDownloadChange"></el-switch>
|
|
35
|
+
</el-form-item>
|
|
33
36
|
|
|
34
37
|
</div>
|
|
35
38
|
</template>
|
|
36
39
|
|
|
37
40
|
<script>
|
|
38
|
-
|
|
41
|
+
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
export default {
|
|
44
|
+
name: "field-vabUpload-editor",
|
|
45
|
+
mixins: [i18n],
|
|
46
|
+
props: {
|
|
47
|
+
designer: Object,
|
|
48
|
+
selectedWidget: Object,
|
|
49
|
+
optionModel: Object,
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
hideDownloadButton() {
|
|
53
|
+
return this.optionModel.showDownload === false;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
handleHideDownloadChange(hidden) {
|
|
58
|
+
this.$set(this.optionModel, "showDownload", !hidden);
|
|
47
59
|
},
|
|
48
|
-
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
49
62
|
</script>
|
|
50
63
|
|
|
51
64
|
<style scoped>
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
<el-form-item :label="i18nt('隐藏删除按钮')">
|
|
41
41
|
<el-switch v-model="optionModel.hideRemoveButton"></el-switch>
|
|
42
42
|
</el-form-item>
|
|
43
|
+
<el-form-item :label="i18nt('隐藏下载按钮')">
|
|
44
|
+
<el-switch :value="hideDownloadButton" @change="handleHideDownloadChange"></el-switch>
|
|
45
|
+
</el-form-item>
|
|
43
46
|
</div>
|
|
44
47
|
</template>
|
|
45
48
|
|
|
@@ -60,6 +63,16 @@ export default {
|
|
|
60
63
|
deleteParam: ["dataId", "formCode", "param"],
|
|
61
64
|
};
|
|
62
65
|
},
|
|
66
|
+
computed: {
|
|
67
|
+
hideDownloadButton() {
|
|
68
|
+
return this.optionModel.showDownload === false;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
handleHideDownloadChange(hidden) {
|
|
73
|
+
this.$set(this.optionModel, "showDownload", !hidden);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
63
76
|
};
|
|
64
77
|
</script>
|
|
65
78
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form-item :label="i18nt('隐藏下载按钮')">
|
|
3
|
+
<el-switch :value="hideDownloadButton" @change="handleChange"></el-switch>
|
|
4
|
+
</el-form-item>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: "showDownloadButton-editor",
|
|
12
|
+
mixins: [i18n],
|
|
13
|
+
props: {
|
|
14
|
+
designer: Object,
|
|
15
|
+
selectedWidget: Object,
|
|
16
|
+
optionModel: Object,
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
hideDownloadButton() {
|
|
20
|
+
return this.optionModel.showDownloadButton === false;
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
handleChange(hidden) {
|
|
25
|
+
this.$set(this.optionModel, "showDownloadButton", !hidden);
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
@@ -199,6 +199,7 @@ const COMMON_PROPERTIES = {
|
|
|
199
199
|
colorClass: "colorClass-editor",
|
|
200
200
|
downloadButtonFlag: "downloadButtonFlag-editor",
|
|
201
201
|
showViewButton: "showViewButton-editor",
|
|
202
|
+
showDownloadButton: "showDownloadButton-editor",
|
|
202
203
|
urlValueEnabled: "urlValueEnabled-editor",
|
|
203
204
|
};
|
|
204
205
|
|
|
@@ -3171,6 +3171,7 @@ export const advancedFields = [
|
|
|
3171
3171
|
limit: null,
|
|
3172
3172
|
fileTypes: [],
|
|
3173
3173
|
hideRemoveButton: false,
|
|
3174
|
+
showDownload: true,
|
|
3174
3175
|
accessType: "1",
|
|
3175
3176
|
entityTableCode: null,
|
|
3176
3177
|
entityTableDesc: null,
|
|
@@ -3748,6 +3749,7 @@ export const advancedFields = [
|
|
|
3748
3749
|
limit: null,
|
|
3749
3750
|
fileTypes: [],
|
|
3750
3751
|
showViewButton: true,
|
|
3752
|
+
showDownloadButton: true,
|
|
3751
3753
|
accessType: "1",
|
|
3752
3754
|
entityTableCode: null,
|
|
3753
3755
|
entityTableDesc: null,
|
|
@@ -4497,6 +4499,7 @@ export const businessFields = [
|
|
|
4497
4499
|
labelHidden: !0,
|
|
4498
4500
|
limit: null,
|
|
4499
4501
|
hideRemoveButton: false,
|
|
4502
|
+
showDownload: true,
|
|
4500
4503
|
accessType: "1",
|
|
4501
4504
|
entityTableCode: null,
|
|
4502
4505
|
entityTableDesc: null,
|