|
|
@@ -1,13 +1,14 @@
|
|
1
|
|
-/** 共同富裕大屏 ECharts 配置(对齐 doc/共同富裕 设计稿) */
|
|
|
1
|
+/** 共同富裕大屏 ECharts 配置(对齐 doc/大屏/共同富裕 v1.1 滚动 12 月) */
|
|
2
|
2
|
|
|
3
|
3
|
const AXIS_LABEL = { color: '#9fb0c3', fontSize: 10 }
|
|
4
|
4
|
const AXIS_LINE = { lineStyle: { color: 'rgba(61, 217, 176, 0.35)' } }
|
|
5
|
5
|
const SPLIT_LINE = { lineStyle: { color: 'rgba(61, 217, 176, 0.12)' } }
|
|
6
|
6
|
const GRID = { left: 40, right: 16, top: 28, bottom: 28, containLabel: true }
|
|
7
|
|
-const MONTHS = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
|
|
8
|
7
|
|
|
9
|
8
|
const PROJECT_TYPE_COLOR = ['#45f0b8', '#6eb5ff', '#ecd27b']
|
|
10
|
9
|
|
|
|
10
|
+const ACHIEVEMENT_EMPTY = '暂无该年度共富成果数据'
|
|
|
11
|
+
|
|
11
|
12
|
function emptyOption(text = '暂无数据') {
|
|
12
|
13
|
return {
|
|
13
|
14
|
title: {
|
|
|
@@ -19,45 +20,72 @@ function emptyOption(text = '暂无数据') {
|
|
19
|
20
|
}
|
|
20
|
21
|
}
|
|
21
|
22
|
|
|
22
|
|
-function monthSeries(monthly, field) {
|
|
23
|
|
- if (!monthly?.length) {
|
|
24
|
|
- return MONTHS.map(() => 0)
|
|
|
23
|
+function pickNumber(row, fields) {
|
|
|
24
|
+ for (const key of fields) {
|
|
|
25
|
+ const raw = row?.[key]
|
|
|
26
|
+ if (raw != null && raw !== '') {
|
|
|
27
|
+ const n = Number(raw)
|
|
|
28
|
+ if (!Number.isNaN(n)) {
|
|
|
29
|
+ return n
|
|
|
30
|
+ }
|
|
|
31
|
+ }
|
|
25
|
32
|
}
|
|
26
|
|
- const map = new Map(monthly.map((row) => [row.month, row[field] ?? 0]))
|
|
27
|
|
- return MONTHS.map((_, i) => {
|
|
28
|
|
- const val = map.get(i + 1) ?? 0
|
|
29
|
|
- return typeof val === 'object' && val !== null ? Number(val) : Number(val)
|
|
|
33
|
+ return 0
|
|
|
34
|
+}
|
|
|
35
|
+
|
|
|
36
|
+/** 滚动最近 12 月:按 statYear、month 升序 */
|
|
|
37
|
+function sortRollingMonths(list) {
|
|
|
38
|
+ return [...(list || [])].sort((a, b) => {
|
|
|
39
|
+ const ak = (Number(a.statYear) || 0) * 100 + (Number(a.month) || 0)
|
|
|
40
|
+ const bk = (Number(b.statYear) || 0) * 100 + (Number(b.month) || 0)
|
|
|
41
|
+ return ak - bk
|
|
30
|
42
|
})
|
|
31
|
43
|
}
|
|
32
|
44
|
|
|
33
|
|
-function hasMonthlyData(monthly, field) {
|
|
34
|
|
- return monthly?.length && monthSeries(monthly, field).some((v) => v > 0)
|
|
|
45
|
+function rollingMonthLabel(row) {
|
|
|
46
|
+ return `${Number(row.month)}月`
|
|
|
47
|
+}
|
|
|
48
|
+
|
|
|
49
|
+function rollingTooltipTitle(row) {
|
|
|
50
|
+ if (!row) {
|
|
|
51
|
+ return ''
|
|
|
52
|
+ }
|
|
|
53
|
+ return `${row.statYear}年${Number(row.month)}月`
|
|
|
54
|
+}
|
|
|
55
|
+
|
|
|
56
|
+function buildRollingAxis(list) {
|
|
|
57
|
+ const rows = sortRollingMonths(list)
|
|
|
58
|
+ return {
|
|
|
59
|
+ rows,
|
|
|
60
|
+ categories: rows.map(rollingMonthLabel),
|
|
|
61
|
+ titleAt: (dataIndex) => rollingTooltipTitle(rows[dataIndex])
|
|
|
62
|
+ }
|
|
|
63
|
+}
|
|
|
64
|
+
|
|
|
65
|
+function rollingSeries(list, field, altFields = []) {
|
|
|
66
|
+ const fields = [field, ...altFields]
|
|
|
67
|
+ return sortRollingMonths(list).map((row) => pickNumber(row, fields))
|
|
35
|
68
|
}
|
|
36
|
69
|
|
|
37
|
|
-/** 横轴为去掉「月」的类目时,tooltip 标题补回「月」 */
|
|
38
|
|
-function formatMonthAxisTooltip(params) {
|
|
39
|
|
- const list = Array.isArray(params) ? params : [params]
|
|
40
|
|
- const raw = list[0]?.axisValue
|
|
41
|
|
- const title =
|
|
42
|
|
- raw != null && raw !== ''
|
|
43
|
|
- ? String(raw).endsWith('月')
|
|
44
|
|
- ? String(raw)
|
|
45
|
|
- : `${raw}月`
|
|
46
|
|
- : ''
|
|
47
|
|
- const body = list
|
|
48
|
|
- .map((p) =>
|
|
49
|
|
- p.seriesName ? `${p.marker}${p.seriesName}:${p.value}` : `${p.marker}${p.value}`
|
|
50
|
|
- )
|
|
51
|
|
- .join('<br/>')
|
|
52
|
|
- return title ? `${title}<br/>${body}` : body
|
|
|
70
|
+function rollingAxisTooltip(params, axis, valueFormatter) {
|
|
|
71
|
+ if (!Array.isArray(params) || !params.length) {
|
|
|
72
|
+ return ''
|
|
|
73
|
+ }
|
|
|
74
|
+ const title = axis.titleAt(params[0].dataIndex)
|
|
|
75
|
+ const lines = params.map((p) => {
|
|
|
76
|
+ const val = valueFormatter ? valueFormatter(p) : `${p.value ?? 0}`
|
|
|
77
|
+ return `${p.marker}${p.seriesName}:${val}`
|
|
|
78
|
+ })
|
|
|
79
|
+ return `${title}<br/>${lines.join('<br/>')}`
|
|
53
|
80
|
}
|
|
54
|
81
|
|
|
55
|
|
-/** 经济收入对比 — 横向柱(集体经济收入,万元) */
|
|
|
82
|
+/** 经济收入对比 — 横向柱(集体经济收入,万元,滚动 12 月) */
|
|
56
|
83
|
export function buildCollectiveIncomeBarOption(monthly, hasData) {
|
|
57
|
|
- if (!hasData || !hasMonthlyData(monthly, 'collectiveEconomyIncome')) {
|
|
58
|
|
- return emptyOption('暂无收入数据')
|
|
|
84
|
+ if (!hasData || !monthly?.length) {
|
|
|
85
|
+ return emptyOption(ACHIEVEMENT_EMPTY)
|
|
59
|
86
|
}
|
|
60
|
|
- const values = monthSeries(monthly, 'collectiveEconomyIncome')
|
|
|
87
|
+ const axis = buildRollingAxis(monthly)
|
|
|
88
|
+ const values = rollingSeries(monthly, 'collectiveEconomyIncome')
|
|
61
|
89
|
const maxVal = Math.max(...values, 1)
|
|
62
|
90
|
return {
|
|
63
|
91
|
color: ['#ecd27b'],
|
|
|
@@ -70,7 +98,8 @@ export function buildCollectiveIncomeBarOption(monthly, hasData) {
|
|
70
|
98
|
if (!row) {
|
|
71
|
99
|
return ''
|
|
72
|
100
|
}
|
|
73
|
|
- return `${row.name}<br/>收入:${Number(row.value).toFixed(1)} 万元`
|
|
|
101
|
+ const title = axis.titleAt(row.dataIndex)
|
|
|
102
|
+ return `${title}<br/>收入:${Number(row.value).toFixed(1)} 万元`
|
|
74
|
103
|
}
|
|
75
|
104
|
},
|
|
76
|
105
|
grid: { left: 4, right: 36, top: 10, bottom: 0, containLabel: true },
|
|
|
@@ -81,7 +110,7 @@ export function buildCollectiveIncomeBarOption(monthly, hasData) {
|
|
81
|
110
|
},
|
|
82
|
111
|
yAxis: {
|
|
83
|
112
|
type: 'category',
|
|
84
|
|
- data: MONTHS,
|
|
|
113
|
+ data: axis.categories,
|
|
85
|
114
|
inverse: true,
|
|
86
|
115
|
boundaryGap: false,
|
|
87
|
116
|
axisLabel: {
|
|
|
@@ -104,7 +133,7 @@ export function buildCollectiveIncomeBarOption(monthly, hasData) {
|
|
104
|
133
|
silent: true,
|
|
105
|
134
|
tooltip: { show: false },
|
|
106
|
135
|
itemStyle: { color: 'rgba(15, 80, 68, 0.55)', borderRadius: [0, 4, 4, 0] },
|
|
107
|
|
- data: MONTHS.map(() => maxVal),
|
|
|
136
|
+ data: axis.categories.map(() => maxVal),
|
|
108
|
137
|
z: 1
|
|
109
|
138
|
},
|
|
110
|
139
|
{
|
|
|
@@ -139,18 +168,18 @@ export function buildCollectiveIncomeBarOption(monthly, hasData) {
|
|
139
|
168
|
}
|
|
140
|
169
|
}
|
|
141
|
170
|
|
|
142
|
|
-/** 就业带动 — 就业人数 + 就业岗位双折线 */
|
|
|
171
|
+/** 就业带动 — 带动就业人数 + 新增就业岗位双折线(滚动 12 月) */
|
|
143
|
172
|
export function buildEmploymentOption(monthly, hasData) {
|
|
144
|
|
- if (
|
|
145
|
|
- !hasData ||
|
|
146
|
|
- (!hasMonthlyData(monthly, 'employmentDrivenCount') &&
|
|
147
|
|
- !hasMonthlyData(monthly, 'newJobPositions'))
|
|
148
|
|
- ) {
|
|
149
|
|
- return emptyOption('暂无就业数据')
|
|
|
173
|
+ if (!hasData || !monthly?.length) {
|
|
|
174
|
+ return emptyOption(ACHIEVEMENT_EMPTY)
|
|
150
|
175
|
}
|
|
|
176
|
+ const axis = buildRollingAxis(monthly)
|
|
151
|
177
|
return {
|
|
152
|
178
|
color: ['#ecd27b', '#5ef0c8'],
|
|
153
|
|
- tooltip: { trigger: 'axis', formatter: formatMonthAxisTooltip },
|
|
|
179
|
+ tooltip: {
|
|
|
180
|
+ trigger: 'axis',
|
|
|
181
|
+ formatter: (params) => rollingAxisTooltip(params, axis)
|
|
|
182
|
+ },
|
|
154
|
183
|
legend: {
|
|
155
|
184
|
top: 4,
|
|
156
|
185
|
left: 'center',
|
|
|
@@ -161,7 +190,7 @@ export function buildEmploymentOption(monthly, hasData) {
|
|
161
|
190
|
grid: { ...GRID, left: 10, top: 36, bottom: 8 },
|
|
162
|
191
|
xAxis: {
|
|
163
|
192
|
type: 'category',
|
|
164
|
|
- data: MONTHS.map((m) => m.replace('月', '')),
|
|
|
193
|
+ data: axis.categories,
|
|
165
|
194
|
axisLabel: { ...AXIS_LABEL, fontSize: 9, interval: 0 },
|
|
166
|
195
|
axisLine: AXIS_LINE
|
|
167
|
196
|
},
|
|
|
@@ -187,40 +216,44 @@ export function buildEmploymentOption(monthly, hasData) {
|
|
187
|
216
|
],
|
|
188
|
217
|
series: [
|
|
189
|
218
|
{
|
|
190
|
|
- name: '就业人数',
|
|
|
219
|
+ name: '带动就业人数',
|
|
191
|
220
|
type: 'line',
|
|
192
|
221
|
smooth: true,
|
|
193
|
222
|
symbol: 'circle',
|
|
194
|
223
|
symbolSize: 4,
|
|
195
|
224
|
areaStyle: { color: 'rgba(236, 210, 123, 0.2)' },
|
|
196
|
|
- data: monthSeries(monthly, 'employmentDrivenCount')
|
|
|
225
|
+ data: rollingSeries(monthly, 'employmentDrivenCount')
|
|
197
|
226
|
},
|
|
198
|
227
|
{
|
|
199
|
|
- name: '就业岗位',
|
|
|
228
|
+ name: '新增就业岗位',
|
|
200
|
229
|
type: 'line',
|
|
201
|
230
|
yAxisIndex: 1,
|
|
202
|
231
|
smooth: true,
|
|
203
|
232
|
symbol: 'circle',
|
|
204
|
233
|
symbolSize: 4,
|
|
205
|
234
|
areaStyle: { color: 'rgba(94, 240, 200, 0.15)' },
|
|
206
|
|
- data: monthSeries(monthly, 'newJobPositions')
|
|
|
235
|
+ data: rollingSeries(monthly, 'newJobPositions')
|
|
207
|
236
|
}
|
|
208
|
237
|
]
|
|
209
|
238
|
}
|
|
210
|
239
|
}
|
|
211
|
240
|
|
|
212
|
|
-/** 环境治理 — 项目数月度柱图 */
|
|
|
241
|
+/** 环境治理 — 项目数月度柱图(滚动 12 月) */
|
|
213
|
242
|
export function buildEnvGovernanceOption(monthly, hasData) {
|
|
214
|
|
- if (!hasData || !hasMonthlyData(monthly, 'envProjectCount')) {
|
|
215
|
|
- return emptyOption('暂无环境治理数据')
|
|
|
243
|
+ if (!hasData || !monthly?.length) {
|
|
|
244
|
+ return emptyOption(ACHIEVEMENT_EMPTY)
|
|
216
|
245
|
}
|
|
|
246
|
+ const axis = buildRollingAxis(monthly)
|
|
217
|
247
|
return {
|
|
218
|
248
|
color: ['#ecd27b'],
|
|
219
|
|
- tooltip: { trigger: 'axis', formatter: formatMonthAxisTooltip },
|
|
|
249
|
+ tooltip: {
|
|
|
250
|
+ trigger: 'axis',
|
|
|
251
|
+ formatter: (params) => rollingAxisTooltip(params, axis, (p) => `${p.value ?? 0} 个`)
|
|
|
252
|
+ },
|
|
220
|
253
|
grid: { ...GRID, left: 10, right: 8, top: 36, bottom: 20, containLabel: true },
|
|
221
|
254
|
xAxis: {
|
|
222
|
255
|
type: 'category',
|
|
223
|
|
- data: MONTHS.map((m) => m.replace('月', '')),
|
|
|
256
|
+ data: axis.categories,
|
|
224
|
257
|
axisLabel: {
|
|
225
|
258
|
...AXIS_LABEL,
|
|
226
|
259
|
fontSize: 9,
|
|
|
@@ -244,24 +277,28 @@ export function buildEnvGovernanceOption(monthly, hasData) {
|
|
244
|
277
|
barMaxWidth: 8,
|
|
245
|
278
|
barCategoryGap: '35%',
|
|
246
|
279
|
itemStyle: { color: '#ecd27b', borderRadius: [3, 3, 0, 0] },
|
|
247
|
|
- data: monthSeries(monthly, 'envProjectCount')
|
|
|
280
|
+ data: rollingSeries(monthly, 'envProjectCount')
|
|
248
|
281
|
}
|
|
249
|
282
|
]
|
|
250
|
283
|
}
|
|
251
|
284
|
}
|
|
252
|
285
|
|
|
253
|
|
-/** 绿化建设 — 新增绿化面积折线面积图 */
|
|
|
286
|
+/** 绿化建设 — 新增绿化面积折线面积图(滚动 12 月) */
|
|
254
|
287
|
export function buildGreenAreaOption(monthly, hasData) {
|
|
255
|
|
- if (!hasData || !hasMonthlyData(monthly, 'newGreenArea')) {
|
|
256
|
|
- return emptyOption('暂无绿化数据')
|
|
|
288
|
+ if (!hasData || !monthly?.length) {
|
|
|
289
|
+ return emptyOption(ACHIEVEMENT_EMPTY)
|
|
257
|
290
|
}
|
|
|
291
|
+ const axis = buildRollingAxis(monthly)
|
|
258
|
292
|
return {
|
|
259
|
293
|
color: ['#5ef0c8'],
|
|
260
|
|
- tooltip: { trigger: 'axis' },
|
|
261
|
|
- grid: {...GRID, left: 10, bottom: 8},
|
|
|
294
|
+ tooltip: {
|
|
|
295
|
+ trigger: 'axis',
|
|
|
296
|
+ formatter: (params) => rollingAxisTooltip(params, axis, (p) => `${p.value ?? 0} 亩`)
|
|
|
297
|
+ },
|
|
|
298
|
+ grid: { ...GRID, left: 10, bottom: 8 },
|
|
262
|
299
|
xAxis: {
|
|
263
|
300
|
type: 'category',
|
|
264
|
|
- data: MONTHS,
|
|
|
301
|
+ data: axis.categories,
|
|
265
|
302
|
axisLabel: { ...AXIS_LABEL, rotate: 35, interval: 0, fontSize: 9 },
|
|
266
|
303
|
axisLine: AXIS_LINE
|
|
267
|
304
|
},
|
|
|
@@ -275,30 +312,34 @@ export function buildGreenAreaOption(monthly, hasData) {
|
|
275
|
312
|
},
|
|
276
|
313
|
series: [
|
|
277
|
314
|
{
|
|
278
|
|
- name: '绿化面积',
|
|
|
315
|
+ name: '新增绿化面积',
|
|
279
|
316
|
type: 'line',
|
|
280
|
317
|
smooth: true,
|
|
281
|
318
|
symbol: 'circle',
|
|
282
|
319
|
symbolSize: 4,
|
|
283
|
320
|
areaStyle: { color: 'rgba(94, 240, 200, 0.3)' },
|
|
284
|
|
- data: monthSeries(monthly, 'newGreenArea')
|
|
|
321
|
+ data: rollingSeries(monthly, 'newGreenArea')
|
|
285
|
322
|
}
|
|
286
|
323
|
]
|
|
287
|
324
|
}
|
|
288
|
325
|
}
|
|
289
|
326
|
|
|
290
|
|
-/** 文化传承 — 月度柱图 */
|
|
|
327
|
+/** 文化传承 — 月度柱图(滚动 12 月) */
|
|
291
|
328
|
export function buildCulturalHeritageOption(monthly, hasData) {
|
|
292
|
|
- if (!hasData || !hasMonthlyData(monthly, 'culturalHeritageCount')) {
|
|
293
|
|
- return emptyOption('暂无文化传承数据')
|
|
|
329
|
+ if (!hasData || !monthly?.length) {
|
|
|
330
|
+ return emptyOption(ACHIEVEMENT_EMPTY)
|
|
294
|
331
|
}
|
|
|
332
|
+ const axis = buildRollingAxis(monthly)
|
|
295
|
333
|
return {
|
|
296
|
334
|
color: ['#5ef0c8'],
|
|
297
|
|
- tooltip: { trigger: 'axis', formatter: formatMonthAxisTooltip },
|
|
|
335
|
+ tooltip: {
|
|
|
336
|
+ trigger: 'axis',
|
|
|
337
|
+ formatter: (params) => rollingAxisTooltip(params, axis, (p) => `${p.value ?? 0} 人`)
|
|
|
338
|
+ },
|
|
298
|
339
|
grid: { ...GRID, left: 10, right: 8, bottom: 20, containLabel: true },
|
|
299
|
340
|
xAxis: {
|
|
300
|
341
|
type: 'category',
|
|
301
|
|
- data: MONTHS.map((m) => m.replace('月', '')),
|
|
|
342
|
+ data: axis.categories,
|
|
302
|
343
|
axisLabel: {
|
|
303
|
344
|
...AXIS_LABEL,
|
|
304
|
345
|
fontSize: 9,
|
|
|
@@ -317,32 +358,29 @@ export function buildCulturalHeritageOption(monthly, hasData) {
|
|
317
|
358
|
},
|
|
318
|
359
|
series: [
|
|
319
|
360
|
{
|
|
320
|
|
- name: '人数',
|
|
|
361
|
+ name: '文化传承人数',
|
|
321
|
362
|
type: 'bar',
|
|
322
|
363
|
barMaxWidth: 8,
|
|
323
|
364
|
barCategoryGap: '35%',
|
|
324
|
365
|
itemStyle: { color: '#5ef0c8', borderRadius: [3, 3, 0, 0] },
|
|
325
|
|
- data: monthSeries(monthly, 'culturalHeritageCount')
|
|
|
366
|
+ data: rollingSeries(monthly, 'culturalHeritageCount')
|
|
326
|
367
|
}
|
|
327
|
368
|
]
|
|
328
|
369
|
}
|
|
329
|
370
|
}
|
|
330
|
371
|
|
|
331
|
|
-/** 民族团结 — 堆叠柱 */
|
|
|
372
|
+/** 民族团结 — 堆叠柱(滚动 12 月) */
|
|
332
|
373
|
export function buildEthnicUnityStackedOption(monthly, hasData) {
|
|
333
|
|
- if (
|
|
334
|
|
- !hasData ||
|
|
335
|
|
- (!hasMonthlyData(monthly, 'ethnicIntegrationProjectCount') &&
|
|
336
|
|
- !hasMonthlyData(monthly, 'ethnicUnityActivityCount'))
|
|
337
|
|
- ) {
|
|
338
|
|
- return emptyOption('暂无民族团结数据')
|
|
|
374
|
+ if (!hasData || !monthly?.length) {
|
|
|
375
|
+ return emptyOption(ACHIEVEMENT_EMPTY)
|
|
339
|
376
|
}
|
|
|
377
|
+ const axis = buildRollingAxis(monthly)
|
|
340
|
378
|
return {
|
|
341
|
379
|
color: ['#5ef0c8', '#1a4a6e'],
|
|
342
|
380
|
tooltip: {
|
|
343
|
381
|
trigger: 'axis',
|
|
344
|
382
|
axisPointer: { type: 'shadow' },
|
|
345
|
|
- formatter: formatMonthAxisTooltip
|
|
|
383
|
+ formatter: (params) => rollingAxisTooltip(params, axis, (p) => `${p.value ?? 0} 个`)
|
|
346
|
384
|
},
|
|
347
|
385
|
legend: {
|
|
348
|
386
|
top: 4,
|
|
|
@@ -354,7 +392,7 @@ export function buildEthnicUnityStackedOption(monthly, hasData) {
|
|
354
|
392
|
grid: { ...GRID, left: 10, right: 8, top: 36, bottom: 20, containLabel: true },
|
|
355
|
393
|
xAxis: {
|
|
356
|
394
|
type: 'category',
|
|
357
|
|
- data: MONTHS.map((m) => m.replace('月', '')),
|
|
|
395
|
+ data: axis.categories,
|
|
358
|
396
|
axisLabel: {
|
|
359
|
397
|
...AXIS_LABEL,
|
|
360
|
398
|
fontSize: 9,
|
|
|
@@ -373,19 +411,19 @@ export function buildEthnicUnityStackedOption(monthly, hasData) {
|
|
373
|
411
|
},
|
|
374
|
412
|
series: [
|
|
375
|
413
|
{
|
|
376
|
|
- name: '民族融合案例',
|
|
|
414
|
+ name: '民族融合项目数',
|
|
377
|
415
|
type: 'bar',
|
|
378
|
416
|
stack: 'ethnic',
|
|
379
|
417
|
barMaxWidth: 8,
|
|
380
|
418
|
barCategoryGap: '35%',
|
|
381
|
|
- data: monthSeries(monthly, 'ethnicIntegrationProjectCount')
|
|
|
419
|
+ data: rollingSeries(monthly, 'ethnicIntegrationProjectCount')
|
|
382
|
420
|
},
|
|
383
|
421
|
{
|
|
384
|
|
- name: '民族团结活动',
|
|
|
422
|
+ name: '民族团结活动数',
|
|
385
|
423
|
type: 'bar',
|
|
386
|
424
|
stack: 'ethnic',
|
|
387
|
425
|
barMaxWidth: 8,
|
|
388
|
|
- data: monthSeries(monthly, 'ethnicUnityActivityCount')
|
|
|
426
|
+ data: rollingSeries(monthly, 'ethnicUnityActivityCount')
|
|
389
|
427
|
}
|
|
390
|
428
|
]
|
|
391
|
429
|
}
|
|
|
@@ -394,7 +432,7 @@ export function buildEthnicUnityStackedOption(monthly, hasData) {
|
|
394
|
432
|
/** 共富项目分类 — 饼图 */
|
|
395
|
433
|
export function buildProjectTypePieOption(projectTypeStats, hasProjectData) {
|
|
396
|
434
|
if (!hasProjectData || !projectTypeStats?.length) {
|
|
397
|
|
- return emptyOption('暂无项目数据')
|
|
|
435
|
+ return emptyOption('本年度暂无共富项目')
|
|
398
|
436
|
}
|
|
399
|
437
|
const data = projectTypeStats
|
|
400
|
438
|
.filter((item) => (item.count ?? 0) > 0)
|
|
|
@@ -404,7 +442,7 @@ export function buildProjectTypePieOption(projectTypeStats, hasProjectData) {
|
|
404
|
442
|
itemStyle: { color: PROJECT_TYPE_COLOR[i % PROJECT_TYPE_COLOR.length] }
|
|
405
|
443
|
}))
|
|
406
|
444
|
if (!data.length) {
|
|
407
|
|
- return emptyOption('暂无项目数据')
|
|
|
445
|
+ return emptyOption('本年度暂无共富项目')
|
|
408
|
446
|
}
|
|
409
|
447
|
return {
|
|
410
|
448
|
tooltip: {
|