vue2-client 1.18.14 → 1.18.15
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 +112 -112
- package/src/base-client/components/his/HChart/HChart.vue +129 -41
- package/src/components/FileImageItem/FileItem.vue +320 -320
- package/src/components/FileImageItem/FileItemGroup.vue +297 -297
- package/src/pages/WorkflowDetail/WorkflowDetail.vue +404 -404
- package/src/pages/WorkflowDetail/WorkflowPageDetail/worklog.vue +98 -98
package/package.json
CHANGED
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue2-client",
|
|
3
|
-
"version": "1.18.
|
|
4
|
-
"private": false,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
7
|
-
"serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
|
|
8
|
-
"serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
|
|
9
|
-
"serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
|
|
10
|
-
"serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
|
|
11
|
-
"serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
|
|
12
|
-
"serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
|
|
13
|
-
"serve:runtime": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode runtime",
|
|
14
|
-
"serve:message": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode message",
|
|
15
|
-
"serve:apply": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode apply",
|
|
16
|
-
"mac-serve": "vue-cli-service serve --no-eslint --mode his",
|
|
17
|
-
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
18
|
-
"test:unit": "vue-cli-service test:unit",
|
|
19
|
-
"lint": "vue-cli-service lint",
|
|
20
|
-
"build:preview": "vue-cli-service build --mode preview",
|
|
21
|
-
"lint:nofix": "vue-cli-service lint --no-fix",
|
|
22
|
-
"test": "jest"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
26
|
-
"@afwenming123/vue-plugin-hiprint": "^0.0.70",
|
|
27
|
-
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
28
|
-
"@antv/data-set": "^0.11.8",
|
|
29
|
-
"@antv/g2plot": "^2.4.31",
|
|
30
|
-
"@hufe921/canvas-editor": "^0.9.49",
|
|
31
|
-
"@microsoft/fetch-event-source": "^2.0.1",
|
|
32
|
-
"@vue/babel-preset-jsx": "^1.4.0",
|
|
33
|
-
"animate.css": "^4.1.1",
|
|
34
|
-
"ant-design-vue": "^1.7.8",
|
|
35
|
-
"axios": "^0.27.2",
|
|
36
|
-
"clipboard": "^2.0.11",
|
|
37
|
-
"core-js": "^3.33.0",
|
|
38
|
-
"crypto-js": "^4.1.1",
|
|
39
|
-
"date-fns": "^2.29.3",
|
|
40
|
-
"default-passive-events": "^2.0.0",
|
|
41
|
-
"dotenv": "^16.3.1",
|
|
42
|
-
"echarts": "^5.5.0",
|
|
43
|
-
"enquire.js": "^2.1.6",
|
|
44
|
-
"file-saver": "^2.0.5",
|
|
45
|
-
"highlight.js": "^11.7.0",
|
|
46
|
-
"html2canvas": "^1.4.1",
|
|
47
|
-
"js-base64": "^3.7.5",
|
|
48
|
-
"js-cookie": "^2.2.1",
|
|
49
|
-
"jsencrypt": "^3.3.2",
|
|
50
|
-
"jspdf": "^2.5.1",
|
|
51
|
-
"lodash.clonedeep": "^4.5.0",
|
|
52
|
-
"lodash.debounce": "^4",
|
|
53
|
-
"lodash.get": "^4.4.2",
|
|
54
|
-
"marked": "^4",
|
|
55
|
-
"mockjs": "^1.1.0",
|
|
56
|
-
"nprogress": "^0.2.0",
|
|
57
|
-
"qs": "^6.11.2",
|
|
58
|
-
"regenerator-runtime": "^0.14.0",
|
|
59
|
-
"splitpanes": "^2.4.1",
|
|
60
|
-
"videojs-contrib-hls": "^5.15.0",
|
|
61
|
-
"viser-vue": "^2.4.8",
|
|
62
|
-
"vue": "^2.7.14",
|
|
63
|
-
"vue-codemirror": "4.0.6",
|
|
64
|
-
"vue-color": "2.7.0",
|
|
65
|
-
"vue-draggable-resizable": "^2.3.0",
|
|
66
|
-
"vue-i18n": "^8.28.2",
|
|
67
|
-
"vue-json-viewer": "^2.2.22",
|
|
68
|
-
"vue-router": "^3.6.5",
|
|
69
|
-
"vue-video-player": "^5.0.2",
|
|
70
|
-
"vue-virtual-scroller": "^1.1.2",
|
|
71
|
-
"vuedraggable": "^2.24.3",
|
|
72
|
-
"vuex": "^3.6.2",
|
|
73
|
-
"xlsx": "0.18.5"
|
|
74
|
-
},
|
|
75
|
-
"devDependencies": {
|
|
76
|
-
"@ant-design/colors": "^7.0.0",
|
|
77
|
-
"@babel/core": "^7.22.20",
|
|
78
|
-
"@babel/eslint-parser": "^7.22.15",
|
|
79
|
-
"@babel/preset-env": "^7.22.20",
|
|
80
|
-
"@vue/cli-plugin-babel": "^5.0.8",
|
|
81
|
-
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
82
|
-
"@vue/cli-service": "^5.0.8",
|
|
83
|
-
"@vue/eslint-config-standard": "^8.0.1",
|
|
84
|
-
"@vue/test-utils": "^1.3.6",
|
|
85
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
86
|
-
"compression-webpack-plugin": "^10.0.0",
|
|
87
|
-
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
88
|
-
"deepmerge": "^4.3.1",
|
|
89
|
-
"eslint": "^8.51.0",
|
|
90
|
-
"eslint-plugin-vue": "^9.17.0",
|
|
91
|
-
"fast-deep-equal": "^3.1.3",
|
|
92
|
-
"ignore-loader": "^0.1.2",
|
|
93
|
-
"jest": "^29.7.0",
|
|
94
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
95
|
-
"jest-transform-stub": "^2.0.0",
|
|
96
|
-
"less-loader": "^6.2.0",
|
|
97
|
-
"script-loader": "^0.7.2",
|
|
98
|
-
"style-resources-loader": "^1.5.0",
|
|
99
|
-
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
100
|
-
"vue-jest": "^4.0.1",
|
|
101
|
-
"vue-template-compiler": "^2.7.14",
|
|
102
|
-
"webpack": "^5.88.2",
|
|
103
|
-
"webpack-theme-color-replacer": "^1.4.7",
|
|
104
|
-
"whatwg-fetch": "^3.6.19"
|
|
105
|
-
},
|
|
106
|
-
"browserslist": [
|
|
107
|
-
"> 1%",
|
|
108
|
-
"last 2 versions",
|
|
109
|
-
"not dead",
|
|
110
|
-
"not ie 11"
|
|
111
|
-
]
|
|
112
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue2-client",
|
|
3
|
+
"version": "1.18.15",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
7
|
+
"serve:gaslink": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode gaslink",
|
|
8
|
+
"serve:revenue": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode revenue",
|
|
9
|
+
"serve:liuli": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode liuli",
|
|
10
|
+
"serve:scada": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode scada",
|
|
11
|
+
"serve:iot": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode iot",
|
|
12
|
+
"serve:his": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode his",
|
|
13
|
+
"serve:runtime": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode runtime",
|
|
14
|
+
"serve:message": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode message",
|
|
15
|
+
"serve:apply": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint --mode apply",
|
|
16
|
+
"mac-serve": "vue-cli-service serve --no-eslint --mode his",
|
|
17
|
+
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
18
|
+
"test:unit": "vue-cli-service test:unit",
|
|
19
|
+
"lint": "vue-cli-service lint",
|
|
20
|
+
"build:preview": "vue-cli-service build --mode preview",
|
|
21
|
+
"lint:nofix": "vue-cli-service lint --no-fix",
|
|
22
|
+
"test": "jest"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
26
|
+
"@afwenming123/vue-plugin-hiprint": "^0.0.70",
|
|
27
|
+
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
28
|
+
"@antv/data-set": "^0.11.8",
|
|
29
|
+
"@antv/g2plot": "^2.4.31",
|
|
30
|
+
"@hufe921/canvas-editor": "^0.9.49",
|
|
31
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
32
|
+
"@vue/babel-preset-jsx": "^1.4.0",
|
|
33
|
+
"animate.css": "^4.1.1",
|
|
34
|
+
"ant-design-vue": "^1.7.8",
|
|
35
|
+
"axios": "^0.27.2",
|
|
36
|
+
"clipboard": "^2.0.11",
|
|
37
|
+
"core-js": "^3.33.0",
|
|
38
|
+
"crypto-js": "^4.1.1",
|
|
39
|
+
"date-fns": "^2.29.3",
|
|
40
|
+
"default-passive-events": "^2.0.0",
|
|
41
|
+
"dotenv": "^16.3.1",
|
|
42
|
+
"echarts": "^5.5.0",
|
|
43
|
+
"enquire.js": "^2.1.6",
|
|
44
|
+
"file-saver": "^2.0.5",
|
|
45
|
+
"highlight.js": "^11.7.0",
|
|
46
|
+
"html2canvas": "^1.4.1",
|
|
47
|
+
"js-base64": "^3.7.5",
|
|
48
|
+
"js-cookie": "^2.2.1",
|
|
49
|
+
"jsencrypt": "^3.3.2",
|
|
50
|
+
"jspdf": "^2.5.1",
|
|
51
|
+
"lodash.clonedeep": "^4.5.0",
|
|
52
|
+
"lodash.debounce": "^4",
|
|
53
|
+
"lodash.get": "^4.4.2",
|
|
54
|
+
"marked": "^4",
|
|
55
|
+
"mockjs": "^1.1.0",
|
|
56
|
+
"nprogress": "^0.2.0",
|
|
57
|
+
"qs": "^6.11.2",
|
|
58
|
+
"regenerator-runtime": "^0.14.0",
|
|
59
|
+
"splitpanes": "^2.4.1",
|
|
60
|
+
"videojs-contrib-hls": "^5.15.0",
|
|
61
|
+
"viser-vue": "^2.4.8",
|
|
62
|
+
"vue": "^2.7.14",
|
|
63
|
+
"vue-codemirror": "4.0.6",
|
|
64
|
+
"vue-color": "2.7.0",
|
|
65
|
+
"vue-draggable-resizable": "^2.3.0",
|
|
66
|
+
"vue-i18n": "^8.28.2",
|
|
67
|
+
"vue-json-viewer": "^2.2.22",
|
|
68
|
+
"vue-router": "^3.6.5",
|
|
69
|
+
"vue-video-player": "^5.0.2",
|
|
70
|
+
"vue-virtual-scroller": "^1.1.2",
|
|
71
|
+
"vuedraggable": "^2.24.3",
|
|
72
|
+
"vuex": "^3.6.2",
|
|
73
|
+
"xlsx": "0.18.5"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@ant-design/colors": "^7.0.0",
|
|
77
|
+
"@babel/core": "^7.22.20",
|
|
78
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
79
|
+
"@babel/preset-env": "^7.22.20",
|
|
80
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
81
|
+
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
82
|
+
"@vue/cli-service": "^5.0.8",
|
|
83
|
+
"@vue/eslint-config-standard": "^8.0.1",
|
|
84
|
+
"@vue/test-utils": "^1.3.6",
|
|
85
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
86
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
87
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
88
|
+
"deepmerge": "^4.3.1",
|
|
89
|
+
"eslint": "^8.51.0",
|
|
90
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
91
|
+
"fast-deep-equal": "^3.1.3",
|
|
92
|
+
"ignore-loader": "^0.1.2",
|
|
93
|
+
"jest": "^29.7.0",
|
|
94
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
95
|
+
"jest-transform-stub": "^2.0.0",
|
|
96
|
+
"less-loader": "^6.2.0",
|
|
97
|
+
"script-loader": "^0.7.2",
|
|
98
|
+
"style-resources-loader": "^1.5.0",
|
|
99
|
+
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
100
|
+
"vue-jest": "^4.0.1",
|
|
101
|
+
"vue-template-compiler": "^2.7.14",
|
|
102
|
+
"webpack": "^5.88.2",
|
|
103
|
+
"webpack-theme-color-replacer": "^1.4.7",
|
|
104
|
+
"whatwg-fetch": "^3.6.19"
|
|
105
|
+
},
|
|
106
|
+
"browserslist": [
|
|
107
|
+
"> 1%",
|
|
108
|
+
"last 2 versions",
|
|
109
|
+
"not dead",
|
|
110
|
+
"not ie 11"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -87,6 +87,7 @@ const chartData = ref([])
|
|
|
87
87
|
const loading = ref(false)
|
|
88
88
|
let resizeObserver = null
|
|
89
89
|
const activePointIndex = ref(-1)
|
|
90
|
+
const activeBarIndex = ref(-1)
|
|
90
91
|
const selectedFilterValue = ref('')
|
|
91
92
|
const selectedSideListValue = ref('')
|
|
92
93
|
|
|
@@ -259,36 +260,111 @@ const handleListChange = (value) => {
|
|
|
259
260
|
|
|
260
261
|
// 常用图表预设,统一处理 dataset → ECharts option 的映射
|
|
261
262
|
const presetResolvers = {
|
|
262
|
-
bar: ({ dataset }) =>
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
type: 'shadow'
|
|
263
|
+
bar: ({ dataset = [], config = {}, state = {} }) => {
|
|
264
|
+
const activeIndex = typeof state.activeBarIndex === 'number' ? state.activeBarIndex : -1
|
|
265
|
+
if (!dataset.length) {
|
|
266
|
+
return {
|
|
267
|
+
xAxis: { type: 'category', data: [] },
|
|
268
|
+
yAxis: { type: 'value' },
|
|
269
|
+
series: [{ type: 'bar', data: [] }]
|
|
270
270
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const barColor = config.barColor || '#3362DA'
|
|
274
|
+
const barHighlightColor = config.barHighlightColor || '#4C7CFF'
|
|
275
|
+
const valueSuffix = config.valueSuffix || ''
|
|
276
|
+
|
|
277
|
+
const tooltipFormatter = (params = []) => {
|
|
278
|
+
if (!params.length) return ''
|
|
279
|
+
const point = params.find(item => item.seriesIndex === 0) || params[0]
|
|
280
|
+
const value = typeof point.data === 'object' ? point.data?.value : point.data
|
|
281
|
+
return `${point.axisValue}<br/>${value}${valueSuffix}`
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return {
|
|
285
|
+
animationDuration: 420,
|
|
286
|
+
animationEasing: 'cubicOut',
|
|
287
|
+
animationDelay: (_, idx) => idx * 40,
|
|
288
|
+
tooltip: {
|
|
289
|
+
trigger: 'axis',
|
|
290
|
+
backgroundColor: '#1F5BFF',
|
|
291
|
+
borderWidth: 0,
|
|
292
|
+
textStyle: { color: '#fff' },
|
|
293
|
+
axisPointer: {
|
|
294
|
+
type: 'shadow',
|
|
295
|
+
shadowStyle: {
|
|
296
|
+
color: 'rgba(51, 98, 218, 0.08)'
|
|
297
|
+
}
|
|
281
298
|
},
|
|
282
|
-
|
|
299
|
+
formatter: tooltipFormatter
|
|
300
|
+
},
|
|
301
|
+
grid: {
|
|
302
|
+
top: 40,
|
|
303
|
+
left: 60,
|
|
304
|
+
right: 40,
|
|
305
|
+
bottom: 40,
|
|
306
|
+
containLabel: true
|
|
307
|
+
},
|
|
308
|
+
xAxis: {
|
|
309
|
+
type: 'category',
|
|
310
|
+
data: dataset.map(item => item.label),
|
|
311
|
+
axisLine: { lineStyle: { color: '#C8D2E8' } },
|
|
312
|
+
axisLabel: { color: '#5C6C8C', fontWeight: 500 },
|
|
313
|
+
axisTick: { show: false },
|
|
314
|
+
splitLine: { show: false }
|
|
315
|
+
},
|
|
316
|
+
yAxis: {
|
|
317
|
+
type: 'value',
|
|
318
|
+
min: 0,
|
|
319
|
+
max: config.yMax ?? 100,
|
|
320
|
+
minInterval: 1,
|
|
321
|
+
axisLine: { show: false },
|
|
322
|
+
axisTick: { show: false },
|
|
323
|
+
axisLabel: {
|
|
324
|
+
color: '#5C6C8C',
|
|
325
|
+
fontWeight: 500,
|
|
326
|
+
formatter: value => `${value}${valueSuffix}`
|
|
327
|
+
},
|
|
328
|
+
splitLine: {
|
|
329
|
+
show: true,
|
|
330
|
+
lineStyle: { type: 'dashed', color: '#E0E6F1' }
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
series: [
|
|
334
|
+
{
|
|
335
|
+
type: 'bar',
|
|
336
|
+
data: dataset.map((item, idx) => ({
|
|
337
|
+
value: item.value,
|
|
338
|
+
barWidth: idx === activeIndex ? 10 : 5
|
|
339
|
+
})),
|
|
283
340
|
itemStyle: {
|
|
284
|
-
color:
|
|
285
|
-
|
|
286
|
-
|
|
341
|
+
color: barColor,
|
|
342
|
+
borderRadius: [6, 6, 0, 0]
|
|
343
|
+
},
|
|
344
|
+
label: {
|
|
345
|
+
show: true,
|
|
346
|
+
position: 'top',
|
|
347
|
+
color: barColor,
|
|
348
|
+
fontWeight: 600,
|
|
349
|
+
formatter: params => {
|
|
350
|
+
const value = typeof params.data === 'object' ? params.data?.value : params.data
|
|
351
|
+
return `${value}${valueSuffix}`
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
emphasis: {
|
|
355
|
+
itemStyle: {
|
|
356
|
+
color: barHighlightColor,
|
|
357
|
+
shadowBlur: 18,
|
|
358
|
+
shadowColor: 'rgba(76, 124, 255, 0.45)'
|
|
359
|
+
},
|
|
360
|
+
label: {
|
|
361
|
+
color: barHighlightColor
|
|
362
|
+
}
|
|
287
363
|
}
|
|
288
364
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
},
|
|
292
368
|
line: ({ dataset = [], config = {}, state = {} }) => {
|
|
293
369
|
if (!dataset.length) {
|
|
294
370
|
return {
|
|
@@ -598,6 +674,7 @@ const loadChartData = async (config) => {
|
|
|
598
674
|
if (staticDataset) {
|
|
599
675
|
chartData.value = staticDataset
|
|
600
676
|
activePointIndex.value = -1
|
|
677
|
+
activeBarIndex.value = -1
|
|
601
678
|
renderChart()
|
|
602
679
|
emit('dataLoaded', chartData.value)
|
|
603
680
|
return
|
|
@@ -615,12 +692,14 @@ const loadChartData = async (config) => {
|
|
|
615
692
|
}
|
|
616
693
|
chartData.value = transformedData
|
|
617
694
|
activePointIndex.value = -1
|
|
695
|
+
activeBarIndex.value = -1
|
|
618
696
|
renderChart()
|
|
619
697
|
emit('dataLoaded', transformedData)
|
|
620
698
|
} else {
|
|
621
699
|
// 没有数据源,使用空数据
|
|
622
700
|
chartData.value = []
|
|
623
701
|
activePointIndex.value = -1
|
|
702
|
+
activeBarIndex.value = -1
|
|
624
703
|
renderChart()
|
|
625
704
|
}
|
|
626
705
|
} catch (error) {
|
|
@@ -632,13 +711,21 @@ const loadChartData = async (config) => {
|
|
|
632
711
|
// 渲染图表
|
|
633
712
|
const handleChartClick = (params) => {
|
|
634
713
|
const config = chartConfig.value || props.config
|
|
635
|
-
if (config?.
|
|
636
|
-
if (params
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
714
|
+
if (!config || params?.componentType !== 'series') return
|
|
715
|
+
if (config.type === 'line' && params.seriesType === 'line') {
|
|
716
|
+
if (typeof params.dataIndex !== 'number') return
|
|
717
|
+
if (activePointIndex.value === params.dataIndex) return
|
|
718
|
+
activePointIndex.value = params.dataIndex
|
|
719
|
+
renderChart()
|
|
720
|
+
return
|
|
721
|
+
}
|
|
722
|
+
if (config.type === 'bar' && params.seriesType === 'bar') {
|
|
723
|
+
if (typeof params.dataIndex !== 'number') return
|
|
724
|
+
const nextIndex = activeBarIndex.value === params.dataIndex ? -1 : params.dataIndex
|
|
725
|
+
if (activeBarIndex.value === nextIndex) return
|
|
726
|
+
activeBarIndex.value = nextIndex
|
|
727
|
+
renderChart()
|
|
728
|
+
}
|
|
642
729
|
}
|
|
643
730
|
|
|
644
731
|
const renderChart = () => {
|
|
@@ -666,7 +753,10 @@ const renderChart = () => {
|
|
|
666
753
|
const preset = resolver({
|
|
667
754
|
dataset: chartData.value,
|
|
668
755
|
config,
|
|
669
|
-
state: {
|
|
756
|
+
state: {
|
|
757
|
+
activePointIndex: activePointIndex.value,
|
|
758
|
+
activeBarIndex: activeBarIndex.value
|
|
759
|
+
}
|
|
670
760
|
})
|
|
671
761
|
|
|
672
762
|
// 处理颜色配置:如果只有一个颜色,生成渐变数组
|
|
@@ -689,6 +779,7 @@ const renderChart = () => {
|
|
|
689
779
|
if (config.options?.series && preset.series) {
|
|
690
780
|
// 分离需要特殊处理的配置项
|
|
691
781
|
const { xAxis: customXAxis, yAxis: customYAxis, series: customSeries, color: _, ...restOptions } = config.options
|
|
782
|
+
const normalizedCustomSeries = Array.isArray(customSeries) ? customSeries : [customSeries]
|
|
692
783
|
|
|
693
784
|
finalOptions = {
|
|
694
785
|
...finalOptions,
|
|
@@ -713,14 +804,11 @@ const renderChart = () => {
|
|
|
713
804
|
...customYAxis
|
|
714
805
|
}
|
|
715
806
|
}),
|
|
716
|
-
series:
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
data: preset.series[0].data
|
|
722
|
-
}
|
|
723
|
-
]
|
|
807
|
+
series: preset.series.map((seriesItem, idx) => ({
|
|
808
|
+
...seriesItem,
|
|
809
|
+
...(normalizedCustomSeries[idx] || {}),
|
|
810
|
+
data: seriesItem.data
|
|
811
|
+
}))
|
|
724
812
|
}
|
|
725
813
|
} else {
|
|
726
814
|
// 没有自定义 series 的情况
|