form-custom-test 3.0.220 → 3.0.222
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 +128 -27
- package/dist/designer.style.css +1 -1
- package/dist/designer.umd.js +3 -3
- package/dist/render.es.js +127 -27
- package/dist/render.style.css +1 -1
- package/dist/render.umd.js +71 -71
- package/package.json +1 -1
package/dist/render.es.js
CHANGED
|
@@ -2004,6 +2004,7 @@ var enLocale_extension = {
|
|
|
2004
2004
|
meetingRoomRemoteUrl: "Request URL",
|
|
2005
2005
|
allowMultiple: "Allow Multiple",
|
|
2006
2006
|
currentUserType: "Current User Type",
|
|
2007
|
+
currentUserValueType: "Value Type",
|
|
2007
2008
|
selectTreeCheckStrictly: "Check Strictly",
|
|
2008
2009
|
assetSelectButtonText: "Button Text",
|
|
2009
2010
|
assetSelectTypeJson: "Asset Type Json",
|
|
@@ -2077,6 +2078,7 @@ var zhLocale_extension = {
|
|
|
2077
2078
|
meetingRoomRemoteUrl: "\u8BF7\u6C42\u5730\u5740",
|
|
2078
2079
|
allowMultiple: "\u662F\u5426\u591A\u9009",
|
|
2079
2080
|
currentUserType: "\u5F53\u524D\u7528\u6237\u7C7B\u578B",
|
|
2081
|
+
currentUserValueType: "\u503C\u7C7B\u578B",
|
|
2080
2082
|
selectTreeCheckStrictly: "\u662F\u5426\u4E25\u683C\u9009\u4E2D",
|
|
2081
2083
|
assetSelectButtonText: "\u6309\u94AE\u6587\u5B57",
|
|
2082
2084
|
assetSelectTypeJson: "\u8D44\u4EA7\u7C7B\u578BJson",
|
|
@@ -26644,13 +26646,13 @@ function registerIcon(app) {
|
|
|
26644
26646
|
if (typeof window !== "undefined") {
|
|
26645
26647
|
let loadSvg = function() {
|
|
26646
26648
|
var body = document.body;
|
|
26647
|
-
var svgDom = document.getElementById("
|
|
26649
|
+
var svgDom = document.getElementById("__svg__icons__dom__1783064649026__");
|
|
26648
26650
|
if (!svgDom) {
|
|
26649
26651
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
26650
26652
|
svgDom.style.position = "absolute";
|
|
26651
26653
|
svgDom.style.width = "0";
|
|
26652
26654
|
svgDom.style.height = "0";
|
|
26653
|
-
svgDom.id = "
|
|
26655
|
+
svgDom.id = "__svg__icons__dom__1783064649026__";
|
|
26654
26656
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
26655
26657
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
26656
26658
|
}
|
|
@@ -62346,20 +62348,26 @@ const _sfc_main$f = {
|
|
|
62346
62348
|
return {
|
|
62347
62349
|
fieldModel: null,
|
|
62348
62350
|
oldFieldValue: null,
|
|
62349
|
-
rules: []
|
|
62351
|
+
rules: [],
|
|
62352
|
+
rawUserData: null
|
|
62350
62353
|
};
|
|
62351
62354
|
},
|
|
62352
62355
|
computed: {
|
|
62353
62356
|
displayModel() {
|
|
62357
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
62358
|
+
if (this.isStringValueType) {
|
|
62359
|
+
return (_a = this.fieldModel) != null ? _a : "";
|
|
62360
|
+
}
|
|
62354
62361
|
if (this.currentUserType === "username") {
|
|
62355
|
-
return this.fieldModel ? this.fieldModel.
|
|
62356
|
-
}
|
|
62357
|
-
|
|
62358
|
-
|
|
62359
|
-
return this.fieldModel ? this.fieldModel.companyName : "";
|
|
62360
|
-
} else {
|
|
62361
|
-
return JSON.stringify(this.fieldModel);
|
|
62362
|
+
return (_e = (_d = (_b = this.fieldModel) == null ? void 0 : _b.username) != null ? _d : (_c = this.fieldModel) == null ? void 0 : _c.userName) != null ? _e : "";
|
|
62363
|
+
}
|
|
62364
|
+
if (this.currentUserType === "deptName") {
|
|
62365
|
+
return (_g = (_f = this.fieldModel) == null ? void 0 : _f.deptName) != null ? _g : "";
|
|
62362
62366
|
}
|
|
62367
|
+
if (this.currentUserType === "companyName") {
|
|
62368
|
+
return (_i = (_h = this.fieldModel) == null ? void 0 : _h.companyName) != null ? _i : "";
|
|
62369
|
+
}
|
|
62370
|
+
return this.fieldModel ? JSON.stringify(this.fieldModel) : "";
|
|
62363
62371
|
},
|
|
62364
62372
|
widgetStyle() {
|
|
62365
62373
|
return {
|
|
@@ -62369,22 +62377,90 @@ const _sfc_main$f = {
|
|
|
62369
62377
|
currentUserType() {
|
|
62370
62378
|
var _a;
|
|
62371
62379
|
return ((_a = this.field.options) == null ? void 0 : _a.type) || "username";
|
|
62380
|
+
},
|
|
62381
|
+
isStringValueType() {
|
|
62382
|
+
var _a;
|
|
62383
|
+
return ((_a = this.field.options) == null ? void 0 : _a.valueType) === "string";
|
|
62372
62384
|
}
|
|
62373
62385
|
},
|
|
62374
62386
|
methods: {
|
|
62387
|
+
extractStringValue(data2) {
|
|
62388
|
+
var _a, _b, _c, _d;
|
|
62389
|
+
if (data2 == null) {
|
|
62390
|
+
return "";
|
|
62391
|
+
}
|
|
62392
|
+
if (typeof data2 === "string") {
|
|
62393
|
+
return data2;
|
|
62394
|
+
}
|
|
62395
|
+
if (this.currentUserType === "username") {
|
|
62396
|
+
return (_b = (_a = data2.username) != null ? _a : data2.userName) != null ? _b : "";
|
|
62397
|
+
}
|
|
62398
|
+
if (this.currentUserType === "deptName") {
|
|
62399
|
+
return (_c = data2.deptName) != null ? _c : "";
|
|
62400
|
+
}
|
|
62401
|
+
if (this.currentUserType === "companyName") {
|
|
62402
|
+
return (_d = data2.companyName) != null ? _d : "";
|
|
62403
|
+
}
|
|
62404
|
+
return "";
|
|
62405
|
+
},
|
|
62406
|
+
normalizeFieldValue(data2) {
|
|
62407
|
+
if (this.isStringValueType) {
|
|
62408
|
+
return this.extractStringValue(data2);
|
|
62409
|
+
}
|
|
62410
|
+
if (data2 && typeof data2 === "object") {
|
|
62411
|
+
return data2;
|
|
62412
|
+
}
|
|
62413
|
+
return data2;
|
|
62414
|
+
},
|
|
62415
|
+
applyFieldValue(data2, emitChange = true) {
|
|
62416
|
+
var _a;
|
|
62417
|
+
const oldValue = (_a = this.oldFieldValue) != null ? _a : this.fieldModel;
|
|
62418
|
+
this.fieldModel = this.normalizeFieldValue(data2);
|
|
62419
|
+
this.syncUpdateFormModel(this.fieldModel);
|
|
62420
|
+
if (emitChange) {
|
|
62421
|
+
this.emitFieldDataChange(this.fieldModel, oldValue);
|
|
62422
|
+
}
|
|
62423
|
+
},
|
|
62375
62424
|
hasExistingValue() {
|
|
62376
62425
|
var _a;
|
|
62377
62426
|
const v = (_a = this.fieldModel) != null ? _a : this.oldFieldValue;
|
|
62378
|
-
|
|
62427
|
+
if (v === void 0 || v === null) {
|
|
62428
|
+
return false;
|
|
62429
|
+
}
|
|
62430
|
+
if (this.isStringValueType) {
|
|
62431
|
+
return v !== "";
|
|
62432
|
+
}
|
|
62433
|
+
if (typeof v === "object") {
|
|
62434
|
+
return Object.keys(v).length > 0;
|
|
62435
|
+
}
|
|
62436
|
+
return v !== "";
|
|
62379
62437
|
},
|
|
62380
62438
|
async getCurrentUser() {
|
|
62381
62439
|
const { data: data2 } = await service$1({
|
|
62382
62440
|
method: "get",
|
|
62383
62441
|
url: "unified-system/employee/loginInfo?accessType=0"
|
|
62384
62442
|
});
|
|
62385
|
-
this.
|
|
62386
|
-
this.
|
|
62387
|
-
|
|
62443
|
+
this.rawUserData = data2;
|
|
62444
|
+
this.applyFieldValue(data2);
|
|
62445
|
+
},
|
|
62446
|
+
refreshFieldValueFromOptions() {
|
|
62447
|
+
var _a;
|
|
62448
|
+
const source2 = (_a = this.rawUserData) != null ? _a : this.fieldModel;
|
|
62449
|
+
if (source2 == null) {
|
|
62450
|
+
if (!this.designState) {
|
|
62451
|
+
this.getCurrentUser();
|
|
62452
|
+
}
|
|
62453
|
+
return;
|
|
62454
|
+
}
|
|
62455
|
+
if (this.isStringValueType && typeof source2 === "object") {
|
|
62456
|
+
this.applyFieldValue(source2);
|
|
62457
|
+
return;
|
|
62458
|
+
}
|
|
62459
|
+
if (!this.isStringValueType && typeof source2 === "string") {
|
|
62460
|
+
this.getCurrentUser();
|
|
62461
|
+
return;
|
|
62462
|
+
}
|
|
62463
|
+
this.applyFieldValue(source2);
|
|
62388
62464
|
}
|
|
62389
62465
|
},
|
|
62390
62466
|
watch: {
|
|
@@ -62397,13 +62473,11 @@ const _sfc_main$f = {
|
|
|
62397
62473
|
"field.options.onValidate"() {
|
|
62398
62474
|
this.buildFieldRules();
|
|
62399
62475
|
},
|
|
62400
|
-
"field.options.type"
|
|
62401
|
-
|
|
62402
|
-
|
|
62403
|
-
|
|
62404
|
-
|
|
62405
|
-
},
|
|
62406
|
-
immediate: false
|
|
62476
|
+
"field.options.type"() {
|
|
62477
|
+
this.refreshFieldValueFromOptions();
|
|
62478
|
+
},
|
|
62479
|
+
"field.options.valueType"() {
|
|
62480
|
+
this.refreshFieldValueFromOptions();
|
|
62407
62481
|
}
|
|
62408
62482
|
},
|
|
62409
62483
|
created() {
|
|
@@ -62412,10 +62486,17 @@ const _sfc_main$f = {
|
|
|
62412
62486
|
this.initEventHandler();
|
|
62413
62487
|
this.buildFieldRules();
|
|
62414
62488
|
this.handleOnCreated();
|
|
62489
|
+
if (this.fieldModel && typeof this.fieldModel === "object") {
|
|
62490
|
+
this.rawUserData = this.fieldModel;
|
|
62491
|
+
}
|
|
62415
62492
|
},
|
|
62416
62493
|
mounted() {
|
|
62417
|
-
if (this.hasExistingValue())
|
|
62494
|
+
if (this.hasExistingValue()) {
|
|
62495
|
+
if (this.isStringValueType && typeof this.fieldModel === "object") {
|
|
62496
|
+
this.applyFieldValue(this.fieldModel, false);
|
|
62497
|
+
}
|
|
62418
62498
|
return;
|
|
62499
|
+
}
|
|
62419
62500
|
this.getCurrentUser();
|
|
62420
62501
|
}
|
|
62421
62502
|
};
|
|
@@ -63810,15 +63891,28 @@ const _sfc_main$b = {
|
|
|
63810
63891
|
getFormConfigCode(item) {
|
|
63811
63892
|
return (item == null ? void 0 : item.subCategoryCode) || (item == null ? void 0 : item.formCode) || this.documentTypeValue;
|
|
63812
63893
|
},
|
|
63894
|
+
buildReadonlyFormJson(formJson) {
|
|
63895
|
+
const json = lodash.exports.cloneDeep(formJson);
|
|
63896
|
+
if (json == null ? void 0 : json.widgetList) {
|
|
63897
|
+
traverseFieldWidgets(json.widgetList, (widget) => {
|
|
63898
|
+
if (widget == null ? void 0 : widget.options) {
|
|
63899
|
+
widget.options.disabled = true;
|
|
63900
|
+
widget.options.readonly = true;
|
|
63901
|
+
}
|
|
63902
|
+
});
|
|
63903
|
+
}
|
|
63904
|
+
return json;
|
|
63905
|
+
},
|
|
63813
63906
|
applyFormToRender(parsed, formData) {
|
|
63814
|
-
|
|
63907
|
+
const disabledJson = this.buildReadonlyFormJson(parsed);
|
|
63908
|
+
this.formJson = disabledJson;
|
|
63815
63909
|
this.showForm = true;
|
|
63816
63910
|
this.$nextTick(() => {
|
|
63817
63911
|
const ref2 = this.$refs.detailFormRender;
|
|
63818
63912
|
if (!ref2 || typeof ref2.setFormJson !== "function") {
|
|
63819
63913
|
return;
|
|
63820
63914
|
}
|
|
63821
|
-
ref2.setFormJson(lodash.exports.cloneDeep(
|
|
63915
|
+
ref2.setFormJson(lodash.exports.cloneDeep(disabledJson));
|
|
63822
63916
|
this.$nextTick(() => {
|
|
63823
63917
|
if (typeof ref2.setFormData === "function") {
|
|
63824
63918
|
ref2.setFormData(lodash.exports.cloneDeep(formData));
|
|
@@ -63835,7 +63929,7 @@ const _sfc_main$b = {
|
|
|
63835
63929
|
}
|
|
63836
63930
|
};
|
|
63837
63931
|
this.$nextTick(disable);
|
|
63838
|
-
setTimeout(disable,
|
|
63932
|
+
[300, 800, 1500].forEach((delay) => setTimeout(disable, delay));
|
|
63839
63933
|
},
|
|
63840
63934
|
async loadDocumentDetail(item) {
|
|
63841
63935
|
const formConfigCode = this.getFormConfigCode(item);
|
|
@@ -63881,7 +63975,7 @@ const _hoisted_1$9 = {
|
|
|
63881
63975
|
};
|
|
63882
63976
|
const _hoisted_2$7 = {
|
|
63883
63977
|
key: 1,
|
|
63884
|
-
class: "detail-form"
|
|
63978
|
+
class: "detail-form detail-form--readonly"
|
|
63885
63979
|
};
|
|
63886
63980
|
const _hoisted_3$5 = {
|
|
63887
63981
|
key: 2,
|
|
@@ -63945,7 +64039,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
63945
64039
|
_: 1
|
|
63946
64040
|
}, 8, ["modelValue", "onClose"]);
|
|
63947
64041
|
}
|
|
63948
|
-
var DocumentDetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-
|
|
64042
|
+
var DocumentDetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-ddc7afce"]]);
|
|
63949
64043
|
var index_vue_vue_type_style_index_0_lang$1 = "";
|
|
63950
64044
|
const _sfc_main$a = {
|
|
63951
64045
|
name: "document-select-widget",
|
|
@@ -66895,6 +66989,12 @@ const loadExtension = function(app) {
|
|
|
66895
66989
|
{ label: "\u516C\u53F8\u540D\u79F0", value: "companyName" }
|
|
66896
66990
|
]
|
|
66897
66991
|
}));
|
|
66992
|
+
registerCPEditor(app, "current-user-valueType", "current-user-valueType-editor", createSelectEditor("valueType", "extension.setting.currentUserValueType", {
|
|
66993
|
+
optionItems: [
|
|
66994
|
+
{ label: "\u5B57\u7B26\u4E32", value: "string" },
|
|
66995
|
+
{ label: "\u5BF9\u8C61", value: "object" }
|
|
66996
|
+
]
|
|
66997
|
+
}));
|
|
66898
66998
|
app.component(CurrentUserSecondCompanyWidget.name, CurrentUserSecondCompanyWidget);
|
|
66899
66999
|
app.component(AssetSelectWidget.name, AssetSelectWidget);
|
|
66900
67000
|
registerCPEditor(app, "asset-select-buttonText", "asset-select-buttonText-editor", createInputTextEditor("buttonText", "extension.setting.assetSelectButtonText"));
|