form-custom-test 3.0.218 → 3.0.220
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/dist/designer.es.js +59 -15
- package/dist/designer.style.css +2 -2
- package/dist/designer.umd.js +3 -3
- package/dist/render.es.js +59 -15
- package/dist/render.style.css +2 -2
- package/dist/render.umd.js +54 -54
- package/package.json +1 -1
package/dist/render.es.js
CHANGED
|
@@ -10732,21 +10732,52 @@ const _sfc_main$$ = {
|
|
|
10732
10732
|
this.unregisterFromRefList();
|
|
10733
10733
|
},
|
|
10734
10734
|
methods: {
|
|
10735
|
+
parseFileFieldModel(value2) {
|
|
10736
|
+
if (value2 == null || value2 === "") {
|
|
10737
|
+
return [];
|
|
10738
|
+
}
|
|
10739
|
+
let parsed = value2;
|
|
10740
|
+
if (typeof parsed === "string") {
|
|
10741
|
+
const trimmed = parsed.trim();
|
|
10742
|
+
if (!trimmed) {
|
|
10743
|
+
return [];
|
|
10744
|
+
}
|
|
10745
|
+
try {
|
|
10746
|
+
parsed = JSON.parse(trimmed);
|
|
10747
|
+
if (typeof parsed === "string") {
|
|
10748
|
+
const inner = parsed.trim();
|
|
10749
|
+
if (inner.startsWith("[") || inner.startsWith("{")) {
|
|
10750
|
+
parsed = JSON.parse(inner);
|
|
10751
|
+
}
|
|
10752
|
+
}
|
|
10753
|
+
} catch (e) {
|
|
10754
|
+
console.warn("[file-upload] fieldModel JSON parse failed:", e);
|
|
10755
|
+
return [];
|
|
10756
|
+
}
|
|
10757
|
+
}
|
|
10758
|
+
if (Array.isArray(parsed)) {
|
|
10759
|
+
return parsed;
|
|
10760
|
+
}
|
|
10761
|
+
if (parsed && typeof parsed === "object") {
|
|
10762
|
+
return [parsed];
|
|
10763
|
+
}
|
|
10764
|
+
return [];
|
|
10765
|
+
},
|
|
10735
10766
|
initFileList() {
|
|
10736
10767
|
if (this.designState === true) {
|
|
10737
10768
|
return;
|
|
10738
10769
|
}
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10770
|
+
const parsedList = this.parseFileFieldModel(this.fieldModel);
|
|
10771
|
+
const shouldNormalizeFieldModel = typeof this.fieldModel === "string" || this.fieldModel != null && !Array.isArray(this.fieldModel) && typeof this.fieldModel === "object";
|
|
10772
|
+
if (shouldNormalizeFieldModel) {
|
|
10773
|
+
this.fieldModel = parsedList;
|
|
10743
10774
|
}
|
|
10744
|
-
|
|
10745
|
-
if (raw.length === 0) {
|
|
10775
|
+
if (parsedList.length === 0) {
|
|
10746
10776
|
this.fileList = [];
|
|
10747
10777
|
this.uploadBtnHidden = false;
|
|
10748
10778
|
return;
|
|
10749
10779
|
}
|
|
10780
|
+
const raw = deepClone(parsedList);
|
|
10750
10781
|
this.fileList = raw.map((item, i) => {
|
|
10751
10782
|
var _a, _b, _c, _d;
|
|
10752
10783
|
const name = (_b = (_a = item.name) != null ? _a : item.fileName) != null ? _b : "";
|
|
@@ -11161,7 +11192,7 @@ function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11161
11192
|
_: 1
|
|
11162
11193
|
}, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
|
|
11163
11194
|
}
|
|
11164
|
-
var fileUploadWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$$, [["render", _sfc_render$$], ["__scopeId", "data-v-
|
|
11195
|
+
var fileUploadWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$$, [["render", _sfc_render$$], ["__scopeId", "data-v-3a72c058"]]);
|
|
11165
11196
|
var __glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11166
11197
|
__proto__: null,
|
|
11167
11198
|
"default": fileUploadWidget
|
|
@@ -26613,13 +26644,13 @@ function registerIcon(app) {
|
|
|
26613
26644
|
if (typeof window !== "undefined") {
|
|
26614
26645
|
let loadSvg = function() {
|
|
26615
26646
|
var body = document.body;
|
|
26616
|
-
var svgDom = document.getElementById("
|
|
26647
|
+
var svgDom = document.getElementById("__svg__icons__dom__1783061794431__");
|
|
26617
26648
|
if (!svgDom) {
|
|
26618
26649
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
26619
26650
|
svgDom.style.position = "absolute";
|
|
26620
26651
|
svgDom.style.width = "0";
|
|
26621
26652
|
svgDom.style.height = "0";
|
|
26622
|
-
svgDom.id = "
|
|
26653
|
+
svgDom.id = "__svg__icons__dom__1783061794431__";
|
|
26623
26654
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
26624
26655
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
26625
26656
|
}
|
|
@@ -63342,7 +63373,7 @@ const _sfc_main$c = {
|
|
|
63342
63373
|
size: this.pageSize,
|
|
63343
63374
|
current: this.currentPage,
|
|
63344
63375
|
title: this.form.title,
|
|
63345
|
-
createdByCompanyId: "
|
|
63376
|
+
createdByCompanyId: sessionStorage.getItem("companyId"),
|
|
63346
63377
|
dataJson: {
|
|
63347
63378
|
form_titleName: this.form.title
|
|
63348
63379
|
},
|
|
@@ -63402,15 +63433,28 @@ const _sfc_main$c = {
|
|
|
63402
63433
|
getFormConfigCode(item) {
|
|
63403
63434
|
return (item == null ? void 0 : item.formCode) || (item == null ? void 0 : item.subCategoryCode) || this.documentTypeValue;
|
|
63404
63435
|
},
|
|
63436
|
+
buildReadonlyFormJson(formJson) {
|
|
63437
|
+
const json = lodash.exports.cloneDeep(formJson);
|
|
63438
|
+
if (json == null ? void 0 : json.widgetList) {
|
|
63439
|
+
traverseFieldWidgets(json.widgetList, (widget) => {
|
|
63440
|
+
if (widget == null ? void 0 : widget.options) {
|
|
63441
|
+
widget.options.disabled = true;
|
|
63442
|
+
widget.options.readonly = true;
|
|
63443
|
+
}
|
|
63444
|
+
});
|
|
63445
|
+
}
|
|
63446
|
+
return json;
|
|
63447
|
+
},
|
|
63405
63448
|
applyFormToRender(parsed, formData) {
|
|
63406
|
-
|
|
63449
|
+
const disabledJson = this.buildReadonlyFormJson(parsed);
|
|
63450
|
+
this.formJson = disabledJson;
|
|
63407
63451
|
this.showForm = true;
|
|
63408
63452
|
this.$nextTick(() => {
|
|
63409
63453
|
const ref2 = this.$refs.detailFormRender;
|
|
63410
63454
|
if (!ref2 || typeof ref2.setFormJson !== "function") {
|
|
63411
63455
|
return;
|
|
63412
63456
|
}
|
|
63413
|
-
ref2.setFormJson(lodash.exports.cloneDeep(
|
|
63457
|
+
ref2.setFormJson(lodash.exports.cloneDeep(disabledJson));
|
|
63414
63458
|
this.$nextTick(() => {
|
|
63415
63459
|
if (typeof ref2.setFormData === "function") {
|
|
63416
63460
|
ref2.setFormData(lodash.exports.cloneDeep(formData));
|
|
@@ -63427,7 +63471,7 @@ const _sfc_main$c = {
|
|
|
63427
63471
|
}
|
|
63428
63472
|
};
|
|
63429
63473
|
this.$nextTick(disable);
|
|
63430
|
-
setTimeout(disable,
|
|
63474
|
+
[300, 800, 1500].forEach((delay) => setTimeout(disable, delay));
|
|
63431
63475
|
},
|
|
63432
63476
|
async loadDocumentDetail(item) {
|
|
63433
63477
|
const formConfigCode = this.getFormConfigCode(item);
|
|
@@ -63495,7 +63539,7 @@ const _hoisted_10 = {
|
|
|
63495
63539
|
};
|
|
63496
63540
|
const _hoisted_11 = {
|
|
63497
63541
|
key: 2,
|
|
63498
|
-
class: "detail-form"
|
|
63542
|
+
class: "detail-form detail-form--readonly"
|
|
63499
63543
|
};
|
|
63500
63544
|
const _hoisted_12 = {
|
|
63501
63545
|
key: 3,
|
|
@@ -63660,7 +63704,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
63660
63704
|
_: 1
|
|
63661
63705
|
}, 8, ["modelValue", "onClose"]);
|
|
63662
63706
|
}
|
|
63663
|
-
var DocumentDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-
|
|
63707
|
+
var DocumentDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-3988fe48"]]);
|
|
63664
63708
|
var documentDetailDialog_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
63665
63709
|
var documentDetailDialog_vue_vue_type_style_index_1_lang = "";
|
|
63666
63710
|
const DEFAULT_FORM_JSON = {
|