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/designer.es.js
CHANGED
|
@@ -3862,6 +3862,7 @@ const currentUserSchema = {
|
|
|
3862
3862
|
name: "",
|
|
3863
3863
|
label: "\u5F53\u524D\u7528\u6237",
|
|
3864
3864
|
type: "username",
|
|
3865
|
+
valueType: "object",
|
|
3865
3866
|
columnWidth: "auto",
|
|
3866
3867
|
required: false,
|
|
3867
3868
|
requiredHint: "",
|
|
@@ -4190,6 +4191,7 @@ var enLocale_extension = {
|
|
|
4190
4191
|
meetingRoomRemoteUrl: "Request URL",
|
|
4191
4192
|
allowMultiple: "Allow Multiple",
|
|
4192
4193
|
currentUserType: "Current User Type",
|
|
4194
|
+
currentUserValueType: "Value Type",
|
|
4193
4195
|
selectTreeCheckStrictly: "Check Strictly",
|
|
4194
4196
|
assetSelectButtonText: "Button Text",
|
|
4195
4197
|
assetSelectTypeJson: "Asset Type Json",
|
|
@@ -4263,6 +4265,7 @@ var zhLocale_extension = {
|
|
|
4263
4265
|
meetingRoomRemoteUrl: "\u8BF7\u6C42\u5730\u5740",
|
|
4264
4266
|
allowMultiple: "\u662F\u5426\u591A\u9009",
|
|
4265
4267
|
currentUserType: "\u5F53\u524D\u7528\u6237\u7C7B\u578B",
|
|
4268
|
+
currentUserValueType: "\u503C\u7C7B\u578B",
|
|
4266
4269
|
selectTreeCheckStrictly: "\u662F\u5426\u4E25\u683C\u9009\u4E2D",
|
|
4267
4270
|
assetSelectButtonText: "\u6309\u94AE\u6587\u5B57",
|
|
4268
4271
|
assetSelectTypeJson: "\u8D44\u4EA7\u7C7B\u578BJson",
|
|
@@ -69279,13 +69282,13 @@ function registerIcon(app) {
|
|
|
69279
69282
|
if (typeof window !== "undefined") {
|
|
69280
69283
|
let loadSvg = function() {
|
|
69281
69284
|
var body = document.body;
|
|
69282
|
-
var svgDom = document.getElementById("
|
|
69285
|
+
var svgDom = document.getElementById("__svg__icons__dom__1783064639584__");
|
|
69283
69286
|
if (!svgDom) {
|
|
69284
69287
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
69285
69288
|
svgDom.style.position = "absolute";
|
|
69286
69289
|
svgDom.style.width = "0";
|
|
69287
69290
|
svgDom.style.height = "0";
|
|
69288
|
-
svgDom.id = "
|
|
69291
|
+
svgDom.id = "__svg__icons__dom__1783064639584__";
|
|
69289
69292
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
69290
69293
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
69291
69294
|
}
|
|
@@ -79435,20 +79438,26 @@ const _sfc_main$f = {
|
|
|
79435
79438
|
return {
|
|
79436
79439
|
fieldModel: null,
|
|
79437
79440
|
oldFieldValue: null,
|
|
79438
|
-
rules: []
|
|
79441
|
+
rules: [],
|
|
79442
|
+
rawUserData: null
|
|
79439
79443
|
};
|
|
79440
79444
|
},
|
|
79441
79445
|
computed: {
|
|
79442
79446
|
displayModel() {
|
|
79447
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i;
|
|
79448
|
+
if (this.isStringValueType) {
|
|
79449
|
+
return (_a2 = this.fieldModel) != null ? _a2 : "";
|
|
79450
|
+
}
|
|
79443
79451
|
if (this.currentUserType === "username") {
|
|
79444
|
-
return this.fieldModel ? this.fieldModel.
|
|
79445
|
-
}
|
|
79446
|
-
|
|
79447
|
-
|
|
79448
|
-
return this.fieldModel ? this.fieldModel.companyName : "";
|
|
79449
|
-
} else {
|
|
79450
|
-
return JSON.stringify(this.fieldModel);
|
|
79452
|
+
return (_e = (_d = (_b2 = this.fieldModel) == null ? void 0 : _b2.username) != null ? _d : (_c2 = this.fieldModel) == null ? void 0 : _c2.userName) != null ? _e : "";
|
|
79453
|
+
}
|
|
79454
|
+
if (this.currentUserType === "deptName") {
|
|
79455
|
+
return (_g = (_f = this.fieldModel) == null ? void 0 : _f.deptName) != null ? _g : "";
|
|
79451
79456
|
}
|
|
79457
|
+
if (this.currentUserType === "companyName") {
|
|
79458
|
+
return (_i = (_h = this.fieldModel) == null ? void 0 : _h.companyName) != null ? _i : "";
|
|
79459
|
+
}
|
|
79460
|
+
return this.fieldModel ? JSON.stringify(this.fieldModel) : "";
|
|
79452
79461
|
},
|
|
79453
79462
|
widgetStyle() {
|
|
79454
79463
|
return {
|
|
@@ -79458,22 +79467,90 @@ const _sfc_main$f = {
|
|
|
79458
79467
|
currentUserType() {
|
|
79459
79468
|
var _a2;
|
|
79460
79469
|
return ((_a2 = this.field.options) == null ? void 0 : _a2.type) || "username";
|
|
79470
|
+
},
|
|
79471
|
+
isStringValueType() {
|
|
79472
|
+
var _a2;
|
|
79473
|
+
return ((_a2 = this.field.options) == null ? void 0 : _a2.valueType) === "string";
|
|
79461
79474
|
}
|
|
79462
79475
|
},
|
|
79463
79476
|
methods: {
|
|
79477
|
+
extractStringValue(data2) {
|
|
79478
|
+
var _a2, _b2, _c2, _d;
|
|
79479
|
+
if (data2 == null) {
|
|
79480
|
+
return "";
|
|
79481
|
+
}
|
|
79482
|
+
if (typeof data2 === "string") {
|
|
79483
|
+
return data2;
|
|
79484
|
+
}
|
|
79485
|
+
if (this.currentUserType === "username") {
|
|
79486
|
+
return (_b2 = (_a2 = data2.username) != null ? _a2 : data2.userName) != null ? _b2 : "";
|
|
79487
|
+
}
|
|
79488
|
+
if (this.currentUserType === "deptName") {
|
|
79489
|
+
return (_c2 = data2.deptName) != null ? _c2 : "";
|
|
79490
|
+
}
|
|
79491
|
+
if (this.currentUserType === "companyName") {
|
|
79492
|
+
return (_d = data2.companyName) != null ? _d : "";
|
|
79493
|
+
}
|
|
79494
|
+
return "";
|
|
79495
|
+
},
|
|
79496
|
+
normalizeFieldValue(data2) {
|
|
79497
|
+
if (this.isStringValueType) {
|
|
79498
|
+
return this.extractStringValue(data2);
|
|
79499
|
+
}
|
|
79500
|
+
if (data2 && typeof data2 === "object") {
|
|
79501
|
+
return data2;
|
|
79502
|
+
}
|
|
79503
|
+
return data2;
|
|
79504
|
+
},
|
|
79505
|
+
applyFieldValue(data2, emitChange = true) {
|
|
79506
|
+
var _a2;
|
|
79507
|
+
const oldValue = (_a2 = this.oldFieldValue) != null ? _a2 : this.fieldModel;
|
|
79508
|
+
this.fieldModel = this.normalizeFieldValue(data2);
|
|
79509
|
+
this.syncUpdateFormModel(this.fieldModel);
|
|
79510
|
+
if (emitChange) {
|
|
79511
|
+
this.emitFieldDataChange(this.fieldModel, oldValue);
|
|
79512
|
+
}
|
|
79513
|
+
},
|
|
79464
79514
|
hasExistingValue() {
|
|
79465
79515
|
var _a2;
|
|
79466
79516
|
const v = (_a2 = this.fieldModel) != null ? _a2 : this.oldFieldValue;
|
|
79467
|
-
|
|
79517
|
+
if (v === void 0 || v === null) {
|
|
79518
|
+
return false;
|
|
79519
|
+
}
|
|
79520
|
+
if (this.isStringValueType) {
|
|
79521
|
+
return v !== "";
|
|
79522
|
+
}
|
|
79523
|
+
if (typeof v === "object") {
|
|
79524
|
+
return Object.keys(v).length > 0;
|
|
79525
|
+
}
|
|
79526
|
+
return v !== "";
|
|
79468
79527
|
},
|
|
79469
79528
|
async getCurrentUser() {
|
|
79470
79529
|
const { data: data2 } = await service$1({
|
|
79471
79530
|
method: "get",
|
|
79472
79531
|
url: "unified-system/employee/loginInfo?accessType=0"
|
|
79473
79532
|
});
|
|
79474
|
-
this.
|
|
79475
|
-
this.
|
|
79476
|
-
|
|
79533
|
+
this.rawUserData = data2;
|
|
79534
|
+
this.applyFieldValue(data2);
|
|
79535
|
+
},
|
|
79536
|
+
refreshFieldValueFromOptions() {
|
|
79537
|
+
var _a2;
|
|
79538
|
+
const source2 = (_a2 = this.rawUserData) != null ? _a2 : this.fieldModel;
|
|
79539
|
+
if (source2 == null) {
|
|
79540
|
+
if (!this.designState) {
|
|
79541
|
+
this.getCurrentUser();
|
|
79542
|
+
}
|
|
79543
|
+
return;
|
|
79544
|
+
}
|
|
79545
|
+
if (this.isStringValueType && typeof source2 === "object") {
|
|
79546
|
+
this.applyFieldValue(source2);
|
|
79547
|
+
return;
|
|
79548
|
+
}
|
|
79549
|
+
if (!this.isStringValueType && typeof source2 === "string") {
|
|
79550
|
+
this.getCurrentUser();
|
|
79551
|
+
return;
|
|
79552
|
+
}
|
|
79553
|
+
this.applyFieldValue(source2);
|
|
79477
79554
|
}
|
|
79478
79555
|
},
|
|
79479
79556
|
watch: {
|
|
@@ -79486,13 +79563,11 @@ const _sfc_main$f = {
|
|
|
79486
79563
|
"field.options.onValidate"() {
|
|
79487
79564
|
this.buildFieldRules();
|
|
79488
79565
|
},
|
|
79489
|
-
"field.options.type"
|
|
79490
|
-
|
|
79491
|
-
|
|
79492
|
-
|
|
79493
|
-
|
|
79494
|
-
},
|
|
79495
|
-
immediate: false
|
|
79566
|
+
"field.options.type"() {
|
|
79567
|
+
this.refreshFieldValueFromOptions();
|
|
79568
|
+
},
|
|
79569
|
+
"field.options.valueType"() {
|
|
79570
|
+
this.refreshFieldValueFromOptions();
|
|
79496
79571
|
}
|
|
79497
79572
|
},
|
|
79498
79573
|
created() {
|
|
@@ -79501,10 +79576,17 @@ const _sfc_main$f = {
|
|
|
79501
79576
|
this.initEventHandler();
|
|
79502
79577
|
this.buildFieldRules();
|
|
79503
79578
|
this.handleOnCreated();
|
|
79579
|
+
if (this.fieldModel && typeof this.fieldModel === "object") {
|
|
79580
|
+
this.rawUserData = this.fieldModel;
|
|
79581
|
+
}
|
|
79504
79582
|
},
|
|
79505
79583
|
mounted() {
|
|
79506
|
-
if (this.hasExistingValue())
|
|
79584
|
+
if (this.hasExistingValue()) {
|
|
79585
|
+
if (this.isStringValueType && typeof this.fieldModel === "object") {
|
|
79586
|
+
this.applyFieldValue(this.fieldModel, false);
|
|
79587
|
+
}
|
|
79507
79588
|
return;
|
|
79589
|
+
}
|
|
79508
79590
|
this.getCurrentUser();
|
|
79509
79591
|
}
|
|
79510
79592
|
};
|
|
@@ -80899,15 +80981,28 @@ const _sfc_main$b = {
|
|
|
80899
80981
|
getFormConfigCode(item) {
|
|
80900
80982
|
return (item == null ? void 0 : item.subCategoryCode) || (item == null ? void 0 : item.formCode) || this.documentTypeValue;
|
|
80901
80983
|
},
|
|
80984
|
+
buildReadonlyFormJson(formJson) {
|
|
80985
|
+
const json = lodash.exports.cloneDeep(formJson);
|
|
80986
|
+
if (json == null ? void 0 : json.widgetList) {
|
|
80987
|
+
traverseFieldWidgets(json.widgetList, (widget) => {
|
|
80988
|
+
if (widget == null ? void 0 : widget.options) {
|
|
80989
|
+
widget.options.disabled = true;
|
|
80990
|
+
widget.options.readonly = true;
|
|
80991
|
+
}
|
|
80992
|
+
});
|
|
80993
|
+
}
|
|
80994
|
+
return json;
|
|
80995
|
+
},
|
|
80902
80996
|
applyFormToRender(parsed, formData) {
|
|
80903
|
-
|
|
80997
|
+
const disabledJson = this.buildReadonlyFormJson(parsed);
|
|
80998
|
+
this.formJson = disabledJson;
|
|
80904
80999
|
this.showForm = true;
|
|
80905
81000
|
this.$nextTick(() => {
|
|
80906
81001
|
const ref2 = this.$refs.detailFormRender;
|
|
80907
81002
|
if (!ref2 || typeof ref2.setFormJson !== "function") {
|
|
80908
81003
|
return;
|
|
80909
81004
|
}
|
|
80910
|
-
ref2.setFormJson(lodash.exports.cloneDeep(
|
|
81005
|
+
ref2.setFormJson(lodash.exports.cloneDeep(disabledJson));
|
|
80911
81006
|
this.$nextTick(() => {
|
|
80912
81007
|
if (typeof ref2.setFormData === "function") {
|
|
80913
81008
|
ref2.setFormData(lodash.exports.cloneDeep(formData));
|
|
@@ -80924,7 +81019,7 @@ const _sfc_main$b = {
|
|
|
80924
81019
|
}
|
|
80925
81020
|
};
|
|
80926
81021
|
this.$nextTick(disable);
|
|
80927
|
-
setTimeout(disable,
|
|
81022
|
+
[300, 800, 1500].forEach((delay) => setTimeout(disable, delay));
|
|
80928
81023
|
},
|
|
80929
81024
|
async loadDocumentDetail(item) {
|
|
80930
81025
|
const formConfigCode = this.getFormConfigCode(item);
|
|
@@ -80970,7 +81065,7 @@ const _hoisted_1$9 = {
|
|
|
80970
81065
|
};
|
|
80971
81066
|
const _hoisted_2$7 = {
|
|
80972
81067
|
key: 1,
|
|
80973
|
-
class: "detail-form"
|
|
81068
|
+
class: "detail-form detail-form--readonly"
|
|
80974
81069
|
};
|
|
80975
81070
|
const _hoisted_3$5 = {
|
|
80976
81071
|
key: 2,
|
|
@@ -81034,7 +81129,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
81034
81129
|
_: 1
|
|
81035
81130
|
}, 8, ["modelValue", "onClose"]);
|
|
81036
81131
|
}
|
|
81037
|
-
var DocumentDetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-
|
|
81132
|
+
var DocumentDetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-ddc7afce"]]);
|
|
81038
81133
|
var index_vue_vue_type_style_index_0_lang$1 = "";
|
|
81039
81134
|
const _sfc_main$a = {
|
|
81040
81135
|
name: "document-select-widget",
|
|
@@ -83997,6 +84092,12 @@ const loadExtension = function(app) {
|
|
|
83997
84092
|
{ label: "\u516C\u53F8\u540D\u79F0", value: "companyName" }
|
|
83998
84093
|
]
|
|
83999
84094
|
}));
|
|
84095
|
+
registerCPEditor(app, "current-user-valueType", "current-user-valueType-editor", createSelectEditor("valueType", "extension.setting.currentUserValueType", {
|
|
84096
|
+
optionItems: [
|
|
84097
|
+
{ label: "\u5B57\u7B26\u4E32", value: "string" },
|
|
84098
|
+
{ label: "\u5BF9\u8C61", value: "object" }
|
|
84099
|
+
]
|
|
84100
|
+
}));
|
|
84000
84101
|
addCustomWidgetSchema(currentUserSecondCompanySchema);
|
|
84001
84102
|
app.component(CurrentUserSecondCompanyWidget.name, CurrentUserSecondCompanyWidget);
|
|
84002
84103
|
addCustomWidgetSchema(assetSelectSchema);
|