|
|
@@ -426,15 +426,24 @@ const initDailySeizedArea = () => {
|
|
426
|
426
|
}
|
|
427
|
427
|
const rawData = countSeizureSingleQuantityData.value
|
|
428
|
428
|
if (!rawData || rawData.length === 0) return
|
|
|
429
|
+
|
|
|
430
|
+ const dates = [...new Set(rawData.map(item => item.recordDate))].sort()
|
|
|
431
|
+ const groupNames = [...new Set(rawData.flatMap(d => d.items.map(i => i.groupName)))]
|
|
|
432
|
+
|
|
429
|
433
|
const groupMap = {}
|
|
430
|
|
- rawData.forEach(item => {
|
|
431
|
|
- if (!groupMap[item.groupName]) {
|
|
432
|
|
- groupMap[item.groupName] = []
|
|
433
|
|
- }
|
|
434
|
|
- groupMap[item.groupName].push(item.seizeQuantity)
|
|
|
434
|
+ groupNames.forEach(name => {
|
|
|
435
|
+ groupMap[name] = new Array(dates.length).fill(0)
|
|
435
|
436
|
})
|
|
436
|
|
- const groupNames = Object.keys(groupMap)
|
|
437
|
|
- const dates = [...new Set(rawData.map(item => item.recordDate))]
|
|
|
437
|
+
|
|
|
438
|
+ rawData.forEach(record => {
|
|
|
439
|
+ const dateIndex = dates.indexOf(record.recordDate)
|
|
|
440
|
+ record.items.forEach(item => {
|
|
|
441
|
+ if (groupMap[item.groupName] && dateIndex >= 0) {
|
|
|
442
|
+ groupMap[item.groupName][dateIndex] = item.seizeQuantity
|
|
|
443
|
+ }
|
|
|
444
|
+ })
|
|
|
445
|
+ })
|
|
|
446
|
+
|
|
438
|
447
|
const countryColors = ['#4da6ff', '#7eff7e', '#bd03fb', '#ffd93d', '#ff6b6b', '#00f5ff', '#ffa500', '#71B138']
|
|
439
|
448
|
const series = groupNames.map((name, idx) => {
|
|
440
|
449
|
const color = countryColors[idx % countryColors.length]
|