sun-card-design 1.1.37 → 1.1.38
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/package.json +1 -1
- package/dist/mobile/sun-card-design-mobile.es61.js +0 -98
- package/dist/mobile/sun-card-design-mobile.es62.js +0 -98
- package/dist/public/sun-card-designer.css +0 -1
- package/dist/sun-card-designer.es.js +0 -25
- package/dist/sun-card-designer.es10.js +0 -167
- package/dist/sun-card-designer.es11.js +0 -197
- package/dist/sun-card-designer.es12.js +0 -203
- package/dist/sun-card-designer.es13.js +0 -130
- package/dist/sun-card-designer.es14.js +0 -120
- package/dist/sun-card-designer.es151.js +0 -4
- package/dist/sun-card-designer.es152.js +0 -4
- package/dist/sun-card-designer.es153.js +0 -4
- package/dist/sun-card-designer.es154.js +0 -4
- package/dist/sun-card-designer.es155.js +0 -82
- package/dist/sun-card-designer.es156.js +0 -91
- package/dist/sun-card-designer.es157.js +0 -92
- package/dist/sun-card-designer.es158.js +0 -191
- package/dist/sun-card-designer.es159.js +0 -86
- package/dist/sun-card-designer.es16.js +0 -10
- package/dist/sun-card-designer.es160.js +0 -238
- package/dist/sun-card-designer.es161.js +0 -113
- package/dist/sun-card-designer.es162.js +0 -49
- package/dist/sun-card-designer.es163.js +0 -43
- package/dist/sun-card-designer.es164.js +0 -39
- package/dist/sun-card-designer.es165.js +0 -46
- package/dist/sun-card-designer.es166.js +0 -58
- package/dist/sun-card-designer.es167.js +0 -56
- package/dist/sun-card-designer.es168.js +0 -58
- package/dist/sun-card-designer.es169.js +0 -73
- package/dist/sun-card-designer.es17.js +0 -333
- package/dist/sun-card-designer.es170.js +0 -59
- package/dist/sun-card-designer.es171.js +0 -69
- package/dist/sun-card-designer.es172.js +0 -182
- package/dist/sun-card-designer.es173.js +0 -176
- package/dist/sun-card-designer.es174.js +0 -184
- package/dist/sun-card-designer.es175.js +0 -409
- package/dist/sun-card-designer.es176.js +0 -365
- package/dist/sun-card-designer.es177.js +0 -70
- package/dist/sun-card-designer.es178.js +0 -68
- package/dist/sun-card-designer.es179.js +0 -184
- package/dist/sun-card-designer.es18.js +0 -68
- package/dist/sun-card-designer.es180.js +0 -193
- package/dist/sun-card-designer.es181.js +0 -193
- package/dist/sun-card-designer.es182.js +0 -193
- package/dist/sun-card-designer.es184.js +0 -228
- package/dist/sun-card-designer.es185.js +0 -71
- package/dist/sun-card-designer.es19.js +0 -611
- package/dist/sun-card-designer.es196.js +0 -4
- package/dist/sun-card-designer.es20.js +0 -225
- package/dist/sun-card-designer.es201.js +0 -125
- package/dist/sun-card-designer.es21.js +0 -69
- package/dist/sun-card-designer.es22.js +0 -719
- package/dist/sun-card-designer.es220.js +0 -63
- package/dist/sun-card-designer.es221.js +0 -80
- package/dist/sun-card-designer.es222.js +0 -82
- package/dist/sun-card-designer.es223.js +0 -94
- package/dist/sun-card-designer.es224.js +0 -87
- package/dist/sun-card-designer.es225.js +0 -226
- package/dist/sun-card-designer.es226.js +0 -105
- package/dist/sun-card-designer.es227.js +0 -45
- package/dist/sun-card-designer.es228.js +0 -31
- package/dist/sun-card-designer.es229.js +0 -29
- package/dist/sun-card-designer.es23.js +0 -211
- package/dist/sun-card-designer.es230.js +0 -32
- package/dist/sun-card-designer.es231.js +0 -46
- package/dist/sun-card-designer.es232.js +0 -42
- package/dist/sun-card-designer.es233.js +0 -44
- package/dist/sun-card-designer.es234.js +0 -61
- package/dist/sun-card-designer.es235.js +0 -46
- package/dist/sun-card-designer.es236.js +0 -54
- package/dist/sun-card-designer.es237.js +0 -130
- package/dist/sun-card-designer.es238.js +0 -127
- package/dist/sun-card-designer.es239.js +0 -132
- package/dist/sun-card-designer.es24.js +0 -265
- package/dist/sun-card-designer.es240.js +0 -375
- package/dist/sun-card-designer.es241.js +0 -348
- package/dist/sun-card-designer.es242.js +0 -69
- package/dist/sun-card-designer.es243.js +0 -65
- package/dist/sun-card-designer.es244.js +0 -87
- package/dist/sun-card-designer.es245.js +0 -98
- package/dist/sun-card-designer.es246.js +0 -98
- package/dist/sun-card-designer.es247.js +0 -98
- package/dist/sun-card-designer.es25.js +0 -857
- package/dist/sun-card-designer.es26.js +0 -768
- package/dist/sun-card-designer.es260.js +0 -125
- package/dist/sun-card-designer.es27.js +0 -264
- package/dist/sun-card-designer.es273.js +0 -192
- package/dist/sun-card-designer.es28.js +0 -809
- package/dist/sun-card-designer.es29.js +0 -220
- package/dist/sun-card-designer.es3.js +0 -506
- package/dist/sun-card-designer.es30.js +0 -809
- package/dist/sun-card-designer.es31.js +0 -220
- package/dist/sun-card-designer.es32.js +0 -820
- package/dist/sun-card-designer.es33.js +0 -225
- package/dist/sun-card-designer.es34.js +0 -69
- package/dist/sun-card-designer.es35.js +0 -375
- package/dist/sun-card-designer.es36.js +0 -186
- package/dist/sun-card-designer.es37.js +0 -119
- package/dist/sun-card-designer.es38.js +0 -354
- package/dist/sun-card-designer.es39.js +0 -127
- package/dist/sun-card-designer.es4.js +0 -365
- package/dist/sun-card-designer.es40.js +0 -100
- package/dist/sun-card-designer.es41.js +0 -214
- package/dist/sun-card-designer.es42.js +0 -119
- package/dist/sun-card-designer.es43.js +0 -250
- package/dist/sun-card-designer.es44.js +0 -118
- package/dist/sun-card-designer.es45.js +0 -64
- package/dist/sun-card-designer.es46.js +0 -223
- package/dist/sun-card-designer.es47.js +0 -196
- package/dist/sun-card-designer.es48.js +0 -77
- package/dist/sun-card-designer.es49.js +0 -85
- package/dist/sun-card-designer.es5.js +0 -317
- package/dist/sun-card-designer.es50.js +0 -85
- package/dist/sun-card-designer.es51.js +0 -64
- package/dist/sun-card-designer.es52.js +0 -283
- package/dist/sun-card-designer.es53.js +0 -64
- package/dist/sun-card-designer.es54.js +0 -142
- package/dist/sun-card-designer.es55.js +0 -52
- package/dist/sun-card-designer.es56.js +0 -85
- package/dist/sun-card-designer.es57.js +0 -258
- package/dist/sun-card-designer.es58.js +0 -226
- package/dist/sun-card-designer.es59.js +0 -169
- package/dist/sun-card-designer.es6.js +0 -190
- package/dist/sun-card-designer.es60.js +0 -280
- package/dist/sun-card-designer.es61.js +0 -168
- package/dist/sun-card-designer.es62.js +0 -219
- package/dist/sun-card-designer.es63.js +0 -168
- package/dist/sun-card-designer.es64.js +0 -275
- package/dist/sun-card-designer.es65.js +0 -760
- package/dist/sun-card-designer.es66.js +0 -272
- package/dist/sun-card-designer.es67.js +0 -559
- package/dist/sun-card-designer.es68.js +0 -124
- package/dist/sun-card-designer.es69.js +0 -528
- package/dist/sun-card-designer.es7.js +0 -65
- package/dist/sun-card-designer.es70.js +0 -185
- package/dist/sun-card-designer.es71.js +0 -107
- package/dist/sun-card-designer.es72.js +0 -153
- package/dist/sun-card-designer.es73.js +0 -315
- package/dist/sun-card-designer.es74.js +0 -114
- package/dist/sun-card-designer.es76.js +0 -4211
- package/dist/sun-card-designer.es79.js +0 -4
- package/dist/sun-card-designer.es8.js +0 -171
- package/dist/sun-card-designer.es80.js +0 -4
- package/dist/sun-card-designer.es81.js +0 -4
- package/dist/sun-card-designer.es84.js +0 -228
- package/dist/sun-card-designer.es87.js +0 -52
- package/dist/sun-card-designer.es88.js +0 -52
- package/dist/sun-card-designer.es9.js +0 -207
- package/dist/sun-card-designer.es91.js +0 -344
- package/dist/sun-card-designer.es92.js +0 -199
- package/dist/sun-card-designer.es95.js +0 -180
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { ref, onMounted, watch, resolveComponent, createElementBlock, openBlock, createVNode, createElementVNode, withCtx } from "vue";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
4
|
-
const _hoisted_1 = { class: "table-style" };
|
|
5
|
-
const _hoisted_2 = { class: "slider-row" };
|
|
6
|
-
const _hoisted_3 = { class: "slider-row" };
|
|
7
|
-
const _hoisted_4 = { class: "slider-row" };
|
|
8
|
-
const _hoisted_5 = { class: "slider-row" };
|
|
9
|
-
const _sfc_main = {
|
|
10
|
-
__name: "tableStylePes",
|
|
11
|
-
props: ["record"],
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const align = ref("left");
|
|
15
|
-
const alignOptions = ref([
|
|
16
|
-
{ label: "左对齐", value: "left" },
|
|
17
|
-
{ label: "居中", value: "center" },
|
|
18
|
-
{ label: "右对齐", value: "right" }
|
|
19
|
-
]);
|
|
20
|
-
onMounted(() => {
|
|
21
|
-
const firstAlign = props.record?.options?.columns?.[0]?.align;
|
|
22
|
-
align.value = firstAlign || "left";
|
|
23
|
-
});
|
|
24
|
-
watch(
|
|
25
|
-
() => align.value,
|
|
26
|
-
(val) => {
|
|
27
|
-
const cols = props.record?.options?.columns || [];
|
|
28
|
-
cols.forEach((col) => {
|
|
29
|
-
col.align = val;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
return (_ctx, _cache) => {
|
|
34
|
-
const _component_a_divider = resolveComponent("a-divider");
|
|
35
|
-
const _component_a_switch = resolveComponent("a-switch");
|
|
36
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
37
|
-
const _component_a_segmented = resolveComponent("a-segmented");
|
|
38
|
-
const _component_a_slider = resolveComponent("a-slider");
|
|
39
|
-
const _component_a_input_number = resolveComponent("a-input-number");
|
|
40
|
-
const _component_a_col = resolveComponent("a-col");
|
|
41
|
-
const _component_a_row = resolveComponent("a-row");
|
|
42
|
-
const _component_a_form = resolveComponent("a-form");
|
|
43
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
44
|
-
createVNode(_component_a_divider, { style: { "margin-top": "0" } }),
|
|
45
|
-
_cache[10] || (_cache[10] = createElementVNode("div", { class: "title" }, "样式", -1)),
|
|
46
|
-
createVNode(_component_a_form, { layout: "vertical" }, {
|
|
47
|
-
default: withCtx(() => [
|
|
48
|
-
createVNode(_component_a_row, { gutter: [16, 16] }, {
|
|
49
|
-
default: withCtx(() => [
|
|
50
|
-
createVNode(_component_a_col, { span: 24 }, {
|
|
51
|
-
default: withCtx(() => [
|
|
52
|
-
createVNode(_component_a_form_item, { label: "显示边框" }, {
|
|
53
|
-
default: withCtx(() => [
|
|
54
|
-
createVNode(_component_a_switch, {
|
|
55
|
-
checked: props.record.options.style.bordered,
|
|
56
|
-
"onUpdate:checked": _cache[0] || (_cache[0] = ($event) => props.record.options.style.bordered = $event)
|
|
57
|
-
}, null, 8, ["checked"])
|
|
58
|
-
]),
|
|
59
|
-
_: 1
|
|
60
|
-
}),
|
|
61
|
-
createVNode(_component_a_form_item, { label: "对齐方式" }, {
|
|
62
|
-
default: withCtx(() => [
|
|
63
|
-
createVNode(_component_a_segmented, {
|
|
64
|
-
block: "",
|
|
65
|
-
value: align.value,
|
|
66
|
-
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => align.value = $event),
|
|
67
|
-
options: alignOptions.value
|
|
68
|
-
}, null, 8, ["value", "options"])
|
|
69
|
-
]),
|
|
70
|
-
_: 1
|
|
71
|
-
}),
|
|
72
|
-
createVNode(_component_a_form_item, { label: "文字大小" }, {
|
|
73
|
-
default: withCtx(() => [
|
|
74
|
-
createElementVNode("div", _hoisted_2, [
|
|
75
|
-
createVNode(_component_a_slider, {
|
|
76
|
-
min: 12,
|
|
77
|
-
max: 36,
|
|
78
|
-
value: props.record.options.style.fontSize,
|
|
79
|
-
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => props.record.options.style.fontSize = $event),
|
|
80
|
-
style: { "flex": "1", "margin-right": "12px" }
|
|
81
|
-
}, null, 8, ["value"]),
|
|
82
|
-
createVNode(_component_a_input_number, {
|
|
83
|
-
min: 12,
|
|
84
|
-
max: 18,
|
|
85
|
-
value: props.record.options.style.fontSize,
|
|
86
|
-
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => props.record.options.style.fontSize = $event)
|
|
87
|
-
}, null, 8, ["value"])
|
|
88
|
-
])
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
}),
|
|
92
|
-
createVNode(_component_a_form_item, { label: "边距" }, {
|
|
93
|
-
default: withCtx(() => [
|
|
94
|
-
createElementVNode("div", _hoisted_3, [
|
|
95
|
-
createVNode(_component_a_slider, {
|
|
96
|
-
min: 2,
|
|
97
|
-
max: 20,
|
|
98
|
-
value: props.record.options.style.padding,
|
|
99
|
-
"onUpdate:value": _cache[4] || (_cache[4] = ($event) => props.record.options.style.padding = $event),
|
|
100
|
-
style: { "flex": "1", "margin-right": "12px" }
|
|
101
|
-
}, null, 8, ["value"]),
|
|
102
|
-
createVNode(_component_a_input_number, {
|
|
103
|
-
min: 14,
|
|
104
|
-
max: 36,
|
|
105
|
-
value: props.record.options.style.padding,
|
|
106
|
-
"onUpdate:value": _cache[5] || (_cache[5] = ($event) => props.record.options.style.padding = $event)
|
|
107
|
-
}, null, 8, ["value"])
|
|
108
|
-
])
|
|
109
|
-
]),
|
|
110
|
-
_: 1
|
|
111
|
-
}),
|
|
112
|
-
createVNode(_component_a_form_item, { label: "上下边距" }, {
|
|
113
|
-
default: withCtx(() => [
|
|
114
|
-
createElementVNode("div", _hoisted_4, [
|
|
115
|
-
createVNode(_component_a_slider, {
|
|
116
|
-
min: 0,
|
|
117
|
-
max: 10,
|
|
118
|
-
value: props.record.options.style.tbPadding,
|
|
119
|
-
"onUpdate:value": _cache[6] || (_cache[6] = ($event) => props.record.options.style.tbPadding = $event),
|
|
120
|
-
style: { "flex": "1", "margin-right": "12px" }
|
|
121
|
-
}, null, 8, ["value"]),
|
|
122
|
-
createVNode(_component_a_input_number, {
|
|
123
|
-
min: 0,
|
|
124
|
-
max: 10,
|
|
125
|
-
value: props.record.options.style.tbPadding,
|
|
126
|
-
"onUpdate:value": _cache[7] || (_cache[7] = ($event) => props.record.options.style.tbPadding = $event)
|
|
127
|
-
}, null, 8, ["value"])
|
|
128
|
-
])
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
}),
|
|
132
|
-
createVNode(_component_a_form_item, { label: "左右边距" }, {
|
|
133
|
-
default: withCtx(() => [
|
|
134
|
-
createElementVNode("div", _hoisted_5, [
|
|
135
|
-
createVNode(_component_a_slider, {
|
|
136
|
-
min: 0,
|
|
137
|
-
max: 10,
|
|
138
|
-
value: props.record.options.style.lrPadding,
|
|
139
|
-
"onUpdate:value": _cache[8] || (_cache[8] = ($event) => props.record.options.style.lrPadding = $event),
|
|
140
|
-
style: { "flex": "1", "margin-right": "12px" }
|
|
141
|
-
}, null, 8, ["value"]),
|
|
142
|
-
createVNode(_component_a_input_number, {
|
|
143
|
-
min: 0,
|
|
144
|
-
max: 10,
|
|
145
|
-
value: props.record.options.style.lrPadding,
|
|
146
|
-
"onUpdate:value": _cache[9] || (_cache[9] = ($event) => props.record.options.style.lrPadding = $event)
|
|
147
|
-
}, null, 8, ["value"])
|
|
148
|
-
])
|
|
149
|
-
]),
|
|
150
|
-
_: 1
|
|
151
|
-
})
|
|
152
|
-
]),
|
|
153
|
-
_: 1
|
|
154
|
-
})
|
|
155
|
-
]),
|
|
156
|
-
_: 1
|
|
157
|
-
})
|
|
158
|
-
]),
|
|
159
|
-
_: 1
|
|
160
|
-
})
|
|
161
|
-
]);
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
const TableStylePes = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9addb5d5"]]);
|
|
166
|
-
export {
|
|
167
|
-
TableStylePes as default
|
|
168
|
-
};
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { ref, reactive, computed, onMounted, nextTick, watch, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, createBlock, unref, createTextVNode, Fragment, renderList, withModifiers, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
-
import { Vue3JsonEditor } from "vue3-json-editor";
|
|
3
|
-
import { useCardManageStore } from "./sun-card-designer.es13.js";
|
|
4
|
-
/* empty css */
|
|
5
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
6
|
-
const _hoisted_1 = { class: "bar-base-pes" };
|
|
7
|
-
const _hoisted_2 = { class: "series-header" };
|
|
8
|
-
const _hoisted_3 = { class: "left" };
|
|
9
|
-
const _hoisted_4 = { class: "right" };
|
|
10
|
-
const _sfc_main = {
|
|
11
|
-
__name: "barChartBasePes",
|
|
12
|
-
props: ["record"],
|
|
13
|
-
setup(__props) {
|
|
14
|
-
const props = __props;
|
|
15
|
-
const cardManageStore = useCardManageStore();
|
|
16
|
-
const xAxisDataProxy = ref([]);
|
|
17
|
-
const xAxisDynamicValue = ref(null);
|
|
18
|
-
const seriesList = reactive([]);
|
|
19
|
-
const showEditors = ref(true);
|
|
20
|
-
const modeOptions = ref([
|
|
21
|
-
{ value: "static", label: "静态" },
|
|
22
|
-
{ value: "dynamic", label: "动态" }
|
|
23
|
-
]);
|
|
24
|
-
const arrayVariableOptions = computed(() => {
|
|
25
|
-
return (cardManageStore.variableList || []).filter((e) => e.type === "Array").map((e) => ({ label: e.name, value: e.name }));
|
|
26
|
-
});
|
|
27
|
-
const ensureOptionArrays = () => {
|
|
28
|
-
props.record.options = props.record.options || {};
|
|
29
|
-
if (!Array.isArray(props.record.options.xAxisConfig)) props.record.options.xAxisConfig = [{}];
|
|
30
|
-
if (!Array.isArray(props.record.options.seriesConfig)) props.record.options.seriesConfig = [{ type: "bar", data: [] }];
|
|
31
|
-
};
|
|
32
|
-
const seriseIndex = ref(0);
|
|
33
|
-
const onAddSerise = () => {
|
|
34
|
-
ensureOptionArrays();
|
|
35
|
-
const list = props.record.options.seriesConfig || [];
|
|
36
|
-
if (list.length >= 3) return;
|
|
37
|
-
const base = list[0] || { type: "bar", data: [] };
|
|
38
|
-
const item = JSON.parse(JSON.stringify(base));
|
|
39
|
-
item.name = `chart${list.length + 1}`;
|
|
40
|
-
list.push(item);
|
|
41
|
-
seriesList.push({ seriesDataProxy: JSON.parse(JSON.stringify(item.data)), seriesDynamicValue: null });
|
|
42
|
-
seriseIndex.value = list.length - 1;
|
|
43
|
-
};
|
|
44
|
-
const onRemoveSeries = (idx) => {
|
|
45
|
-
ensureOptionArrays();
|
|
46
|
-
const list = props.record.options.seriesConfig || [];
|
|
47
|
-
if (list.length <= 1) return;
|
|
48
|
-
list.splice(idx, 1);
|
|
49
|
-
seriesList.splice(idx, 1);
|
|
50
|
-
list.forEach((s, i) => {
|
|
51
|
-
s.name = `chart${i + 1}`;
|
|
52
|
-
});
|
|
53
|
-
if (seriseIndex.value >= list.length) seriseIndex.value = list.length - 1;
|
|
54
|
-
};
|
|
55
|
-
const onxAxisChange = (params) => {
|
|
56
|
-
xAxisDataProxy.value = params;
|
|
57
|
-
};
|
|
58
|
-
const onSeriesChange = (params, index) => {
|
|
59
|
-
seriesList[index].seriesDataProxy = params;
|
|
60
|
-
};
|
|
61
|
-
onMounted(async () => {
|
|
62
|
-
ensureOptionArrays();
|
|
63
|
-
showEditors.value = false;
|
|
64
|
-
await nextTick();
|
|
65
|
-
showEditors.value = true;
|
|
66
|
-
if (props.record.options.mode === "static") {
|
|
67
|
-
xAxisDataProxy.value = JSON.parse(JSON.stringify(props.record.options.xAxisConfig[0]?.data || []));
|
|
68
|
-
xAxisDynamicValue.value = null;
|
|
69
|
-
seriesList.splice(0, seriesList.length);
|
|
70
|
-
props.record.options.seriesConfig.forEach((e) => {
|
|
71
|
-
seriesList.push({ seriesDataProxy: JSON.parse(JSON.stringify(e.data)), seriesDynamicValue: null });
|
|
72
|
-
});
|
|
73
|
-
} else {
|
|
74
|
-
xAxisDataProxy.value = "";
|
|
75
|
-
xAxisDynamicValue.value = JSON.parse(JSON.stringify(props.record.options.xAxisConfig[0]?.data || null));
|
|
76
|
-
seriesList.splice(0, seriesList.length);
|
|
77
|
-
props.record.options.seriesConfig.forEach((e) => {
|
|
78
|
-
seriesList.push({ seriesDataProxy: "", seriesDynamicValue: JSON.parse(JSON.stringify(e.data)) });
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
watch(() => xAxisDataProxy.value, (val) => {
|
|
83
|
-
if (val !== "") {
|
|
84
|
-
ensureOptionArrays();
|
|
85
|
-
props.record.options.xAxisConfig[0].data = JSON.parse(JSON.stringify(val));
|
|
86
|
-
}
|
|
87
|
-
}, { deep: true });
|
|
88
|
-
watch(seriesList, () => {
|
|
89
|
-
seriesList.forEach((_, index) => {
|
|
90
|
-
if ((props.record.options.mode || "static") === "static") {
|
|
91
|
-
const val = seriesList[index].seriesDataProxy;
|
|
92
|
-
if (val !== "") {
|
|
93
|
-
ensureOptionArrays();
|
|
94
|
-
props.record.options.seriesConfig[index] = props.record.options.seriesConfig[index] || { type: "bar", data: [] };
|
|
95
|
-
props.record.options.seriesConfig[index].data = JSON.parse(JSON.stringify(val));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}, { deep: true });
|
|
100
|
-
watch(() => props.record.options.mode, async (val) => {
|
|
101
|
-
if (val === "static") {
|
|
102
|
-
xAxisDataProxy.value = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
103
|
-
xAxisDynamicValue.value = null;
|
|
104
|
-
seriesList.splice(0, seriesList.length);
|
|
105
|
-
props.record.options.seriesConfig.forEach(() => {
|
|
106
|
-
seriesList.push({
|
|
107
|
-
seriesDataProxy: [120, 200, 150, 80, 70, 110, 130],
|
|
108
|
-
seriesDynamicValue: null
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
seriseIndex.value = 0;
|
|
112
|
-
} else {
|
|
113
|
-
xAxisDataProxy.value = "";
|
|
114
|
-
xAxisDynamicValue.value = null;
|
|
115
|
-
seriesList.splice(0, seriesList.length);
|
|
116
|
-
props.record.options.seriesConfig.forEach(() => {
|
|
117
|
-
seriesList.push({
|
|
118
|
-
seriesDataProxy: "",
|
|
119
|
-
seriesDynamicValue: null
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
seriseIndex.value = 0;
|
|
123
|
-
}
|
|
124
|
-
showEditors.value = false;
|
|
125
|
-
await nextTick();
|
|
126
|
-
showEditors.value = true;
|
|
127
|
-
});
|
|
128
|
-
const applyXAxisDynamic = (val) => {
|
|
129
|
-
ensureOptionArrays();
|
|
130
|
-
props.record.options.xAxisConfig[0].data = JSON.parse(JSON.stringify(val));
|
|
131
|
-
};
|
|
132
|
-
const applySeriesDynamic = (val, index) => {
|
|
133
|
-
ensureOptionArrays();
|
|
134
|
-
props.record.options.seriesConfig[index] = props.record.options.seriesConfig[index] || { type: "bar", data: [] };
|
|
135
|
-
props.record.options.seriesConfig[index].data = JSON.parse(JSON.stringify(val));
|
|
136
|
-
seriesList[index].seriesDynamicValue = val;
|
|
137
|
-
};
|
|
138
|
-
return (_ctx, _cache) => {
|
|
139
|
-
const _component_a_segmented = resolveComponent("a-segmented");
|
|
140
|
-
const _component_a_select = resolveComponent("a-select");
|
|
141
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
142
|
-
const _component_a_button = resolveComponent("a-button");
|
|
143
|
-
const _component_a_tag = resolveComponent("a-tag");
|
|
144
|
-
const _component_a_input = resolveComponent("a-input");
|
|
145
|
-
const _component_a_col = resolveComponent("a-col");
|
|
146
|
-
const _component_a_row = resolveComponent("a-row");
|
|
147
|
-
const _component_a_form = resolveComponent("a-form");
|
|
148
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
149
|
-
_cache[4] || (_cache[4] = createElementVNode("div", { class: "title" }, "数据", -1)),
|
|
150
|
-
createVNode(_component_a_form, { layout: "vertical" }, {
|
|
151
|
-
default: withCtx(() => [
|
|
152
|
-
createVNode(_component_a_row, { gutter: [16, 16] }, {
|
|
153
|
-
default: withCtx(() => [
|
|
154
|
-
createVNode(_component_a_col, { span: 24 }, {
|
|
155
|
-
default: withCtx(() => [
|
|
156
|
-
createVNode(_component_a_segmented, {
|
|
157
|
-
block: "",
|
|
158
|
-
value: props.record.options.mode,
|
|
159
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => props.record.options.mode = $event),
|
|
160
|
-
options: modeOptions.value,
|
|
161
|
-
style: { "margin-bottom": "10px" }
|
|
162
|
-
}, null, 8, ["value", "options"]),
|
|
163
|
-
createVNode(_component_a_form_item, { label: "X 轴数据" }, {
|
|
164
|
-
default: withCtx(() => [
|
|
165
|
-
showEditors.value && props.record.options.mode === "static" ? (openBlock(), createBlock(unref(Vue3JsonEditor), {
|
|
166
|
-
key: 0,
|
|
167
|
-
mode: "text",
|
|
168
|
-
"show-btns": false,
|
|
169
|
-
expandedOnStart: true,
|
|
170
|
-
modelValue: xAxisDataProxy.value,
|
|
171
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => xAxisDataProxy.value = $event),
|
|
172
|
-
onJsonChange: onxAxisChange
|
|
173
|
-
}, null, 8, ["modelValue"])) : (openBlock(), createBlock(_component_a_select, {
|
|
174
|
-
key: 1,
|
|
175
|
-
value: xAxisDynamicValue.value,
|
|
176
|
-
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => xAxisDynamicValue.value = $event),
|
|
177
|
-
options: arrayVariableOptions.value,
|
|
178
|
-
placeholder: "选择变量",
|
|
179
|
-
onChange: applyXAxisDynamic
|
|
180
|
-
}, null, 8, ["value", "options"]))
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
}),
|
|
184
|
-
createElementVNode("div", _hoisted_2, [
|
|
185
|
-
createElementVNode("div", _hoisted_3, [
|
|
186
|
-
createVNode(_component_a_button, {
|
|
187
|
-
type: "primary",
|
|
188
|
-
size: "small",
|
|
189
|
-
onClick: onAddSerise,
|
|
190
|
-
disabled: (props.record.options.seriesConfig || []).length >= 3
|
|
191
|
-
}, {
|
|
192
|
-
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
193
|
-
createTextVNode("新增图形", -1)
|
|
194
|
-
])]),
|
|
195
|
-
_: 1
|
|
196
|
-
}, 8, ["disabled"])
|
|
197
|
-
]),
|
|
198
|
-
createElementVNode("div", _hoisted_4, [
|
|
199
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.options.seriesConfig || [], (s, idx) => {
|
|
200
|
-
return openBlock(), createBlock(_component_a_tag, {
|
|
201
|
-
key: idx,
|
|
202
|
-
color: seriseIndex.value === idx ? "blue" : void 0,
|
|
203
|
-
closable: (props.record.options.seriesConfig || []).length > 1,
|
|
204
|
-
onClose: withModifiers(() => onRemoveSeries(idx), ["stop", "prevent"]),
|
|
205
|
-
onClick: () => seriseIndex.value = idx,
|
|
206
|
-
style: { "cursor": "pointer", "user-select": "none", "margin-bottom": "6px" }
|
|
207
|
-
}, {
|
|
208
|
-
default: withCtx(() => [
|
|
209
|
-
createTextVNode(toDisplayString(s.name || `系列${idx + 1}`), 1)
|
|
210
|
-
]),
|
|
211
|
-
_: 2
|
|
212
|
-
}, 1032, ["color", "closable", "onClose", "onClick"]);
|
|
213
|
-
}), 128))
|
|
214
|
-
])
|
|
215
|
-
]),
|
|
216
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.options.seriesConfig, (item, index) => {
|
|
217
|
-
return openBlock(), createElementBlock("div", { key: index }, [
|
|
218
|
-
index === seriseIndex.value && seriesList[index] ? (openBlock(), createBlock(_component_a_form_item, {
|
|
219
|
-
key: 0,
|
|
220
|
-
label: ""
|
|
221
|
-
}, {
|
|
222
|
-
default: withCtx(() => [
|
|
223
|
-
showEditors.value && props.record.options.mode === "static" ? (openBlock(), createBlock(unref(Vue3JsonEditor), {
|
|
224
|
-
key: 0,
|
|
225
|
-
mode: "text",
|
|
226
|
-
"show-btns": false,
|
|
227
|
-
expandedOnStart: false,
|
|
228
|
-
modelValue: seriesList[index].seriesDataProxy,
|
|
229
|
-
"onUpdate:modelValue": ($event) => seriesList[index].seriesDataProxy = $event,
|
|
230
|
-
onJsonChange: (value) => onSeriesChange(value, index)
|
|
231
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "onJsonChange"])) : (openBlock(), createBlock(_component_a_select, {
|
|
232
|
-
key: 1,
|
|
233
|
-
value: seriesList[index].seriesDynamicValue,
|
|
234
|
-
"onUpdate:value": ($event) => seriesList[index].seriesDynamicValue = $event,
|
|
235
|
-
options: arrayVariableOptions.value,
|
|
236
|
-
placeholder: "选择数组变量",
|
|
237
|
-
onChange: (val) => applySeriesDynamic(val, index)
|
|
238
|
-
}, null, 8, ["value", "onUpdate:value", "options", "onChange"]))
|
|
239
|
-
]),
|
|
240
|
-
_: 2
|
|
241
|
-
}, 1024)) : createCommentVNode("", true)
|
|
242
|
-
]);
|
|
243
|
-
}), 128)),
|
|
244
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.options.seriesConfig, (item, index) => {
|
|
245
|
-
return openBlock(), createElementBlock("div", { key: index }, [
|
|
246
|
-
createVNode(_component_a_form_item, {
|
|
247
|
-
label: item.name
|
|
248
|
-
}, {
|
|
249
|
-
default: withCtx(() => [
|
|
250
|
-
createVNode(_component_a_input, {
|
|
251
|
-
value: item.name,
|
|
252
|
-
"onUpdate:value": ($event) => item.name = $event
|
|
253
|
-
}, null, 8, ["value", "onUpdate:value"])
|
|
254
|
-
]),
|
|
255
|
-
_: 2
|
|
256
|
-
}, 1032, ["label"])
|
|
257
|
-
]);
|
|
258
|
-
}), 128))
|
|
259
|
-
]),
|
|
260
|
-
_: 1
|
|
261
|
-
})
|
|
262
|
-
]),
|
|
263
|
-
_: 1
|
|
264
|
-
})
|
|
265
|
-
]),
|
|
266
|
-
_: 1
|
|
267
|
-
})
|
|
268
|
-
]);
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
const BarChartBasePes = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2e1071e4"]]);
|
|
273
|
-
export {
|
|
274
|
-
BarChartBasePes as default
|
|
275
|
-
};
|