super-page-runtime 2.3.9 → 2.3.10
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/common-util.d.ts +4 -0
- package/dist/es/components/runtime/utils/common-util.js +4 -0
- package/dist/es/components/runtime/utils/events/validator-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/events/validator-util.js +121 -103
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +22 -19
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +34 -31
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +31 -28
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +35 -33
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +50 -47
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +33 -30
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +38 -35
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +18 -15
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +60 -57
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +46 -43
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +56 -53
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +59 -56
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +25 -22
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +16 -13
- package/package.json +2 -2
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, onUnmounted as n, createElementBlock as u, openBlock as o, createBlock as
|
|
1
|
+
import { defineComponent as e, ref as t, onUnmounted as n, createElementBlock as u, openBlock as o, createBlock as a, createCommentVNode as l, unref as r } from "vue";
|
|
2
2
|
import i from "./sub-table-runtime.vue.js";
|
|
3
3
|
import c from "./main-table-runtime.vue.js";
|
|
4
4
|
const f = e({ __name: "table-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: f2 }) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const T =
|
|
5
|
+
const s = e2, g = s.pageContext.pageType, d = t(null), v = s.configure.uuid, p = s.pageContext.superGridItems, S = p ? p[v] : null;
|
|
6
|
+
d.value = S ? S.configure ? JSON.parse(S.configure) : null : s.configure;
|
|
7
|
+
const T = s.configure.runtime ? s.configure.runtime : {};
|
|
8
8
|
T.style, T.class;
|
|
9
|
-
const
|
|
9
|
+
const C = t(true), b = t(null);
|
|
10
10
|
let m = null;
|
|
11
11
|
function E(e3) {
|
|
12
|
-
|
|
12
|
+
s.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES ? s.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES.push(e3) : s.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES = [e3];
|
|
13
13
|
}
|
|
14
14
|
return n(() => {
|
|
15
15
|
m && clearTimeout(m);
|
|
16
16
|
}), f2({ refresh: function(e3, t2, n2, u2) {
|
|
17
|
-
if (
|
|
17
|
+
if (g && "list" === g) return b.value.refresh(e3, t2, n2, u2);
|
|
18
18
|
}, createRow: function() {
|
|
19
|
-
return
|
|
19
|
+
return b.value.createRow();
|
|
20
20
|
}, clearSelections: function() {
|
|
21
|
-
return
|
|
21
|
+
return b.value.clearSelections();
|
|
22
22
|
}, getSelections: function() {
|
|
23
|
-
return
|
|
23
|
+
return b.value.getSelections();
|
|
24
24
|
}, getSelectionIds: function() {
|
|
25
|
-
return
|
|
25
|
+
return b.value.getSelectionIds();
|
|
26
26
|
}, getTableConfigure: function() {
|
|
27
|
-
return
|
|
27
|
+
return b.value.getTableConfigure();
|
|
28
28
|
}, isDeleteChange: function(e3) {
|
|
29
|
-
|
|
29
|
+
g && "list" === g && b.value.isDeleteChange(e3);
|
|
30
30
|
}, validatorSunTableListData: function() {
|
|
31
|
-
if (
|
|
31
|
+
if (g && "form" === g) return b.value.validatorSunTableListData();
|
|
32
32
|
}, showMobileSearch: function() {
|
|
33
|
-
|
|
33
|
+
b.value.showMobileSearch();
|
|
34
34
|
}, getTableSelectOptions: function() {
|
|
35
|
-
if (
|
|
35
|
+
if (b.value) return b.value.getTableSelectOptions();
|
|
36
36
|
}, dynamicControlTableEdit: function(e3, t2, n2) {
|
|
37
|
-
|
|
37
|
+
b.value && b.value.dynamicControlTableEdit(e3, t2, n2);
|
|
38
38
|
}, getTableUuid: function() {
|
|
39
|
-
return
|
|
39
|
+
return s.configure.uuid;
|
|
40
40
|
}, doLayout: function(e3) {
|
|
41
|
-
|
|
41
|
+
b.value && b.value.doLayout(e3);
|
|
42
42
|
}, changeOperationAddState: function(e3) {
|
|
43
|
-
|
|
43
|
+
b.value && b.value.changeOperationAddState(e3);
|
|
44
44
|
}, scrollTo: function(e3, t2) {
|
|
45
45
|
var _a;
|
|
46
|
-
(_a =
|
|
46
|
+
(_a = b.value) == null ? void 0 : _a.scrollTo(e3, t2);
|
|
47
47
|
}, setScrollTop: function(e3) {
|
|
48
48
|
var _a;
|
|
49
|
-
(_a =
|
|
49
|
+
(_a = b.value) == null ? void 0 : _a.setScrollTop(e3);
|
|
50
50
|
}, setScrollLeft: function(e3) {
|
|
51
51
|
var _a;
|
|
52
|
-
(_a =
|
|
52
|
+
(_a = b.value) == null ? void 0 : _a.setScrollLeft(e3);
|
|
53
53
|
}, getSuperGridRef: function() {
|
|
54
54
|
var _a;
|
|
55
|
-
return (_a =
|
|
55
|
+
return (_a = b.value) == null ? void 0 : _a.getSuperGridRef();
|
|
56
56
|
}, getSuperGridTableRef: function() {
|
|
57
57
|
var _a;
|
|
58
|
-
return (_a =
|
|
58
|
+
return (_a = b.value) == null ? void 0 : _a.getSuperGridTableRef();
|
|
59
59
|
}, setCurrentRowIndex: function(e3) {
|
|
60
60
|
var _a;
|
|
61
|
-
(_a =
|
|
61
|
+
(_a = b.value) == null ? void 0 : _a.setCurrentRowIndex(e3);
|
|
62
62
|
}, setScrollTopByRowIndex: function(e3) {
|
|
63
63
|
var _a;
|
|
64
|
-
(_a =
|
|
64
|
+
(_a = b.value) == null ? void 0 : _a.setScrollTopByRowIndex(e3);
|
|
65
65
|
}, reloadSubTable: function() {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
C.value = false, m = setTimeout(() => {
|
|
67
|
+
C.value = true;
|
|
68
68
|
}, 10);
|
|
69
69
|
}, getTableData: function() {
|
|
70
70
|
var _a;
|
|
71
|
-
return (_a =
|
|
72
|
-
}
|
|
71
|
+
return (_a = b.value) == null ? void 0 : _a.getTableData();
|
|
72
|
+
}, addRequiredClass: function(e3, t2, n2) {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = b.value) == null ? void 0 : _a.addRequiredClass(e3, t2, n2);
|
|
75
|
+
} }), (e3, t2) => (o(), u("div", null, [r(g) && "form" === r(g) && C.value ? (o(), a(i, { key: 0, ref_key: "gridRef", ref: b, pageContext: e3.pageContext, configure: d.value, onSetSafeDeleteTableCode: E }, null, 8, ["pageContext", "configure"])) : r(g) && "form" === r(g) ? l("", true) : (o(), a(c, { key: 1, ref_key: "gridRef", ref: b, pageContext: e3.pageContext, configure: d.value, onSetSafeDeleteTableCode: E }, null, 8, ["pageContext", "configure"]))]));
|
|
73
76
|
} });
|
|
74
77
|
export {
|
|
75
78
|
f as default
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { defineComponent as e,
|
|
2
|
-
import { setVariableValue as y, getVariableValue as x, getOptionDatasFromPage as
|
|
3
|
-
import { getFormModelFields as
|
|
4
|
-
import { handleFormEvent as
|
|
5
|
-
import { $t as
|
|
1
|
+
import { defineComponent as e, ref as t, computed as l, onMounted as o, nextTick as n, resolveComponent as a, createBlock as u, openBlock as i, normalizeStyle as r, normalizeClass as s, unref as p, withCtx as c, createVNode as f, createElementBlock as g, Fragment as v, renderList as d, createCommentVNode as m, toDisplayString as h } from "vue";
|
|
2
|
+
import { setVariableValue as y, getVariableValue as x, getOptionDatasFromPage as C, monitorFieldChange as b, autoSetAfterSelect as k, queryOptionDatasources as R } from "../../../../utils/page-helper-util.js";
|
|
3
|
+
import { getFormModelFields as _ } from "../../../../utils/page-init-util.js";
|
|
4
|
+
import { handleFormEvent as j, handleAfterInitEvent as S } from "../../../../utils/events/event-util.js";
|
|
5
|
+
import { $t as q } from "../../../../utils/i18n-util.js";
|
|
6
|
+
import { addRequiredClassUtil as I } from "../../../../utils/common-util.js";
|
|
6
7
|
const V = e({ __name: "checkbox-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: V2 }) {
|
|
7
|
-
const
|
|
8
|
-
let
|
|
9
|
-
const
|
|
10
|
-
let e3 = x(
|
|
8
|
+
const w = e2, z = t(null), D = w.pageContext.entity ? w.pageContext.entity : {};
|
|
9
|
+
let O = _(w.pageContext, w.configure);
|
|
10
|
+
const A = l({ get() {
|
|
11
|
+
let e3 = x(D, O);
|
|
11
12
|
return e3 && "string" == typeof e3 && (e3 = e3.split(",")), e3;
|
|
12
13
|
}, set(e3) {
|
|
13
|
-
e3 && e3.length > 0 && (e3 = e3.join(",")), y(
|
|
14
|
-
} }),
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
if (("dynamicData" ==
|
|
19
|
-
|
|
20
|
-
if (
|
|
14
|
+
e3 && e3.length > 0 && (e3 = e3.join(",")), y(D, O, e3), null != e3 && (z.value = "");
|
|
15
|
+
} }), M = w.configure.runtime ? w.configure.runtime : {}, P = M.style, E = M.class, F = M.headerStyle, T = M.titleExceedStyle, U = t(M.props ? M.props : {}), W = t(U.value.options ? U.value.options : []), B = C(w.pageContext, w.configure);
|
|
16
|
+
B.length > 0 && (W.value = B);
|
|
17
|
+
const G = w.configure.props && w.configure.props.dataOrigin ? w.configure.props.dataOrigin : {}, H = G.optionValueSetType;
|
|
18
|
+
let J = [];
|
|
19
|
+
if (("dynamicData" == H || "dynamicData" == H || "service" == H) && G.autoSets) for (let e3 of G.autoSets) e3.source && J.push(e3);
|
|
20
|
+
w.configure && w.configure.props && w.configure.props.base && w.configure.props.base.optionProp && J.push({ source: "label", target: w.configure.props.base.optionProp }), U.value.changeMethod = function(e3) {
|
|
21
|
+
if (J.length > -1) {
|
|
21
22
|
let t2 = null;
|
|
22
|
-
|
|
23
|
+
W.value && null != e3 && null != e3 && (t2 = W.value.filter((t3) => Array.isArray(e3) ? e3.includes(t3.value) : e3 === t3.value)), k(w.configure, w.pageContext, J, t2);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
j(e3, w.pageContext, w.configure, "change");
|
|
25
26
|
};
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const K = U.value.optionconfigInfo ? U.value.optionconfigInfo : {};
|
|
28
|
+
const L = U.value.monitorFields;
|
|
29
|
+
b(w.pageContext, L, function() {
|
|
30
|
+
R(w.pageContext, K, void 0).then((e3) => {
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
|
-
const
|
|
33
|
+
const N = t(null), Q = t(null), X = t(null);
|
|
33
34
|
return o(() => {
|
|
34
35
|
n(() => {
|
|
35
|
-
const e3 =
|
|
36
|
-
|
|
36
|
+
const e3 = A.value;
|
|
37
|
+
S(e3, w.pageContext, w.configure, { formItemRef: N.value, componentRef: Q.value, titleRef: X.value, value: e3, entity: w.pageContext.entity.data, pageData: w.pageContext.entity.page });
|
|
37
38
|
});
|
|
38
39
|
}), V2({ updateOptions: function(e3) {
|
|
39
|
-
|
|
40
|
+
W.value = e3 || [];
|
|
41
|
+
}, addRequiredClass: function() {
|
|
42
|
+
z.value = I();
|
|
40
43
|
} }), (e3, t2) => {
|
|
41
44
|
const l2 = a("el-checkbox"), o2 = a("el-checkbox-group"), n2 = a("el-form-item");
|
|
42
|
-
return i(), u(n2, { ref_key: "formItemRef", ref:
|
|
45
|
+
return i(), u(n2, { ref_key: "formItemRef", ref: N, class: s(p(E) + (z.value ? " " + z.value : "")), required: !!U.value.required, "label-width": U.value.labelWidth, style: r(p(P)) }, { label: c(() => [U.value.tittleShow ? (i(), g("div", { key: 0, ref_key: "titleRef", ref: X, style: r({ ...p(F), ...p(T) }) }, h(p(q)(U.value.title)), 5)) : m("", true)]), default: c(() => [f(o2, { ref_key: "componentRef", ref: Q, disabled: "disabled" === U.value.state, size: U.value.size, onChange: U.value.changeMethod, modelValue: A.value, "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => A.value = e4) }, { default: c(() => [(i(true), g(v, null, d(W.value, (t3) => (i(), u(l2, { key: t3.value, value: t3.value, label: t3.label, onClick: (l3) => p(j)(t3.value, e3.pageContext, e3.configure, "click", { values: A.value }) }, null, 8, ["value", "label", "onClick"]))), 128))]), _: 1 }, 8, ["disabled", "size", "onChange", "modelValue"])]), _: 1 }, 8, ["class", "required", "label-width", "style"]);
|
|
43
46
|
};
|
|
44
47
|
} });
|
|
45
48
|
export {
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import { defineComponent as e,
|
|
1
|
+
import { defineComponent as e, ref as t, computed as o, onMounted as a, nextTick as n, onUnmounted as i, resolveComponent as u, createBlock as l, createElementBlock as r, createCommentVNode as s, openBlock as p, normalizeStyle as c, normalizeClass as g, unref as m, withCtx as d, resolveDynamicComponent as f, toDisplayString as v } from "vue";
|
|
2
2
|
import { getFormModelFields as C } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { setVariableValue as x, getVariableValue as y, formatVariableValue as b, getFormPropName as h, setVariableValueWithProp as j } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { handleAfterInitEvent as R, handleEvent as k } from "../../../../utils/events/event-util.js";
|
|
5
5
|
import { updateFormItemEditState as V } from "../../../../utils/events/validator-util.js";
|
|
6
|
-
import { getListCode as _ } from "../../../../utils/common-util.js";
|
|
7
|
-
import { getComponentRef as
|
|
8
|
-
import { getAdditionalParamMap as
|
|
9
|
-
import { $t as
|
|
10
|
-
import
|
|
11
|
-
import { functions as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
x(
|
|
15
|
-
} }),
|
|
6
|
+
import { getListCode as _, addRequiredClassUtil as D } from "../../../../utils/common-util.js";
|
|
7
|
+
import { getComponentRef as E } from "../../../../utils/global-refs.js";
|
|
8
|
+
import { getAdditionalParamMap as w } from "../../../../utils/events/standard-event.js";
|
|
9
|
+
import { $t as S } from "../../../../utils/i18n-util.js";
|
|
10
|
+
import U from "../../../../utils/eventBus.js";
|
|
11
|
+
import { functions as F } from "../../../../utils/api/page-expose-util.js";
|
|
12
|
+
const q = { key: 0, style: { width: "100%", height: "100%" } }, O = { key: 1, style: { width: "100%", height: "100%" }, class: "amb-widget-richtext-single" }, $ = e({ __name: "custom-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: $2 }) {
|
|
13
|
+
const z = e2, G = t(null), H = z.pageContext.entity ? z.pageContext.entity : {}, P = C(z.pageContext, z.configure), I = o({ get: () => y(H, P), set(e3) {
|
|
14
|
+
x(H, P, e3), null != e3 && (G.value = "");
|
|
15
|
+
} }), A = z.configure.runtime ? z.configure.runtime : {}, B = A.style, W = A.class, J = A.headerStyle, K = t(A.props ? A.props : {}), L = function(e3) {
|
|
16
16
|
let t2 = {};
|
|
17
17
|
if (e3) for (let o2 in e3) {
|
|
18
18
|
const a2 = e3[o2];
|
|
19
|
-
t2[o2] = b(
|
|
19
|
+
t2[o2] = b(z.pageContext, a2);
|
|
20
20
|
}
|
|
21
21
|
return t2;
|
|
22
|
-
}(
|
|
23
|
-
function
|
|
24
|
-
j(
|
|
22
|
+
}(A.customParams ? A.customParams : {}), M = w(z.pageContext), N = t(z.configure.props && z.configure.props.base ? z.configure.props.base.name : null);
|
|
23
|
+
function Q(e3, t2) {
|
|
24
|
+
j(H, e3, t2);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function T(e3) {
|
|
27
|
+
F.isHasFieldAuthPermission(z.configure) ? V(z.pageContext, e3) : console.error("没有该字段的权限,dynamicFields=", P ? P.join(".") : "");
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const e3 =
|
|
29
|
+
function X() {
|
|
30
|
+
const e3 = z.pageContext.tableUuids;
|
|
31
31
|
e3 && e3.forEach((e4) => {
|
|
32
|
-
const t2 = _(
|
|
32
|
+
const t2 = _(z.pageContext.code, z.pageContext.version, z.configure.uuid), o2 = E(z.pageContext, e4);
|
|
33
33
|
o2 && o2.restoreGridEdit(t2);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
function
|
|
39
|
-
k(
|
|
36
|
+
z.configure.props.verification.custom && z.configure.props.verification.custom.enabled && (z.pageContext.customValidatorUuids || (z.pageContext.customValidatorUuids = []), z.pageContext.customValidatorUuids.push(z.configure.uuid));
|
|
37
|
+
const Y = z.pageContext.code, Z = t(P && P.length > 0 ? Y + "__" + P.join("__") : null), ee = t(null), te = t(null), oe = t(null);
|
|
38
|
+
function ae(e3) {
|
|
39
|
+
k(I.value, z.pageContext, z.configure, e3);
|
|
40
40
|
}
|
|
41
41
|
return a(() => {
|
|
42
|
-
|
|
42
|
+
U.$on(Z.value + "-scanDone", (e3) => {
|
|
43
43
|
const t2 = e3.result;
|
|
44
|
-
x(
|
|
45
|
-
}),
|
|
46
|
-
|
|
44
|
+
x(H, P, t2);
|
|
45
|
+
}), U.$on(Z.value + "-pickFileDone", (e3) => {
|
|
46
|
+
Z.value, ee.value.pickFileDone(e3);
|
|
47
47
|
}), n(() => {
|
|
48
|
-
const e3 =
|
|
49
|
-
R(e3,
|
|
48
|
+
const e3 = I.value;
|
|
49
|
+
R(e3, z.pageContext, z.configure, { formItemRef: te.value, componentRef: ee.value, titleRef: oe.value, value: e3, entity: z.pageContext.entity.data, pageData: z.pageContext.entity.page });
|
|
50
50
|
});
|
|
51
51
|
}), i(() => {
|
|
52
|
-
|
|
52
|
+
U.$off(Z.value + "-scanDone"), U.$off(Z.value + "-pickFileDone");
|
|
53
53
|
}), $2({ getCustomRef: function() {
|
|
54
|
-
return
|
|
54
|
+
return ee.value;
|
|
55
|
+
}, addRequiredClass: function() {
|
|
56
|
+
G.value = D();
|
|
55
57
|
} }), (e3, t2) => {
|
|
56
58
|
const o2 = u("el-form-item");
|
|
57
|
-
return
|
|
59
|
+
return K.value.tittleShow ? (p(), l(o2, { key: 0, ref_key: "formItemRef", ref: te, required: K.value.required, class: g(m(W) + (G.value ? " " + G.value : "")), "label-width": K.value.labelWidth, style: c(m(B)) }, { label: d(() => [K.value.tittleShow ? (p(), r("div", { key: 0, ref_key: "titleRef", ref: oe, style: c({ ...m(J) }) }, v(m(S)(K.value.title)), 5)) : s("", true)]), default: d(() => [N.value ? (p(), r("div", q, [(p(), l(f(N.value), { ref_key: "customRef", ref: ee, size: K.value.size, entity: e3.pageContext.entity.data, pageData: e3.pageContext.entity.page, pageContext: e3.pageContext, configureObj: e3.configure, prop: m(h)(e3.configure.props && e3.configure.props.base ? e3.configure.props.base.prop : null), "custom-params": m(L), modelValue: I.value, "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => I.value = e4), disabled: "disabled" === K.value.state, "additional-param-map": m(M), "component-id": Z.value, onSetEntityValue: Q, onSetCustomRules: T, onRestoreGridEdit: X, onHandleEvent: ae, onChange: t2[1] || (t2[1] = (t3) => m(k)(I.value, e3.pageContext, e3.configure, "change")) }, null, 40, ["size", "entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))])) : s("", true)]), _: 1 }, 8, ["required", "class", "label-width", "style"])) : N.value ? (p(), r("div", O, [(p(), l(f(N.value), { ref_key: "customRef", ref: ee, entity: e3.pageContext.entity.data, pageData: e3.pageContext.entity.page, pageContext: e3.pageContext, configureObj: e3.configure, prop: m(h)(e3.configure.props && e3.configure.props.base ? e3.configure.props.base.prop : null), "custom-params": m(L), modelValue: I.value, "onUpdate:modelValue": t2[2] || (t2[2] = (e4) => I.value = e4), disabled: "disabled" === K.value.state, "additional-param-map": m(M), "component-id": Z.value, onSetEntityValue: Q, onSetCustomRules: T, onRestoreGridEdit: X, onHandleEvent: ae, onChange: t2[3] || (t2[3] = (t3) => m(k)(I.value, e3.pageContext, e3.configure, "change")) }, null, 40, ["entity", "pageData", "pageContext", "configureObj", "prop", "custom-params", "modelValue", "disabled", "additional-param-map", "component-id"]))])) : s("", true);
|
|
58
60
|
};
|
|
59
61
|
} });
|
|
60
62
|
export {
|
package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js
CHANGED
|
@@ -3,85 +3,88 @@ import { getFormModelFields as h } from "../../../../utils/page-init-util.js";
|
|
|
3
3
|
import { getDateShortCuts as y } from "../../../../utils/form/date-shortcuts.js";
|
|
4
4
|
import { getModelFieldFromPageContext as C, getValueFromVariable as x, setVariableValue as b, getVariableValue as F, isDateDataType as k } from "../../../../utils/page-helper-util.js";
|
|
5
5
|
import { handleAfterInitEvent as T, getCustomFunc as V, handleFormEvent as j } from "../../../../utils/events/event-util.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import R from "../common/title-suffix-element.vue.js";
|
|
7
|
+
import Y from "dayjs";
|
|
8
8
|
import { $t as _ } from "../../../../utils/i18n-util.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { addRequiredClassUtil as z } from "../../../../utils/common-util.js";
|
|
10
|
+
const P = e({ __name: "datepicker-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: P2 }) {
|
|
11
|
+
const S = e2, w = a(null), q = S.pageContext.entity ? S.pageContext.entity : {}, A = S.configure.runtime ? S.configure.runtime : {}, D = A.style, $ = A.class, I = A.headerStyle, M = A.titleExceedStyle, B = a(A.props ? A.props : {});
|
|
12
|
+
let N = h(S.pageContext, S.configure, B.value.prop);
|
|
13
|
+
if (S.pageContext.modelFieldsMap && N && N.length > 0 && "data" === N[0]) {
|
|
14
|
+
const e3 = C(N, S.pageContext);
|
|
14
15
|
e3 && function(e4) {
|
|
15
16
|
const a2 = e4.dataType;
|
|
16
|
-
k(a2) && ("year" ===
|
|
17
|
+
k(a2) && ("year" === B.value.dateType && "YYYY" === B.value.valueFormat || "month" === B.value.dateType && "YYYY-MM" === B.value.valueFormat) && (B.value.valueFormat = "x");
|
|
17
18
|
}(e3);
|
|
18
19
|
}
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
let e3 =
|
|
23
|
-
e3 && e3.startsWith("${") || (e3 = "${page." +
|
|
24
|
-
const a2 = x(
|
|
25
|
-
if (e3 = e3.substring(2, e3.length - 1),
|
|
26
|
-
const e4 = x(
|
|
27
|
-
b(
|
|
20
|
+
let U = null, W = false;
|
|
21
|
+
if (B.value.dateType && B.value.dateType.includes("range")) {
|
|
22
|
+
W = true;
|
|
23
|
+
let e3 = B.value.prop2;
|
|
24
|
+
e3 && e3.startsWith("${") || (e3 = "${page." + S.configure.uuid + "-2}");
|
|
25
|
+
const a2 = x(q, e3, null);
|
|
26
|
+
if (e3 = e3.substring(2, e3.length - 1), U = e3.split("."), !(a2 || q.data && (q.data.id || q.data.ID)) && B.value.defaultValue2) {
|
|
27
|
+
const e4 = x(q, B.value.defaultValue2);
|
|
28
|
+
b(q, U, e4);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
31
|
+
const E = a(null), O = a(null), G = a(null);
|
|
32
|
+
function H(e3, a2) {
|
|
32
33
|
if (!e3) return e3;
|
|
33
34
|
if (a2) {
|
|
34
35
|
"number" != typeof e3 || isNaN(e3) || 4 !== e3.toString().length || (e3 = e3.toString());
|
|
35
36
|
try {
|
|
36
|
-
const l2 =
|
|
37
|
+
const l2 = Y(e3);
|
|
37
38
|
let t2 = null;
|
|
38
|
-
return t2 = "x" === a2 ? l2.toDate().getTime() :
|
|
39
|
+
return t2 = "x" === a2 ? l2.toDate().getTime() : Y(e3).format(a2), t2;
|
|
39
40
|
} catch (a3) {
|
|
40
|
-
return console.error("日期值格式化错误", a3), console.error(`value: ${e3} ,valueFormat: ${
|
|
41
|
+
return console.error("日期值格式化错误", a3), console.error(`value: ${e3} ,valueFormat: ${B.value.valueFormat}`), e3;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
return e3;
|
|
44
45
|
}
|
|
45
46
|
if (l(() => {
|
|
46
47
|
t(() => {
|
|
47
|
-
const e3 =
|
|
48
|
-
T(e3,
|
|
48
|
+
const e3 = J.value;
|
|
49
|
+
T(e3, S.pageContext, S.configure, { formItemRef: E.value, componentRef: O.value, titleRef: G.value, value: e3, entity: S.pageContext.entity.data, pageData: S.pageContext.entity.page });
|
|
49
50
|
});
|
|
50
|
-
}),
|
|
51
|
-
const e3 = F(
|
|
52
|
-
e3 !== a2 && b(
|
|
51
|
+
}), N) {
|
|
52
|
+
const e3 = F(q, N), a2 = H(e3, B.value.valueFormat);
|
|
53
|
+
e3 !== a2 && b(q, N, a2);
|
|
53
54
|
}
|
|
54
|
-
if (
|
|
55
|
-
const e3 = F(
|
|
56
|
-
e3 !== a2 && b(
|
|
55
|
+
if (U) {
|
|
56
|
+
const e3 = F(q, U), a2 = H(e3, B.value.valueFormat);
|
|
57
|
+
e3 !== a2 && b(q, U, a2);
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
59
|
+
const J = o({ get() {
|
|
60
|
+
if (W) {
|
|
60
61
|
const e3 = [];
|
|
61
|
-
let a2 = F(
|
|
62
|
-
e3.push(
|
|
63
|
-
let l2 = F(
|
|
64
|
-
return e3.push(
|
|
62
|
+
let a2 = F(q, N);
|
|
63
|
+
e3.push(H(a2, B.value.valueFormat));
|
|
64
|
+
let l2 = F(q, U);
|
|
65
|
+
return e3.push(H(l2, B.value.valueFormat)), e3;
|
|
65
66
|
}
|
|
66
|
-
return
|
|
67
|
+
return H(F(q, N), B.value.valueFormat);
|
|
67
68
|
}, set(e3) {
|
|
68
|
-
|
|
69
|
-
} }),
|
|
70
|
-
if (
|
|
71
|
-
const e3 = V(
|
|
69
|
+
W ? Array.isArray(e3) ? (b(q, N, e3[0]), b(q, U, e3[1]), w.value = "") : null === e3 && (b(q, N, null), b(q, U, null)) : (b(q, N, e3), null != e3 && (w.value = ""));
|
|
70
|
+
} }), K = a(y(B.value.dateScopeDetails, B.value.sourceType, B.value.dateType));
|
|
71
|
+
if (B.value.shortcutsFunc) {
|
|
72
|
+
const e3 = V(S.pageContext, B.value.shortcutsFunc);
|
|
72
73
|
if (e3) {
|
|
73
|
-
let a2 = e3.apply(e3, [{ pageContext:
|
|
74
|
+
let a2 = e3.apply(e3, [{ pageContext: S.pageContext, configureObj: S.configure }]);
|
|
74
75
|
if (a2) {
|
|
75
|
-
Array.isArray(a2) || (a2 = [a2]),
|
|
76
|
-
for (let e4 of a2) e4.text && e4.value &&
|
|
76
|
+
Array.isArray(a2) || (a2 = [a2]), K.value || (K.value = []);
|
|
77
|
+
for (let e4 of a2) e4.text && e4.value && K.value.push(e4);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
return (
|
|
81
|
+
return P2({ addRequiredClass: function() {
|
|
82
|
+
w.value = z();
|
|
83
|
+
} }), (e3, a2) => {
|
|
81
84
|
const l2 = r("el-time-picker"), t2 = r("el-date-picker"), o2 = r("el-form-item");
|
|
82
|
-
return n(), u(o2, { ref_key: "formItemRef", ref:
|
|
85
|
+
return n(), u(o2, { ref_key: "formItemRef", ref: E, required: B.value.required, class: p(s($) + (w.value ? " " + w.value : "")), "label-width": B.value.labelWidth, style: i(s(D)) }, { label: c(() => [B.value.tittleShow ? (n(), d("div", { key: 0, ref_key: "titleRef", ref: G, style: i({ ...s(I), ...s(M) }) }, [B.value.prefixType ? (n(), u(R, { key: 0, pageContext: e3.pageContext, property: B.value }, null, 8, ["pageContext", "property"])) : (n(), d(f, { key: 1 }, [g(m(s(_)(B.value.title)), 1)], 64))], 4)) : v("", true)]), default: c(() => ["time" == B.value.dateType || "timerange" == B.value.dateType ? (n(), u(l2, { key: 0, ref_key: "componentRef", ref: O, "is-range": "timerange" == B.value.dateType, style: { width: "100%" }, "range-separator": "-", clearable: B.value.clearable, disabled: "disabled" === B.value.state, readonly: "readonly" === B.value.state, size: B.value.size, placeholder: B.value.placeholder, "start-placeholder": B.value.placeholder, "end-placeholder": B.value.endPlaceholder ? B.value.endPlaceholder : B.value.placeholder, "unlink-panels": true, format: B.value.format, "value-format": B.value.valueFormat, modelValue: J.value, "onUpdate:modelValue": a2[0] || (a2[0] = (e4) => J.value = e4), shortcuts: K.value, type: B.value.dateType, onChange: a2[1] || (a2[1] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "change")), onBlur: a2[2] || (a2[2] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "blur")), onFocus: a2[3] || (a2[3] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "focus")), onVisibleChange: a2[4] || (a2[4] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "visible-change")), onPanelChange: a2[5] || (a2[5] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "panel-change")), onClear: a2[6] || (a2[6] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "clear")) }, null, 8, ["is-range", "clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "value-format", "modelValue", "shortcuts", "type"])) : (n(), u(t2, { key: 1, ref_key: "componentRef", ref: O, clearable: B.value.clearable, style: { width: "100%" }, "unlink-panels": true, disabled: "disabled" === B.value.state, readonly: "readonly" === B.value.state, size: B.value.size, placeholder: B.value.placeholder, "start-placeholder": B.value.placeholder, "end-placeholder": B.value.endPlaceholder ? B.value.endPlaceholder : B.value.placeholder, format: B.value.format, "value-format": B.value.valueFormat, modelValue: J.value, "onUpdate:modelValue": a2[7] || (a2[7] = (e4) => J.value = e4), shortcuts: K.value, type: B.value.dateType, onChange: a2[8] || (a2[8] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "change")), onBlur: a2[9] || (a2[9] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "blur")), onFocus: a2[10] || (a2[10] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "focus")), onVisibleChange: a2[11] || (a2[11] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "visible-change")), onPanelChange: a2[12] || (a2[12] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "panel-change")), onClear: a2[13] || (a2[13] = (a3) => s(j)(a3, e3.pageContext, e3.configure, "clear")) }, null, 8, ["clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "value-format", "modelValue", "shortcuts", "type"]))]), _: 1 }, 8, ["required", "class", "label-width", "style"]);
|
|
83
86
|
};
|
|
84
87
|
} });
|
|
85
88
|
export {
|
|
86
|
-
|
|
89
|
+
P as default
|
|
87
90
|
};
|
|
@@ -1,51 +1,54 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, onMounted as l, nextTick as o, computed as
|
|
1
|
+
import { defineComponent as e, ref as t, onMounted as l, nextTick as o, computed as i, watch as n, resolveComponent as p, createBlock as a, openBlock as u, normalizeStyle as r, normalizeClass as s, unref as d, withCtx as f, createVNode as c, createElementBlock as m, createCommentVNode as g, Fragment as v, createTextVNode as y, toDisplayString as x } from "vue";
|
|
2
2
|
import { getFormModelFields as C } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { handleAfterInitEvent as S, handleFormEvent as h } from "../../../../utils/events/event-util.js";
|
|
4
4
|
import F from "../common/title-suffix-element.vue.js";
|
|
5
5
|
import { $t as b } from "../../../../utils/i18n-util.js";
|
|
6
|
-
import { setVariableValue as k, getVariableValue as R, getValueFromVariable as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
T
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { setVariableValue as k, getVariableValue as R, getValueFromVariable as j } from "../../../../utils/page-helper-util.js";
|
|
7
|
+
import { addRequiredClassUtil as _ } from "../../../../utils/common-util.js";
|
|
8
|
+
const I = e({ __name: "depttree-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: I2 }) {
|
|
9
|
+
const T = e2, q = t(null), w = t([]), z = T.pageContext.entity ? T.pageContext.entity : {};
|
|
10
|
+
z.data || (z.data = {});
|
|
11
|
+
const M = z.data, O = z.page;
|
|
12
|
+
let $ = C(T.pageContext, T.configure);
|
|
13
|
+
const D = $.length > 0 ? $[$.length - 1] : T.configure.uuid, E = T.configure.runtime ? T.configure.runtime : {}, V = t(E.props ? E.props : {}), W = E.style, A = E.class, B = E.headerStyle, G = E.titleExceedStyle;
|
|
14
|
+
E.props.deptScope && ("field" == E.props.deptScope && E.props.deptScopeField ? (U(), function(e3, t2) {
|
|
14
15
|
if (0 === e3.indexOf("${fixed.")) return;
|
|
15
16
|
const l2 = e3.match(/\${(.*?)}/);
|
|
16
17
|
if (!l2) return;
|
|
17
18
|
const o2 = l2 ? l2[1].split(".") : [];
|
|
18
|
-
o2 && o2.length > 0 &&
|
|
19
|
+
o2 && o2.length > 0 && n(() => o2.reduce((e4, t3) => e4[t3], T.pageContext.entity), (e4, l3) => {
|
|
19
20
|
t2(e4, l3);
|
|
20
21
|
});
|
|
21
|
-
}(
|
|
22
|
-
|
|
23
|
-
})) : "depts" ==
|
|
24
|
-
const
|
|
22
|
+
}(E.props.deptScopeField, (e3, t2) => {
|
|
23
|
+
U();
|
|
24
|
+
})) : "depts" == E.props.deptScope && E.props.deptScopeCodes && (w.value = E.props.deptScopeCodes.split(",")));
|
|
25
|
+
const H = t(null), J = t(null), K = t(null);
|
|
25
26
|
l(() => {
|
|
26
27
|
o(() => {
|
|
27
|
-
const e3 =
|
|
28
|
-
S(e3,
|
|
28
|
+
const e3 = M ? M[D] : null;
|
|
29
|
+
S(e3, T.pageContext, T.configure, { formItemRef: H.value, componentRef: J.value, titleRef: K.value, value: e3, entity: T.pageContext.entity.data, pageData: T.pageContext.entity.page });
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
|
-
const
|
|
32
|
-
k(
|
|
33
|
-
} }),
|
|
34
|
-
function
|
|
35
|
-
e3 ===
|
|
32
|
+
const L = i({ get: () => R(z, $), set(e3) {
|
|
33
|
+
k(z, $, e3), null != e3 && (q.value = "");
|
|
34
|
+
} }), N = V.value.autoSetFields ? V.value.autoSetFields : [];
|
|
35
|
+
function P(e3, t2) {
|
|
36
|
+
e3 === D && h(t2, T.pageContext, T.configure, "change");
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
h(null,
|
|
38
|
+
function Q() {
|
|
39
|
+
h(null, T.pageContext, T.configure, "click");
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const e3 =
|
|
42
|
-
|
|
41
|
+
function U() {
|
|
42
|
+
const e3 = j(T.pageContext.entity, E.props.deptScopeField);
|
|
43
|
+
w.value = e3 ? e3.split(",") : [];
|
|
43
44
|
}
|
|
44
|
-
return (
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
return I2({ addRequiredClass: function() {
|
|
46
|
+
q.value = _();
|
|
47
|
+
} }), (e3, t2) => {
|
|
48
|
+
const l2 = p("OrganizationInput"), o2 = p("el-form-item");
|
|
49
|
+
return u(), a(o2, { ref_key: "formItemRef", ref: H, required: V.value.required, class: s(d(A) + (q.value ? " " + q.value : "")), "label-width": V.value.labelWidth, style: r(d(W)) }, { label: f(() => [V.value.tittleShow ? (u(), m("div", { key: 0, ref_key: "titleRef", ref: K, style: r({ ...d(B), ...d(G) }) }, [V.value.prefixType ? (u(), a(F, { key: 0, pageContext: e3.pageContext, property: V.value }, null, 8, ["pageContext", "property"])) : (u(), m(v, { key: 1 }, [y(x(d(b)(V.value.title)), 1)], 64))], 4)) : g("", true)]), default: f(() => [c(l2, { ref_key: "componentRef", ref: J, disabled: "disabled" == V.value.state, multiple: V.value.multiple, treeType: V.value.treeType, value: L.value, models: d(M), departmentInfo: w.value, limitFilterColumn: V.value.limitFilterColumn, pageModels: d(O), fields: d(N), size: V.value.size, separator: V.value.separator, onSetValue: P, onShowTree: Q }, null, 8, ["disabled", "multiple", "treeType", "value", "models", "departmentInfo", "limitFilterColumn", "pageModels", "fields", "size", "separator"])]), _: 1 }, 8, ["required", "class", "label-width", "style"]);
|
|
47
50
|
};
|
|
48
51
|
} });
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
I as default
|
|
51
54
|
};
|