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.
Files changed (152) hide show
  1. package/package.json +1 -1
  2. package/dist/mobile/sun-card-design-mobile.es61.js +0 -98
  3. package/dist/mobile/sun-card-design-mobile.es62.js +0 -98
  4. package/dist/public/sun-card-designer.css +0 -1
  5. package/dist/sun-card-designer.es.js +0 -25
  6. package/dist/sun-card-designer.es10.js +0 -167
  7. package/dist/sun-card-designer.es11.js +0 -197
  8. package/dist/sun-card-designer.es12.js +0 -203
  9. package/dist/sun-card-designer.es13.js +0 -130
  10. package/dist/sun-card-designer.es14.js +0 -120
  11. package/dist/sun-card-designer.es151.js +0 -4
  12. package/dist/sun-card-designer.es152.js +0 -4
  13. package/dist/sun-card-designer.es153.js +0 -4
  14. package/dist/sun-card-designer.es154.js +0 -4
  15. package/dist/sun-card-designer.es155.js +0 -82
  16. package/dist/sun-card-designer.es156.js +0 -91
  17. package/dist/sun-card-designer.es157.js +0 -92
  18. package/dist/sun-card-designer.es158.js +0 -191
  19. package/dist/sun-card-designer.es159.js +0 -86
  20. package/dist/sun-card-designer.es16.js +0 -10
  21. package/dist/sun-card-designer.es160.js +0 -238
  22. package/dist/sun-card-designer.es161.js +0 -113
  23. package/dist/sun-card-designer.es162.js +0 -49
  24. package/dist/sun-card-designer.es163.js +0 -43
  25. package/dist/sun-card-designer.es164.js +0 -39
  26. package/dist/sun-card-designer.es165.js +0 -46
  27. package/dist/sun-card-designer.es166.js +0 -58
  28. package/dist/sun-card-designer.es167.js +0 -56
  29. package/dist/sun-card-designer.es168.js +0 -58
  30. package/dist/sun-card-designer.es169.js +0 -73
  31. package/dist/sun-card-designer.es17.js +0 -333
  32. package/dist/sun-card-designer.es170.js +0 -59
  33. package/dist/sun-card-designer.es171.js +0 -69
  34. package/dist/sun-card-designer.es172.js +0 -182
  35. package/dist/sun-card-designer.es173.js +0 -176
  36. package/dist/sun-card-designer.es174.js +0 -184
  37. package/dist/sun-card-designer.es175.js +0 -409
  38. package/dist/sun-card-designer.es176.js +0 -365
  39. package/dist/sun-card-designer.es177.js +0 -70
  40. package/dist/sun-card-designer.es178.js +0 -68
  41. package/dist/sun-card-designer.es179.js +0 -184
  42. package/dist/sun-card-designer.es18.js +0 -68
  43. package/dist/sun-card-designer.es180.js +0 -193
  44. package/dist/sun-card-designer.es181.js +0 -193
  45. package/dist/sun-card-designer.es182.js +0 -193
  46. package/dist/sun-card-designer.es184.js +0 -228
  47. package/dist/sun-card-designer.es185.js +0 -71
  48. package/dist/sun-card-designer.es19.js +0 -611
  49. package/dist/sun-card-designer.es196.js +0 -4
  50. package/dist/sun-card-designer.es20.js +0 -225
  51. package/dist/sun-card-designer.es201.js +0 -125
  52. package/dist/sun-card-designer.es21.js +0 -69
  53. package/dist/sun-card-designer.es22.js +0 -719
  54. package/dist/sun-card-designer.es220.js +0 -63
  55. package/dist/sun-card-designer.es221.js +0 -80
  56. package/dist/sun-card-designer.es222.js +0 -82
  57. package/dist/sun-card-designer.es223.js +0 -94
  58. package/dist/sun-card-designer.es224.js +0 -87
  59. package/dist/sun-card-designer.es225.js +0 -226
  60. package/dist/sun-card-designer.es226.js +0 -105
  61. package/dist/sun-card-designer.es227.js +0 -45
  62. package/dist/sun-card-designer.es228.js +0 -31
  63. package/dist/sun-card-designer.es229.js +0 -29
  64. package/dist/sun-card-designer.es23.js +0 -211
  65. package/dist/sun-card-designer.es230.js +0 -32
  66. package/dist/sun-card-designer.es231.js +0 -46
  67. package/dist/sun-card-designer.es232.js +0 -42
  68. package/dist/sun-card-designer.es233.js +0 -44
  69. package/dist/sun-card-designer.es234.js +0 -61
  70. package/dist/sun-card-designer.es235.js +0 -46
  71. package/dist/sun-card-designer.es236.js +0 -54
  72. package/dist/sun-card-designer.es237.js +0 -130
  73. package/dist/sun-card-designer.es238.js +0 -127
  74. package/dist/sun-card-designer.es239.js +0 -132
  75. package/dist/sun-card-designer.es24.js +0 -265
  76. package/dist/sun-card-designer.es240.js +0 -375
  77. package/dist/sun-card-designer.es241.js +0 -348
  78. package/dist/sun-card-designer.es242.js +0 -69
  79. package/dist/sun-card-designer.es243.js +0 -65
  80. package/dist/sun-card-designer.es244.js +0 -87
  81. package/dist/sun-card-designer.es245.js +0 -98
  82. package/dist/sun-card-designer.es246.js +0 -98
  83. package/dist/sun-card-designer.es247.js +0 -98
  84. package/dist/sun-card-designer.es25.js +0 -857
  85. package/dist/sun-card-designer.es26.js +0 -768
  86. package/dist/sun-card-designer.es260.js +0 -125
  87. package/dist/sun-card-designer.es27.js +0 -264
  88. package/dist/sun-card-designer.es273.js +0 -192
  89. package/dist/sun-card-designer.es28.js +0 -809
  90. package/dist/sun-card-designer.es29.js +0 -220
  91. package/dist/sun-card-designer.es3.js +0 -506
  92. package/dist/sun-card-designer.es30.js +0 -809
  93. package/dist/sun-card-designer.es31.js +0 -220
  94. package/dist/sun-card-designer.es32.js +0 -820
  95. package/dist/sun-card-designer.es33.js +0 -225
  96. package/dist/sun-card-designer.es34.js +0 -69
  97. package/dist/sun-card-designer.es35.js +0 -375
  98. package/dist/sun-card-designer.es36.js +0 -186
  99. package/dist/sun-card-designer.es37.js +0 -119
  100. package/dist/sun-card-designer.es38.js +0 -354
  101. package/dist/sun-card-designer.es39.js +0 -127
  102. package/dist/sun-card-designer.es4.js +0 -365
  103. package/dist/sun-card-designer.es40.js +0 -100
  104. package/dist/sun-card-designer.es41.js +0 -214
  105. package/dist/sun-card-designer.es42.js +0 -119
  106. package/dist/sun-card-designer.es43.js +0 -250
  107. package/dist/sun-card-designer.es44.js +0 -118
  108. package/dist/sun-card-designer.es45.js +0 -64
  109. package/dist/sun-card-designer.es46.js +0 -223
  110. package/dist/sun-card-designer.es47.js +0 -196
  111. package/dist/sun-card-designer.es48.js +0 -77
  112. package/dist/sun-card-designer.es49.js +0 -85
  113. package/dist/sun-card-designer.es5.js +0 -317
  114. package/dist/sun-card-designer.es50.js +0 -85
  115. package/dist/sun-card-designer.es51.js +0 -64
  116. package/dist/sun-card-designer.es52.js +0 -283
  117. package/dist/sun-card-designer.es53.js +0 -64
  118. package/dist/sun-card-designer.es54.js +0 -142
  119. package/dist/sun-card-designer.es55.js +0 -52
  120. package/dist/sun-card-designer.es56.js +0 -85
  121. package/dist/sun-card-designer.es57.js +0 -258
  122. package/dist/sun-card-designer.es58.js +0 -226
  123. package/dist/sun-card-designer.es59.js +0 -169
  124. package/dist/sun-card-designer.es6.js +0 -190
  125. package/dist/sun-card-designer.es60.js +0 -280
  126. package/dist/sun-card-designer.es61.js +0 -168
  127. package/dist/sun-card-designer.es62.js +0 -219
  128. package/dist/sun-card-designer.es63.js +0 -168
  129. package/dist/sun-card-designer.es64.js +0 -275
  130. package/dist/sun-card-designer.es65.js +0 -760
  131. package/dist/sun-card-designer.es66.js +0 -272
  132. package/dist/sun-card-designer.es67.js +0 -559
  133. package/dist/sun-card-designer.es68.js +0 -124
  134. package/dist/sun-card-designer.es69.js +0 -528
  135. package/dist/sun-card-designer.es7.js +0 -65
  136. package/dist/sun-card-designer.es70.js +0 -185
  137. package/dist/sun-card-designer.es71.js +0 -107
  138. package/dist/sun-card-designer.es72.js +0 -153
  139. package/dist/sun-card-designer.es73.js +0 -315
  140. package/dist/sun-card-designer.es74.js +0 -114
  141. package/dist/sun-card-designer.es76.js +0 -4211
  142. package/dist/sun-card-designer.es79.js +0 -4
  143. package/dist/sun-card-designer.es8.js +0 -171
  144. package/dist/sun-card-designer.es80.js +0 -4
  145. package/dist/sun-card-designer.es81.js +0 -4
  146. package/dist/sun-card-designer.es84.js +0 -228
  147. package/dist/sun-card-designer.es87.js +0 -52
  148. package/dist/sun-card-designer.es88.js +0 -52
  149. package/dist/sun-card-designer.es9.js +0 -207
  150. package/dist/sun-card-designer.es91.js +0 -344
  151. package/dist/sun-card-designer.es92.js +0 -199
  152. package/dist/sun-card-designer.es95.js +0 -180
