verce-vue-test 0.0.61 → 0.0.63

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 (112) hide show
  1. package/design-qa.md +28 -27
  2. package/package.json +1 -1
  3. package/src/App.vue +8 -0
  4. package/src/components/ElTablePro.vue +16 -5
  5. package/src/components/NumberRange.vue +145 -65
  6. package/src/router/index.ts +10 -0
  7. package/src/utils/formatters.ts +17 -0
  8. package/src/views/ForecastInfo/components/FlowInfoPanel.vue +373 -0
  9. package/src/views/ForecastInfo/components/ForecastInfoPanel.vue +709 -0
  10. package/src/views/ForecastInfo/forecast-info.css +816 -0
  11. package/src/views/ForecastInfo/index.vue +39 -0
  12. package/src/views/ForecastInfo/store.ts +1035 -0
  13. package/src/views/NumberRangeView.vue +114 -0
  14. package/mini2.0-main/.editorconfig +0 -8
  15. package/mini2.0-main/.env.development +0 -3
  16. package/mini2.0-main/.env.production +0 -3
  17. package/mini2.0-main/.env.test +0 -3
  18. package/mini2.0-main/.gitattributes +0 -1
  19. package/mini2.0-main/.oxlintrc.json +0 -10
  20. package/mini2.0-main/.playwright-cli/page-2026-07-07T07-17-06-007Z.yml +0 -61
  21. package/mini2.0-main/.playwright-cli/page-2026-07-07T07-18-36-454Z.yml +0 -0
  22. package/mini2.0-main/.playwright-cli/page-2026-07-07T07-18-47-595Z.yml +0 -66
  23. package/mini2.0-main/.playwright-cli/page-2026-07-07T07-18-59-176Z.yml +0 -0
  24. package/mini2.0-main/.prettierrc.json +0 -6
  25. package/mini2.0-main/.vscode/extensions.json +0 -9
  26. package/mini2.0-main/README.md +0 -179
  27. package/mini2.0-main/auto-imports.d.ts +0 -629
  28. package/mini2.0-main/components.d.ts +0 -21
  29. package/mini2.0-main/design-qa.md +0 -36
  30. package/mini2.0-main/docs/MX_API.md +0 -244
  31. package/mini2.0-main/docs/REQUEST.md +0 -217
  32. package/mini2.0-main/docs/jsapi.js +0 -515
  33. package/mini2.0-main/docs/package-json-guide.md +0 -132
  34. package/mini2.0-main/env.d.ts +0 -15
  35. package/mini2.0-main/eslint.config.ts +0 -26
  36. package/mini2.0-main/index.html +0 -16
  37. package/mini2.0-main/output/playwright/rmb-position/design-comparison.png +0 -0
  38. package/mini2.0-main/output/playwright/rmb-position/rmb-position-back-top.png +0 -0
  39. package/mini2.0-main/output/playwright/rmb-position/rmb-position-page.png +0 -0
  40. package/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-check.png +0 -0
  41. package/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-scrolled.png +0 -0
  42. package/mini2.0-main/package-lock.json +0 -6473
  43. package/mini2.0-main/package.json +0 -66
  44. package/mini2.0-main/plugins/bump-version.ts +0 -61
  45. package/mini2.0-main/postcss.config.ts +0 -15
  46. package/mini2.0-main/public/favicon.ico +0 -0
  47. package/mini2.0-main/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
  48. package/mini2.0-main/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
  49. package/mini2.0-main/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
  50. package/mini2.0-main/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
  51. package/mini2.0-main/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
  52. package/mini2.0-main/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
  53. package/mini2.0-main/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
  54. package/mini2.0-main/public/images/img.png +0 -0
  55. package/mini2.0-main/src/App.vue +0 -131
  56. package/mini2.0-main/src/api/announcement.ts +0 -405
  57. package/mini2.0-main/src/api/health.ts +0 -13
  58. package/mini2.0-main/src/api/pbc-position.ts +0 -178
  59. package/mini2.0-main/src/api/rmb-position.ts +0 -233
  60. package/mini2.0-main/src/api/tam.ts +0 -173
  61. package/mini2.0-main/src/api/user.ts +0 -92
  62. package/mini2.0-main/src/auto-imports.d.ts +0 -633
  63. package/mini2.0-main/src/components/AppTitleBar.vue +0 -376
  64. package/mini2.0-main/src/components.d.ts +0 -33
  65. package/mini2.0-main/src/config/config.properties +0 -3
  66. package/mini2.0-main/src/config/env.ts +0 -6
  67. package/mini2.0-main/src/config/plugin.properties.pro +0 -6
  68. package/mini2.0-main/src/config/plugin.properties.test +0 -6
  69. package/mini2.0-main/src/core/mxApi/index.ts +0 -451
  70. package/mini2.0-main/src/core/request/index.ts +0 -135
  71. package/mini2.0-main/src/main.ts +0 -40
  72. package/mini2.0-main/src/router/index.ts +0 -144
  73. package/mini2.0-main/src/stores/app.ts +0 -103
  74. package/mini2.0-main/src/stores/counter.ts +0 -12
  75. package/mini2.0-main/src/stores/user.ts +0 -137
  76. package/mini2.0-main/src/styles/nprogress.css +0 -22
  77. package/mini2.0-main/src/styles/vant-overrides.css +0 -42
  78. package/mini2.0-main/src/types/api.d.ts +0 -14
  79. package/mini2.0-main/src/types/nprogress.d.ts +0 -8
  80. package/mini2.0-main/src/utils/auth-token.ts +0 -241
  81. package/mini2.0-main/src/utils/code-highlight.ts +0 -165
  82. package/mini2.0-main/src/utils/copy.ts +0 -36
  83. package/mini2.0-main/src/utils/query.ts +0 -27
  84. package/mini2.0-main/src/utils/request.ts +0 -238
  85. package/mini2.0-main/src/utils/rmb-forecast.ts +0 -84
  86. package/mini2.0-main/src/utils/toast.ts +0 -61
  87. package/mini2.0-main/src/views/article-detail/index.vue +0 -289
  88. package/mini2.0-main/src/views/article-edit/index.vue +0 -600
  89. package/mini2.0-main/src/views/articles/index.vue +0 -293
  90. package/mini2.0-main/src/views/clearing-detail/index.vue +0 -26
  91. package/mini2.0-main/src/views/dashboard/index.vue +0 -18
  92. package/mini2.0-main/src/views/foreign-position/index.vue +0 -26
  93. package/mini2.0-main/src/views/home/index.vue +0 -213
  94. package/mini2.0-main/src/views/login/index.vue +0 -275
  95. package/mini2.0-main/src/views/mine/index.vue +0 -147
  96. package/mini2.0-main/src/views/net-debit/index.vue +0 -26
  97. package/mini2.0-main/src/views/opening-reserve-estimate/index.vue +0 -28
  98. package/mini2.0-main/src/views/pbc-position/index.vue +0 -357
  99. package/mini2.0-main/src/views/position-estimate/index.vue +0 -74
  100. package/mini2.0-main/src/views/position-estimate-report/index.vue +0 -28
  101. package/mini2.0-main/src/views/rmb-position/index.vue +0 -1013
  102. package/mini2.0-main/src/views/rmb-position-create/index.vue +0 -221
  103. package/mini2.0-main/src/views/rmb-position-detail/index.vue +0 -355
  104. package/mini2.0-main/src/views/settings/index.vue +0 -67
  105. package/mini2.0-main/src/views/warning/index.vue +0 -26
  106. package/mini2.0-main/tsconfig.app.json +0 -18
  107. package/mini2.0-main/tsconfig.json +0 -11
  108. package/mini2.0-main/tsconfig.node.json +0 -28
  109. package/mini2.0-main/vite.config.ts +0 -100
  110. package/output/playwright/home-1672x941.png +0 -0
  111. package/output/playwright/home-preview-1672x941.png +0 -0
  112. package/output/playwright/home-reference-vs-preview.png +0 -0
