super-page-runtime 2.3.31 → 2.3.32-cdn2
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/charts/chart-columnline-util.js +134 -119
- package/dist/es/components/runtime/utils/events/event-util.js +16 -16
- package/dist/es/components/runtime/utils/events/standard-event.js +32 -31
- package/dist/es/components/runtime/utils/page-init-util.js +36 -36
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +36 -33
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +22 -22
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page.vue2.js +1 -1
- package/dist/es/style.css +76 -76
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
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 n } from "./interfaces/page-design-types.js";
|
|
4
|
-
import { getFormPropName as i, getVariableValue as
|
|
4
|
+
import { getFormPropName as i, getVariableValue as s, formatVariableValue as r, setVariableValue as o } from "./page-helper-util.js";
|
|
5
5
|
import { getSessionCache as a } from "agilebuilder-ui/src/utils/auth";
|
|
6
6
|
import { functions as l } from "./api/page-expose-util.js";
|
|
7
|
-
import { isWorkflowPage as
|
|
7
|
+
import { isWorkflowPage as u, deepCopy as p } from "./common-util.js";
|
|
8
8
|
import { packageCustomValidator as d } from "./events/validator-util.js";
|
|
9
9
|
import { isMobileBrowser as c } from "agilebuilder-ui/src/utils/common-util";
|
|
10
10
|
function f(t2) {
|
|
@@ -24,8 +24,8 @@ function f(t2) {
|
|
|
24
24
|
}
|
|
25
25
|
function m(e2, t2) {
|
|
26
26
|
return new Promise((n2, i2) => {
|
|
27
|
-
e2 ? b().then((
|
|
28
|
-
|
|
27
|
+
e2 ? b().then((s2) => {
|
|
28
|
+
s2 && (e2.systemParam = h(s2)), e2.tableRuntimes && Object.keys(e2.tableRuntimes).length > 0 ? x(e2, t2, e2.systemVersion).then((t3) => {
|
|
29
29
|
e2.contextParam = h(t3.contextParam), e2.branchFieldAuth = t3.branchFieldAuth, e2.isWorkflowEntity = t3.isWorkflowEntity, e2.dataTypeMaps = t3.dataTypeMaps, e2.superGridItems = t3.superGrids, n2(e2);
|
|
30
30
|
}).catch((e3) => {
|
|
31
31
|
i2(e3);
|
|
@@ -60,7 +60,7 @@ function y(e2) {
|
|
|
60
60
|
if (c()) {
|
|
61
61
|
e3.entity.page._isMobile = "true";
|
|
62
62
|
const t3 = navigator ? navigator.userAgent : null;
|
|
63
|
-
t3 ? t3.indexOf("
|
|
63
|
+
t3 ? t3.indexOf("Html5Plus") > 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");
|
|
64
64
|
} else e3.entity.page._isMobile = "false";
|
|
65
65
|
}(t2), Object.assign(t2, e2), t2.isWorkflowEntity = void 0 !== ((_b = e2.props) == null ? void 0 : _b.activeWorkflow) ? (_c = e2.props) == null ? void 0 : _c.activeWorkflow : e2.isWorkflowEntity, t2.dimensions = function() {
|
|
66
66
|
const e3 = window.outerWidth;
|
|
@@ -138,27 +138,27 @@ function C(e2, t2) {
|
|
|
138
138
|
function k(e2, t2) {
|
|
139
139
|
let n2, i2 = t2;
|
|
140
140
|
t2 || (n2 = e2.props.base ? e2.props.base : {}, i2 = n2.prop);
|
|
141
|
-
let
|
|
142
|
-
return t2 && !t2.startsWith("${") ?
|
|
141
|
+
let s2 = null;
|
|
142
|
+
return t2 && !t2.startsWith("${") ? s2 = ["data", t2] : !e2 || i2 && i2.startsWith("${") ? i2.startsWith("${") ? (i2 = i2.substring(2, i2.length - 1), s2 = i2.split("."), e2 && s2.length < 2 && (s2 = [e2.uuid])) : e2 && (s2 = ["page", e2.uuid]) : s2 = ["page", e2.uuid], s2 || e2 ? s2 : ["temp"];
|
|
143
143
|
}
|
|
144
144
|
function A(e2, t2, n2) {
|
|
145
145
|
var _a, _b;
|
|
146
|
-
const i2 = k(t2, n2),
|
|
147
|
-
if (null ==
|
|
146
|
+
const i2 = k(t2, n2), r2 = e2.entity;
|
|
147
|
+
if (null == r2.data.ID && null == r2.data.id) {
|
|
148
148
|
let n3, o2, a2 = false;
|
|
149
149
|
t2 && (n3 = t2.props.base ? t2.props.base : {}, o2 = t2.name, a2 = n3.multiple);
|
|
150
|
-
const l2 =
|
|
150
|
+
const l2 = s(r2, i2);
|
|
151
151
|
if (null == l2) {
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
const t3 = T(e2,
|
|
155
|
-
if (M(t3)) I(
|
|
152
|
+
const s2 = n3 ? n3.defaultValue : null, l3 = Boolean((_a = t2 == null ? void 0 : t2.runtime) == null ? void 0 : _a.arrayValue);
|
|
153
|
+
if (s2) try {
|
|
154
|
+
const t3 = T(e2, s2, o2, a2);
|
|
155
|
+
if (M(t3)) I(r2, i2, t3, l3);
|
|
156
156
|
else if (((_b = n3.moreDefaultValue) == null ? void 0 : _b.length) > 0) {
|
|
157
157
|
const t4 = n3.moreDefaultValue;
|
|
158
158
|
for (let n4 = 0; n4 < t4.length; n4++) {
|
|
159
|
-
const
|
|
160
|
-
if (M(
|
|
161
|
-
I(
|
|
159
|
+
const s3 = T(e2, t4[n4], o2, a2);
|
|
160
|
+
if (M(s3)) {
|
|
161
|
+
I(r2, i2, s3, l3);
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -177,12 +177,12 @@ function I(e2, t2, n2, i2) {
|
|
|
177
177
|
!Array.isArray(n2) || i2 ? o(e2, t2, n2) : o(e2, t2, n2.join(","));
|
|
178
178
|
}
|
|
179
179
|
function T(e2, t2, n2, i2) {
|
|
180
|
-
let
|
|
181
|
-
if (t2 && (
|
|
180
|
+
let s2;
|
|
181
|
+
if (t2 && (s2 = r(e2, t2), null != s2 && null != s2 && n2)) {
|
|
182
182
|
let e3 = false;
|
|
183
|
-
"checkbox" == n2 ? e3 = true : "select" == n2 && (e3 = i2), e3 && (
|
|
183
|
+
"checkbox" == n2 ? e3 = true : "select" == n2 && (e3 = i2), e3 && (s2 = (s2 + "").split(","));
|
|
184
184
|
}
|
|
185
|
-
return
|
|
185
|
+
return s2;
|
|
186
186
|
}
|
|
187
187
|
function j(e2, t2) {
|
|
188
188
|
var _a, _b;
|
|
@@ -190,14 +190,14 @@ function j(e2, t2) {
|
|
|
190
190
|
const n2 = [];
|
|
191
191
|
if (e2.autoPermissions) for (const i2 of e2.autoPermissions) n2.push(t2.code + "." + i2.simpleCode);
|
|
192
192
|
if (e2.functionCodes) {
|
|
193
|
-
const i2 = e2.sourceTypes ? e2.sourceTypes : [],
|
|
194
|
-
for (let e3 = 0; e3 <
|
|
195
|
-
const
|
|
193
|
+
const i2 = e2.sourceTypes ? e2.sourceTypes : [], s2 = e2.functionCodes;
|
|
194
|
+
for (let e3 = 0; e3 < s2.length; e3++) {
|
|
195
|
+
const r2 = s2[e3], o2 = e3 < i2.length ? i2[e3] : "";
|
|
196
196
|
let a2 = "";
|
|
197
|
-
if ("service" == o2) a2 =
|
|
198
|
-
else if ("standard" === o2) a2 = t2.code + "." +
|
|
197
|
+
if ("service" == o2) a2 = r2;
|
|
198
|
+
else if ("standard" === o2) a2 = t2.code + "." + r2;
|
|
199
199
|
else {
|
|
200
|
-
a2 = "custom" === O(
|
|
200
|
+
a2 = "custom" === O(r2, t2).type ? r2 : t2.code + "." + r2;
|
|
201
201
|
}
|
|
202
202
|
n2.includes(a2) || n2.push(a2);
|
|
203
203
|
}
|
|
@@ -211,26 +211,26 @@ function O(e2, t2) {
|
|
|
211
211
|
}
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
|
-
function x(n2, i2,
|
|
215
|
-
const
|
|
214
|
+
function x(n2, i2, s2) {
|
|
215
|
+
const r2 = n2.tableRuntimes, o2 = t(i2);
|
|
216
216
|
let a2;
|
|
217
217
|
const l2 = n2.code;
|
|
218
|
-
return o2 && Object.keys(o2) > 0 && (a2 = JSON.stringify(o2)), e.post(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/super-grids", { tableRuntimes:
|
|
218
|
+
return o2 && Object.keys(o2) > 0 && (a2 = JSON.stringify(o2)), e.post(window.$vueApp.config.globalProperties.baseAPI + "/component/super-page-design/super-grids", { tableRuntimes: r2, additionalParamMapJson: a2, pageCode: l2, publishVersion: s2, pageType: n2.pageType });
|
|
219
219
|
}
|
|
220
220
|
const R = ["button-detail", "print-label"];
|
|
221
221
|
function _(e2, t2, n2) {
|
|
222
222
|
var _a, _b;
|
|
223
|
-
const
|
|
223
|
+
const s2 = t2.props && t2.props.base ? t2.props.base.prop : null, r2 = u(e2);
|
|
224
224
|
let o2 = false;
|
|
225
|
-
if (
|
|
225
|
+
if (r2 && R.indexOf(t2.name) < 0 && e2.fieldPermissionMap) {
|
|
226
226
|
const n3 = e2.fieldPermissionMap.get("all_fields");
|
|
227
227
|
false === (n3 == null ? void 0 : n3.canEdit) && ((_a = t2.runtime) == null ? void 0 : _a.props) && (t2.runtime.props.state = "disabled", o2 = true);
|
|
228
228
|
}
|
|
229
|
-
if (
|
|
230
|
-
const a2 = i(
|
|
229
|
+
if (s2) {
|
|
230
|
+
const a2 = i(s2);
|
|
231
231
|
if (e2.rules || (e2.rules = {}), t2.props.rules && t2.props.rules.length > 0 && (e2.rules[a2] || (e2.rules[a2] = []), t2.props.rules.forEach((e3) => {
|
|
232
232
|
d(e3), !n2 && e3 && e3.required && (e3.required = false);
|
|
233
|
-
}), e2.rules[a2] = t2.props.rules),
|
|
233
|
+
}), e2.rules[a2] = t2.props.rules), r2 && !o2 && "button-detail" !== t2.name && e2.fieldPermissionMap) {
|
|
234
234
|
const i2 = e2.fieldPermissionMap.get(a2);
|
|
235
235
|
if (!n2 && e2.workflowRules && (e2.workflowRules[a2] || e2.workflowRules.rules && e2.workflowRules.rules[a2])) {
|
|
236
236
|
let t3 = e2.workflowRules[a2];
|
|
@@ -255,7 +255,7 @@ function V(e2, t2) {
|
|
|
255
255
|
if (i2) if ("dynamicControlFormEdit" === n2) {
|
|
256
256
|
let n3 = i2.filter((e3) => "_all_fields" === e3.name || e3.name === t2);
|
|
257
257
|
if (n3 && n3.length > 0 && (n3 = n3.filter((e3) => "_all_fields" === e3.name), n3 && n3.length > 0)) {
|
|
258
|
-
const e3 =
|
|
258
|
+
const e3 = p(n3[0]);
|
|
259
259
|
e3.name = t2, n3 = [e3];
|
|
260
260
|
}
|
|
261
261
|
l.dynamicControlFormEdit(e2, n3, false);
|
package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { defineComponent as e, ref as l, watch as t, onMounted as
|
|
1
|
+
import { defineComponent as e, ref as l, watch as t, onMounted as o, nextTick as a, onUnmounted as i, resolveComponent as s, createBlock as r, createCommentVNode as u, openBlock as n, normalizeStyle as p, normalizeClass as d, unref as m, withCtx as v, createElementBlock as f, toDisplayString as c } from "vue";
|
|
2
2
|
import { getVariableValue as h, setVariableValue as y } from "../../../../utils/page-helper-util.js";
|
|
3
|
-
import { handleAfterInitEvent as g, fileUploadBeforeUpload as
|
|
4
|
-
import
|
|
3
|
+
import { handleAfterInitEvent as g, fileUploadBeforeUpload as w } from "../../../../utils/events/event-util.js";
|
|
4
|
+
import C from "agilebuilder-ui/src/utils/request";
|
|
5
5
|
import { FsUploadNew as b } from "agilebuilder-ui";
|
|
6
6
|
import k from "../../../../utils/eventBus.js";
|
|
7
7
|
import { $t as x } from "../../../../utils/i18n-util.js";
|
|
8
8
|
import { addRequiredClassUtil as P } from "../../../../utils/common-util.js";
|
|
9
|
-
import { getRelativeBaseUrl as
|
|
10
|
-
const
|
|
9
|
+
import { getRelativeBaseUrl as S } from "agilebuilder-ui/src/utils/common-util";
|
|
10
|
+
const N = e({ __name: "fileupload-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: N2 }) {
|
|
11
11
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
|
|
12
|
+
const T = e2, _ = l(null), j = T.configure.runtime ? T.configure.runtime : {}, z = l(j.props ? j.props : {}), R = j.style, I = j.class, D = j.headerStyle, O = j.titleExceedStyle, q = T.pageContext.entity ? T.pageContext.entity : {}, F = T.configure.props.base ? T.configure.props.base : {}, W = M(F.prop), $ = M(F.propName);
|
|
13
|
+
let A = l({});
|
|
14
|
+
A.value.isShowWatermark = void 0 === ((_b = (_a = T.configure.props) == null ? void 0 : _a.watermark) == null ? void 0 : _b.isShowWatermark) ? "true" : ((_c = T.configure.props) == null ? void 0 : _c.watermark.isShowWatermark) + "", A.value.content = ((_e = (_d = T.configure.props) == null ? void 0 : _d.watermark) == null ? void 0 : _e.content) ? (_g = (_f = T.configure.props) == null ? void 0 : _f.watermark) == null ? void 0 : _g.content : "", W && W.length > 1 && t(() => T.pageContext.entity[W[0]][W[1]], (e3) => {
|
|
15
15
|
L(h(q, W));
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const E = T.pageContext.code, U = l(W ? E + "__" + W.join("__") : null), B = h(q, W), G = l(null), H = l(false), J = l([]), K = l({});
|
|
18
18
|
function L(e3) {
|
|
19
19
|
if (e3) {
|
|
20
20
|
const l2 = e3.split(",");
|
|
21
21
|
if (l2.length > 0) {
|
|
22
|
-
const e4 =
|
|
23
|
-
|
|
22
|
+
const e4 = S(window.$vueApp.config.globalProperties.baseAPI) + "/component/fs-upload/search-file-metadata";
|
|
23
|
+
C.post(e4, l2).then((e5) => {
|
|
24
24
|
J.value = [];
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const t2 = [], o2 = {};
|
|
26
|
+
e5.forEach((e6) => {
|
|
27
|
+
o2[e6.uuid] = e6;
|
|
28
|
+
});
|
|
29
|
+
for (let e6 = 0; e6 < l2.length; e6++) {
|
|
30
|
+
const a2 = l2[e6];
|
|
31
|
+
t2.push(o2[a2].fileName), J.value.push({ showName: o2[a2].fileName, serverPath: a2, fileSize: o2[a2].fileSize });
|
|
29
32
|
}
|
|
30
|
-
"input" ===
|
|
33
|
+
"input" === z.value.displayType && (K.value.showName = t2.join(","), K.value.serverPath = l2.join(","));
|
|
31
34
|
}).finally(() => {
|
|
32
35
|
H.value = true;
|
|
33
36
|
});
|
|
@@ -38,38 +41,38 @@ const j = e({ __name: "fileupload-runtime", props: { pageContext: {}, configure:
|
|
|
38
41
|
return e3 ? (e3.startsWith("${") && (e3 = e3.substring(2, e3.length - 1)), e3.split(".")) : [];
|
|
39
42
|
}
|
|
40
43
|
function Q(e3) {
|
|
41
|
-
return
|
|
44
|
+
return w(e3);
|
|
42
45
|
}
|
|
43
|
-
L(
|
|
46
|
+
L(B);
|
|
44
47
|
const V = (e3, l2, t2) => {
|
|
45
48
|
Y();
|
|
46
49
|
}, X = (e3) => {
|
|
47
50
|
Y();
|
|
48
51
|
}, Y = () => {
|
|
49
52
|
const e3 = [], l2 = [];
|
|
50
|
-
if (
|
|
51
|
-
const e4 = J.value.length -
|
|
53
|
+
if (z.value.limit && J.value.length > z.value.limit) {
|
|
54
|
+
const e4 = J.value.length - z.value.limit;
|
|
52
55
|
for (let l3 = 0; l3 < e4; l3++) J.value.shift();
|
|
53
56
|
}
|
|
54
57
|
for (let t2 = 0; t2 < J.value.length; t2++) e3.push(J.value[t2].showName), l2.push(J.value[t2].serverPath);
|
|
55
|
-
y(
|
|
58
|
+
y(T.pageContext.entity, W, l2.join(",")), y(T.pageContext.entity, $, e3.join(",")), l2.length > 0 && (_.value = "");
|
|
56
59
|
}, Z = l(null), ee = l(null);
|
|
57
|
-
return
|
|
58
|
-
k.$on(
|
|
59
|
-
|
|
60
|
-
}),
|
|
61
|
-
const e3 = h(q, W), l2 = { showName: h(q,
|
|
62
|
-
g(l2,
|
|
60
|
+
return o(() => {
|
|
61
|
+
k.$on(U.value + "-pickFileDone", (e3) => {
|
|
62
|
+
U.value, G.value.pickFileDone(e3);
|
|
63
|
+
}), a(() => {
|
|
64
|
+
const e3 = h(q, W), l2 = { showName: h(q, $), serverPath: e3 };
|
|
65
|
+
g(l2, T.pageContext, T.configure, { formItemRef: Z.value, componentRef: G.value, titleRef: ee.value, value: l2, entity: T.pageContext.entity.data, pageData: T.pageContext.entity.page });
|
|
63
66
|
});
|
|
64
67
|
}), i(() => {
|
|
65
|
-
k.$off(
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
+
k.$off(U.value + "-pickFileDone");
|
|
69
|
+
}), N2({ addRequiredClass: function() {
|
|
70
|
+
_.value = P();
|
|
68
71
|
} }), (l2, t2) => {
|
|
69
|
-
const
|
|
70
|
-
return
|
|
72
|
+
const o2 = s("el-form-item");
|
|
73
|
+
return z.value.tittleShow ? (n(), r(o2, { key: 0, ref_key: "formItemRef", ref: Z, required: z.value.required, class: d(m(I) + (_.value ? " " + _.value : "")), "label-width": z.value.labelWidth, style: p(m(R)) }, { label: v(() => [z.value.tittleShow ? (n(), f("div", { key: 0, ref_key: "titleRef", ref: ee, style: p({ ...m(D), ...m(O) }) }, c(m(x)(z.value.title)), 5)) : u("", true)]), default: v(() => [H.value ? (n(), r(m(b), { key: 0, ref_key: "fileUploadRef", ref: G, style: { width: "100%" }, disabled: "disabled" === z.value.state, displayType: z.value.displayType, accept: z.value.accept, multiple: z.value.multiple, placeholder: z.value.placeholder, limit: z.value.limit, "limit-file-size": z.value.limitFileSize, "disabled-no-preview": z.value.disabledNoPreview, "disabled-no-download": z.value.disabledNoDownload, openCameraOrChoosePhoto: z.value.openCameraOrChoosePhoto, "sort-type": z.value.sortType, "file-info": K.value, "file-list": J.value, "system-code": e2.pageContext.systemCode, componentId: U.value, watermark: m(A), "on-success": V, "on-remove": X, "before-upload": Q, pageContext: e2.pageContext, "file-show-type": z.value.fileShowType }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "disabled-no-preview", "disabled-no-download", "openCameraOrChoosePhoto", "sort-type", "file-info", "file-list", "system-code", "componentId", "watermark", "pageContext", "file-show-type"])) : u("", true)]), _: 1 }, 8, ["required", "class", "label-width", "style"])) : H.value ? (n(), r(m(b), { key: 1, ref_key: "fileUploadRef", ref: G, style: { width: "100%" }, disabled: "disabled" === z.value.state, displayType: z.value.displayType, accept: z.value.accept, multiple: z.value.multiple, placeholder: z.value.placeholder, limit: z.value.limit, "limit-file-size": z.value.limitFileSize, "disabled-no-preview": z.value.disabledNoPreview, "disabled-no-download": z.value.disabledNoDownload, openCameraOrChoosePhoto: z.value.openCameraOrChoosePhoto, "sort-type": z.value.sortType, "file-info": K.value, "file-list": J.value, "system-code": e2.pageContext.systemCode, componentId: U.value, watermark: m(A), "on-success": V, "on-remove": X, "before-upload": Q, pageContext: e2.pageContext, "file-show-type": z.value.fileShowType }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "disabled-no-preview", "disabled-no-download", "openCameraOrChoosePhoto", "sort-type", "file-info", "file-list", "system-code", "componentId", "watermark", "pageContext", "file-show-type"])) : u("", true);
|
|
71
74
|
};
|
|
72
75
|
} });
|
|
73
76
|
export {
|
|
74
|
-
|
|
77
|
+
N as default
|
|
75
78
|
};
|
package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, computed as l, onMounted as n, nextTick as o, onUnmounted as a, watch as u, resolveComponent as i, createBlock as r, openBlock as
|
|
1
|
+
import { defineComponent as e, ref as t, computed as l, onMounted as n, nextTick as o, onUnmounted as a, watch as u, resolveComponent as i, createBlock as r, openBlock as s, normalizeStyle as p, normalizeClass as c, unref as v, withCtx as f, createVNode as y, createCommentVNode as g, createSlots as m, createTextVNode as d, toDisplayString as x, createElementBlock as C, Fragment as I } from "vue";
|
|
2
2
|
import { SuperIcon as T } from "agilebuilder-ui";
|
|
3
3
|
import { getFormModelFields as k } from "../../../../utils/page-init-util.js";
|
|
4
4
|
import { getModelFieldFromPageContext as w, isNumberDataType as V, setVariableValue as h, getVariableValue as b } from "../../../../utils/page-helper-util.js";
|
|
5
5
|
import { handleFormEvent as _, handleAfterInitEvent as S, doSuffixOrPrefixClickEvent as j } from "../../../../utils/events/event-util.js";
|
|
6
6
|
import { formatScanRuleSets as R, analysisScanValue as O, setScanAnalysisValue as N } from "../../../../utils/form/scan-util.js";
|
|
7
|
-
import
|
|
8
|
-
import { isMobileBrowser as
|
|
9
|
-
import
|
|
10
|
-
import { $t as
|
|
11
|
-
import { addRequiredClassUtil as
|
|
7
|
+
import P from "../common/title-suffix-element.vue.js";
|
|
8
|
+
import { isMobileBrowser as q } from "agilebuilder-ui/src/utils/common-util";
|
|
9
|
+
import D from "../../../../utils/eventBus.js";
|
|
10
|
+
import { $t as J } from "../../../../utils/i18n-util.js";
|
|
11
|
+
import { addRequiredClassUtil as M } from "../../../../utils/common-util.js";
|
|
12
12
|
const z = e({ __name: "inputtext-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: z2 }) {
|
|
13
13
|
var _a, _b, _c;
|
|
14
14
|
const L = e2, B = L.pageContext.entity ? L.pageContext.entity : {}, F = t("text");
|
|
@@ -17,47 +17,47 @@ const z = e({ __name: "inputtext-runtime", props: { pageContext: {}, configure:
|
|
|
17
17
|
const e3 = w($, L.pageContext);
|
|
18
18
|
e3 && (F.value = V(e3.dataType) ? "number" : "text");
|
|
19
19
|
}
|
|
20
|
-
const A = t(
|
|
21
|
-
h(B, $, e3), null != e3 && "" !== e3 && (
|
|
22
|
-
} }),
|
|
20
|
+
const A = t(q()), E = L.pageContext.code, H = t($ && $.length > 0 ? E + "__" + $.join("__") : null), U = t(null), W = l({ get: () => b(B, $), set(e3) {
|
|
21
|
+
h(B, $, e3), null != e3 && "" !== e3 && (U.value = "");
|
|
22
|
+
} }), G = t(null), K = t(null), Q = t(null), X = L.configure.runtime ? L.configure.runtime : {}, Y = t(X.props ? X.props : {}), Z = t(!!((_a = Y.value.scan) == null ? void 0 : _a.enable));
|
|
23
23
|
let ee = false;
|
|
24
24
|
const te = window.localStorage.getItem("auth_source");
|
|
25
25
|
te && "dingtalk" === te && (ee = true);
|
|
26
26
|
let le = "";
|
|
27
27
|
const ne = navigator.userAgent;
|
|
28
|
-
le = ne.indexOf("
|
|
28
|
+
le = ne.indexOf("Html5Plus") > 0 ? "app" : "browser";
|
|
29
29
|
const oe = !(!A.value || !le || "app" !== le), ae = t(!!((oe || ee) && Z.value || A.value && Z.value && "https:" === window.location.protocol));
|
|
30
30
|
let ue = {};
|
|
31
31
|
((_b = Y.value.scan) == null ? void 0 : _b.enable) && ((_c = Y.value.scan.ruleList) == null ? void 0 : _c.length) > 0 && (R(Y.value.scan.ruleList).then((e3) => {
|
|
32
32
|
ue = e3;
|
|
33
|
-
}), u(() =>
|
|
33
|
+
}), u(() => W.value, (e3) => {
|
|
34
34
|
e3 = e3.trim();
|
|
35
35
|
const t2 = O(e3, ue);
|
|
36
36
|
t2 && N(L.pageContext, t2.scanSet, t2.params);
|
|
37
37
|
}));
|
|
38
|
-
const ie = X.style, re = X.class,
|
|
38
|
+
const ie = X.style, re = X.class, se = X.headerStyle, pe = X.titleExceedStyle;
|
|
39
39
|
function ce(e3) {
|
|
40
40
|
return h(B, $, e3);
|
|
41
41
|
}
|
|
42
42
|
n(() => {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
D.$on(H.value + "-scanDone", (e3) => {
|
|
44
|
+
H.value, JSON.stringify(e3), ce(e3.result), _(e3.result, L.pageContext, L.configure, "afterScanDone");
|
|
45
45
|
}), o(() => {
|
|
46
46
|
var _a2;
|
|
47
|
-
const e3 =
|
|
48
|
-
S(e3, L.pageContext, L.configure, { formItemRef:
|
|
47
|
+
const e3 = W.value;
|
|
48
|
+
S(e3, L.pageContext, L.configure, { formItemRef: G.value, componentRef: K.value, titleRef: Q.value, value: e3, entity: L.pageContext.entity.data, pageData: L.pageContext.entity.page }), ae.value && ((_a2 = Y.value.scan) == null ? void 0 : _a2.autoOpen) && fe();
|
|
49
49
|
});
|
|
50
50
|
}), a(() => {
|
|
51
|
-
|
|
51
|
+
D.$off(H.value + "-scanDone");
|
|
52
52
|
});
|
|
53
53
|
const ve = t(false);
|
|
54
54
|
function fe() {
|
|
55
55
|
if (oe || ee) {
|
|
56
|
-
const e3 = { type: "scan", componentId:
|
|
56
|
+
const e3 = { type: "scan", componentId: H.value, systemCode: L.pageContext.systemCode };
|
|
57
57
|
ee && (e3.type = "dingTalkScan"), window.parent.parent ? (window.parent.parent, window.parent.parent.postMessage(JSON.stringify(e3), "*")) : window.parent && (window.parent, window.parent.postMessage(JSON.stringify(e3), "*"));
|
|
58
58
|
} else if (A.value) if ("https:" === window.location.protocol) ve.value = true;
|
|
59
59
|
else {
|
|
60
|
-
const e3 = { type: "scan", componentId:
|
|
60
|
+
const e3 = { type: "scan", componentId: H.value, systemCode: L.pageContext.systemCode };
|
|
61
61
|
window.parent.postMessage(JSON.stringify(e3), "*");
|
|
62
62
|
}
|
|
63
63
|
else ve.value = true;
|
|
@@ -68,13 +68,13 @@ const z = e({ __name: "inputtext-runtime", props: { pageContext: {}, configure:
|
|
|
68
68
|
return z2({ getValue: function() {
|
|
69
69
|
return b(B, $);
|
|
70
70
|
}, setValue: ce, scanClick: fe, addRequiredClass: function() {
|
|
71
|
-
|
|
71
|
+
U.value = M();
|
|
72
72
|
} }), (t2, l2) => {
|
|
73
73
|
const n2 = i("el-input"), o2 = i("scan-code-input-browser"), a2 = i("el-form-item");
|
|
74
|
-
return
|
|
74
|
+
return s(), r(a2, { ref_key: "formItemRef", ref: G, required: !!Y.value.required, class: c(v(re) + (U.value ? " " + U.value : "")), "label-width": Y.value.labelWidth, style: p(v(ie)) }, { label: f(() => [Y.value.tittleShow ? (s(), C("div", { key: 0, ref_key: "titleRef", ref: Q, style: p({ ...v(se), ...v(pe) }) }, [Y.value.prefixType ? (s(), r(P, { key: 0, pageContext: e2.pageContext, property: Y.value }, null, 8, ["pageContext", "property"])) : (s(), C(I, { key: 1 }, [d(x(v(J)(Y.value.title)), 1)], 64))], 4)) : g("", true)]), default: f(() => [y(n2, { ref_key: "componentRef", ref: K, disabled: "disabled" === Y.value.state, readonly: "readonly" === Y.value.state, size: Y.value.size, clearable: Y.value.clearable, placeholder: Y.value.placeholder, maxlength: Y.value.maxLength, "show-word-limit": Y.value.showInputNum, type: F.value, modelValue: W.value, "onUpdate:modelValue": l2[5] || (l2[5] = (e3) => W.value = e3), onInput: l2[6] || (l2[6] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "input")), onChange: l2[7] || (l2[7] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "change")), onBlur: l2[8] || (l2[8] = (e3) => function(e4) {
|
|
75
75
|
let t3 = b(B, $);
|
|
76
76
|
null != t3 && (t3 = t3.trim()), h(B, $, t3), _(e4, L.pageContext, L.configure, "blur");
|
|
77
|
-
}(e3)), onFocus: l2[9] || (l2[9] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "focus")), onClick: l2[10] || (l2[10] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "click")), onClear: l2[11] || (l2[11] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "clear")) }, m({ _: 2 }, ["outer" != Y.value.iconPosition && (Y.value.preIconType && Y.value.preIconValue || Y.value.preText) ? { name: "prefix", fn: f(() => [Y.value.preIconType && Y.value.preIconValue ? (
|
|
77
|
+
}(e3)), onFocus: l2[9] || (l2[9] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "focus")), onClick: l2[10] || (l2[10] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "click")), onClear: l2[11] || (l2[11] = (t3) => v(_)(t3, e2.pageContext, e2.configure, "clear")) }, m({ _: 2 }, ["outer" != Y.value.iconPosition && (Y.value.preIconType && Y.value.preIconValue || Y.value.preText) ? { name: "prefix", fn: f(() => [Y.value.preIconType && Y.value.preIconValue ? (s(), r(v(T), { key: 0, style: { cursor: "pointer" }, iconType: Y.value.preIconType, iconValue: Y.value.preIconValue, onClick: l2[0] || (l2[0] = (t3) => v(j)(W.value, e2.pageContext, e2.configure, "prefixClick")) }, null, 8, ["iconType", "iconValue"])) : g("", true), d(" " + x(v(J)(Y.value.preText)), 1)]), key: "0" } : void 0, "outer" == Y.value.iconPosition && (Y.value.preIconType && Y.value.preIconValue || Y.value.preText) ? { name: "prepend", fn: f(() => [Y.value.preIconType && Y.value.preIconValue ? (s(), r(v(T), { key: 0, style: { cursor: "pointer" }, iconType: Y.value.preIconType, iconValue: Y.value.preIconValue, onClick: l2[1] || (l2[1] = (t3) => v(j)(W.value, e2.pageContext, e2.configure, "prefixClick")) }, null, 8, ["iconType", "iconValue"])) : g("", true), d(" " + x(v(J)(Y.value.preText)), 1)]), key: "1" } : void 0, "outer" != Y.value.iconPosition && (Y.value.sufIconType && Y.value.sufIconValue || Y.value.sufText) ? { name: "suffix", fn: f(() => [Y.value.sufIconType && Y.value.sufIconValue ? (s(), r(v(T), { key: 0, style: { cursor: "pointer" }, iconType: Y.value.sufIconType, iconValue: Y.value.sufIconValue, onClick: l2[2] || (l2[2] = (t3) => v(j)(W.value, e2.pageContext, e2.configure, "suffixClick")) }, null, 8, ["iconType", "iconValue"])) : g("", true), d(" " + x(v(J)(Y.value.sufText)), 1)]), key: "2" } : void 0, ae.value || "outer" == Y.value.iconPosition && (Y.value.sufIconType && Y.value.sufIconValue || Y.value.sufText) ? { name: "append", fn: f(() => [ae.value ? (s(), r(v(T), { key: 0, style: { cursor: "pointer" }, iconValue: "fa-barcode", onClick: l2[3] || (l2[3] = (e3) => fe()) })) : g("", true), Y.value.sufIconType && Y.value.sufIconValue ? (s(), r(v(T), { key: 1, style: { cursor: "pointer" }, iconType: Y.value.sufIconType, iconValue: Y.value.sufIconValue, onClick: l2[4] || (l2[4] = (t3) => v(j)(W.value, e2.pageContext, e2.configure, "suffixClick")) }, null, 8, ["iconType", "iconValue"])) : g("", true), d(" " + x(v(J)(Y.value.sufText)), 1)]), key: "3" } : void 0]), 1032, ["disabled", "readonly", "size", "clearable", "placeholder", "maxlength", "show-word-limit", "type", "modelValue"]), ve.value ? (s(), r(o2, { key: 0, onClose: ye })) : g("", true)]), _: 1 }, 8, ["required", "class", "label-width", "style"]);
|
|
78
78
|
};
|
|
79
79
|
} });
|
|
80
80
|
export {
|
|
@@ -250,7 +250,7 @@ const Se = e({ __name: "super-page", props: { pageCode: { type: String, required
|
|
|
250
250
|
const a3 = e3.isNeedValueMapping;
|
|
251
251
|
l2 = e3.dataModel, o2 = e3.sourceTableName, a3 && te(la.value, n2, l2, o2, ta.value ? ta.value.valueMappings : null);
|
|
252
252
|
}
|
|
253
|
-
O(null, la.value, n2, "closePopup", { sourceModel: l2, sourceTableName: o2, jumpPageSetting: ta.value, entity: la.value.entity.data, targetTableName: u2, pageContext: na.value, parentPageContext: la.value, parentConfigureObj: n2, columnProp: i2 }), function(e4, a3, t3) {
|
|
253
|
+
O(null, la.value, n2, "closePopup", { sourceModel: l2, sourceTableName: o2, jumpPageSetting: ta.value, entity: la.value.entity.data, targetTableName: u2, pageContext: na.value, parentPageContext: la.value, parentConfigureObj: n2, columnProp: i2 }), "function" == typeof a2 ? a2.apply(a2, [{ dataModel: e3.dataModel }]) : function(e4, a3, t3) {
|
|
254
254
|
if (e4) {
|
|
255
255
|
const l3 = I(la.value, e4);
|
|
256
256
|
l3 && l3.apply(l3, [{ pageContext: na.value, parentPageContext: la.value, parentConfigureObj: t3, jumpPageSetting: ta.value, columnProp: a3 }]);
|