super-page-runtime 2.3.0 → 2.3.2
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/es/components/runtime/utils/api/page-expose-util.js +25 -25
- package/dist/es/components/runtime/utils/page-helper-util.d.ts +4 -1
- package/dist/es/components/runtime/utils/page-helper-util.js +152 -152
- package/dist/es/components/runtime/utils/page-init-util.js +5 -2
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +185 -158
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +130 -114
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +31 -10
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +15 -15
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +41 -25
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +21 -21
- package/package.json +2 -2
|
@@ -5,21 +5,21 @@ import l from "agilebuilder-ui/src/utils/request";
|
|
|
5
5
|
import { getFormData as c, getAdditionalParamMap as u, refreshPage as f } from "../events/standard-event.js";
|
|
6
6
|
import { dynamicControlTableEdit as m, disabledAllFields as p, updateFormItemEditState as d } from "../events/validator-util.js";
|
|
7
7
|
import { deepCopy as g, getBaseUrl as y } from "../common-util.js";
|
|
8
|
-
import {
|
|
9
|
-
import { getFormModelFields as
|
|
10
|
-
import { getCustomFunc as
|
|
11
|
-
const
|
|
12
|
-
n2 ?
|
|
8
|
+
import { replacePrefix as b, isMobileBrowser as h } from "agilebuilder-ui/src/utils/common-util";
|
|
9
|
+
import { getFormModelFields as E, getModelFields as P } from "../page-init-util.js";
|
|
10
|
+
import { getCustomFunc as C } from "../events/event-util.js";
|
|
11
|
+
const k = { showElement: function(e2, t2, n2) {
|
|
12
|
+
n2 ? j(e2, "showElement", t2) : t2.forEach((t3) => {
|
|
13
13
|
const n3 = r(e2, t3);
|
|
14
14
|
n3 && n3.show();
|
|
15
15
|
});
|
|
16
16
|
}, hideElement: function(e2, t2, n2) {
|
|
17
|
-
n2 ?
|
|
17
|
+
n2 ? j(e2, "hideElement", t2) : t2.forEach((t3) => {
|
|
18
18
|
const n3 = r(e2, t3);
|
|
19
19
|
n3 && n3.hide();
|
|
20
20
|
});
|
|
21
21
|
}, enableElement: function(e2, t2, n2) {
|
|
22
|
-
n2 ?
|
|
22
|
+
n2 ? j(e2, "enableElement", t2) : t2.forEach((t3) => {
|
|
23
23
|
const n3 = r(e2, t3);
|
|
24
24
|
if (n3) {
|
|
25
25
|
const e3 = n3.getConfigure();
|
|
@@ -27,7 +27,7 @@ const C = { showElement: function(e2, t2, n2) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}, disableElement: function(e2, t2, n2) {
|
|
30
|
-
n2 ?
|
|
30
|
+
n2 ? j(e2, "disableElement", t2) : t2.forEach((t3) => {
|
|
31
31
|
const n3 = r(e2, t3);
|
|
32
32
|
if (n3) {
|
|
33
33
|
const e3 = n3.getConfigure();
|
|
@@ -47,7 +47,7 @@ const C = { showElement: function(e2, t2, n2) {
|
|
|
47
47
|
o(e2.entity, i2.startsWith("${") ? i2 : "${" + t2 + "." + i2 + "}", n2[i2]);
|
|
48
48
|
});
|
|
49
49
|
}, dynamicControlFormEdit: function(e2, t2, n2) {
|
|
50
|
-
n2 ?
|
|
50
|
+
n2 ? j(e2, "dynamicControlFormEdit", t2) : d(e2, t2);
|
|
51
51
|
}, disabledAllFields(e2) {
|
|
52
52
|
p(e2);
|
|
53
53
|
}, dynamicControlTableEdit(e2, t2, n2) {
|
|
@@ -80,7 +80,7 @@ const C = { showElement: function(e2, t2, n2) {
|
|
|
80
80
|
}, getServerConfigValue: (e2) => window.$vueApp.config.globalProperties[e2], getBackendUrl: (e2) => y(e2.backendUrl, false), getPlateBackendUrl: () => window.$vueApp.config.globalProperties.baseAPI, getEntity: (e2) => e2.entity.data, getEntityValue: (e2, t2) => e2.entity.data ? e2.entity.data[t2] : null, getPageData: (e2) => e2.entity.page, getPageDataValue: (e2, t2) => e2.entity.page ? e2.entity.page[t2] : null, getAdditionalParams: (e2) => u(e2), getAdditionalParamValue(e2, t2) {
|
|
81
81
|
const n2 = u(e2);
|
|
82
82
|
return n2 ? n2[t2] : null;
|
|
83
|
-
}, isMobile: () =>
|
|
83
|
+
}, isMobile: () => h(), getComponentRefByProp: (e2, t2) => r(e2, t2), getComponentRefByCode: (e2, t2) => a(e2, t2), getFormViewData(o2) {
|
|
84
84
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
85
85
|
const r2 = o2.entity ? o2.entity : {}, s2 = g(r2), l2 = e(o2);
|
|
86
86
|
for (const e2 in l2) {
|
|
@@ -88,13 +88,13 @@ const C = { showElement: function(e2, t2, n2) {
|
|
|
88
88
|
if (l3) {
|
|
89
89
|
const e3 = l3.getConfigure();
|
|
90
90
|
if (e3 && ((_b = (_a = e3.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && ("static" === ((_d = (_c = e3.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) || "optionGroup" === ((_f = (_e = e3.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType))) if (e3.name && ("select" === e3.name && ((_h = (_g = e3.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || "checkbox" === e3.name)) {
|
|
91
|
-
const t2 =
|
|
91
|
+
const t2 = E(o2, e3), a2 = n(s2, t2);
|
|
92
92
|
if (a2) {
|
|
93
|
-
const e4 =
|
|
93
|
+
const e4 = V(a2.split(","), r3);
|
|
94
94
|
i(s2, t2, e4);
|
|
95
95
|
}
|
|
96
96
|
} else {
|
|
97
|
-
const t2 =
|
|
97
|
+
const t2 = E(o2, e3), a2 = V(n(s2, t2), r3);
|
|
98
98
|
i(s2, t2, a2);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -105,34 +105,34 @@ const C = { showElement: function(e2, t2, n2) {
|
|
|
105
105
|
if (e2.indexOf("__") > 0 && (t2 = e2.substring(e2.lastIndexOf("__") + 2)), t2) {
|
|
106
106
|
const i2 = a(o2, t2);
|
|
107
107
|
if (i2) {
|
|
108
|
-
const t3 = i2.getConfigure(), o3 = t3.code ? t3.code : e2, a2 =
|
|
109
|
-
|
|
108
|
+
const t3 = i2.getConfigure(), o3 = t3.code ? t3.code : e2, a2 = P(t3, o3), r3 = n(s2, a2);
|
|
109
|
+
v(i2.getTableSelectOptions(e2), r3);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
return s2.data;
|
|
114
|
-
}, getFormData: (e2, t2) => c(e2, t2), getCustomFunc: (e2, t2) =>
|
|
115
|
-
function
|
|
114
|
+
}, getFormData: (e2, t2) => c(e2, t2), getCustomFunc: (e2, t2) => C(e2, t2), replaceUrlPrefix: (e2) => b(e2) };
|
|
115
|
+
function v(e2, t2) {
|
|
116
116
|
e2 && t2 && t2.forEach((t3) => {
|
|
117
117
|
Object.keys(e2).forEach((n2) => {
|
|
118
118
|
const i2 = t3[n2], o2 = e2[n2], a2 = o2.options, r2 = o2.column;
|
|
119
119
|
let s2;
|
|
120
120
|
if (r2 && r2.componentType && ("multiselect" === r2.componentType || "checkbox" === r2.componentType)) {
|
|
121
121
|
if (i2) {
|
|
122
|
-
s2 =
|
|
122
|
+
s2 = V(i2.split(","), a2);
|
|
123
123
|
}
|
|
124
|
-
} else s2 =
|
|
124
|
+
} else s2 = V(i2, a2);
|
|
125
125
|
t3[n2] = s2;
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function V(e2, t2) {
|
|
130
130
|
let n2;
|
|
131
131
|
return null != e2 && t2 && (Array.isArray(e2) ? (n2 = "", e2.forEach((i2) => {
|
|
132
|
-
n2 = n2 +
|
|
133
|
-
}), n2.indexOf(",") > 0 && (n2 = n2.substring(0, n2.lastIndexOf(",")))) : (n2 = e2, n2 =
|
|
132
|
+
n2 = n2 + $(e2, t2) + ",";
|
|
133
|
+
}), n2.indexOf(",") > 0 && (n2 = n2.substring(0, n2.lastIndexOf(",")))) : (n2 = e2, n2 = $(e2, t2))), n2;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function $(e2, t2) {
|
|
136
136
|
let n2 = e2;
|
|
137
137
|
if (null != e2 && t2) for (let i2 = 0; i2 < t2.length; i2++) {
|
|
138
138
|
const o2 = t2[i2].value, a2 = t2[i2].label ? t2[i2].label : t2[i2].name;
|
|
@@ -143,9 +143,9 @@ function V(e2, t2) {
|
|
|
143
143
|
}
|
|
144
144
|
return n2;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function j(e2, t2, n2) {
|
|
147
147
|
e2.initInfo || (e2.initInfo = {}), e2.initInfo[t2] = n2;
|
|
148
148
|
}
|
|
149
149
|
export {
|
|
150
|
-
|
|
150
|
+
k as functions
|
|
151
151
|
};
|
|
@@ -80,8 +80,11 @@ export declare function queryOptions(component: Component, pageContext: PageCont
|
|
|
80
80
|
* 根据查询条件远程查询
|
|
81
81
|
* @param component
|
|
82
82
|
* @param query 模糊查询内容
|
|
83
|
+
* @param skipProps 自动赋值映射字段跳过字段,因为当前组件set方法内已经被赋值了,
|
|
84
|
+
* 如果是筛选,之前选择的值可能不在筛选后的结果内,这里再给当前组件变量赋值一遍就会导致之前选择的值被覆盖消失
|
|
85
|
+
*
|
|
83
86
|
*/
|
|
84
|
-
export declare function autoSetAfterSelect(component: Component, pageContext: PageContext, autoSets: any[], selItems: any[]): void;
|
|
87
|
+
export declare function autoSetAfterSelect(component: Component, pageContext: PageContext, autoSets: any[], selItems: any[], skipProps?: string[]): void;
|
|
85
88
|
/**
|
|
86
89
|
*
|
|
87
90
|
* @param entity
|
|
@@ -4,94 +4,94 @@ import { executeExpression } from "agilebuilder-ui/src/utils/calculator/calculat
|
|
|
4
4
|
import { getComponentRef } from "./global-refs.js";
|
|
5
5
|
import { watch } from "vue";
|
|
6
6
|
import { deepCopy, getBaseUrl } from "./common-util.js";
|
|
7
|
-
function getComponentOptionConfigs(t, e,
|
|
8
|
-
return getComponentOptionConfigsBase(t, (e == null ? void 0 : e.systemCode) ? e.systemCode :
|
|
7
|
+
function getComponentOptionConfigs(t, e, n, o) {
|
|
8
|
+
return getComponentOptionConfigsBase(t, (e == null ? void 0 : e.systemCode) ? e.systemCode : n, (e == null ? void 0 : e.systemVersion) ? e == null ? void 0 : e.systemVersion : o);
|
|
9
9
|
}
|
|
10
|
-
function getComponentOptionConfigsBase(t, e,
|
|
10
|
+
function getComponentOptionConfigsBase(t, e, n) {
|
|
11
11
|
if (!t.props || !t.props.dataOrigin) return;
|
|
12
12
|
if (t.name && "table" === t.name) return;
|
|
13
|
-
const
|
|
14
|
-
if ("optionGroup" ==
|
|
15
|
-
else if ("dynamicData" ==
|
|
16
|
-
else if ("dataTable" ==
|
|
17
|
-
a.filterType =
|
|
18
|
-
const t2 = getTableQueryInfo(
|
|
13
|
+
const o = t.props.dataOrigin, a = { uuid: t.uuid };
|
|
14
|
+
if ("optionGroup" == o.optionValueSetType) a.type = "optionGroup", a.props = { code: o.optionGroup };
|
|
15
|
+
else if ("dynamicData" == o.optionValueSetType) a.type = "dynamicData", a.filterType = o.filterType, a.props = { code: o.dynamicDataSourceCode };
|
|
16
|
+
else if ("dataTable" == o.optionValueSetType) {
|
|
17
|
+
a.filterType = o.filterType;
|
|
18
|
+
const t2 = getTableQueryInfo(o, e, n);
|
|
19
19
|
Object.assign(a, t2);
|
|
20
|
-
} else if ("service" ==
|
|
21
|
-
a.filterType =
|
|
22
|
-
const t2 = getServiceQueryInfo(
|
|
20
|
+
} else if ("service" == o.optionValueSetType) {
|
|
21
|
+
a.filterType = o.filterType;
|
|
22
|
+
const t2 = getServiceQueryInfo(o, e, n);
|
|
23
23
|
Object.assign(a, t2);
|
|
24
24
|
}
|
|
25
25
|
return a.type ? a : void 0;
|
|
26
26
|
}
|
|
27
|
-
function getTableQueryInfo(t, e,
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
27
|
+
function getTableQueryInfo(t, e, n) {
|
|
28
|
+
const o = { type: "dataTable" };
|
|
29
|
+
if (o.valueLabelSwitch = !!t.valueLabelSwitch, o.props = { tableName: t.tableName, systemCode: t.tableSysCode ? t.tableSysCode : e, systemVersion: t.tableSysVersion ? t.tableSysVersion : n }, t.sortFields) {
|
|
30
30
|
const e2 = [];
|
|
31
|
-
for (const
|
|
32
|
-
|
|
31
|
+
for (const n2 of t.sortFields) n2.name && e2.push({ prop: n2.name, order: n2.type ? n2.type : "asc" });
|
|
32
|
+
o.props.sorts = e2;
|
|
33
33
|
}
|
|
34
34
|
const a = [];
|
|
35
35
|
if (t.filterList) {
|
|
36
36
|
const e2 = [];
|
|
37
|
-
for (const
|
|
38
|
-
if (!
|
|
39
|
-
|
|
37
|
+
for (const n2 of t.filterList) {
|
|
38
|
+
if (!n2.propName) continue;
|
|
39
|
+
n2.propDbName || (n2.propDbName = n2.propName);
|
|
40
40
|
const t2 = {};
|
|
41
|
-
Object.assign(t2,
|
|
42
|
-
const
|
|
43
|
-
for (const t3 of
|
|
44
|
-
|
|
41
|
+
Object.assign(t2, n2);
|
|
42
|
+
const o2 = getParamNames(n2.propValue);
|
|
43
|
+
for (const t3 of o2) t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (a.includes(t3) || a.push(t3));
|
|
44
|
+
n2.propValue, e2.push(t2);
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
o.props.searchForm = e2;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
o.props.monitorFields = a;
|
|
49
49
|
const r = [];
|
|
50
|
-
if (t.tableValueField && (
|
|
51
|
-
return
|
|
50
|
+
if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 == r.indexOf(t.tableLableField) && (o.props.lableField = t.tableLableField), t.autoSets) for (const e2 of t.autoSets) e2.source && -1 == r.indexOf(e2.source) && r.push(e2.source);
|
|
51
|
+
return o.props.queryFields = r, o.props.pageSize = t.displayQuantity, o;
|
|
52
52
|
}
|
|
53
|
-
function getServiceQueryInfo(t, e,
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
53
|
+
function getServiceQueryInfo(t, e, n) {
|
|
54
|
+
const o = { type: "service" };
|
|
55
|
+
if (o.valueLabelSwitch = !!t.valueLabelSwitch, o.props = { serivceCode: t.serviceCode, systemCode: t.tableSysCode ? t.tableSysCode : e, systemVersion: t.tableSysVersion ? t.tableSysVersion : n }, t.serviceInputs) {
|
|
56
56
|
const e2 = [];
|
|
57
|
-
for (const
|
|
58
|
-
if (!
|
|
57
|
+
for (const n2 of t.serviceInputs) {
|
|
58
|
+
if (!n2.name || n2.value) continue;
|
|
59
59
|
const t2 = {};
|
|
60
|
-
Object.assign(t2,
|
|
60
|
+
Object.assign(t2, n2), e2.push(t2);
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
o.props.inputs = e2;
|
|
63
63
|
}
|
|
64
|
-
return
|
|
64
|
+
return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
|
|
65
65
|
}
|
|
66
|
-
function updateChartDatasources(t, e,
|
|
66
|
+
function updateChartDatasources(t, e, n, o) {
|
|
67
67
|
return new Promise((a, r) => {
|
|
68
68
|
if (!e || 0 == e.length) return void r(new Error("无需查询的统计图配置!"));
|
|
69
69
|
const s = deepCopy(e);
|
|
70
70
|
s.forEach((e2) => {
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const e3 =
|
|
74
|
-
e3 && (
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
}), delete
|
|
71
|
+
const n2 = e2.services;
|
|
72
|
+
if (n2 && n2.length > 0) {
|
|
73
|
+
const e3 = n2[0].serviceInputs;
|
|
74
|
+
e3 && (n2[0].serviceInParams = {}, e3.forEach((e4) => {
|
|
75
|
+
const o2 = e4.name, a2 = e4.value;
|
|
76
|
+
n2[0].serviceInParams[o2] = getValueFromVariable(t.entity, a2);
|
|
77
|
+
}), delete n2[0].serviceInputs);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
const i = t.entity ? t.entity : {}, u = {};
|
|
81
|
-
i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page),
|
|
81
|
+
i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page), n && Object.assign(u, n);
|
|
82
82
|
const l = {};
|
|
83
83
|
i.task && Object.assign(l, i.task);
|
|
84
84
|
const c = { entityMap: i.data, additionalParamMap: u, taskMap: l, dataSourceList: s, systemCode: t.systemCode, pageCode: t.code }, p = t.backendUrl, f = getBaseUrl(p, t.isTest) + "/common/common-data/find-chart-datas";
|
|
85
85
|
http.post(f, c, { headers: { customSystem: t.systemCode } }).then((e2) => {
|
|
86
86
|
var _a, _b;
|
|
87
87
|
t.chartDataSourceMap || (t.chartDataSourceMap = {});
|
|
88
|
-
for (const
|
|
89
|
-
t.chartDataSourceMap[
|
|
90
|
-
const a2 = getComponentRef(t,
|
|
88
|
+
for (const n2 in e2) {
|
|
89
|
+
t.chartDataSourceMap[n2] = e2[n2];
|
|
90
|
+
const a2 = getComponentRef(t, n2);
|
|
91
91
|
if (a2) {
|
|
92
92
|
const r2 = a2.getConfigure();
|
|
93
|
-
if ((!
|
|
94
|
-
const
|
|
93
|
+
if ((!o || r2 && (void 0 === r2.initializationQuery || r2.initializationQuery)) && a2.updateChartDatas && (a2.updateChartDatas(e2[n2]), (_b = (_a = r2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
|
|
94
|
+
const o2 = e2[n2] && e2[n2].length > 0 ? e2[n2][0] : {}, a3 = o2 && o2.result ? o2.result : {};
|
|
95
95
|
let s2 = null;
|
|
96
96
|
r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(t.entity, r2.runtime.dataConfig.resultSet, s2);
|
|
97
97
|
}
|
|
@@ -104,23 +104,23 @@ function updateChartDatasources(t, e, o, n) {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function updateChartDatasourcesByComponent(t, e) {
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const n = t.initChartServiceConfigs.find((t2) => t2.uuid === e);
|
|
108
|
+
n && updateChartDatasources(t, [n], null, false);
|
|
109
109
|
}
|
|
110
|
-
function updateOptionDatasources(t, e,
|
|
111
|
-
return new Promise((
|
|
110
|
+
function updateOptionDatasources(t, e, n) {
|
|
111
|
+
return new Promise((o, a) => {
|
|
112
112
|
if (!e || 0 == e.length) return void a(new Error("无需查询的配置!"));
|
|
113
113
|
const r = t.entity ? t.entity : {}, s = {};
|
|
114
|
-
r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query =
|
|
115
|
-
const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query:
|
|
114
|
+
r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query = n;
|
|
115
|
+
const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query: n }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
|
|
116
116
|
http.post(l, i).then((e2) => {
|
|
117
117
|
t.optionSourceMap || (t.optionSourceMap = {});
|
|
118
|
-
for (const
|
|
119
|
-
t.optionSourceMap[
|
|
120
|
-
const
|
|
121
|
-
|
|
118
|
+
for (const n2 in e2) {
|
|
119
|
+
t.optionSourceMap[n2] = e2[n2];
|
|
120
|
+
const o2 = getComponentRef(t, n2);
|
|
121
|
+
o2 && o2.updateOptions && o2.updateOptions(e2[n2]);
|
|
122
122
|
}
|
|
123
|
-
|
|
123
|
+
o(e2);
|
|
124
124
|
}).catch((t2) => {
|
|
125
125
|
a(t2);
|
|
126
126
|
});
|
|
@@ -130,8 +130,8 @@ function getOptionDatasFromPage(t, e) {
|
|
|
130
130
|
return getComponentOptionDatasFromPage(t, e.uuid);
|
|
131
131
|
}
|
|
132
132
|
function getComponentOptionDatasFromPage(t, e) {
|
|
133
|
-
const
|
|
134
|
-
return
|
|
133
|
+
const n = getOptionDatasSourceMap(t)[e];
|
|
134
|
+
return n || [];
|
|
135
135
|
}
|
|
136
136
|
function getOptionDatasSourceMap(t) {
|
|
137
137
|
if (!t || !t.optionSourceMap) return {};
|
|
@@ -142,63 +142,63 @@ function getChartDatasFromPage(t, e) {
|
|
|
142
142
|
if (!t || !t.chartDataSourceMap || !e) return null;
|
|
143
143
|
return t.chartDataSourceMap[e.uuid];
|
|
144
144
|
}
|
|
145
|
-
function queryOptionDatasources(t, e,
|
|
146
|
-
return updateOptionDatasources(t, e ? [e] : [],
|
|
147
|
-
}
|
|
148
|
-
function autoSetAfterSelect(t, e, o,
|
|
149
|
-
if (!
|
|
150
|
-
const
|
|
151
|
-
for (const t2 of
|
|
152
|
-
if (!t2.source || !t2.target) continue;
|
|
153
|
-
const e2 = getValuesByField(
|
|
154
|
-
let
|
|
155
|
-
if (!
|
|
156
|
-
|
|
157
|
-
setVariableValue(
|
|
145
|
+
function queryOptionDatasources(t, e, n) {
|
|
146
|
+
return updateOptionDatasources(t, e ? [e] : [], n);
|
|
147
|
+
}
|
|
148
|
+
function autoSetAfterSelect(t, e, n, o, a = []) {
|
|
149
|
+
if (!n || 0 == n.length) return;
|
|
150
|
+
const r = e.entity ? e.entity : {};
|
|
151
|
+
for (const t2 of n) {
|
|
152
|
+
if (!t2.source || !t2.target || a.includes(t2.target)) continue;
|
|
153
|
+
const e2 = getValuesByField(o, t2.source);
|
|
154
|
+
let n2 = t2.target;
|
|
155
|
+
if (!n2 || !n2.startsWith("${")) continue;
|
|
156
|
+
n2 = n2.substring(2, n2.length - 1);
|
|
157
|
+
setVariableValue(r, n2.split("."), e2.join(","));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
function getValuesByField(t, e) {
|
|
161
161
|
if (t) {
|
|
162
|
-
const
|
|
163
|
-
for (const
|
|
164
|
-
let t2 =
|
|
165
|
-
null != t2 && null != t2 || (t2 = ""),
|
|
162
|
+
const n = [];
|
|
163
|
+
for (const o of t) {
|
|
164
|
+
let t2 = o[e];
|
|
165
|
+
null != t2 && null != t2 || (t2 = ""), n.push(t2);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return n;
|
|
168
168
|
}
|
|
169
169
|
return [""];
|
|
170
170
|
}
|
|
171
171
|
function getVariableValue(t, e) {
|
|
172
172
|
if (!t || !e || 0 == e.length) return;
|
|
173
|
-
let
|
|
173
|
+
let n = t;
|
|
174
174
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
175
|
-
if (null ==
|
|
176
|
-
|
|
175
|
+
if (null == n) return n;
|
|
176
|
+
n = n[e[t2]];
|
|
177
177
|
}
|
|
178
|
-
return
|
|
178
|
+
return n;
|
|
179
179
|
}
|
|
180
|
-
function setValueForVariableName(t, e,
|
|
180
|
+
function setValueForVariableName(t, e, n) {
|
|
181
181
|
if (!e || !e.startsWith("${")) return;
|
|
182
|
-
setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."),
|
|
182
|
+
setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), n);
|
|
183
183
|
}
|
|
184
|
-
function setVariableValue(t, e,
|
|
184
|
+
function setVariableValue(t, e, n) {
|
|
185
185
|
if (!t || !e || 0 == e.length) return;
|
|
186
|
-
let
|
|
186
|
+
let o = t;
|
|
187
187
|
for (let t2 = 0; t2 < e.length; t2++) {
|
|
188
188
|
const a = e[t2];
|
|
189
|
-
t2 + 1 === e.length ?
|
|
189
|
+
t2 + 1 === e.length ? o[a] = n : (void 0 === o[a] && (o[a] = {}), o = o[a]);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
function setVariableValueWithProp(t, e,
|
|
192
|
+
function setVariableValueWithProp(t, e, n) {
|
|
193
193
|
if (!t || !e) return;
|
|
194
|
-
setVariableValue(t, e.split("."),
|
|
194
|
+
setVariableValue(t, e.split("."), n);
|
|
195
195
|
}
|
|
196
196
|
function formatVariableValue(t, e) {
|
|
197
197
|
if (!t || "" == e || null == e || null == e) return e;
|
|
198
|
-
const
|
|
199
|
-
for (const t2 in
|
|
200
|
-
const a =
|
|
201
|
-
if (r && "[object Date]" === Object.prototype.toString.call(r)) return dayjs(r).format("YYYY-MM-DD
|
|
198
|
+
const n = t.entity ? t.entity : {}, o = getParamNames(e);
|
|
199
|
+
for (const t2 in o) {
|
|
200
|
+
const a = o[t2], r = getValueFromVariable(n, a);
|
|
201
|
+
if (r && "[object Date]" === Object.prototype.toString.call(r)) return dayjs(r).format("YYYY-MM-DD HH:mm:ss");
|
|
202
202
|
if (r && "number" == typeof r) return r;
|
|
203
203
|
e = e.replace(a, null == r ? "" : r);
|
|
204
204
|
}
|
|
@@ -209,60 +209,60 @@ function getParamNames(t) {
|
|
|
209
209
|
const e = t.match(/\$\{[^\{|\}]+\}/g);
|
|
210
210
|
return e || [];
|
|
211
211
|
}
|
|
212
|
-
function formatValueByType(t, e,
|
|
212
|
+
function formatValueByType(t, e, n) {
|
|
213
213
|
if (!e || "" == t || null == t || null == t) return t;
|
|
214
|
-
if (
|
|
214
|
+
if (n = n || {}, "number" == e || "percent" == e) {
|
|
215
215
|
if (isNaN(t)) return t;
|
|
216
|
-
let
|
|
217
|
-
if ((null ==
|
|
216
|
+
let o = parseInt(n.decimalDigit);
|
|
217
|
+
if ((null == o || isNaN(o)) && (o = -1), t = parseFloat(t), "percent" == e && (t *= 100), o > -1 && (t = parseFloat(t.toFixed(o))), "percent" == e) t += "%";
|
|
218
218
|
else {
|
|
219
|
-
if (
|
|
219
|
+
if (n.thousandsSeparator) {
|
|
220
220
|
const e2 = t.toString().split(".");
|
|
221
221
|
e2[0] = e2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t = e2.length > 1 ? e2.join(".") : e2[0];
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
n.symbol && (t = n.symbol + "" + t);
|
|
224
224
|
}
|
|
225
225
|
return t;
|
|
226
226
|
}
|
|
227
227
|
if ("date" == e || "time" == e) {
|
|
228
|
-
let
|
|
229
|
-
return "date" == e ? (
|
|
228
|
+
let o = "";
|
|
229
|
+
return "date" == e ? (o = n.dateFormat, o || (o = "YYYY-MM-DD")) : (o = n.timeFormat, o || (o = "HH:mm:ss")), dayjs(t).format(o);
|
|
230
230
|
}
|
|
231
|
-
return "custom" == e &&
|
|
231
|
+
return "custom" == e && n.formatEventUuid, t;
|
|
232
232
|
}
|
|
233
|
-
function getValueFromVariable(t, e,
|
|
233
|
+
function getValueFromVariable(t, e, n) {
|
|
234
234
|
if (null == e || null == e) return e;
|
|
235
235
|
if (e.startsWith("${") && e.endsWith("}")) {
|
|
236
|
-
let
|
|
237
|
-
if (
|
|
238
|
-
else if (
|
|
239
|
-
else if (
|
|
240
|
-
else if (
|
|
241
|
-
else if (
|
|
242
|
-
else if (
|
|
236
|
+
let o = e.substring(2, e.length - 1), a = null, r = null;
|
|
237
|
+
if (o.startsWith("data.")) o = o.substring(5), r = t.data, a = "data";
|
|
238
|
+
else if (o.startsWith("page.")) o = o.substring(5), a = "page", r = t.page;
|
|
239
|
+
else if (o.startsWith("task.")) o = o.substring(5), a = "task", r = t.task;
|
|
240
|
+
else if (o.startsWith("request.")) o = o.substring(8), a = "request", r = t.request;
|
|
241
|
+
else if (o.startsWith("context.")) o = o.substring(8), a = "context", r = t.context;
|
|
242
|
+
else if (o.startsWith("system.")) o = o.substring(7), a = "system", r = t.system;
|
|
243
243
|
else {
|
|
244
|
-
if (
|
|
245
|
-
|
|
244
|
+
if (o.startsWith("fixed.")) return o.substring(6);
|
|
245
|
+
o.startsWith("row.") && (o = o.substring(4), r = n, a = "row");
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return o ? getValueFromSource(r, o, a) : "";
|
|
248
248
|
}
|
|
249
249
|
return e;
|
|
250
250
|
}
|
|
251
|
-
function getValueFromSource(t, e,
|
|
252
|
-
if ("context" !=
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
const a = e.substring(0,
|
|
251
|
+
function getValueFromSource(t, e, n) {
|
|
252
|
+
if ("context" != n && !t || !e) return;
|
|
253
|
+
const o = e.indexOf(".");
|
|
254
|
+
if (o > -1) {
|
|
255
|
+
const a = e.substring(0, o), r = e.substring(o + 1);
|
|
256
256
|
let s = t[a];
|
|
257
|
-
return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r,
|
|
257
|
+
return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, n);
|
|
258
258
|
}
|
|
259
|
-
if ("context" ==
|
|
259
|
+
if ("context" == n) {
|
|
260
260
|
if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
|
|
261
261
|
if (e.startsWith("currentDate") && e.length > 11) {
|
|
262
|
-
const t2 = e.substring(11),
|
|
263
|
-
let
|
|
262
|
+
const t2 = e.substring(11), n2 = t2.substring(0, 1);
|
|
263
|
+
let o2 = parseInt(t2.substring(1, t2.length - 1), 10);
|
|
264
264
|
const a = t2.substring(t2.length - 1), r = /* @__PURE__ */ new Date();
|
|
265
|
-
return
|
|
265
|
+
return o2 = "+" === n2 ? o2 : -o2, "d" === a || "w" === a ? (o2 = "w" === a ? 7 * o2 : o2, r.setDate(r.getDate() + o2)) : "m" === a ? r.setMonth(r.getMonth() + o2) : "y" === a && r.setFullYear(r.getFullYear() + o2), r;
|
|
266
266
|
}
|
|
267
267
|
if (!t) return;
|
|
268
268
|
}
|
|
@@ -274,17 +274,17 @@ function caculateShowCondition(pageContext, showConditions, row) {
|
|
|
274
274
|
let conditions = "";
|
|
275
275
|
const maxLen = showConditions.length;
|
|
276
276
|
for (let t = 0; t < maxLen; t++) {
|
|
277
|
-
const e = showConditions[t],
|
|
278
|
-
let
|
|
279
|
-
if (!
|
|
280
|
-
|
|
281
|
-
const a = getValueFromVariable(entityData,
|
|
277
|
+
const e = showConditions[t], n = e.propName;
|
|
278
|
+
let o = e.operator;
|
|
279
|
+
if (!n || "" === n) continue;
|
|
280
|
+
o || (o = "EQ");
|
|
281
|
+
const a = getValueFromVariable(entityData, n, row);
|
|
282
282
|
let r = getValueFromVariable(entityData, e.propValue, row);
|
|
283
283
|
const s = e.dataType;
|
|
284
|
-
"CONTAIN" !=
|
|
284
|
+
"CONTAIN" != o && "NOT_CONTAIN" != o || a && !a.includes && (o = "CONTAIN" == o ? "EQ" : "NET");
|
|
285
285
|
let i = e.variableIsNull, u;
|
|
286
|
-
if (i || (i = "null"), "IS_NULL" !==
|
|
287
|
-
u = executeExpression(a,
|
|
286
|
+
if (i || (i = "null"), "IS_NULL" !== o && "IS_NOT_NULL" !== o && (void 0 !== r && "" !== r || (r = null, "null" === i ? o = "IS_NULL" : "notequal" === i ? o = "IS_NOT_NULL" : u = true)), null == u) try {
|
|
287
|
+
u = executeExpression(a, o, r, s);
|
|
288
288
|
} catch (t2) {
|
|
289
289
|
u = false;
|
|
290
290
|
}
|
|
@@ -297,34 +297,34 @@ function caculateShowCondition(pageContext, showConditions, row) {
|
|
|
297
297
|
}
|
|
298
298
|
return !conditions || eval("(" + conditions + ")");
|
|
299
299
|
}
|
|
300
|
-
function monitorFieldChange(t, e,
|
|
301
|
-
if (!
|
|
302
|
-
const
|
|
300
|
+
function monitorFieldChange(t, e, n) {
|
|
301
|
+
if (!n || !t || !e || 0 == e.length) return;
|
|
302
|
+
const o = [], a = [];
|
|
303
303
|
for (let t2 of e) if (t2.startsWith("${")) {
|
|
304
304
|
t2 = t2.substring(2, t2.length - 1);
|
|
305
305
|
const e2 = t2.split(".");
|
|
306
|
-
"page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (
|
|
306
|
+
"page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (o.push(e2), a.includes(e2[0]) || a.push(e2[0]));
|
|
307
307
|
}
|
|
308
|
-
let r = getMonitorFieldValues(
|
|
308
|
+
let r = getMonitorFieldValues(o, t.entity), s = false;
|
|
309
309
|
for (const e2 of a) watch(t.entity[e2], () => {
|
|
310
310
|
s && clearTimeout(s), s = setTimeout(function() {
|
|
311
|
-
const e3 = getMonitorFieldValues(
|
|
312
|
-
r != e3 && (r = e3,
|
|
311
|
+
const e3 = getMonitorFieldValues(o, t.entity);
|
|
312
|
+
r != e3 && (r = e3, n());
|
|
313
313
|
}, 200);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
function getMonitorFieldValues(t, e) {
|
|
317
|
-
let
|
|
318
|
-
for (const
|
|
319
|
-
return
|
|
317
|
+
let n = "";
|
|
318
|
+
for (const o of t) n += "_" + getVariableValue(e, o);
|
|
319
|
+
return n;
|
|
320
320
|
}
|
|
321
321
|
function getFormPropName(t) {
|
|
322
322
|
return t && t.indexOf("${") >= 0 ? t.substring(t.indexOf(".") + 1, t.lastIndexOf("}")) : t;
|
|
323
323
|
}
|
|
324
324
|
function getSizeConfig(t, e) {
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
return e.props && e.props.size && e.props.size[
|
|
325
|
+
const n = getPageModeType(t);
|
|
326
|
+
let o;
|
|
327
|
+
return e.props && e.props.size && e.props.size[n] && (o = e.props.size[n]), !o && e.props && e.props.size && (o = e.props.size.pc), o;
|
|
328
328
|
}
|
|
329
329
|
function getPageModeType(t) {
|
|
330
330
|
let e = t.dimensions;
|
|
@@ -340,12 +340,12 @@ function decomposeVariable(t) {
|
|
|
340
340
|
}
|
|
341
341
|
function getModelFieldFromPageContext(t, e) {
|
|
342
342
|
if (!e.modelFieldsMap) return;
|
|
343
|
-
let
|
|
344
|
-
for (let
|
|
345
|
-
const a = t[
|
|
346
|
-
|
|
343
|
+
let n = null;
|
|
344
|
+
for (let o = 0; o < t.length; o++) {
|
|
345
|
+
const a = t[o];
|
|
346
|
+
o + 1 === t.length && (n = e.modelFieldsMap[a]);
|
|
347
347
|
}
|
|
348
|
-
return
|
|
348
|
+
return n;
|
|
349
349
|
}
|
|
350
350
|
function isNumberDataType(t) {
|
|
351
351
|
return "INTEGER" === t || "LONG" === t || "DOUBLE" === t || "FLOAT_COM" === t;
|
|
@@ -88,8 +88,11 @@ function w(e2, t2, s2) {
|
|
|
88
88
|
t2 && (s3 = t2.props.base ? t2.props.base : {}, l2 = t2.name, a2 = s3.multiple);
|
|
89
89
|
const p2 = n(r2, i2);
|
|
90
90
|
if (null == p2) {
|
|
91
|
-
const t3 =
|
|
92
|
-
|
|
91
|
+
const t3 = s3 ? s3.defaultValue : null;
|
|
92
|
+
if (t3) {
|
|
93
|
+
const s4 = P(e2, t3, l2, a2);
|
|
94
|
+
null != s4 && o(r2, i2, s4);
|
|
95
|
+
}
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
return i2;
|