verce-vue-test 0.0.105 → 0.0.107

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.
@@ -1946,7 +1946,7 @@ POST /TAM/0001/140103002
1946
1946
  > 200 Response
1947
1947
 
1948
1948
  ```
1949
- {"body":{"predAmtIn":"string","predAmtOut":"string","unverifyAmtIn":"string","unverifyAmtOut":"string","verifyAmtIn":"string","verifyAmtOut":"string"},"head":{"adminUserId":"string","agentBranchId":"string","apprUserId":"string","areaCode":"string","batch":true,"branchId":"string","consumerId":"string","consumerSeqNo":"string","ctrlBits":"string","digitalSign":"string","extra":{},"fileFlag":"string","filePath":"string","isBatch":true,"msgId":"string","origSender":"string","pageIndex":"string","pageSize":"string","retCode":"string","retMsg":"string","retMsg2":"string","retStatus":"string","spanId":"string","traceId":"string","tranCode":"string","tranDate":"string","tranTimestamp":"string","userId":"string","verifyUserId":"string","versionId":"string"}}
1949
+ {"head":{"consumerId":"TAM001","tranCode":"/TAM/0001/140103002","versionId":"0001","ctrlBits":"00004000","tranDate":"20260723","consumerSeqNo":"superuser62026072386363402","tranTimestamp":"135923","pageSize":"10","pageIndex":"1","traceId":"","spanId":"","userId":"superuser6","verifyUserId":"","adminUserId":"","apprUserId":"","branchId":"25001","areaCode":"0000","digitalSign":"","fileFlag":"N","filePath":"","isBatch":false,"extra":{},"retStatus":"S","retCode":"00000","retMsg":"交易成功"},"body":{"predAmtIn":"1112256255","predAmtOut":"0","verifyAmtIn":"510122220.47","verifyAmtOut":"0","unverifyAmtIn":"612133032","unverifyAmtOut":"0"}}
1950
1950
  ```
1951
1951
 
1952
1952
  ### 返回结果
@@ -2012,7 +2012,7 @@ POST /TAM/0001/140103003
2012
2012
  > 200 Response
2013
2013
 
2014
2014
  ```
2015
- {"body":{"cjAmt":"string","fzAmt":"string","pdAmt":"string","rhAmt":"string","rzAmt":"string","unverifyAmtIn":"string","unverifyAmtOut":"string"},"head":{"adminUserId":"string","agentBranchId":"string","apprUserId":"string","areaCode":"string","batch":true,"branchId":"string","consumerId":"string","consumerSeqNo":"string","ctrlBits":"string","digitalSign":"string","extra":{},"fileFlag":"string","filePath":"string","isBatch":true,"msgId":"string","origSender":"string","pageIndex":"string","pageSize":"string","retCode":"string","retMsg":"string","retMsg2":"string","retStatus":"string","spanId":"string","traceId":"string","tranCode":"string","tranDate":"string","tranTimestamp":"string","userId":"string","verifyUserId":"string","versionId":"string"}}
2015
+ {"head":{"consumerId":"TAM001","tranCode":"/TAM/0001/140103003","versionId":"0001","ctrlBits":"00004000","tranDate":"20260723","consumerSeqNo":"superuser62026072386405694","tranTimestamp":"140005","pageSize":"10","pageIndex":"1","traceId":"","spanId":"","userId":"superuser6","verifyUserId":"","adminUserId":"","apprUserId":"","branchId":"25001","areaCode":"0000","digitalSign":"","fileFlag":"N","filePath":"","isBatch":false,"extra":{},"retStatus":"S","retCode":"00000","retMsg":"交易成功"},"body":{"rhAmt":"4850534974337620.00","pdAmt":"8128113891","fzAmt":"143100000001","cjAmt":"4850383746223728.00","rzAmt":"4850534974337620.00","unverifyAmtIn":"0","unverifyAmtOut":"0"}}
2016
2016
  ```
2017
2017
 
2018
2018
  ### 返回结果
@@ -2078,7 +2078,7 @@ POST /TAM/0001/140103004
2078
2078
  > 200 Response
2079
2079
 
