jojotaoo_components 0.0.1-beta.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/assets/maps/heilongjiang.json +25543 -0
- package/dist/components/charts/BackgroundCard.vue.d.ts +17 -0
- package/dist/components/charts/BackgroundCard.vue.d.ts.map +1 -0
- package/dist/components/charts/BackgroundCard.vue.js +140 -0
- package/dist/components/charts/BarChart.vue.d.ts +20 -0
- package/dist/components/charts/BarChart.vue.d.ts.map +1 -0
- package/dist/components/charts/BarChart.vue.js +109 -0
- package/dist/components/charts/CustomLegend.vue.d.ts +28 -0
- package/dist/components/charts/CustomLegend.vue.d.ts.map +1 -0
- package/dist/components/charts/CustomLegend.vue.js +198 -0
- package/dist/components/charts/DataFetchManager.vue.d.ts +10 -0
- package/dist/components/charts/DataFetchManager.vue.d.ts.map +1 -0
- package/dist/components/charts/DataFetchManager.vue.js +127 -0
- package/dist/components/charts/DateTimeDisplay.vue.d.ts +17 -0
- package/dist/components/charts/DateTimeDisplay.vue.d.ts.map +1 -0
- package/dist/components/charts/DateTimeDisplay.vue.js +112 -0
- package/dist/components/charts/GroupComponent.vue.d.ts +13 -0
- package/dist/components/charts/GroupComponent.vue.d.ts.map +1 -0
- package/dist/components/charts/GroupComponent.vue.js +106 -0
- package/dist/components/charts/GroupPreview.vue.d.ts +10 -0
- package/dist/components/charts/GroupPreview.vue.d.ts.map +1 -0
- package/dist/components/charts/GroupPreview.vue.js +76 -0
- package/dist/components/charts/HeaderLineChart.vue.d.ts +17 -0
- package/dist/components/charts/HeaderLineChart.vue.d.ts.map +1 -0
- package/dist/components/charts/HeaderLineChart.vue.js +62 -0
- package/dist/components/charts/ImageDisplay.vue.d.ts +17 -0
- package/dist/components/charts/ImageDisplay.vue.d.ts.map +1 -0
- package/dist/components/charts/ImageDisplay.vue.js +106 -0
- package/dist/components/charts/LineChart.vue.d.ts +20 -0
- package/dist/components/charts/LineChart.vue.d.ts.map +1 -0
- package/dist/components/charts/LineChart.vue.js +116 -0
- package/dist/components/charts/MapChart.vue.d.ts +22 -0
- package/dist/components/charts/MapChart.vue.d.ts.map +1 -0
- package/dist/components/charts/MapChart.vue.js +680 -0
- package/dist/components/charts/PieChart.vue.d.ts +20 -0
- package/dist/components/charts/PieChart.vue.d.ts.map +1 -0
- package/dist/components/charts/PieChart.vue.js +106 -0
- package/dist/components/charts/PieGridChart.vue.d.ts +20 -0
- package/dist/components/charts/PieGridChart.vue.d.ts.map +1 -0
- package/dist/components/charts/PieGridChart.vue.js +214 -0
- package/dist/components/charts/RiskScrollList.vue.d.ts +15 -0
- package/dist/components/charts/RiskScrollList.vue.d.ts.map +1 -0
- package/dist/components/charts/RiskScrollList.vue.js +294 -0
- package/dist/components/charts/ScrollList.vue.d.ts +15 -0
- package/dist/components/charts/ScrollList.vue.d.ts.map +1 -0
- package/dist/components/charts/ScrollList.vue.js +149 -0
- package/dist/components/charts/TextDisplay.vue.d.ts +17 -0
- package/dist/components/charts/TextDisplay.vue.d.ts.map +1 -0
- package/dist/components/charts/TextDisplay.vue.js +209 -0
- package/dist/composables/useChartDataFetch.d.ts +18 -0
- package/dist/composables/useChartDataFetch.d.ts.map +1 -0
- package/dist/composables/useChartDataFetch.js +131 -0
- package/dist/composables/useComponentRender.d.ts +20 -0
- package/dist/composables/useComponentRender.d.ts.map +1 -0
- package/dist/composables/useComponentRender.js +45 -0
- package/dist/composables/useDataPondManager.d.ts +20 -0
- package/dist/composables/useDataPondManager.d.ts.map +1 -0
- package/dist/composables/useDataPondManager.js +105 -0
- package/dist/composables/useECharts.d.ts +9 -0
- package/dist/composables/useECharts.d.ts.map +1 -0
- package/dist/composables/useECharts.js +118 -0
- package/dist/composables/useEventListener.d.ts +2 -0
- package/dist/composables/useEventListener.d.ts.map +1 -0
- package/dist/composables/useEventListener.js +5 -0
- package/dist/composables/useId.d.ts +3 -0
- package/dist/composables/useId.d.ts.map +1 -0
- package/dist/composables/useId.js +6 -0
- package/dist/composables/useInteractClear.d.ts +4 -0
- package/dist/composables/useInteractClear.d.ts.map +1 -0
- package/dist/composables/useInteractClear.js +26 -0
- package/dist/composables/useInteractDispatch.d.ts +5 -0
- package/dist/composables/useInteractDispatch.d.ts.map +1 -0
- package/dist/composables/useInteractDispatch.js +44 -0
- package/dist/composables/useInteractFilter.d.ts +5 -0
- package/dist/composables/useInteractFilter.d.ts.map +1 -0
- package/dist/composables/useInteractFilter.js +24 -0
- package/dist/composables/usePollingManager.d.ts +10 -0
- package/dist/composables/usePollingManager.d.ts.map +1 -0
- package/dist/composables/usePollingManager.js +42 -0
- package/dist/composables/useRequestMerge.d.ts +32 -0
- package/dist/composables/useRequestMerge.d.ts.map +1 -0
- package/dist/composables/useRequestMerge.js +131 -0
- package/dist/config/chartThemes.d.ts +26 -0
- package/dist/config/chartThemes.d.ts.map +1 -0
- package/dist/config/chartThemes.js +221 -0
- package/dist/config/componentDefinitions.d.ts +12 -0
- package/dist/config/componentDefinitions.d.ts.map +1 -0
- package/dist/config/componentDefinitions.js +503 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/stores/dashboard.d.ts +3240 -0
- package/dist/stores/dashboard.d.ts.map +1 -0
- package/dist/stores/dashboard.js +666 -0
- package/dist/stores/utils.d.ts +15 -0
- package/dist/stores/utils.d.ts.map +1 -0
- package/dist/stores/utils.js +28 -0
- package/dist/types/canvas.d.ts +36 -0
- package/dist/types/canvas.d.ts.map +1 -0
- package/dist/types/canvas.js +1 -0
- package/dist/types/component.d.ts +175 -0
- package/dist/types/component.d.ts.map +1 -0
- package/dist/types/component.js +63 -0
- package/dist/types/events.d.ts +43 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/request.d.ts +43 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +18 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/stores/dashboard.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EAMb,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAIxF,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAEzE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,UAAU,MAAM,SAAS,GAAG;sCA0ChC,MAAM;6BAef,MAAM;yBAwCV;QAAE,gBAAgB,CAAC,EAAE,GAAG,CAAC;QAAC,mBAAmB,CAAC,EAAE,GAAG,CAAC;QAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE;mlCAuGxG,CAAA"}
|
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import { ref, computed } from 'vue';
|
|
3
|
+
import { DEFAULT_ATTR, DEFAULT_STYLES, DEFAULT_STATUS, DEFAULT_PREVIEW, DEFAULT_CHART_STYLE, DEFAULT_REQUEST, } from '../types';
|
|
4
|
+
import { useIdGenerator } from '../composables/useId';
|
|
5
|
+
import { componentDefinitions } from '../config/componentDefinitions';
|
|
6
|
+
import { rectsIntersect, findInGroupList, removeFromGroupList } from './utils';
|
|
7
|
+
import { applyTheme } from '../config/chartThemes';
|
|
8
|
+
export const useDashboardStore = defineStore('dashboard', () => {
|
|
9
|
+
function deepClone(obj) {
|
|
10
|
+
if (obj === null || typeof obj !== 'object')
|
|
11
|
+
return obj;
|
|
12
|
+
if (obj instanceof Date)
|
|
13
|
+
return new Date(obj.getTime());
|
|
14
|
+
if (Array.isArray(obj))
|
|
15
|
+
return obj.map(deepClone);
|
|
16
|
+
const result = {};
|
|
17
|
+
for (const key in obj) {
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
19
|
+
result[key] = deepClone(obj[key]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
const components = ref([]);
|
|
25
|
+
const selectedId = ref(null);
|
|
26
|
+
const selectedIds = ref([]);
|
|
27
|
+
const isPreviewMode = ref(false);
|
|
28
|
+
const editCanvasConfig = ref({
|
|
29
|
+
projectName: '可视化大屏',
|
|
30
|
+
width: 1920,
|
|
31
|
+
height: 1080,
|
|
32
|
+
background: '#11111b',
|
|
33
|
+
backgroundImage: null,
|
|
34
|
+
filterShow: false,
|
|
35
|
+
opacity: 1,
|
|
36
|
+
saturate: 1,
|
|
37
|
+
contrast: 1,
|
|
38
|
+
hueRotate: 0,
|
|
39
|
+
brightness: 1,
|
|
40
|
+
blendMode: 'normal',
|
|
41
|
+
customTheme: null,
|
|
42
|
+
});
|
|
43
|
+
const requestGlobalConfig = ref({
|
|
44
|
+
requestOriginUrl: '',
|
|
45
|
+
requestInterval: 30,
|
|
46
|
+
requestIntervalUnit: 'second',
|
|
47
|
+
requestHeader: {},
|
|
48
|
+
requestDataPond: [],
|
|
49
|
+
});
|
|
50
|
+
const selectedComponent = computed(() => {
|
|
51
|
+
if (!selectedId.value)
|
|
52
|
+
return null;
|
|
53
|
+
return findComponent(selectedId.value);
|
|
54
|
+
});
|
|
55
|
+
const generateId = useIdGenerator();
|
|
56
|
+
function addComponent(key) {
|
|
57
|
+
const def = componentDefinitions.find(d => d.key === key);
|
|
58
|
+
if (!def)
|
|
59
|
+
return;
|
|
60
|
+
const id = generateId();
|
|
61
|
+
const offset = components.value.length * 30;
|
|
62
|
+
const comp = {
|
|
63
|
+
id,
|
|
64
|
+
key: def.key,
|
|
65
|
+
props: deepClone(def.defaultProps),
|
|
66
|
+
chartConfig: {
|
|
67
|
+
key: def.key,
|
|
68
|
+
chartKey: def.chartKey,
|
|
69
|
+
conKey: def.conKey,
|
|
70
|
+
title: def.title,
|
|
71
|
+
category: def.category,
|
|
72
|
+
categoryName: def.categoryName,
|
|
73
|
+
package: def.package,
|
|
74
|
+
chartFrame: def.chartFrame,
|
|
75
|
+
image: def.image,
|
|
76
|
+
icon: def.icon,
|
|
77
|
+
},
|
|
78
|
+
attr: {
|
|
79
|
+
...DEFAULT_ATTR,
|
|
80
|
+
x: 50 + offset,
|
|
81
|
+
y: 50 + offset,
|
|
82
|
+
w: 400,
|
|
83
|
+
h: 320,
|
|
84
|
+
zIndex: components.value.length,
|
|
85
|
+
},
|
|
86
|
+
styles: { ...DEFAULT_STYLES },
|
|
87
|
+
status: { ...DEFAULT_STATUS },
|
|
88
|
+
preview: { ...DEFAULT_PREVIEW },
|
|
89
|
+
option: deepClone(def.defaultOption),
|
|
90
|
+
chartStyle: deepClone(DEFAULT_CHART_STYLE),
|
|
91
|
+
interactActions: def.defaultInteractActions ? deepClone(def.defaultInteractActions) : [],
|
|
92
|
+
request: deepClone(DEFAULT_REQUEST),
|
|
93
|
+
};
|
|
94
|
+
components.value.push(comp);
|
|
95
|
+
// components.value = [...components.value, comp]
|
|
96
|
+
selectedId.value = comp.id;
|
|
97
|
+
selectedIds.value = [comp.id];
|
|
98
|
+
}
|
|
99
|
+
function removeComponent(id) {
|
|
100
|
+
const index = components.value.findIndex(c => c.id === id);
|
|
101
|
+
if (index !== -1) {
|
|
102
|
+
components.value.splice(index, 1);
|
|
103
|
+
if (id === selectedId.value) {
|
|
104
|
+
selectedId.value = components.value[0]?.id ?? null;
|
|
105
|
+
selectedIds.value = [];
|
|
106
|
+
}
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
for (const group of components.value) {
|
|
110
|
+
if (group.groupList && removeFromGroupList(group.groupList, id)) {
|
|
111
|
+
if (id === selectedId.value) {
|
|
112
|
+
selectedId.value = null;
|
|
113
|
+
selectedIds.value = [];
|
|
114
|
+
}
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function selectComponent(id) {
|
|
120
|
+
selectedId.value = id;
|
|
121
|
+
if (id === null) {
|
|
122
|
+
selectedIds.value = [];
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
selectedIds.value = [id];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function toggleSelectComponent(id) {
|
|
129
|
+
const idx = selectedIds.value.indexOf(id);
|
|
130
|
+
if (idx >= 0) {
|
|
131
|
+
selectedIds.value.splice(idx, 1);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
selectedIds.value.push(id);
|
|
135
|
+
}
|
|
136
|
+
if (selectedIds.value.length === 1) {
|
|
137
|
+
selectedId.value = selectedIds.value[0];
|
|
138
|
+
}
|
|
139
|
+
else if (selectedIds.value.length > 1) {
|
|
140
|
+
selectedId.value = id;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
selectedId.value = null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function selectComponentsByRect(x, y, w, h) {
|
|
147
|
+
const rect = { x, y, w, h };
|
|
148
|
+
selectedIds.value = components.value
|
|
149
|
+
.filter(c => rectsIntersect(rect, { x: c.attr.x, y: c.attr.y, w: c.attr.w, h: c.attr.h }))
|
|
150
|
+
.map(c => c.id);
|
|
151
|
+
if (selectedIds.value.length === 0) {
|
|
152
|
+
selectedId.value = null;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
selectedId.value = selectedIds.value[selectedIds.value.length - 1];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function clearSelection() {
|
|
159
|
+
selectedIds.value = [];
|
|
160
|
+
selectedId.value = null;
|
|
161
|
+
}
|
|
162
|
+
function setPreviewMode(value) {
|
|
163
|
+
isPreviewMode.value = value;
|
|
164
|
+
}
|
|
165
|
+
function updateComponentProp(id, key, value) {
|
|
166
|
+
const comp = findComponent(id);
|
|
167
|
+
if (comp) {
|
|
168
|
+
comp.props[key] = value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function updateComponentTitle(id, title) {
|
|
172
|
+
const comp = findComponent(id);
|
|
173
|
+
if (comp)
|
|
174
|
+
comp.chartConfig.title = title;
|
|
175
|
+
}
|
|
176
|
+
function updateComponentProps(id, props) {
|
|
177
|
+
const comp = findComponent(id);
|
|
178
|
+
if (comp) {
|
|
179
|
+
comp.props = { ...comp.props, ...props };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function updateComponentPosition(id, x, y) {
|
|
183
|
+
const comp = findComponent(id);
|
|
184
|
+
if (comp) {
|
|
185
|
+
comp.attr.x = x;
|
|
186
|
+
comp.attr.y = y;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function updateComponentSize(id, w, h) {
|
|
190
|
+
const comp = findComponent(id);
|
|
191
|
+
if (comp) {
|
|
192
|
+
comp.attr.w = w;
|
|
193
|
+
comp.attr.h = h;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function updateCanvasConfig(config) {
|
|
197
|
+
Object.assign(editCanvasConfig.value, config);
|
|
198
|
+
}
|
|
199
|
+
function updateRequestGlobalConfig(config) {
|
|
200
|
+
Object.assign(requestGlobalConfig.value, config);
|
|
201
|
+
}
|
|
202
|
+
function findComponent(id) {
|
|
203
|
+
for (const comp of components.value) {
|
|
204
|
+
if (comp.id === id)
|
|
205
|
+
return comp;
|
|
206
|
+
if (comp.groupList) {
|
|
207
|
+
const found = findInGroupList(comp.groupList, id);
|
|
208
|
+
if (found)
|
|
209
|
+
return found;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
function updateComponentAttr(id, key, value) {
|
|
215
|
+
const comp = findComponent(id);
|
|
216
|
+
if (comp)
|
|
217
|
+
comp.attr[key] = value;
|
|
218
|
+
}
|
|
219
|
+
function updateComponentStyle(id, key, value) {
|
|
220
|
+
const comp = findComponent(id);
|
|
221
|
+
if (comp)
|
|
222
|
+
comp.styles[key] = value;
|
|
223
|
+
}
|
|
224
|
+
function updateComponentOption(id, key, value) {
|
|
225
|
+
const comp = findComponent(id);
|
|
226
|
+
if (comp)
|
|
227
|
+
comp.option[key] = value;
|
|
228
|
+
}
|
|
229
|
+
function updateChartStyle(id, path, value) {
|
|
230
|
+
const comp = findComponent(id);
|
|
231
|
+
if (!comp || !comp.chartStyle)
|
|
232
|
+
return;
|
|
233
|
+
const keys = path.split('.');
|
|
234
|
+
let target = comp.chartStyle;
|
|
235
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
236
|
+
target = target[keys[i]];
|
|
237
|
+
}
|
|
238
|
+
target[keys[keys.length - 1]] = value;
|
|
239
|
+
}
|
|
240
|
+
function applyThemeToAll(preset) {
|
|
241
|
+
function applyToComp(comp) {
|
|
242
|
+
if (comp.chartStyle) {
|
|
243
|
+
const updated = applyTheme(comp.chartStyle, preset);
|
|
244
|
+
Object.assign(comp.chartStyle, updated);
|
|
245
|
+
}
|
|
246
|
+
comp.groupList?.forEach(child => {
|
|
247
|
+
if (child.chartStyle) {
|
|
248
|
+
const updated = applyTheme(child.chartStyle, preset);
|
|
249
|
+
Object.assign(child.chartStyle, updated);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
components.value.forEach(applyToComp);
|
|
254
|
+
}
|
|
255
|
+
function saveCustomTheme(preset) {
|
|
256
|
+
editCanvasConfig.value.customTheme = preset;
|
|
257
|
+
}
|
|
258
|
+
function toggleComponentStatus(id, statusKey) {
|
|
259
|
+
const comp = findComponent(id);
|
|
260
|
+
if (comp)
|
|
261
|
+
comp.status[statusKey] = !comp.status[statusKey];
|
|
262
|
+
}
|
|
263
|
+
function toggleComponentPreviewOverflow(id) {
|
|
264
|
+
const comp = findComponent(id);
|
|
265
|
+
if (comp)
|
|
266
|
+
comp.preview.overFlowHidden = !comp.preview.overFlowHidden;
|
|
267
|
+
}
|
|
268
|
+
function toggleComponentFilterShow(id) {
|
|
269
|
+
const comp = findComponent(id);
|
|
270
|
+
if (comp)
|
|
271
|
+
comp.styles.filterShow = !comp.styles.filterShow;
|
|
272
|
+
}
|
|
273
|
+
function updateComponentFilter(id, value) {
|
|
274
|
+
const comp = findComponent(id);
|
|
275
|
+
if (comp)
|
|
276
|
+
comp.filter = value;
|
|
277
|
+
}
|
|
278
|
+
function updateOptionDatasetDimension(id, index, value) {
|
|
279
|
+
const comp = findComponent(id);
|
|
280
|
+
if (comp) {
|
|
281
|
+
const dims = comp.option.dataset?.dimensions;
|
|
282
|
+
if (dims) {
|
|
283
|
+
const clone = [...dims];
|
|
284
|
+
clone[index] = value;
|
|
285
|
+
comp.option.dataset.dimensions = clone;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function updateOptionDatasetCell(id, rowIndex, colIndex, value) {
|
|
290
|
+
const comp = findComponent(id);
|
|
291
|
+
if (comp) {
|
|
292
|
+
const src = comp.option.dataset?.source;
|
|
293
|
+
if (src?.[rowIndex]) {
|
|
294
|
+
const currentVal = src[rowIndex][colIndex];
|
|
295
|
+
const newVal = typeof currentVal === 'number' ? Number(value) : value;
|
|
296
|
+
const newRow = [...src[rowIndex]];
|
|
297
|
+
newRow[colIndex] = newVal;
|
|
298
|
+
const newSource = [...src];
|
|
299
|
+
newSource[rowIndex] = newRow;
|
|
300
|
+
comp.option.dataset.source = newSource;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function addOptionDatasetRow(id) {
|
|
305
|
+
const comp = findComponent(id);
|
|
306
|
+
if (comp) {
|
|
307
|
+
const ds = comp.option.dataset;
|
|
308
|
+
if (!ds)
|
|
309
|
+
return;
|
|
310
|
+
const colCount = ds.dimensions?.length ?? 2;
|
|
311
|
+
ds.source = [...ds.source, Array(colCount).fill('')];
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function removeOptionDatasetRow(id, rowIndex) {
|
|
315
|
+
const comp = findComponent(id);
|
|
316
|
+
if (comp) {
|
|
317
|
+
const src = comp.option.dataset?.source;
|
|
318
|
+
if (src) {
|
|
319
|
+
comp.option.dataset.source = src.filter((_, i) => i !== rowIndex);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function groupSelectedComponents() {
|
|
324
|
+
if (selectedIds.value.length < 2)
|
|
325
|
+
return;
|
|
326
|
+
const ids = new Set(selectedIds.value);
|
|
327
|
+
const selected = components.value.filter(c => ids.has(c.id));
|
|
328
|
+
if (selected.length < 2)
|
|
329
|
+
return;
|
|
330
|
+
const minX = Math.min(...selected.map(c => c.attr.x));
|
|
331
|
+
const minY = Math.min(...selected.map(c => c.attr.y));
|
|
332
|
+
const maxX = Math.max(...selected.map(c => c.attr.x + c.attr.w));
|
|
333
|
+
const maxY = Math.max(...selected.map(c => c.attr.y + c.attr.h));
|
|
334
|
+
const id = generateId();
|
|
335
|
+
const group = {
|
|
336
|
+
id,
|
|
337
|
+
key: 'group',
|
|
338
|
+
isGroup: true,
|
|
339
|
+
props: {},
|
|
340
|
+
chartConfig: {
|
|
341
|
+
key: 'group',
|
|
342
|
+
chartKey: 'group',
|
|
343
|
+
conKey: '',
|
|
344
|
+
title: '分组',
|
|
345
|
+
category: '',
|
|
346
|
+
categoryName: '',
|
|
347
|
+
package: '',
|
|
348
|
+
chartFrame: 'common',
|
|
349
|
+
image: '',
|
|
350
|
+
},
|
|
351
|
+
attr: {
|
|
352
|
+
x: minX, y: minY, w: maxX - minX, h: maxY - minY,
|
|
353
|
+
offsetX: 0, offsetY: 0, zIndex: components.value.length,
|
|
354
|
+
},
|
|
355
|
+
styles: { ...DEFAULT_STYLES },
|
|
356
|
+
status: { ...DEFAULT_STATUS },
|
|
357
|
+
preview: { ...DEFAULT_PREVIEW },
|
|
358
|
+
option: {},
|
|
359
|
+
groupList: selected.map(c => ({
|
|
360
|
+
...c,
|
|
361
|
+
attr: { ...c.attr, x: c.attr.x - minX, y: c.attr.y - minY },
|
|
362
|
+
})),
|
|
363
|
+
};
|
|
364
|
+
const idSet = new Set(selected.map(c => c.id));
|
|
365
|
+
components.value = components.value.filter(c => !idSet.has(c.id));
|
|
366
|
+
components.value.push(group);
|
|
367
|
+
selectedIds.value = [id];
|
|
368
|
+
selectedId.value = id;
|
|
369
|
+
}
|
|
370
|
+
function ungroupComponent(groupId) {
|
|
371
|
+
const comp = components.value.find(c => c.id === groupId);
|
|
372
|
+
if (!comp || !comp.isGroup || !comp.groupList)
|
|
373
|
+
return;
|
|
374
|
+
const absChildren = comp.groupList.map(child => ({
|
|
375
|
+
...child,
|
|
376
|
+
props: child.props ?? {},
|
|
377
|
+
attr: { ...child.attr, x: child.attr.x + comp.attr.x, y: child.attr.y + comp.attr.y },
|
|
378
|
+
}));
|
|
379
|
+
const idx = components.value.findIndex(c => c.id === groupId);
|
|
380
|
+
if (idx >= 0) {
|
|
381
|
+
components.value.splice(idx, 1, ...absChildren);
|
|
382
|
+
}
|
|
383
|
+
selectedIds.value = [];
|
|
384
|
+
selectedId.value = null;
|
|
385
|
+
}
|
|
386
|
+
function moveComponentDelta(id, dx, dy, baseX, baseY, pageW, pageH) {
|
|
387
|
+
const comp = findComponent(id);
|
|
388
|
+
if (!comp)
|
|
389
|
+
return;
|
|
390
|
+
comp.attr.x = Math.round(Math.max(0, Math.min(baseX + dx, (pageW ?? 9999) - comp.attr.w)));
|
|
391
|
+
comp.attr.y = Math.round(Math.max(0, Math.min(baseY + dy, (pageH ?? 9999) - comp.attr.h)));
|
|
392
|
+
}
|
|
393
|
+
function resizeComponentDelta(id, dw, dh, baseW, baseH, maxW, maxH) {
|
|
394
|
+
const comp = findComponent(id);
|
|
395
|
+
if (!comp)
|
|
396
|
+
return;
|
|
397
|
+
comp.attr.w = Math.max(100, Math.min(baseW + dw, maxW ?? 9999));
|
|
398
|
+
comp.attr.h = Math.max(60, Math.min(baseH + dh, maxH ?? 9999));
|
|
399
|
+
}
|
|
400
|
+
function addDataPond(item) {
|
|
401
|
+
requestGlobalConfig.value.requestDataPond.push(item);
|
|
402
|
+
}
|
|
403
|
+
function updateDataPond(id, item) {
|
|
404
|
+
const pond = requestGlobalConfig.value.requestDataPond.find(p => p.dataPondId === id);
|
|
405
|
+
if (pond) {
|
|
406
|
+
Object.assign(pond, item);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function removeDataPond(id) {
|
|
410
|
+
const idx = requestGlobalConfig.value.requestDataPond.findIndex(p => p.dataPondId === id);
|
|
411
|
+
if (idx >= 0) {
|
|
412
|
+
requestGlobalConfig.value.requestDataPond.splice(idx, 1);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function updateComponentRequest(id, request) {
|
|
416
|
+
const comp = findComponent(id);
|
|
417
|
+
if (comp && comp.request) {
|
|
418
|
+
Object.assign(comp.request, request);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const interactFilters = ref({});
|
|
422
|
+
const interactDataModified = new Set();
|
|
423
|
+
function updateComponentEvents(id, events) {
|
|
424
|
+
const comp = findComponent(id);
|
|
425
|
+
if (comp)
|
|
426
|
+
comp.events = events;
|
|
427
|
+
}
|
|
428
|
+
function updateComponentInteractActions(id, actions) {
|
|
429
|
+
const comp = findComponent(id);
|
|
430
|
+
if (comp)
|
|
431
|
+
comp.interactActions = actions;
|
|
432
|
+
}
|
|
433
|
+
function addInteractEvent(id, event) {
|
|
434
|
+
const comp = findComponent(id);
|
|
435
|
+
if (!comp)
|
|
436
|
+
return;
|
|
437
|
+
if (!comp.events)
|
|
438
|
+
comp.events = {};
|
|
439
|
+
if (!comp.events.interactEvents)
|
|
440
|
+
comp.events.interactEvents = [];
|
|
441
|
+
comp.events.interactEvents.push(event);
|
|
442
|
+
}
|
|
443
|
+
function removeInteractEvent(id, index) {
|
|
444
|
+
const comp = findComponent(id);
|
|
445
|
+
if (comp?.events?.interactEvents) {
|
|
446
|
+
comp.events.interactEvents.splice(index, 1);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function updateInteractEvent(id, index, patch) {
|
|
450
|
+
const comp = findComponent(id);
|
|
451
|
+
if (comp?.events?.interactEvents?.[index]) {
|
|
452
|
+
Object.assign(comp.events.interactEvents[index], patch);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function ensureStructuredOverrides(target) {
|
|
456
|
+
if (!target.interactOverrides) {
|
|
457
|
+
target.interactOverrides = { params: {}, body: {} };
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (!target.interactOverrides.params && !target.interactOverrides.body) {
|
|
461
|
+
target.interactOverrides = { params: target.interactOverrides, body: {} };
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function applyInteractAction(targetId, method, value) {
|
|
465
|
+
if (method === 'setFilter') {
|
|
466
|
+
const currentFilters = interactFilters.value[targetId] || {};
|
|
467
|
+
let newFilters;
|
|
468
|
+
if (typeof value === 'object' && value !== null) {
|
|
469
|
+
newFilters = { ...currentFilters, ...value };
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
newFilters = { ...currentFilters, _primary: value };
|
|
473
|
+
}
|
|
474
|
+
interactFilters.value = { ...interactFilters.value, [targetId]: newFilters };
|
|
475
|
+
}
|
|
476
|
+
else if (method === 'setData') {
|
|
477
|
+
const target = findComponent(targetId);
|
|
478
|
+
if (target) {
|
|
479
|
+
target.option.dataset = value;
|
|
480
|
+
interactDataModified.add(targetId);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
else if (method === 'clearFilter') {
|
|
484
|
+
const { [targetId]: _, ...rest } = interactFilters.value;
|
|
485
|
+
interactFilters.value = rest;
|
|
486
|
+
}
|
|
487
|
+
else if (method === 'setRequestParams') {
|
|
488
|
+
const target = findComponent(targetId);
|
|
489
|
+
if (target) {
|
|
490
|
+
ensureStructuredOverrides(target);
|
|
491
|
+
Object.assign(target.interactOverrides.params, value);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else if (method === 'setRequestBody') {
|
|
495
|
+
const target = findComponent(targetId);
|
|
496
|
+
if (target) {
|
|
497
|
+
ensureStructuredOverrides(target);
|
|
498
|
+
Object.assign(target.interactOverrides.body, value);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
else if (method === 'clearOverrides') {
|
|
502
|
+
const target = findComponent(targetId);
|
|
503
|
+
if (target)
|
|
504
|
+
target.interactOverrides = { params: {}, body: {} };
|
|
505
|
+
}
|
|
506
|
+
else if (method === 'setRequestUrl') {
|
|
507
|
+
const target = findComponent(targetId);
|
|
508
|
+
if (target?.request) {
|
|
509
|
+
target.request.requestUrl = value;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
function clearInteractFilters(targetId) {
|
|
514
|
+
if (targetId) {
|
|
515
|
+
const { [targetId]: _, ...rest } = interactFilters.value;
|
|
516
|
+
interactFilters.value = rest;
|
|
517
|
+
if (interactDataModified.has(targetId)) {
|
|
518
|
+
const target = findComponent(targetId);
|
|
519
|
+
if (target?.option)
|
|
520
|
+
target.option.dataset = { dimensions: [], source: [] };
|
|
521
|
+
interactDataModified.delete(targetId);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
interactFilters.value = {};
|
|
526
|
+
interactDataModified.clear();
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function duplicateComponent(id) {
|
|
530
|
+
const source = findComponent(id);
|
|
531
|
+
if (!source)
|
|
532
|
+
return;
|
|
533
|
+
const newId = generateId();
|
|
534
|
+
const cloned = {
|
|
535
|
+
id: newId,
|
|
536
|
+
key: source.key,
|
|
537
|
+
isGroup: source.isGroup,
|
|
538
|
+
chartConfig: {
|
|
539
|
+
...deepClone(source.chartConfig),
|
|
540
|
+
title: source.chartConfig.title + ' - 复制',
|
|
541
|
+
},
|
|
542
|
+
attr: {
|
|
543
|
+
...deepClone(source.attr),
|
|
544
|
+
x: source.attr.x + 20,
|
|
545
|
+
y: source.attr.y + 20,
|
|
546
|
+
zIndex: components.value.length,
|
|
547
|
+
},
|
|
548
|
+
styles: deepClone(source.styles),
|
|
549
|
+
status: deepClone(source.status),
|
|
550
|
+
preview: deepClone(source.preview),
|
|
551
|
+
option: deepClone(source.option),
|
|
552
|
+
chartStyle: deepClone(source.chartStyle ?? DEFAULT_CHART_STYLE),
|
|
553
|
+
props: deepClone(source.props),
|
|
554
|
+
filter: source.filter,
|
|
555
|
+
request: deepClone(source.request) ?? deepClone(DEFAULT_REQUEST),
|
|
556
|
+
events: deepClone(source.events),
|
|
557
|
+
interactActions: deepClone(source.interactActions),
|
|
558
|
+
};
|
|
559
|
+
if (source.isGroup && source.groupList) {
|
|
560
|
+
cloned.groupList = deepClone(source.groupList);
|
|
561
|
+
}
|
|
562
|
+
components.value = [...components.value, cloned];
|
|
563
|
+
selectedId.value = newId;
|
|
564
|
+
selectedIds.value = [newId];
|
|
565
|
+
}
|
|
566
|
+
function loadSchema(schema) {
|
|
567
|
+
if (schema.editCanvasConfig) {
|
|
568
|
+
Object.assign(editCanvasConfig.value, schema.editCanvasConfig);
|
|
569
|
+
}
|
|
570
|
+
if (schema.requestGlobalConfig) {
|
|
571
|
+
Object.assign(requestGlobalConfig.value, schema.requestGlobalConfig);
|
|
572
|
+
}
|
|
573
|
+
const newComponents = (schema.componentList ?? []).map((item, index) => {
|
|
574
|
+
const newId = generateId();
|
|
575
|
+
return {
|
|
576
|
+
id: newId,
|
|
577
|
+
key: item.key,
|
|
578
|
+
isGroup: item.isGroup,
|
|
579
|
+
chartConfig: item.chartConfig,
|
|
580
|
+
attr: { ...DEFAULT_ATTR, ...item.attr, zIndex: index },
|
|
581
|
+
styles: { ...DEFAULT_STYLES, ...(item.styles ?? {}) },
|
|
582
|
+
status: { ...DEFAULT_STATUS, ...(item.status ?? {}) },
|
|
583
|
+
preview: { ...DEFAULT_PREVIEW, ...(item.preview ?? {}) },
|
|
584
|
+
filter: item.filter,
|
|
585
|
+
option: item.option ?? {},
|
|
586
|
+
chartStyle: item.chartStyle ?? { ...DEFAULT_CHART_STYLE },
|
|
587
|
+
props: deepClone(item.props ?? {}),
|
|
588
|
+
events: item.events,
|
|
589
|
+
interactActions: item.interactActions,
|
|
590
|
+
request: item.request,
|
|
591
|
+
groupList: item.groupList
|
|
592
|
+
? item.groupList.map((child) => ({
|
|
593
|
+
...child,
|
|
594
|
+
id: generateId(),
|
|
595
|
+
attr: { ...DEFAULT_ATTR, ...child.attr },
|
|
596
|
+
styles: { ...DEFAULT_STYLES, ...(child.styles ?? {}) },
|
|
597
|
+
status: { ...DEFAULT_STATUS, ...(child.status ?? {}) },
|
|
598
|
+
preview: { ...DEFAULT_PREVIEW, ...(child.preview ?? {}) },
|
|
599
|
+
props: deepClone(child.props ?? {}),
|
|
600
|
+
chartStyle: child.chartStyle ?? { ...DEFAULT_CHART_STYLE },
|
|
601
|
+
}))
|
|
602
|
+
: undefined,
|
|
603
|
+
};
|
|
604
|
+
});
|
|
605
|
+
components.value = newComponents;
|
|
606
|
+
selectedId.value = null;
|
|
607
|
+
selectedIds.value = [];
|
|
608
|
+
}
|
|
609
|
+
return {
|
|
610
|
+
components,
|
|
611
|
+
selectedId,
|
|
612
|
+
selectedIds,
|
|
613
|
+
selectedComponent,
|
|
614
|
+
isPreviewMode,
|
|
615
|
+
componentDefinitions,
|
|
616
|
+
editCanvasConfig,
|
|
617
|
+
requestGlobalConfig,
|
|
618
|
+
addComponent,
|
|
619
|
+
removeComponent,
|
|
620
|
+
selectComponent,
|
|
621
|
+
toggleSelectComponent,
|
|
622
|
+
selectComponentsByRect,
|
|
623
|
+
clearSelection,
|
|
624
|
+
setPreviewMode,
|
|
625
|
+
groupSelectedComponents,
|
|
626
|
+
ungroupComponent,
|
|
627
|
+
updateComponentProp,
|
|
628
|
+
updateComponentProps,
|
|
629
|
+
updateComponentTitle,
|
|
630
|
+
updateComponentPosition,
|
|
631
|
+
updateComponentSize,
|
|
632
|
+
updateCanvasConfig,
|
|
633
|
+
updateRequestGlobalConfig,
|
|
634
|
+
findComponent,
|
|
635
|
+
updateComponentAttr,
|
|
636
|
+
updateComponentStyle,
|
|
637
|
+
updateComponentOption,
|
|
638
|
+
updateChartStyle,
|
|
639
|
+
applyThemeToAll,
|
|
640
|
+
saveCustomTheme,
|
|
641
|
+
toggleComponentStatus,
|
|
642
|
+
toggleComponentPreviewOverflow,
|
|
643
|
+
toggleComponentFilterShow,
|
|
644
|
+
updateComponentFilter,
|
|
645
|
+
moveComponentDelta,
|
|
646
|
+
resizeComponentDelta,
|
|
647
|
+
updateOptionDatasetDimension,
|
|
648
|
+
updateOptionDatasetCell,
|
|
649
|
+
addOptionDatasetRow,
|
|
650
|
+
removeOptionDatasetRow,
|
|
651
|
+
addDataPond,
|
|
652
|
+
updateDataPond,
|
|
653
|
+
removeDataPond,
|
|
654
|
+
updateComponentRequest,
|
|
655
|
+
interactFilters,
|
|
656
|
+
updateComponentEvents,
|
|
657
|
+
updateComponentInteractActions,
|
|
658
|
+
addInteractEvent,
|
|
659
|
+
removeInteractEvent,
|
|
660
|
+
updateInteractEvent,
|
|
661
|
+
applyInteractAction,
|
|
662
|
+
clearInteractFilters,
|
|
663
|
+
duplicateComponent,
|
|
664
|
+
loadSchema,
|
|
665
|
+
};
|
|
666
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CreateComponentType } from '../types';
|
|
2
|
+
export declare function rectsIntersect(a: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
}, b: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
w: number;
|
|
11
|
+
h: number;
|
|
12
|
+
}): boolean;
|
|
13
|
+
export declare function findInGroupList(list: CreateComponentType[], id: string): CreateComponentType | null;
|
|
14
|
+
export declare function removeFromGroupList(list: CreateComponentType[], id: string): boolean;
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/stores/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,wBAAgB,cAAc,CAC5B,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACjD,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,WAGlD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CASnG;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAYpF"}
|