super-page-runtime 2.3.5 → 2.3.6
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 +60 -52
- package/dist/es/components/runtime/utils/common-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/common-util.js +62 -47
- package/dist/es/components/runtime/utils/events/standard-event.js +3 -1
- package/dist/es/components/runtime/utils/events/validator-util.js +22 -22
- package/dist/es/components/runtime/utils/page-init-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/page-init-util.js +60 -47
- package/dist/es/components/runtime/utils/table-utils.d.ts +14 -0
- package/dist/es/components/runtime/utils/table-utils.js +57 -32
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +3 -3
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +10 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +29 -21
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +6 -6
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +129 -129
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +8 -4
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +24 -22
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +48 -48
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +42 -42
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +15 -15
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +23 -22
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +60 -51
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +69 -67
- package/dist/es/components/runtime/views/super-page.vue.d.ts +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/dist/es/style.css +82 -82
- package/package.json +2 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import e from "agilebuilder-ui/src/utils/request";
|
|
2
2
|
import { getAdditionalParamMap as t } from "./events/standard-event.js";
|
|
3
3
|
import { PageDimensions as s } from "./interfaces/page-design-types.js";
|
|
4
|
-
import { getFormPropName as i, getVariableValue as
|
|
4
|
+
import { getFormPropName as i, getVariableValue as o, setVariableValue as n, formatVariableValue as r } from "./page-helper-util.js";
|
|
5
5
|
import { getSessionCache as l } from "agilebuilder-ui/src/utils/auth";
|
|
6
6
|
import { functions as a } from "./api/page-expose-util.js";
|
|
7
7
|
import { isWorkflowPage as p, deepCopy as u } from "./common-util.js";
|
|
8
8
|
import { packageCustomValidator as d } from "./events/validator-util.js";
|
|
9
|
-
import { isMobileBrowser as
|
|
10
|
-
function
|
|
9
|
+
import { isMobileBrowser as f } from "agilebuilder-ui/src/utils/common-util";
|
|
10
|
+
function m(t2) {
|
|
11
11
|
return e.get(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + t2);
|
|
12
12
|
}
|
|
13
13
|
function c(e2) {
|
|
14
14
|
var _a, _b, _c;
|
|
15
15
|
if (null == e2) return null;
|
|
16
|
-
const t2 = { uuid: e2.uuid, name: e2.name, label: e2.label, code: e2.code, version: e2.version, dimensions: e2.dimensions, systemCode: e2.systemCode, systemVersion: e2.systemVersion, backendUrl: e2.backendUrl, rules: {}, tableUuids: e2.tableUuids, listCodesMap: e2.listCodesMap, formNoRuleCode: e2.props ? e2.props.formNoRuleCode : null, judgeHeavyList: g(e2), pageType: e2.pageType, beanName: e2.props ? e2.props.beanName : null, importBeanName: e2.props ? e2.props.importBeanName : null, subTablePageInfo: e2.subTablePageInfo, workflowCode: e2.workflowCode, workflowVersion: e2.workflowVersion, refercePropMap: (_a = e2.runtime) == null ? void 0 : _a.refercePropMap, subTableWatchProps: e2.subTableWatchProps, dataTypeMaps: e2.dataTypeMaps, isWorkflowEntity: void 0 !== ((_b = e2.props) == null ? void 0 : _b.activeWorkflow) ? (_c = e2.props) == null ? void 0 : _c.activeWorkflow : e2.isWorkflowEntity, allChartUuids: e2.allChartUuids, entity: { data: {}, task: {}, request: {}, page: {}, context: e2.contextParam, system: e2.systemParam } };
|
|
16
|
+
const t2 = { uuid: e2.uuid, name: e2.name, label: e2.label, code: e2.code, version: e2.version, dimensions: e2.dimensions, systemCode: e2.systemCode, systemVersion: e2.systemVersion, backendUrl: e2.backendUrl, rules: {}, tableUuids: e2.tableUuids, listCodesMap: e2.listCodesMap, formNoRuleCode: e2.props ? e2.props.formNoRuleCode : null, judgeHeavyList: g(e2), pageType: e2.pageType, beanName: e2.props ? e2.props.beanName : null, importBeanName: e2.props ? e2.props.importBeanName : null, subTablePageInfo: e2.subTablePageInfo, workflowCode: e2.workflowCode, workflowVersion: e2.workflowVersion, refercePropMap: (_a = e2.runtime) == null ? void 0 : _a.refercePropMap, subTableWatchProps: e2.subTableWatchProps, dataTypeMaps: e2.dataTypeMaps, isWorkflowEntity: void 0 !== ((_b = e2.props) == null ? void 0 : _b.activeWorkflow) ? (_c = e2.props) == null ? void 0 : _c.activeWorkflow : e2.isWorkflowEntity, allChartUuids: e2.allChartUuids, branchFieldAuth: e2.branchFieldAuth, entity: { data: {}, task: {}, request: {}, page: {}, context: e2.contextParam, system: e2.systemParam } };
|
|
17
17
|
if (e2.props && e2.props.notIdInitializationList) {
|
|
18
18
|
let s2 = e2.props.notIdInitializationList;
|
|
19
19
|
"string" == typeof s2 && (s2 = JSON.parse(s2)), s2.length > 0 && (t2.notIdInitializationList = s2);
|
|
@@ -23,7 +23,7 @@ function c(e2) {
|
|
|
23
23
|
for (const t3 of e2.variables) t3.name && (t3.isArrayElement ? s2[t3.name] = [] : t3.defaultValue ? s2[t3.name] = t3.defaultValue : s2[t3.name] = void 0);
|
|
24
24
|
}
|
|
25
25
|
return function(e3) {
|
|
26
|
-
if (
|
|
26
|
+
if (f()) {
|
|
27
27
|
e3.entity.page._isMobile = "true";
|
|
28
28
|
const t3 = navigator ? navigator.userAgent : null;
|
|
29
29
|
t3 ? t3.indexOf(" uni-app ") > 0 ? (e3.entity.page._isMobileApp = "true", e3.entity.page._isMobileBrowser = "false") : (e3.entity.page._isMobileApp = "false", e3.entity.page._isMobileBrowser = "true") : (e3.entity.page._isMobileApp = "false", e3.entity.page._isMobileBrowser = "false");
|
|
@@ -58,16 +58,16 @@ function b(e2) {
|
|
|
58
58
|
function y(e2, t2) {
|
|
59
59
|
if (e2) {
|
|
60
60
|
Object.assign(t2, e2);
|
|
61
|
-
|
|
61
|
+
w(e2.paramStoreId, t2), delete e2.paramStoreId, e2.jumpMode && (t2.jumpMode = e2.jumpMode);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
function h(e2, t2) {
|
|
65
65
|
if (e2 && (e2.params && Object.assign(t2, e2.params), e2.query, e2.query)) {
|
|
66
66
|
Object.assign(t2, e2.query);
|
|
67
|
-
|
|
67
|
+
w(e2.query.paramStoreId, t2);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function w(e2, t2) {
|
|
71
71
|
if (e2) {
|
|
72
72
|
const s2 = l(e2);
|
|
73
73
|
if (s2) {
|
|
@@ -79,85 +79,98 @@ function v(e2, t2) {
|
|
|
79
79
|
function E(e2, t2) {
|
|
80
80
|
let s2, i2 = t2;
|
|
81
81
|
t2 || (s2 = e2.props.base ? e2.props.base : {}, i2 = s2.prop);
|
|
82
|
-
let
|
|
83
|
-
return t2 && !t2.startsWith("${") ?
|
|
82
|
+
let o2 = null;
|
|
83
|
+
return t2 && !t2.startsWith("${") ? o2 = ["data", t2] : !e2 || i2 && i2.startsWith("${") ? i2.startsWith("${") ? (i2 = i2.substring(2, i2.length - 1), o2 = i2.split("."), e2 && o2.length < 2 && (o2 = [e2.uuid])) : e2 && (o2 = ["page", e2.uuid]) : o2 = ["page", e2.uuid], o2 || e2 ? o2 : ["temp"];
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function v(e2, t2, s2) {
|
|
86
86
|
const i2 = E(t2, s2), r2 = e2.entity;
|
|
87
87
|
if (null == r2.data.ID && null == r2.data.id) {
|
|
88
88
|
let s3, l2, a2 = false;
|
|
89
89
|
t2 && (s3 = t2.props.base ? t2.props.base : {}, l2 = t2.name, a2 = s3.multiple);
|
|
90
|
-
const p2 =
|
|
90
|
+
const p2 = o(r2, i2);
|
|
91
91
|
if (null == p2) {
|
|
92
92
|
const t3 = s3 ? s3.defaultValue : null;
|
|
93
93
|
if (t3) {
|
|
94
94
|
const s4 = P(e2, t3, l2, a2);
|
|
95
|
-
null != s4 &&
|
|
95
|
+
null != s4 && n(r2, i2, s4);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return i2;
|
|
100
100
|
}
|
|
101
101
|
function P(e2, t2, s2, i2) {
|
|
102
|
-
let
|
|
103
|
-
if (t2 && (
|
|
102
|
+
let o2;
|
|
103
|
+
if (t2 && (o2 = r(e2, t2), null != o2 && null != o2 && s2)) {
|
|
104
104
|
let e3 = false;
|
|
105
|
-
"checkbox" == s2 ? e3 = true : "select" == s2 && (e3 = i2), e3 && (
|
|
105
|
+
"checkbox" == s2 ? e3 = true : "select" == s2 && (e3 = i2), e3 && (o2 = (o2 + "").split(","));
|
|
106
106
|
}
|
|
107
|
-
return
|
|
107
|
+
return o2;
|
|
108
108
|
}
|
|
109
109
|
function M(e2, t2) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
if (false === ((_b = (_a = e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isPermission)) return "true";
|
|
110
112
|
const s2 = [];
|
|
111
113
|
if (e2.autoPermissions) for (const i2 of e2.autoPermissions) s2.push(t2.code + "." + i2.simpleCode);
|
|
112
114
|
if (e2.functionCodes) {
|
|
113
|
-
const i2 = e2.sourceTypes ? e2.sourceTypes : [],
|
|
114
|
-
for (let e3 = 0; e3 <
|
|
115
|
-
const
|
|
115
|
+
const i2 = e2.sourceTypes ? e2.sourceTypes : [], o2 = e2.functionCodes;
|
|
116
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
117
|
+
const n2 = o2[e3], r2 = e3 < i2.length ? i2[e3] : "";
|
|
116
118
|
let l2 = "";
|
|
117
|
-
if ("service" == r2) l2 =
|
|
118
|
-
else if ("standard" === r2) l2 = t2.code + "." +
|
|
119
|
+
if ("service" == r2) l2 = n2;
|
|
120
|
+
else if ("standard" === r2) l2 = t2.code + "." + n2;
|
|
119
121
|
else {
|
|
120
|
-
l2 = "custom" ===
|
|
122
|
+
l2 = "custom" === k(n2, t2).type ? n2 : t2.code + "." + n2;
|
|
121
123
|
}
|
|
122
124
|
s2.includes(l2) || s2.push(l2);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
return s2.join(",");
|
|
126
128
|
}
|
|
127
|
-
function
|
|
129
|
+
function k(e2, t2) {
|
|
128
130
|
const s2 = t2.pagePermissions;
|
|
129
131
|
if (s2 && s2.length > 0) {
|
|
130
132
|
for (let t3 = 0; t3 < s2.length; t3++) if (s2[t3].simpleCode === e2) return s2[t3];
|
|
131
133
|
}
|
|
132
134
|
return null;
|
|
133
135
|
}
|
|
134
|
-
function
|
|
135
|
-
const
|
|
136
|
+
function j(s2, i2, o2) {
|
|
137
|
+
const n2 = s2.tableRuntimes, r2 = t(i2);
|
|
136
138
|
let l2;
|
|
137
139
|
const a2 = i2.code;
|
|
138
|
-
return r2 && Object.keys(r2) > 0 && (l2 = JSON.stringify(r2)), e.post(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/super-grids", { tableRuntimes:
|
|
140
|
+
return r2 && Object.keys(r2) > 0 && (l2 = JSON.stringify(r2)), e.post(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/super-grids", { tableRuntimes: n2, additionalParamMapJson: l2, pageCode: a2, publishVersion: o2, pageType: s2.pageType });
|
|
139
141
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
142
|
+
const C = ["button-detail", "print-label"];
|
|
143
|
+
function I(e2, t2, s2) {
|
|
142
144
|
var _a, _b;
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
if (n2 &&
|
|
145
|
+
const o2 = t2.props && t2.props.base ? t2.props.base.prop : null, n2 = p(e2);
|
|
146
|
+
let r2 = false;
|
|
147
|
+
if (n2 && C.indexOf(t2.name) < 0 && e2.fieldPermissionMap) {
|
|
146
148
|
const s3 = e2.fieldPermissionMap.get("all_fields");
|
|
147
|
-
false === (s3 == null ? void 0 : s3.canEdit) && ((_a = t2.runtime) == null ? void 0 : _a.props) && (t2.runtime.props.state = "disabled",
|
|
149
|
+
false === (s3 == null ? void 0 : s3.canEdit) && ((_a = t2.runtime) == null ? void 0 : _a.props) && (t2.runtime.props.state = "disabled", r2 = true);
|
|
148
150
|
}
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
if (e2.rules || (e2.rules = {}), t2.props.rules && t2.props.rules.length > 0 && (e2.rules[
|
|
152
|
-
d(e3);
|
|
153
|
-
}), e2.rules[
|
|
154
|
-
const
|
|
155
|
-
|
|
151
|
+
if (o2) {
|
|
152
|
+
const l2 = i(o2);
|
|
153
|
+
if (e2.rules || (e2.rules = {}), t2.props.rules && t2.props.rules.length > 0 && (e2.rules[l2] || (e2.rules[l2] = []), t2.props.rules.forEach((e3) => {
|
|
154
|
+
d(e3), !s2 && e3 && e3.required && (e3.required = false);
|
|
155
|
+
}), e2.rules[l2] = t2.props.rules), n2 && !r2 && "button-detail" !== t2.name && e2.fieldPermissionMap) {
|
|
156
|
+
const i2 = e2.fieldPermissionMap.get(l2);
|
|
157
|
+
if (!s2 && e2.workflowRules && (e2.workflowRules[l2] || e2.workflowRules.rules && e2.workflowRules.rules[l2])) {
|
|
158
|
+
let t3 = e2.workflowRules[l2];
|
|
159
|
+
if (!t3 && e2.workflowRules.rules && (t3 = e2.workflowRules.rules[l2]), t3 && Array.isArray(t3) && t3.length > 0) for (let e3 = 0; e3 < t3.length; e3++) {
|
|
160
|
+
const s3 = t3[e3];
|
|
161
|
+
if (s3 && s3.required) {
|
|
162
|
+
s3.required = false;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else t3 && t3.required && (t3.required = false);
|
|
167
|
+
}
|
|
168
|
+
t2.runtime.props || (t2.runtime.props = {}), i2 ? (!s2 && i2.canEdit && (i2.canEdit = false), false === i2.canEdit ? t2.runtime.props.state = "disabled" : i2.canEdit && (t2.runtime.props.state = "", t2.runtime.props.required = true)) : t2.runtime.props.state = "";
|
|
156
169
|
}
|
|
157
|
-
((_b = t2.props) == null ? void 0 : _b.customRuleEvents) && (e2.customRuleEvents || (e2.customRuleEvents = []), e2.customRuleEvents.push({ prop:
|
|
170
|
+
((_b = t2.props) == null ? void 0 : _b.customRuleEvents) && (e2.customRuleEvents || (e2.customRuleEvents = []), e2.customRuleEvents.push({ prop: l2, events: t2.props.customRuleEvents }));
|
|
158
171
|
}
|
|
159
172
|
}
|
|
160
|
-
function
|
|
173
|
+
function O(e2, t2) {
|
|
161
174
|
if (e2.initInfo) {
|
|
162
175
|
["dynamicControlFormEdit", "disableElement", "enableElement", "hideElement", "showElement"].forEach((s2) => {
|
|
163
176
|
const i2 = e2.initInfo[s2];
|
|
@@ -173,16 +186,16 @@ function _(e2, t2) {
|
|
|
173
186
|
}
|
|
174
187
|
}
|
|
175
188
|
export {
|
|
176
|
-
|
|
189
|
+
O as controlObjectRenderState,
|
|
177
190
|
c as convertToPageContext,
|
|
178
191
|
P as getDefaultValue,
|
|
179
|
-
|
|
192
|
+
v as getFormModelFields,
|
|
180
193
|
E as getModelFields,
|
|
181
194
|
M as getPermissionCodes,
|
|
182
195
|
b as packageAdditionalMapWithLocationSearch,
|
|
183
196
|
y as packageAdditionalMapWithPageRequest,
|
|
184
197
|
h as packageAdditionalMapWithRoute,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
198
|
+
I as packageFormRules,
|
|
199
|
+
m as queryPageDesignByCode,
|
|
200
|
+
j as queryPageSuperGrids
|
|
188
201
|
};
|
|
@@ -18,3 +18,17 @@ export declare function getDistanceToAppContainer(tableDivRef: any): {
|
|
|
18
18
|
distanceToTop: number;
|
|
19
19
|
distanceToBottom: number;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* 是否有字段的权限
|
|
23
|
+
* @param pageContext
|
|
24
|
+
* @param fieldName
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function isHasFieldAuth(pageContext: any, configure: any): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 是否有字段的权限
|
|
30
|
+
* @param pageContext
|
|
31
|
+
* @param fieldName
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export declare function isHasFieldPermissionAuth(pageContext: any, tableName: any, fieldName: any): boolean;
|
|
@@ -1,55 +1,80 @@
|
|
|
1
1
|
import "agilebuilder-ui/src/utils/common-util";
|
|
2
2
|
import "agilebuilder-ui/src/utils/util";
|
|
3
|
+
import { ExpressionEvaluator as t } from "../views/assemblys/chart/table/chart-table-util.js";
|
|
4
|
+
import { getCustomFunc as e } from "./events/event-util.js";
|
|
3
5
|
import "agilebuilder-ui/src/utils/request";
|
|
4
|
-
import
|
|
5
|
-
import { getPermissionCodes as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
t.$emit(i2 + "_open-dialog", e2);
|
|
6
|
+
import i from "./eventBus.js";
|
|
7
|
+
import { getPermissionCodes as o } from "./page-init-util.js";
|
|
8
|
+
import { $t as n } from "./i18n-util.js";
|
|
9
|
+
import { getFormPropName as s } from "./page-helper-util.js";
|
|
10
|
+
function r(t2) {
|
|
11
|
+
const e2 = t2.pageContext && t2.pageContext.code;
|
|
12
|
+
i.$emit(e2 + "_open-dialog", t2);
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function u(t2, e2) {
|
|
14
15
|
const i2 = t2.tableName;
|
|
15
16
|
if (!e2 && i2) return i2;
|
|
16
17
|
let o2;
|
|
17
18
|
return t2.tableRuntimes && e2 && t2.tableRuntimes[e2] && (o2 = JSON.parse(t2.tableRuntimes[e2].configure)), o2 && o2.props && o2.props.dataOrigin ? o2.props.dataOrigin.tableName : null;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const r2 = !(!
|
|
21
|
-
|
|
22
|
-
const r3 = {}, u3 = Object.assign({},
|
|
23
|
-
if ("custom" ===
|
|
24
|
-
const
|
|
25
|
-
|
|
20
|
+
function l(t2, e2, i2, s2) {
|
|
21
|
+
const r2 = !(!e2.props || !e2.props.base) && e2.props.base.showOperation, u2 = e2.btnList;
|
|
22
|
+
e2.btnList, r2 && u2 && u2.forEach((e3) => {
|
|
23
|
+
const r3 = {}, u3 = Object.assign({}, e3.props.base);
|
|
24
|
+
if ("custom" === e3.name ? u3.customControl = u3.name : u3.elementType = "el-button", void 0 === e3.isPermission || e3.isPermission + "" == "true") {
|
|
25
|
+
const i3 = o(e3, t2);
|
|
26
|
+
i3 && (u3.permission = i3);
|
|
26
27
|
}
|
|
27
|
-
if (u3.label =
|
|
28
|
-
const t3 =
|
|
28
|
+
if (u3.label = n(u3.title), u3.sourceButton = { uuid: e3.uuid }, r3.props = u3, void 0 !== s2) {
|
|
29
|
+
const t3 = s2(e3);
|
|
29
30
|
r3.onClick = (t3 == null ? void 0 : t3.onClick) ?? t3, r3.eventName = t3 == null ? void 0 : t3.eventName;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
i2.push(r3);
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function p(i2, o2, n2, s2) {
|
|
35
36
|
let r2;
|
|
36
|
-
const u2 =
|
|
37
|
+
const u2 = n2 == null ? void 0 : n2.some((n3) => {
|
|
37
38
|
let u3 = false;
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
|
|
39
|
+
if (n3.scopeFunc) {
|
|
40
|
+
const t2 = e(i2, n3.scopeFunc);
|
|
41
|
+
if (t2) {
|
|
42
|
+
t2.apply(t2, [{ pageContext: i2, configureObj: o2, row: s2 }]) && (u3 = true);
|
|
42
43
|
}
|
|
43
|
-
} else if (
|
|
44
|
-
|
|
44
|
+
} else if (n3.showCondition && n3.showCondition.length > 0) {
|
|
45
|
+
t.evaluate(i2, n3.showCondition, s2) && (u3 = true);
|
|
45
46
|
} else u3 = true;
|
|
46
|
-
if (u3) return r2 =
|
|
47
|
+
if (u3) return r2 = n3, true;
|
|
47
48
|
});
|
|
48
49
|
return { show: u2, toPage: r2 };
|
|
49
50
|
}
|
|
51
|
+
function a(t2, e2) {
|
|
52
|
+
var _a;
|
|
53
|
+
const i2 = t2.tableName;
|
|
54
|
+
let o2 = "";
|
|
55
|
+
const n2 = (_a = e2 == null ? void 0 : e2.props) == null ? void 0 : _a.base;
|
|
56
|
+
if (n2 && n2.prop) {
|
|
57
|
+
const t3 = n2.prop;
|
|
58
|
+
o2 = s(t3);
|
|
59
|
+
}
|
|
60
|
+
return c(t2, i2, o2);
|
|
61
|
+
}
|
|
62
|
+
function c(t2, e2, i2) {
|
|
63
|
+
if (!i2 || !e2) return true;
|
|
64
|
+
const o2 = t2.branchFieldAuth;
|
|
65
|
+
if (o2) {
|
|
66
|
+
const t3 = o2.hasAuthFields;
|
|
67
|
+
if (t3 && t3[e2] && t3[e2].indexOf(i2) >= 0) return true;
|
|
68
|
+
const n2 = o2.allAuthFields;
|
|
69
|
+
if (n2 && n2[e2] && n2[e2].indexOf(i2) >= 0) return false;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
50
73
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
p as expressJump,
|
|
75
|
+
l as getOperationButtons,
|
|
76
|
+
u as getTableNameByTableUuid,
|
|
77
|
+
a as isHasFieldAuth,
|
|
78
|
+
c as isHasFieldPermissionAuth,
|
|
79
|
+
r as popupToPage
|
|
55
80
|
};
|
package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js
CHANGED
|
@@ -5,14 +5,14 @@ import { ElLoading as y, ElMessage as C } from "element-plus";
|
|
|
5
5
|
import S from "agilebuilder-ui/src/utils/request";
|
|
6
6
|
import "agilebuilder-ui/src/utils/common-util";
|
|
7
7
|
import "agilebuilder-ui/src/utils/util";
|
|
8
|
-
import "
|
|
8
|
+
import "async-validator";
|
|
9
9
|
import "../../../../utils/global-refs.js";
|
|
10
10
|
import "../../../../utils/eventBus.js";
|
|
11
|
-
import "axios";
|
|
12
|
-
import "async-validator";
|
|
13
11
|
import "../../../../utils/page-store.js";
|
|
14
12
|
import "agilebuilder-ui/src/utils/i18n-util";
|
|
15
13
|
import "vue-i18n";
|
|
14
|
+
import "agilebuilder-ui/src/utils/auth";
|
|
15
|
+
import "axios";
|
|
16
16
|
import "../../../../utils/events/print-label.js";
|
|
17
17
|
const b = { style: { overflow: "auto", height: "calc(100vh - 140px)" }, ref: "dialogBody" }, O = { class: "dialog-footer" }, x = e({ __name: "common-homepage-search", props: { configure: { type: Object, required: true }, pageContext: { type: Object, default: () => {
|
|
18
18
|
} } }, setup(e2, { expose: x2 }) {
|
|
@@ -3,16 +3,24 @@ import { Component, PageContext } from '../../../../utils/interfaces/page-design
|
|
|
3
3
|
type Condition = {
|
|
4
4
|
propValueType: string;
|
|
5
5
|
joinSign: string;
|
|
6
|
-
dataType: 'number' | 'date' | 'string';
|
|
6
|
+
dataType: 'number' | 'date' | 'string' | 'boolean' | 'TEXT' | 'DATE' | 'TIME' | 'DOUBLE' | 'FLOAT' | 'INTEGER' | 'LONG';
|
|
7
7
|
rightBracket: string;
|
|
8
8
|
leftBracket: string;
|
|
9
9
|
propValue: string;
|
|
10
10
|
propName: string;
|
|
11
11
|
operator: 'GT' | 'LT' | 'GET' | 'LET' | 'NET' | 'CONTAIN' | 'NOT_CONTAIN' | 'IS_NULL' | 'IS_NOT_NULL';
|
|
12
|
+
variableIsNull?: string;
|
|
12
13
|
};
|
|
13
14
|
type Data = Record<string, any>;
|
|
14
15
|
export declare class ExpressionEvaluator {
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param pageContext 页面上下文
|
|
19
|
+
* @param conditions 条件集合
|
|
20
|
+
* @param data 数据对象,一般是行数据
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
static evaluate(pageContext: PageContext, conditions: Condition[], data?: Data): boolean;
|
|
16
24
|
private static createExpression;
|
|
17
25
|
private static getComparisonExpression;
|
|
18
26
|
private static changeDataType;
|
|
@@ -10,40 +10,48 @@ class ExpressionEvaluator {
|
|
|
10
10
|
const { propName: o, operator: a, propValue: n, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
|
|
11
11
|
if (!o || "" === o) return "";
|
|
12
12
|
const u = getValueFromVariable(e.entity, o, r);
|
|
13
|
-
let p = `${s} ${this.getComparisonExpression(u,
|
|
13
|
+
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity, n, r))} ${l}`;
|
|
14
14
|
return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
|
|
15
15
|
}
|
|
16
|
-
static getComparisonExpression(e, t, r
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
static getComparisonExpression(e, t, r) {
|
|
17
|
+
const { dataType: o, variableIsNull: a } = t;
|
|
18
|
+
let n = t.operator;
|
|
19
|
+
n || (n = "EQ");
|
|
20
|
+
let s = this.parseValue(e, o);
|
|
21
|
+
const l = this.parseValue(r, o);
|
|
22
|
+
if (null == l && a) {
|
|
23
|
+
if (null == s && (s = "null"), "null" === a) return `${s} === null`;
|
|
24
|
+
if ("ignore" === a) return "1=1";
|
|
25
|
+
if ("notequal" === a) return "1!=1";
|
|
26
|
+
}
|
|
27
|
+
switch (n) {
|
|
20
28
|
case "EQ":
|
|
21
|
-
return `${
|
|
29
|
+
return `${s} === ${l}`;
|
|
22
30
|
case "GT":
|
|
23
|
-
return `${
|
|
31
|
+
return `${s} > ${l}`;
|
|
24
32
|
case "LT":
|
|
25
|
-
return `${
|
|
33
|
+
return `${s} < ${l}`;
|
|
26
34
|
case "GET":
|
|
27
|
-
return `${
|
|
35
|
+
return `${s} >= ${l}`;
|
|
28
36
|
case "LET":
|
|
29
|
-
return `${
|
|
37
|
+
return `${s} <= ${l}`;
|
|
30
38
|
case "NET":
|
|
31
|
-
return `${
|
|
39
|
+
return `${s} !== ${l}`;
|
|
32
40
|
case "CONTAIN":
|
|
33
|
-
return `${
|
|
41
|
+
return `${s}.includes(${l})`;
|
|
34
42
|
case "NOT_CONTAIN":
|
|
35
|
-
return `!${
|
|
43
|
+
return `!${s}.includes(${l})`;
|
|
36
44
|
case "IS_NULL":
|
|
37
|
-
return `${
|
|
45
|
+
return `${s} === null`;
|
|
38
46
|
case "IS_NOT_NULL":
|
|
39
|
-
return `${
|
|
47
|
+
return `${s} !== null`;
|
|
40
48
|
case "IN":
|
|
41
49
|
if ("TEXT" === o) {
|
|
42
|
-
return `${
|
|
50
|
+
return `${l.split(",")}.includes(${s})`;
|
|
43
51
|
}
|
|
44
|
-
return `[${
|
|
52
|
+
return `[${l}].includes(${s})`;
|
|
45
53
|
default:
|
|
46
|
-
throw new Error(`比较符号不匹配: ${
|
|
54
|
+
throw new Error(`比较符号不匹配: ${n}`);
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
57
|
static changeDataType(e) {
|
|
@@ -57,17 +65,17 @@ class ExpressionEvaluator {
|
|
|
57
65
|
return t;
|
|
58
66
|
}
|
|
59
67
|
static parseValue(e, t) {
|
|
60
|
-
|
|
68
|
+
if (t = this.changeDataType(t), null == e) return null;
|
|
69
|
+
switch (t) {
|
|
61
70
|
case "number":
|
|
62
71
|
return getNumberValue(e);
|
|
63
72
|
case "date":
|
|
64
73
|
return new Date(e).getTime();
|
|
65
74
|
case "string":
|
|
75
|
+
default:
|
|
66
76
|
return `"${e}"`;
|
|
67
77
|
case "boolean":
|
|
68
78
|
return "true" === e || true === e || 1 === e;
|
|
69
|
-
default:
|
|
70
|
-
throw new Error(`数据类型解析错误: ${t}`);
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
81
|
static evaluateExpression(expression) {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { defineComponent as o, ref as e, resolveComponent as t, createBlock as r, openBlock as p, withCtx as l, createElementBlock as s, Fragment as n, createTextVNode as a, toDisplayString as u, resolveDynamicComponent as i, createVNode as c, createCommentVNode as m, createElementVNode as f, normalizeClass as g } from "vue";
|
|
2
2
|
import "agilebuilder-ui/src/utils/common-util";
|
|
3
3
|
import "agilebuilder-ui/src/utils/util";
|
|
4
|
+
import { formatColContent as d } from "./chart-table-util.js";
|
|
4
5
|
import "agilebuilder-ui/src/utils/request";
|
|
5
6
|
import "element-plus";
|
|
6
7
|
import "agilebuilder-ui/src/utils/auth";
|
|
7
8
|
import "../../../../utils/global-refs.js";
|
|
8
|
-
import
|
|
9
|
+
import y from "../../../../utils/eventBus.js";
|
|
9
10
|
import "axios";
|
|
10
11
|
import "dayjs";
|
|
11
12
|
import "agilebuilder-ui/src/utils/calculator/calculator-util";
|
|
12
13
|
import "async-validator";
|
|
14
|
+
import { expressJump as b } from "../../../../utils/table-utils.js";
|
|
13
15
|
import "../../../../utils/events/print-label.js";
|
|
14
|
-
import { expressJump as y } from "../../../../utils/table-utils.js";
|
|
15
16
|
import "../../../../utils/page-store.js";
|
|
16
|
-
import { formatColContent as b } from "./chart-table-util.js";
|
|
17
17
|
const k = { key: 0 }, w = { key: 1 }, h = { key: 1 }, x = { key: 2 }, C = o({ __name: "normal-column", props: { configure: { type: Object, default: () => ({}) }, pageContext: { type: Object, default: () => ({}) }, column: { type: Object, default: () => ({}) } }, setup(o2) {
|
|
18
18
|
const C2 = o2, j = e(false);
|
|
19
19
|
let v = null;
|
|
20
20
|
function O(o3, e2, t2, r2) {
|
|
21
21
|
}
|
|
22
22
|
function _(o3) {
|
|
23
|
-
const e2 =
|
|
23
|
+
const e2 = b(C2.pageContext, C2.configure, C2.column.linkPage, o3);
|
|
24
24
|
let t2 = false;
|
|
25
25
|
return e2 && (t2 = e2.show, v = e2.toPage), t2;
|
|
26
26
|
}
|
|
@@ -29,11 +29,11 @@ const k = { key: 0 }, w = { key: 1 }, h = { key: 1 }, x = { key: 2 }, C = o({ __
|
|
|
29
29
|
const e2 = C2.pageContext.code + "_", t2 = JSON.parse(JSON.stringify(v));
|
|
30
30
|
t2.base = { successOperation: "closeWindow" };
|
|
31
31
|
const r2 = { id: o3.id ? o3.id : o3.ID, selections: [o3] };
|
|
32
|
-
|
|
32
|
+
y.$emit(e2 + "open-dialog", { pageContext: C2.pageContext, configureObj: { props: t2 }, eventParams: r2 });
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
function T(o3, e2) {
|
|
36
|
-
return
|
|
36
|
+
return d(o3, e2, C2.column, C2.pageContext, C2.configure);
|
|
37
37
|
}
|
|
38
38
|
return C2.column.linkPage && C2.column.linkPage.length > 0 && (j.value = true), (e2, d2) => {
|
|
39
39
|
const y2 = t("el-table-column"), b2 = t("el-progress"), C3 = t("el-tag"), v2 = t("el-link");
|