2080
2080
  ```
2081
- {"body":{"fzAmt":"string","pdAmt":"string","preAmt":"string","rhAmt":"string","unverifyAmtIn":"string","unverifyAmtOut":"string"},"head":{"adminUserId":"string","agentBranchId":"string","apprUserId":"string","areaCode":"string","batch":true,"branchId":"string","consumerId":"string","consumerSeqNo":"string","ctrlBits":"string","digitalSign":"string","extra":{},"fileFlag":"string","filePath":"string","isBatch":true,"msgId":"string","origSender":"string","pageIndex":"string","pageSize":"string","retCode":"string","retMsg":"string","retMsg2":"string","retStatus":"string","spanId":"string","traceId":"string","tranCode":"string","tranDate":"string","tranTimestamp":"string","userId":"string","verifyUserId":"string","versionId":"string"}}
2081
+ {"head":{"consumerId":"TAM001","tranCode":"/TAM/0001/140103004","versionId":"0001","ctrlBits":"00004000","tranDate":"20260723","consumerSeqNo":"superuser62026072386427755","tranTimestamp":"140027","pageSize":"10","pageIndex":"1","traceId":"","spanId":"","userId":"superuser6","verifyUserId":"","adminUserId":"","apprUserId":"","branchId":"25001","areaCode":"0000","digitalSign":"","fileFlag":"N","filePath":"","isBatch":false,"extra":{},"retStatus":"S","retCode":"00000","retMsg":"交易成功"},"body":{"rhAmt":"4850534974337620.00","pdAmt":"8128113891","fzAmt":"143100000001","preAmt":"4850383746223728.00","unverifyAmtIn":"0","unverifyAmtOut":"0"}}
2082
2082
  ```
2083
2083
 
2084
2084
  ### 返回结果
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.105",
3
+ "version": "0.0.107",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import baseHttpClient, { type HttpRequestOptions, type TamResponse } from '@/utils/baseHttpClient'
1
+ import baseHttpClient from '@/utils/baseHttpClient'
2
2
 
