@veltra/sheet 2.3.4 → 2.5.0
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/index.d.ts +2 -17
- package/dist/index.js +2 -13
- package/dist/types/index.d.ts +1 -3
- package/package.json +5 -6
- package/src/index.ts +1 -27
- package/src/types/index.ts +0 -2
- package/dist/components/report/binding-badge.js +0 -112
- package/dist/components/report/designer/cell-coords.js +0 -46
- package/dist/components/report/designer/col-widths.js +0 -29
- package/dist/components/report/designer/conditional-rules/helpers.js +0 -139
- package/dist/components/report/designer/drop-highlight-overlay.js +0 -76
- package/dist/components/report/designer/float-panel.js +0 -422
- package/dist/components/report/designer/role.js +0 -17
- package/dist/components/report/designer/rule-preview.js +0 -33
- package/dist/components/report/designer/rule-row.js +0 -253
- package/dist/components/report/designer/rules-dialog.js +0 -118
- package/dist/components/report/designer/topology-overlay.js +0 -122
- package/dist/components/report/designer/topology.js +0 -64
- package/dist/components/report/designer/use-grid-overlay.js +0 -75
- package/dist/components/report/designer-hub.js +0 -177
- package/dist/components/report/field-panel-helpers.js +0 -33
- package/dist/components/report/field-panel.js +0 -132
- package/dist/components/report/filter-bar.js +0 -74
- package/dist/components/report/hub-connection-form.js +0 -145
- package/dist/components/report/hub-dataset-editor.js +0 -409
- package/dist/components/report/preview-grid-size.js +0 -32
- package/dist/components/report/report-designer.js +0 -393
- package/dist/components/report/report-viewer.js +0 -124
- package/dist/components/report/style.d.ts +0 -17
- package/dist/components/report/style.js +0 -18
- package/dist/components/report/style2.css +0 -874
- package/dist/components/report/use-report-designer.js +0 -386
- package/dist/components/report/use-report-viewer.js +0 -55
- package/dist/report/binding.d.ts +0 -83
- package/dist/report/binding.js +0 -334
- package/dist/report/connector.d.ts +0 -66
- package/dist/report/connector.js +0 -159
- package/dist/report/export-xlsx.d.ts +0 -13
- package/dist/report/export-xlsx.js +0 -13
- package/dist/report/filter-bar.d.ts +0 -10
- package/dist/report/filter-bar.js +0 -31
- package/dist/report/index.d.ts +0 -12
- package/dist/report/params.d.ts +0 -13
- package/dist/report/params.js +0 -61
- package/dist/report/render/aggregate.js +0 -169
- package/dist/report/render/builder.d.ts +0 -12
- package/dist/report/render/builder.js +0 -139
- package/dist/report/render/coordinate.d.ts +0 -25
- package/dist/report/render/coordinate.js +0 -733
- package/dist/report/render/index.d.ts +0 -14
- package/dist/report/render/index.js +0 -21
- package/dist/report/render/style-resolver.js +0 -50
- package/dist/report/render/template-index.d.ts +0 -24
- package/dist/report/render/template-index.js +0 -137
- package/dist/report/rules/evaluate.d.ts +0 -25
- package/dist/report/rules/evaluate.js +0 -82
- package/dist/report/rules/index.d.ts +0 -2
- package/dist/report/template.d.ts +0 -63
- package/dist/report/template.js +0 -83
- package/dist/report/types.d.ts +0 -85
- package/dist/types/report-designer.d.ts +0 -38
- package/dist/types/report-viewer.d.ts +0 -38
- package/src/components/report/__test__/binding-badge.test.ts +0 -92
- package/src/components/report/__test__/conditional-rules-helpers.test.ts +0 -88
- package/src/components/report/__test__/field-panel-helpers.test.ts +0 -65
- package/src/components/report/__test__/float-panel-position.test.ts +0 -45
- package/src/components/report/__test__/preview-grid-size.test.ts +0 -63
- package/src/components/report/__test__/report-designer.test.ts +0 -464
- package/src/components/report/__test__/report-viewer.test.ts +0 -357
- package/src/components/report/__test__/topology.test.ts +0 -143
- package/src/components/report/__test__/use-report-designer.test.ts +0 -697
- package/src/components/report/binding-badge.ts +0 -117
- package/src/components/report/designer/cell-coords.ts +0 -95
- package/src/components/report/designer/col-widths.ts +0 -56
- package/src/components/report/designer/conditional-rules/helpers.ts +0 -189
- package/src/components/report/designer/drop-highlight-overlay.vue +0 -75
- package/src/components/report/designer/float-panel.vue +0 -432
- package/src/components/report/designer/role.ts +0 -32
- package/src/components/report/designer/rule-preview.vue +0 -40
- package/src/components/report/designer/rule-row.vue +0 -252
- package/src/components/report/designer/rules-dialog.vue +0 -110
- package/src/components/report/designer/topology-overlay.vue +0 -128
- package/src/components/report/designer/topology.ts +0 -124
- package/src/components/report/designer/use-grid-overlay.ts +0 -114
- package/src/components/report/designer-hub.vue +0 -198
- package/src/components/report/field-panel-helpers.ts +0 -44
- package/src/components/report/field-panel.vue +0 -136
- package/src/components/report/filter-bar.vue +0 -77
- package/src/components/report/hub-connection-form.vue +0 -124
- package/src/components/report/hub-dataset-editor.vue +0 -387
- package/src/components/report/index.ts +0 -2
- package/src/components/report/preview-grid-size.ts +0 -33
- package/src/components/report/report-designer.vue +0 -421
- package/src/components/report/report-viewer.vue +0 -136
- package/src/components/report/style-designer.scss +0 -587
- package/src/components/report/style-hub.scss +0 -292
- package/src/components/report/style-viewer.scss +0 -104
- package/src/components/report/style.scss +0 -3
- package/src/components/report/style.ts +0 -20
- package/src/components/report/use-report-designer.ts +0 -602
- package/src/components/report/use-report-viewer.ts +0 -88
- package/src/report/__test__/binding.test.ts +0 -320
- package/src/report/__test__/connector.test.ts +0 -239
- package/src/report/__test__/export-xlsx.test.ts +0 -96
- package/src/report/__test__/filter-bar.test.ts +0 -58
- package/src/report/__test__/params.test.ts +0 -156
- package/src/report/__test__/render.test.ts +0 -856
- package/src/report/__test__/rules.test.ts +0 -131
- package/src/report/__test__/template.test.ts +0 -366
- package/src/report/binding.ts +0 -474
- package/src/report/connector.ts +0 -206
- package/src/report/export-xlsx.ts +0 -15
- package/src/report/filter-bar.ts +0 -36
- package/src/report/index.ts +0 -13
- package/src/report/params.ts +0 -96
- package/src/report/render/__test__/aggregate.test.ts +0 -16
- package/src/report/render/__test__/coordinate.test.ts +0 -405
- package/src/report/render/aggregate.ts +0 -261
- package/src/report/render/builder.ts +0 -211
- package/src/report/render/coordinate.ts +0 -1239
- package/src/report/render/index.ts +0 -30
- package/src/report/render/style-resolver.ts +0 -68
- package/src/report/render/template-index.ts +0 -200
- package/src/report/rules/evaluate.ts +0 -113
- package/src/report/rules/index.ts +0 -7
- package/src/report/template.ts +0 -145
- package/src/report/types.ts +0 -96
- package/src/types/report-designer.ts +0 -38
- package/src/types/report-viewer.ts +0 -37
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
import { formatBindingPlaceholder, formatCellAddress, formatParentCandidateLabel, inferReportPreset, isReductionAggregate } from "../../../report/binding.js";
|
|
2
|
-
import { resolveGridOverlayLayout } from "./cell-coords.js";
|
|
3
|
-
import { readCellOverlayRect, resolveBindingFloatPanelPosition, useGridOverlaySync } from "./use-grid-overlay.js";
|
|
4
|
-
import { REPORT_PRESET_OPTIONS, presetBindingDefaults } from "./role.js";
|
|
5
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, openBlock, ref, toDisplayString, toRef, unref, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
6
|
-
import { UButton, URadioGroup, USelect, USwitch } from "@veltra/desktop";
|
|
7
|
-
import { bem } from "@veltra/utils";
|
|
8
|
-
//#region src/components/report/designer/float-panel.vue
|
|
9
|
-
const _hoisted_1 = ["title"];
|
|
10
|
-
const CUSTOM_PRESET_VALUE = "__custom__";
|
|
11
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
12
|
-
name: "UReportFloatPanel",
|
|
13
|
-
__name: "float-panel",
|
|
14
|
-
props: {
|
|
15
|
-
cell: {},
|
|
16
|
-
binding: {},
|
|
17
|
-
resolvedRowParentLabel: {},
|
|
18
|
-
resolvedColParentLabel: {},
|
|
19
|
-
parentPickMode: {},
|
|
20
|
-
rowParentCandidates: {},
|
|
21
|
-
colParentCandidates: {},
|
|
22
|
-
resolveFieldLabel: { type: Function },
|
|
23
|
-
getBindingAt: { type: Function },
|
|
24
|
-
hostEl: {},
|
|
25
|
-
getGrid: { type: Function }
|
|
26
|
-
},
|
|
27
|
-
emits: [
|
|
28
|
-
"patch",
|
|
29
|
-
"remove",
|
|
30
|
-
"open-rules",
|
|
31
|
-
"start-parent-pick",
|
|
32
|
-
"cancel-parent-pick",
|
|
33
|
-
"clear-parent"
|
|
34
|
-
],
|
|
35
|
-
setup(__props, { emit: __emit }) {
|
|
36
|
-
const props = __props;
|
|
37
|
-
const emit = __emit;
|
|
38
|
-
const cls = bem("report-float-panel");
|
|
39
|
-
const hostEl = toRef(props, "hostEl");
|
|
40
|
-
const panelRef = ref(null);
|
|
41
|
-
const expanded = ref(false);
|
|
42
|
-
const placement = ref("above");
|
|
43
|
-
const presetOptions = computed(() => {
|
|
44
|
-
const options = REPORT_PRESET_OPTIONS.map((item) => ({ ...item }));
|
|
45
|
-
if (props.binding && inferReportPreset(props.binding) === null) options.unshift({
|
|
46
|
-
value: CUSTOM_PRESET_VALUE,
|
|
47
|
-
label: "自定义"
|
|
48
|
-
});
|
|
49
|
-
return options;
|
|
50
|
-
});
|
|
51
|
-
const ALL_AGGREGATE_OPTIONS = [
|
|
52
|
-
{
|
|
53
|
-
value: "list",
|
|
54
|
-
label: "明细"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: "group",
|
|
58
|
-
label: "分组"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
value: "sum",
|
|
62
|
-
label: "求和"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
value: "avg",
|
|
66
|
-
label: "平均"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
value: "count",
|
|
70
|
-
label: "计数"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
value: "max",
|
|
74
|
-
label: "最大"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
value: "min",
|
|
78
|
-
label: "最小"
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
const REDUCTION_AGGREGATE_OPTIONS = ALL_AGGREGATE_OPTIONS.filter((item) => isReductionAggregate(item.value));
|
|
82
|
-
const expandOptions = [
|
|
83
|
-
{
|
|
84
|
-
value: "down",
|
|
85
|
-
label: "向下"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
value: "right",
|
|
89
|
-
label: "向右"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
value: "none",
|
|
93
|
-
label: "不展开"
|
|
94
|
-
}
|
|
95
|
-
];
|
|
96
|
-
const sortOptions = [
|
|
97
|
-
{
|
|
98
|
-
value: "none",
|
|
99
|
-
label: "无"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
value: "asc",
|
|
103
|
-
label: "升序"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
value: "desc",
|
|
107
|
-
label: "降序"
|
|
108
|
-
}
|
|
109
|
-
];
|
|
110
|
-
const panelLeft = ref(0);
|
|
111
|
-
const panelTop = ref(0);
|
|
112
|
-
const inView = ref(false);
|
|
113
|
-
const currentPresetValue = computed(() => {
|
|
114
|
-
if (!props.binding) return "detail";
|
|
115
|
-
return inferReportPreset(props.binding) ?? CUSTOM_PRESET_VALUE;
|
|
116
|
-
});
|
|
117
|
-
const showAggregateSelect = computed(() => {
|
|
118
|
-
const preset = currentPresetValue.value;
|
|
119
|
-
return preset === CUSTOM_PRESET_VALUE || preset === "subtotal" || preset === "grandTotal" || preset === "cross";
|
|
120
|
-
});
|
|
121
|
-
const showExpandSelect = computed(() => {
|
|
122
|
-
const preset = currentPresetValue.value;
|
|
123
|
-
return preset === CUSTOM_PRESET_VALUE || preset === "groupHeader" || preset === "detail";
|
|
124
|
-
});
|
|
125
|
-
const aggregateOptions = computed(() => currentPresetValue.value === CUSTOM_PRESET_VALUE ? ALL_AGGREGATE_OPTIONS : REDUCTION_AGGREGATE_OPTIONS);
|
|
126
|
-
const summaryText = computed(() => {
|
|
127
|
-
if (!props.binding) return "";
|
|
128
|
-
const parts = [formatBindingPlaceholder(props.binding, props.resolveFieldLabel)];
|
|
129
|
-
if (props.binding.rowParent && props.resolvedRowParentLabel !== "—") {
|
|
130
|
-
const parent = props.getBindingAt?.(props.binding.rowParent);
|
|
131
|
-
const name = parent ? props.resolveFieldLabel?.(parent.dataset, parent.field) ?? parent.field : props.resolvedRowParentLabel;
|
|
132
|
-
parts.push(`行父格 ${name} ${props.resolvedRowParentLabel}`);
|
|
133
|
-
}
|
|
134
|
-
if (props.binding.colParent && props.resolvedColParentLabel !== "—") {
|
|
135
|
-
const parent = props.getBindingAt?.(props.binding.colParent);
|
|
136
|
-
const name = parent ? props.resolveFieldLabel?.(parent.dataset, parent.field) ?? parent.field : props.resolvedColParentLabel;
|
|
137
|
-
parts.push(`列父格 ${name} ${props.resolvedColParentLabel}`);
|
|
138
|
-
}
|
|
139
|
-
return parts.join(" · ");
|
|
140
|
-
});
|
|
141
|
-
function candidateOption(addr) {
|
|
142
|
-
const value = formatCellAddress(addr);
|
|
143
|
-
const binding = props.getBindingAt?.(addr);
|
|
144
|
-
return {
|
|
145
|
-
value,
|
|
146
|
-
label: binding ? formatParentCandidateLabel(addr, binding, props.resolveFieldLabel) : value
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
const rowParentOptions = computed(() => props.rowParentCandidates.map(candidateOption));
|
|
150
|
-
const colParentOptions = computed(() => props.colParentCandidates.map(candidateOption));
|
|
151
|
-
const rowParentSelectValue = computed(() => props.binding?.rowParent ? formatCellAddress(props.binding.rowParent) : void 0);
|
|
152
|
-
const colParentSelectValue = computed(() => props.binding?.colParent ? formatCellAddress(props.binding.colParent) : void 0);
|
|
153
|
-
const visible = computed(() => !!props.binding && !!props.cell && inView.value);
|
|
154
|
-
const panelStyle = computed(() => ({
|
|
155
|
-
left: `${panelLeft.value}px`,
|
|
156
|
-
top: `${panelTop.value}px`
|
|
157
|
-
}));
|
|
158
|
-
watch(() => [props.cell?.row, props.cell?.col], () => {
|
|
159
|
-
if (props.parentPickMode) return;
|
|
160
|
-
expanded.value = false;
|
|
161
|
-
});
|
|
162
|
-
watch(() => props.parentPickMode, (mode) => {
|
|
163
|
-
if (mode) expanded.value = true;
|
|
164
|
-
});
|
|
165
|
-
watch(expanded, () => {
|
|
166
|
-
nextTick(() => updatePosition());
|
|
167
|
-
});
|
|
168
|
-
watch(visible, (show) => {
|
|
169
|
-
if (!show) return;
|
|
170
|
-
nextTick(() => updatePosition());
|
|
171
|
-
});
|
|
172
|
-
function onPreset(preset) {
|
|
173
|
-
if (preset === CUSTOM_PRESET_VALUE) return;
|
|
174
|
-
emit("patch", presetBindingDefaults(preset));
|
|
175
|
-
}
|
|
176
|
-
function aggregateDefaultExpand(aggregate) {
|
|
177
|
-
return isReductionAggregate(aggregate) ? "none" : "down";
|
|
178
|
-
}
|
|
179
|
-
function onAggregate(aggregate) {
|
|
180
|
-
emit("patch", {
|
|
181
|
-
aggregate,
|
|
182
|
-
expand: aggregateDefaultExpand(aggregate)
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
function onExpand(expand) {
|
|
186
|
-
emit("patch", { expand });
|
|
187
|
-
}
|
|
188
|
-
function onSort(value) {
|
|
189
|
-
emit("patch", { sort: value });
|
|
190
|
-
}
|
|
191
|
-
function onMergeSpan(merged) {
|
|
192
|
-
emit("patch", { mergeSpan: merged });
|
|
193
|
-
}
|
|
194
|
-
function onRowParentSelect(label) {
|
|
195
|
-
const addr = props.rowParentCandidates.find((item) => formatCellAddress(item) === label);
|
|
196
|
-
if (!addr) return;
|
|
197
|
-
emit("patch", { rowParent: { ...addr } });
|
|
198
|
-
}
|
|
199
|
-
function onColParentSelect(label) {
|
|
200
|
-
const addr = props.colParentCandidates.find((item) => formatCellAddress(item) === label);
|
|
201
|
-
if (!addr) return;
|
|
202
|
-
emit("patch", { colParent: { ...addr } });
|
|
203
|
-
}
|
|
204
|
-
function updatePosition() {
|
|
205
|
-
const cell = props.cell;
|
|
206
|
-
const host = props.hostEl;
|
|
207
|
-
if (!cell || !host) {
|
|
208
|
-
inView.value = false;
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
const layoutResolved = resolveGridOverlayLayout(host);
|
|
212
|
-
const rect = readCellOverlayRect(cell, host, props.getGrid);
|
|
213
|
-
if (!rect || !layoutResolved) {
|
|
214
|
-
inView.value = false;
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
inView.value = true;
|
|
218
|
-
const panelEl = panelRef.value;
|
|
219
|
-
const panelWidth = panelEl?.offsetWidth ?? 340;
|
|
220
|
-
const panelHeight = panelEl?.offsetHeight ?? (expanded.value ? 360 : 68);
|
|
221
|
-
const position = resolveBindingFloatPanelPosition(rect, layoutResolved.layout, panelWidth, panelHeight, host.clientWidth);
|
|
222
|
-
placement.value = position.placement;
|
|
223
|
-
panelLeft.value = position.left;
|
|
224
|
-
panelTop.value = position.top;
|
|
225
|
-
}
|
|
226
|
-
useGridOverlaySync({
|
|
227
|
-
hostEl,
|
|
228
|
-
getGrid: () => props.getGrid(),
|
|
229
|
-
watchSources: () => [
|
|
230
|
-
props.cell?.row,
|
|
231
|
-
props.cell?.col,
|
|
232
|
-
props.binding,
|
|
233
|
-
props.hostEl,
|
|
234
|
-
expanded.value,
|
|
235
|
-
props.parentPickMode
|
|
236
|
-
],
|
|
237
|
-
update: updatePosition
|
|
238
|
-
});
|
|
239
|
-
return (_ctx, _cache) => {
|
|
240
|
-
return __props.binding && __props.cell ? withDirectives((openBlock(), createElementBlock("div", {
|
|
241
|
-
key: 0,
|
|
242
|
-
ref_key: "panelRef",
|
|
243
|
-
ref: panelRef,
|
|
244
|
-
class: normalizeClass([
|
|
245
|
-
unref(cls).b,
|
|
246
|
-
unref(cls).m(placement.value),
|
|
247
|
-
expanded.value ? unref(cls).m("expanded") : ""
|
|
248
|
-
]),
|
|
249
|
-
style: normalizeStyle(panelStyle.value),
|
|
250
|
-
onMousedown: _cache[8] || (_cache[8] = withModifiers(() => {}, ["stop"])),
|
|
251
|
-
onPointerdown: _cache[9] || (_cache[9] = withModifiers(() => {}, ["stop"]))
|
|
252
|
-
}, [createElementVNode("div", { class: normalizeClass(unref(cls).e("bar")) }, [createElementVNode("div", {
|
|
253
|
-
class: normalizeClass(unref(cls).e("summary")),
|
|
254
|
-
title: summaryText.value
|
|
255
|
-
}, toDisplayString(summaryText.value), 11, _hoisted_1), createElementVNode("div", { class: normalizeClass(unref(cls).e("toolbar")) }, [
|
|
256
|
-
createVNode(unref(USelect), {
|
|
257
|
-
size: "small",
|
|
258
|
-
class: normalizeClass([unref(cls).e("select"), unref(cls).em("select", "role")]),
|
|
259
|
-
"model-value": currentPresetValue.value,
|
|
260
|
-
options: presetOptions.value,
|
|
261
|
-
"onUpdate:modelValue": onPreset
|
|
262
|
-
}, null, 8, [
|
|
263
|
-
"class",
|
|
264
|
-
"model-value",
|
|
265
|
-
"options"
|
|
266
|
-
]),
|
|
267
|
-
showAggregateSelect.value ? (openBlock(), createBlock(unref(USelect), {
|
|
268
|
-
key: 0,
|
|
269
|
-
size: "small",
|
|
270
|
-
class: normalizeClass([unref(cls).e("select"), unref(cls).em("select", "aggregate")]),
|
|
271
|
-
"model-value": __props.binding.aggregate,
|
|
272
|
-
options: aggregateOptions.value,
|
|
273
|
-
"onUpdate:modelValue": onAggregate
|
|
274
|
-
}, null, 8, [
|
|
275
|
-
"class",
|
|
276
|
-
"model-value",
|
|
277
|
-
"options"
|
|
278
|
-
])) : createCommentVNode("v-if", true),
|
|
279
|
-
showExpandSelect.value ? (openBlock(), createBlock(unref(USelect), {
|
|
280
|
-
key: 1,
|
|
281
|
-
size: "small",
|
|
282
|
-
class: normalizeClass([unref(cls).e("select"), unref(cls).em("select", "expand")]),
|
|
283
|
-
"model-value": __props.binding.expand,
|
|
284
|
-
options: expandOptions,
|
|
285
|
-
"onUpdate:modelValue": onExpand
|
|
286
|
-
}, null, 8, ["class", "model-value"])) : createCommentVNode("v-if", true),
|
|
287
|
-
createVNode(unref(UButton), {
|
|
288
|
-
size: "small",
|
|
289
|
-
plain: "",
|
|
290
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("open-rules"))
|
|
291
|
-
}, {
|
|
292
|
-
default: withCtx(() => [..._cache[10] || (_cache[10] = [createTextVNode("条件样式", -1)])]),
|
|
293
|
-
_: 1
|
|
294
|
-
}),
|
|
295
|
-
createVNode(unref(UButton), {
|
|
296
|
-
size: "small",
|
|
297
|
-
text: "",
|
|
298
|
-
type: "danger",
|
|
299
|
-
onClick: _cache[1] || (_cache[1] = ($event) => emit("remove"))
|
|
300
|
-
}, {
|
|
301
|
-
default: withCtx(() => [..._cache[11] || (_cache[11] = [createTextVNode("删除绑定", -1)])]),
|
|
302
|
-
_: 1
|
|
303
|
-
}),
|
|
304
|
-
createVNode(unref(UButton), {
|
|
305
|
-
size: "small",
|
|
306
|
-
text: "",
|
|
307
|
-
class: normalizeClass(unref(cls).e("expand")),
|
|
308
|
-
title: expanded.value ? "收起" : "展开更多",
|
|
309
|
-
onClick: _cache[2] || (_cache[2] = ($event) => expanded.value = !expanded.value)
|
|
310
|
-
}, {
|
|
311
|
-
default: withCtx(() => [createTextVNode(toDisplayString(expanded.value ? "收起" : "展开"), 1)]),
|
|
312
|
-
_: 1
|
|
313
|
-
}, 8, ["class", "title"])
|
|
314
|
-
], 2)], 2), expanded.value ? (openBlock(), createElementBlock("div", {
|
|
315
|
-
key: 0,
|
|
316
|
-
class: normalizeClass(unref(cls).e("body"))
|
|
317
|
-
}, [
|
|
318
|
-
createElementVNode("section", { class: normalizeClass(unref(cls).e("section")) }, [createElementVNode("div", { class: normalizeClass(unref(cls).e("section-label")) }, "数据集", 2), createElementVNode("p", { class: normalizeClass(unref(cls).e("hint")) }, toDisplayString(__props.binding.dataset), 3)], 2),
|
|
319
|
-
createElementVNode("section", { class: normalizeClass(unref(cls).e("section")) }, [createElementVNode("div", { class: normalizeClass(unref(cls).e("section-label")) }, "排序", 2), createVNode(unref(URadioGroup), {
|
|
320
|
-
size: "small",
|
|
321
|
-
items: sortOptions,
|
|
322
|
-
"model-value": __props.binding.sort ?? "none",
|
|
323
|
-
"onUpdate:modelValue": onSort
|
|
324
|
-
}, null, 8, ["model-value"])], 2),
|
|
325
|
-
createElementVNode("section", { class: normalizeClass(unref(cls).e("section")) }, [createElementVNode("div", { class: normalizeClass(unref(cls).e("section-label")) }, "扩展实例合并单元格", 2), createVNode(unref(USwitch), {
|
|
326
|
-
size: "small",
|
|
327
|
-
"model-value": __props.binding.mergeSpan !== false,
|
|
328
|
-
"onUpdate:modelValue": onMergeSpan
|
|
329
|
-
}, null, 8, ["model-value"])], 2),
|
|
330
|
-
createElementVNode("section", { class: normalizeClass(unref(cls).e("section")) }, [
|
|
331
|
-
createElementVNode("div", { class: normalizeClass(unref(cls).e("section-label")) }, "行方向父格", 2),
|
|
332
|
-
createElementVNode("p", { class: normalizeClass(unref(cls).e("hint")) }, "当前:" + toDisplayString(__props.resolvedRowParentLabel), 3),
|
|
333
|
-
createElementVNode("div", { class: normalizeClass(unref(cls).e("parent-actions")) }, [
|
|
334
|
-
createVNode(unref(UButton), {
|
|
335
|
-
size: "small",
|
|
336
|
-
plain: "",
|
|
337
|
-
type: __props.parentPickMode === "row" ? "primary" : void 0,
|
|
338
|
-
onClick: _cache[3] || (_cache[3] = ($event) => emit("start-parent-pick", "row"))
|
|
339
|
-
}, {
|
|
340
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.parentPickMode === "row" ? "点选目标格…" : "设置行方向父格"), 1)]),
|
|
341
|
-
_: 1
|
|
342
|
-
}, 8, ["type"]),
|
|
343
|
-
rowParentOptions.value.length > 0 ? (openBlock(), createBlock(unref(USelect), {
|
|
344
|
-
key: 0,
|
|
345
|
-
size: "small",
|
|
346
|
-
class: normalizeClass(unref(cls).e("parent-select")),
|
|
347
|
-
placeholder: "候选格",
|
|
348
|
-
"model-value": rowParentSelectValue.value,
|
|
349
|
-
options: rowParentOptions.value,
|
|
350
|
-
"onUpdate:modelValue": onRowParentSelect
|
|
351
|
-
}, null, 8, [
|
|
352
|
-
"class",
|
|
353
|
-
"model-value",
|
|
354
|
-
"options"
|
|
355
|
-
])) : createCommentVNode("v-if", true),
|
|
356
|
-
__props.binding.rowParent ? (openBlock(), createBlock(unref(UButton), {
|
|
357
|
-
key: 1,
|
|
358
|
-
size: "small",
|
|
359
|
-
text: "",
|
|
360
|
-
type: "danger",
|
|
361
|
-
onClick: _cache[4] || (_cache[4] = ($event) => emit("clear-parent", "row"))
|
|
362
|
-
}, {
|
|
363
|
-
default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" 清除 ", -1)])]),
|
|
364
|
-
_: 1
|
|
365
|
-
})) : createCommentVNode("v-if", true)
|
|
366
|
-
], 2)
|
|
367
|
-
], 2),
|
|
368
|
-
createElementVNode("section", { class: normalizeClass(unref(cls).e("section")) }, [
|
|
369
|
-
createElementVNode("div", { class: normalizeClass(unref(cls).e("section-label")) }, "列方向父格", 2),
|
|
370
|
-
createElementVNode("p", { class: normalizeClass(unref(cls).e("hint")) }, "当前:" + toDisplayString(__props.resolvedColParentLabel), 3),
|
|
371
|
-
createElementVNode("div", { class: normalizeClass(unref(cls).e("parent-actions")) }, [
|
|
372
|
-
createVNode(unref(UButton), {
|
|
373
|
-
size: "small",
|
|
374
|
-
plain: "",
|
|
375
|
-
type: __props.parentPickMode === "col" ? "primary" : void 0,
|
|
376
|
-
onClick: _cache[5] || (_cache[5] = ($event) => emit("start-parent-pick", "col"))
|
|
377
|
-
}, {
|
|
378
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.parentPickMode === "col" ? "点选目标格…" : "设置列方向父格"), 1)]),
|
|
379
|
-
_: 1
|
|
380
|
-
}, 8, ["type"]),
|
|
381
|
-
colParentOptions.value.length > 0 ? (openBlock(), createBlock(unref(USelect), {
|
|
382
|
-
key: 0,
|
|
383
|
-
size: "small",
|
|
384
|
-
class: normalizeClass(unref(cls).e("parent-select")),
|
|
385
|
-
placeholder: "候选格",
|
|
386
|
-
"model-value": colParentSelectValue.value,
|
|
387
|
-
options: colParentOptions.value,
|
|
388
|
-
"onUpdate:modelValue": onColParentSelect
|
|
389
|
-
}, null, 8, [
|
|
390
|
-
"class",
|
|
391
|
-
"model-value",
|
|
392
|
-
"options"
|
|
393
|
-
])) : createCommentVNode("v-if", true),
|
|
394
|
-
__props.binding.colParent ? (openBlock(), createBlock(unref(UButton), {
|
|
395
|
-
key: 1,
|
|
396
|
-
size: "small",
|
|
397
|
-
text: "",
|
|
398
|
-
type: "danger",
|
|
399
|
-
onClick: _cache[6] || (_cache[6] = ($event) => emit("clear-parent", "col"))
|
|
400
|
-
}, {
|
|
401
|
-
default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" 清除 ", -1)])]),
|
|
402
|
-
_: 1
|
|
403
|
-
})) : createCommentVNode("v-if", true)
|
|
404
|
-
], 2)
|
|
405
|
-
], 2),
|
|
406
|
-
__props.parentPickMode ? (openBlock(), createElementBlock("footer", {
|
|
407
|
-
key: 0,
|
|
408
|
-
class: normalizeClass(unref(cls).e("footer"))
|
|
409
|
-
}, [createVNode(unref(UButton), {
|
|
410
|
-
size: "small",
|
|
411
|
-
plain: "",
|
|
412
|
-
onClick: _cache[7] || (_cache[7] = ($event) => emit("cancel-parent-pick"))
|
|
413
|
-
}, {
|
|
414
|
-
default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode("取消点选", -1)])]),
|
|
415
|
-
_: 1
|
|
416
|
-
})], 2)) : createCommentVNode("v-if", true)
|
|
417
|
-
], 2)) : createCommentVNode("v-if", true)], 38)), [[vShow, visible.value]]) : createCommentVNode("v-if", true);
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
//#endregion
|
|
422
|
-
export { _sfc_main as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { presetBindingPatch } from "../../../report/binding.js";
|
|
2
|
-
const REPORT_PRESET_OPTIONS = Object.entries({
|
|
3
|
-
groupHeader: "分组头",
|
|
4
|
-
detail: "明细行",
|
|
5
|
-
subtotal: "小计行",
|
|
6
|
-
grandTotal: "总计行",
|
|
7
|
-
cross: "交叉格"
|
|
8
|
-
}).map(([value, label]) => ({
|
|
9
|
-
value,
|
|
10
|
-
label
|
|
11
|
-
}));
|
|
12
|
-
/** 切换预设时写入 expand / aggregate / 父格组合(父格除 grandTotal 外保留既有值) */
|
|
13
|
-
function presetBindingDefaults(preset) {
|
|
14
|
-
return presetBindingPatch(preset);
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { REPORT_PRESET_OPTIONS, presetBindingDefaults };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { computed, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref } from "vue";
|
|
2
|
-
import { bem } from "@veltra/utils";
|
|
3
|
-
//#region src/components/report/designer/rule-preview.vue
|
|
4
|
-
const _hoisted_1 = ["title"];
|
|
5
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
-
name: "UReportRulePreview",
|
|
7
|
-
__name: "rule-preview",
|
|
8
|
-
props: { rule: {} },
|
|
9
|
-
setup(__props) {
|
|
10
|
-
const props = __props;
|
|
11
|
-
const cls = bem("report-rule-preview");
|
|
12
|
-
const previewStyle = computed(() => {
|
|
13
|
-
const { fill, font } = props.rule.style;
|
|
14
|
-
return {
|
|
15
|
-
backgroundColor: fill?.color || "transparent",
|
|
16
|
-
color: font?.color || "inherit",
|
|
17
|
-
fontWeight: font?.bold ? "700" : "400",
|
|
18
|
-
fontStyle: font?.italic ? "italic" : "normal"
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
const previewLabel = computed(() => props.rule.scope === "row" ? "整行" : "Aa");
|
|
22
|
-
const previewTitle = computed(() => props.rule.scope === "row" ? "整行作用范围:命中后染满物理输出行(交叉表会染满整行,明细行报表更合适)" : "本格作用范围");
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
return openBlock(), createElementBlock("span", {
|
|
25
|
-
class: normalizeClass([unref(cls).b, __props.rule.scope === "row" && unref(cls).m("row")]),
|
|
26
|
-
style: normalizeStyle(previewStyle.value),
|
|
27
|
-
title: previewTitle.value
|
|
28
|
-
}, toDisplayString(previewLabel.value), 15, _hoisted_1);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
//#endregion
|
|
33
|
-
export { _sfc_main as default };
|