package/design-qa.md CHANGED
@@ -1,47 +1,48 @@
1
1
  **Findings**
2
- - No actionable P0/P1/P2 findings remain.
2
+ - No actionable P0/P1/P2 findings remain for the `ElTablePro` table revision.
3
3
 
4
4
  **Open Questions**
5
- - None for the current homepage state.
5
+ - None.
6
6
 
7
7
  **Implementation Checklist**
8
- - Kept the homepage as a fullscreen balance overview route.
9
- - Reworked the homepage shell into a responsive two-column layout with a right-side quick menu.
10
- - Replaced the previous fixed-reference sizing with `grid`, `%`, `minmax()`, and `clamp()` sizing.
11
- - Reused the provided home assets and renamed them to ASCII filenames.
12
- - Verified the reference viewport at 1672x941 plus additional device sizes.
13
- - Removed the extra white highlight dot from all circular badge icons.
14
- - Verified production preview screenshots across wide, laptop, tablet landscape, and tablet portrait viewports.
8
+ - Replaced both native `el-table` blocks with `ElTablePro`.
9
+ - Replaced manual pagination footers with `ElTablePro` built-in pagination.
10
+ - Kept forecast CRUD actions in the `ElTablePro` toolbar slot.
11
+ - Enabled `ElTablePro` column configuration for both forecast and flow tables.
12
+ - Added `paginationSize` support to `ElTablePro` so this page can keep all pagination controls `small`.
13
+ - Forwarded the `empty` slot from `ElTablePro` to the inner `el-table` so empty-state illustrations still render.
15
14
 
