verce-vue-test 0.0.38 → 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.
- package/888/mini2.0-main/.editorconfig +8 -0
- package/888/mini2.0-main/.env.development +3 -0
- package/888/mini2.0-main/.env.production +3 -0
- package/888/mini2.0-main/.env.test +3 -0
- package/888/mini2.0-main/.gitattributes +1 -0
- package/888/mini2.0-main/.oxlintrc.json +10 -0
- package/888/mini2.0-main/.prettierrc.json +6 -0
- package/888/mini2.0-main/.vscode/extensions.json +9 -0
- package/888/mini2.0-main/README.md +179 -0
- package/888/mini2.0-main/auto-imports.d.ts +629 -0
- package/888/mini2.0-main/components.d.ts +21 -0
- package/888/mini2.0-main/design-qa.md +36 -0
- package/888/mini2.0-main/docs/MX_API.md +244 -0
- package/888/mini2.0-main/docs/REQUEST.md +217 -0
- package/888/mini2.0-main/docs/jsapi.js +515 -0
- package/888/mini2.0-main/docs/package-json-guide.md +132 -0
- package/888/mini2.0-main/env.d.ts +15 -0
- package/888/mini2.0-main/eslint.config.ts +26 -0
- package/888/mini2.0-main/index.html +16 -0
- package/888/mini2.0-main/output/playwright/rmb-position/design-comparison.png +0 -0
- package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-back-top.png +0 -0
- package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-page.png +0 -0
- package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-check.png +0 -0
- package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-scrolled.png +0 -0
- package/888/mini2.0-main/package-lock.json +6442 -0
- package/888/mini2.0-main/package.json +66 -0
- package/888/mini2.0-main/plugins/bump-version.ts +61 -0
- package/888/mini2.0-main/postcss.config.ts +15 -0
- package/888/mini2.0-main/public/favicon.ico +0 -0
- package/888/mini2.0-main/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
- package/888/mini2.0-main/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
- package/888/mini2.0-main/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
- package/888/mini2.0-main/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
- package/888/mini2.0-main/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
- package/888/mini2.0-main/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
- package/888/mini2.0-main/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
- package/888/mini2.0-main/public/images/img.png +0 -0
- package/888/mini2.0-main/src/App.vue +59 -0
- package/888/mini2.0-main/src/api/health.ts +13 -0
- package/888/mini2.0-main/src/api/rmb-position.ts +287 -0
- package/888/mini2.0-main/src/api/user.ts +54 -0
- package/888/mini2.0-main/src/auto-imports.d.ts +639 -0
- package/888/mini2.0-main/src/components.d.ts +30 -0
- package/888/mini2.0-main/src/config/config.properties +3 -0
- package/888/mini2.0-main/src/config/env.ts +6 -0
- package/888/mini2.0-main/src/config/plugin.properties.pro +6 -0
- package/888/mini2.0-main/src/config/plugin.properties.test +6 -0
- package/888/mini2.0-main/src/core/mxApi/index.ts +344 -0
- package/888/mini2.0-main/src/core/request/index.ts +135 -0
- package/888/mini2.0-main/src/main.ts +39 -0
- package/888/mini2.0-main/src/router/index.ts +77 -0
- package/888/mini2.0-main/src/stores/app.ts +24 -0
- package/888/mini2.0-main/src/stores/counter.ts +12 -0
- package/888/mini2.0-main/src/stores/user.ts +85 -0
- package/888/mini2.0-main/src/types/api.d.ts +14 -0
- package/888/mini2.0-main/src/types/nprogress.d.ts +8 -0
- package/888/mini2.0-main/src/utils/auth-token.ts +197 -0
- package/888/mini2.0-main/src/utils/query.ts +27 -0
- package/888/mini2.0-main/src/utils/request.ts +233 -0
- package/888/mini2.0-main/src/views/clearing-detail/index.vue +49 -0
- package/888/mini2.0-main/src/views/foreign-position/index.vue +49 -0
- package/888/mini2.0-main/src/views/home/index.vue +213 -0
- package/888/mini2.0-main/src/views/login/index.vue +202 -0
- package/888/mini2.0-main/src/views/mine/index.vue +143 -0
- package/888/mini2.0-main/src/views/net-debit/index.vue +49 -0
- package/888/mini2.0-main/src/views/pbc-position/index.vue +49 -0
- package/888/mini2.0-main/src/views/position-estimate/index.vue +49 -0
- package/888/mini2.0-main/src/views/rmb-position/index.vue +1042 -0
- package/888/mini2.0-main/src/views/warning/index.vue +49 -0
- package/888/mini2.0-main/tsconfig.app.json +18 -0
- package/888/mini2.0-main/tsconfig.json +11 -0
- package/888/mini2.0-main/tsconfig.node.json +28 -0
- package/888/mini2.0-main/vite.config.ts +98 -0
- package/design-qa.md +39 -0
- package/output/playwright/home-1672x941.png +0 -0
- package/output/playwright/home-preview-1672x941.png +0 -0
- package/output/playwright/home-reference-vs-preview.png +0 -0
- package/package.json +1 -1
- package/src/assets/home/card-clearing-city.png +0 -0
- package/src/assets/home/card-cross-border-map.png +0 -0
- package/src/assets/home/card-digital-currency.png +0 -0
- package/src/assets/home/card-eur-church.png +0 -0
- package/src/assets/home/card-hkd-skyline.png +0 -0
- package/src/assets/home/card-jpy-fuji.png +0 -0
- package/src/assets/home/card-rmb-great-wall.png +0 -0
- package/src/assets/home/card-usd-liberty.png +0 -0
- package/src/assets/home/home-page-bg.png +0 -0
- package/src/router/index.ts +1 -0
- 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
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
+
}
|