super-page-runtime 2.3.12-sit1 → 2.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/runtime/utils/api/page-expose-util.js +50 -50
- package/dist/es/components/runtime/utils/events/event-util.js +3 -3
- package/dist/es/components/runtime/utils/events/print-label.js +26 -25
- package/dist/es/components/runtime/utils/events/standard-event.js +10 -10
- package/dist/es/components/runtime/utils/events/validator-util.js +1 -1
- package/dist/es/components/runtime/utils/page-init-util.js +25 -24
- package/dist/es/components/runtime/utils/page-store.js +10 -10
- package/dist/es/components/runtime/utils/table-utils.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +10 -6
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +8 -6
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +98 -93
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +11 -9
- package/dist/es/components/runtime/views/assemblys/container/fixed/YxAffix.vue2.js +2 -0
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +12 -10
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +27 -23
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +32 -32
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +35 -34
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +5 -3
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +1 -0
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +15 -14
- package/dist/es/components/runtime/views/home-chart.vue.js +7 -7
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +4 -3
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page.vue2.js +156 -148
- package/dist/es/style.css +82 -79
- package/package.json +2 -2
|
@@ -3,12 +3,13 @@ import { Search as p } from "@element-plus/icons-vue";
|
|
|
3
3
|
import g from "./common-chart-header-group.vue.js";
|
|
4
4
|
import m from "./common-chart-header-breadcrumb.vue.js";
|
|
5
5
|
import b from "./common-homepage-search.vue.js";
|
|
6
|
-
import { setVariableValueWithProp as v, getValueFromSource as y, setValueForVariableName as
|
|
7
|
-
const
|
|
6
|
+
import { setVariableValueWithProp as v, getValueFromSource as y, setValueForVariableName as O } from "../../../../utils/page-helper-util.js";
|
|
7
|
+
const w = { class: "amb-widget-chart-header" }, x = { class: "amb-widget-chart-header-item" }, k = { class: "amb-widget-chart-header-item amb-widget-chart-header-center" }, j = { class: "amb-widget-chart-header-item" }, C = { key: 0, class: "amb-widget-chart-header-item" }, P = e({ __name: "common-chart-header", props: { headerInfo: { type: Object, required: true }, configure: { type: Object, required: true }, pageContext: { type: Object, required: true } }, emits: ["drill-end"], setup(e2, { expose: P2, emit: _ }) {
|
|
8
8
|
const N = e2, D = o(null), A = o(), R = _;
|
|
9
9
|
function S(e3) {
|
|
10
10
|
const o2 = N.headerInfo.drillOptions.length;
|
|
11
|
-
if (
|
|
11
|
+
if (e3 >= o2) N.headerInfo.drillOptions;
|
|
12
|
+
else {
|
|
12
13
|
for (let r2 = o2 - 1; r2 >= e3; r2--) N.headerInfo.drillOptions.splice(r2, 1);
|
|
13
14
|
q(e3);
|
|
14
15
|
}
|
|
@@ -34,7 +35,7 @@ const x = { class: "amb-widget-chart-header" }, O = { class: "amb-widget-chart-h
|
|
|
34
35
|
for (let e4 of o2.variables) {
|
|
35
36
|
if (!e4.fieldName || !e4.variable) continue;
|
|
36
37
|
const o3 = y(r2, e4.fieldName, void 0);
|
|
37
|
-
|
|
38
|
+
O(N.pageContext.entity, e4.variable, o3);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
N.headerInfo.drillOptions || (N.headerInfo.drillOptions = []);
|
|
@@ -46,11 +47,12 @@ const x = { class: "amb-widget-chart-header" }, O = { class: "amb-widget-chart-h
|
|
|
46
47
|
if (r2 + 1 >= N.headerInfo.options.length) {
|
|
47
48
|
return F(o2 && e3.dataIndex < o2.length ? o2[e3.dataIndex] : void 0), void R("drill-end", e3);
|
|
48
49
|
}
|
|
50
|
+
N.headerInfo.options;
|
|
49
51
|
const n2 = N.headerInfo.options[r2], t2 = o2 && e3.dataIndex < o2.length ? o2[e3.dataIndex] : null, a2 = { fieldName: n2.target ? n2.target.replace(".", "_") : "", rawFieldName: n2.target ? n2.target : "", label: e3.name, value: e3.name, data: t2 };
|
|
50
52
|
N.headerInfo.drillOptions.push(a2), q(r2 + 1);
|
|
51
53
|
}, closeDrill: S }), (o2, v2) => {
|
|
52
|
-
const y2 = r("el-icon"),
|
|
53
|
-
return t(), n("div",
|
|
54
|
+
const y2 = r("el-icon"), O2 = r("el-tooltip");
|
|
55
|
+
return t(), n("div", w, [a("div", x, [i(a("label", { style: f(e2.headerInfo.style) }, h(e2.headerInfo.title) + " ", 5), [[s, e2.headerInfo.title && (!e2.headerInfo.textAlign || "left" == e2.headerInfo.textAlign)]]), !e2.headerInfo.showDrill || e2.headerInfo.groupPosition && "left" != e2.headerInfo.groupPosition ? l("", true) : (t(), d(m, { key: 0, ref_key: "drillObjRef", ref: D, headerInfo: e2.headerInfo, onCloseDrill: S }, null, 8, ["headerInfo"])), !e2.headerInfo.showGroup || e2.headerInfo.groupPosition && "left" != e2.headerInfo.groupPosition ? l("", true) : (t(), d(g, { key: 1, headerInfo: e2.headerInfo }, null, 8, ["headerInfo"]))]), a("div", k, [i(a("label", { style: f(e2.headerInfo.style) }, h(e2.headerInfo.title) + " ", 5), [[s, e2.headerInfo.title && "center" == e2.headerInfo.textAlign]]), e2.headerInfo.showDrill && "center" == e2.headerInfo.groupPosition ? (t(), d(m, { key: 0, headerInfo: e2.headerInfo, onCloseDrill: S, ref_key: "drillObjRef", ref: D }, null, 8, ["headerInfo"])) : l("", true), e2.headerInfo.showGroup && "center" == e2.headerInfo.groupPosition ? (t(), d(g, { key: 1, headerInfo: e2.headerInfo }, null, 8, ["headerInfo"])) : l("", true)]), a("div", j, [i(a("label", { style: f(e2.headerInfo.style) }, h(e2.headerInfo.title) + " ", 5), [[s, e2.headerInfo.title && "right" == e2.headerInfo.textAlign]]), e2.headerInfo.showDrill && "right" == e2.headerInfo.groupPosition ? (t(), d(m, { key: 0, headerInfo: e2.headerInfo, onCloseDrill: S, ref_key: "drillObjRef", ref: D }, null, 8, ["headerInfo"])) : l("", true), e2.headerInfo.showGroup && "right" == e2.headerInfo.groupPosition ? (t(), d(g, { key: 1, headerInfo: e2.headerInfo }, null, 8, ["headerInfo"])) : l("", true)]), e2.pageContext.showHomepageSearch ? (t(), n("div", C, [c(O2, { content: "打开查询弹窗", effect: "light" }, { default: I(() => [c(y2, { onClick: G }, { default: I(() => [c(u(p))]), _: 1 })]), _: 1 }), c(b, { ref_key: "commonHomepageSearchRef", ref: A, configure: e2.configure, pageContext: e2.pageContext }, null, 8, ["configure", "pageContext"])])) : l("", true)]);
|
|
54
56
|
};
|
|
55
57
|
} });
|
|
56
58
|
export {
|
|
@@ -11,24 +11,24 @@ class ExpressionEvaluator {
|
|
|
11
11
|
return this.evaluateExpression(o);
|
|
12
12
|
}
|
|
13
13
|
static createExpression(e, t, r) {
|
|
14
|
-
const { propName: o, operator:
|
|
14
|
+
const { propName: o, operator: n, propValue: a, leftBracket: s, rightBracket: l, joinSign: i, dataType: c } = t;
|
|
15
15
|
if (!o || "" === o) return "";
|
|
16
16
|
const u = getValueFromVariable(e.entity, o, r);
|
|
17
|
-
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity,
|
|
17
|
+
let p = `${s} ${this.getComparisonExpression(u, t, getValueFromVariable(e.entity, a, r))} ${l}`;
|
|
18
18
|
return i && ("and" === i || "AND" === i ? p += "&&" : "or" !== i && "OR" !== i || (p += "||")), p.trim();
|
|
19
19
|
}
|
|
20
20
|
static getComparisonExpression(e, t, r) {
|
|
21
|
-
const { dataType: o, variableIsNull:
|
|
22
|
-
let
|
|
23
|
-
|
|
21
|
+
const { dataType: o, variableIsNull: n } = t;
|
|
22
|
+
let a = t.operator;
|
|
23
|
+
a || (a = "EQ");
|
|
24
24
|
let s = this.parseValue(e, o);
|
|
25
25
|
const l = this.parseValue(r, o);
|
|
26
|
-
if (null == l &&
|
|
27
|
-
if (null == s && (s = "null"), "null" ===
|
|
28
|
-
if ("ignore" ===
|
|
29
|
-
if ("notequal" ===
|
|
26
|
+
if (null == l && n) {
|
|
27
|
+
if (null == s && (s = "null"), "null" === n) return `${s} === null`;
|
|
28
|
+
if ("ignore" === n) return "1=1";
|
|
29
|
+
if ("notequal" === n) return "1!=1";
|
|
30
30
|
}
|
|
31
|
-
switch (
|
|
31
|
+
switch (a) {
|
|
32
32
|
case "EQ":
|
|
33
33
|
return `${s} === ${l}`;
|
|
34
34
|
case "GT":
|
|
@@ -55,7 +55,7 @@ class ExpressionEvaluator {
|
|
|
55
55
|
}
|
|
56
56
|
return `[${l}].includes(${s})`;
|
|
57
57
|
default:
|
|
58
|
-
throw new Error(`比较符号不匹配: ${
|
|
58
|
+
throw new Error(`比较符号不匹配: ${a}`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
static changeDataType(e) {
|
|
@@ -86,7 +86,7 @@ class ExpressionEvaluator {
|
|
|
86
86
|
try {
|
|
87
87
|
return eval(expression);
|
|
88
88
|
} catch (e) {
|
|
89
|
-
return false;
|
|
89
|
+
return console.error("表达式错误:", expression, e), false;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -114,39 +114,40 @@ function getSummaryDataColumn(e, t) {
|
|
|
114
114
|
const r = {};
|
|
115
115
|
return ((_a = e.props.summaries) == null ? void 0 : _a.dataColumn) && e.props.summaries.dataColumn.length > 0 && e.props.summaries.dataColumn.forEach((o) => {
|
|
116
116
|
var _a2;
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const n = (_a2 = e.items) == null ? void 0 : _a2.find((e2) => o.prop === e2.props.base.prop);
|
|
118
|
+
n && ("table" === t && n.props.base.tableSummary || "group" === t && n.props.base.groupSummary) && (r[o.prop] = o);
|
|
119
119
|
}), r;
|
|
120
120
|
}
|
|
121
121
|
function summaryStatistics(e, t, r, o) {
|
|
122
|
-
let
|
|
123
|
-
const
|
|
124
|
-
if (s.length > 0) if ("custom" ===
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
const e2 =
|
|
128
|
-
|
|
122
|
+
let n = "";
|
|
123
|
+
const a = e.summaryMode, s = t.map((e2) => Number(e2[r])).filter((e2) => !Number.isNaN(e2));
|
|
124
|
+
if (s.length > 0) if ("custom" === a) {
|
|
125
|
+
const a2 = getCustomFunc(o, e.customFunc);
|
|
126
|
+
if (a2) try {
|
|
127
|
+
const e2 = a2.apply(a2, [{ data: t, prop: r }]);
|
|
128
|
+
n = e2 ? ` ${e2}` : " N/A";
|
|
129
129
|
} catch (e2) {
|
|
130
|
+
console.error("自定义函数脚本错误:", t, e2);
|
|
130
131
|
}
|
|
131
|
-
else
|
|
132
|
-
} else switch (
|
|
132
|
+
else n = " N/A";
|
|
133
|
+
} else switch (a) {
|
|
133
134
|
case "sum":
|
|
134
|
-
|
|
135
|
+
n = ` ${s.reduce((e2, t2) => e2 + t2, 0)}`;
|
|
135
136
|
break;
|
|
136
137
|
case "avg":
|
|
137
|
-
|
|
138
|
+
n = " " + s.reduce((e2, t2) => e2 + t2, 0) / s.length;
|
|
138
139
|
break;
|
|
139
140
|
case "min":
|
|
140
|
-
|
|
141
|
+
n = ` ${Math.min(...s)}`;
|
|
141
142
|
break;
|
|
142
143
|
case "max":
|
|
143
|
-
|
|
144
|
+
n = ` ${Math.max(...s)}`;
|
|
144
145
|
break;
|
|
145
146
|
default:
|
|
146
|
-
|
|
147
|
+
n = " N/A";
|
|
147
148
|
}
|
|
148
|
-
else
|
|
149
|
-
return
|
|
149
|
+
else n = " N/A";
|
|
150
|
+
return n;
|
|
150
151
|
}
|
|
151
152
|
function replacePlaceholders(e, t) {
|
|
152
153
|
if (e) return e.replace(/\$\{row\.(\w+)\}/g, (e2, r) => Object.prototype.hasOwnProperty.call(t, r) ? t[r] : "");
|
|
@@ -156,31 +157,33 @@ function getHeaderCellStyleUtil(e, t, r) {
|
|
|
156
157
|
const o = {};
|
|
157
158
|
e.column.property && ((_a = t.titleStyle) == null ? void 0 : _a.forEach((t2) => {
|
|
158
159
|
if (t2.field && t2.field.includes(e.column.property)) if (t2.scopeFunc) {
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
161
|
-
false !==
|
|
162
|
-
} catch (
|
|
160
|
+
const n2 = getCustomFunc(r.pageContext, t2.scopeFunc);
|
|
161
|
+
if (n2) try {
|
|
162
|
+
false !== n2.apply(n2, [{ item: t2, data: e }]) && copyStyle(o, t2);
|
|
163
|
+
} catch (r2) {
|
|
164
|
+
console.error("自定义函数脚本错误:", t2, e, r2);
|
|
163
165
|
}
|
|
164
166
|
} else copyStyle(o, t2);
|
|
165
167
|
}));
|
|
166
|
-
const
|
|
167
|
-
return
|
|
168
|
+
const n = getCellStyleUtil(e, t.cellTitleStyle, r);
|
|
169
|
+
return n && Object.assign(o, n), o;
|
|
168
170
|
}
|
|
169
171
|
function getRowStyleUtil(e, t, r) {
|
|
170
172
|
const o = {};
|
|
171
173
|
if (r.configure.style.rowStyle) for (let t2 = 0; t2 < r.configure.style.rowStyle.length; t2++) {
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const t3 = getCustomFunc(r.pageContext,
|
|
174
|
+
const n = r.configure.style.rowStyle[t2];
|
|
175
|
+
if (n.scopeFunc) {
|
|
176
|
+
const t3 = getCustomFunc(r.pageContext, n.scopeFunc);
|
|
175
177
|
if (t3) try {
|
|
176
178
|
const r2 = t3.apply(t3, [{ data: e }]);
|
|
177
|
-
null != r2 && false !== r2 && copyStyle(o,
|
|
178
|
-
} catch (
|
|
179
|
+
null != r2 && false !== r2 && copyStyle(o, n);
|
|
180
|
+
} catch (t4) {
|
|
181
|
+
console.error("自定义函数脚本错误:", e, t4);
|
|
179
182
|
}
|
|
180
|
-
} else if (
|
|
181
|
-
const t3 = ExpressionEvaluator.evaluate(r.pageContext,
|
|
182
|
-
(t3 || void 0 === t3) && copyStyle(o,
|
|
183
|
-
} else copyStyle(o,
|
|
183
|
+
} else if (n.matchingCondition) {
|
|
184
|
+
const t3 = ExpressionEvaluator.evaluate(r.pageContext, n.matchingCondition, e.row);
|
|
185
|
+
(t3 || void 0 === t3) && copyStyle(o, n);
|
|
186
|
+
} else copyStyle(o, n);
|
|
184
187
|
}
|
|
185
188
|
if (t && t.length > 0 && -1 !== t.indexOf(e.rowIndex)) {
|
|
186
189
|
const e2 = {};
|
|
@@ -193,18 +196,19 @@ function getRowStyleUtil(e, t, r) {
|
|
|
193
196
|
}
|
|
194
197
|
function getCellStyleUtil(e, t, r) {
|
|
195
198
|
const o = {};
|
|
196
|
-
if (t) for (let
|
|
197
|
-
const
|
|
198
|
-
if (isSetStyle(
|
|
199
|
-
const t2 = getCustomFunc(r.pageContext,
|
|
199
|
+
if (t) for (let n = 0; n < t.length; n++) {
|
|
200
|
+
const a = t[n];
|
|
201
|
+
if (isSetStyle(a)) if (a.scopeFunc) {
|
|
202
|
+
const t2 = getCustomFunc(r.pageContext, a.scopeFunc);
|
|
200
203
|
if (t2) try {
|
|
201
|
-
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o,
|
|
202
|
-
} catch (
|
|
204
|
+
false !== t2.apply(t2, [{ data: e }]) && copyStyle(o, a);
|
|
205
|
+
} catch (t3) {
|
|
206
|
+
console.error("自定义函数脚本错误:", e, t3);
|
|
203
207
|
}
|
|
204
|
-
} else if (
|
|
205
|
-
const t2 = ExpressionEvaluator.evaluate(r.pageContext,
|
|
206
|
-
(t2 || void 0 === t2) && copyStyle(o,
|
|
207
|
-
} else copyStyle(o,
|
|
208
|
+
} else if (a.matchingCondition) {
|
|
209
|
+
const t2 = ExpressionEvaluator.evaluate(r.pageContext, a.matchingCondition, e.row);
|
|
210
|
+
(t2 || void 0 === t2) && copyStyle(o, a);
|
|
211
|
+
} else copyStyle(o, a);
|
|
208
212
|
}
|
|
209
213
|
return o;
|
|
210
214
|
}
|
|
@@ -216,33 +220,33 @@ function copyStyle(e, t) {
|
|
|
216
220
|
Object.assign(e, t.style), t.customStyle && Object.assign(e, JSON.parse(t.customStyle));
|
|
217
221
|
}
|
|
218
222
|
function rowDataToColumn(e, t, r) {
|
|
219
|
-
const o = t.props.dataOrigin.groupField,
|
|
223
|
+
const o = t.props.dataOrigin.groupField, n = t.props.dataOrigin.rowToColumn.titleColumns, a = t.props.dataOrigin.rowToColumn.dataColumns, s = [], l = {};
|
|
220
224
|
if (o && o.length > 0) e.forEach((e2) => {
|
|
221
225
|
const t2 = o.map((t3) => e2[t3]).join("|");
|
|
222
226
|
if (!l[t2]) {
|
|
223
227
|
const r2 = {};
|
|
224
228
|
o.forEach((t3) => r2[t3] = e2[t3]), l[t2] = r2, s.push(r2);
|
|
225
229
|
}
|
|
226
|
-
|
|
227
|
-
const o2 = `${
|
|
230
|
+
a.forEach((r2) => {
|
|
231
|
+
const o2 = `${n.map((t3) => e2[t3]).join("")}${r2}`;
|
|
228
232
|
l[t2][o2] = e2[r2];
|
|
229
233
|
});
|
|
230
234
|
});
|
|
231
235
|
else {
|
|
232
236
|
const t2 = [];
|
|
233
237
|
e.forEach((e2) => {
|
|
234
|
-
|
|
238
|
+
n.forEach((r2) => {
|
|
235
239
|
e2[r2] && t2.push(e2[r2]);
|
|
236
240
|
});
|
|
237
|
-
}),
|
|
238
|
-
const o2 = {},
|
|
241
|
+
}), a.forEach((t3) => {
|
|
242
|
+
const o2 = {}, a2 = r.find((e2) => {
|
|
239
243
|
var _a, _b;
|
|
240
244
|
return ((_b = (_a = e2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop) === t3;
|
|
241
245
|
});
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
o2[
|
|
246
|
+
a2 && (o2.$GroupColumn = a2.props.base.name), e.forEach((e2) => {
|
|
247
|
+
n.forEach((r2) => {
|
|
248
|
+
const n2 = e2[r2], a3 = e2[t3];
|
|
249
|
+
o2[n2] = a3;
|
|
246
250
|
});
|
|
247
251
|
}), s.push(o2);
|
|
248
252
|
});
|
|
@@ -250,9 +254,9 @@ function rowDataToColumn(e, t, r) {
|
|
|
250
254
|
return s;
|
|
251
255
|
}
|
|
252
256
|
function colDataToRow(e, t) {
|
|
253
|
-
const r = t.props.dataOrigin.groupField, o = t.props.dataOrigin.columnToRow.titleColumns,
|
|
257
|
+
const r = t.props.dataOrigin.groupField, o = t.props.dataOrigin.columnToRow.titleColumns, n = t.props.dataOrigin.columnToRow.dataColumns, a = t.props.dataOrigin.columnToRow.transColumns, s = t.props.dataOrigin.columnToRow.dataColumnsMapping;
|
|
254
258
|
if (0 === e.length) return e;
|
|
255
|
-
const l = [], i = groupBy(e, r), c =
|
|
259
|
+
const l = [], i = groupBy(e, r), c = n.reduce((e2, t2) => t2.columns.length > e2.columns.length ? t2 : e2, n[0]), u = n.reduce((e2, t2) => (t2.columns.forEach((r2) => {
|
|
256
260
|
e2[r2] = t2.prop;
|
|
257
261
|
}), e2), {});
|
|
258
262
|
return i.forEach((e2) => {
|
|
@@ -260,14 +264,14 @@ function colDataToRow(e, t) {
|
|
|
260
264
|
const i2 = c.prop, p = {};
|
|
261
265
|
if (r.forEach((t3) => {
|
|
262
266
|
p[t3] = e2[t3];
|
|
263
|
-
}), p[i2] = e2[t2],
|
|
267
|
+
}), p[i2] = e2[t2], n.length > 1) {
|
|
264
268
|
const r2 = s.find((e3) => e3.props.includes(t2));
|
|
265
269
|
r2 && r2.props.length > 1 && r2.props.forEach((r3) => {
|
|
266
270
|
r3 !== t2 && u[r3] && (p[u[r3]] = e2[r3]);
|
|
267
271
|
});
|
|
268
272
|
}
|
|
269
273
|
o.forEach((e3) => {
|
|
270
|
-
const r2 =
|
|
274
|
+
const r2 = a.filter((t3) => t3.relatedTitle === e3.prop);
|
|
271
275
|
let o2 = false;
|
|
272
276
|
r2 && r2.length > 0 && r2.forEach((r3) => {
|
|
273
277
|
if (r3.columns.includes(t2)) return p[e3.prop] = r3.label, void (o2 = true);
|
|
@@ -277,25 +281,25 @@ function colDataToRow(e, t) {
|
|
|
277
281
|
}), l;
|
|
278
282
|
}
|
|
279
283
|
function getColumnToRowTableConfig(e) {
|
|
280
|
-
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns,
|
|
284
|
+
const t = e.items, r = e.props.dataOrigin.groupField, o = e.props.dataOrigin.columnToRow.titleColumns, n = e.props.dataOrigin.columnToRow.dataColumns, a = [];
|
|
281
285
|
r && r.length > 0 && r.forEach((e2) => {
|
|
282
286
|
if (t) {
|
|
283
287
|
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
284
|
-
r2 &&
|
|
288
|
+
r2 && a.push(r2);
|
|
285
289
|
}
|
|
286
290
|
});
|
|
287
|
-
return [...o, ...
|
|
291
|
+
return [...o, ...n].forEach((e2) => {
|
|
288
292
|
if (t) {
|
|
289
293
|
const r2 = t.find((t2) => t2.props.base.prop === e2);
|
|
290
|
-
r2 ?
|
|
294
|
+
r2 ? a.push(r2) : a.push({ uuid: (/* @__PURE__ */ new Date()).getTime(), name: "", props: { base: { prop: e2.prop, name: e2.title, sortable: true, headerAlign: "center", align: "center", fixed: false, visible: true, dataType: "string" }, format: {}, size: { pc: {} } }, style: {}, componentIndex: 0, runtime: { common: { class: "", style: { pc_style: {}, pc_class: "" } } } });
|
|
291
295
|
}
|
|
292
|
-
}),
|
|
296
|
+
}), a;
|
|
293
297
|
}
|
|
294
298
|
function groupBy(e, t) {
|
|
295
299
|
const r = {};
|
|
296
300
|
return e.forEach((e2) => {
|
|
297
301
|
const o = t.map((t2) => e2[t2]).join("|");
|
|
298
|
-
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2,
|
|
302
|
+
r[o] || (r[o] = { ...e2, records: [] }, t.forEach((t2, n) => {
|
|
299
303
|
r[o][t2] = e2[t2];
|
|
300
304
|
})), r[o].records.push(e2);
|
|
301
305
|
}), Object.values(r).map((e2) => ({ ...e2, records: void 0 }));
|
|
@@ -323,7 +327,7 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
323
327
|
r += Number(e2[t]);
|
|
324
328
|
});
|
|
325
329
|
} catch (e2) {
|
|
326
|
-
r = 0;
|
|
330
|
+
console.error("计算错误:", e2), r = 0;
|
|
327
331
|
}
|
|
328
332
|
totalValueMap[e] = r;
|
|
329
333
|
} else (e.startsWith("${page.") || e.startsWith("${data.") || e.startsWith("${row.") || e.startsWith("${request.") || e.startsWith("${context.") || e.startsWith("${system.") || e.startsWith("${fixed.")) && (totalValueMap[e] = getValueFromVariable(entity, e, data));
|
|
@@ -335,7 +339,7 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
335
339
|
try {
|
|
336
340
|
data[key] = eval(expr);
|
|
337
341
|
} catch (e) {
|
|
338
|
-
data[key] = 0;
|
|
342
|
+
console.error(itemConfs[key] + " 计算错误, 替换后表达式为:" + expr, e), data[key] = 0;
|
|
339
343
|
}
|
|
340
344
|
});
|
|
341
345
|
});
|
|
@@ -343,19 +347,19 @@ function computeFormula(itemConfs, datas, entity) {
|
|
|
343
347
|
function getFieldName(e) {
|
|
344
348
|
return e.substring(6, e.length - 1);
|
|
345
349
|
}
|
|
346
|
-
function formatColContent(e, t, r, o,
|
|
347
|
-
const
|
|
350
|
+
function formatColContent(e, t, r, o, n) {
|
|
351
|
+
const a = e[r.props.base.prop];
|
|
348
352
|
switch (t.type) {
|
|
349
353
|
case "number":
|
|
350
|
-
return formatNumber(
|
|
354
|
+
return formatNumber(a, t);
|
|
351
355
|
case "currency":
|
|
352
|
-
return formatCurrency(
|
|
356
|
+
return formatCurrency(a, t);
|
|
353
357
|
case "percent":
|
|
354
|
-
return formatPercent(
|
|
358
|
+
return formatPercent(a, t);
|
|
355
359
|
case "custom":
|
|
356
|
-
return formatCustomFunc(e, t, r, o,
|
|
360
|
+
return formatCustomFunc(e, t, r, o, n);
|
|
357
361
|
default:
|
|
358
|
-
return
|
|
362
|
+
return a;
|
|
359
363
|
}
|
|
360
364
|
}
|
|
361
365
|
function formatNumber(e, t) {
|
|
@@ -370,28 +374,29 @@ function formatPercent(e, t) {
|
|
|
370
374
|
let r = e;
|
|
371
375
|
return r || (r = 0), t.decimalDigit && (r = Number(e).toFixed(t.decimalDigit)), r + " %";
|
|
372
376
|
}
|
|
373
|
-
function formatCustomFunc(e, t, r, o,
|
|
374
|
-
const
|
|
375
|
-
if (
|
|
377
|
+
function formatCustomFunc(e, t, r, o, n) {
|
|
378
|
+
const a = getCustomFunc(o, t.customFunc);
|
|
379
|
+
if (a) {
|
|
376
380
|
try {
|
|
377
|
-
return
|
|
378
|
-
} catch (
|
|
381
|
+
return a.apply(a, [{ pageContext: o, configureObj: n, row: e, prop: r.props.base.prop }]);
|
|
382
|
+
} catch (t2) {
|
|
383
|
+
console.error("自定义函数脚本错误:", e, t2);
|
|
379
384
|
}
|
|
380
385
|
return "";
|
|
381
386
|
}
|
|
382
387
|
}
|
|
383
|
-
function mergeRowByProperty(e, t, r, o,
|
|
384
|
-
const
|
|
388
|
+
function mergeRowByProperty(e, t, r, o, n) {
|
|
389
|
+
const a = e[o];
|
|
385
390
|
let s = 1, l = true;
|
|
386
391
|
for (let e2 = r - 1; e2 >= 0; e2--) {
|
|
387
|
-
if (
|
|
392
|
+
if (n[e2][o] === a) {
|
|
388
393
|
l = false;
|
|
389
394
|
break;
|
|
390
395
|
}
|
|
391
396
|
break;
|
|
392
397
|
}
|
|
393
398
|
if (!l) return [0, 0];
|
|
394
|
-
for (let e2 = r + 1; e2 <
|
|
399
|
+
for (let e2 = r + 1; e2 < n.length && n[e2][o] === a; e2++) s++;
|
|
395
400
|
return [s, 1];
|
|
396
401
|
}
|
|
397
402
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, onMounted as l, resolveComponent as a, createBlock as o, openBlock as u, withCtx as p, createVNode as
|
|
1
|
+
import { defineComponent as e, ref as t, onMounted as l, resolveComponent as a, createBlock as o, openBlock as u, withCtx as p, createVNode as n, createTextVNode as s, toDisplayString as r } from "vue";
|
|
2
2
|
import { packageTemplateFiles as i } from "../../../utils/common-util.js";
|
|
3
3
|
import { ElMessage as m } from "element-plus";
|
|
4
4
|
const c = "${", d = "}", g = e({ __name: "export-form-report-dialog", props: { configure: { type: Object, required: true }, pageContext: { type: Object, required: true } }, emits: ["export", "close"], setup(e2, { emit: g2 }) {
|
|
@@ -7,7 +7,7 @@ const c = "${", d = "}", g = e({ __name: "export-form-report-dialog", props: { c
|
|
|
7
7
|
function N(e3) {
|
|
8
8
|
let t2, l2, a2 = e3;
|
|
9
9
|
const o2 = a2.indexOf(c), u2 = a2.indexOf(d);
|
|
10
|
-
return -1 !== o2 && -1 !== u2 ? (o2 > u2 ? a2 = a2.substring(0, u2) + a2.substring(u2 + 1) : (t2 = a2.substring(o2 + 2, u2), l2 = a2.substring(o2, u2 + 1), x.value.push(t2), a2 = a2.replace(l2, "")), N(a2)) : x.value;
|
|
10
|
+
return -1 !== o2 && -1 !== u2 ? (o2 > u2 ? a2 = a2.substring(0, u2) + a2.substring(u2 + 1) : (t2 = a2.substring(o2 + 2, u2), l2 = a2.substring(o2, u2 + 1), x.value.push(t2), x.value, a2 = a2.replace(l2, "")), N(a2)) : x.value;
|
|
11
11
|
}
|
|
12
12
|
function O(e3) {
|
|
13
13
|
v("export", f.configure, e3);
|
|
@@ -17,16 +17,18 @@ const c = "${", d = "}", g = e({ __name: "export-form-report-dialog", props: { c
|
|
|
17
17
|
}
|
|
18
18
|
return l(() => {
|
|
19
19
|
y.templateFiles && y.templateFiles.length > 0 ? h.value = i(y.templateFiles, f.pageContext, f.configure) : y.templateUuid && y.templateName && h.value.push({ templateUuid: y.templateUuid, templateName: y.templateName }), h.value.forEach((e3) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
e3 && e3.templateName && (e3.templateName = function(e4) {
|
|
21
|
+
const t2 = N(e4);
|
|
22
|
+
return t2.forEach((t3) => {
|
|
23
|
+
const l2 = c + t3 + d;
|
|
24
|
+
let a2;
|
|
25
|
+
-1 !== e4.indexOf(l2) && Object.prototype.hasOwnProperty.call(w, t3) && (a2 = w[t3] ? w[t3] : "", e4 = e4.replace(l2, a2));
|
|
26
|
+
}), e4;
|
|
27
|
+
}(e3.templateName));
|
|
26
28
|
}), h.value && 0 !== h.value.length || (m({ message: "无符合条件可导出的模板!", type: "warning" }), v("close")), 1 === (h == null ? void 0 : h.value.length) ? (O(h.value[0]), v("close")) : b.value = true;
|
|
27
29
|
}), (e3, t2) => {
|
|
28
30
|
const l2 = a("el-table-column"), i2 = a("el-button"), m2 = a("el-table"), c2 = a("el-dialog");
|
|
29
|
-
return u(), o(c2, { modelValue: b.value, "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => b.value = e4), "show-close": true, "append-to-body": true, title: e3.$t("superPageRuntimeMessage.selectTemplate"), onClose: _ }, { default: p(() => [
|
|
31
|
+
return u(), o(c2, { modelValue: b.value, "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => b.value = e4), "show-close": true, "append-to-body": true, title: e3.$t("superPageRuntimeMessage.selectTemplate"), onClose: _ }, { default: p(() => [n(m2, { data: h.value, style: { width: "100%" } }, { default: p(() => [n(l2, { label: e3.$t("superPageRuntimeMessage.temlpate"), prop: "templateShowPath" }, { default: p((e4) => [s(r(e4.row.templateName), 1)]), _: 1 }, 8, ["label"]), n(l2, { label: e3.$t("superPageRuntimeMessage.operating"), width: "200", fixed: "right" }, { default: p((t3) => [n(i2, { type: "text", size: "small", onClick: (e4) => O(t3.row) }, { default: p(() => [s(r(e3.$t("superPageRuntimeMessage.export")), 1)]), _: 2 }, 1032, ["onClick"])]), _: 1 }, 8, ["label"])]), _: 1 }, 8, ["data"])]), _: 1 }, 8, ["modelValue", "title"]);
|
|
30
32
|
};
|
|
31
33
|
} });
|
|
32
34
|
export {
|
|
@@ -19,6 +19,7 @@ const p = e({ __name: "YxAffix", props: { offset: { type: Number, default: 0 },
|
|
|
19
19
|
B.value = l2 ?? 0, R(n2 || i2 || false, e3);
|
|
20
20
|
}
|
|
21
21
|
} catch (e3) {
|
|
22
|
+
console.error(e3);
|
|
22
23
|
}
|
|
23
24
|
}, R = (e3, t2) => {
|
|
24
25
|
var _a;
|
|
@@ -55,6 +56,7 @@ const p = e({ __name: "YxAffix", props: { offset: { type: Number, default: 0 },
|
|
|
55
56
|
})();
|
|
56
57
|
b.value = e3, T.value = e3[0], b.value.forEach((e4) => e4.addEventListener("scroll", z)), window.addEventListener("resize", L), S();
|
|
57
58
|
} catch (e3) {
|
|
59
|
+
console.error(e3);
|
|
58
60
|
}
|
|
59
61
|
});
|
|
60
62
|
}, 100);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as e, computed as t, ref as
|
|
1
|
+
import { defineComponent as e, computed as t, ref as r, onMounted as a, watch as o, resolveComponent as l, createBlock as n, openBlock as u, normalizeStyle as i, normalizeClass as s, unref as c, withCtx as p, createElementBlock as m, createCommentVNode as f, toDisplayString as g } from "vue";
|
|
2
2
|
import d from "qrcode";
|
|
3
3
|
import v from "jsbarcode";
|
|
4
4
|
import { getFormModelFields as y } from "../../../../utils/page-init-util.js";
|
|
@@ -12,7 +12,7 @@ const j = ["src"], D = e({ __name: "barcode-runtime", props: { pageContext: {},
|
|
|
12
12
|
let k = y(q.pageContext, q.configure);
|
|
13
13
|
const A = t({ get: () => x(N, k), set(e3) {
|
|
14
14
|
h(N, k, e3);
|
|
15
|
-
} }), E = q.configure.runtime ? q.configure.runtime : {}, _ =
|
|
15
|
+
} }), E = q.configure.runtime ? q.configure.runtime : {}, _ = r(E.props ? E.props : {}), O = E.style, P = E.class, S = E.headerStyle, $ = r(""), I = r(null), Q = r(_.value.brCodeFormat ?? "CODE128"), V = r([]);
|
|
16
16
|
function F(e3) {
|
|
17
17
|
return h(N, k, e3);
|
|
18
18
|
}
|
|
@@ -22,31 +22,32 @@ const j = ["src"], D = e({ __name: "barcode-runtime", props: { pageContext: {},
|
|
|
22
22
|
function L(e3) {
|
|
23
23
|
var t2;
|
|
24
24
|
"QR-code" === _.value.type ? (t2 = e3, d.toDataURL(t2, (e4, t3) => {
|
|
25
|
-
e4
|
|
25
|
+
e4 ? console.error(e4) : $.value = t3;
|
|
26
26
|
})) : function(e4) {
|
|
27
27
|
try {
|
|
28
28
|
v(I.value, e4, { format: Q.value });
|
|
29
29
|
} catch (e5) {
|
|
30
|
+
console.error("生成条形码时发生错误:", e5);
|
|
30
31
|
}
|
|
31
32
|
}(e3);
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
+
return a(() => {
|
|
34
35
|
_.value.generateRule && ("fixed" === _.value.generateRuleType ? (V.value = Array.from(_.value.generateRule.matchAll(/\$\{(\w+)\}/g), (e3) => e3[1]), V.value.forEach((e3) => {
|
|
35
|
-
|
|
36
|
+
o(() => q.pageContext.entity.data[e3], (e4, t2) => {
|
|
36
37
|
null != e4 && function() {
|
|
37
38
|
let e5 = true;
|
|
38
39
|
V.value.forEach((t3) => {
|
|
39
40
|
q.pageContext.entity.data[t3] || (e5 = false);
|
|
40
41
|
}), e5 && J(function(e6, t3) {
|
|
41
|
-
const
|
|
42
|
-
return e6.replace(
|
|
42
|
+
const r2 = /\$\{(\w+)\}/g;
|
|
43
|
+
return e6.replace(r2, (e7, r3) => t3.hasOwnProperty(r3) ? t3[r3] : e7);
|
|
43
44
|
}(_.value.generateRule, q.pageContext.entity.data));
|
|
44
45
|
}();
|
|
45
46
|
});
|
|
46
47
|
})) : w.get(window.$vueApp.config.globalProperties.baseAPI + "/dc/setting-barcode-models/by-code/" + _.value.generateRule).then((e3) => {
|
|
47
48
|
const t2 = JSON.parse(e3.barcodeModelItems);
|
|
48
49
|
t2.forEach((e4) => {
|
|
49
|
-
"-1" !== e4.propDbName && -1 !== e4.propDbName && (V.value.push(e4.propDbName),
|
|
50
|
+
"-1" !== e4.propDbName && -1 !== e4.propDbName && (V.value.push(e4.propDbName), o(() => q.pageContext.entity.data[e4.propDbName], (e5, r2) => {
|
|
50
51
|
if (null != e5) {
|
|
51
52
|
const e6 = b(t2, q.pageContext.entity.data);
|
|
52
53
|
e6 && J(e6);
|
|
@@ -54,12 +55,13 @@ const j = ["src"], D = e({ __name: "barcode-runtime", props: { pageContext: {},
|
|
|
54
55
|
}));
|
|
55
56
|
});
|
|
56
57
|
}).catch((e3) => {
|
|
58
|
+
console.error("获取条码规则失败:", e3);
|
|
57
59
|
})), A.value && L(A.value);
|
|
58
60
|
}), D2({ getValue: function() {
|
|
59
61
|
return x(N, k);
|
|
60
62
|
}, setValue: F }), (e3, t2) => {
|
|
61
|
-
const
|
|
62
|
-
return
|
|
63
|
+
const r2 = l("el-form-item");
|
|
64
|
+
return u(), n(r2, { required: !!_.value.required, class: s(c(P)), "label-width": _.value.labelWidth, style: i(c(O)) }, { label: p(() => [_.value.tittleShow ? (u(), m("div", { key: 0, style: i({ ...c(S) }) }, g(c(R)(_.value.title)), 5)) : f("", true)]), default: p(() => ["QR-code" === _.value.type ? (u(), m("img", { key: 0, src: $.value }, null, 8, j)) : (u(), m("canvas", { key: 1, ref_key: "barcode", ref: I }, null, 512))]), _: 1 }, 8, ["required", "class", "label-width", "style"]);
|
|
63
65
|
};
|
|
64
66
|
} });
|
|
65
67
|
export {
|