super-page-runtime 2.3.2 → 2.3.3-sit1
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/events/validator-util.js +94 -87
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +3 -3
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +81 -29
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +26 -26
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +38 -38
- package/dist/es/components/runtime/views/home-chart.vue.d.ts +3 -3
- package/dist/es/components/runtime/views/home-chart.vue.js +24 -22
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page.vue2.js +26 -26
- package/dist/es/i18n/langs/cn.js +1 -1
- package/dist/es/i18n/langs/en.js +1 -1
- package/dist/es/style.css +93 -84
- package/package.json +2 -2
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import e from "async-validator";
|
|
2
2
|
import { ElMessage as t } from "element-plus";
|
|
3
|
-
import { getComponentRefByCode as n, getAllComponentRefs as
|
|
3
|
+
import { getComponentRefByCode as n, getAllComponentRefs as s, getComponentRef as r } from "../global-refs.js";
|
|
4
4
|
import { getI18n as i } from "agilebuilder-ui/src/utils/util";
|
|
5
5
|
import { getAdditionalParamMap as l } from "./standard-event.js";
|
|
6
6
|
import { isPromise as o } from "agilebuilder-ui/src/utils/common-util";
|
|
7
7
|
import { getListCode as a, isWorkflowPage as u } from "../common-util.js";
|
|
8
8
|
function f(e2, t2, n2) {
|
|
9
|
-
const
|
|
9
|
+
const s2 = {};
|
|
10
10
|
t2 || (t2 = {});
|
|
11
|
-
let
|
|
11
|
+
let r2 = 0;
|
|
12
12
|
const i2 = e2.split(".");
|
|
13
13
|
return i2.forEach((e3) => {
|
|
14
14
|
let l2;
|
|
15
|
-
if (
|
|
16
|
-
let
|
|
17
|
-
for (let
|
|
18
|
-
if (t3[
|
|
15
|
+
if (r2 === i2.length - 1) l2 = function(e4, t3, n3) {
|
|
16
|
+
let s3;
|
|
17
|
+
for (let r3 = 0; r3 < t3.length; r3++) if (s3 = 0 === r3 ? e4[t3[r3]] : s3.fields[t3[r3]], r3 !== t3.length - 1) {
|
|
18
|
+
if (t3[r3 + 1] === n3) break;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
21
|
-
}(
|
|
20
|
+
return s3;
|
|
21
|
+
}(s2, i2, e3), l2.fields[e3] = n2;
|
|
22
22
|
else {
|
|
23
23
|
let n3;
|
|
24
|
-
0 ===
|
|
25
|
-
let
|
|
26
|
-
for (let
|
|
27
|
-
const i3 = t3[
|
|
28
|
-
if (
|
|
24
|
+
0 === r2 ? l2 = t2 : (n3 = function(e4, t3, n4) {
|
|
25
|
+
let s3;
|
|
26
|
+
for (let r3 = 0; r3 < t3.length; r3++) {
|
|
27
|
+
const i3 = t3[r3];
|
|
28
|
+
if (s3 = 0 === r3 ? e4[i3] : s3.fields[t3[r3]], i3 === n4) break;
|
|
29
29
|
}
|
|
30
|
-
return
|
|
31
|
-
}(
|
|
30
|
+
return s3;
|
|
31
|
+
}(s2, i2, i2[r2 - 1]), l2 = n3.fields), l2[e3] || (l2[e3] = { type: "object", required: true, fields: {} }), 0 === r2 ? s2[e3] = l2[e3] : n3.fields[e3] = l2[e3];
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
}),
|
|
33
|
+
r2++;
|
|
34
|
+
}), s2;
|
|
35
35
|
}
|
|
36
|
-
function c(e2, t2, n2,
|
|
37
|
-
return d(e2, t2, n2,
|
|
36
|
+
function c(e2, t2, n2, s2, r2) {
|
|
37
|
+
return d(e2, t2, n2, s2, true);
|
|
38
38
|
}
|
|
39
39
|
function m(e2) {
|
|
40
40
|
if (e2) return Object.keys(e2).forEach((t2) => {
|
|
@@ -44,67 +44,67 @@ function m(e2) {
|
|
|
44
44
|
}
|
|
45
45
|
}), e2;
|
|
46
46
|
}
|
|
47
|
-
function d(n2,
|
|
48
|
-
let a2, u2 = m(
|
|
49
|
-
if (
|
|
47
|
+
function d(n2, s2, r2, i2, l2, o2) {
|
|
48
|
+
let a2, u2 = m(s2);
|
|
49
|
+
if (s2 && null !== s2 || !r2 || (u2 = {}), !u2 || 0 === Object.keys(u2).length) return n2.validateErrorField = "", true;
|
|
50
50
|
return new e(u2).validate(n2, { first: true }, (e2, o3) => {
|
|
51
51
|
let u3;
|
|
52
52
|
if (e2 ? (a2 = e2[0].message, u3 = e2[0].field, t({ message: a2, showClose: true, type: "warning", duration: 3e3 })) : a2 = true, u3 && true === l2) {
|
|
53
53
|
if (/[A-Z]+/.test(u3) && void 0 !== n2[u3.toLowerCase()]) {
|
|
54
54
|
const e3 = JSON.parse(JSON.stringify(n2));
|
|
55
|
-
e3[u3.toUpperCase()] = n2[u3.toLowerCase()], delete e3[u3.toLowerCase()], a2 = d(e3,
|
|
55
|
+
e3[u3.toUpperCase()] = n2[u3.toLowerCase()], delete e3[u3.toLowerCase()], a2 = d(e3, s2, r2, i2, false);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}), a2;
|
|
59
59
|
}
|
|
60
|
-
function p(e2, n2,
|
|
61
|
-
const
|
|
62
|
-
return null != f2 && (
|
|
60
|
+
function p(e2, n2, s2) {
|
|
61
|
+
const r2 = e2.entity.data, o2 = { ...e2.entity.page, ...r2 }, a2 = e2.rules, f2 = n2.props.base ? n2.props.base.isEnableRequired : null;
|
|
62
|
+
return null != f2 && (s2 = f2), null == s2 && (s2 = false), function(e3, n3, s3, r3) {
|
|
63
63
|
if (e3) {
|
|
64
|
-
return u(
|
|
65
|
-
return new Promise((
|
|
64
|
+
return u(r3) ? function(e4, n4, s4) {
|
|
65
|
+
return new Promise((r4, o3) => {
|
|
66
66
|
const a3 = l(n4), u2 = n4.entity.context, f3 = n4.entity.task, c2 = true, m2 = n4.subTablePageInfo;
|
|
67
|
-
b(e4, n4,
|
|
68
|
-
if (
|
|
69
|
-
let i2 =
|
|
67
|
+
b(e4, n4, s4).then((s5) => {
|
|
68
|
+
if (s5) {
|
|
69
|
+
let i2 = s5;
|
|
70
70
|
const l2 = n4.workflowRules;
|
|
71
|
-
i2 = !l2 || window.$vueApp.config.globalProperties.$formValidator(e4, l2, c2, a3, f3, u2, m2), true !== i2 ? (t({ showClose: true, message: i2 + "", type: "warning" }),
|
|
71
|
+
i2 = !l2 || window.$vueApp.config.globalProperties.$formValidator(e4, l2, c2, a3, f3, u2, m2), true !== i2 ? (t({ showClose: true, message: i2 + "", type: "warning" }), r4(false)) : (Object.keys(e4).indexOf("validateErrorField") >= 0 && delete e4.validateErrorField, r4(e4));
|
|
72
72
|
} else o3(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
|
|
73
73
|
}).catch((e5) => {
|
|
74
74
|
o3(e5);
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
-
}(n3,
|
|
78
|
-
return new Promise((
|
|
77
|
+
}(n3, r3, s3) : function(e4, t2, n4) {
|
|
78
|
+
return new Promise((s4, r4) => {
|
|
79
79
|
b(e4, t2, n4).then((t3) => {
|
|
80
80
|
if (t3) {
|
|
81
81
|
const t4 = JSON.parse(JSON.stringify(e4));
|
|
82
|
-
Object.keys(t4).indexOf("validateErrorField") >= 0 && delete t4.validateErrorField,
|
|
83
|
-
} else
|
|
82
|
+
Object.keys(t4).indexOf("validateErrorField") >= 0 && delete t4.validateErrorField, s4(t4);
|
|
83
|
+
} else s4(false);
|
|
84
84
|
}).catch((e5) => {
|
|
85
|
-
|
|
85
|
+
r4(e5);
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
|
-
}(n3,
|
|
88
|
+
}(n3, r3, s3);
|
|
89
89
|
}
|
|
90
90
|
return new Promise((e4, t2) => {
|
|
91
91
|
e4(true);
|
|
92
92
|
});
|
|
93
|
-
}(
|
|
93
|
+
}(s2, o2, a2, e2);
|
|
94
94
|
}
|
|
95
95
|
function g(e2) {
|
|
96
96
|
return new Promise((t2, n2) => {
|
|
97
|
-
const
|
|
97
|
+
const s2 = [], i2 = e2.customValidatorUuids;
|
|
98
98
|
i2 && i2.forEach((t3) => {
|
|
99
|
-
const n3 =
|
|
100
|
-
n3 && n3.validator &&
|
|
101
|
-
}),
|
|
99
|
+
const n3 = r(e2, t3);
|
|
100
|
+
n3 && n3.validator && s2.push(n3.validator());
|
|
101
|
+
}), s2 && s2.length > 0 ? Promise.all(s2).then((e3) => {
|
|
102
102
|
e3.includes(false) ? t2(false) : t2(true);
|
|
103
103
|
}) : t2(true);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function b(e2, t2, n2) {
|
|
107
|
-
return new Promise((
|
|
107
|
+
return new Promise((s2, l2) => {
|
|
108
108
|
const a2 = JSON.parse(JSON.stringify(e2));
|
|
109
109
|
if (n2 && 0 !== Object.keys(n2).length) {
|
|
110
110
|
if (true === c(a2, n2, null, null)) {
|
|
@@ -113,7 +113,7 @@ function b(e2, t2, n2) {
|
|
|
113
113
|
const t3 = e4.tableUuids;
|
|
114
114
|
if (!t3) return true;
|
|
115
115
|
for (let n3 = 0; n3 < t3.length; n3++) {
|
|
116
|
-
const
|
|
116
|
+
const s3 = t3[n3], i2 = r(e4, s3);
|
|
117
117
|
if (i2) {
|
|
118
118
|
if (!i2.validatorSunTableListData()) return false;
|
|
119
119
|
}
|
|
@@ -124,16 +124,16 @@ function b(e2, t2, n2) {
|
|
|
124
124
|
const e4 = function(e5) {
|
|
125
125
|
const t3 = [];
|
|
126
126
|
e5.customRuleEvents && e5.customRuleEvents.length > 0 && e5.customRuleEvents.forEach((n3) => {
|
|
127
|
-
n3.events.forEach((
|
|
128
|
-
const
|
|
129
|
-
t3.push(
|
|
127
|
+
n3.events.forEach((s3) => {
|
|
128
|
+
const r2 = e5.customEvents[s3];
|
|
129
|
+
t3.push(r2.apply(r2, [{ prop: n3.prop, pageContext: e5 }]));
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
if (t3 && t3.length > 0) return new Promise((e6, n3) => {
|
|
133
|
-
const
|
|
133
|
+
const s3 = [], r2 = [];
|
|
134
134
|
t3.forEach((e7) => {
|
|
135
|
-
o(e7) ?
|
|
136
|
-
}),
|
|
135
|
+
o(e7) ? s3.push(e7) : r2.push(e7);
|
|
136
|
+
}), r2.includes(false) && e6(false), s3.length > 0 ? Promise.all(s3).then((t4) => {
|
|
137
137
|
t4.includes(false) ? e6(false) : e6(true);
|
|
138
138
|
}).catch((t4) => {
|
|
139
139
|
e6(false);
|
|
@@ -143,39 +143,39 @@ function b(e2, t2, n2) {
|
|
|
143
143
|
}(t2);
|
|
144
144
|
e4 && o(e4) ? e4.then((e5) => {
|
|
145
145
|
e5 ? g(t2).then((e6) => {
|
|
146
|
-
|
|
147
|
-
}) :
|
|
146
|
+
s2(e6);
|
|
147
|
+
}) : s2(false);
|
|
148
148
|
}) : g(t2).then((e5) => {
|
|
149
|
-
|
|
149
|
+
s2(e5);
|
|
150
150
|
});
|
|
151
151
|
} else l2(new Error(i().t("superPageRuntimeMessage.tableListSubTableDataVerificationFailed")).message);
|
|
152
152
|
} else l2(new Error(i().t("superPageRuntimeMessage.formDataVerificationFailed")).message);
|
|
153
|
-
} else
|
|
153
|
+
} else s2(true);
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
function h(e2, t2) {
|
|
157
157
|
if (!e2) return t2;
|
|
158
158
|
t2 || (t2 = {});
|
|
159
|
-
const n2 = Object.keys(e2),
|
|
159
|
+
const n2 = Object.keys(e2), s2 = e2;
|
|
160
160
|
return n2.forEach((e3) => {
|
|
161
161
|
if ("__subRules" === e3) {
|
|
162
|
-
const e4 =
|
|
162
|
+
const e4 = s2.__subRules;
|
|
163
163
|
Object.keys(e4).forEach((n3) => {
|
|
164
164
|
t2.subRules || (t2.subRules = {}), t2.subRules[n3] ? Object.assign(t2.subRules[n3], e4[n3]) : t2.subRules[n3] = e4[n3];
|
|
165
165
|
});
|
|
166
|
-
} else j(
|
|
166
|
+
} else j(s2[e3]), t2[e3] = s2[e3];
|
|
167
167
|
}), m(t2);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function w(e2) {
|
|
170
170
|
if (!e2 || 0 === Object.keys(e2).length) return;
|
|
171
171
|
const t2 = {}, n2 = Object.keys(e2);
|
|
172
|
-
for (let
|
|
173
|
-
const
|
|
174
|
-
|
|
172
|
+
for (let s2 = 0; s2 < n2.length; s2++) {
|
|
173
|
+
const r2 = n2[s2], i2 = e2[r2];
|
|
174
|
+
y(i2), r2.indexOf(".") > 0 ? f(r2, t2, i2) : i2 && i2.length > 0 && (t2[r2] = [...i2]);
|
|
175
175
|
}
|
|
176
176
|
return t2;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function y(e2, t2) {
|
|
179
179
|
e2.forEach((e3) => {
|
|
180
180
|
e3.message;
|
|
181
181
|
const t3 = e3.label, n2 = i().t(t3);
|
|
@@ -183,48 +183,55 @@ function w(e2, t2) {
|
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
function v(e2) {
|
|
186
|
-
const t2 = e2.entity.data, n2 = { ...e2.entity.page, ...t2 },
|
|
186
|
+
const t2 = e2.entity.data, n2 = { ...e2.entity.page, ...t2 }, s2 = l(e2), r2 = e2.entity.context, i2 = e2.entity.task;
|
|
187
187
|
e2.formPropTiltleMap && Object.keys(e2.formPropTiltleMap).length > 0 && e2.completeTaskParam.fieldPermissions && e2.completeTaskParam.fieldPermissions.length > 0 && e2.completeTaskParam.fieldPermissions.forEach((t3) => {
|
|
188
188
|
t3.name && e2.formPropTiltleMap[t3.name] && (t3.label = e2.formPropTiltleMap[t3.name]);
|
|
189
189
|
});
|
|
190
|
-
let o2 = window.$vueApp.config.globalProperties.$getValidator(e2.completeTaskParam.fieldPermissions, n2, true,
|
|
190
|
+
let o2 = window.$vueApp.config.globalProperties.$getValidator(e2.completeTaskParam.fieldPermissions, n2, true, s2, i2, r2);
|
|
191
191
|
return o2 = h(e2.customRules, o2), o2;
|
|
192
192
|
}
|
|
193
193
|
function P(e2, t2) {
|
|
194
194
|
if (!t2) return;
|
|
195
|
-
const
|
|
195
|
+
const s2 = {};
|
|
196
196
|
t2.forEach((e3) => {
|
|
197
197
|
const { name: t3, rules: n2 } = e3;
|
|
198
|
-
n2 && (
|
|
198
|
+
n2 && (s2[t3] = n2);
|
|
199
199
|
});
|
|
200
|
-
let
|
|
201
|
-
|
|
200
|
+
let r2 = e2.rules ? e2.rules : {};
|
|
201
|
+
r2 = h(s2, r2), e2.rules = r2;
|
|
202
202
|
let i2 = e2.workflowRules ? e2.workflowRules : {};
|
|
203
|
-
i2 = h(
|
|
203
|
+
i2 = h(s2, i2), e2.workflowRules = i2;
|
|
204
204
|
const l2 = t2.filter((e3) => "_all_fields" === e3.name);
|
|
205
|
-
l2 && l2.length > 0 &&
|
|
205
|
+
l2 && l2.length > 0 && E(e2, l2[0]), t2.forEach((t3) => {
|
|
206
206
|
if ("_all_fields" !== t3.name) {
|
|
207
|
-
|
|
207
|
+
O(n(e2, t3.name), t3);
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
|
|
211
|
+
function R(e2) {
|
|
212
|
+
E(e2, { disabled: true });
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
const n2 =
|
|
214
|
+
function E(e2, t2) {
|
|
215
|
+
const n2 = s(e2);
|
|
216
216
|
if (n2) for (const e3 in n2) {
|
|
217
|
-
const
|
|
218
|
-
|
|
217
|
+
const s2 = n2[e3];
|
|
218
|
+
O(s2 ? s2.value : s2, t2);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function k(e2, t2, s2) {
|
|
222
|
+
var _a;
|
|
222
223
|
let i2, l2;
|
|
223
|
-
if (
|
|
224
|
+
if (s2 ? (i2 = n(e2, s2), l2 = i2 ? i2.getTableUuid() : null) : (l2 = e2.tableUuids && e2.tableUuids.length > 0 ? e2.tableUuids[0] : null, i2 = l2 ? r(e2, l2) : null), !i2) return;
|
|
224
225
|
const o2 = e2.code, u2 = e2.version, f2 = a(o2, u2, l2);
|
|
226
|
+
if (((_a = e2.workflowRules) == null ? void 0 : _a.subRules) && e2.workflowRules.subRules[s2]) {
|
|
227
|
+
const n2 = e2.workflowRules.subRules[s2];
|
|
228
|
+
t2.forEach((e3) => {
|
|
229
|
+
n2[e3.name] = e3;
|
|
230
|
+
});
|
|
231
|
+
}
|
|
225
232
|
i2.dynamicControlTableEdit(e2, t2, f2);
|
|
226
233
|
}
|
|
227
|
-
function
|
|
234
|
+
function O(e2, t2) {
|
|
228
235
|
var _a, _b, _c;
|
|
229
236
|
if (e2) {
|
|
230
237
|
const n2 = e2.getConfigure();
|
|
@@ -243,15 +250,15 @@ function j(e2) {
|
|
|
243
250
|
});
|
|
244
251
|
}
|
|
245
252
|
export {
|
|
246
|
-
|
|
247
|
-
|
|
253
|
+
R as disabledAllFields,
|
|
254
|
+
k as dynamicControlTableEdit,
|
|
248
255
|
v as getWorkflowRules,
|
|
249
|
-
|
|
250
|
-
|
|
256
|
+
y as i18nValidatePropRulesMessage,
|
|
257
|
+
w as i18nValidateRulesMessage,
|
|
251
258
|
h as packageCustomRules,
|
|
252
259
|
j as packageCustomValidator,
|
|
253
260
|
f as setObjectPropRule,
|
|
254
|
-
|
|
261
|
+
O as updateComponentDisplayState,
|
|
255
262
|
P as updateFormItemEditState,
|
|
256
263
|
p as validateDataModelFunc,
|
|
257
264
|
c as validator
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./tabs-runtime.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const r = e
|
|
3
|
+
import t from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = t(e, [["__scopeId", "data-v-df9efce2"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,44 +1,96 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t,
|
|
2
|
-
import { ElTabs as
|
|
3
|
-
import
|
|
4
|
-
import { SuperIcon as
|
|
5
|
-
import { handleAfterInitEvent as
|
|
6
|
-
import { $t as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { defineComponent as e, ref as t, watch as n, onMounted as o, nextTick as a, resolveComponent as i, createBlock as c, openBlock as u, unref as l, normalizeClass as r, normalizeStyle as s, withCtx as p, createElementBlock as f, createCommentVNode as g, Fragment as d, renderList as m, createElementVNode as b, toDisplayString as y, withModifiers as v, createTextVNode as h } from "vue";
|
|
2
|
+
import { ElTabs as x, ElTabPane as C } from "element-plus";
|
|
3
|
+
import T from "../../object-render.vue.js";
|
|
4
|
+
import { SuperIcon as E } from "agilebuilder-ui";
|
|
5
|
+
import { handleAfterInitEvent as k, handleEvent as N } from "../../../../utils/events/event-util.js";
|
|
6
|
+
import { $t as V } from "../../../../utils/i18n-util.js";
|
|
7
|
+
import { isPromise as _ } from "../../../../utils/page-helper-util.js";
|
|
8
|
+
const A = e({ __name: "tabs-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: A2 }) {
|
|
9
|
+
const P = e2, j = t(""), w = t([]);
|
|
10
|
+
P.configure.items.forEach((e3) => {
|
|
11
|
+
e3.code || (e3.code = e3.index);
|
|
12
|
+
}), j.value = P.configure.props.defaultOpen ? P.configure.props.defaultOpen : 1;
|
|
13
|
+
const O = t(null), R = P.configure.runtime ? P.configure.runtime : {}, B = R.style, z = R.class, I = R.headerStyle;
|
|
14
|
+
function S(e3, t2) {
|
|
15
|
+
return N(e3, P.pageContext, P.configure, "before-leave", { activeName: e3, oldActiveName: t2 }) ?? true;
|
|
13
16
|
}
|
|
14
17
|
function D(e3, t2) {
|
|
15
18
|
const n2 = { pane: e3, ev: t2 }, o2 = e3.paneName;
|
|
16
|
-
return
|
|
19
|
+
return P.pageContext.activeTab = o2, P.pageContext.activeLabel = n2.label, N(o2, P.pageContext, P.configure, "tab-click", n2);
|
|
17
20
|
}
|
|
18
|
-
function
|
|
21
|
+
function F(e3) {
|
|
19
22
|
const t2 = { paneName: e3 };
|
|
20
|
-
return
|
|
23
|
+
return P.pageContext.activeTab = e3, N(e3, P.pageContext, P.configure, "tab-change", t2);
|
|
21
24
|
}
|
|
22
|
-
function
|
|
23
|
-
const t2 = { paneName: e3 };
|
|
24
|
-
|
|
25
|
+
function L(e3) {
|
|
26
|
+
const t2 = { paneName: e3 }, n2 = N(e3, P.pageContext, P.configure, "tab-remove", t2);
|
|
27
|
+
_(n2) ? n2.then((t3) => {
|
|
28
|
+
false !== t3 && U(e3);
|
|
29
|
+
}) : false !== n2 && U(e3);
|
|
30
|
+
}
|
|
31
|
+
function U(e3) {
|
|
32
|
+
j.value === e3 && P.configure.items.forEach((t2, n2) => {
|
|
33
|
+
if (t2.code === e3) {
|
|
34
|
+
const e4 = P.configure.items[n2 + 1] || P.configure.items[n2 - 1];
|
|
35
|
+
e4 && void 0 !== e4.code && (j.value = e4.code);
|
|
36
|
+
}
|
|
37
|
+
}), w.value.includes(e3) || w.value.push(e3);
|
|
25
38
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
39
|
+
function q() {
|
|
40
|
+
return N(null, P.pageContext, P.configure, "tab-add");
|
|
28
41
|
}
|
|
29
|
-
function
|
|
42
|
+
function G(e3, t2) {
|
|
30
43
|
const n2 = { paneName: e3, action: t2 };
|
|
31
|
-
return
|
|
44
|
+
return N(e3, P.pageContext, P.configure, "edit", n2);
|
|
45
|
+
}
|
|
46
|
+
function H() {
|
|
47
|
+
const e3 = N(P.configure.items, P.pageContext, P.configure, "tab-reset");
|
|
48
|
+
_(e3) ? e3.then((e4) => {
|
|
49
|
+
w.value = [];
|
|
50
|
+
}) : false !== e3 && (w.value = []);
|
|
32
51
|
}
|
|
33
|
-
return n(() => {
|
|
34
|
-
|
|
52
|
+
return n(w, (e3) => {
|
|
53
|
+
e3 && e3.length > 0 ? e3.forEach((e4) => {
|
|
54
|
+
const t2 = document.getElementById("tab-" + e4);
|
|
55
|
+
t2 && (t2.style.display = "none");
|
|
56
|
+
}) : P.configure.items.forEach((e4) => {
|
|
57
|
+
const t2 = document.getElementById("tab-" + e4.code);
|
|
58
|
+
t2 && (t2.style.display = "");
|
|
59
|
+
});
|
|
60
|
+
}, { deep: true }), o(() => {
|
|
61
|
+
a(() => {
|
|
35
62
|
let e3 = [];
|
|
36
|
-
|
|
37
|
-
t2.code && e3.push(document.
|
|
38
|
-
}),
|
|
63
|
+
P.configure.items.forEach((t2) => {
|
|
64
|
+
t2.code && e3.push(document.getElementById("tab-" + t2.code));
|
|
65
|
+
}), k(null, P.pageContext, P.configure, { componentRef: O.value, tabsDom: e3, entity: P.pageContext.entity.data, pageData: P.pageContext.entity.page });
|
|
66
|
+
});
|
|
67
|
+
}), A2({ thisRef: O, activeName: j, hiddenPanes: w, resetTab: H, hiddenTabPanes: function(e3) {
|
|
68
|
+
if (Array.isArray(e3)) {
|
|
69
|
+
const t2 = [];
|
|
70
|
+
e3.forEach((e4) => {
|
|
71
|
+
w.value.includes(e4) || t2.push(e4);
|
|
72
|
+
}), t2.length > 0 && w.value.push(...t2);
|
|
73
|
+
}
|
|
74
|
+
}, showTabPanes: function(e3) {
|
|
75
|
+
Array.isArray(e3) && e3.forEach((e4) => {
|
|
76
|
+
const t2 = w.value.indexOf(e4);
|
|
77
|
+
t2 > -1 && w.value.splice(t2, 1);
|
|
39
78
|
});
|
|
40
|
-
}
|
|
79
|
+
}, showTabPanesOnly: function(e3) {
|
|
80
|
+
const t2 = [];
|
|
81
|
+
P.configure.items.forEach((n2) => {
|
|
82
|
+
e3.includes(n2.code) || t2.push(n2.code);
|
|
83
|
+
}), w.value = [...new Set(t2)];
|
|
84
|
+
}, hiddenTabPanesOnly: function(e3) {
|
|
85
|
+
const t2 = [];
|
|
86
|
+
P.configure.items.forEach((n2) => {
|
|
87
|
+
e3.includes(n2.code) && t2.push(n2.code);
|
|
88
|
+
}), w.value = [...new Set(t2)];
|
|
89
|
+
} }), (e3, t2) => {
|
|
90
|
+
const n2 = i("el-button");
|
|
91
|
+
return u(), c(l(x), { ref_key: "thisRef", ref: O, modelValue: j.value, "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => j.value = e4), type: e3.configure.props.cardType, "tab-position": e3.configure.props.tabPosition, style: s(l(B)), class: r([l(z), "runtime-page-container-tabs-view"]), closable: e3.configure.props.closable, "before-leave": S, onTabClick: D, onTabChange: F, onTabRemove: L, onTabAdd: q, onEdit: G }, { default: p(() => [(u(true), f(d, null, m(P.configure.items, (t3, n3) => (u(), c(l(C), { key: n3, label: t3.label, name: t3.code, lazy: !!e3.configure.props.lazy }, { label: p(() => [t3.iconType && t3.iconValue ? (u(), c(l(E), { key: 0, iconType: t3.iconType, iconValue: t3.iconValue, style: { "margin-right": "2px" } }, null, 8, ["iconType", "iconValue"])) : g("", true), b("span", { style: s(l(I)) }, y(l(V)(t3.label)), 5)]), default: p(() => [(e3.configure.props.isFullyRendered ?? 1) || t3.code === j.value ? (u(true), f(d, { key: 0 }, m(t3.items, (t4) => (u(), c(T, { key: t4.uuid, pageContext: e3.pageContext, configure: t4 }, null, 8, ["pageContext", "configure"]))), 128)) : g("", true)]), _: 2 }, 1032, ["label", "name", "lazy"]))), 128)), e3.configure.props.resetable ? (u(), c(l(C), { key: 0, disabled: "", name: "-1" }, { label: p(() => [e3.configure.props.resetable ? (u(), c(n2, { key: 0, type: "text", circle: "", onClick: v(H, ["stop"]) }, { default: p(() => [h(y(e3.configure.props.resetButtonName || "重置"), 1)]), _: 1 })) : g("", true)]), _: 1 })) : g("", true)]), _: 1 }, 8, ["modelValue", "type", "tab-position", "style", "class", "closable"]);
|
|
92
|
+
};
|
|
41
93
|
} });
|
|
42
94
|
export {
|
|
43
|
-
|
|
95
|
+
A as default
|
|
44
96
|
};
|
package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
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 a, nextTick as o, onUnmounted as i, resolveComponent as u, createBlock as s, createCommentVNode as n, openBlock as p, normalizeStyle as r, normalizeClass as v, unref as m, withCtx as d, 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
|
|
5
|
-
import { FsUploadNew as
|
|
6
|
-
import
|
|
7
|
-
import { $t as
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
A(h(
|
|
3
|
+
import { handleAfterInitEvent as g, fileUploadBeforeUpload as b } from "../../../../utils/events/event-util.js";
|
|
4
|
+
import C from "agilebuilder-ui/src/utils/request";
|
|
5
|
+
import { FsUploadNew as w } from "agilebuilder-ui";
|
|
6
|
+
import x from "../../../../utils/eventBus.js";
|
|
7
|
+
import { $t as k } from "../../../../utils/i18n-util.js";
|
|
8
|
+
const P = e({ __name: "fileupload-runtime", props: { pageContext: {}, configure: {} }, setup(e2) {
|
|
9
|
+
const P2 = e2, _ = P2.configure.runtime ? P2.configure.runtime : {}, j = l(_.props ? _.props : {}), R = _.style, T = _.class, z = _.headerStyle, D = _.titleExceedStyle, I = P2.pageContext.entity ? P2.pageContext.entity : {}, O = P2.configure.props.base ? P2.configure.props.base : {}, S = G(O.prop), F = G(O.propName);
|
|
10
|
+
S && S.length > 1 && t(() => P2.pageContext.entity[S[0]][S[1]], (e3) => {
|
|
11
|
+
A(h(I, S));
|
|
12
12
|
});
|
|
13
|
-
const
|
|
13
|
+
const N = P2.pageContext.code, q = l(S ? N + "__" + S.join("__") : null), U = h(I, S), $ = l(null), W = l(false), B = l([]), E = l({});
|
|
14
14
|
function A(e3) {
|
|
15
15
|
if (e3) {
|
|
16
16
|
const l2 = e3.split(",");
|
|
17
17
|
if (l2.length > 0) {
|
|
18
|
-
const e4 =
|
|
19
|
-
|
|
18
|
+
const e4 = P2.pageContext.backendUrl;
|
|
19
|
+
C.post(e4 + "/common/fs-upload/search-file-names", l2).then((e5) => {
|
|
20
20
|
B.value = [];
|
|
21
21
|
const t2 = [];
|
|
22
|
-
for (let
|
|
23
|
-
const o2 = l2[
|
|
22
|
+
for (let a2 = 0; a2 < l2.length; a2++) {
|
|
23
|
+
const o2 = l2[a2];
|
|
24
24
|
t2.push(e5[o2]), B.value.push({ showName: e5[o2], serverPath: o2 });
|
|
25
25
|
}
|
|
26
26
|
"input" === j.value.displayType && (E.value.showName = t2.join(","), E.value.serverPath = l2.join(","));
|
|
@@ -34,7 +34,7 @@ const w = e({ __name: "fileupload-runtime", props: { pageContext: {}, configure:
|
|
|
34
34
|
return e3 ? (e3.startsWith("${") && (e3 = e3.substring(2, e3.length - 1)), e3.split(".")) : [];
|
|
35
35
|
}
|
|
36
36
|
function H(e3) {
|
|
37
|
-
return
|
|
37
|
+
return b(e3);
|
|
38
38
|
}
|
|
39
39
|
A(U);
|
|
40
40
|
const J = (e3, l2, t2) => {
|
|
@@ -48,22 +48,22 @@ const w = e({ __name: "fileupload-runtime", props: { pageContext: {}, configure:
|
|
|
48
48
|
for (let l3 = 0; l3 < e4; l3++) B.value.shift();
|
|
49
49
|
}
|
|
50
50
|
for (let t2 = 0; t2 < B.value.length; t2++) e3.push(B.value[t2].showName), l2.push(B.value[t2].serverPath);
|
|
51
|
-
y(
|
|
51
|
+
y(P2.pageContext.entity, S, l2.join(",")), y(P2.pageContext.entity, F, e3.join(","));
|
|
52
52
|
}, M = l(null), Q = l(null);
|
|
53
|
-
return
|
|
54
|
-
|
|
53
|
+
return a(() => {
|
|
54
|
+
x.$on(q.value + "-pickFileDone", (e3) => {
|
|
55
55
|
$.value.pickFileDone(e3);
|
|
56
56
|
}), o(() => {
|
|
57
|
-
const e3 = h(
|
|
58
|
-
g(l2,
|
|
57
|
+
const e3 = h(I, S), l2 = { showName: h(I, F), serverPath: e3 };
|
|
58
|
+
g(l2, P2.pageContext, P2.configure, { formItemRef: M.value, componentRef: $.value, titleRef: Q.value, value: l2, entity: P2.pageContext.entity.data, pageData: P2.pageContext.entity.page });
|
|
59
59
|
});
|
|
60
|
-
}),
|
|
61
|
-
|
|
60
|
+
}), i(() => {
|
|
61
|
+
x.$off(q.value + "-pickFileDone");
|
|
62
62
|
}), (e3, l2) => {
|
|
63
|
-
const t2 =
|
|
64
|
-
return j.value.tittleShow ? (p(),
|
|
63
|
+
const t2 = u("el-form-item");
|
|
64
|
+
return j.value.tittleShow ? (p(), s(t2, { key: 0, ref_key: "formItemRef", ref: M, required: j.value.required, class: v(m(T)), "label-width": j.value.labelWidth, style: r(m(R)) }, { label: d(() => [j.value.tittleShow ? (p(), f("div", { key: 0, ref_key: "titleRef", ref: Q, style: r({ ...m(z), ...m(D) }) }, c(m(k)(j.value.title)), 5)) : n("", true)]), default: d(() => [W.value ? (p(), s(m(w), { key: 0, ref_key: "fileUploadRef", ref: $, style: { width: "100%" }, disabled: "disabled" === j.value.state, displayType: j.value.displayType, accept: j.value.accept, multiple: j.value.multiple, placeholder: j.value.placeholder, limit: j.value.limit, "limit-file-size": j.value.limitFileSize, "absolute-preview": j.value.absolutePreview, "absolute-downloadable": j.value.absoluteDownloadable, openCameraOrChoosePhoto: j.value.openCameraOrChoosePhoto, "file-info": E.value, "file-list": B.value, "system-code": e3.pageContext.systemCode, componentId: q.value, "on-success": J, "on-remove": K, "before-upload": H, pageContext: e3.pageContext }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "absolute-preview", "absolute-downloadable", "openCameraOrChoosePhoto", "file-info", "file-list", "system-code", "componentId", "pageContext"])) : n("", true)]), _: 1 }, 8, ["required", "class", "label-width", "style"])) : W.value ? (p(), s(m(w), { key: 1, ref_key: "fileUploadRef", ref: $, style: { width: "100%" }, disabled: "disabled" === j.value.state, displayType: j.value.displayType, accept: j.value.accept, multiple: j.value.multiple, placeholder: j.value.placeholder, limit: j.value.limit, "limit-file-size": j.value.limitFileSize, "absolute-preview": j.value.absolutePreview, "absolute-downloadable": j.value.absoluteDownloadable, openCameraOrChoosePhoto: j.value.openCameraOrChoosePhoto, "file-info": E.value, "file-list": B.value, "system-code": e3.pageContext.systemCode, componentId: q.value, "on-success": J, "on-remove": K, "before-upload": H, pageContext: e3.pageContext }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "absolute-preview", "absolute-downloadable", "openCameraOrChoosePhoto", "file-info", "file-list", "system-code", "componentId", "pageContext"])) : n("", true);
|
|
65
65
|
};
|
|
66
66
|
} });
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
P as default
|
|
69
69
|
};
|