16
15
  **Follow-up Polish**
17
- - [P3] The three non-currency badge glyphs use the closest available Element Plus icons. If exact source icon artwork becomes available, replace those three glyphs with the supplied image assets for even tighter parity.
16
+ - [P3] When backend data is connected, wire `handleForecastPaginationChange` and `handleFlowPaginationChange` to reload their respective lists.
18
17
 
19
- source visual truth path: `/var/folders/9_/635n2vmx5017pd592w50p_d80000gn/T/codex-clipboard-5312293c-ab94-4ddd-9cdd-53b6bbe19f2b.png`
18
+ source visual truth path: `/var/folders/9_/635n2vmx5017pd592w50p_d80000gn/T/codex-clipboard-2f217f68-ef5c-41ad-82fc-63dd8e80fd89.png`
20
19
 
21
- implementation screenshot path: `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-responsive-1672x941.png`
20
+ implementation screenshot path: `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/forecast-info-table-pro-1672x941.png`
22
21
 
23
- viewport: `1672x941`, `1366x768`, `1024x768`, `820x1180`
22
+ viewport: `1672x941`
24
23
 
25
- state: production preview, `/`, default homepage
24
+ state: production preview, `/forecast-info`, existing app shell, drawer-filter default state, `ElTablePro` tables
26
25
 
27
26
  full-view comparison evidence:
28
- - `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-responsive-1672x941.png`
29
- - `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-responsive-1366x768.png`
30
- - `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-responsive-1024x768.png`
31
- - `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-responsive-820x1180.png`
27
+ - `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/forecast-info-table-pro-1672x941.png`
32
28
 
33
- focused region comparison evidence: card rows, amount blocks, badge icons, update time, and the right-side menu were checked in the rendered screenshots. The layout no longer depends on a single 1672px-wide design viewport.
29
+ focused region comparison evidence:
30
+ - Forecast list: rendered through `ElTablePro`, toolbar actions appear above the table, column config is available, built-in pagination renders below.
31
+ - Flow list: rendered through `ElTablePro`, column config is available, built-in pagination renders below.
32
+ - Empty state: custom empty illustration/text still render inside `ElTablePro` through slot forwarding.
34
33
 
35
34
  required fidelity surfaces:
36
- - Fonts and typography: Chinese titles, timestamps, labels, amounts, decimals, and unit codes match the visual hierarchy and stay inside their containers.
37
- - Spacing and layout rhythm: glass panel, two-column/four-row grid, card gaps, rounded corners, and right-side menu scale across tested viewports. Portrait view uses panel scrolling instead of compressing all eight cards into overlapping rows.
38
- - Colors and visual tokens: red, green, blue, cyan, orange, and purple card themes follow the source palette and use supplied background art.
39
- - Image quality and asset fidelity: all provided raster backgrounds are used from `src/assets/home`; no Chinese filenames remain in the app references.
40
- - Copy and content: title, update time, account labels, amount strings, decimals, and currency codes match the screenshot.
35
+ - Fonts and typography: table headers, toolbar buttons, pagination text, and empty-state text remain compact and readable.
36
+ - Spacing and layout rhythm: table toolbar, column config button, table body, and pagination are aligned within each card.
37
+ - Colors and visual tokens: `ElTablePro` output preserves existing gray borders, light header rows, and blue primary pagination state.
38
+ - Image quality and asset fidelity: empty states use Element Plus' empty illustration; action icons use Element Plus icons.
39
+ - Copy and content: column labels, toolbar actions, empty text, pagination, and column config copy are present.
41
40
 
42
41
  patches made since previous QA pass:
