super-page-runtime 2.3.49-cdnTmp1 → 2.3.49-cdnTmp2
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/views/assemblys/data/table/main-table-runtime.vue.mjs +91 -87
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime2.vue.mjs +14 -14
- package/dist/lib/components/runtime/views/assemblys/data/table/main-table-runtime.vue.cjs +1 -1
- package/dist/lib/components/runtime/views/assemblys/form/input-text/inputtext-runtime2.vue.cjs +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as Fe, ref as
|
|
2
|
-
import { setTableEvents as $e, canExecuteButton as
|
|
1
|
+
import { defineComponent as Fe, ref as S, onMounted as He, watch as B, onUnmounted as Me, resolveComponent as je, openBlock as Ae, createElementBlock as _e, unref as y, createVNode as Le } from "vue";
|
|
2
|
+
import { setTableEvents as $e, canExecuteButton as H, doAfterClickEvent as E, doBeforeClickEvent as P, gridSelectRecord as ze, gridSelectAllRecords as Ge, gridSelectionChange as We, cellClick as qe, cellDblClick as Ye, rowClick as Je, rowDblClick as Qe, headerClick as Xe, getEventNameByType as Ze, getEventFuncByType as Ke, getHandleEvent as et } from "../../../../utils/events/event-util.mjs";
|
|
3
3
|
import { getBaseUrl as tt, getListCode as nt, getRealRestApiPath as ot, isWorkflowPage as at, isVariableInvalidValue as Q } from "../../../../utils/common-util.mjs";
|
|
4
4
|
import { getAdditionalParamMap as it, getSaveFormRequestWithRow as lt, standardEvents as rt } from "../../../../utils/events/standard-event.mjs";
|
|
5
|
-
import { isMobileBrowser as st, isPromise as
|
|
5
|
+
import { isMobileBrowser as st, isPromise as N } from "agilebuilder-ui";
|
|
6
6
|
import { getOperationButtons as ut, popupToPage as ct } from "../../../../utils/table-utils.mjs";
|
|
7
|
-
import
|
|
7
|
+
import w from "../../../../utils/eventBus.mjs";
|
|
8
8
|
import { getDefaultValue as pt } from "../../../../utils/page-init-util.mjs";
|
|
9
9
|
import { getSizeConfig as dt, caculateShowCondition as ft, decomposeVariable as X } from "../../../../utils/page-helper-util.mjs";
|
|
10
10
|
import { getComponentRefByCode as gt } from "../../../../utils/global-refs.mjs";
|
|
@@ -12,19 +12,19 @@ import { getRowStyleUtil as mt, getCellStyleUtil as vt, getHeaderCellStyleUtil a
|
|
|
12
12
|
const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext: {}, configure: {} }, emits: ["setSafeDeleteTableCode"], setup(Z, { expose: K, emit: ee }) {
|
|
13
13
|
const p = Z, a = p.pageContext;
|
|
14
14
|
let o = p.configure;
|
|
15
|
-
const
|
|
16
|
-
a.isTest ?
|
|
17
|
-
const te =
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
const v =
|
|
15
|
+
const I = S({});
|
|
16
|
+
a.isTest ? I.value = p.configure.runtime ? p.configure.runtime : {} : a.tableRuntimes && a.tableRuntimes[o.uuid] && (o = JSON.parse(a.tableRuntimes[o.uuid].configure), I.value = o.runtime ? o.runtime : {});
|
|
17
|
+
const te = I.value.style, ne = I.value.class, oe = a.systemCode, ae = a.backendUrl, ie = o.props && o.props.dataOrigin && o.props.dataOrigin.tableName;
|
|
18
|
+
let D = tt(a.backendUrl, a.isTest);
|
|
19
|
+
D || (D = window.$vueApp.config.globalProperties.baseURL);
|
|
20
|
+
const v = S({}), T = [], h = S({});
|
|
21
21
|
h.value = function() {
|
|
22
|
-
var s, c, u,
|
|
22
|
+
var s, c, u, g, b;
|
|
23
23
|
const e = a.systemCode, t = a.code;
|
|
24
24
|
let n = o.props && o.props.dataOrigin && o.props.dataOrigin.sqlFilterCondition !== "[]" ? o.props.dataOrigin.sqlFilterCondition : null;
|
|
25
25
|
n == null && (n = []);
|
|
26
|
-
const i = (s = o.props) == null ? void 0 : s.dataOrigin.principalLinkage, l = { isSql: !0, optionTableHeight: 0, rowKeyProp: i, extraParam: { beanName: a.beanName, functionCode: t + ".listData", tableName: ie, systemCode: e, pageCode: a.code, pageVersion: a.version, isMobile: st() }, initSearchForm: n, lineEditOptions: { aftersaveIsCreateRow: !1, autoSave: !1, enter: pe, esc: me }, indexContinuous: !(!o.props || !o.props.otherSettings) && o.props.otherSettings.serialNumberContinuous, initSearch: !o.props || o.props.dataOrigin.initializationQuery !== !1, resizeHeight: be, pageCode: a.code, pageVersion: a.version, additionalParamMap: it(a), showOverflowTooltip: (u = (c = o == null ? void 0 : o.props) == null ? void 0 : c.otherSettings) == null ? void 0 : u.showOverflowTooltip, isEnableEnterEvent: o.props && o.props.otherSettings && o.props.otherSettings.isEnableEnterEvent, isWithDataPermission: !!(o.props && o.props.otherSettings && o.props.otherSettings.isWithDataPermission) && o.props.otherSettings.isWithDataPermission, pageDevMode: !1, isWorkflowEntity: at(a), tableClass: ne, tableStyle: te, pageContext: a, configureObj: o, backendUrl:
|
|
27
|
-
return (
|
|
26
|
+
const i = (s = o.props) == null ? void 0 : s.dataOrigin.principalLinkage, l = { isSql: !0, optionTableHeight: 0, rowKeyProp: i, extraParam: { beanName: a.beanName, functionCode: t + ".listData", tableName: ie, systemCode: e, pageCode: a.code, pageVersion: a.version, isMobile: st() }, initSearchForm: n, lineEditOptions: { aftersaveIsCreateRow: !1, autoSave: !1, enter: pe, esc: me }, indexContinuous: !(!o.props || !o.props.otherSettings) && o.props.otherSettings.serialNumberContinuous, initSearch: !o.props || o.props.dataOrigin.initializationQuery !== !1, resizeHeight: be, pageCode: a.code, pageVersion: a.version, additionalParamMap: it(a), showOverflowTooltip: (u = (c = o == null ? void 0 : o.props) == null ? void 0 : c.otherSettings) == null ? void 0 : u.showOverflowTooltip, isEnableEnterEvent: o.props && o.props.otherSettings && o.props.otherSettings.isEnableEnterEvent, isWithDataPermission: !!(o.props && o.props.otherSettings && o.props.otherSettings.isWithDataPermission) && o.props.otherSettings.isWithDataPermission, pageDevMode: !1, isWorkflowEntity: at(a), tableClass: ne, tableStyle: te, pageContext: a, configureObj: o, backendUrl: D, cellStyleRender: Ie, rowStyleRender: Oe, titleStyleRender: Ve, validateEitConditions: Pe, showOperationCondition: null };
|
|
27
|
+
return (b = (g = o == null ? void 0 : o.props) == null ? void 0 : g.base) != null && b.showOperationCondition && (l.showOperationCondition = o.props.base.showOperationCondition), function(d) {
|
|
28
28
|
var f;
|
|
29
29
|
(f = o.props.highOrder) != null && f.mergeFields && o.props.highOrder.mergeFields.length > 0 && (d.mergeFields = o.props.highOrder.mergeFields.join(","));
|
|
30
30
|
}(l), function(d) {
|
|
@@ -32,37 +32,37 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
32
32
|
d.operations || (d.operations = {}), ut(a, o, f, de), d.operations.operation = f;
|
|
33
33
|
}(l), function(d) {
|
|
34
34
|
o.props && o.props.dataOrigin && o.props.dataOrigin.sortField && (d.initSortInfo = [], o.props.dataOrigin.sortField.forEach((f) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const C = { order: f.type === "desc" ? "desc" : "asc" };
|
|
36
|
+
C.prop = f.name, d.initSortInfo.push(C);
|
|
37
37
|
}));
|
|
38
38
|
}(l), function(d) {
|
|
39
39
|
const f = o.props ? o.props.dataOrigin : {};
|
|
40
40
|
if (f.treeTable) {
|
|
41
|
-
let
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
41
|
+
let C;
|
|
42
|
+
const O = f.rowKey;
|
|
43
|
+
if (C = O && O.indexOf("~~") > 0 ? O.substring(O.indexOf("~~") + 2) : O, d.parentProp = C, f.checkStrictly && (d.checkStrictly = f.checkStrictly), d.parentProp) {
|
|
44
44
|
const Y = f.lazy, J = f.defaultExpandAll;
|
|
45
45
|
d.lazy = Y == null || Y, d.defaultExpandAll = J != null && J;
|
|
46
|
-
const Ue = { parentProp:
|
|
47
|
-
d.extraParam.listViewTreeSetting = JSON.stringify(Ue), d.subRowUrl =
|
|
46
|
+
const Ue = { parentProp: C, lazy: d.lazy, defaultExpandAll: d.defaultExpandAll };
|
|
47
|
+
d.extraParam.listViewTreeSetting = JSON.stringify(Ue), d.subRowUrl = D + "/dsc/commons/list-subs";
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}(l), function(d) {
|
|
51
51
|
const f = o.runtime && o.runtime.events ? o.runtime.events : [];
|
|
52
52
|
$e(d, f, a, o);
|
|
53
|
-
const
|
|
54
|
-
|
|
53
|
+
const C = a.customEvents;
|
|
54
|
+
C && (d.eventCallBack = C);
|
|
55
55
|
}(l), l;
|
|
56
56
|
}();
|
|
57
|
-
const
|
|
58
|
-
let e =
|
|
57
|
+
const V = S(), r = S(), le = function() {
|
|
58
|
+
let e = D + "/dsc/commons/list";
|
|
59
59
|
return e && (e = ot(e, oe, ae, a.isTest)), e;
|
|
60
|
-
}(),
|
|
60
|
+
}(), m = nt(a.code, a.version, o.uuid), R = a.code + "_" + m, x = S([]), re = a.entity.page, M = S({ data: [] }), j = a.superGridItems, se = j ? j[o.uuid] : null, A = S(!1), ue = ee;
|
|
61
61
|
function ce() {
|
|
62
62
|
o.props.linkages && o.props.linkages.length > 0 && (o.props.linkages.forEach((e) => {
|
|
63
63
|
const t = X(e.fieldName);
|
|
64
|
-
t && t.length > 1 &&
|
|
65
|
-
}),
|
|
64
|
+
t && t.length > 1 && T.push(t[1]);
|
|
65
|
+
}), T.length > 0 && function() {
|
|
66
66
|
let e = [];
|
|
67
67
|
if (p.pageContext.toolsInputComponents && p.pageContext.toolsInputComponents.length > 0 && p.pageContext.toolsInputComponents.forEach((t) => {
|
|
68
68
|
if (o.props.linkages.some((n) => n.fieldName === t.prop) && t.defaultValue) {
|
|
@@ -71,11 +71,11 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
71
71
|
}
|
|
72
72
|
}), e.length === 0) q();
|
|
73
73
|
else {
|
|
74
|
-
const t =
|
|
75
|
-
e = e.filter((n) => Q(t, n)), e.length === 0 ? (
|
|
76
|
-
|
|
77
|
-
const i =
|
|
78
|
-
e.length === 0 ?
|
|
74
|
+
const t = F();
|
|
75
|
+
e = e.filter((n) => Q(t, n)), e.length === 0 ? (k(t), q()) : T.forEach((n) => {
|
|
76
|
+
B(() => p.pageContext.entity.page[n], () => {
|
|
77
|
+
const i = F();
|
|
78
|
+
e.length === 0 ? k(i) : (e = e.filter((l) => Q(i, l)), e.length === 0 && k(i));
|
|
79
79
|
}, { immediate: !0 });
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -86,9 +86,9 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
86
86
|
}
|
|
87
87
|
function _(e, t, n, i, l) {
|
|
88
88
|
const s = v.value.lineEditSave, c = o;
|
|
89
|
-
s.props.base.tableUuid = c.uuid, h.value.lineEditOptions.beforeSave = fe, a.editData = n,
|
|
90
|
-
u.canExecute === !0 && (h.value.lineEditOptions.saveRow = ge, r.value.saveRow(l,
|
|
91
|
-
|
|
89
|
+
s.props.base.tableUuid = c.uuid, h.value.lineEditOptions.beforeSave = fe, a.editData = n, H({ pageContext: a, configureObj: s }).then((u) => {
|
|
90
|
+
u.canExecute === !0 && (h.value.lineEditOptions.saveRow = ge, r.value.saveRow(l, m).then(() => {
|
|
91
|
+
E(a, s, { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l });
|
|
92
92
|
}));
|
|
93
93
|
}).finally(() => {
|
|
94
94
|
a.editData = null;
|
|
@@ -98,7 +98,7 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
98
98
|
if (!e) return;
|
|
99
99
|
let t;
|
|
100
100
|
const n = Ze(e.events, "click");
|
|
101
|
-
return n ? (v.value[n] = e, n === "lineEditSave" ? t = _ : n === "restoreEdit" ? t =
|
|
101
|
+
return n ? (v.value[n] = e, n === "lineEditSave" ? t = _ : n === "restoreEdit" ? t = U : n === "lineEditUpdate" ? t = ve : n === "lineEditDelete" && (t = he), !t && (t = Ke(a, e.events, "click"))) : (v.value[e.uuid] = e, t = Ce), { onClick: t, eventName: n };
|
|
102
102
|
}
|
|
103
103
|
function fe({ row: e, columns: t, additionalParamMap: n }) {
|
|
104
104
|
const i = v.value.lineEditSave, l = o;
|
|
@@ -106,37 +106,37 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
106
106
|
}
|
|
107
107
|
function ge({ row: e, columns: t, dataTypeMap: n, dynamicColumnInfo: i, additionalParamMap: l, mainDefaultValueColumns: s }) {
|
|
108
108
|
const c = v.value.lineEditSave, u = o;
|
|
109
|
-
return c.props.base.tableUuid = u.uuid, new Promise((
|
|
109
|
+
return c.props.base.tableUuid = u.uuid, new Promise((g, b) => {
|
|
110
110
|
const d = { tableName: u.props.dataOrigin.tableName };
|
|
111
111
|
lt(a, c, "/dsc/commons", !1, s, i, e, d, !0).then((f) => {
|
|
112
|
-
|
|
112
|
+
g(f ? f.entity : {});
|
|
113
113
|
}).catch((f) => {
|
|
114
|
-
|
|
114
|
+
b(f);
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
function me({ rowIndex: e, column: t, row: n, orgRow: i }) {
|
|
119
|
-
|
|
119
|
+
U(null, null, n, t, e);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function U(e, t, n, i, l) {
|
|
122
122
|
const s = v.value.restoreEdit, c = o;
|
|
123
123
|
s.props.base.tableUuid = c.uuid;
|
|
124
124
|
const u = P(a, s, { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l });
|
|
125
|
-
u && (
|
|
126
|
-
|
|
127
|
-
}) : r.value.restoreRow(l,
|
|
125
|
+
u && (N(u) ? u.then((g) => {
|
|
126
|
+
g && r.value.restoreRow(l, m);
|
|
127
|
+
}) : r.value.restoreRow(l, m), E(a, o, { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l }));
|
|
128
128
|
}
|
|
129
129
|
function ve(e, t, n, i, l) {
|
|
130
130
|
const s = v.value.lineEditUpdate, c = o;
|
|
131
131
|
s.props.base.tableUuid = c.uuid;
|
|
132
132
|
const u = P(a, s, { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l });
|
|
133
|
-
u && (
|
|
134
|
-
|
|
133
|
+
u && (N(u) ? u.then((g) => {
|
|
134
|
+
g && L(e, t, n, i, l, s);
|
|
135
135
|
}) : L(e, t, n, i, l, s));
|
|
136
136
|
}
|
|
137
137
|
function L(e, t, n, i, l, s) {
|
|
138
|
-
a.editData = n,
|
|
139
|
-
c.canExecute === !0 && (r.value.editRow(l,
|
|
138
|
+
a.editData = n, H({ pageContext: a, configureObj: s }).then((c) => {
|
|
139
|
+
c.canExecute === !0 && (r.value.editRow(l, m), E(a, o, { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l }));
|
|
140
140
|
}).finally(() => {
|
|
141
141
|
a.editData = null;
|
|
142
142
|
});
|
|
@@ -144,22 +144,26 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
144
144
|
function he(e, t, n, i, l) {
|
|
145
145
|
const s = v.value.lineEditDelete, c = o;
|
|
146
146
|
s.props.base.tableUuid = c.uuid;
|
|
147
|
-
const u =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}) : $(e, t, n, i, l, s));
|
|
151
|
-
}
|
|
152
|
-
function $(e, t, n, i, l, s) {
|
|
153
|
-
n.id || n.ID ? (a.editData = n,
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
n.id ?
|
|
147
|
+
const u = { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l }, g = P(a, s, u);
|
|
148
|
+
g && (N(g) ? g.then((b) => {
|
|
149
|
+
b && $(e, t, n, i, l, s, u);
|
|
150
|
+
}) : $(e, t, n, i, l, s, u));
|
|
151
|
+
}
|
|
152
|
+
function $(e, t, n, i, l, s, c) {
|
|
153
|
+
n.id || n.ID ? (a.editData = n, H({ pageContext: a, configureObj: s }).then((u) => {
|
|
154
|
+
if (u.canExecute === !0) {
|
|
155
|
+
const g = [];
|
|
156
|
+
n.id ? g.push(n.id) : g.push(n.ID);
|
|
157
|
+
const b = rt.delete({ pageContext: a, configureObj: s, ids: g });
|
|
158
|
+
N(b) ? b.then(() => {
|
|
159
|
+
E(a, s, c);
|
|
160
|
+
}) : E(a, s, c);
|
|
157
161
|
}
|
|
158
162
|
}).finally(() => {
|
|
159
163
|
a.editData = null;
|
|
160
|
-
})) : (
|
|
164
|
+
})) : (U(e, t, n, i, l), E(a, o, { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l }));
|
|
161
165
|
}
|
|
162
|
-
function
|
|
166
|
+
function k(e) {
|
|
163
167
|
if (!a.dataTypeMaps) return;
|
|
164
168
|
const t = a.dataTypeMaps;
|
|
165
169
|
let n = [];
|
|
@@ -202,18 +206,18 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
208
|
function Ce(e, t, n, i, l, s) {
|
|
205
|
-
const c = { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l, button: s, id: n.ID ? n.ID : n.id }, u = v.value[s.sourceButton.uuid],
|
|
206
|
-
u.props.base.tableUuid =
|
|
209
|
+
const c = { originalValue: e, formatValue: t, row: n, column: i, rowIndex: l, button: s, id: n.ID ? n.ID : n.id }, u = v.value[s.sourceButton.uuid], g = o;
|
|
210
|
+
u.props.base.tableUuid = g.uuid, et(null, a, u, "click", c);
|
|
207
211
|
}
|
|
208
212
|
function G(e) {
|
|
209
213
|
var t, n;
|
|
210
214
|
e.data === "close_open_win" ? r.value && r.value.refresh() : ((t = e.data) == null ? void 0 : t.type) === "close_open_win" && ((n = e.data.jumpFrom) == null ? void 0 : n.uuid) === p.configure.uuid && r.value && r.value.refresh();
|
|
211
215
|
}
|
|
212
216
|
function we(e, t) {
|
|
213
|
-
|
|
217
|
+
x.value = e, ze(a, o, { selection: e, row: t });
|
|
214
218
|
}
|
|
215
219
|
function Se(e) {
|
|
216
|
-
|
|
220
|
+
x.value = e, Ge(a, o, { selection: e });
|
|
217
221
|
}
|
|
218
222
|
function ye(e) {
|
|
219
223
|
We(a, o, { newSelection: e });
|
|
@@ -234,7 +238,7 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
234
238
|
Xe(a, o, { column: e, event: t });
|
|
235
239
|
}
|
|
236
240
|
function W() {
|
|
237
|
-
|
|
241
|
+
x.value = [];
|
|
238
242
|
}
|
|
239
243
|
function ke(e) {
|
|
240
244
|
A.value = !0;
|
|
@@ -249,42 +253,42 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
249
253
|
const t = e.titleStyle, n = p.configure.style.titleStyle;
|
|
250
254
|
return ht(e, { cellTitleStyle: t, titleStyle: n }, p);
|
|
251
255
|
}
|
|
252
|
-
function
|
|
256
|
+
function F() {
|
|
253
257
|
const e = {};
|
|
254
|
-
return
|
|
258
|
+
return T.forEach((t) => {
|
|
255
259
|
e[t] = p.pageContext.entity.page[t];
|
|
256
260
|
}), e;
|
|
257
261
|
}
|
|
258
262
|
function q() {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
263
|
+
T.forEach((e) => {
|
|
264
|
+
B(() => p.pageContext.entity.page[e], () => {
|
|
265
|
+
k(F());
|
|
262
266
|
});
|
|
263
267
|
});
|
|
264
268
|
}
|
|
265
269
|
He(() => {
|
|
266
270
|
const e = Be();
|
|
267
|
-
r.value && e && e.distanceToBottom && (r.value.tableHeight = e.distanceToBottom - 110), p.pageContext.pageRuntimeStyle && p.pageContext.pageRuntimeStyle.height, window.addEventListener("message", G),
|
|
271
|
+
r.value && e && e.distanceToBottom && (r.value.tableHeight = e.distanceToBottom - 110), p.pageContext.pageRuntimeStyle && p.pageContext.pageRuntimeStyle.height, window.addEventListener("message", G), w.$on(R + "-close-component-page-dialog", function({ jumpInfo: t, popEntity: n, popPageCode: i }) {
|
|
268
272
|
r.value.closePageDialog({ entity: n, pageCode: i, jumpInfo: t });
|
|
269
|
-
}),
|
|
270
|
-
|
|
271
|
-
}),
|
|
273
|
+
}), w.$on(R + "_close-dialog-get-entity", () => {
|
|
274
|
+
w.$emit(R + "_close-super-dialog");
|
|
275
|
+
}), w.$on(m + "-pickFileDone", (t) => {
|
|
272
276
|
r.value.pickFileDone(t);
|
|
273
|
-
}),
|
|
277
|
+
}), w.$on(m + "-scanDone", (t) => {
|
|
274
278
|
r.value.scanDone(t);
|
|
275
279
|
}), h.value.formSetMaxHeight = z(), h.value && h.value.configureObj.props.base && h.value.configureObj.props.base.isSafeDelete && ue("setSafeDeleteTableCode", h.value.extraParam.tableName);
|
|
276
|
-
}),
|
|
280
|
+
}), B(() => p.pageContext.searchFormData, (e) => {
|
|
277
281
|
M.value.data = e;
|
|
278
|
-
}),
|
|
279
|
-
|
|
282
|
+
}), B(() => p.pageContext.entity.data, (e) => {
|
|
283
|
+
k(p.pageContext.entity.data);
|
|
280
284
|
}), Me(() => {
|
|
281
|
-
window.removeEventListener("message", G),
|
|
285
|
+
window.removeEventListener("message", G), w.$off(R + "-close-component-page-dialog"), w.$off(R + "_close-dialog-get-entity"), w.$off(m + "-pickFileDone"), w.$off(m + "-scanDone");
|
|
282
286
|
});
|
|
283
287
|
const Be = () => {
|
|
284
|
-
if (!
|
|
285
|
-
let e =
|
|
288
|
+
if (!V.value) return null;
|
|
289
|
+
let e = V.value.closest(".app-container");
|
|
286
290
|
if (!e) return null;
|
|
287
|
-
const t =
|
|
291
|
+
const t = V.value.getBoundingClientRect(), n = e.getBoundingClientRect(), i = window.scrollY;
|
|
288
292
|
return { distanceToTop: t.top + i - n.top, distanceToBottom: n.bottom - t.top };
|
|
289
293
|
};
|
|
290
294
|
function Pe({ row: e, editConditions: t }) {
|
|
@@ -304,12 +308,12 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
304
308
|
return K({ refresh: function(e, t, n, i) {
|
|
305
309
|
return r.value.refresh(e, t, n, i);
|
|
306
310
|
}, createRow: function() {
|
|
307
|
-
return r.value.createRow(
|
|
311
|
+
return r.value.createRow(m, {}, { getDefaultValueFunc: pt });
|
|
308
312
|
}, clearSelections: W, getSelections: function() {
|
|
309
|
-
return
|
|
313
|
+
return x.value;
|
|
310
314
|
}, getSelectionIds: function() {
|
|
311
315
|
const e = [];
|
|
312
|
-
return
|
|
316
|
+
return x.value !== null && x.value.forEach((t) => {
|
|
313
317
|
e.push(t.id ? t.id : t.ID ? t.ID : null);
|
|
314
318
|
}), e;
|
|
315
319
|
}, getTableConfigure: function() {
|
|
@@ -321,7 +325,7 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
321
325
|
}, showMobileSearch: function() {
|
|
322
326
|
A.value && r.value.showMobileSearch();
|
|
323
327
|
}, getTableSelectOptions: function() {
|
|
324
|
-
if (r.value) return r.value.getTableSelectOptions(
|
|
328
|
+
if (r.value) return r.value.getTableSelectOptions(m);
|
|
325
329
|
}, dynamicControlTableEdit: function(e, t, n) {
|
|
326
330
|
r.value && r.value.dynamicControlTableEdit(e, t, n);
|
|
327
331
|
}, doLayout: function(e) {
|
|
@@ -354,7 +358,7 @@ const bt = ["id"], It = Fe({ __name: "main-table-runtime", props: { pageContext:
|
|
|
354
358
|
return (e = r.value) == null ? void 0 : e.getColumns();
|
|
355
359
|
} }), (e, t) => {
|
|
356
360
|
const n = je("super-grid");
|
|
357
|
-
return Ae(), _e("div", { ref_key: "tableDivRef", ref:
|
|
361
|
+
return Ae(), _e("div", { ref_key: "tableDivRef", ref: V, id: y(m) + "_tableDiv" }, [Le(n, { ref_key: "gridRef", ref: r, url: y(le), options: h.value, code: y(m), settings: y(se), "search-form-info": M.value, "list-toolbar-form-data": y(re), isDialog: y(a).isDialog, onSelect: we, onSelectAll: Se, onSelectionChange: ye, onCellClick: xe, onCellDblclick: Ee, onRowClick: De, onRowDblclick: Te, onHeaderClick: Re, onRefresh: W, onNewOpenGridDialog: y(ct), onCanShowMobileSearch: ke, onGridOnmounted: ce }, null, 8, ["url", "options", "code", "settings", "search-form-info", "list-toolbar-form-data", "isDialog", "onNewOpenGridDialog"])], 8, bt);
|
|
358
362
|
};
|
|
359
363
|
} });
|
|
360
364
|
export {
|
package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime2.vue.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ne, ref as r, computed as ue, onMounted as re, nextTick as se, onUnmounted as ie, watch as ce, resolveComponent as F, openBlock as i, createBlock as p, normalizeStyle as j, unref as o, normalizeClass as pe, createSlots as H, withCtx as m, createVNode as fe, createCommentVNode as y, createTextVNode as V, toDisplayString as k, createElementVNode as ve, createElementBlock as de, Fragment as me } from "vue";
|
|
2
2
|
import { isMobileBrowser as ye, isDingTalkEnv as ge, SuperIcon as T } from "agilebuilder-ui";
|
|
3
3
|
import { getFormModelFields as xe } from "../../../../utils/page-init-util.mjs";
|
|
4
|
-
import { getModelFieldFromPageContext as Ce, isNumberDataType as Ve, setVariableValue as
|
|
4
|
+
import { getModelFieldFromPageContext as Ce, isNumberDataType as Ve, setVariableValue as M, getVariableValue as E } from "../../../../utils/page-helper-util.mjs";
|
|
5
5
|
import { handleFormEvent as f, handleAfterInitEvent as ke, doSuffixOrPrefixClickEvent as b } from "../../../../utils/events/event-util.mjs";
|
|
6
6
|
import { formatScanRuleSets as Te, analysisScanValue as Ie, setScanAnalysisValue as we } from "../../../../utils/form/scan-util.mjs";
|
|
7
7
|
import he from "../common/title-suffix-element.vue.mjs";
|
|
8
8
|
import W from "../../../../utils/eventBus.mjs";
|
|
9
9
|
import { $t as g } from "../../../../utils/i18n-util.mjs";
|
|
10
10
|
import { addRequiredClassUtil as be } from "../../../../utils/common-util.mjs";
|
|
11
|
-
const ze =
|
|
11
|
+
const ze = ne({ __name: "inputtext-runtime", props: { pageContext: {}, configure: {} }, setup(n, { expose: G }) {
|
|
12
12
|
var L, U, $;
|
|
13
|
-
const l =
|
|
13
|
+
const l = n, v = l.pageContext.entity ? l.pageContext.entity : {}, O = r("text");
|
|
14
14
|
let s = xe(l.pageContext, l.configure);
|
|
15
15
|
if (l.pageContext.modelFieldsMap) {
|
|
16
16
|
const t = Ce(s, l.pageContext);
|
|
17
17
|
t && (O.value = Ve(t.dataType) ? "number" : "text");
|
|
18
18
|
}
|
|
19
19
|
const S = r(ye()), K = l.pageContext.code, x = r(s && s.length > 0 ? K + "__" + s.join("__") : null), I = r(null), c = ue({ get: () => E(v, s), set(t) {
|
|
20
|
-
|
|
20
|
+
M(v, s, t), t != null && t !== "" && (I.value = "");
|
|
21
21
|
} }), P = r(null), q = r(null), z = r(null), d = l.configure.runtime ? l.configure.runtime : {}, e = r(d.props ? d.props : {}), B = r(!!((L = e.value.scan) != null && L.enable));
|
|
22
22
|
let w = !1;
|
|
23
23
|
ge() && (w = !0);
|
|
@@ -34,7 +34,7 @@ const ze = le({ __name: "inputtext-runtime", props: { pageContext: {}, configure
|
|
|
34
34
|
}));
|
|
35
35
|
const Q = d.style, X = d.class, Y = d.headerStyle, Z = d.titleExceedStyle;
|
|
36
36
|
function R(t) {
|
|
37
|
-
return
|
|
37
|
+
return M(v, s, t);
|
|
38
38
|
}
|
|
39
39
|
re(() => {
|
|
40
40
|
W.$on(x.value + "-scanDone", (t) => {
|
|
@@ -42,13 +42,13 @@ const ze = le({ __name: "inputtext-runtime", props: { pageContext: {}, configure
|
|
|
42
42
|
}), se(() => {
|
|
43
43
|
var a;
|
|
44
44
|
const t = c.value;
|
|
45
|
-
ke(t, l.pageContext, l.configure, { formItemRef: P.value, componentRef: q.value, titleRef: z.value, value: t, entity: l.pageContext.entity.data, pageData: l.pageContext.entity.page }), N.value && ((a = e.value.scan) != null && a.autoOpen) &&
|
|
45
|
+
ke(t, l.pageContext, l.configure, { formItemRef: P.value, componentRef: q.value, titleRef: z.value, value: t, entity: l.pageContext.entity.data, pageData: l.pageContext.entity.page }), N.value && ((a = e.value.scan) != null && a.autoOpen) && D();
|
|
46
46
|
});
|
|
47
47
|
}), ie(() => {
|
|
48
48
|
W.$off(x.value + "-scanDone");
|
|
49
49
|
});
|
|
50
50
|
const C = r(!1);
|
|
51
|
-
function
|
|
51
|
+
function D() {
|
|
52
52
|
if (J || w) {
|
|
53
53
|
const t = { type: "scan", componentId: x.value, systemCode: l.pageContext.systemCode };
|
|
54
54
|
w && (t.type = "dingTalkScan"), window.parent.parent ? (window.parent.parent, window.parent.parent.postMessage(JSON.stringify(t), "*")) : window.parent && (window.parent, window.parent.postMessage(JSON.stringify(t), "*"));
|
|
@@ -60,18 +60,18 @@ const ze = le({ __name: "inputtext-runtime", props: { pageContext: {}, configure
|
|
|
60
60
|
else C.value = !0;
|
|
61
61
|
}
|
|
62
62
|
function ee(t) {
|
|
63
|
-
C.value = !1, R(t);
|
|
63
|
+
C.value = !1, R(t), f(t, l.pageContext, l.configure, "afterScanDone");
|
|
64
64
|
}
|
|
65
65
|
return G({ getValue: function() {
|
|
66
66
|
return E(v, s);
|
|
67
|
-
}, setValue: R, scanClick:
|
|
67
|
+
}, setValue: R, scanClick: D, addRequiredClass: function() {
|
|
68
68
|
I.value = be();
|
|
69
69
|
} }), (t, a) => {
|
|
70
|
-
const ae =
|
|
71
|
-
return i(), p(
|
|
70
|
+
const ae = F("el-input"), te = F("scan-code-input-browser"), oe = F("el-form-item");
|
|
71
|
+
return i(), p(oe, { ref_key: "formItemRef", ref: P, required: !!e.value.required, class: pe(o(X) + (I.value ? " " + I.value : "")), "label-width": e.value.labelWidth, style: j(o(Q)) }, H({ default: m(() => [fe(ae, { ref_key: "componentRef", ref: q, disabled: e.value.state === "disabled", readonly: e.value.state === "readonly", size: e.value.size, clearable: e.value.clearable, placeholder: o(g)(e.value.placeholder), maxlength: e.value.maxLength, "show-word-limit": e.value.showInputNum, type: O.value, modelValue: c.value, "onUpdate:modelValue": a[5] || (a[5] = (u) => c.value = u), onInput: a[6] || (a[6] = (u) => o(f)(u, n.pageContext, n.configure, "input")), onChange: a[7] || (a[7] = (u) => o(f)(u, n.pageContext, n.configure, "change")), onBlur: a[8] || (a[8] = (u) => function(le) {
|
|
72
72
|
let h = E(v, s);
|
|
73
|
-
h != null && (h = h.trim()),
|
|
74
|
-
}(u)), onFocus: a[9] || (a[9] = (u) =>
|
|
73
|
+
h != null && (h = h.trim()), M(v, s, h), f(le, l.pageContext, l.configure, "blur");
|
|
74
|
+
}(u)), onFocus: a[9] || (a[9] = (u) => o(f)(u, n.pageContext, n.configure, "focus")), onClick: a[10] || (a[10] = (u) => o(f)(u, n.pageContext, n.configure, "click")), onClear: a[11] || (a[11] = (u) => o(f)(u, n.pageContext, n.configure, "clear")) }, H({ _: 2 }, [e.value.iconPosition != "outer" && (e.value.preIconType && e.value.preIconValue || e.value.preText) ? { name: "prefix", fn: m(() => [e.value.preIconType && e.value.preIconValue ? (i(), p(o(T), { key: 0, style: { cursor: "pointer" }, iconType: e.value.preIconType, iconValue: e.value.preIconValue, onClick: a[0] || (a[0] = (u) => o(b)(c.value, n.pageContext, n.configure, "prefixClick")) }, null, 8, ["iconType", "iconValue"])) : y("", !0), V(" " + k(o(g)(e.value.preText)), 1)]), key: "0" } : void 0, e.value.iconPosition == "outer" && (e.value.preIconType && e.value.preIconValue || e.value.preText) ? { name: "prepend", fn: m(() => [e.value.preIconType && e.value.preIconValue ? (i(), p(o(T), { key: 0, style: { cursor: "pointer" }, iconType: e.value.preIconType, iconValue: e.value.preIconValue, onClick: a[1] || (a[1] = (u) => o(b)(c.value, n.pageContext, n.configure, "prefixClick")) }, null, 8, ["iconType", "iconValue"])) : y("", !0), V(" " + k(o(g)(e.value.preText)), 1)]), key: "1" } : void 0, e.value.iconPosition != "outer" && (e.value.sufIconType && e.value.sufIconValue || e.value.sufText) ? { name: "suffix", fn: m(() => [e.value.sufIconType && e.value.sufIconValue ? (i(), p(o(T), { key: 0, style: { cursor: "pointer" }, iconType: e.value.sufIconType, iconValue: e.value.sufIconValue, onClick: a[2] || (a[2] = (u) => o(b)(c.value, n.pageContext, n.configure, "suffixClick")) }, null, 8, ["iconType", "iconValue"])) : y("", !0), V(" " + k(o(g)(e.value.sufText)), 1)]), key: "2" } : void 0, N.value || e.value.iconPosition == "outer" && (e.value.sufIconType && e.value.sufIconValue || e.value.sufText) ? { name: "append", fn: m(() => [N.value ? (i(), p(o(T), { key: 0, style: { cursor: "pointer" }, iconValue: "fa-barcode", onClick: a[3] || (a[3] = (u) => D()) })) : y("", !0), e.value.sufIconType && e.value.sufIconValue ? (i(), p(o(T), { key: 1, style: { cursor: "pointer" }, iconType: e.value.sufIconType, iconValue: e.value.sufIconValue, onClick: a[4] || (a[4] = (u) => o(b)(c.value, n.pageContext, n.configure, "suffixClick")) }, null, 8, ["iconType", "iconValue"])) : y("", !0), V(" " + k(o(g)(e.value.sufText)), 1)]), key: "3" } : void 0]), 1032, ["disabled", "readonly", "size", "clearable", "placeholder", "maxlength", "show-word-limit", "type", "modelValue"]), C.value ? (i(), p(te, { key: 0, onClose: ee, onCancel: a[12] || (a[12] = (u) => C.value = !1) })) : y("", !0)]), _: 2 }, [e.value.tittleShow ? { name: "label", fn: m(() => [ve("div", { ref_key: "titleRef", ref: z, class: "amb-form-item-label", style: j({ ...o(Y), ...o(Z) }) }, [e.value.prefixType ? (i(), p(he, { key: 0, pageContext: n.pageContext, property: e.value }, null, 8, ["pageContext", "property"])) : (i(), de(me, { key: 1 }, [V(k(o(g)(e.value.title)), 1)], 64))], 4)]), key: "0" } : void 0]), 1032, ["required", "class", "label-width", "style"]);
|
|
75
75
|
};
|
|
76
76
|
} });
|
|
77
77
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const p=require("vue"),g=require("../../../../utils/events/event-util.cjs"),x=require("../../../../utils/common-util.cjs"),F=require("../../../../utils/events/standard-event.cjs"),B=require("agilebuilder-ui"),J=require("../../../../utils/table-utils.cjs"),y=require("../../../../utils/eventBus.cjs"),Ue=require("../../../../utils/page-init-util.cjs"),P=require("../../../../utils/page-helper-util.cjs"),Fe=require("../../../../utils/global-refs.cjs"),A=require("../../chart/table/chart-table-util.cjs"),Ae=["id"],He=p.defineComponent({__name:"main-table-runtime",props:{pageContext:{},configure:{}},emits:["setSafeDeleteTableCode"],setup(K,{expose:X,emit:Z}){const f=K,a=f.pageContext;let o=f.configure;const I=p.ref({});a.isTest?I.value=f.configure.runtime?f.configure.runtime:{}:a.tableRuntimes&&a.tableRuntimes[o.uuid]&&(o=JSON.parse(a.tableRuntimes[o.uuid].configure),I.value=o.runtime?o.runtime:{});const ee=I.value.style,te=I.value.class,ne=a.systemCode,oe=a.backendUrl,ie=o.props&&o.props.dataOrigin&&o.props.dataOrigin.tableName;let D=x.getBaseUrl(a.backendUrl,a.isTest);D||(D=window.$vueApp.config.globalProperties.baseURL);const b=p.ref({}),k=[],w=p.ref({});w.value=function(){var u,s,c,v,C;const e=a.systemCode,t=a.code;let n=o.props&&o.props.dataOrigin&&o.props.dataOrigin.sqlFilterCondition!=="[]"?o.props.dataOrigin.sqlFilterCondition:null;n==null&&(n=[]);const i=(u=o.props)==null?void 0:u.dataOrigin.principalLinkage,l={isSql:!0,optionTableHeight:0,rowKeyProp:i,extraParam:{beanName:a.beanName,functionCode:t+".listData",tableName:ie,systemCode:e,pageCode:a.code,pageVersion:a.version,isMobile:B.isMobileBrowser()},initSearchForm:n,lineEditOptions:{aftersaveIsCreateRow:!1,autoSave:!1,enter:ce,esc:ge},indexContinuous:!(!o.props||!o.props.otherSettings)&&o.props.otherSettings.serialNumberContinuous,initSearch:!o.props||o.props.dataOrigin.initializationQuery!==!1,resizeHeight:he,pageCode:a.code,pageVersion:a.version,additionalParamMap:F.getAdditionalParamMap(a),showOverflowTooltip:(c=(s=o==null?void 0:o.props)==null?void 0:s.otherSettings)==null?void 0:c.showOverflowTooltip,isEnableEnterEvent:o.props&&o.props.otherSettings&&o.props.otherSettings.isEnableEnterEvent,isWithDataPermission:!!(o.props&&o.props.otherSettings&&o.props.otherSettings.isWithDataPermission)&&o.props.otherSettings.isWithDataPermission,pageDevMode:!1,isWorkflowEntity:x.isWorkflowPage(a),tableClass:te,tableStyle:ee,pageContext:a,configureObj:o,backendUrl:D,cellStyleRender:Oe,rowStyleRender:Re,titleStyleRender:Ie,validateEitConditions:Be,showOperationCondition:null};return(C=(v=o==null?void 0:o.props)==null?void 0:v.base)!=null&&C.showOperationCondition&&(l.showOperationCondition=o.props.base.showOperationCondition),function(d){var m;(m=o.props.highOrder)!=null&&m.mergeFields&&o.props.highOrder.mergeFields.length>0&&(d.mergeFields=o.props.highOrder.mergeFields.join(","))}(l),function(d){const m=[];d.operations||(d.operations={}),J.getOperationButtons(a,o,m,pe),d.operations.operation=m}(l),function(d){o.props&&o.props.dataOrigin&&o.props.dataOrigin.sortField&&(d.initSortInfo=[],o.props.dataOrigin.sortField.forEach(m=>{const S={order:m.type==="desc"?"desc":"asc"};S.prop=m.name,d.initSortInfo.push(S)}))}(l),function(d){const m=o.props?o.props.dataOrigin:{};if(m.treeTable){let S;const O=m.rowKey;if(S=O&&O.indexOf("~~")>0?O.substring(O.indexOf("~~")+2):O,d.parentProp=S,m.checkStrictly&&(d.checkStrictly=m.checkStrictly),d.parentProp){const Q=m.lazy,Y=m.defaultExpandAll;d.lazy=Q==null||Q,d.defaultExpandAll=Y!=null&&Y;const Ne={parentProp:S,lazy:d.lazy,defaultExpandAll:d.defaultExpandAll};d.extraParam.listViewTreeSetting=JSON.stringify(Ne),d.subRowUrl=D+"/dsc/commons/list-subs"}}}(l),function(d){const m=o.runtime&&o.runtime.events?o.runtime.events:[];g.setTableEvents(d,m,a,o);const S=a.customEvents;S&&(d.eventCallBack=S)}(l),l}();const V=p.ref(),r=p.ref(),ae=function(){let e=D+"/dsc/commons/list";return e&&(e=x.getRealRestApiPath(e,ne,oe,a.isTest)),e}(),h=x.getListCode(a.code,a.version,o.uuid),T=a.code+"_"+h,E=p.ref([]),le=a.entity.page,H=p.ref({data:[]}),M=a.superGridItems,re=M?M[o.uuid]:null,q=p.ref(!1),ue=Z;function se(){o.props.linkages&&o.props.linkages.length>0&&(o.props.linkages.forEach(e=>{const t=P.decomposeVariable(e.fieldName);t&&t.length>1&&k.push(t[1])}),k.length>0&&function(){let e=[];if(f.pageContext.toolsInputComponents&&f.pageContext.toolsInputComponents.length>0&&f.pageContext.toolsInputComponents.forEach(t=>{if(o.props.linkages.some(n=>n.fieldName===t.prop)&&t.defaultValue){const n=P.decomposeVariable(t.prop);n&&n.length>1&&e.push(n[1])}}),e.length===0)W();else{const t=U();e=e.filter(n=>x.isVariableInvalidValue(t,n)),e.length===0?(R(t),W()):k.forEach(n=>{p.watch(()=>f.pageContext.entity.page[n],()=>{const i=U();e.length===0?R(i):(e=e.filter(l=>x.isVariableInvalidValue(i,l)),e.length===0&&R(i))},{immediate:!0})})}}())}function ce({rowIndex:e,column:t,row:n,orgRow:i}){j(null,null,n,t,e)}function j(e,t,n,i,l){const u=b.value.lineEditSave,s=o;u.props.base.tableUuid=s.uuid,w.value.lineEditOptions.beforeSave=de,a.editData=n,g.canExecuteButton({pageContext:a,configureObj:u}).then(c=>{c.canExecute===!0&&(w.value.lineEditOptions.saveRow=fe,r.value.saveRow(l,h).then(()=>{const v={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l};g.doAfterClickEvent(a,u,v)}))}).finally(()=>{a.editData=null})}function pe(e){if(!e)return;let t;const n=g.getEventNameByType(e.events,"click");return n?(b.value[n]=e,n==="lineEditSave"?t=j:n==="restoreEdit"?t=N:n==="lineEditUpdate"?t=me:n==="lineEditDelete"&&(t=ve),!t&&(t=g.getEventFuncByType(a,e.events,"click"))):(b.value[e.uuid]=e,t=Ce),{onClick:t,eventName:n}}function de({row:e,columns:t,additionalParamMap:n}){const i=b.value.lineEditSave,l=o;i.props.base.tableUuid=l.uuid;const u={row:e,columns:t};return g.doBeforeClickEvent(a,i,u)}function fe({row:e,columns:t,dataTypeMap:n,dynamicColumnInfo:i,additionalParamMap:l,mainDefaultValueColumns:u}){const s=b.value.lineEditSave,c=o;return s.props.base.tableUuid=c.uuid,new Promise((v,C)=>{const d={tableName:c.props.dataOrigin.tableName};F.getSaveFormRequestWithRow(a,s,"/dsc/commons",!1,u,i,e,d,!0).then(m=>{v(m?m.entity:{})}).catch(m=>{C(m)})})}function ge({rowIndex:e,column:t,row:n,orgRow:i}){N(null,null,n,t,e)}function N(e,t,n,i,l){const u=b.value.restoreEdit,s=o;u.props.base.tableUuid=s.uuid;const c={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l},v=g.doBeforeClickEvent(a,u,c);if(!v)return;B.isPromise(v)?v.then(d=>{d&&r.value.restoreRow(l,h)}):r.value.restoreRow(l,h);const C={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l};g.doAfterClickEvent(a,o,C)}function me(e,t,n,i,l){const u=b.value.lineEditUpdate,s=o;u.props.base.tableUuid=s.uuid;const c={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l},v=g.doBeforeClickEvent(a,u,c);v&&(B.isPromise(v)?v.then(C=>{C&&_(e,t,n,i,l,u)}):_(e,t,n,i,l,u))}function _(e,t,n,i,l,u){a.editData=n,g.canExecuteButton({pageContext:a,configureObj:u}).then(s=>{if(s.canExecute===!0){r.value.editRow(l,h);const c={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l};g.doAfterClickEvent(a,o,c)}}).finally(()=>{a.editData=null})}function ve(e,t,n,i,l){const u=b.value.lineEditDelete,s=o;u.props.base.tableUuid=s.uuid;const c={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l},v=g.doBeforeClickEvent(a,u,c);v&&(B.isPromise(v)?v.then(C=>{C&&L(e,t,n,i,l,u)}):L(e,t,n,i,l,u))}function L(e,t,n,i,l,u){if(n.id||n.ID)a.editData=n,g.canExecuteButton({pageContext:a,configureObj:u}).then(s=>{if(s.canExecute===!0){const c=[];n.id?c.push(n.id):c.push(n.ID),F.standardEvents.delete({pageContext:a,configureObj:u,ids:c})}}).finally(()=>{a.editData=null});else{N(e,t,n,i,l);const s={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l};g.doAfterClickEvent(a,o,s)}}function R(e){if(!a.dataTypeMaps)return;const t=a.dataTypeMaps;let n=[];if(e)for(var i in e){const u=e[i];if(u!=null&&u!=="")if(u instanceof Array){if(u.length>0){const s=[];for(var l=0;l<u.length;l++){const c={};c.leftBracket=l===0?"((":"(",c.propName=i,c.propDbName=i,c.dataType=t[i]?t[i]:"TEXT",c.operator="EQ",c.propValue=u[l],l===u.length-1?(c.rightBracket="))",c.joinSign="and"):(c.rightBracket=")",c.joinSign="or"),s.push(c)}n=n.concat(s)}}else{const s={leftBracket:"("};s.propName=i,s.propDbName=i,s.dataType=t[i]?t[i]:"TEXT",s.operator="EQ",s.propValue=u,Pe(s,i),s.rightBracket=")",s.joinSign="and",n.push(s)}}r.value.toolbarRefresh(null,null,n)}function he(e){const t=$();if(t){let n=0;return e.searchHeight&&(n=e.searchHeight),t-10-n}}function $(){if(!r.value)return;const e=P.getSizeConfig(f.pageContext,f.configure);if(e){if(e.isCalcHeight){let t=r.value.$el;if(t||(t=r.value),!t)return;const n=t.getBoundingClientRect();return window.innerHeight-n.y-90}if(e.fixHeight&&r.value&&(r.value.tableHeight=e.fixHeight),e.maxHeight)return e.maxHeight}}function Ce(e,t,n,i,l,u){const s={originalValue:e,formatValue:t,row:n,column:i,rowIndex:l,button:u,id:n.ID?n.ID:n.id},c=b.value[u.sourceButton.uuid],v=o;c.props.base.tableUuid=v.uuid,g.getHandleEvent(null,a,c,"click",s)}function z(e){var t,n;e.data==="close_open_win"?r.value&&r.value.refresh():((t=e.data)==null?void 0:t.type)==="close_open_win"&&((n=e.data.jumpFrom)==null?void 0:n.uuid)===f.configure.uuid&&r.value&&r.value.refresh()}function be(e,t){E.value=e;const n={selection:e,row:t};g.gridSelectRecord(a,o,n)}function we(e){E.value=e;const t={selection:e};g.gridSelectAllRecords(a,o,t)}function Se(e){const t={newSelection:e};g.gridSelectionChange(a,o,t)}function ye(e,t,n,i){const l={row:e,column:t,cell:n,event:i};g.cellClick(a,o,l)}function Ee(e,t,n,i){const l={row:e,column:t,cell:n,event:i};g.cellDblClick(a,o,l)}function xe(e,t,n){const i={row:e,column:t,event:n};g.rowClick(a,o,i)}function De(e,t,n){const i={row:e,column:t,event:n};g.rowDblClick(a,o,i)}function ke(e,t){const n={column:e,event:t};g.headerClick(a,o,n)}function G(){E.value=[]}function Te(e){q.value=!0}function Re(e){return A.getRowStyleUtil(e,[],f)}function Oe(e){return A.getCellStyleUtil(e,e.cellStyle,f)}function Ie(e){const t=e.titleStyle,n=f.configure.style.titleStyle;return A.getHeaderCellStyleUtil(e,{cellTitleStyle:t,titleStyle:n},f)}function U(){const e={};return k.forEach(t=>{e[t]=f.pageContext.entity.page[t]}),e}function W(){k.forEach(e=>{p.watch(()=>f.pageContext.entity.page[e],()=>{R(U())})})}p.onMounted(()=>{const e=Ve();r.value&&e&&e.distanceToBottom&&(r.value.tableHeight=e.distanceToBottom-110),f.pageContext.pageRuntimeStyle&&f.pageContext.pageRuntimeStyle.height,window.addEventListener("message",z),y.$on(T+"-close-component-page-dialog",function({jumpInfo:t,popEntity:n,popPageCode:i}){r.value.closePageDialog({entity:n,pageCode:i,jumpInfo:t})}),y.$on(T+"_close-dialog-get-entity",()=>{y.$emit(T+"_close-super-dialog")}),y.$on(h+"-pickFileDone",t=>{r.value.pickFileDone(t)}),y.$on(h+"-scanDone",t=>{r.value.scanDone(t)}),w.value.formSetMaxHeight=$(),w.value&&w.value.configureObj.props.base&&w.value.configureObj.props.base.isSafeDelete&&ue("setSafeDeleteTableCode",w.value.extraParam.tableName)}),p.watch(()=>f.pageContext.searchFormData,e=>{H.value.data=e}),p.watch(()=>f.pageContext.entity.data,e=>{R(f.pageContext.entity.data)}),p.onUnmounted(()=>{window.removeEventListener("message",z),y.$off(T+"-close-component-page-dialog"),y.$off(T+"_close-dialog-get-entity"),y.$off(h+"-pickFileDone"),y.$off(h+"-scanDone")});const Ve=()=>{if(!V.value)return null;let e=V.value.closest(".app-container");if(!e)return null;const t=V.value.getBoundingClientRect(),n=e.getBoundingClientRect(),i=window.scrollY;return{distanceToTop:t.top+i-n.top,distanceToBottom:n.bottom-t.top}};function Be({row:e,editConditions:t}){let n=!0;return t&&t.length>0&&(n=P.caculateShowCondition(f.pageContext,t,e)),n}function Pe(e,t){const n=Fe.getComponentRefByCode(f.pageContext,t);if(n){const i=n.getConfigure();if(i.name==="datePicker"){const l=i.runtime.props.dateType;e.dateFormatType=l==="year"?"YEAR":l==="month"?"MONTH":"DAY"}}}return X({refresh:function(e,t,n,i){return r.value.refresh(e,t,n,i)},createRow:function(){return r.value.createRow(h,{},{getDefaultValueFunc:Ue.getDefaultValue})},clearSelections:G,getSelections:function(){return E.value},getSelectionIds:function(){const e=[];return E.value!==null&&E.value.forEach(t=>{e.push(t.id?t.id:t.ID?t.ID:null)}),e},getTableConfigure:function(){return o},isDeleteChange:function(e){r.value.isDeleteChange(e)},validatorSunTableListData:function(){return r.value.validatorSunTableListData()},showMobileSearch:function(){q.value&&r.value.showMobileSearch()},getTableSelectOptions:function(){if(r.value)return r.value.getTableSelectOptions(h)},dynamicControlTableEdit:function(e,t,n){r.value&&r.value.dynamicControlTableEdit(e,t,n)},doLayout:function(e){r.value&&r.value.doLayout(e)},changeOperationAddState:function(e){},scrollTo:function(e,t){r.value&&r.value.scrollTo(e,t)},setScrollTop:function(e){r.value&&r.value.setScrollTop(e)},setScrollLeft:function(e){r.value&&r.value.setScrollLeft(e)},getSuperGridRef:function(){return r.value},getSuperGridTableRef:function(){return r.value.getSuperGridTableRef()},setCurrentRowIndex:function(e){var t;(t=r.value)==null||t.setCurrentRowIndex(e)},setScrollTopByRowIndex:function(e){var t;(t=r.value)==null||t.setScrollTopByRowIndex(e)},getTableData:function(){var e;return(e=r.value)==null?void 0:e.getTableData()},handleSearch:function(e,t){var n;return(n=r.value)==null?void 0:n.handleSearch(e,t)},getColumns:function(){var e;return(e=r.value)==null?void 0:e.getColumns()}}),(e,t)=>{const n=p.resolveComponent("super-grid");return p.openBlock(),p.createElementBlock("div",{ref_key:"tableDivRef",ref:V,id:p.unref(h)+"_tableDiv"},[p.createVNode(n,{ref_key:"gridRef",ref:r,url:p.unref(ae),options:w.value,code:p.unref(h),settings:p.unref(re),"search-form-info":H.value,"list-toolbar-form-data":p.unref(le),isDialog:p.unref(a).isDialog,onSelect:be,onSelectAll:we,onSelectionChange:Se,onCellClick:ye,onCellDblclick:Ee,onRowClick:xe,onRowDblclick:De,onHeaderClick:ke,onRefresh:G,onNewOpenGridDialog:p.unref(J.popupToPage),onCanShowMobileSearch:Te,onGridOnmounted:se},null,8,["url","options","code","settings","search-form-info","list-toolbar-form-data","isDialog","onNewOpenGridDialog"])],8,Ae)}}});module.exports=He;
|
|
1
|
+
"use strict";const p=require("vue"),f=require("../../../../utils/events/event-util.cjs"),x=require("../../../../utils/common-util.cjs"),U=require("../../../../utils/events/standard-event.cjs"),I=require("agilebuilder-ui"),J=require("../../../../utils/table-utils.cjs"),y=require("../../../../utils/eventBus.cjs"),Ae=require("../../../../utils/page-init-util.cjs"),P=require("../../../../utils/page-helper-util.cjs"),Ue=require("../../../../utils/global-refs.cjs"),F=require("../../chart/table/chart-table-util.cjs"),Fe=["id"],He=p.defineComponent({__name:"main-table-runtime",props:{pageContext:{},configure:{}},emits:["setSafeDeleteTableCode"],setup(K,{expose:X,emit:Z}){const g=K,i=g.pageContext;let o=g.configure;const V=p.ref({});i.isTest?V.value=g.configure.runtime?g.configure.runtime:{}:i.tableRuntimes&&i.tableRuntimes[o.uuid]&&(o=JSON.parse(i.tableRuntimes[o.uuid].configure),V.value=o.runtime?o.runtime:{});const ee=V.value.style,te=V.value.class,ne=i.systemCode,oe=i.backendUrl,ie=o.props&&o.props.dataOrigin&&o.props.dataOrigin.tableName;let D=x.getBaseUrl(i.backendUrl,i.isTest);D||(D=window.$vueApp.config.globalProperties.baseURL);const b=p.ref({}),k=[],w=p.ref({});w.value=function(){var u,c,s,m,C;const e=i.systemCode,t=i.code;let n=o.props&&o.props.dataOrigin&&o.props.dataOrigin.sqlFilterCondition!=="[]"?o.props.dataOrigin.sqlFilterCondition:null;n==null&&(n=[]);const a=(u=o.props)==null?void 0:u.dataOrigin.principalLinkage,l={isSql:!0,optionTableHeight:0,rowKeyProp:a,extraParam:{beanName:i.beanName,functionCode:t+".listData",tableName:ie,systemCode:e,pageCode:i.code,pageVersion:i.version,isMobile:I.isMobileBrowser()},initSearchForm:n,lineEditOptions:{aftersaveIsCreateRow:!1,autoSave:!1,enter:ce,esc:ge},indexContinuous:!(!o.props||!o.props.otherSettings)&&o.props.otherSettings.serialNumberContinuous,initSearch:!o.props||o.props.dataOrigin.initializationQuery!==!1,resizeHeight:he,pageCode:i.code,pageVersion:i.version,additionalParamMap:U.getAdditionalParamMap(i),showOverflowTooltip:(s=(c=o==null?void 0:o.props)==null?void 0:c.otherSettings)==null?void 0:s.showOverflowTooltip,isEnableEnterEvent:o.props&&o.props.otherSettings&&o.props.otherSettings.isEnableEnterEvent,isWithDataPermission:!!(o.props&&o.props.otherSettings&&o.props.otherSettings.isWithDataPermission)&&o.props.otherSettings.isWithDataPermission,pageDevMode:!1,isWorkflowEntity:x.isWorkflowPage(i),tableClass:te,tableStyle:ee,pageContext:i,configureObj:o,backendUrl:D,cellStyleRender:Oe,rowStyleRender:Re,titleStyleRender:Ie,validateEitConditions:Be,showOperationCondition:null};return(C=(m=o==null?void 0:o.props)==null?void 0:m.base)!=null&&C.showOperationCondition&&(l.showOperationCondition=o.props.base.showOperationCondition),function(d){var v;(v=o.props.highOrder)!=null&&v.mergeFields&&o.props.highOrder.mergeFields.length>0&&(d.mergeFields=o.props.highOrder.mergeFields.join(","))}(l),function(d){const v=[];d.operations||(d.operations={}),J.getOperationButtons(i,o,v,pe),d.operations.operation=v}(l),function(d){o.props&&o.props.dataOrigin&&o.props.dataOrigin.sortField&&(d.initSortInfo=[],o.props.dataOrigin.sortField.forEach(v=>{const S={order:v.type==="desc"?"desc":"asc"};S.prop=v.name,d.initSortInfo.push(S)}))}(l),function(d){const v=o.props?o.props.dataOrigin:{};if(v.treeTable){let S;const O=v.rowKey;if(S=O&&O.indexOf("~~")>0?O.substring(O.indexOf("~~")+2):O,d.parentProp=S,v.checkStrictly&&(d.checkStrictly=v.checkStrictly),d.parentProp){const Q=v.lazy,Y=v.defaultExpandAll;d.lazy=Q==null||Q,d.defaultExpandAll=Y!=null&&Y;const Ne={parentProp:S,lazy:d.lazy,defaultExpandAll:d.defaultExpandAll};d.extraParam.listViewTreeSetting=JSON.stringify(Ne),d.subRowUrl=D+"/dsc/commons/list-subs"}}}(l),function(d){const v=o.runtime&&o.runtime.events?o.runtime.events:[];f.setTableEvents(d,v,i,o);const S=i.customEvents;S&&(d.eventCallBack=S)}(l),l}();const B=p.ref(),r=p.ref(),ae=function(){let e=D+"/dsc/commons/list";return e&&(e=x.getRealRestApiPath(e,ne,oe,i.isTest)),e}(),h=x.getListCode(i.code,i.version,o.uuid),T=i.code+"_"+h,E=p.ref([]),le=i.entity.page,H=p.ref({data:[]}),M=i.superGridItems,re=M?M[o.uuid]:null,q=p.ref(!1),ue=Z;function se(){o.props.linkages&&o.props.linkages.length>0&&(o.props.linkages.forEach(e=>{const t=P.decomposeVariable(e.fieldName);t&&t.length>1&&k.push(t[1])}),k.length>0&&function(){let e=[];if(g.pageContext.toolsInputComponents&&g.pageContext.toolsInputComponents.length>0&&g.pageContext.toolsInputComponents.forEach(t=>{if(o.props.linkages.some(n=>n.fieldName===t.prop)&&t.defaultValue){const n=P.decomposeVariable(t.prop);n&&n.length>1&&e.push(n[1])}}),e.length===0)W();else{const t=A();e=e.filter(n=>x.isVariableInvalidValue(t,n)),e.length===0?(R(t),W()):k.forEach(n=>{p.watch(()=>g.pageContext.entity.page[n],()=>{const a=A();e.length===0?R(a):(e=e.filter(l=>x.isVariableInvalidValue(a,l)),e.length===0&&R(a))},{immediate:!0})})}}())}function ce({rowIndex:e,column:t,row:n,orgRow:a}){j(null,null,n,t,e)}function j(e,t,n,a,l){const u=b.value.lineEditSave,c=o;u.props.base.tableUuid=c.uuid,w.value.lineEditOptions.beforeSave=de,i.editData=n,f.canExecuteButton({pageContext:i,configureObj:u}).then(s=>{s.canExecute===!0&&(w.value.lineEditOptions.saveRow=fe,r.value.saveRow(l,h).then(()=>{const m={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l};f.doAfterClickEvent(i,u,m)}))}).finally(()=>{i.editData=null})}function pe(e){if(!e)return;let t;const n=f.getEventNameByType(e.events,"click");return n?(b.value[n]=e,n==="lineEditSave"?t=j:n==="restoreEdit"?t=N:n==="lineEditUpdate"?t=me:n==="lineEditDelete"&&(t=ve),!t&&(t=f.getEventFuncByType(i,e.events,"click"))):(b.value[e.uuid]=e,t=Ce),{onClick:t,eventName:n}}function de({row:e,columns:t,additionalParamMap:n}){const a=b.value.lineEditSave,l=o;a.props.base.tableUuid=l.uuid;const u={row:e,columns:t};return f.doBeforeClickEvent(i,a,u)}function fe({row:e,columns:t,dataTypeMap:n,dynamicColumnInfo:a,additionalParamMap:l,mainDefaultValueColumns:u}){const c=b.value.lineEditSave,s=o;return c.props.base.tableUuid=s.uuid,new Promise((m,C)=>{const d={tableName:s.props.dataOrigin.tableName};U.getSaveFormRequestWithRow(i,c,"/dsc/commons",!1,u,a,e,d,!0).then(v=>{m(v?v.entity:{})}).catch(v=>{C(v)})})}function ge({rowIndex:e,column:t,row:n,orgRow:a}){N(null,null,n,t,e)}function N(e,t,n,a,l){const u=b.value.restoreEdit,c=o;u.props.base.tableUuid=c.uuid;const s={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l},m=f.doBeforeClickEvent(i,u,s);if(!m)return;I.isPromise(m)?m.then(d=>{d&&r.value.restoreRow(l,h)}):r.value.restoreRow(l,h);const C={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l};f.doAfterClickEvent(i,o,C)}function me(e,t,n,a,l){const u=b.value.lineEditUpdate,c=o;u.props.base.tableUuid=c.uuid;const s={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l},m=f.doBeforeClickEvent(i,u,s);m&&(I.isPromise(m)?m.then(C=>{C&&_(e,t,n,a,l,u)}):_(e,t,n,a,l,u))}function _(e,t,n,a,l,u){i.editData=n,f.canExecuteButton({pageContext:i,configureObj:u}).then(c=>{if(c.canExecute===!0){r.value.editRow(l,h);const s={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l};f.doAfterClickEvent(i,o,s)}}).finally(()=>{i.editData=null})}function ve(e,t,n,a,l){const u=b.value.lineEditDelete,c=o;u.props.base.tableUuid=c.uuid;const s={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l},m=f.doBeforeClickEvent(i,u,s);m&&(I.isPromise(m)?m.then(C=>{C&&L(e,t,n,a,l,u,s)}):L(e,t,n,a,l,u,s))}function L(e,t,n,a,l,u,c){if(n.id||n.ID)i.editData=n,f.canExecuteButton({pageContext:i,configureObj:u}).then(s=>{if(s.canExecute===!0){const m=[];n.id?m.push(n.id):m.push(n.ID);const C=U.standardEvents.delete({pageContext:i,configureObj:u,ids:m});I.isPromise(C)?C.then(()=>{f.doAfterClickEvent(i,u,c)}):f.doAfterClickEvent(i,u,c)}}).finally(()=>{i.editData=null});else{N(e,t,n,a,l);const s={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l};f.doAfterClickEvent(i,o,s)}}function R(e){if(!i.dataTypeMaps)return;const t=i.dataTypeMaps;let n=[];if(e)for(var a in e){const u=e[a];if(u!=null&&u!=="")if(u instanceof Array){if(u.length>0){const c=[];for(var l=0;l<u.length;l++){const s={};s.leftBracket=l===0?"((":"(",s.propName=a,s.propDbName=a,s.dataType=t[a]?t[a]:"TEXT",s.operator="EQ",s.propValue=u[l],l===u.length-1?(s.rightBracket="))",s.joinSign="and"):(s.rightBracket=")",s.joinSign="or"),c.push(s)}n=n.concat(c)}}else{const c={leftBracket:"("};c.propName=a,c.propDbName=a,c.dataType=t[a]?t[a]:"TEXT",c.operator="EQ",c.propValue=u,Pe(c,a),c.rightBracket=")",c.joinSign="and",n.push(c)}}r.value.toolbarRefresh(null,null,n)}function he(e){const t=$();if(t){let n=0;return e.searchHeight&&(n=e.searchHeight),t-10-n}}function $(){if(!r.value)return;const e=P.getSizeConfig(g.pageContext,g.configure);if(e){if(e.isCalcHeight){let t=r.value.$el;if(t||(t=r.value),!t)return;const n=t.getBoundingClientRect();return window.innerHeight-n.y-90}if(e.fixHeight&&r.value&&(r.value.tableHeight=e.fixHeight),e.maxHeight)return e.maxHeight}}function Ce(e,t,n,a,l,u){const c={originalValue:e,formatValue:t,row:n,column:a,rowIndex:l,button:u,id:n.ID?n.ID:n.id},s=b.value[u.sourceButton.uuid],m=o;s.props.base.tableUuid=m.uuid,f.getHandleEvent(null,i,s,"click",c)}function z(e){var t,n;e.data==="close_open_win"?r.value&&r.value.refresh():((t=e.data)==null?void 0:t.type)==="close_open_win"&&((n=e.data.jumpFrom)==null?void 0:n.uuid)===g.configure.uuid&&r.value&&r.value.refresh()}function be(e,t){E.value=e;const n={selection:e,row:t};f.gridSelectRecord(i,o,n)}function we(e){E.value=e;const t={selection:e};f.gridSelectAllRecords(i,o,t)}function Se(e){const t={newSelection:e};f.gridSelectionChange(i,o,t)}function ye(e,t,n,a){const l={row:e,column:t,cell:n,event:a};f.cellClick(i,o,l)}function Ee(e,t,n,a){const l={row:e,column:t,cell:n,event:a};f.cellDblClick(i,o,l)}function xe(e,t,n){const a={row:e,column:t,event:n};f.rowClick(i,o,a)}function De(e,t,n){const a={row:e,column:t,event:n};f.rowDblClick(i,o,a)}function ke(e,t){const n={column:e,event:t};f.headerClick(i,o,n)}function G(){E.value=[]}function Te(e){q.value=!0}function Re(e){return F.getRowStyleUtil(e,[],g)}function Oe(e){return F.getCellStyleUtil(e,e.cellStyle,g)}function Ie(e){const t=e.titleStyle,n=g.configure.style.titleStyle;return F.getHeaderCellStyleUtil(e,{cellTitleStyle:t,titleStyle:n},g)}function A(){const e={};return k.forEach(t=>{e[t]=g.pageContext.entity.page[t]}),e}function W(){k.forEach(e=>{p.watch(()=>g.pageContext.entity.page[e],()=>{R(A())})})}p.onMounted(()=>{const e=Ve();r.value&&e&&e.distanceToBottom&&(r.value.tableHeight=e.distanceToBottom-110),g.pageContext.pageRuntimeStyle&&g.pageContext.pageRuntimeStyle.height,window.addEventListener("message",z),y.$on(T+"-close-component-page-dialog",function({jumpInfo:t,popEntity:n,popPageCode:a}){r.value.closePageDialog({entity:n,pageCode:a,jumpInfo:t})}),y.$on(T+"_close-dialog-get-entity",()=>{y.$emit(T+"_close-super-dialog")}),y.$on(h+"-pickFileDone",t=>{r.value.pickFileDone(t)}),y.$on(h+"-scanDone",t=>{r.value.scanDone(t)}),w.value.formSetMaxHeight=$(),w.value&&w.value.configureObj.props.base&&w.value.configureObj.props.base.isSafeDelete&&ue("setSafeDeleteTableCode",w.value.extraParam.tableName)}),p.watch(()=>g.pageContext.searchFormData,e=>{H.value.data=e}),p.watch(()=>g.pageContext.entity.data,e=>{R(g.pageContext.entity.data)}),p.onUnmounted(()=>{window.removeEventListener("message",z),y.$off(T+"-close-component-page-dialog"),y.$off(T+"_close-dialog-get-entity"),y.$off(h+"-pickFileDone"),y.$off(h+"-scanDone")});const Ve=()=>{if(!B.value)return null;let e=B.value.closest(".app-container");if(!e)return null;const t=B.value.getBoundingClientRect(),n=e.getBoundingClientRect(),a=window.scrollY;return{distanceToTop:t.top+a-n.top,distanceToBottom:n.bottom-t.top}};function Be({row:e,editConditions:t}){let n=!0;return t&&t.length>0&&(n=P.caculateShowCondition(g.pageContext,t,e)),n}function Pe(e,t){const n=Ue.getComponentRefByCode(g.pageContext,t);if(n){const a=n.getConfigure();if(a.name==="datePicker"){const l=a.runtime.props.dateType;e.dateFormatType=l==="year"?"YEAR":l==="month"?"MONTH":"DAY"}}}return X({refresh:function(e,t,n,a){return r.value.refresh(e,t,n,a)},createRow:function(){return r.value.createRow(h,{},{getDefaultValueFunc:Ae.getDefaultValue})},clearSelections:G,getSelections:function(){return E.value},getSelectionIds:function(){const e=[];return E.value!==null&&E.value.forEach(t=>{e.push(t.id?t.id:t.ID?t.ID:null)}),e},getTableConfigure:function(){return o},isDeleteChange:function(e){r.value.isDeleteChange(e)},validatorSunTableListData:function(){return r.value.validatorSunTableListData()},showMobileSearch:function(){q.value&&r.value.showMobileSearch()},getTableSelectOptions:function(){if(r.value)return r.value.getTableSelectOptions(h)},dynamicControlTableEdit:function(e,t,n){r.value&&r.value.dynamicControlTableEdit(e,t,n)},doLayout:function(e){r.value&&r.value.doLayout(e)},changeOperationAddState:function(e){},scrollTo:function(e,t){r.value&&r.value.scrollTo(e,t)},setScrollTop:function(e){r.value&&r.value.setScrollTop(e)},setScrollLeft:function(e){r.value&&r.value.setScrollLeft(e)},getSuperGridRef:function(){return r.value},getSuperGridTableRef:function(){return r.value.getSuperGridTableRef()},setCurrentRowIndex:function(e){var t;(t=r.value)==null||t.setCurrentRowIndex(e)},setScrollTopByRowIndex:function(e){var t;(t=r.value)==null||t.setScrollTopByRowIndex(e)},getTableData:function(){var e;return(e=r.value)==null?void 0:e.getTableData()},handleSearch:function(e,t){var n;return(n=r.value)==null?void 0:n.handleSearch(e,t)},getColumns:function(){var e;return(e=r.value)==null?void 0:e.getColumns()}}),(e,t)=>{const n=p.resolveComponent("super-grid");return p.openBlock(),p.createElementBlock("div",{ref_key:"tableDivRef",ref:B,id:p.unref(h)+"_tableDiv"},[p.createVNode(n,{ref_key:"gridRef",ref:r,url:p.unref(ae),options:w.value,code:p.unref(h),settings:p.unref(re),"search-form-info":H.value,"list-toolbar-form-data":p.unref(le),isDialog:p.unref(i).isDialog,onSelect:be,onSelectAll:we,onSelectionChange:Se,onCellClick:ye,onCellDblclick:Ee,onRowClick:xe,onRowDblclick:De,onHeaderClick:ke,onRefresh:G,onNewOpenGridDialog:p.unref(J.popupToPage),onCanShowMobileSearch:Te,onGridOnmounted:se},null,8,["url","options","code","settings","search-form-info","list-toolbar-form-data","isDialog","onNewOpenGridDialog"])],8,Fe)}}});module.exports=He;
|
package/dist/lib/components/runtime/views/assemblys/form/input-text/inputtext-runtime2.vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),s=require("agilebuilder-ui"),G=require("../../../../utils/page-init-util.cjs"),p=require("../../../../utils/page-helper-util.cjs"),
|
|
1
|
+
"use strict";const e=require("vue"),s=require("agilebuilder-ui"),G=require("../../../../utils/page-init-util.cjs"),p=require("../../../../utils/page-helper-util.cjs"),u=require("../../../../utils/events/event-util.cjs"),I=require("../../../../utils/form/scan-util.cjs"),K=require("../common/title-suffix-element.vue.cjs"),P=require("../../../../utils/eventBus.cjs"),d=require("../../../../utils/i18n-util.cjs"),Q=require("../../../../utils/common-util.cjs"),X=e.defineComponent({__name:"inputtext-runtime",props:{pageContext:{},configure:{}},setup(a,{expose:R}){var D,_,O;const l=a,f=l.pageContext.entity?l.pageContext.entity:{},S=e.ref("text");let i=G.getFormModelFields(l.pageContext,l.configure);if(l.pageContext.modelFieldsMap){const o=p.getModelFieldFromPageContext(i,l.pageContext);o&&(S.value=p.isNumberDataType(o.dataType)?"number":"text")}const k=e.ref(s.isMobileBrowser()),M=l.pageContext.code,y=e.ref(i&&i.length>0?M+"__"+i.join("__"):null),m=e.ref(null),c=e.computed({get:()=>p.getVariableValue(f,i),set(o){p.setVariableValue(f,i,o),o!=null&&o!==""&&(m.value="")}}),b=e.ref(null),B=e.ref(null),N=e.ref(null),v=l.configure.runtime?l.configure.runtime:{},n=e.ref(v.props?v.props:{}),E=e.ref(!!((D=n.value.scan)!=null&&D.enable));let x=!1;s.isDingTalkEnv()&&(x=!0);let V="";V=navigator.userAgent.indexOf("Html5Plus")>0?"app":"browser";const q=!(!k.value||!V||V!=="app"),T=e.ref(!!((q||x)&&E.value||k.value&&E.value&&window.location.protocol==="https:"));let F={};(_=n.value.scan)!=null&&_.enable&&((O=n.value.scan.ruleList)==null?void 0:O.length)>0&&(I.formatScanRuleSets(n.value.scan.ruleList).then(o=>{F=o}),e.watch(()=>c.value,o=>{o=o.trim();const t=I.analysisScanValue(o,F);t&&I.setScanAnalysisValue(l.pageContext,t.scanSet,t.params)}));const $=v.style,z=v.class,J=v.headerStyle,A=v.titleExceedStyle;function h(o){return p.setVariableValue(f,i,o)}e.onMounted(()=>{P.$on(y.value+"-scanDone",o=>{y.value,JSON.stringify(o),h(o.result),u.handleFormEvent(o.result,l.pageContext,l.configure,"afterScanDone")}),e.nextTick(()=>{var t;const o=c.value;u.handleAfterInitEvent(o,l.pageContext,l.configure,{formItemRef:b.value,componentRef:B.value,titleRef:N.value,value:o,entity:l.pageContext.entity.data,pageData:l.pageContext.entity.page}),T.value&&((t=n.value.scan)!=null&&t.autoOpen)&&w()})}),e.onUnmounted(()=>{P.$off(y.value+"-scanDone")});const g=e.ref(!1);function w(){if(q||x){const o={type:"scan",componentId:y.value,systemCode:l.pageContext.systemCode};x&&(o.type="dingTalkScan"),window.parent.parent?(window.parent.parent,window.parent.parent.postMessage(JSON.stringify(o),"*")):window.parent&&(window.parent,window.parent.postMessage(JSON.stringify(o),"*"))}else if(k.value)if(window.location.protocol==="https:")g.value=!0;else{const o={type:"scan",componentId:y.value,systemCode:l.pageContext.systemCode};window.parent.postMessage(JSON.stringify(o),"*")}else g.value=!0}function L(o){g.value=!1,h(o),u.handleFormEvent(o,l.pageContext,l.configure,"afterScanDone")}return R({getValue:function(){return p.getVariableValue(f,i)},setValue:h,scanClick:w,addRequiredClass:function(){m.value=Q.addRequiredClassUtil()}}),(o,t)=>{const U=e.resolveComponent("el-input"),j=e.resolveComponent("scan-code-input-browser"),H=e.resolveComponent("el-form-item");return e.openBlock(),e.createBlock(H,{ref_key:"formItemRef",ref:b,required:!!n.value.required,class:e.normalizeClass(e.unref(z)+(m.value?" "+m.value:"")),"label-width":n.value.labelWidth,style:e.normalizeStyle(e.unref($))},e.createSlots({default:e.withCtx(()=>[e.createVNode(U,{ref_key:"componentRef",ref:B,disabled:n.value.state==="disabled",readonly:n.value.state==="readonly",size:n.value.size,clearable:n.value.clearable,placeholder:e.unref(d.$t)(n.value.placeholder),maxlength:n.value.maxLength,"show-word-limit":n.value.showInputNum,type:S.value,modelValue:c.value,"onUpdate:modelValue":t[5]||(t[5]=r=>c.value=r),onInput:t[6]||(t[6]=r=>e.unref(u.handleFormEvent)(r,a.pageContext,a.configure,"input")),onChange:t[7]||(t[7]=r=>e.unref(u.handleFormEvent)(r,a.pageContext,a.configure,"change")),onBlur:t[8]||(t[8]=r=>function(W){let C=p.getVariableValue(f,i);C!=null&&(C=C.trim()),p.setVariableValue(f,i,C),u.handleFormEvent(W,l.pageContext,l.configure,"blur")}(r)),onFocus:t[9]||(t[9]=r=>e.unref(u.handleFormEvent)(r,a.pageContext,a.configure,"focus")),onClick:t[10]||(t[10]=r=>e.unref(u.handleFormEvent)(r,a.pageContext,a.configure,"click")),onClear:t[11]||(t[11]=r=>e.unref(u.handleFormEvent)(r,a.pageContext,a.configure,"clear"))},e.createSlots({_:2},[n.value.iconPosition!="outer"&&(n.value.preIconType&&n.value.preIconValue||n.value.preText)?{name:"prefix",fn:e.withCtx(()=>[n.value.preIconType&&n.value.preIconValue?(e.openBlock(),e.createBlock(e.unref(s.SuperIcon),{key:0,style:{cursor:"pointer"},iconType:n.value.preIconType,iconValue:n.value.preIconValue,onClick:t[0]||(t[0]=r=>e.unref(u.doSuffixOrPrefixClickEvent)(c.value,a.pageContext,a.configure,"prefixClick"))},null,8,["iconType","iconValue"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(d.$t)(n.value.preText)),1)]),key:"0"}:void 0,n.value.iconPosition=="outer"&&(n.value.preIconType&&n.value.preIconValue||n.value.preText)?{name:"prepend",fn:e.withCtx(()=>[n.value.preIconType&&n.value.preIconValue?(e.openBlock(),e.createBlock(e.unref(s.SuperIcon),{key:0,style:{cursor:"pointer"},iconType:n.value.preIconType,iconValue:n.value.preIconValue,onClick:t[1]||(t[1]=r=>e.unref(u.doSuffixOrPrefixClickEvent)(c.value,a.pageContext,a.configure,"prefixClick"))},null,8,["iconType","iconValue"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(d.$t)(n.value.preText)),1)]),key:"1"}:void 0,n.value.iconPosition!="outer"&&(n.value.sufIconType&&n.value.sufIconValue||n.value.sufText)?{name:"suffix",fn:e.withCtx(()=>[n.value.sufIconType&&n.value.sufIconValue?(e.openBlock(),e.createBlock(e.unref(s.SuperIcon),{key:0,style:{cursor:"pointer"},iconType:n.value.sufIconType,iconValue:n.value.sufIconValue,onClick:t[2]||(t[2]=r=>e.unref(u.doSuffixOrPrefixClickEvent)(c.value,a.pageContext,a.configure,"suffixClick"))},null,8,["iconType","iconValue"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(d.$t)(n.value.sufText)),1)]),key:"2"}:void 0,T.value||n.value.iconPosition=="outer"&&(n.value.sufIconType&&n.value.sufIconValue||n.value.sufText)?{name:"append",fn:e.withCtx(()=>[T.value?(e.openBlock(),e.createBlock(e.unref(s.SuperIcon),{key:0,style:{cursor:"pointer"},iconValue:"fa-barcode",onClick:t[3]||(t[3]=r=>w())})):e.createCommentVNode("",!0),n.value.sufIconType&&n.value.sufIconValue?(e.openBlock(),e.createBlock(e.unref(s.SuperIcon),{key:1,style:{cursor:"pointer"},iconType:n.value.sufIconType,iconValue:n.value.sufIconValue,onClick:t[4]||(t[4]=r=>e.unref(u.doSuffixOrPrefixClickEvent)(c.value,a.pageContext,a.configure,"suffixClick"))},null,8,["iconType","iconValue"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(d.$t)(n.value.sufText)),1)]),key:"3"}:void 0]),1032,["disabled","readonly","size","clearable","placeholder","maxlength","show-word-limit","type","modelValue"]),g.value?(e.openBlock(),e.createBlock(j,{key:0,onClose:L,onCancel:t[12]||(t[12]=r=>g.value=!1)})):e.createCommentVNode("",!0)]),_:2},[n.value.tittleShow?{name:"label",fn:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"titleRef",ref:N,class:"amb-form-item-label",style:e.normalizeStyle({...e.unref(J),...e.unref(A)})},[n.value.prefixType?(e.openBlock(),e.createBlock(K,{key:0,pageContext:a.pageContext,property:n.value},null,8,["pageContext","property"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(d.$t)(n.value.title)),1)],64))],4)]),key:"0"}:void 0]),1032,["required","class","label-width","style"])}}});module.exports=X;
|