@@ -1,46 +0,0 @@
1
- import { resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode, withCtx, unref } from "vue";
2
- import { renderTextByVariables } from "./sun-card-designer.es185.js";
3
- /* empty css */
4
- import _export_sfc from "./sun-card-designer.es16.js";
5
- const _sfc_main = {
6
- __name: "enterpriseSearch",
7
- props: ["record"],
8
- setup(__props) {
9
- const props = __props;
10
- return (_ctx, _cache) => {
11
- const _component_a_select = resolveComponent("a-select");
12
- const _component_a_form_item = resolveComponent("a-form-item");
13
- const _component_a_form = resolveComponent("a-form");
14
- return openBlock(), createElementBlock("div", {
15
- class: "main-enterpriseSearch",
16
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
17
- }, [
18
- createVNode(_component_a_form, {
19
- layout: props.record.options.flex
20
- }, {
21
- default: withCtx(() => [
22
- createVNode(_component_a_form_item, {
23
- label: unref(renderTextByVariables)(props.record.options.label)
24
- }, {
25
- default: withCtx(() => [
26
- createVNode(_component_a_select, {
27
- value: _ctx.value,
28
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.value = $event),
29
- options: [],
30
- style: { "width": "100%" },
31
- placeholder: props.record.options.placeholder
32
- }, null, 8, ["value", "placeholder"])
33
- ]),
34
- _: 1
35
- }, 8, ["label"])
36
- ]),
37
- _: 1
38
- }, 8, ["layout"])
39
- ], 4);
40
- };
41
- }
42
- };
43
- const EnterpriseSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d616ad69"]]);
44
- export {
45
- EnterpriseSearch as default
46
- };
@@ -1,54 +0,0 @@
1
- import { computed, resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode } from "vue";
2
- /* empty css */
3
- import _export_sfc from "./sun-card-designer.es16.js";
4
- const _sfc_main = {
5
- __name: "tableComp",
6
- props: ["record"],
7
- setup(__props) {
8
- const props = __props;
9
- const parseJsonSafe = (str) => {
10
- try {
11
- return JSON.parse(str);
12
- } catch {
13
- return null;
14
- }
15
- };
16
- const resolveArrayFromVariable = (name) => {
17
- if (!name) return [];
18
- const v = (cardManageStore.variableList || []).find((e) => e.name === name);
19
- if (!v || !v.defaultValue) return [];
20
- const data = typeof v.defaultValue === "string" ? parseJsonSafe(v.defaultValue) : v.defaultValue;
21
- return Array.isArray(data) ? data : [];
22
- };
23
- const dataSource = computed(() => {
24
- const val = props.record.options.defaultValue;
25
- if (typeof val === "string") {
26
- return resolveArrayFromVariable(val);
27
- }
28
- return Array.isArray(val) ? val : [];
29
- });
30
- return (_ctx, _cache) => {
31
- const _component_a_table = resolveComponent("a-table");
32
- return openBlock(), createElementBlock("div", {
33
- class: "main-table",
34
- style: normalizeStyle({
35
- "--tbl-font-size": (props.record.options.style.fontSize || 14) + "px",
36
- "--tbl-cell-padding": (props.record.options.style.padding || 6) + "px",
37
- padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px`
38
- })
39
- }, [
40
- createVNode(_component_a_table, {
41
- columns: props.record.options.columns,
42
- "data-source": dataSource.value,
43
- bordered: props.record.options.style.bordered,
44
- size: "small",
45
- pagination: false
46
- }, null, 8, ["columns", "data-source", "bordered"])
47
- ], 4);
48
- };
49
- }
50
- };
51
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f6dd6b54"]]);
52
- export {
53
- Table as default
54
- };
@@ -1,130 +0,0 @@
1
- import { ref, onMounted, nextTick, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, createElementVNode } from "vue";
2
- import { previewData } from "./sun-card-designer.es185.js";
3
- import * as echarts from "echarts";
4
- /* empty css */
5
- import _export_sfc from "./sun-card-designer.es16.js";
6
- const _sfc_main = {
7
- __name: "barChartComp",
8
- props: ["record"],
9
- setup(__props) {
10
- const props = __props;
11
- const chartDom = ref(null);
12
- const myChart = ref(null);
13
- onMounted(async () => {
14
- await nextTick();
15
- initRender();
16
- });
17
- onBeforeUnmount(() => {
18
- if (myChart.value) {
19
- myChart.value.dispose();
20
- myChart.value = null;
21
- }
22
- });
23
- const parseJsonSafe = (str) => {
24
- try {
25
- return JSON.parse(str);
26
- } catch (_) {
27
- return null;
28
- }
29
- };
30
- const resolveArrayFromVariable = (name) => {
31
- if (!name) return [];
32
- const v = (previewData.variableList || []).find((e) => e.name === name);
33
- if (!v || !v.defaultValue) return [];
34
- const data = typeof v.defaultValue === "string" ? parseJsonSafe(v.defaultValue) : v.defaultValue;
35
- if (!Array.isArray(data)) return [];
36
- if (!data.length) return [];
37
- if (typeof data[0] === "object" && data[0] !== null) {
38
- const firstKey = Object.keys(data[0])[0];
39
- return data.map((i) => i[firstKey]);
40
- }
41
- return data;
42
- };
43
- const deepClone = (obj) => {
44
- try {
45
- return JSON.parse(JSON.stringify(obj));
46
- } catch (_) {
47
- return obj;
48
- }
49
- };
50
- const buildOption = () => {
51
- const xAxisCfg = deepClone(props.record.options.xAxisConfig || []);
52
- xAxisCfg.forEach((ax) => {
53
- if (typeof ax.data === "string") {
54
- ax.data = resolveArrayFromVariable(ax.data);
55
- }
56
- });
57
- const seriesCfg = deepClone(props.record.options.seriesConfig || []);
58
- seriesCfg.forEach((s) => {
59
- if (typeof s.data === "string") {
60
- s.data = resolveArrayFromVariable(s.data);
61
- }
62
- });
63
- return {
64
- title: props.record.options.titleConfig,
65
- tooltip: props.record.options.tooltipConfig,
66
- legend: props.record.options.legendConfig,
67
- grid: props.record.options.gridConfig,
68
- xAxis: xAxisCfg,
69
- yAxis: props.record.options.yAxisConfig,
70
- series: seriesCfg
71
- };
72
- };
73
- const applyOption = () => {
74
- if (!myChart.value) return;
75
- try {
76
- const opt = buildOption();
77
- myChart.value.setOption(opt, true);
78
- } catch (e) {
79
- void reinitChart();
80
- }
81
- };
82
- const initRender = () => {
83
- if (!chartDom.value) return;
84
- try {
85
- myChart.value = echarts.init(chartDom.value);
86
- applyOption();
87
- } catch (e) {
88
- const t = setTimeout(() => {
89
- clearTimeout(t);
90
- try {
91
- myChart.value = echarts.init(chartDom.value);
92
- applyOption();
93
- } catch (_) {
94
- }
95
- }, 50);
96
- }
97
- };
98
- const reinitChart = async () => {
99
- if (!chartDom.value) return;
100
- if (myChart.value) {
101
- try {
102
- myChart.value.dispose();
103
- } catch (_) {
104
- }
105
- myChart.value = null;
106
- }
107
- await nextTick();
108
- initRender();
109
- };
110
- return (_ctx, _cache) => {
111
- return openBlock(), createElementBlock("div", {
112
- class: "barChart-table",
113
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
114
- }, [
115
- createElementVNode("div", {
116
- ref_key: "chartDom",
117
- ref: chartDom,
118
- style: normalizeStyle({
119
- width: props.record.options.style.width,
120
- height: props.record.options.style.height
121
- })
122
- }, null, 4)
123
- ], 4);
124
- };
125
- }
126
- };
127
- const BarChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bdc1c7d2"]]);
128
- export {
129
- BarChart as default
130
- };
@@ -1,127 +0,0 @@
1
- import { ref, onMounted, nextTick, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, createElementVNode } from "vue";
2
- import { previewData } from "./sun-card-designer.es185.js";
3
- import * as echarts from "echarts";
4
- /* empty css */
5
- import _export_sfc from "./sun-card-designer.es16.js";
6
- const _sfc_main = {
7
- __name: "pieChartComp",
8
- props: ["record"],
9
- setup(__props) {
10
- const props = __props;
11
- const chartDom = ref(null);
12
- const myChart = ref(null);
13
- onMounted(async () => {
14
- await nextTick();
15
- initRender();
16
- });
17
- onBeforeUnmount(() => {
18
- if (myChart.value) {
19
- myChart.value.dispose();
20
- myChart.value = null;
21
- }
22
- });
23
- const parseJsonSafe = (str) => {
24
- try {
25
- return JSON.parse(str);
26
- } catch (_) {
27
- return null;
28
- }
29
- };
30
- const resolveArrayFromVariable = (name) => {
31
- if (!name) return [];
32
- const v = (previewData.variableList || []).find((e) => e.name === name);
33
- if (!v || !v.defaultValue) return [];
34
- const data = typeof v.defaultValue === "string" ? parseJsonSafe(v.defaultValue) : v.defaultValue;
35
- if (!Array.isArray(data)) return [];
36
- if (!data.length) return [];
37
- if (typeof data[0] === "object" && data[0] !== null) {
38
- const firstKey = Object.keys(data[0])[0];
39
- return data.map((i) => i[firstKey]);
40
- }
41
- return data;
42
- };
43
- const deepClone = (obj) => {
44
- try {
45
- return JSON.parse(JSON.stringify(obj));
46
- } catch (_) {
47
- return obj;
48
- }
49
- };
50
- const buildOption = () => {
51
- const xAxisCfg = deepClone(props.record.options.xAxisConfig || []);
52
- xAxisCfg.forEach((ax) => {
53
- if (typeof ax.data === "string") {
54
- ax.data = resolveArrayFromVariable(ax.data);
55
- }
56
- });
57
- const seriesCfg = deepClone(props.record.options.seriesConfig || []);
58
- seriesCfg.forEach((s) => {
59
- if (typeof s.data === "string") {
60
- s.data = resolveArrayFromVariable(s.data);
61
- }
62
- });
63
- return {
64
- title: props.record.options.titleConfig,
65
- tooltip: props.record.options.tooltipConfig,
66
- legend: props.record.options.legendConfig,
67
- series: seriesCfg
68
- };
69
- };
70
- const applyOption = () => {
71
- if (!myChart.value) return;
72
- try {
73
- const opt = buildOption();
74
- myChart.value.setOption(opt, true);
75
- } catch (e) {
76
- void reinitChart();
77
- }
78
- };
79
- const initRender = () => {
80
- if (!chartDom.value) return;
81
- try {
82
- myChart.value = echarts.init(chartDom.value);
83
- applyOption();
84
- } catch (e) {
85
- const t = setTimeout(() => {
86
- clearTimeout(t);
87
- try {
88
- myChart.value = echarts.init(chartDom.value);
89
- applyOption();
90
- } catch (_) {
91
- }
92
- }, 50);
93
- }
94
- };
95
- const reinitChart = async () => {
96
- if (!chartDom.value) return;
97
- if (myChart.value) {
98
- try {
99
- myChart.value.dispose();
100
- } catch (_) {
101
- }
102
- myChart.value = null;
103
- }
104
- await nextTick();
105
- initRender();
106
- };
107
- return (_ctx, _cache) => {
108
- return openBlock(), createElementBlock("div", {
109
- class: "pieChart-table",
110
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
111
- }, [
112
- createElementVNode("div", {
113
- ref_key: "chartDom",
114
- ref: chartDom,
115
- style: normalizeStyle({
116
- width: props.record.options.style.width,
117
- height: props.record.options.style.height
118
- })
119
- }, null, 4)
120
- ], 4);
121
- };
122
- }
123
- };
124
- const PieChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-28332879"]]);
125
- export {
126
- PieChart as default
127
- };
@@ -1,132 +0,0 @@
1
- import { ref, onMounted, nextTick, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, createElementVNode } from "vue";
2
- import { previewData } from "./sun-card-designer.es185.js";
3
- import * as echarts from "echarts";
4
- /* empty css */
5
- import _export_sfc from "./sun-card-designer.es16.js";
6
- const _sfc_main = {
7
- __name: "lineChartComp",
8
- props: ["record"],
9
- setup(__props) {
10
- const props = __props;
11
- const chartDom = ref(null);
12
- const myChart = ref(null);
13
- onMounted(async () => {
14
- await nextTick();
15
- initRender();
16
- });
17
- onBeforeUnmount(() => {
18
- if (myChart.value) {
19
- myChart.value.dispose();
20
- myChart.value = null;
21
- }
22
- });
23
- const parseJsonSafe = (str) => {
24
- try {
25
- return JSON.parse(str);
26
- } catch (_) {
27
- return null;
28
- }
29
- };
30
- const resolveArrayFromVariable = (name) => {
31
- if (!name) return [];
32
- const v = (previewData.variableList || []).find((e) => e.name === name);
33
- if (!v || !v.defaultValue) return [];
34
- const data = typeof v.defaultValue === "string" ? parseJsonSafe(v.defaultValue) : v.defaultValue;
35
- if (!Array.isArray(data)) return [];
36
- if (!data.length) return [];
37
- if (typeof data[0] === "object" && data[0] !== null) {
38
- const firstKey = Object.keys(data[0])[0];
39
- return data.map((i) => i[firstKey]);
40
- }
41
- return data;
42
- };
43
- const deepClone = (obj) => {
44
- try {
45
- return JSON.parse(JSON.stringify(obj));
46
- } catch (_) {
47
- return obj;
48
- }
49
- };
50
- const buildOption = () => {
51
- const xAxisCfg = deepClone(props.record.options.xAxisConfig || []);
52
- xAxisCfg.forEach((ax) => {
53
- if (typeof ax.data === "string") {
54
- ax.data = resolveArrayFromVariable(ax.data);
55
- }
56
- });
57
- const seriesCfg = deepClone(props.record.options.seriesConfig || []);
58
- seriesCfg.forEach((s) => {
59
- if (typeof s.data === "string") {
60
- s.data = resolveArrayFromVariable(s.data);
61
- }
62
- if (!s.type) s.type = "line";
63
- if (!s.showSymbol) s.showSymbol = true;
64
- });
65
- return {
66
- title: props.record.options.titleConfig,
67
- tooltip: props.record.options.tooltipConfig,
68
- legend: props.record.options.legendConfig,
69
- grid: props.record.options.gridConfig,
70
- xAxis: xAxisCfg,
71
- yAxis: props.record.options.yAxisConfig,
72
- series: seriesCfg
73
- };
74
- };
75
- const applyOption = () => {
76
- if (!myChart.value) return;
77
- try {
78
- const opt = buildOption();
79
- myChart.value.setOption(opt, true);
80
- } catch (e) {
81
- void reinitChart();
82
- }
83
- };
84
- const initRender = () => {
85
- if (!chartDom.value) return;
86
- try {
87
- myChart.value = echarts.init(chartDom.value);
88
- applyOption();
89
- } catch (e) {
90
- const t = setTimeout(() => {
91
- clearTimeout(t);
92
- try {
93
- myChart.value = echarts.init(chartDom.value);
94
- applyOption();
95
- } catch (_) {
96
- }
97
- }, 50);
98
- }
99
- };
100
- const reinitChart = async () => {
101
- if (!chartDom.value) return;
102
- if (myChart.value) {
103
- try {
104
- myChart.value.dispose();
105
- } catch (_) {
106
- }
107
- myChart.value = null;
108
- }
109
- await nextTick();
110
- initRender();
111
- };
112
- return (_ctx, _cache) => {
113
- return openBlock(), createElementBlock("div", {
114
- class: "lineChart-table",
115
- style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
116
- }, [
117
- createElementVNode("div", {
118
- ref_key: "chartDom",
119
- ref: chartDom,
120
- style: normalizeStyle({
121
- width: props.record.options.style.width,
122
- height: props.record.options.style.height
123
- })
124
- }, null, 4)
125
- ], 4);
126
- };
127
- }
128
- };
129
- const LineChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c3a80733"]]);
130
- export {
131
- LineChart as default
132
- };