verce-vue-test 0.0.92 → 0.0.93

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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +4 -0
  3. package/src/components/{NumberRange.vue → element-rewrite/NumberRange.vue} +1 -1
  4. package/src/components/index.ts +2 -2
  5. package/src/router/index.ts +5 -0
  6. package/src/views/ForecastInfo/components/FlowInfoPanel.vue +1 -1
  7. package/src/views/ForecastInfo/components/ForecastInfoPanel.vue +1 -1
  8. package/src/views/FundCockpitView.vue +344 -101
  9. package/src/views/NumberRangeView.vue +1 -1
  10. package/src/views/foreign-currency-authorization/index.vue +48 -4
  11. package/src/views/foreign-currency-fund-allocation/api.ts +87 -0
  12. package/src/views/foreign-currency-fund-allocation/index.vue +1100 -0
  13. package/src/views/foreign-currency-fund-allocation/options.ts +23 -0
  14. package/src/views/foreign-currency-fund-allocation/types.ts +127 -0
  15. package/src/views/foreign-currency-position-forecast/components/ForeignPositionForecastEditor.vue +63 -5
  16. package/src/views/foreign-currency-settlement/api.ts +10 -60
  17. package/src/views/foreign-currency-settlement/components/ForeignSettlementFlowPanel.vue +117 -47
  18. package/src/views/foreign-currency-settlement/components/ForeignSettlementForecastPanel.vue +155 -57
  19. package/src/views/foreign-currency-settlement/foreign-currency-settlement-base.css +1089 -0
  20. package/src/views/foreign-currency-settlement/index.vue +17 -20
  21. package/src/views/foreign-currency-settlement/options.ts +13 -15
  22. package/src/views/foreign-currency-settlement/store.ts +27 -30
  23. package/src/views/foreign-currency-settlement/useScopedMessage.ts +3 -9
  24. package/src/views/foreign-currency-settlement/utils.ts +19 -6
  25. package/src/views/fund-cockpit/api.ts +199 -0
  26. package/src/components/business/AccountBankSelect.vue +0 -142
  27. package/src/views/foreign-currency-settlement/foreign-currency-settlement.css +0 -100
  28. package/src/views/foreign-currency-settlement/types.ts +0 -210
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.92",
3
+ "version": "0.0.93",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -46,6 +46,7 @@ const searchableMenus: MenuSearchItem[] = [
46
46
  { value: '外币头寸预报', path: '/foreign-currency-position-forecast' },
47
47
  { value: '外币授权', path: '/foreign-currency-authorization' },
48
48
  { value: '外币手工核销', path: '/foreign-currency-settlement' },
49
+ { value: '外币资金调拨', path: '/foreign-currency-fund-allocation' },
49
50
  { value: '预报员页看板', path: '/position-forecast-execution' },
50
51
  { value: '人民币手工核销', path: '/forecast-info' },
51
52
  { value: '人民币头寸匡算', path: '/rmb-position-estimation' },
@@ -180,6 +181,9 @@ function toggleCollapse() {
180
181
  <el-menu-item index="/foreign-currency-settlement">
181
182
  <span>外币手工核销</span>
182
183
  </el-menu-item>
184
+ <el-menu-item index="/foreign-currency-fund-allocation">
185
+ <span>外币资金调拨</span>
186
+ </el-menu-item>
183
187
  </el-sub-menu>
184
188
  <el-menu-item index="/notice-announcement">
185
189
  <el-icon><Bell /></el-icon>
@@ -32,7 +32,7 @@
32
32
  </template>
33
33
 
34
34
  <script setup lang="ts" name="NumberRange">
35
- import { ref, watch, computed } from "vue"
35
+ import { computed, ref, watch } from "vue"
36
36
 
37
37
  export type RangeValue = [number | null, number | null]
38
38
  type RangeInput = any
@@ -4,10 +4,10 @@ import TokenTag from './business/Public/TokenTag.vue'
4
4
  import ElButtonPro from './element-rewrite/ElButtonPro.vue'
5
5
  import ElFormDialog from './element-rewrite/ElFormDialog.vue'
6
6
  import ElInputThousandth from './element-rewrite/ElInputThousandth.vue'
7
+ import NumberRange from './element-rewrite/NumberRange.vue'
7
8
  import ElTablePro from './element-rewrite/ElTablePro.vue'
8
9
  import ElUploadButton from './element-rewrite/ElUploadButton.vue'
9
10
  import LoginSuccessNotification from './LoginSuccessNotification.vue'
10
- import NumberRange from './NumberRange.vue'
11
11
  import WebsiteNoticeTitle from './WebsiteNoticeTitle.vue'
12
12
 
13
13
  type GlobalComponentDefinition = {
@@ -73,7 +73,7 @@ const globalComponentDefinitions: GlobalComponentDefinition[] = [
73
73
  component: NumberRange,
74
74
  category: '表单组件',
75
75
  description: '支持数组或双字段绑定、单位换算和区间校验的数字范围输入。',
76
- filePath: 'src/components/NumberRange.vue',
76
+ filePath: 'src/components/element-rewrite/NumberRange.vue',
77
77
  },
78
78
  {
79
79
  name: 'WebsiteNoticeTitle',
@@ -90,6 +90,11 @@ const router = createRouter({
90
90
  name: 'foreignCurrencySettlement',
91
91
  component: () => import('../views/foreign-currency-settlement/index.vue'),
92
92
  },
93
+ {
94
+ path: '/foreign-currency-fund-allocation',
95
+ name: 'foreignCurrencyFundAllocation',
96
+ component: () => import('../views/foreign-currency-fund-allocation/index.vue'),
97
+ },
93
98
  {
94
99
  path: '/position-forecast-execution',
95
100
  name: 'positionForecastExecution',
@@ -11,7 +11,7 @@ import {
11
11
  } from 'vue'
12
12
  import { storeToRefs } from 'pinia'
13
13
  import { FullScreen, Search } from '@element-plus/icons-vue'
14
- import type { RangeValue } from '@/components/NumberRange.vue'
14
+ import type { RangeValue } from '@/components/element-rewrite/NumberRange.vue'
15
15
  import { formatThousands } from '@/utils/formatters'
16
16
  import {
17
17
  useForecastInfoStore,
@@ -21,7 +21,7 @@ import {
21
21
  Tickets,
22
22
  WarningFilled,
23
23
  } from '@element-plus/icons-vue'
24
- import type { RangeValue } from '@/components/NumberRange.vue'
24
+ import type { RangeValue } from '@/components/element-rewrite/NumberRange.vue'
25
25
  import { formatThousands } from '@/utils/formatters'
26
26
  import {
27
27
  useForecastInfoStore,
@@ -3,6 +3,28 @@ import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue'
3
3
  import type { ComponentPublicInstance } from 'vue'
4
4
  import * as echarts from 'echarts'
5
5
  import type { ECharts, EChartsOption } from 'echarts'
6
+ import {
7
+ queryDeviationHistory,
8
+ queryFundCockpitSummary,
9
+ queryFutureCashFlow,
10
+ queryFutureCashGap,
11
+ queryFutureYearCashFlow,
12
+ queryInterbankIndicators,
13
+ queryLiquidityGauges,
14
+ queryPaymentReceiptHistory,
15
+ queryPbocBalanceHistory,
16
+ queryShibor,
17
+ type DeviationHistoryRecord,
18
+ type FundCockpitSummaryBody,
19
+ type FutureCashFlowBody,
20
+ type FutureCashGapRecord,
21
+ type FutureYearCashFlowBody,
22
+ type InterbankIndicatorRecord,
23
+ type LiquidityGaugeBody,
24
+ type PaymentReceiptHistoryRecord,
25
+ type PbocBalanceHistoryRecord,
26
+ type ShiborRecord,
27
+ } from './fund-cockpit/api'
6
28
 
7
29
  interface MetricRow {
8
30
  label: string
@@ -14,6 +36,7 @@ interface MetricCard {
14
36
  title: string
15
37
  rows: MetricRow[]
16
38
  progress: number
39
+ hoverText: string
17
40
  }
18
41
 
19
42
  interface GaugeCard {
@@ -39,65 +62,190 @@ interface ProjectMetricRow {
39
62
  current: string
40
63
  }
41
64
 
42
- const metricCards: MetricCard[] = [
65
+ const overviewBody = ref<FundCockpitSummaryBody>({})
66
+ const futureCashGapRows = ref<FutureCashGapRecord[]>([])
67
+ const futureCashFlowBody = ref<FutureCashFlowBody>({})
68
+ const futureYearCashFlowBody = ref<FutureYearCashFlowBody>({})
69
+ const shiborRecords = ref<ShiborRecord[]>([])
70
+ const interbankRecord = ref<InterbankIndicatorRecord>({})
71
+ const liquidityBody = ref<LiquidityGaugeBody>({})
72
+ const pbocHistoryRows = ref<PbocBalanceHistoryRecord[]>([])
73
+ const deviationHistoryRows = ref<DeviationHistoryRecord[]>([])
74
+ const paymentReceiptHistoryRows = ref<PaymentReceiptHistoryRecord[]>([])
75
+ const cockpitLoading = ref(false)
76
+ const loadError = ref('')
77
+
78
+ function pad(value: number) {
79
+ return String(value).padStart(2, '0')
80
+ }
81
+
82
+ function compactDate(date: Date) {
83
+ return `${date.getFullYear()}${pad(date.getMonth() + 1)}${pad(date.getDate())}`
84
+ }
85
+
86
+ function isValidCompactDate(value: string) {
87
+ if (!/^\d{8}$/.test(value)) return false
88
+ const date = new Date(Number(value.slice(0, 4)), Number(value.slice(4, 6)) - 1, Number(value.slice(6, 8)))
89
+ return compactDate(date) === value
90
+ }
91
+
92
+ function getQueryDate() {
93
+ const configuredDate = String(import.meta.env.VITE_SYSTEM_WORK_DATE || '').trim()
94
+ return isValidCompactDate(configuredDate) ? configuredDate : compactDate(new Date())
95
+ }
96
+
97
+ const queryDate = getQueryDate()
98
+
99
+ function displayText(value: unknown) {
100
+ const text = String(value ?? '').trim()
101
+ return text || '—'
102
+ }
103
+
104
+ function toOptionalNumber(value: unknown) {
105
+ const text = String(value ?? '').replaceAll(',', '').replace('%', '').trim()
106
+ if (!text) return undefined
107
+ const number = Number(text)
108
+ return Number.isFinite(number) ? number : undefined
109
+ }
110
+
111
+ function toNumber(value: unknown) {
112
+ return toOptionalNumber(value) ?? 0
113
+ }
114
+
115
+ function formatNumber(value: unknown, maximumFractionDigits = 2) {
116
+ const number = toOptionalNumber(value)
117
+ if (number === undefined) return displayText(value)
118
+ return number.toLocaleString('zh-CN', {
119
+ minimumFractionDigits: Number.isInteger(number) ? 0 : 1,
120
+ maximumFractionDigits,
121
+ })
122
+ }
123
+
124
+ function formatAmount(value: unknown) {
125
+ const number = toOptionalNumber(value)
126
+ if (number === undefined) return displayText(value)
127
+ return number.toLocaleString('zh-CN', {
128
+ minimumFractionDigits: 2,
129
+ maximumFractionDigits: 2,
130
+ })
131
+ }
132
+
133
+ function formatRate(value: unknown) {
134
+ const text = String(value ?? '').trim()
135
+ if (!text) return '—'
136
+ return text.includes('%') ? text : `${formatNumber(text, 1)}%`
137
+ }
138
+
139
+ function calculateProgress(currentValue: unknown, totalValue: unknown) {
140
+ const current = toOptionalNumber(currentValue)
141
+ const total = toOptionalNumber(totalValue)
142
+ if (current === undefined || total === undefined || total === 0) return 0
143
+ return Math.min(Math.round(Math.abs(current / total) * 100), 100)
144
+ }
145
+
146
+ function formatHoverRows(rows: string[]) {
147
+ return rows.filter(Boolean).join('\n')
148
+ }
149
+
150
+ const metricCards = computed<MetricCard[]>(() => [
43
151
  {
44
152
  tone: 'blue',
45
153
  title: '资金余额',
46
154
  rows: [
47
- { label: '资金余额(亿):', value: '891.17' },
48
- { label: '当日净流入(亿):', value: '1455.26' },
155
+ { label: '资金余额(亿):', value: formatAmount(overviewBody.value.cash) },
156
+ { label: '当日净流入(亿):', value: formatAmount(overviewBody.value.actualdeviation) },
49
157
  ],
50
- progress: 78,
158
+ progress: calculateProgress(overviewBody.value.actualdeviation, overviewBody.value.reportedAmt),
159
+ hoverText: formatHoverRows(deviationHistoryRows.value.map((item) =>
160
+ `${displayText(item.mtDate)} 报备轧差 ${formatAmount(item.reportedAmt)} / 实际轧差 ${formatAmount(item.actualdeviation)}`,
161
+ )),
51
162
  },
52
163
  {
53
164
  tone: 'green',
54
165
  title: '报备收款',
55
166
  rows: [
56
- { label: '报备收款(亿):', value: '5624.57' },
57
- { label: '实际收款(亿):', value: '6260610398.41' },
167
+ { label: '报备收款(亿):', value: formatAmount(overviewBody.value.collection) },
168
+ { label: '实际收款(亿):', value: formatAmount(overviewBody.value.actualCollection) },
58
169
  ],
59
- progress: 92,
170
+ progress: calculateProgress(overviewBody.value.actualCollection, overviewBody.value.collection),
171
+ hoverText: formatHoverRows(paymentReceiptHistoryRows.value.map((item) =>
172
+ `${displayText(item.mtDate)} 预测 ${formatAmount(item.foreAmtIn)} / 报备 ${formatAmount(item.predAmtIn)} / 实际 ${formatAmount(item.tranAmtIn)}`,
173
+ )),
60
174
  },
61
175
  {
62
176
  tone: 'purple',
63
177
  title: '报备扎金',
64
178
  rows: [
65
- { label: '报备扎金(亿):', value: '4733.39' },
66
- { label: '实际扎金(亿):', value: '6260608943.15' },
179
+ { label: '报备扎金(亿):', value: formatAmount(overviewBody.value.payment) },
180
+ { label: '实际扎金(亿):', value: formatAmount(overviewBody.value.actualPayment) },
67
181
  ],
68
- progress: 87,
182
+ progress: calculateProgress(overviewBody.value.actualPayment, overviewBody.value.payment),
183
+ hoverText: formatHoverRows(paymentReceiptHistoryRows.value.map((item) =>
184
+ `${displayText(item.mtDate)} 预测 ${formatAmount(item.foreAmtOut)} / 报备 ${formatAmount(item.predAmtOut)} / 实际 ${formatAmount(item.tranAmtOut)}`,
185
+ )),
69
186
  },
70
187
  {
71
188
  tone: 'bank',
72
189
  title: '人行账户余额',
73
190
  rows: [
74
- { label: '人行账户余额(亿):', value: '0.00' },
75
- { label: '法定存款准备金(亿):', value: '0.00' },
76
- { label: '超额准备金(亿):', value: '0.00' },
191
+ { label: '人行账户余额(亿):', value: formatAmount(overviewBody.value.blance) },
192
+ { label: '法定存款准备金(亿):', value: formatAmount(overviewBody.value.datBlance) },
193
+ { label: '超额准备金(亿):', value: formatAmount(overviewBody.value.overReserveFund) },
77
194
  ],
78
- progress: 0,
195
+ progress: calculateProgress(overviewBody.value.overReserveFund, overviewBody.value.blance),
196
+ hoverText: formatHoverRows(pbocHistoryRows.value.map((item) =>
197
+ `${displayText(item.mtDate)} 法定准备金 ${formatAmount(item.datBlance)} / 跨境 ${formatAmount(item.crossBorder)}`,
198
+ )),
79
199
  },
80
- ]
81
-
82
- const leftMetricCards = metricCards.slice(0, 2)
83
- const rightMetricCards = metricCards.slice(2)
200
+ ])
84
201
 
85
- const gaugeCards: GaugeCard[] = [
86
- { title: '流动性比例', date: '2026-06-04', max: 100, needle: 18, value: '1%' },
87
- { title: '流动性覆盖率', date: '2026-06-04', max: 200, needle: 72, value: '2%' },
88
- { title: '净稳定资金比例', date: '2026-06-04', max: 200, needle: 66, value: '3%' },
89
- ]
202
+ const leftMetricCards = computed(() => metricCards.value.slice(0, 2))
203
+ const rightMetricCards = computed(() => metricCards.value.slice(2))
90
204
 
91
- const shiborRows: ShiborRow[] = [
92
- { date: '20260303', term: '1M', shibor: 'SHIBOR01', shiborBp: '1.6', ftp: '121212', ftpBp: '-1.5' },
93
- { date: '20260403', term: '2M', shibor: 'SHIBOR02', shiborBp: '1.5', ftp: '232333', ftpBp: '1.0' },
94
- { date: '20260503', term: '3M', shibor: 'SHIBOR03', shiborBp: '1.2', ftp: '323232', ftpBp: '1.0' },
95
- ]
96
-
97
- const projectMetricRows: ProjectMetricRow[] = [
98
- { project: '同业存放占', dataTime: '2026-06-04', current: '1' },
99
- { project: '同业活期存款余额', dataTime: '2026-06-04', current: '—' },
100
- ]
205
+ const gaugeCards = computed<GaugeCard[]>(() => [
206
+ {
207
+ title: '流动性比例',
208
+ date: displayText(liquidityBody.value.ldxblTime || liquidityBody.value.curDate),
209
+ max: 100,
210
+ needle: toNumber(liquidityBody.value.ldxbl),
211
+ value: formatRate(liquidityBody.value.ldxbl),
212
+ },
213
+ {
214
+ title: '流动性覆盖率',
215
+ date: displayText(liquidityBody.value.ldxfglTime || liquidityBody.value.curDate),
216
+ max: 200,
217
+ needle: toNumber(liquidityBody.value.ldxfgl),
218
+ value: formatRate(liquidityBody.value.ldxfgl),
219
+ },
220
+ {
221
+ title: '净稳定资金比例',
222
+ date: displayText(liquidityBody.value.jwdzjblTime || liquidityBody.value.curDate),
223
+ max: 200,
224
+ needle: toNumber(liquidityBody.value.jwdzjbl),
225
+ value: formatRate(liquidityBody.value.jwdzjbl),
226
+ },
227
+ ])
228
+
229
+ const shiborRows = computed<ShiborRow[]>(() =>
230
+ shiborRecords.value.slice(0, 4).map((item) => {
231
+ const useAssetFtp = Boolean(String(item.zcFtp ?? '').trim())
232
+ return {
233
+ date: displayText(item.dateDt),
234
+ term: displayText(item.mtDate),
235
+ shibor: displayText(item.shibor),
236
+ shiborBp: formatNumber(item.shiborBsr, 1),
237
+ ftp: displayText(useAssetFtp ? item.zcFtp : item.fzFtp),
238
+ ftpBp: formatNumber(useAssetFtp ? item.zcFtpBsr : item.fzFtpBsr, 1),
239
+ }
240
+ }),
241
+ )
242
+
243
+ const projectMetricRows = computed<ProjectMetricRow[]>(() => [
244
+ { project: '同业负债占比', dataTime: displayText(interbankRecord.value.tyfzzbTime), current: displayText(interbankRecord.value.tyfzzb) },
245
+ { project: '同业活期存款余额', dataTime: displayText(interbankRecord.value.tyhqckyeTime), current: displayText(interbankRecord.value.tyhqckye) },
246
+ { project: '同业活期存款占比', dataTime: displayText(interbankRecord.value.tyhqckzbTime), current: displayText(interbankRecord.value.tyhqckzb) },
247
+ { project: '同业资产占比', dataTime: displayText(interbankRecord.value.tyzczbTime), current: displayText(interbankRecord.value.tyzczb) },
248
+ ])
101
249
 
102
250
  const cashflowChart = ref<HTMLElement>()
103
251
  const maturityChart = ref<HTMLElement>()
@@ -150,31 +298,22 @@ function barGradient(top = '#1b78ff', bottom = '#0a3d95') {
150
298
  }
151
299
 
152
300
  function createCashflowOption(): EChartsOption {
153
- const dates = [
154
- '05-19',
155
- '05-20',
156
- '05-21',
157
- '05-22',
158
- '05-23',
159
- '05-24',
160
- '05-25',
161
- '05-26',
162
- '05-27',
163
- '05-28',
164
- '05-29',
165
- '05-30',
166
- '05-31',
167
- '06-01',
168
- '06-02',
169
- '06-03',
170
- '06-04',
171
- ]
172
- const publicData = [20, 8, 4, 14, 58, 44, 62, 20, 15, 34, 58, 42, 8, 0, 286, 720, 1030]
173
- const retailData = [10, 0, 12, 18, 26, 22, 18, 16, 8, 18, 24, 12, 8, 18, 50, 22, 18]
174
- const interbankData = [-348, 12, 0, -70, 45, -165, -142, -198, 0, 10, -140, -82, 370, -120, 286, 720, 980]
175
- const centralBankData = [80, -136, -84, 0, 0, -118, 0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0]
176
- const otherData = [0, 28, 26, -30, 18, 22, 12, 34, 28, 8, 18, 36, 10, 12, 26, 34, 46]
177
- const netData = [8, -310, 0, -62, 16, -156, -132, -260, 0, 36, -160, -70, 360, 4, -290, 740, 1060]
301
+ const records = Array.isArray(futureCashFlowBody.value.resultInfoObj)
302
+ ? futureCashFlowBody.value.resultInfoObj
303
+ : []
304
+ const summary = Array.isArray(futureCashFlowBody.value.resultInfoList)
305
+ ? futureCashFlowBody.value.resultInfoList[0]
306
+ : undefined
307
+ const minimum = toOptionalNumber(summary?.min)
308
+ const maximum = toOptionalNumber(summary?.max)
309
+ const useApiRange = minimum !== undefined && maximum !== undefined && minimum < maximum
310
+ const dates = records.map((item) => displayText(item.mtDate))
311
+ const publicData = records.map((item) => toNumber(item.togovernment))
312
+ const retailData = records.map((item) => toNumber(item.retail))
313
+ const interbankData = records.map((item) => toNumber(item.samework))
314
+ const centralBankData = records.map((item) => toNumber(item.center))
315
+ const otherData = records.map((item) => toNumber(item.other))
316
+ const netData = records.map((item) => toNumber(item.sumcashflow))
178
317
 
179
318
  return {
180
319
  animationDuration: 800,
@@ -204,9 +343,9 @@ function createCashflowOption(): EChartsOption {
204
343
  },
205
344
  yAxis: {
206
345
  type: 'value',
207
- min: -600,
208
- max: 1200,
209
- interval: 300,
346
+ min: useApiRange ? minimum : undefined,
347
+ max: useApiRange ? maximum : undefined,
348
+ splitNumber: 6,
210
349
  axisLabel: { color: '#d4deeb', fontSize: 13 },
211
350
  splitLine: {
212
351
  lineStyle: {
@@ -337,34 +476,20 @@ function createStageGaugeOption(card: GaugeCard): EChartsOption {
337
476
  }
338
477
 
339
478
  function createMaturityOption(): EChartsOption {
340
- const dates = [
341
- '05-01',
342
- '06-01',
343
- '07-01',
344
- '08-01',
345
- '09-01',
346
- '10-01',
347
- '11-01',
348
- '12-01',
349
- '2027-01-01',
350
- '02-01',
351
- '2027-03-01',
352
- '04-01',
353
- ]
354
- const values = [
355
- -8200000,
356
- -7400000,
357
- -950000,
358
- 3600000,
359
- -240000,
360
- 1050000,
361
- 3400000,
362
- 4550000,
363
- 15000000,
364
- 12800000,
365
- 7700000,
366
- 2450000,
367
- ]
479
+ const records = Array.isArray(futureYearCashFlowBody.value.resultInfoObj)
480
+ ? futureYearCashFlowBody.value.resultInfoObj
481
+ : []
482
+ const summary = Array.isArray(futureYearCashFlowBody.value.resultInfoList)
483
+ ? futureYearCashFlowBody.value.resultInfoList[0]
484
+ : undefined
485
+ const minimum = toOptionalNumber(summary?.min)
486
+ const maximum = toOptionalNumber(summary?.max)
487
+ const useApiRange = minimum !== undefined && maximum !== undefined && minimum < maximum
488
+ const dates = records.map((item) => {
489
+ const date = displayText(item.mtDate)
490
+ return date.startsWith(queryDate.slice(0, 4)) ? date.slice(5) : date
491
+ })
492
+ const values = records.map((item) => toNumber(item.overCash))
368
493
 
369
494
  return {
370
495
  animationDuration: 850,
@@ -393,9 +518,9 @@ function createMaturityOption(): EChartsOption {
393
518
  },
394
519
  yAxis: {
395
520
  type: 'value',
396
- min: -10000000,
397
- max: 15000000,
398
- interval: 5000000,
521
+ min: useApiRange ? minimum : undefined,
522
+ max: useApiRange ? maximum : undefined,
523
+ splitNumber: 5,
399
524
  axisLabel: {
400
525
  color: '#d4deeb',
401
526
  fontSize: 13,
@@ -415,19 +540,131 @@ function createMaturityOption(): EChartsOption {
415
540
  }
416
541
  }
417
542
 
543
+ const futureCashGapTitle = computed(() => {
544
+ const item = futureCashGapRows.value[futureCashGapRows.value.length - 1]
545
+ if (!item) return ''
546
+ return [
547
+ `数据日期:${displayText(item.curDate)}`,
548
+ `未来一日现金缺口:${formatAmount(item.wlyrxjqk)}`,
549
+ `未来2—7日现金缺口:${formatAmount(item.wledqrxjqk)}`,
550
+ `未来8—30日现金缺口:${formatAmount(item.wlbdssrxjqk)}`,
551
+ `未来一个月缺口合计:${formatAmount(item.wlyyqkhj)}`,
552
+ ].join('\n')
553
+ })
554
+
555
+ function getErrorMessage(error: unknown, fallback: string) {
556
+ if (error instanceof Error && error.message) return error.message
557
+ return fallback
558
+ }
559
+
560
+ async function loadCockpitData(signal: AbortSignal) {
561
+ cockpitLoading.value = true
562
+ loadError.value = ''
563
+ const options = { signal }
564
+ const results = await Promise.allSettled([
565
+ queryFutureCashGap(options),
566
+ queryFutureCashFlow(options),
567
+ queryShibor(queryDate, options),
568
+ queryFutureYearCashFlow(queryDate, options),
569
+ queryInterbankIndicators(queryDate, options),
570
+ queryFundCockpitSummary(queryDate, options),
571
+ queryPbocBalanceHistory(queryDate, options),
572
+ queryDeviationHistory(queryDate, options),
573
+ queryPaymentReceiptHistory(queryDate, options),
574
+ queryLiquidityGauges(queryDate, options),
575
+ ] as const)
576
+ const errors: string[] = []
577
+ const [
578
+ futureCashGapResult,
579
+ futureCashFlowResult,
580
+ shiborResult,
581
+ futureYearCashFlowResult,
582
+ interbankResult,
583
+ overviewResult,
584
+ pbocHistoryResult,
585
+ deviationHistoryResult,
586
+ paymentReceiptHistoryResult,
587
+ liquidityResult,
588
+ ] = results
589
+
590
+ if (futureCashGapResult.status === 'fulfilled') {
591
+ futureCashGapRows.value = Array.isArray(futureCashGapResult.value.body.resultInfos)
592
+ ? futureCashGapResult.value.body.resultInfos
593
+ : []
594
+ } else errors.push(getErrorMessage(futureCashGapResult.reason, '未来现金缺口加载失败'))
595
+
596
+ if (futureCashFlowResult.status === 'fulfilled') {
597
+ futureCashFlowBody.value = futureCashFlowResult.value.body
598
+ } else errors.push(getErrorMessage(futureCashFlowResult.reason, '未来现金流加载失败'))
599
+
600
+ if (shiborResult.status === 'fulfilled') {
601
+ shiborRecords.value = Array.isArray(shiborResult.value.body.resultInfoObj)
602
+ ? shiborResult.value.body.resultInfoObj
603
+ : []
604
+ } else errors.push(getErrorMessage(shiborResult.reason, 'SHIBOR 数据加载失败'))
605
+
606
+ if (futureYearCashFlowResult.status === 'fulfilled') {
607
+ futureYearCashFlowBody.value = futureYearCashFlowResult.value.body
608
+ } else errors.push(getErrorMessage(futureYearCashFlowResult.reason, '未来一年现金流加载失败'))
609
+
610
+ if (interbankResult.status === 'fulfilled') {
611
+ interbankRecord.value = Array.isArray(interbankResult.value.body.resultInfoObj)
612
+ ? interbankResult.value.body.resultInfoObj[0] || {}
613
+ : {}
614
+ } else errors.push(getErrorMessage(interbankResult.reason, '同业指标加载失败'))
615
+
616
+ if (overviewResult.status === 'fulfilled') {
617
+ overviewBody.value = overviewResult.value.body
618
+ } else errors.push(getErrorMessage(overviewResult.reason, '驾驶舱汇总加载失败'))
619
+
620
+ if (pbocHistoryResult.status === 'fulfilled') {
621
+ pbocHistoryRows.value = Array.isArray(pbocHistoryResult.value.body.resultInfoObj)
622
+ ? pbocHistoryResult.value.body.resultInfoObj
623
+ : []
624
+ } else errors.push(getErrorMessage(pbocHistoryResult.reason, '人行余额趋势加载失败'))
625
+
626
+ if (deviationHistoryResult.status === 'fulfilled') {
627
+ deviationHistoryRows.value = Array.isArray(deviationHistoryResult.value.body.resultInfoObj)
628
+ ? deviationHistoryResult.value.body.resultInfoObj
629
+ : []
630
+ } else errors.push(getErrorMessage(deviationHistoryResult.reason, '轧差趋势加载失败'))
631
+
632
+ if (paymentReceiptHistoryResult.status === 'fulfilled') {
633
+ paymentReceiptHistoryRows.value = Array.isArray(paymentReceiptHistoryResult.value.body.resultInfoObj)
634
+ ? paymentReceiptHistoryResult.value.body.resultInfoObj
635
+ : []
636
+ } else errors.push(getErrorMessage(paymentReceiptHistoryResult.reason, '收付款趋势加载失败'))
637
+
638
+ if (liquidityResult.status === 'fulfilled') {
639
+ liquidityBody.value = liquidityResult.value.body
640
+ } else errors.push(getErrorMessage(liquidityResult.reason, '流动性仪表盘加载失败'))
641
+
642
+ if (!signal.aborted) {
643
+ loadError.value = [...new Set(errors)].join(';')
644
+ cockpitLoading.value = false
645
+ }
646
+ }
647
+
648
+ let loadController: AbortController | undefined
649
+
418
650
  onMounted(async () => {
419
651
  updateCockpitScale()
652
+ window.addEventListener('resize', handleViewportChange)
653
+ window.visualViewport?.addEventListener('resize', handleViewportChange)
654
+ const controller = new AbortController()
655
+ loadController = controller
656
+ await loadCockpitData(controller.signal)
657
+ if (controller.signal.aborted) return
420
658
  await nextTick()
421
659
  createChart(cashflowChart.value, createCashflowOption())
422
- createChart(liquidityGauge.value, createStageGaugeOption(gaugeCards[0]!))
423
- createChart(coverageGauge.value, createStageGaugeOption(gaugeCards[1]!))
424
- createChart(stableGauge.value, createStageGaugeOption(gaugeCards[2]!))
660
+ createChart(liquidityGauge.value, createStageGaugeOption(gaugeCards.value[0]!))
661
+ createChart(coverageGauge.value, createStageGaugeOption(gaugeCards.value[1]!))
662
+ createChart(stableGauge.value, createStageGaugeOption(gaugeCards.value[2]!))
425
663
  createChart(maturityChart.value, createMaturityOption())
426
- window.addEventListener('resize', handleViewportChange)
427
- window.visualViewport?.addEventListener('resize', handleViewportChange)
428
664
  })
429
665
 
430
666
  onUnmounted(() => {
667
+ loadController?.abort()
431
668
  window.removeEventListener('resize', handleViewportChange)
432
669
  window.visualViewport?.removeEventListener('resize', handleViewportChange)
433
670
  charts.forEach((chart) => chart.dispose())
@@ -435,7 +672,7 @@ onUnmounted(() => {
435
672
  </script>
436
673
 
437
674
  <template>
438
- <main class="fund-cockpit-page">
675
+ <main class="fund-cockpit-page" :aria-busy="cockpitLoading">
439
676
  <section class="cockpit-canvas" :style="cockpitCanvasStyle">
440
677
  <header class="topbar">
441
678
  <div class="brand">
@@ -444,6 +681,7 @@ onUnmounted(() => {
444
681
  </div>
445
682
 
446
683
  <div class="toolbar">
684
+ <span v-if="loadError" class="load-error" :title="loadError">部分数据加载失败</span>
447
685
  <button class="export-button" type="button">
448
686
  <span class="download-icon"></span>
449
687
  导出报表
@@ -453,7 +691,7 @@ onUnmounted(() => {
453
691
 
454
692
  <section class="metric-strip" aria-label="资金指标">
455
693
  <div class="metric-group">
456
- <article v-for="card in leftMetricCards" :key="card.title" class="metric-card" :class="`is-${card.tone}`">
694
+ <article v-for="card in leftMetricCards" :key="card.title" class="metric-card" :class="`is-${card.tone}`" :title="card.hoverText">
457
695
  <div class="metric-icon">
458
696
  <span class="metric-icon-symbol"></span>
459
697
  </div>
@@ -475,7 +713,7 @@ onUnmounted(() => {
475
713
  </div>
476
714
 
477
715
  <div class="metric-group">
478
- <article v-for="card in rightMetricCards" :key="card.title" class="metric-card" :class="`is-${card.tone}`">
716
+ <article v-for="card in rightMetricCards" :key="card.title" class="metric-card" :class="`is-${card.tone}`" :title="card.hoverText">
479
717
  <div class="metric-icon">
480
718
  <span class="metric-icon-symbol"></span>
481
719
  </div>
@@ -497,7 +735,7 @@ onUnmounted(() => {
497
735
  </div>
498
736
  </section>
499
737
 
500
- <section class="cashflow-section">
738
+ <section class="cashflow-section" :title="futureCashGapTitle">
501
739
  <div class="section-title-row">
502
740
  <h2>未来现金流</h2>
503
741
  </div>
@@ -662,6 +900,11 @@ onUnmounted(() => {
662
900
  font-size: 14px;
663
901
  }
664
902
 
903
+ .load-error {
904
+ color: #ffb86b;
905
+ font-size: 13px;
906
+ }
907
+
665
908
  .export-button {
666
909
  height: 37px;
667
910
  gap: 9px;
@@ -50,7 +50,7 @@
50
50
  <script setup lang="ts">
51
51
  import { reactive, ref } from 'vue'
52
52
  import { ElMessage } from 'element-plus'
53
- import type { RangeValue } from '@/components/NumberRange.vue'
53
+ import type { RangeValue } from '@/components/element-rewrite/NumberRange.vue'
54
54
 
55
55
  const form = reactive({
56
56
  amountRange: [null, null] as RangeValue,