@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,489 lines • 60.7 kB
JavaScript
var ge = Object.defineProperty;
var be = (t, e, n) => e in t ? ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var P = (t, e, n) => be(t, typeof e != "symbol" ? e + "" : e, n);
import { ref as O, computed as U, defineComponent as Q, provide as q, onMounted as he, nextTick as ye, createVNode as F, createTextVNode as z, inject as H, watch as Ce } from "vue";
import { FButtonEdit as xe } from "../button-edit/index.esm.js";
import { isPlainObject as Y, cloneDeep as j } from "lodash-es";
import { FPropertyPanel as we } from "../property-panel/index.esm.js";
import { FTreeView as Se } from "../tree-view/index.esm.js";
import { FMessageBoxService as X } from "../message-box/index.esm.js";
import { DgControl as J, canvasChanged as Ee, refreshCanvas as Pe } from "../designer-canvas/index.esm.js";
import { EVENT_PROPERTY_TAB_IDS as Te } from "../common/index.esm.js";
function Z(t, e) {
let n;
function r(l) {
const { properties: p, title: y, ignore: d } = l, f = d && Array.isArray(d), c = Object.keys(p).reduce((h, x) => ((!f || !d.find((T) => T === x)) && (h[x] = p[x].type === "object" && p[x].properties ? r(p[x]) : j(p[x].default)), h), {});
if (y && (!f || !d.find((h) => h === "id"))) {
const h = y.toLowerCase().replace(/-/g, "_");
c.id = `${h}_${Math.random().toString().slice(2, 6)}`;
}
return c;
}
function o(l) {
const { properties: p, title: y, required: d } = l;
if (d && Array.isArray(d)) {
const f = d.reduce((c, h) => (c[h] = p[h].type === "object" && p[h].properties ? r(p[h]) : j(p[h].default), c), {});
if (y && d.find((c) => c === "id")) {
const c = y.toLowerCase().replace(/-/g, "_");
f.id = `${c}_${Math.random().toString().slice(2, 6)}`;
}
return f;
}
return {
type: y
};
}
function s(l, p = {}, y) {
const d = t[l];
if (d) {
let f = o(d);
const c = e[l];
return f = c ? c({ getSchemaByType: s }, f, p, y) : f, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(f), f;
}
return null;
}
function i(l, p) {
const y = r(p);
return Object.keys(y).reduce((d, f) => (Object.prototype.hasOwnProperty.call(l, f) && (d[f] && Y(d[f]) && Y(l[f] || !l[f]) ? Object.assign(d[f], l[f] || {}) : d[f] = l[f]), d), y), y;
}
function v(l, p) {
return Object.keys(l).filter((d) => l[d] != null).reduce((d, f) => {
if (p.has(f)) {
const c = p.get(f);
if (typeof c == "string")
d[c] = l[f];
else {
const h = c(f, l[f], l);
Object.assign(d, h);
}
} else
d[f] = l[f];
return d;
}, {});
}
function a(l, p, y = /* @__PURE__ */ new Map()) {
const d = i(l, p);
return v(d, y);
}
function u(l) {
var y;
const p = l.type;
if (p) {
const d = t[p];
if (!d)
return l;
const f = i(l, d), c = ((y = l.editor) == null ? void 0 : y.type) || "";
if (c) {
const h = t[c], x = i(l.editor, h);
f.editor = x;
}
return f;
}
return l;
}
function m(l) {
n = l;
}
return { getSchemaByType: s, resolveSchemaWithDefaultValue: u, resolveSchemaToProps: a, mappingSchemaToProps: v, setDesignerContext: m };
}
const K = {}, ee = {}, { resolveSchemaWithDefaultValue: Fe, resolveSchemaToProps: Me, mappingSchemaToProps: Ie } = Z(K, ee);
function Ve(t = {}) {
function e(u, m, l, p) {
if (typeof l == "number")
return p[u].length === l;
if (typeof l == "object") {
const y = Object.keys(l)[0], d = l[y];
if (y === "not")
return Number(p[u].length) !== Number(d);
if (y === "moreThan")
return Number(p[u].length) >= Number(d);
if (y === "lessThan")
return Number(p[u].length) <= Number(d);
}
return !1;
}
function n(u, m, l, p) {
return p[u] && p[u].propertyValue && String(p[u].propertyValue.value) === String(l);
}
const r = /* @__PURE__ */ new Map([
["length", e],
["getProperty", n]
]);
Object.keys(t).reduce((u, m) => (u.set(m, t[m]), u), r);
function o(u, m) {
const l = u;
return typeof m == "number" ? [{ target: l, operator: "length", param: null, value: Number(m) }] : typeof m == "boolean" ? [{ target: l, operator: "getProperty", param: u, value: !!m }] : typeof m == "object" ? Object.keys(m).map((p) => {
if (p === "length")
return { target: l, operator: "length", param: null, value: m[p] };
const y = p, d = m[p];
return { target: l, operator: "getProperty", param: y, value: d };
}) : [];
}
function s(u) {
return Object.keys(u).reduce((l, p) => {
const y = o(p, u[p]);
return l.push(...y), l;
}, []);
}
function i(u, m) {
if (r.has(u.operator)) {
const l = r.get(u.operator);
return l && l(u.target, u.param, u.value, m) || !1;
}
return !1;
}
function v(u, m) {
return s(u).reduce((y, d) => y && i(d, m), !0);
}
function a(u, m) {
const l = Object.keys(u), p = l.includes("allOf"), y = l.includes("anyOf"), d = p || y, h = (d ? u[d ? p ? "allOf" : "anyOf" : "allOf"] : [u]).map((T) => v(T, m));
return p ? !h.includes(!1) : h.includes(!0);
}
return { parseValueSchema: a };
}
const ke = {
convertTo: (t, e, n, r) => {
t.appearance || (t.appearance = {}), t.appearance[e] = n;
},
convertFrom: (t, e, n) => t.appearance ? t.appearance[e] : t[e]
}, Oe = {
convertFrom: (t, e, n) => t.buttons && t.buttons.length ? `共 ${t.buttons.length} 项` : "无"
}, Ne = {
convertTo: (t, e, n, r) => {
t.editor && (t.editor[e] = n);
},
convertFrom: (t, e, n) => t.editor && Object.prototype.hasOwnProperty.call(t.editor, e) ? t.editor[e] : t[e]
}, Re = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"drawer-toolbar-item": { type: "drawer-toolbar-item", name: "抽屉工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
"drawer-toolbar": { type: "drawer-toolbar", name: "抽屉工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
nav: { type: "nav", name: "标签类导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" },
image: { type: "image", name: "图像" },
avatar: { type: "avatar", name: "头像" },
"discussion-editor": { type: "discussion-editor", name: "评论编辑区" },
"discussion-list": { type: "discussion-list", name: "评论列表" },
comment: { type: "comment", name: "评论区" },
"approval-logs": { type: "approval-logs", name: "审批记录" },
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
wizard: { type: "wizard", name: "向导", icon: "wizard" },
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
step: { type: "step", name: "步骤条", icon: "step" },
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
}, Be = {
convertFrom: (t, e, n) => {
var o;
const r = t.editor && t.editor[e] ? t.editor[e] : t[e];
return ((o = Re[r]) == null ? void 0 : o.name) || r;
}
}, Ue = {
convertTo: (t, e, n, r) => {
t[e] = t[e];
},
convertFrom: (t, e, n) => t.editor ? n.getRealEditorType(t.editor.type) : ""
}, je = {
convertTo: (t, e, n, r) => {
(t.type === "data-grid-column" || t.type === "tree-grid-column") && (t.formatter ? t.formatter[e] = n : t.formatter = {
[e]: n
});
},
convertFrom: (t, e, n) => {
if (t.formatter) {
if (e === "trueText")
return t.formatter.trueText;
if (e === "falseText")
return t.formatter.falseText;
if (e === "prefix")
return t.formatter.prefix;
if (e === "suffix")
return t.formatter.suffix;
if (e === "precision")
return t.formatter.precision;
if (e === "decimal")
return t.formatter.decimal;
if (e === "thousand")
return t.formatter.thousand;
if (e === "dateFormat")
return t.formatter.dateFormat || "yyyy-MM-dd";
if (e === "customFormat")
return t.formatter.customFormat;
if (e === "type")
return t.formatter.type || "none";
}
return "none";
}
}, $e = {
convertTo: (t, e, n, r) => {
t.command ? t.command[e] = n : t.command = {
[e]: n
}, e === "enableType" && n === "default" && (t.command.enable = !0, t.command.formatter = "", t.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]), e === "enableType" && n === "custom" && (t.command.enable = !0, t.command.commands = [
{
value: "add",
text: "增加",
type: "link"
},
{
value: "edit",
text: "编辑",
type: "link"
},
{
value: "remove",
text: "删除",
type: "link"
}
]), e === "enableType" && n === "unable" && (t.command.enable = !1, t.command.formatter = "");
},
convertFrom: (t, e, n) => {
var r, o;
if (t.command) {
if (e === "enableType") {
if (t.command.enableType)
return t.command.enableType;
const s = (o = (r = t.command) == null ? void 0 : r.commands) == null ? void 0 : o.find((i) => i.command === "edit" && i.type === "primary");
return t.command.enable ? s ? "default" : "custom" : "unable";
}
if (e === "commands")
return t.command.enableType === "custom" ? t.command.commands : [];
if (e === "formatter")
return t.command.formatter;
if (e === "count")
return t.command.count;
if (e === "columnWidth")
return t.command.columnWidth || 200;
}
return "";
}
}, ze = {
convertTo: (t, e, n, r) => {
t.column ? t.column[e] = n : t.column = {
[e]: n
}, e === "fitColumns" && n && (t.column.fitMode || (t.column.fitMode = "average"));
},
convertFrom: (t, e, n) => {
if (t.column) {
if (e === "fitColumns")
return t.column.fitColumns;
if (e === "fitMode")
return t.column.fitMode;
}
return "";
}
}, Ae = {
convertTo: (t, e, n, r) => {
t.summary ? t.summary[e] = n : t.summary = {
[e]: n
}, e === "enable" && n && (t.summary ? t.summary.groupFields || (t.summary.groupFields = []) : t.summary = {
enable: n,
groupFields: []
});
},
convertFrom: (t, e, n) => {
var r, o;
return e === "customSummaryStyle" ? t.summary.customSummaryStyle : e === "position" ? ((r = t.summary) == null ? void 0 : r[e]) || "bottom" : e === "customRender" ? ((o = t.summary) == null ? void 0 : o[e]) || "" : t.summary && e === "enable" ? t.summary.enable : t.type === "data-grid-column" ? t.enableSummary === void 0 ? !1 : t.enableSummary : "";
}
}, De = {
convertTo: (t, e, n, r) => {
t.group ? t.group[e] = n : t.group = {
[e]: n
}, e === "enable" && n && (t.group ? t.group.groupFields || (t.group.groupFields = []) : t.group = {
enable: n,
groupFields: [],
showSummary: !1,
customRender: ""
});
},
convertFrom: (t, e, n) => {
if (t.group) {
if (e === "enable")
return t.group.enable;
if (e === "showSummary")
return t.group.showSummary;
if (e === "customRender")
return t.group.customRender;
if (e === "groupFields")
return t.group.groupFields;
}
}
}, _e = {
convertFrom: (t, e) => t.binding ? t.binding.path : "",
convertTo: (t, e, n) => {
if (n && n.length > 0) {
const r = n[0];
t.binding || (t.binding = {}), t.binding.type = "Form", t.binding.path = r.bindingField, t.binding.field = r.id, t.binding.fullPath = r.path, t.path = r.bindingPath;
}
}
}, Le = {
convertTo: (t, e, n, r) => {
t.pagination || (t.pagination = {}), e === "sizeLimits" ? t.pagination.sizeLimits = n.split(",") : t.pagination[e] = n;
},
convertFrom: (t, e, n) => {
var r;
return t.pagination ? e === "sizeLimits" ? (r = t.pagination.sizeLimits) == null ? void 0 : r.join(",") : t.pagination[e] : t[e];
}
}, qe = {
convertTo: (t, e, n, r) => {
t.rowNumber || (t.rowNumber = {}), t.rowNumber[e] = n;
},
convertFrom: (t, e, n) => t.rowNumber ? t.rowNumber[e] : t[e]
}, We = {
convertTo: (t, e, n, r) => {
t.selection || (t.selection = {}), t.selection[e] = n;
},
convertFrom: (t, e, n) => {
if (!t.selection)
return !!t[e];
const r = !!t.selection[e];
return e === "showCheckbox" && r == null && t.selection.multiSelect === !0 ? !0 : r;
}
}, Ge = {
convertFrom: (t, e, n) => t[e] && t[e].length ? `共 ${t[e].length} 项` : ""
}, He = {
convertFrom: (t, e) => t[e] || "",
convertTo: (t, e, n) => {
t[e] = n;
}
}, Ye = {
convertTo: (t, e, n, r) => {
t.size || (t.size = {}), t.size[e] = n;
},
convertFrom: (t, e, n) => t.size ? t.size[e] : t[e]
}, Je = {
convertFrom: (t, e, n) => {
var r, o;
return (r = t.formatter) != null && r.data && e === "formatterEnumData" && !t.formatterEnumData ? (o = t.formatter) == null ? void 0 : o.data : t.formatterEnumData;
}
}, Qe = {
convertTo: (t, e, n, r) => {
t.sort || (t.sort = {}), t.sort[e] = n;
},
convertFrom: (t, e, n) => {
var r, o;
if (e === "mode")
return ((r = t.sort) == null ? void 0 : r.mode) || "client";
if (e === "multiSort")
return !!((o = t.sort) != null && o.multiSort);
}
}, Xe = {
convertTo: (t, e, n, r) => {
t.filter || (t.filter = {}), t.filter[e] = n, e === "enable" && (t.enableFilter = !1);
},
convertFrom: (t, e, n) => {
var r, o, s, i;
return e === "mode" ? ((r = t.filter) == null ? void 0 : r.mode) || "server" : e === "filterStyle" ? ((o = t.filter) == null ? void 0 : o.filterStyle) || "filter-column" : e === "enable" ? ((s = t.filter) == null ? void 0 : s.enable) !== void 0 ? !!t.filter.enable : !!t.enableFilter : ((i = t.filter) == null ? void 0 : i[e]) || void 0;
}
}, Ze = {
convertTo: (t, e, n, r) => {
t.rowOption ? t.rowOption[e] = n : t.rowOption = {
[e]: n
};
},
convertFrom: (t, e, n) => {
if (t.rowOption) {
if (e === "customRowStyle")
return t.rowOption.customRowStyle;
if (e === "customCellStyle")
return t.rowOption.customCellStyle;
if (e === "height")
return t.rowOption.height;
}
return "";
}
}, Ke = {
convertTo: (t, e, n, r) => {
(t.type === "data-grid-column" || t.type === "tree-grid-column") && (t[e] = n, e === "columnTemplateType" && n === "hyperlink" && (t.onClickLinkCommand ? t.columnTemplate = `
<span class="f-pretend-link f-cursor-pointer"
@click="(ctx)=>viewModel.current.${t.onClickLinkCommand || ""}({id: rowData.id,context: ctx})">
{{rowData.${t.field}}}
</span>` : t.columnTemplate = `
<span class="f-pretend-link f-cursor-pointer">
{{rowData.${t.field}}}
</span>`), e === "columnTemplateType" && n === "default" && (t.columnTemplate = ""), e === "columnTemplateType" && n === "custom" && (t.columnTemplate = ""));
},
convertFrom: (t, e, n) => e === "columnTemplate" ? t.columnTemplate : e === "columnTemplateType" ? t.columnTemplateType ? t.columnTemplateType || "default" : t.columnTemplate && !t.onClickLinkCommand ? "custom" : t.columnTemplate && t.onClickLinkCommand ? "hyperlink" : "default" : ""
}, et = {
convertTo: (t, e, n, r) => {
t.hierarchy || (t.hierarchy = {
cascadeOption: {}
}), t.hierarchy.cascadeOption || (t.hierarchy.cascadeOption = {}), t.hierarchy.cascadeOption[e] = n;
},
convertFrom: (t, e, n) => {
var r, o;
return !!((o = (r = t.hierarchy) == null ? void 0 : r.cascadeOption) != null && o[e]);
}
};
function te(t, e, n) {
const r = /* @__PURE__ */ new Map([
["/converter/appearance.converter", ke],
["/converter/buttons.converter", Oe],
["/converter/property-editor.converter", Ne],
["/converter/items-count.converter", Ge],
["/converter/type.converter", Be],
["/converter/change-editor.converter", Ue],
["/converter/change-formatter.converter", je],
["/converter/column-command.converter", $e],
["/converter/column-option.converter", ze],
["/converter/summary.converter", Ae],
["/converter/group.converter", De],
["/converter/form-group-label.converter", He],
["/converter/field-selector.converter", _e],
["/converter/pagination.converter", Le],
["/converter/row-number.converter", qe],
["/converter/grid-selection.converter", We],
["/converter/size.converter", Ye],
["/converter/change-formatter-enum.converter", Je],
["/converter/grid-sort.converter", Qe],
["/converter/grid-filter.converter", Xe],
["/converter/row-option.converter", Ze],
["/converter/change-formatter-type.converter", Ke],
["/converter/tree-auto-check.converter", et]
]), o = /* @__PURE__ */ new Map([
["string", { type: "input-group", enableClear: !1 }],
["boolean", {
type: "combo-list",
textField: "name",
valueField: "value",
idField: "value",
enableClear: !1,
editable: !1,
data: [
{
value: !0,
name: "是"
},
{
value: !1,
name: "否"
}
]
}],
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
["array", { type: "button-edit" }],
["number", { type: "number-spinner", placeholder: "" }],
["events-editor", { type: "events-editor", hide: !0 }],
["multiLanguage", { type: "language-textbox" }]
]), s = Ve();
function i(d, f) {
return () => s.parseValueSchema(d, f);
}
function v(d, f, c) {
return d.includes("visible") && f.visible !== void 0 ? typeof f.visible == "boolean" ? () => !!f.visible : f.visible === void 0 ? !0 : i(f.visible, c) : () => !0;
}
function a(d, f, c) {
return d.includes("readonly") && f.readonly !== void 0 ? typeof f.readonly == "boolean" ? () => !!f.readonly : i(f.readonly, c) : () => !1;
}
function u(d, f) {
const c = d.$converter || f;
return typeof c == "string" && c && r.has(c) ? r.get(c) || null : c || null;
}
function m(d, f, c, h, x, T = "", V = "") {
return Object.keys(d).map((S) => {
const N = O(1), k = S, C = d[S], g = Object.keys(C), E = C.title, M = C.type, b = o.get(M) || { type: "input-group", enableClear: !1 }, w = C.editor ? Object.assign({}, b, C.editor) : Object.assign({}, b), $ = v(g, C, f), A = a(g, C, f);
w.readonly = w.readonly === void 0 ? A() : w.readonly;
const _ = C.type === "cascade" ? m(C.properties, f, c, h, x, T, V) : [], L = !0;
let R = u(C, V);
const de = U({
get() {
if (N.value) {
if (["class", "style"].find((D) => D === k) && !R && (R = r.get("/converter/appearance.converter") || null), R && R.convertFrom) {
const D = R.convertFrom(c, S, x, T);
return D === void 0 && Object.prototype.hasOwnProperty.call(C, "defaultValue") ? C.type === "boolean" ? C.defaultValue : C.defaultValue || "" : D;
}
const B = c[S];
return Object.prototype.hasOwnProperty.call(C, "defaultValue") && (B === void 0 || typeof B == "string" && B === "") ? C.type === "boolean" ? C.defaultValue : C.defaultValue || "" : B;
}
return null;
},
set(B) {
N.value += 1, R && R.convertTo ? (R.convertTo(h, S, B, x, T), R.convertTo(c, S, B, x, T)) : (h[S] = B, c[S] = B);
}
}), { refreshPanelAfterChanged: fe, description: me, isExpand: pe, parentPropertyID: ve } = C, G = { propertyID: k, propertyName: E, propertyType: M, propertyValue: de, editor: w, visible: $, readonly: A, cascadeConfig: _, hideCascadeTitle: L, refreshPanelAfterChanged: fe, description: me, isExpand: pe, parentPropertyID: ve };
return f[k] = G, G;
});
}
function l(d, f, c = {}) {
const h = {}, x = t[d];
return x && x.categories ? Object.keys(x.categories).map((V) => {
const I = x.categories[V], S = I == null ? void 0 : I.title, N = m(I.properties || {}, h, {}, c, f);
return { categoryId: V, categoryName: S, properties: N };
}) : [];
}
function p(d, f, c, h, x = "") {
const T = f.$ref.schema, V = f.$ref.converter, I = c[T], S = I.type, N = n(I), k = {}, C = t[S];
if (C && C.categories) {
const g = C.categories[d], E = g == null ? void 0 : g.title;
V && Object.keys(g.properties).forEach((w) => {
g.properties[w].$converter = V;
});
const M = (g == null ? void 0 : g.properties) || {}, b = m(M, k, N, I, h, x);
return { categoryId: d, categoryName: E, properties: b };
}
return { categoryId: d, categoryName: "", properties: [] };
}
function y(d, f, c, h, x) {
const T = d.type, V = n(d), I = {};
let S = x || t[T];
if (!(S && Object.keys(S).length > 0) && c && c.getPropConfig && (S = c.getPropConfig(h)), S && S.categories) {
const k = [];
return Object.keys(S.categories).map((C) => {
const g = S.categories[C];
if (g.$ref) {
k.push(p(C, g, d, f, h));
return;
}
const E = g == null ? void 0 : g.title, M = g == null ? void 0 : g.tabId, b = g == null ? void 0 : g.tabName, w = g == null ? void 0 : g.hide, $ = g == null ? void 0 : g.hideTitle, A = m(g.properties || {}, I, V, d, f, h, g.$converter), { setPropertyRelates: _ } = g, L = g == null ? void 0 : g.parentPropertyID;
k.push({ categoryId: C, categoryName: E, tabId: M, tabName: b, hide: w, properties: A, hideTitle: $, setPropertyRelates: _, parentPropertyID: L });
}), k;
}
return [];
}
return {
getPropertyConfigBySchema: y,
getPropertyConfigByType: l,
propertyConverterMap: r
};
}
const ne = {}, re = {};
te(ne, re, Fe);
const oe = {}, ie = {}, { resolveSchemaWithDefaultValue: tt } = Z(oe, ie), se = {}, ae = {};
te(se, ae, tt);
function nt(t, e, n = /* @__PURE__ */ new Map(), r = (i, v, a, u) => v, o = {}, s = (i) => i) {
return K[e.title] = e, ee[e.title] = r, ne[e.title] = o, re[e.title] = s, oe[e.title] = e, ie[e.title] = r, se[e.title] = o, ae[e.title] = s, (i = {}, v = !0) => {
if (!v)
return Ie(i, n);
const a = Me(i, e, n), u = Object.keys(t).reduce((m, l) => (m[l] = t[l].default, m), {});
return Object.assign(u, a);
};
}
const rt = "https://json-schema.org/draft/2020-12/schema", ot = "https://farris-design.gitee.io/collection-property-editor.schema.json", it = "collection-property-editor", st = "A Farris Component", at = "object", lt = {
id: {
description: "The unique identifier for collection-property-editor",
type: "string"
},
type: {
description: "The type string of collection-property-editor",
type: "string",
default: "collection-property-editor"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
modelValue: {
type: "array",
default: []
},
idField: {
type: "string",
default: "id"
},
textField: {
type: "string",
default: ""
},
defaultComponentSchema: {
type: "object",
default: {}
},
modalTitle: {
type: "string",
default: "编辑器"
},
visibleCondition: {
type: "object",
default: null
},
allowCollapse: {
type: "boolean",
default: !0
},
enableClear: {
type: "boolean",
default: !1
}
}, ct = [
"type"
], ut = [
"id"
], dt = {
$schema: rt,
$id: ot,
title: it,
description: st,
type: at,
properties: lt,
required: ct,
ignore: ut
}, le = {
modelValue: {
type: Array,
default: []
},
idField: {
type: String,
default: "id"
},
textField: {
type: String,
default: ""
},
defaultComponentSchema: {
type: Object,
default: {}
},
isToolbarHidden: {
type: Boolean,
default: !1
},
useFormCommand: {
type: Object,
default: {}
},
useFormSchema: {
type: Object,
default: {}
},
visibleCondition: {
type: Function,
default: null
},
allowCollapse: {
type: Boolean,
default: !0
},
enableClear: {
type: Boolean,
default: !1
},
designerHostService: {
type: Object,
default: null
}
}, ce = {
...le,
modalTitle: {
type: String,
default: "编辑器"
}
}, ft = nt(ce, dt), ue = /* @__PURE__ */ Q({
name: "CollectionPropertyContainer",
props: le,
emits: ["valueChange", "selectionChange"],
setup(t, e) {
const n = O(), r = O(), {
idField: o,
textField: s,
defaultComponentSchema: i,
isToolbarHidden: v
} = t, a = O(t.modelValue || []), u = O(), m = O("collection-property-editor");
q("useFormCommand", t.useFormCommand), q("useFormSchema", t.useFormSchema), q("designerHostService", t.designerHostService);
const l = O(), p = U(() => !a.value || a.value.length === 0), y = [{
field: s,
title: "名称",
width: 340,
resizable: !0,
dataType: "string"
}], d = U(() => a.value.filter((b) => t.visibleCondition ? t.visibleCondition(b) : !0));
function f() {
const b = j(i), w = Math.random().toString().slice(2, 6);
return b[o] = b[o] + "_" + w, b[s] = b[s] + "_" + w, b;
}
function c(b) {
l.value = b, e.emit("selectionChange", {
selectedData: l,
propertyConfig: u,
propertyPanelRef: r.value
}), r.value.updatePropertyConfig(u.value, l.value, !0);
}
function h(b) {
if (b >= a.value.length && (b = a.value.length - 1), a.value.length > 0) {
const w = a.value[b];
n.value.selectItemById(w[o]), c(w);
}
}
function x() {
const b = f();
a.value.push(b), n.value.updateDataSource(d.value), n.value.selectItemById(b[o]), c(b);
}
function T() {
const b = a.value && a.value.length > 0 ? a.value[0] : null;
b && (n.value.selectItemById(b[o]), c(b));
}
function V() {
const b = a.value.indexOf(l.value);
a.value.splice(b, 1), n.value.updateDataSource(d.value), h(b);
}
function I() {
if (!l.value)
return;
const b = a.value.indexOf(l.value);
b !== a.value.length - 1 && (a.value[b] = a.value[b + 1], a.value[b + 1] = l.value, n.value.updateDataSource(d.value));
}
function S() {
X.question("您确定要清空所有按钮吗?", "", () => {
a.value = [], n.value.updateDataSource([]), e.emit("clear");
}, () => {
});
}
function N() {
if (!l.value)
return;
const b = a.value.indexOf(l.value);
b !== 0 && (a.value[b] = a.value[b - 1], a.value[b - 1] = l.value, n.value.updateDataSource(d.value));
}
function k(b) {
c(b[0]);
}
function C(b) {
const {
changeObject: w,
designerItem: $
} = b;
n.value.updateDataSource(d.value);
}
he(() => {
ye(() => {
T();
});
});
const g = U(() => !l.value || p.value), E = U(() => g.value || a.value.length <= 1 ? !1 : a.value.findIndex((w) => w.id === l.value.id) > 0), M = U(() => g.value || a.value.length <= 1 ? !1 : a.value.findIndex((w) => w.id === l.value.id) < a.value.length - 1);
return e.expose({
propertyPanelRef: r
}), () => F("div", {
class: "f-utils-fill-flex-column h-100 pt-2 pl-2 border-bottom"
}, [F("div", {
hidden: v,
class: "border-bottom pb-2"
}, [F("button", {
class: "btn btn-primary mr-2",
onClick: x
}, [z("新增")]), F("button", {
class: "btn btn-secondary mr-2",
onClick: V,
disabled: g.value
}, [z("删除")]), F("button", {
class: "btn btn-secondary mr-2",
onClick: N,
disabled: !E.value
}, [z("上移")]), F("button", {
class: "btn btn-secondary mr-2",
onClick: I,
disabled: !M.value
}, [z("下移")]), t.enableClear && F("button", {
class: "btn btn-secondary mr-2 d-flex align-items-center",
style: "float:right",
onClick: S,
disabled: p.value
}, [F("i", {
class: "f-icon f-icon-close mr-1"
}, null), z("清空")])]), F("div", {
class: "f-utils-fill-flex-row"
}, [F("div", {
class: "f-utils-fill f-utils-overflow-auto"
}, [F(Se, {
ref: n,
columns: y,
data: d.value,
rowOption: {
disabledField: "undefined"
},
fit: "true",
idField: o,
columnOption: {
fitColumns: !0
},
onSelectionChange: k
}, null)]), F("div", {
hidden: p.value,
style: "display: flex;"
}, [F(we, {
propertyConfig: u.value,
ref: r,
propertyName: m.value,
enableSearch: !1,
allowCollapse: t.allowCollapse,
onPropertyChanged: C
}, null)])])]);
}
}), W = /* @__PURE__ */ Q({
name: "FCollectionPropertyEditor",
props: ce,
emits: ["valueChange", "selectionChange"],
setup(t, e) {
const n = O(), r = H("useFormCommand"), o = H("useFormSchema"), s = O(j(t.modelValue) || []), i = O();
Ce(() => t.modelValue, (c) => {
s.value = j(c) || [];
});
const v = U(() => {
var c;
return (c = i.value) == null ? void 0 : c.getModal();
}), a = U(() => {
let c = 0;
return s.value && (t.visibleCondition ? c = s.value.filter(t.visibleCondition).length : c = s.value.length), `共 ${c || 0} 项`;
});
function u(c) {
Object.keys(c).forEach((h) => {
h.indexOf("__fv") > -1 && delete c[h];
});
}
function m(c) {
c && c.forEach((h) => {
u(h);
});
}
function l() {
return m(s.value), e.emit("valueChange", s.value), !0;
}
function p() {
return !0;
}
function y({
selectedData: c,
propertyConfig: h
}) {
u(c.value), e.emit("selectionChange", {
selectedData: c,
propertyConfig: h,
modalRef: v.value,
buttonPropertyPanelInstance: n.value.propertyPanelRef
});
}
function d() {
s.value = [];
}
const f = {
title: t.modalTitle || "编辑器",
width: 650,
height: 700,
minWidth: 380,
minHeight: 400,
fitContent: !1,
showMaxButton: !0,
resizeable: !0,
draggable: !0,
enableEsc: !0,
buttons: [{
name: "cancel",
text: "取消",
class: "btn btn-secondary",
handle: p
}, {
name: "accept",
text: "确定",
class: "btn btn-primary",
handle: l
}],
closedCallback: (c, h) => {
if ((c == null ? void 0 : c.target.name) === "cancel" || h === "icon" || h === "esc")
return s.value = j(t.modelValue), e.emit("valueChange", s.value), !0;
!c && h === "button" && l();
}
};
return () => F(xe, {
modelValue: a.value,
"onUpdate:modelValue": (c) => a.value = c,
editable: !1,
enableTitle: !0,
inputType: "text",
buttonBehavior: "Modal",
modalOptions: f,
ref: i
}, {
default: () => [F("div", {
class: "h-100 d-flex flex-column"
}, [F(ue, {
ref: n,
modelValue: s.value,
"onUpdate:modelValue": (c) => s.value = c,
idField: t.idField,
textField: t.textField,
defaultComponentSchema: t.defaultComponentSchema,
onSelectionChange: y,
useFormCommand: r,
useFormSchema: o,
allowCollapse: t.allowCollapse,
visibleCondition: t.visibleCondition,
enableClear: t.enableClear,
onClear: d
}, null)])]
});
}
});
function mt(t) {
const { formSchemaUtils: e, formStateMachineUtils: n } = t;
function r(a, u = "") {
return {
path: u + a.code,
field: a.id,
fullPath: a.code
};
}
function o(a, u = "") {
const m = e.getViewModelById(a);
return m ? m.states.map((l) => r(l, u)) : [];
}
function s(a) {
const u = e.getRootViewModelId(), m = o(a);
if (a === u)
return m;
const l = o(u, "root-component.");
return [...m, ...l];
}
function i(a) {
return a.binding && a.binding.path || a.id || "";
}
function v() {
return n && n.getRenderStates() || [];
}
return { getVariables: s, getControlName: i, getStateMachines: v };
}
class pt {
constructor(e) {
P(this, "sessionVariables", [
{
key: "CurrentSysOrgName",
name: "当前组织Name",
description: "当前组织Name"
},
// {
// key: "CurrentSysOrgCode",
// name: "当前组织Code",
// description: "当前组织Code"
// },
{
key: "CurrentSysOrgId",
name: "当前组织Id",
description: "当前组织Id"
},
{
key: "CurrentUserName",
name: "当前用户Name",
description: "当前用户Name"
},
{
key: "CurrentUserCode",
name: "当前用户Code",
description: "当前用户Code"
},
{
key: "CurrentUserId",
name: "当前用户Id",
description: "当前用户Id"
},
{
key: "CurrentLanguage",
name: "当前语言编号",
description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
}
]);
P(this, "expressionNames", {
compute: "计算表达式",
dependency: "依赖表达式",
validate: "验证表达式",
dataPicking: "帮助前表达式",
visible: "可见表达式",
readonly: "只读表达式",
required: "必填表达式"
});
P(this, "getExpressionConverter", (e, n) => ({
convertFrom: (r, o, s, i) => {
const v = s.getExpressionRuleValue(e, n || o);
return v && v.value || "";
},
convertTo: (r, o, s, i, v) => {
var a;
if (o === "dataPicking" && (s != null && s.target)) {
const u = `${s.target}_dataPicking`;
((a = s.rules) == null ? void 0 : a.some(
(l) => l.id === u && l.value
)) ? r.dictPickingExpressionId = u : delete r.dictPickingExpressionId;
}
i.updateExpression(s);
}
}));
this.formSchemaService = e;
}
getExpressionRule(e, n) {
const r = this.getExpressionData();
if (!r)
return "";
const o = r.find((i) => i.target === e);
if (!o)
return "";
const s = o.rules.find((i) => i.type === n);
return s || "";
}
// 获取上下文表单变量
getContextFormVariables() {
const { module: e } = this.formSchemaService.getFormSchema();
if (!e.viewmodels || e.viewmodels.length === 0)
return [];
const n = this.formSchemaService.getRootViewModelId(), r = this.formSchemaService.getViewModelById(n);
if (!r || !r.states || r.states.length === 0)
return [];
const o = [];
return r.states.filter((s) => s.category === "remote").forEach((s) => {
o.push({
key: s.code,
name: s.name,
description: s.name,
category: s.category
});
}), o;
}
createTreeNode(e, n, r = "label") {
return {
id: e.id,
name: e.name,
bindingPath: e[r],
parents: n,
type: "field"
};
}
buildEntityFieldsTreeData(e = null, n) {
const r = [];
return e == null || e.forEach((o) => {
var v;
const s = this.createTreeNode(o, n);
let i = [];
(v = o.type) != null && v.fields && (i = this.buildEntityFieldsTreeData(o.type.fields, [...n, o.label])), r.push({
data: s,
children: i,
expanded: !0
});
}), r;
}
buildChildEntityTreeData(e = null, n) {
const r = [];
return e == null || e.forEach((o) => {
var a, u;
const s = this.createTreeNode(o, n);
s.type = "entity";
const i = this.buildEntityFieldsTreeData((a = o.type) == null ? void 0 : a.fields, [...n, o.label]), v = this.buildChildEntityTreeData((u = o.type) == null ? void 0 : u.entities, [...n, o.label]);
v != null && v.length && (i == null || i.push(...v)), r.push({
data: s,
children: i || [],
// 空值回退
expanded: !0
});
}), r;
}
getEntitiesTreeData() {
const e = this.formSchemaService.getSchemaEntities();
if (!(e != null && e.length))
return [];
const n = e[0];
if (!(n != null && n.type))
return [];
const r = this.buildEntityFieldsTreeData(n.type.fields, [n.code]), o = this.buildChildEntityTreeData(n.type.entities, [n.code]);
return o != null && o.length && (r == null || r.push(...o)), {
entityCode: n.code,
fields: [{
data: this.createTreeNode(n, [], "code"),
children: r || []
}]
};
}
getEntitiesAndVariables() {
return {
entities: this.getEntitiesTreeData(),
variables: {
session: {
name: "系统变量",
items: this.sessionVariables,
visible: !1
},
forms: {
name: "表单变量",
items: this.getContextFormVariables(),
visible: !0
}
}
};
}
onBeforeOpenExpression(e, n, r) {
const o = r === "Field" ? e.binding.field : e.id, s = this.getExpressionRule(o, n), i = this.getEntitiesAndVariables(), v = {
message: ["validate", "required", "dataPicking"].includes(n) && s ? s.message : "",
...i
};
return s.messageType != null && (v.messageType = s.messageType), v;
}
buildRule(e, n, r, o) {
const { expression: s, message: i, messageType: v } = n, a = {
id: `${e}_${r}`,
type: r,
value: s
};
return (r === "validate" || r === "dataPicking" || r === "required") && (a.message = i), r === "dataPicking" && (a.messageType = v), r === "validate" && o && (a.elementId = o), a;
}
getExpressionData() {
const { expressions: e } = this.formSchemaService.getFormSchema().module;
return e || [];
}
updateExpression(e, n, r, o) {
const s = n === "Field" ? e.binding.field : e.id, i = this.buildRule(s, r, o, e.type === "form-group" ? e.id : "");
let a = this.getExpressionData().find((m) => m.targetType === n && m.target === s);
const u = (m) => m.value.trim() === "";
if (a) {
const m = a.rules.find((l) => l.id === i.id);
if (m)
u(i) ? a.rules = a.rules.filter((l) => l.id !== i.id) : (Object.assign(m, i), o === "validate" && e.type === "form-group" && (m.elementId = e.id));
else {
if (u(i))
return null;
a.rules = a.rules || [], a.rules.push(i);
}
} else {
if (u(i))
return null;
a = {
target: `${s}`,
rules: [i],
targetType: n
};
}
return a;
}
getExpressionEditorOptions(e, n, r, o) {
return r.reduce((s, i) => {
var a, u;
const v = n === "Field" ? (a = e == null ? void 0 : e.binding) == null ? void 0 : a.field : e.id;
return s[i] = {
hide: n === "Field" ? !!((u = e == null ? void 0 : e.binding) != null && u.field) : !1,
description: "",
title: this.expressionNames[i],
type: "string",
$converter: this.getExpressionConverter(v),
refreshPanelAfterChanged: !0,
editor: {
type: "expression-editor",
singleExpand: !1,
dialogTitle: `${this.expressionNames[i]}编辑器`,
showMessage: i === "validate" || i === "dataPicking" || i === "required",
showMessageType: i === "dataPicking",
beforeOpen: () => this.onBeforeOpenExpression(e, i, n),
onSubmitModal: (m) => {
const l = this.updateExpression(e, n, m, i);
if (o) {
const p = this.buildRule(v, m, i);
o(p);
}
return l;
}
}
}, s;
}, {});
}
getExpressionInfo(e, n, r) {
const o = n === "Field" ? e.binding.field : e.id, s = this.getExpressionRule(o, r), i = {
value: s && s.value,
targetId: o,
targetType: n,
expressionType: r
};
return s && s.message && (i.message = s.message), i;
}
getExpressionConfig(e, n, r = ["compute", "dependency", "validate"], o) {
var s;
return {
description: "表达式",
title: "表达式",
hide: !(e.binding && ((s = e.binding) == null ? void 0 : s.type) === "Form"),
properties: {
...this.getExpressionEditorOptions(e, n, r, o)
}
};
}
getExpressionOptions(e, n, r) {
const o = this.getExpressionInfo(e, n, r);
return {
dialogTitle: `${this.expressionNames[r] || "表达式"}编辑器`,
singleExpand: !1,
showMessage: r === "required",
beforeOpen: () => this.onBeforeOpenExpression(e, r, n),
expressionInfo: o
};
}
}
class vt {
constructor(e, n) {
P(this, "componentId");
P(this, "viewModelId");
P(this, "eventsEditorUtils");
P(this, "formSchemaUtils");
P(this, "formMetadataConverter");
P(this, "designViewModelUtils");
P(this, "designViewModelField");
P(this, "controlCreatorUtils");
P(this, "designerHostService");
P(this, "designerContext");
P(this, "modalService", null);
/** 表单规则 */
P(this, "formRule", null);
P(this, "schemaService", null);
P(this, "metadataService", null);
P(this, "propertyConfig", {
type: "object",
categories: {}
});
P(this, "expressionProperty");
var r;
this.componentId = e, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((r = this.formSchemaUtils) == null ? void 0 : r.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService, this.designerContext = n.designerContext, this.modalService = n.modalService, this.expressionProperty = new pt(this.formSchemaUtils);
}
/**
* 是否在响应式表单中
*/
inResponsiveForm() {
var e;
return !!((e = this.designerContext) != null && e.responsiveForm);
}
getFormDesignerInstance() {
var e, n;
return (n = (e = this.designerContext) == null ? void 0 : e.instances) == null ? void 0 : n.formDesigner.value;
}
getTableInfo() {
var e;
return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
}
setDesignViewModelField(e) {
var r;
const n = e.binding && e.binding.type === "Form" && e.binding.field;
if (n) {
if (!this.designViewModelField) {
const o = this.designViewModelUtils.getDgViewModel(this.viewModelId);
this.designViewModelField = o.fields.find((s) => s.id === n);
}
e.updateOn = (r = this.designViewModelField) == null ? void 0 : r.updateOn;
}
}
getBasicPropConfig(e) {
return {
description: "Basic Information",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "combo-list",
textField: "name",
valueField: "value",
idField: "value",
editable: !1,
data: [{ value: e.type, name: J[e.type] && J[e.type].name }]
}
}
}
};
}
getAppearanceConfig(e = null, n = {}, r) {
const o = {
title: "外观",
description: "Appearance"
}, s = {
class: {
title: "class样式",
type: "string",
description: "组件的CSS样式",
$converter: "/converter/appearance.converter",
parentPropertyID: "appearance"
},
style: {
title: "style样式",
type: "string",
description: "组件的样式",
$converter: "/converter/appearance.converter",
parentPropertyID: "appearance"
}
};
for (const i in n)
s[i] = Object.assign(s[i] || {}, n[i]);
return {
...o,
properties: { ...s },
setPropertyRelates(i, v) {
if (i) {
switch (i && i.propertyID) {
case "class":
case "style": {
Ee.value++;
break;
}
}
r && r(i, e, v);
}
}
};
}
/**
*
* @param propertyData
* @param propertyTypes
* @param propertyName
* @param constInfos
* @param variableInfos
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
* @returns
*/
getPropertyEditorParams(e, n = [], r = "visible", o = {}, s = {}, i = "") {
const { getVariables: v, getControlName: a, getStateMachines: u } = mt(this.designerHostService), m = this.getRealTargetType(e), l = n && n.length > 0 ? n : ["Const", "Variable", "StateMachine", "Expression"], p = {
type: "property-editor",
propertyTypes: l
};
return l.map((y) => {
switch (y) {
case "Const":
Object.assign(p, {
constType: "enum",
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
}, o);
break;
case "Expression":
p.expressionConfig = this.getExpressionOptions(e, m, i || r);
break;
case "StateMachine":
p.stateMachines = u();
break;
case "Variable":
Object.assign(p, {
controlName: a(e),
newVariablePrefix: "is",
newVariableType: "Boolean",
variables: v(this.viewModelId),
parentComponentId: this.componentId === "root-component" ? "" : "root-component",
onBeforeOpenVariables: (d) => {
d.value = v(this.viewModelId);
}
}, s), this.designerContext.designerMode === "PC_RTC" && (p.newVariablePrefix = "ext_" + p.newVariablePrefix);
break;
}
}), p;
}
getVisibleProperty(e, n = "") {
var s;
let r = ["Const", "Variable", "StateMachine", "Expression"];
return n === "gridFieldEditor" ? r = ["Const", "Expression"] : n === "form-group" && !((s = e.binding) != null && s.field) ? r = ["Const", "Variable", "StateMachine", "Custom"] : n === "dataGrid" || n === "treeGrid" || n === "wizard" ? r = ["Const", "Variable", "Expression"] : (e.type.indexOf("toolbar-item") > -1 || n === "form-group") && (r = ["Const", "Variable", "StateMachine", "Custom", "Expression"]), {
visible: {
title: "是否可见",
type: "boolean",
description: "运行时组件是否可见",
editor: this.getPropertyEditorParams(e, r, "visible")
}
};
}
/**
* 获取行为
* @param propertyData
* @param viewModelId
* @returns
*/
getBehaviorConfig(e, n = "", r = {}, o) {
const s = {
title: "行为",
description: ""
}, i = this.getVisibleProperty(e, n);
for (const a in r)
i[a] = Object.assign(i[a] || {}, r[a]);
const v = this;
return {
...s,
properties: { ...i },
setPropertyRelates(a, u) {
if (a) {
switch (a.propertyID) {
case "disabled":
case "readonly":
case "visible":
v.afterMutilEditorChanged(e, a);
break;
}
o && o(a, u);
}
}
};
}
/**
* 当多值编辑器变更时
* @param propertyData
* @param changeObject
*/
afterMutilEditorChanged(e, n) {
this.addNewVariableToViewModel(n, this.viewModelId), this.updateExpressionValue(n, e), this.clearExpression(n, e);
}
/**
*
* @param propertyId
* @param co