43
- - Added a right-side quick menu to the fullscreen homepage.
44
- - Replaced the rigid `cqw`/absolute-position layout with responsive CSS Grid and `clamp()` sizing.
45
- - Confirmed badge highlight dots remain removed.
42
+ - Imported and used `ElTablePro` in `ForecastInfoView.vue`.
43
+ - Added separate page/page-size state and pagination callbacks for forecast and flow lists.
44
+ - Added `paginationSize` prop and empty-slot forwarding to `ElTablePro.vue`.
45
+ - Removed manual table pagination markup and related page-level CSS.
46
+ - Re-captured the page in production preview.
46
47
 
47
48
  final result: passed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -77,6 +77,10 @@ function toggleCollapse() {
77
77
  <el-icon><EditPen /></el-icon>
78
78
  <span>千分位输入</span>
79
79
  </el-menu-item>
80
+ <el-menu-item index="/number-range">
81
+ <el-icon><DataLine /></el-icon>
82
+ <span>数字区间</span>
83
+ </el-menu-item>
80
84
  <el-menu-item index="/position-forecast">
81
85
  <el-icon><DataLine /></el-icon>
82
86
  <span>头寸预报</span>
@@ -85,6 +89,10 @@ function toggleCollapse() {
85
89
  <el-icon><DataLine /></el-icon>
86
90
  <span>头寸预报执行</span>
87
91
  </el-menu-item>
92
+ <el-menu-item index="/forecast-info">
93
+ <el-icon><DataLine /></el-icon>
94
+ <span>预报信息</span>
95
+ </el-menu-item>
88
96
  <el-menu-item index="/executive-management">
89
97
  <el-icon><TrendCharts /></el-icon>
90
98
  <span>总行管理员首页</span>
@@ -49,6 +49,8 @@ const props = withDefaults(
49
49
  pageSizes?: number[]
50
50
  // 分页组件布局
51
51
  layout?: string
52
+ // 分页尺寸
53
+ paginationSize?: 'large' | 'default' | 'small'
52
54
  }>(),
53
55
  {
54
56
  columnConfig: true,
@@ -58,6 +60,7 @@ const props = withDefaults(
58
60
  pageSize: 10,
59
61
  pageSizes: () => [10, 20, 50, 100],
60
62
  layout: 'total, sizes, prev, pager, next, jumper',
63
+ paginationSize: 'default',
61
64
  },
62
65
  )
63
66
 
@@ -357,6 +360,13 @@ initColumns()
357
360
  v-for="column in visibleColumns"
358
361
  :key="column.key"
359
362
  />
363
+
364
+ <template
365
+ v-if="$slots.empty"
366
+ #empty
367
+ >
368
+ <slot name="empty" />
369
+ </template>
360
370
  </el-table>
361
371
 
362
372
  <!-- 分页组件 -->
@@ -368,10 +378,11 @@ initColumns()
368
378
  v-model:current-page="currentPage"
369
379
  v-model:page-size="currentPageSize"
370
380
  :total="total || data.length"
371
- :page-sizes="pageSizes"
372
- :layout="layout"
373
- background
374
- />
381
+ :page-sizes="pageSizes"
382
+ :layout="layout"
383
+ :size="paginationSize"
384
+ background
385
+ />
375
386
  </div>
376
387
 
377
388
  <!-- 列配置弹窗 -->
@@ -559,4 +570,4 @@ initColumns()
559
570
  background-color: #40A9FF;
560
571
  border-color: #40A9FF;
561
572
  }
562
- </style>
573
+ </style>
@@ -6,6 +6,7 @@
6
6
  :class="{ 'is-error': showError }"
7
7
  :placeholder="minPlaceholder"
8
8
  :disabled="disabled"
9
+ :size="size"
9
10
  clearable
10
11
  @input="onMinInput"
11
12
  @focus="onMinFocus"
@@ -19,6 +20,7 @@
19
20
  :class="{ 'is-error': showError }"
20
21
  :placeholder="maxPlaceholder"
21
22
  :disabled="disabled"
23
+ :size="size"
22
24
  clearable
23
25
  @input="onMaxInput"
24
26
  @focus="onMaxFocus"
@@ -29,53 +31,76 @@
29
31
  </div>
30
32
  </template>
31
33
 
32
- <script setup lang="ts">
33
- import { ref, watch, computed } from 'vue'
34
+ <script setup lang="ts" name="NumberRange">
35
+ import { ref, watch, computed } from "vue"
34
36
 
35
37
  export type RangeValue = [number | null, number | null]
36
- type RangeInput = [number | string | null, number | string | null]
37
-
38
- const props = withDefaults(defineProps<{
39
- /** 数组模式绑定值 [min, max],接受字符串自动转换 */
40
- modelValue?: RangeInput
41
- /** 双字段模式 - 起始值,接受字符串自动转换 */
42
- start?: number | string | null
43
- /** 双字段模式 - 结束值,接受字符串自动转换 */
44
- end?: number | string | null
45
- minPlaceholder?: string
46
- maxPlaceholder?: string
47
- separator?: string
48
- /** 小数位数限制 */
49
- precision?: number
50
- disabled?: boolean
51
- /** 自定义错误提示 */
52
- errorMessage?: string
53
- }>(), {
54
- modelValue: undefined,
55
- start: undefined,
56
- end: undefined,
57
- minPlaceholder: '最小值',
58
- maxPlaceholder: '最大值',
59
- separator: '到',
60
- precision: undefined,
61
- disabled: false,
62
- errorMessage: '结束值不能小于起始值'
63
- })
38
+ type RangeInput = any
39
+
40
+ const props = withDefaults(
41
+ defineProps<{
42
+ /** 数组模式绑定值 [min, max],接受字符串自动转换 */
43
+ modelValue?: RangeInput
44
+ /** 双字段模式 - 起始值,接受字符串自动转换 */
45
+ start?: number | string | null
46
+ /** 双字段模式 - 结束值,接受字符串自动转换 */
47
+ end?: number | string | null
48
+ minPlaceholder?: string
49
+ maxPlaceholder?: string
50
+ separator?: string
51
+ /** 小数位数限制 */
52
+ precision?: number
53
+ /** 输出单位,支持传入 "万"、"亿" 或直接传入倍率数字 */
54
+ unit?: string | number
55
+ size?: "large" | "default" | "small"
56
+ disabled?: boolean
57
+ /** 自定义错误提示 */
58
+ errorMessage?: string
59
+ }>(),
60
+ {
61
+ modelValue: undefined,
62
+ start: undefined,
63
+ end: undefined,
64
+ minPlaceholder: "最小值",
65
+ maxPlaceholder: "最大值",
66
+ separator: "到",
67
+ precision: undefined,
68
+ unit: "",
69
+ size: "default",
70
+ disabled: false,
71
+ errorMessage: "开始金额不能大于结束金额"
72
+ }
73
+ )
64
74
 
65
75
  const emit = defineEmits<{
66
- 'update:modelValue': [value: RangeValue]
67
- 'update:start': [value: number | null]
68
- 'update:end': [value: number | null]
76
+ "update:modelValue": [value: RangeValue]
77
+ "update:start": [value: number | null]
78
+ "update:end": [value: number | null]
69
79
  /** 校验状态变化:true 表示通过,false 表示不通过 */
70
- 'validate': [valid: boolean]
80
+ validate: [valid: boolean]
71
81
  }>()
72
82
 
73
83
  // 判断绑定模式
74
84
  const isArrayMode = computed(() => props.modelValue !== undefined)
85
+ const unitMultiplier = computed(() => getUnitMultiplier(props.unit))
86
+
87
+ const UNIT_MULTIPLIERS: Record<string, number> = {
88
+ "": 1,
89
+ 个: 1,
90
+ 元: 1,
91
+ 十: 10,
92
+ 百: 100,
93
+ 千: 1000,
94
+ 千元: 1000,
95
+ 万: 10000,
96
+ 万元: 10000,
97
+ 亿: 100000000,
98
+ 亿元: 100000000
99
+ }
75
100
 
76
101
  // 显示值
77
- const minDisplay = ref('')
78
- const maxDisplay = ref('')
102
+ const minDisplay = ref("")
103
+ const maxDisplay = ref("")
79
104
 
80
105
  // 焦点状态
81
106
  const minFocused = ref(false)
@@ -90,30 +115,49 @@ const rangeInvalid = computed(() => {
90
115
  })
91
116
 
92
117
  // 显示错误:两个输入框都失焦后且校验不通过
93
- const showError = computed(() => hasBlurred.value && !minFocused.value && !maxFocused.value && rangeInvalid.value)
118
+ const showError = computed(
119
+ () =>
120
+ hasBlurred.value &&
121
+ !minFocused.value &&
122
+ !maxFocused.value &&
123
+ rangeInvalid.value
124
+ )
94
125
 
95
126
  // 转换为数字
96
127
  function toNum(val: unknown): number | null {
97
- if (val === null || val === undefined || val === '') return null
98
- const n = Number(val)
99
- return Number.isNaN(n) ? null : n
128
+ if (val === null || val === undefined) return null
129
+
130
+ if (typeof val === "number") {
131
+ return Number.isFinite(val) ? val : null
132
+ }
133
+
134
+ if (typeof val !== "string") return null
135
+
136
+ const value = val.trim()
137
+ if (!value || value === "-" || value === "." || value === "-.") return null
138
+
139
+ const n = Number(value)
140
+ return Number.isFinite(n) ? n : null
100
141
  }
101
142
 
102
143
  // 输入过滤
103
- function sanitize(raw: string): string {
104
- if (!raw) return ''
105
- let s = raw.replace(/[^0-9.\-]/g, '')
106
- const negative = s.startsWith('-')
107
- s = s.replace(/-/g, '')
108
- if (negative) s = '-' + s
109
- const dotIdx = s.indexOf('.')
144
+ function sanitize(raw: unknown): string {
145
+ if (raw === null || raw === undefined) return ""
146
+
147
+ let s = String(raw).replace(/[^0-9.\-]/g, "")
148
+ if (!s) return ""
149
+
150
+ const negative = s.startsWith("-")
151
+ s = s.replace(/-/g, "")
152
+ if (negative) s = "-" + s
153
+ const dotIdx = s.indexOf(".")
110
154
  if (dotIdx !== -1) {
111
155
  const intPart = s.slice(0, dotIdx)
112
- let decPart = s.slice(dotIdx + 1).replace(/\./g, '')
156
+ let decPart = s.slice(dotIdx + 1).replace(/\./g, "")
113
157
  if (props.precision !== undefined) {
114
158
  decPart = decPart.slice(0, props.precision)
115
159
  }
116
- s = intPart + '.' + decPart
160
+ s = intPart + "." + decPart
117
161
  }
118
162
  return s
119
163
  }
@@ -126,34 +170,69 @@ function formatNum(val: number | null): number | null {
126
170
  return val
127
171
  }
128
172
 
173
+ function getUnitMultiplier(unit: string | number): number {
174
+ if (typeof unit === "number") {
175
+ return Number.isFinite(unit) && unit > 0 ? unit : 1
176
+ }
177
+
178
+ const normalizedUnit = unit.trim()
179
+ const mappedMultiplier = UNIT_MULTIPLIERS[normalizedUnit]
180
+ if (mappedMultiplier !== undefined) {
181
+ return mappedMultiplier
182
+ }
183
+
184
+ const parsed = Number(normalizedUnit)
185
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 1
186
+ }
187
+
188
+ function normalizeNumber(val: number): number {
189
+ return Number.isInteger(val) ? val : Number(val.toFixed(12))
190
+ }
191
+
192
+ function toActualNum(val: number | null): number | null {
193
+ if (val === null) return null
194
+ return normalizeNumber(val * unitMultiplier.value)
195
+ }
196
+
197
+ function toDisplayNum(val: number | null): number | null {
198
+ if (val === null) return null
199
+ return normalizeNumber(val / unitMultiplier.value)
200
+ }
201
+
129
202
  function emitValue() {
130
- const minVal = formatNum(toNum(minDisplay.value))
131
- const maxVal = formatNum(toNum(maxDisplay.value))
203
+ const minVal = toActualNum(formatNum(toNum(minDisplay.value)))
204
+ const maxVal = toActualNum(formatNum(toNum(maxDisplay.value)))
132
205
  if (isArrayMode.value) {
133
- emit('update:modelValue', [minVal, maxVal])
206
+ emit("update:modelValue", [minVal, maxVal])
134
207
  } else {
135
- emit('update:start', minVal)
136
- emit('update:end', maxVal)
208
+ emit("update:start", minVal)
209
+ emit("update:end", maxVal)
137
210
  }
138
211
  // 发送校验状态
139
- emit('validate', !rangeInvalid.value)
212
+ emit("validate", !rangeInvalid.value)
140
213
  }
141
214
 
142
- function onMinInput(val: string | number) {
143
- minDisplay.value = sanitize(String(val))
215
+ function onMinInput(val: string) {
216
+ minDisplay.value = sanitize(val)
217
+ if (minDisplay.value === "") {
218
+ emitValue()
219
+ }
144
220
  }
145
221
 
146
- function onMaxInput(val: string | number) {
147
- maxDisplay.value = sanitize(String(val))
222
+ function onMaxInput(val: string) {
223
+ maxDisplay.value = sanitize(val)
224
+ if (maxDisplay.value === "") {
225
+ emitValue()
226
+ }
148
227
  }
149
228
 
150
229
  function onMinClear() {
151
- minDisplay.value = ''
230
+ minDisplay.value = ""
152
231
  emitValue()
153
232
  }
154
233
 
155
234
  function onMaxClear() {
156
- maxDisplay.value = ''
235
+ maxDisplay.value = ""
157
236
  emitValue()
158
237
  }
159
238
 
@@ -199,8 +278,8 @@ function validate(): boolean {
199
278
 
200
279
  // 重置方法
201
280
  function reset() {
202
- minDisplay.value = ''
203
- maxDisplay.value = ''
281
+ minDisplay.value = ""
282
+ maxDisplay.value = ""
204
283
  hasBlurred.value = false
205
284
  }
206
285
 
@@ -210,14 +289,15 @@ defineExpose({ validate, reset })
210
289
  watch(
211
290
  () => ({
212
291
  isArrayMode: isArrayMode.value,
292
+ unitMultiplier: unitMultiplier.value,
213
293
  min: isArrayMode.value ? props.modelValue?.[0] : props.start,
214
294
  max: isArrayMode.value ? props.modelValue?.[1] : props.end
215
295
  }),
216
296
  ({ min, max }) => {
217
297
  const minNum = toNum(min)
218
298
  const maxNum = toNum(max)
219
- const newMin = minNum !== null ? String(formatNum(minNum)) : ''
220
- const newMax = maxNum !== null ? String(formatNum(maxNum)) : ''
299
+ const newMin = minNum !== null ? String(formatNum(toDisplayNum(minNum))) : ""
300
+ const newMax = maxNum !== null ? String(formatNum(toDisplayNum(maxNum))) : ""
221
301
  if (newMin !== minDisplay.value) minDisplay.value = newMin
222
302
  if (newMax !== maxDisplay.value) maxDisplay.value = newMax
223
303
  },
@@ -55,6 +55,11 @@ const router = createRouter({
55
55
  name: 'thousandth',
56
56
  component: () => import('../views/ThousandthView.vue'),
57
57
  },
58
+ {
59
+ path: '/number-range',
60
+ name: 'numberRange',
61
+ component: () => import('../views/NumberRangeView.vue'),
62
+ },
58
63
  {
59
64
  path: '/position-forecast',
60
65
  name: 'positionForecast',
@@ -65,6 +70,11 @@ const router = createRouter({
65
70
  name: 'positionForecastExecution',
66
71
  component: () => import('../views/PositionForecastExecutionView.vue'),
67
72
  },
73
+ {
74
+ path: '/forecast-info',
75
+ name: 'forecastInfo',
76
+ component: () => import('../views/ForecastInfo/index.vue'),
77
+ },
68
78
  {
69
79
  path: '/executive-management',
70
80
  name: 'executiveManagement',
@@ -13,6 +13,23 @@ export const priceFormatter: FormatterFn = (
13
13
  cellValue,
14
14
  ) => `¥${Number(cellValue).toLocaleString()}`
15
15
 
16
+ export function formatThousands(value: unknown, fallback = '') {
17
+ const rawValue = value === null || value === undefined ? '' : String(value).trim()
18
+ if (!rawValue) return fallback
19
+
20
+ const normalizedValue = rawValue.replace(/,/g, '')
21
+ if (!/^-?\d+(\.\d+)?$/.test(normalizedValue)) {
22
+ return rawValue
23
+ }
24
+
25
+ const sign = normalizedValue.startsWith('-') ? '-' : ''
26
+ const unsignedValue = sign ? normalizedValue.slice(1) : normalizedValue
27
+ const [integerPart, decimalPart] = unsignedValue.split('.')
28
+ const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
29
+
30
+ return `${sign}${formattedInteger}${decimalPart === undefined ? '' : `.${decimalPart}`}`
31
+ }
32
+
16
33
  export const booleanFormatter = (
17
34
  truthyText = '启用',
18
35
  falsyText = '禁用',