verce-vue-test 0.0.37 → 0.0.39

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 (153) hide show
  1. package/888/mini2.0-main/.editorconfig +8 -0
  2. package/888/mini2.0-main/.env.development +3 -0
  3. package/888/mini2.0-main/.env.production +3 -0
  4. package/888/mini2.0-main/.env.test +3 -0
  5. package/888/mini2.0-main/.gitattributes +1 -0
  6. package/888/mini2.0-main/.oxlintrc.json +10 -0
  7. package/888/mini2.0-main/.prettierrc.json +6 -0
  8. package/888/mini2.0-main/.vscode/extensions.json +9 -0
  9. package/888/mini2.0-main/README.md +179 -0
  10. package/888/mini2.0-main/auto-imports.d.ts +629 -0
  11. package/888/mini2.0-main/components.d.ts +21 -0
  12. package/888/mini2.0-main/design-qa.md +36 -0
  13. package/888/mini2.0-main/docs/MX_API.md +244 -0
  14. package/888/mini2.0-main/docs/REQUEST.md +217 -0
  15. package/888/mini2.0-main/docs/jsapi.js +515 -0
  16. package/888/mini2.0-main/docs/package-json-guide.md +132 -0
  17. package/888/mini2.0-main/env.d.ts +15 -0
  18. package/888/mini2.0-main/eslint.config.ts +26 -0
  19. package/888/mini2.0-main/index.html +16 -0
  20. package/888/mini2.0-main/output/playwright/rmb-position/design-comparison.png +0 -0
  21. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-back-top.png +0 -0
  22. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-page.png +0 -0
  23. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-check.png +0 -0
  24. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-scrolled.png +0 -0
  25. package/888/mini2.0-main/package-lock.json +6442 -0
  26. package/888/mini2.0-main/package.json +66 -0
  27. package/888/mini2.0-main/plugins/bump-version.ts +61 -0
  28. package/888/mini2.0-main/postcss.config.ts +15 -0
  29. package/888/mini2.0-main/public/favicon.ico +0 -0
  30. package/888/mini2.0-main/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
  31. package/888/mini2.0-main/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
  32. package/888/mini2.0-main/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
  33. package/888/mini2.0-main/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
  34. package/888/mini2.0-main/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
  35. package/888/mini2.0-main/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
  36. package/888/mini2.0-main/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
  37. package/888/mini2.0-main/public/images/img.png +0 -0
  38. package/888/mini2.0-main/src/App.vue +59 -0
  39. package/888/mini2.0-main/src/api/health.ts +13 -0
  40. package/888/mini2.0-main/src/api/rmb-position.ts +287 -0
  41. package/888/mini2.0-main/src/api/user.ts +54 -0
  42. package/888/mini2.0-main/src/auto-imports.d.ts +639 -0
  43. package/888/mini2.0-main/src/components.d.ts +30 -0
  44. package/888/mini2.0-main/src/config/config.properties +3 -0
  45. package/888/mini2.0-main/src/config/env.ts +6 -0
  46. package/888/mini2.0-main/src/config/plugin.properties.pro +6 -0
  47. package/888/mini2.0-main/src/config/plugin.properties.test +6 -0
  48. package/888/mini2.0-main/src/core/mxApi/index.ts +344 -0
  49. package/888/mini2.0-main/src/core/request/index.ts +135 -0
  50. package/888/mini2.0-main/src/main.ts +39 -0
  51. package/888/mini2.0-main/src/router/index.ts +77 -0
  52. package/888/mini2.0-main/src/stores/app.ts +24 -0
  53. package/888/mini2.0-main/src/stores/counter.ts +12 -0
  54. package/888/mini2.0-main/src/stores/user.ts +85 -0
  55. package/888/mini2.0-main/src/types/api.d.ts +14 -0
  56. package/888/mini2.0-main/src/types/nprogress.d.ts +8 -0
  57. package/888/mini2.0-main/src/utils/auth-token.ts +197 -0
  58. package/888/mini2.0-main/src/utils/query.ts +27 -0
  59. package/888/mini2.0-main/src/utils/request.ts +233 -0
  60. package/888/mini2.0-main/src/views/clearing-detail/index.vue +49 -0
  61. package/888/mini2.0-main/src/views/foreign-position/index.vue +49 -0
  62. package/888/mini2.0-main/src/views/home/index.vue +213 -0
  63. package/888/mini2.0-main/src/views/login/index.vue +202 -0
  64. package/888/mini2.0-main/src/views/mine/index.vue +143 -0
  65. package/888/mini2.0-main/src/views/net-debit/index.vue +49 -0
  66. package/888/mini2.0-main/src/views/pbc-position/index.vue +49 -0
  67. package/888/mini2.0-main/src/views/position-estimate/index.vue +49 -0
  68. package/888/mini2.0-main/src/views/rmb-position/index.vue +1042 -0
  69. package/888/mini2.0-main/src/views/warning/index.vue +49 -0
  70. package/888/mini2.0-main/tsconfig.app.json +18 -0
  71. package/888/mini2.0-main/tsconfig.json +11 -0
  72. package/888/mini2.0-main/tsconfig.node.json +28 -0
  73. package/888/mini2.0-main/vite.config.ts +98 -0
  74. package/design-qa.md +39 -0
  75. package/mini2.0-main 2/.editorconfig +8 -0
  76. package/mini2.0-main 2/.env.development +3 -0
  77. package/mini2.0-main 2/.env.production +3 -0
  78. package/mini2.0-main 2/.env.test +3 -0
  79. package/mini2.0-main 2/.gitattributes +1 -0
  80. package/mini2.0-main 2/.oxlintrc.json +10 -0
  81. package/mini2.0-main 2/.prettierrc.json +6 -0
  82. package/mini2.0-main 2/.vscode/extensions.json +9 -0
  83. package/mini2.0-main 2/README.md +179 -0
  84. package/mini2.0-main 2/auto-imports.d.ts +629 -0
  85. package/mini2.0-main 2/components.d.ts +21 -0
  86. package/mini2.0-main 2/docs/MX_API.md +244 -0
  87. package/mini2.0-main 2/docs/REQUEST.md +217 -0
  88. package/mini2.0-main 2/docs/jsapi.js +515 -0
  89. package/mini2.0-main 2/docs/package-json-guide.md +132 -0
  90. package/mini2.0-main 2/env.d.ts +13 -0
  91. package/mini2.0-main 2/eslint.config.ts +26 -0
  92. package/mini2.0-main 2/index.html +16 -0
  93. package/mini2.0-main 2/package-lock.json +6442 -0
  94. package/mini2.0-main 2/package.json +66 -0
  95. package/mini2.0-main 2/plugins/bump-version.ts +61 -0
  96. package/mini2.0-main 2/postcss.config.ts +15 -0
  97. package/mini2.0-main 2/public/favicon.ico +0 -0
  98. package/mini2.0-main 2/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
  99. package/mini2.0-main 2/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
  100. package/mini2.0-main 2/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
  101. package/mini2.0-main 2/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
  102. package/mini2.0-main 2/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
  103. package/mini2.0-main 2/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
  104. package/mini2.0-main 2/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
  105. package/mini2.0-main 2/public/images/img.png +0 -0
  106. package/mini2.0-main 2/src/App.vue +11 -0
  107. package/mini2.0-main 2/src/api/user.ts +33 -0
  108. package/mini2.0-main 2/src/auto-imports.d.ts +639 -0
  109. package/mini2.0-main 2/src/components.d.ts +23 -0
  110. package/mini2.0-main 2/src/config/config.properties +3 -0
  111. package/mini2.0-main 2/src/config/env.ts +6 -0
  112. package/mini2.0-main 2/src/config/plugin.properties.pro +6 -0
  113. package/mini2.0-main 2/src/config/plugin.properties.test +6 -0
  114. package/mini2.0-main 2/src/core/mxApi/index.ts +217 -0
  115. package/mini2.0-main 2/src/core/request/index.ts +42 -0
  116. package/mini2.0-main 2/src/main.ts +28 -0
  117. package/mini2.0-main 2/src/router/index.ts +70 -0
  118. package/mini2.0-main 2/src/stores/app.ts +24 -0
  119. package/mini2.0-main 2/src/stores/counter.ts +12 -0
  120. package/mini2.0-main 2/src/stores/user.ts +52 -0
  121. package/mini2.0-main 2/src/types/api.d.ts +14 -0
  122. package/mini2.0-main 2/src/types/nprogress.d.ts +8 -0
  123. package/mini2.0-main 2/src/utils/query.ts +27 -0
  124. package/mini2.0-main 2/src/utils/request.ts +159 -0
  125. package/mini2.0-main 2/src/views/clearing-detail/index.vue +49 -0
  126. package/mini2.0-main 2/src/views/foreign-position/index.vue +49 -0
  127. package/mini2.0-main 2/src/views/home/index.vue +201 -0
  128. package/mini2.0-main 2/src/views/login/index.vue +196 -0
  129. package/mini2.0-main 2/src/views/net-debit/index.vue +49 -0
  130. package/mini2.0-main 2/src/views/pbc-position/index.vue +49 -0
  131. package/mini2.0-main 2/src/views/position-estimate/index.vue +49 -0
  132. package/mini2.0-main 2/src/views/rmb-position/index.vue +49 -0
  133. package/mini2.0-main 2/src/views/warning/index.vue +49 -0
  134. package/mini2.0-main 2/tsconfig.app.json +18 -0
  135. package/mini2.0-main 2/tsconfig.json +11 -0
  136. package/mini2.0-main 2/tsconfig.node.json +28 -0
  137. package/mini2.0-main 2/vite.config.ts +69 -0
  138. package/output/playwright/home-1672x941.png +0 -0
  139. package/output/playwright/home-preview-1672x941.png +0 -0
  140. package/output/playwright/home-reference-vs-preview.png +0 -0
  141. package/package.json +1 -1
  142. package/src/assets/home/card-clearing-city.png +0 -0
  143. package/src/assets/home/card-cross-border-map.png +0 -0
  144. package/src/assets/home/card-digital-currency.png +0 -0
  145. package/src/assets/home/card-eur-church.png +0 -0
  146. package/src/assets/home/card-hkd-skyline.png +0 -0
  147. package/src/assets/home/card-jpy-fuji.png +0 -0
  148. package/src/assets/home/card-rmb-great-wall.png +0 -0
  149. package/src/assets/home/card-usd-liberty.png +0 -0
  150. package/src/assets/home/home-page-bg.png +0 -0
  151. package/src/router/index.ts +1 -0
  152. package/src/views/FundCockpitView.vue +17 -23
  153. package/src/views/HomeView.vue +619 -33
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "mini2.0",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "dev:test": "vite --mode test",
9
+ "build": "run-p type-check \"build-only {@}\" --",
10
+ "build:test": "run-s type-check build-only:test",
11
+ "build:prod": "run-s type-check build-only:prod",
12
+ "preview": "vite preview",
13
+ "build-only": "vite build",
14
+ "build-only:test": "vite build --mode test",
15
+ "build-only:prod": "vite build --mode production",
16
+ "type-check": "vue-tsc --build",
17
+ "lint": "run-s lint:*",
18
+ "lint:oxlint": "oxlint . --fix",
19
+ "lint:eslint": "eslint . --fix --cache",
20
+ "format": "prettier --write --experimental-cli src/"
21
+ },
22
+ "dependencies": {
23
+ "@iconify/vue": "^5.0.1",
24
+ "@vueuse/core": "^14.3.0",
25
+ "adm-zip": "^0.5.17",
26
+ "axios": "^1.16.1",
27
+ "clipboard": "^2.0.11",
28
+ "crypto-js": "^4.2.0",
29
+ "dayjs": "^1.11.21",
30
+ "nprogress": "^0.2.0",
31
+ "pinia": "^3.0.4",
32
+ "pinia-plugin-persistedstate": "^4.7.1",
33
+ "qrcode": "^1.5.4",
34
+ "vant": "^4.9.24",
35
+ "vconsole": "^3.15.1",
36
+ "vue": "^3.5.32",
37
+ "vue-router": "^5.0.4"
38
+ },
39
+ "devDependencies": {
40
+ "@tsconfig/node24": "^24.0.4",
41
+ "@types/adm-zip": "^0.5.8",
42
+ "@types/node": "^24.12.2",
43
+ "@vitejs/plugin-vue": "^6.0.6",
44
+ "@vue/eslint-config-typescript": "^14.7.0",
45
+ "@vue/tsconfig": "^0.9.1",
46
+ "eslint": "^10.2.1",
47
+ "eslint-config-prettier": "^10.1.8",
48
+ "eslint-plugin-oxlint": "~1.60.0",
49
+ "eslint-plugin-vue": "~10.8.0",
50
+ "jiti": "^2.6.1",
51
+ "less": "^4.6.4",
52
+ "npm-run-all2": "^8.0.4",
53
+ "oxlint": "~1.60.0",
54
+ "postcss-px-to-viewport-8-plugin": "^1.2.5",
55
+ "prettier": "3.8.3",
56
+ "typescript": "~6.0.0",
57
+ "unplugin-auto-import": "^21.0.0",
58
+ "unplugin-vue-components": "^32.1.0",
59
+ "vite": "^8.0.8",
60
+ "vite-plugin-vue-devtools": "^8.1.1",
61
+ "vue-tsc": "^3.2.6"
62
+ },
63
+ "engines": {
64
+ "node": "^20.19.0 || >=22.12.0"
65
+ }
66
+ }
@@ -0,0 +1,61 @@
1
+ import { readFileSync, writeFileSync, cpSync, rmSync } from 'node:fs'
2
+ import { resolve, basename } from 'node:path'
3
+ import type { Plugin } from 'vite'
4
+ import AdmZip from 'adm-zip'
5
+
6
+ /**
7
+ * 打包时自增版本号、复制配置文件、压缩 dist 为 zip
8
+ */
9
+ export function bumpVersion(mode: string): Plugin {
10
+ return {
11
+ name: 'bump-version-and-copy',
12
+ writeBundle(options) {
13
+ const outDir = options.dir
14
+ if (!outDir) return
15
+
16
+ const suffix = mode === 'production' ? 'pro' : 'test'
17
+ const src = `src/config/plugin.properties.${suffix}`
18
+
19
+ let content = readFileSync(src, 'utf-8')
20
+ const match = content.match(/version_code=(\d+)/)
21
+ if (!match) return
22
+
23
+ const oldCode = Number(match[1])
24
+ const newCode = oldCode + 1
25
+
26
+ // 版本号规则:5位 version_code → 4位版本名
27
+ // version_code: ABCDD A=major B=minor C=patch DD=hotfix
28
+ // version_name: A.B.C.DD 示例 66102 → 6.6.1.02
29
+ const major = Math.floor(newCode / 10000)
30
+ const minor = Math.floor((newCode / 1000) % 10)
31
+ const patch = Math.floor((newCode / 100) % 10)
32
+ const hotfix = String(newCode % 100).padStart(2, '0')
33
+ const versionName = `${major}.${minor}.${patch}.${hotfix}`
34
+
35
+ content = content
36
+ .replace(/version_code=\d+/, `version_code=${newCode}`)
37
+ .replace(/version_name=[^;\n]+/, `version_name=${versionName}`)
38
+
39
+ writeFileSync(src, content)
40
+ writeFileSync(resolve(outDir, '..', 'plugin.properties'), content)
41
+
42
+ // 复制 config.properties 到 dist/www/
43
+ cpSync('src/config/config.properties', resolve(outDir, 'config.properties'))
44
+
45
+ console.log(`[plugin.properties] version: ${oldCode} → ${newCode} (${versionName})`)
46
+
47
+ // 压缩 dist 为 zip(使用 adm-zip,跨平台兼容)
48
+ const distDir = resolve(outDir, '..')
49
+ const zipName = `dist_${newCode}.zip`
50
+ const zipPath = resolve(distDir, zipName)
51
+ const zip = new AdmZip()
52
+
53
+ zip.addLocalFolder(resolve(distDir, 'www'), 'www')
54
+ zip.addLocalFile(resolve(distDir, 'plugin.properties'))
55
+
56
+ rmSync(zipPath, { force: true })
57
+ zip.writeZip(zipPath)
58
+ console.log(`[zip] 已生成 ${basename(distDir)}/${zipName}`)
59
+ },
60
+ }
61
+ }
@@ -0,0 +1,15 @@
1
+ import pxToViewport from 'postcss-px-to-viewport-8-plugin'
2
+
3
+ export default {
4
+ plugins: [
5
+ pxToViewport({
6
+ viewportWidth: 375,
7
+
8
+ viewportUnit: 'vw',
9
+
10
+ unitPrecision: 6,
11
+
12
+ minPixelValue: 2,
13
+ }),
14
+ ],
15
+ }
@@ -0,0 +1,59 @@
1
+ <script setup lang="ts">
2
+ const route = useRoute()
3
+ const router = useRouter()
4
+
5
+ const tabItems = [
6
+ { title: '首页', path: '/', icon: 'wap-home-o' },
7
+ { title: '我的', path: '/mine', icon: 'manager-o' },
8
+ ]
9
+
10
+ const showTabbar = computed(() => route.meta.hideTabbar !== true)
11
+
12
+ const activeTab = computed({
13
+ get: () => route.path,
14
+ set: (path: string) => {
15
+ if (path !== route.path) {
16
+ router.push(path)
17
+ }
18
+ },
19
+ })
20
+ </script>
21
+
22
+ <template>
23
+ <div class="app-shell">
24
+ <router-view v-slot="{ Component }">
25
+ <keep-alive include="HomePage">
26
+ <component :is="Component" />
27
+ </keep-alive>
28
+ </router-view>
29
+
30
+ <van-tabbar v-if="showTabbar" v-model="activeTab" fixed placeholder safe-area-inset-bottom>
31
+ <van-tabbar-item v-for="item in tabItems" :key="item.path" :name="item.path" :icon="item.icon">
32
+ {{ item.title }}
33
+ </van-tabbar-item>
34
+ </van-tabbar>
35
+ </div>
36
+ </template>
37
+
38
+ <style scoped>
39
+ .app-shell {
40
+ min-height: 100vh;
41
+ background: #f7f8fa;
42
+ }
43
+
44
+ :deep(.van-tabbar) {
45
+ max-width: 750px;
46
+ left: 50%;
47
+ transform: translateX(-50%);
48
+ border-top: 1px solid #f0f1f3;
49
+ }
50
+
51
+ :deep(.van-tabbar-item) {
52
+ color: #6b7280;
53
+ font-size: 12px;
54
+ }
55
+
56
+ :deep(.van-tabbar-item--active) {
57
+ color: #f22f3d;
58
+ }
59
+ </style>
@@ -0,0 +1,13 @@
1
+ import { request } from '@/core/request'
2
+
3
+ export interface HealthCheckResult {
4
+ status?: string
5
+ timestamp?: string
6
+ }
7
+
8
+ export function healthCheckApi() {
9
+ return request<HealthCheckResult>({
10
+ url: '/uaa/announcement/get/restricted',
11
+ method: 'GET',
12
+ })
13
+ }
@@ -0,0 +1,287 @@
1
+ import dayjs from 'dayjs'
2
+
3
+ export type RmbForecastRecord = {
4
+ busiType?: string
5
+ clientName?: string
6
+ clientType?: string
7
+ competAcct?: string
8
+ competName?: string
9
+ groundBranch?: string
10
+ payChannel?: string
11
+ payDirec?: string
12
+ predAmt?: string
13
+ predDate?: string
14
+ predRefNo?: string
15
+ predStatus?: string
16
+ tranDate?: string
17
+ verifyAmt?: string
18
+ verifyStatus?: string
19
+ }
20
+
21
+ export type RmbForecastQueryForm = {
22
+ tranDate: string
23
+ groundBranch?: string
24
+ startTranAmt?: string
25
+ endTranAmt?: string
26
+ busiType?: string
27
+ clientName?: string
28
+ competName?: string
29
+ payChannel?: string
30
+ payDirec?: string
31
+ predStatus?: string
32
+ sortRule?: string
33
+ verifyStatus?: string
34
+ }
35
+
36
+ export type RmbForecastQueryPayload = {
37
+ appHead: {
38
+ fileName: string
39
+ opType: string
40
+ ip: string
41
+ }
42
+ body: {
43
+ tranDate: string
44
+ busiType: string
45
+ clientName: string
46
+ competName: string
47
+ groundBranch: string
48
+ payChannel: string
49
+ endTranAmt: number | null
50
+ payDirec: string
51
+ predStatus: string
52
+ sortRule: string
53
+ startTranAmt: number | null
54
+ verifyStatus: string
55
+ }
56
+ head: {
57
+ adminUserId: string
58
+ apprUserId: string
59
+ areaCode: string
60
+ branchId: string
61
+ consumerId: string
62
+ consumerSeqNo: string
63
+ digitalSign: string
64
+ fileFlag: string
65
+ filePath: string
66
+ isBatch: boolean
67
+ pageIndex: number
68
+ pageSize: number
69
+ spanId: string
70
+ traceId: string
71
+ tranCode: string
72
+ tranDate: string
73
+ tranTimeStamp: string
74
+ userId: string
75
+ verifyUserId: string
76
+ versionId: string
77
+ }
78
+ }
79
+
80
+ export type RmbForecastQueryResult = {
81
+ body: {
82
+ resultList: RmbForecastRecord[]
83
+ totalCount: string
84
+ }
85
+ head: RmbForecastQueryPayload['head'] & {
86
+ retCode: string
87
+ retMsg: string
88
+ retStatus: string
89
+ }
90
+ }
91
+
92
+ type QueryOptions = {
93
+ form: RmbForecastQueryForm
94
+ pageIndex: number
95
+ pageSize: number
96
+ }
97
+
98
+ const TRAN_CODE = '/TAM/0001/140101001'
99
+ const DEFAULT_TOTAL = 251
100
+
101
+ const baseMockRecords: RmbForecastRecord[] = [
102
+ {
103
+ busiType: '1',
104
+ clientName: '铁运客户',
105
+ clientType: '1',
106
+ competAcct: '1',
107
+ competName: '1',
108
+ groundBranch: '沙雅支行营业部',
109
+ payChannel: '1',
110
+ payDirec: '1',
111
+ predAmt: '1100000000',
112
+ predDate: '20260512 10:50:42',
113
+ predRefNo: '2026051201437066',
114
+ predStatus: '2',
115
+ verifyAmt: '0',
116
+ verifyStatus: '1',
117
+ },
118
+ {
119
+ busiType: '1',
120
+ competName: '3234',
121
+ groundBranch: '北京银行总行核算中心',
122
+ payChannel: '1',
123
+ payDirec: '1',
124
+ predAmt: '0',
125
+ verifyStatus: '1',
126
+ },
127
+ {
128
+ busiType: '1',
129
+ groundBranch: '北京银行股份有限公司北京分行',
130
+ payChannel: '1',
131
+ payDirec: '1',
132
+ predAmt: '123',
133
+ verifyStatus: '1',
134
+ },
135
+ {
136
+ busiType: '5',
137
+ competName: '111',
138
+ groundBranch: '乌市营业部',
139
+ payChannel: '1',
140
+ payDirec: '1',
141
+ predAmt: '0',
142
+ verifyStatus: '1',
143
+ },
144
+ {
145
+ busiType: '4',
146
+ competName: 'ddd',
147
+ competAcct: '123123124124',
148
+ groundBranch: '北京银行总行核算中心',
149
+ predAmt: '0',
150
+ verifyStatus: '1',
151
+ },
152
+ {
153
+ busiType: '7',
154
+ competName: 'www',
155
+ competAcct: '123214455123',
156
+ groundBranch: '北京银行总行核算中心',
157
+ predAmt: '0',
158
+ verifyStatus: '1',
159
+ },
160
+ {
161
+ busiType: '2',
162
+ groundBranch: '北京银行总行核算中心',
163
+ payChannel: '2',
164
+ payDirec: '1',
165
+ predAmt: '1234444444',
166
+ verifyStatus: '1',
167
+ },
168
+ ]
169
+
170
+ export function buildRmbForecastQueryPayload({
171
+ form,
172
+ pageIndex,
173
+ pageSize,
174
+ }: QueryOptions): RmbForecastQueryPayload {
175
+ const now = dayjs()
176
+ const tranDate = normalizeDate(form.tranDate)
177
+
178
+ return {
179
+ appHead: {
180
+ fileName: '',
181
+ opType: '',
182
+ ip: '10.51.106.161',
183
+ },
184
+ body: {
185
+ tranDate,
186
+ busiType: form.busiType || '',
187
+ clientName: form.clientName || '',
188
+ competName: form.competName || '',
189
+ groundBranch: form.groundBranch || '',
190
+ payChannel: form.payChannel || '',
191
+ endTranAmt: toRequestAmount(form.endTranAmt),
192
+ payDirec: form.payDirec || '',
193
+ predStatus: form.predStatus || '',
194
+ sortRule: form.sortRule || '',
195
+ startTranAmt: toRequestAmount(form.startTranAmt),
196
+ verifyStatus: form.verifyStatus || '',
197
+ },
198
+ head: {
199
+ adminUserId: '',
200
+ apprUserId: '',
201
+ areaCode: '0000',
202
+ branchId: '25001',
203
+ consumerId: 'TAM001',
204
+ consumerSeqNo: `superuser6${now.format('YYYYMMDDHHmmssSSS')}`,
205
+ digitalSign: '',
206
+ fileFlag: 'N',
207
+ filePath: '',
208
+ isBatch: false,
209
+ pageIndex,
210
+ pageSize,
211
+ spanId: '',
212
+ traceId: '',
213
+ tranCode: TRAN_CODE,
214
+ tranDate: now.format('YYYYMMDD'),
215
+ tranTimeStamp: now.format('HHmmss'),
216
+ userId: 'superuser6',
217
+ verifyUserId: '',
218
+ versionId: '0001',
219
+ },
220
+ }
221
+ }
222
+
223
+ export async function queryRmbForecastPage(
224
+ payload: RmbForecastQueryPayload,
225
+ ): Promise<RmbForecastQueryResult> {
226
+ const records = buildMockRecords(payload.body.tranDate)
227
+ .filter((record) =>
228
+ payload.body.groundBranch ? record.groundBranch?.includes(payload.body.groundBranch) : true,
229
+ )
230
+ .filter((record) => {
231
+ const amount = Number(record.predAmt || 0)
232
+ const matchesMin =
233
+ payload.body.startTranAmt === null ? true : amount >= payload.body.startTranAmt
234
+ const matchesMax = payload.body.endTranAmt === null ? true : amount <= payload.body.endTranAmt
235
+
236
+ return matchesMin && matchesMax
237
+ })
238
+
239
+ const start = (payload.head.pageIndex - 1) * payload.head.pageSize
240
+ const end = start + payload.head.pageSize
241
+
242
+ await wait(220)
243
+
244
+ return {
245
+ body: {
246
+ resultList: records.slice(start, end),
247
+ totalCount: String(records.length),
248
+ },
249
+ head: {
250
+ ...payload.head,
251
+ retCode: '000000',
252
+ retMsg: '交易成功',
253
+ retStatus: 'S',
254
+ },
255
+ }
256
+ }
257
+
258
+ function buildMockRecords(tranDate: string) {
259
+ return Array.from({ length: DEFAULT_TOTAL }, (_, index) => {
260
+ const base = baseMockRecords[index % baseMockRecords.length]!
261
+ const serial = String(index + 1).padStart(4, '0')
262
+ const predAmt = base.predAmt === '0' ? String((index % 9) * 10000000) : base.predAmt
263
+
264
+ return {
265
+ ...base,
266
+ predAmt,
267
+ tranDate,
268
+ predRefNo: base.predRefNo || `${tranDate}${serial}`,
269
+ }
270
+ })
271
+ }
272
+
273
+ function normalizeDate(value: string) {
274
+ if (/^\d{8}$/.test(value)) return value
275
+ return value.replaceAll('-', '')
276
+ }
277
+
278
+ function toRequestAmount(value?: string) {
279
+ if (!value?.trim()) return null
280
+
281
+ const amount = Number(value)
282
+ return Number.isFinite(amount) ? Math.round(amount * 100000000) : null
283
+ }
284
+
285
+ function wait(ms: number) {
286
+ return new Promise((resolve) => window.setTimeout(resolve, ms))
287
+ }
@@ -0,0 +1,54 @@
1
+ import { request } from '@/core/request'
2
+ import { REFRESH_TOKEN_URL, type AuthTokenResponse } from '@/utils/auth-token'
3
+
4
+ interface UserInfo {
5
+ id: number
6
+ username: string
7
+ avatar: string
8
+ }
9
+
10
+ export function getUserInfoApi(id: number) {
11
+ return request<UserInfo>({ url: `/user/${id}` })
12
+ }
13
+
14
+ export function loginApi(data: { username: string; password: string }) {
15
+ return request<AuthTokenResponse>({
16
+ url: '/uaa/oauth/token',
17
+ method: 'POST',
18
+ data,
19
+ auth: {
20
+ username: 'client',
21
+ password: 'secret',
22
+ },
23
+ skipAuth: true,
24
+ })
25
+ }
26
+ /**
27
+ * 通过敏行token换取业务登录信息
28
+ * @param appToken
29
+ */
30
+ export function loginByAppTokenApi(appToken: string) {
31
+ return request<AuthTokenResponse>({
32
+ url: '/uaa/oauth/mobile/token',
33
+ method: 'POST',
34
+ data: {
35
+ token: appToken,
36
+ },
37
+ skipAuth: true,
38
+ })
39
+ }
40
+
41
+ /**
42
+ * 通过 refresh token 刷新业务登录信息
43
+ * @param refreshToken
44
+ */
45
+ export function refreshMobileTokenApi(refreshToken: string) {
46
+ return request<AuthTokenResponse>({
47
+ url: REFRESH_TOKEN_URL,
48
+ method: 'POST',
49
+ data: {
50
+ refreshToken,
51
+ },
52
+ skipAuth: true,
53
+ })
54
+ }