3
3
  export type ForecastOccurrenceRequest = {
4
4
  /** 业务类型,接口允许为空。 */
@@ -55,31 +55,25 @@ export type OpeningReserveEstimationResult = {
55
55
  }
56
56
 
57
57
  /** 按业务类型和交易日期查询预报发生情况。 */
58
- export function queryForecastOccurrence(
59
- params: ForecastOccurrenceRequest,
60
- options?: HttpRequestOptions,
61
- ) {
62
- return baseHttpClient.post<TamResponse<ForecastOccurrenceResult>>(
58
+ export function queryForecastOccurrence(params: ForecastOccurrenceRequest) {
59
+ return baseHttpClient.post<any>(
63
60
  '/TAM/0001/140103002',
64
61
  params,
65
- options,
66
62
  )
67
63
  }
68
64
 
69
65
  /** 查询日终拆借数匡算结果,接口业务请求体为空。 */
70
- export function queryEndOfDayBorrowingEstimation(options?: HttpRequestOptions) {
71
- return baseHttpClient.post<TamResponse<EndOfDayBorrowingEstimationResult>>(
66
+ export function queryEndOfDayBorrowingEstimation() {
67
+ return baseHttpClient.post<any>(
72
68
  '/TAM/0001/140103003',
73
69
  {},
74
- options,
75
70
  )
76
71
  }
77
72
 
78
73
  /** 查询日初备款数匡算结果,接口业务请求体为空。 */
79
- export function queryOpeningReserveEstimation(options?: HttpRequestOptions) {
80
- return baseHttpClient.post<TamResponse<OpeningReserveEstimationResult>>(
74
+ export function queryOpeningReserveEstimation() {
75
+ return baseHttpClient.post<any>(
81
76
  '/TAM/0001/140103004',
82
77
  {},
83
- options,
84
78
  )
85
79
  }
@@ -0,0 +1,500 @@
1
+ .rmb-estimation-page {
2
+ width: 100%;
3
+ min-height: 100%;
4
+ margin: 0;
5
+ padding: 24px;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .rmb-estimation-page--menu {
10
+ display: flex;
11
+ align-items: center;
12
+ background: #f4f7fc;
13
+ }
14
+
15
+ .rmb-estimation-page .estimation-image-gallery {
16
+ display: grid;
17
+ grid-template-columns: repeat(3, minmax(0, 1fr));
18
+ gap: 20px;
19
+ width: 100%;
20
+ max-width: 1500px;
21
+ margin-inline: auto;
22
+ }
23
+
24
+ .rmb-estimation-page .estimation-module-card {
25
+ display: grid;
26
+ grid-template-rows: auto minmax(220px, 1fr) auto;
27
+ min-width: 0;
28
+ min-height: 480px;
29
+ padding: 24px;
30
+ overflow: hidden;
31
+ border: 1px solid #e6edf8;
32
+ border-radius: 18px;
33
+ background: #fff;
34
+ color: inherit;
35
+ font: inherit;
36
+ text-align: left;
37
+ cursor: pointer;
38
+ box-shadow: 0 10px 30px rgba(40, 72, 128, 0.1);
39
+ transition:
40
+ transform 180ms ease,
41
+ border-color 180ms ease,
42
+ box-shadow 180ms ease;
43
+ }
44
+
45
+ .rmb-estimation-page .estimation-module-card:hover {
46
+ border-color: #60a5fa;
47
+ transform: translateY(-4px);
48
+ box-shadow: 0 18px 42px rgba(37, 99, 235, 0.16);
49
+ }
50
+
51
+ .rmb-estimation-page .estimation-module-card:focus-visible {
52
+ outline: 3px solid rgba(59, 130, 246, 0.35);
53
+ outline-offset: 4px;
54
+ }
55
+
56
+ .rmb-estimation-page .module-card-heading {
57
+ display: flex;
58
+ align-items: center;
59
+ gap: 16px;
60
+ min-width: 0;
61
+ }
62
+
63
+ .rmb-estimation-page .module-card-sequence {
64
+ display: inline-grid;
65
+ width: 48px;
66
+ height: 48px;
67
+ flex: 0 0 48px;
68
+ place-items: center;
69
+ border-radius: 10px;
70
+ color: #1673e6;
71
+ background: #e5f0ff;
72
+ font: 700 20px/1 "DIN Alternate", Consolas, sans-serif;
73
+ }
74
+
75
+ .rmb-estimation-page .module-card-title {
76
+ min-width: 0;
77
+ color: #092e68;
78
+ font: 700 clamp(20px, 1.7vw, 28px)/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
79
+ letter-spacing: 0.02em;
80
+ }
81
+
82
+ .rmb-estimation-page .module-card-visual {
83
+ display: block;
84
+ min-height: 0;
85
+ margin: 14px -8px 16px;
86
+ overflow: hidden;
87
+ border-radius: 12px;
88
+ }
89
+
90
+ .rmb-estimation-page .estimation-image {
91
+ display: block;
92
+ width: 100%;
93
+ height: calc(100% + 120px);
94
+ min-height: 0;
95
+ margin-top: -120px;
96
+ object-fit: cover;
97
+ object-position: center bottom;
98
+ transition: transform 240ms ease;
99
+ }
100
+
101
+ .rmb-estimation-page .estimation-module-card:hover .estimation-image {
102
+ transform: scale(1.02);
103
+ }
104
+
105
+ .rmb-estimation-page .module-card-action {
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ gap: 28px;
110
+ min-height: 50px;
111
+ border-radius: 10px;
112
+ color: #1673e6;
113
+ background: #e8f1ff;
114
+ font-size: 16px;
115
+ font-weight: 700;
116
+ }
117
+
118
+ .rmb-estimation-page .module-card-action .el-icon {
119
+ font-size: 21px;
120
+ transition: transform 180ms ease;
121
+ }
122
+
123
+ .rmb-estimation-page .estimation-module-card:hover .module-card-action .el-icon {
124
+ transform: translateX(5px);
125
+ }
126
+
127
+ .rmb-estimation-page .estimation-module-card--2 .module-card-sequence {
128
+ color: #099eb2;
129
+ background: #e2f7f8;
130
+ }
131
+
132
+ .rmb-estimation-page .estimation-module-card--2 .module-card-action {
133
+ color: #099eb2;
134
+ background: #e8f8f8;
135
+ }
136
+
137
+ .rmb-estimation-page .estimation-module-card--3 .module-card-sequence {
138
+ color: #3f5cf3;
139
+ background: #e9edff;
140
+ }
141
+
142
+ .rmb-estimation-page .estimation-module-card--3 .module-card-action {
143
+ color: #3f5cf3;
144
+ background: #eef0ff;
145
+ }
146
+
147
+ .rmb-estimation-page .estimation-module-tabs {
148
+ display: flex;
149
+ align-items: center;
150
+ width: min(100%, 760px);
151
+ margin: 0 auto 12px;
152
+ overflow-x: auto;
153
+ border-bottom: 1px solid #d9e4f5;
154
+ }
155
+
156
+ .rmb-estimation-page .estimation-module-tab {
157
+ position: relative;
158
+ min-height: 44px;
159
+ padding: 0 22px;
160
+ border: 0;
161
+ color: #587095;
162
+ background: transparent;
163
+ font: 500 15px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
164
+ white-space: nowrap;
165
+ cursor: pointer;
166
+ transition:
167
+ color 160ms ease,
168
+ background-color 160ms ease;
169
+ }
170
+
171
+ .rmb-estimation-page .estimation-module-tab::after {
172
+ position: absolute;
173
+ right: 22px;
174
+ bottom: -1px;
175
+ left: 22px;
176
+ height: 3px;
177
+ border-radius: 3px 3px 0 0;
178
+ background: #2777df;
179
+ content: "";
180
+ opacity: 0;
181
+ transform: scaleX(0.5);
182
+ transition:
183
+ opacity 160ms ease,
184
+ transform 160ms ease;
185
+ }
186
+
187
+ .rmb-estimation-page .estimation-module-tab:hover {
188
+ color: #1f66c5;
189
+ background: #f5f8fd;
190
+ }
191
+
192
+ .rmb-estimation-page .estimation-module-tab.is-active {
193
+ color: #155fbf;
194
+ font-weight: 700;
195
+ }
196
+
197
+ .rmb-estimation-page .estimation-module-tab.is-active::after {
198
+ opacity: 1;
199
+ transform: scaleX(1);
200
+ }
201
+
202
+ .rmb-estimation-page .estimation-module-tab:focus-visible {
203
+ z-index: 1;
204
+ outline: 2px solid rgba(39, 119, 223, 0.35);
205
+ outline-offset: -3px;
206
+ }
207
+
208
+ .rmb-estimation-page .estimation-detail-page {
209
+ min-height: 620px;
210
+ color: #102757;
211
+ }
212
+
213
+ .rmb-estimation-page .back-row {
214
+ display: flex;
215
+ align-items: center;
216
+ width: min(100%, 760px);
217
+ min-height: 48px;
218
+ margin-inline: auto;
219
+ }
220
+
221
+ .rmb-estimation-page .page-toolbar {
222
+ display: grid;
223
+ grid-template-columns: 1fr auto 1fr;
224
+ align-items: center;
225
+ gap: 24px;
226
+ width: min(100%, 960px);
227
+ min-height: 72px;
228
+ margin-inline: auto;
229
+ padding: 0 2px;
230
+ box-sizing: border-box;
231
+ }
232
+
233
+ .rmb-estimation-page .page-toolbar > :last-child {
234
+ justify-self: end;
235
+ }
236
+
237
+ .rmb-estimation-page :is(
238
+ .forecast-occurrence-page,
239
+ .borrowing-estimation-page,
240
+ .opening-reserve-page
241
+ ) .page-toolbar {
242
+ grid-template-columns: minmax(0, 1fr) auto;
243
+ width: min(100%, 760px);
244
+ }
245
+
246
+ .rmb-estimation-page :is(
247
+ .forecast-occurrence-page,
248
+ .borrowing-estimation-page,
249
+ .opening-reserve-page
250
+ ) .title-wrap {
251
+ text-align: left;
252
+ }
253
+
254
+ .rmb-estimation-page .forecast-occurrence-page .title-wrap {
255
+ justify-self: start;
256
+ }
257
+
258
+ .rmb-estimation-page .toolbar-actions,
259
+ .rmb-estimation-page .amount-unit-control {
260
+ display: flex;
261
+ align-items: center;
262
+ }
263
+
264
+ .rmb-estimation-page .toolbar-actions {
265
+ gap: 14px;
266
+ }
267
+
268
+ .rmb-estimation-page .amount-unit-control {
269
+ gap: 8px;
270
+ color: #526b91;
271
+ font-size: 14px;
272
+ white-space: nowrap;
273
+ }
274
+
275
+ .rmb-estimation-page .amount-unit-select {
276
+ width: 96px;
277
+ }
278
+
279
+ .rmb-estimation-page .query-button {
280
+ min-height: 42px;
281
+ padding-inline: 20px;
282
+ border-radius: 6px;
283
+ font-size: 15px;
284
+ }
285
+
286
+ .rmb-estimation-page .refresh-button {
287
+ min-height: 32px;
288
+ }
289
+
290
+ .rmb-estimation-page .back-button {
291
+ min-height: 32px;
292
+ padding-inline: 12px;
293
+ border-radius: 5px;
294
+ font-size: 13px;
295
+ }
296
+
297
+ .rmb-estimation-page .title-wrap {
298
+ text-align: center;
299
+ }
300
+
301
+ .rmb-estimation-page .page-title {
302
+ margin: 0;
303
+ color: #0d3479;
304
+ font: 700 30px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
305
+ letter-spacing: 0.04em;
306
+ }
307
+
308
+ .rmb-estimation-page .detail-panel {
309
+ overflow: hidden;
310
+ border: 1px solid #d9e4f5;
311
+ border-radius: 6px;
312
+ background: #fff;
313
+ box-shadow: 0 10px 30px rgba(29, 78, 150, 0.08);
314
+ }
315
+
316
+ .rmb-estimation-page .item-order {
317
+ display: inline-grid;
318
+ width: 28px;
319
+ height: 28px;
320
+ flex: 0 0 28px;
321
+ place-items: center;
322
+ border-radius: 50%;
323
+ color: #fff;
324
+ background: #2777df;
325
+ font: 700 13px/1 "DIN Alternate", sans-serif;
326
+ }
327
+
328
+ .rmb-estimation-page .query-panel {
329
+ width: min(100%, 760px);
330
+ margin: 0 auto 16px;
331
+ padding: 18px 24px 2px;
332
+ border: 1px solid #d9e4f5;
333
+ border-radius: 6px;
334
+ box-sizing: border-box;
335
+ }
336
+
337
+ .rmb-estimation-page .query-panel .el-form {
338
+ display: flex;
339
+ flex-wrap: nowrap;
340
+ align-items: flex-start;
341
+ }
342
+
343
+ .rmb-estimation-page .query-panel .el-form-item {
344
+ margin-right: 16px;
345
+ }
346
+
347
+ .rmb-estimation-page .query-panel .el-form-item:last-child {
348
+ margin-right: 0;
349
+ }
350
+
351
+ .rmb-estimation-page .query-panel .query-button {
352
+ height: 32px;
353
+ min-height: 32px;
354
+ }
355
+
356
+ .rmb-estimation-page .query-panel .el-select,
357
+ .rmb-estimation-page .query-panel .el-date-editor {
358
+ width: 190px;
359
+ }
360
+
361
+ .rmb-estimation-page .amount-table {
362
+ padding: 0 24px;
363
+ }
364
+
365
+ .rmb-estimation-page .amount-row {
366
+ display: grid;
367
+ align-items: center;
368
+ gap: 18px;
369
+ min-height: 68px;
370
+ border-top: 1px dashed #dce5f2;
371
+ }
372
+
373
+ .rmb-estimation-page .amount-table--occurrence .amount-row {
374
+ grid-template-columns:
375
+ minmax(210px, 1.1fr)
376
+ repeat(2, minmax(180px, 0.9fr));
377
+ }
378
+
379
+ .rmb-estimation-page .amount-table--ledger .amount-row {
380
+ grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.72fr);
381
+ }
382
+
383
+ .rmb-estimation-page .amount-row--head {
384
+ min-height: 52px;
385
+ border-top-style: solid;
386
+ border-top-color: #cbdaf0;
387
+ border-bottom: 1px solid #cbdaf0;
388
+ color: #183c74;
389
+ font-size: 14px;
390
+ font-weight: 700;
391
+ }
392
+
393
+ .rmb-estimation-page .amount-row--head > :not(:first-child) {
394
+ text-align: right;
395
+ }
396
+
397
+ .rmb-estimation-page .amount-name {
398
+ display: flex;
399
+ align-items: center;
400
+ gap: 16px;
401
+ }
402
+
403
+ .rmb-estimation-page .amount-name strong {
404
+ color: #18345f;
405
+ font-size: 15px;
406
+ }
407
+
408
+ .rmb-estimation-page .amount-value {
409
+ min-width: 0;
410
+ overflow-wrap: anywhere;
411
+ font: 600 20px/1.2 "DIN Alternate", Consolas, monospace;
412
+ text-align: right;
413
+ }
414
+
415
+ .rmb-estimation-page .amount-value--with-unit {
416
+ display: flex;
417
+ align-items: baseline;
418
+ justify-content: flex-end;
419
+ gap: 8px;
420
+ color: #18345f;
421
+ }
422
+
423
+ .rmb-estimation-page .amount-value--with-unit strong {
424
+ font: inherit;
425
+ }
426
+
427
+ .rmb-estimation-page .amount-value--with-unit span {
428
+ color: #56729c;
429
+ font: 400 14px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
430
+ }
431
+
432
+ .rmb-estimation-page .amount-value--income {
433
+ color: #07895b;
434
+ }
435
+
436
+ .rmb-estimation-page .amount-value--expense,
437
+ .rmb-estimation-page .amount-value--negative {
438
+ color: #d92c2c;
439
+ }
440
+
441
+ .rmb-estimation-page .occurrence-panel {
442
+ width: min(100%, 760px);
443
+ margin-inline: auto;
444
+ }
445
+
446
+ .rmb-estimation-page .ledger-panel {
447
+ width: min(100%, 760px);
448
+ margin-inline: auto;
449
+ }
450
+
451
+ @media screen and (max-width: 1080px) {
452
+ .rmb-estimation-page .estimation-image-gallery {
453
+ grid-template-columns: 1fr;
454
+ max-width: 620px;
455
+ }
456
+
457
+ .rmb-estimation-page .estimation-module-card {
458
+ min-height: 460px;
459
+ }
460
+ }
461
+
462
+ @media screen and (max-width: 980px) {
463
+ .rmb-estimation-page .estimation-detail-page {
464
+ overflow-x: auto;
465
+ }
466
+
467
+ .rmb-estimation-page .query-panel,
468
+ .rmb-estimation-page .occurrence-panel {
469
+ min-width: 760px;
470
+ }
471
+
472
+ .rmb-estimation-page .ledger-panel {
473
+ min-width: 640px;
474
+ }
475
+ }
476
+
477
+ @media screen and (max-width: 680px) {
478
+ .rmb-estimation-page .page-toolbar {
479
+ display: flex;
480
+ justify-content: flex-end;
481
+ min-width: 0;
482
+ }
483
+
484
+ .rmb-estimation-page .toolbar-spacer,
485
+ .rmb-estimation-page .title-wrap {
486
+ display: none;
487
+ }
488
+
489
+ .rmb-estimation-page .query-button {
490
+ padding-inline: 14px;
491
+ }
492
+
493
+ .rmb-estimation-page .toolbar-actions {
494
+ gap: 8px;
495
+ }
496
+
497
+ .rmb-estimation-page .amount-unit-control > span {
498
+ display: none;
499
+ }
500
+ }
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ type LedgerItem = {
3
+ key: string
4
+ label: string
5
+ tone?: 'income' | 'expense'
6
+ }
7
+
8
+ const props = defineProps<{
9
+ items: readonly LedgerItem[]
10
+ values: object
11
+ amountUnitLabel: string
12
+ formatAmount: (value: unknown) => string
13
+ }>()
14
+
15
+ function getValue(key: string) {
16
+ return (props.values as Record<string, unknown>)[key]
17
+ }
18
+
19
+ function isNegative(value: unknown) {
20
+ return /^-\d+(?:\.\d+)?$/.test(String(value ?? '').replace(/,/g, '').trim())
21
+ }
22
+ </script>
23
+
24
+ <template>
25
+ <div class="amount-table amount-table--ledger">
26
+ <div class="amount-row amount-row--head">
27
+ <span>项目</span>
28
+ <span>金额({{ amountUnitLabel }})</span>
29
+ </div>
30
+
31
+ <div
32
+ v-for="(item, index) in items"
33
+ :key="item.key"
34
+ class="amount-row"
35
+ >
36
+ <div class="amount-name">
37
+ <span class="item-order">{{ index + 1 }}</span>
38
+ <strong>{{ item.label }}</strong>
39
+ </div>
40
+ <div
41
+ class="amount-value amount-value--with-unit"
42
+ :class="{
43
+ 'amount-value--income': item.tone === 'income',
44
+ 'amount-value--expense': item.tone === 'expense',
45
+ 'amount-value--negative': !item.tone && isNegative(getValue(item.key)),
46
+ }"
47
+ >
48
+ <strong>{{ formatAmount(getValue(item.key)) }}</strong>
49
+ <span>{{ amountUnitLabel }}</span>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </template>