minitest2.0 0.0.0
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/.editorconfig +8 -0
- package/.env.development +3 -0
- package/.env.production +3 -0
- package/.env.test +3 -0
- package/.gitattributes +1 -0
- package/.oxlintrc.json +10 -0
- package/.prettierrc.json +6 -0
- package/.vscode/extensions.json +9 -0
- package/.vscode/settings.json +13 -0
- package/README.md +179 -0
- package/auto-imports.d.ts +629 -0
- package/components.d.ts +21 -0
- package/design-qa.md +36 -0
- package/docs/MX_API.md +244 -0
- package/docs/REQUEST.md +217 -0
- package/docs/jsapi.js +515 -0
- package/docs/package-json-guide.md +132 -0
- package/env.d.ts +15 -0
- package/eslint.config.ts +26 -0
- package/index.html +16 -0
- package/package.json +83 -0
- package/plugins/bump-version.ts +61 -0
- package/postcss.config.ts +15 -0
- package/public/favicon.ico +0 -0
- package/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
- package/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
- package/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
- package/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
- package/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
- package/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
- package/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
- package/public/images/img.png +0 -0
- package/public/images/opening-reserve-estimate.png +0 -0
- package/public/images/position-estimate-report.png +0 -0
- package/src/App.vue +131 -0
- package/src/api/announcement.ts +405 -0
- package/src/api/health.ts +13 -0
- package/src/api/pbc-position.ts +178 -0
- package/src/api/rmb-position.ts +233 -0
- package/src/api/tam.ts +173 -0
- package/src/api/user.ts +92 -0
- package/src/auto-imports.d.ts +633 -0
- package/src/components/AppTitleBar.vue +376 -0
- package/src/components.d.ts +33 -0
- package/src/config/config.properties +3 -0
- package/src/config/env.ts +6 -0
- package/src/config/plugin.properties.pro +6 -0
- package/src/config/plugin.properties.test +6 -0
- package/src/core/mxApi/index.ts +451 -0
- package/src/core/request/index.ts +135 -0
- package/src/main.ts +40 -0
- package/src/router/index.ts +144 -0
- package/src/stores/app.ts +103 -0
- package/src/stores/counter.ts +12 -0
- package/src/stores/user.ts +137 -0
- package/src/styles/nprogress.css +22 -0
- package/src/styles/vant-overrides.css +42 -0
- package/src/types/api.d.ts +14 -0
- package/src/types/nprogress.d.ts +8 -0
- package/src/utils/auth-token.ts +241 -0
- package/src/utils/code-highlight.ts +165 -0
- package/src/utils/copy.ts +36 -0
- package/src/utils/query.ts +27 -0
- package/src/utils/request.ts +238 -0
- package/src/utils/rmb-forecast.ts +84 -0
- package/src/utils/toast.ts +61 -0
- package/src/views/article-detail/index.vue +289 -0
- package/src/views/article-edit/index.vue +600 -0
- package/src/views/articles/index.vue +293 -0
- package/src/views/clearing-detail/index.vue +26 -0
- package/src/views/dashboard/index.vue +18 -0
- package/src/views/foreign-position/index.vue +26 -0
- package/src/views/home/index.vue +213 -0
- package/src/views/login/index.vue +275 -0
- package/src/views/mine/index.vue +147 -0
- package/src/views/net-debit/index.vue +26 -0
- package/src/views/opening-reserve-estimate/index.vue +28 -0
- package/src/views/pbc-position/index.vue +357 -0
- package/src/views/position-estimate/index.vue +67 -0
- package/src/views/position-estimate-report/index.vue +28 -0
- package/src/views/rmb-position/index.vue +1013 -0
- package/src/views/rmb-position-create/index.vue +221 -0
- package/src/views/rmb-position-detail/index.vue +355 -0
- package/src/views/settings/index.vue +67 -0
- package/src/views/warning/index.vue +26 -0
- package/tsconfig.app.json +18 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +28 -0
- package/vite.config.ts +100 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// TSConfig for modules that run in Node.js environment via either transpilation or type-stripping.
|
|
2
|
+
{
|
|
3
|
+
"extends": "@tsconfig/node24/tsconfig.json",
|
|
4
|
+
"include": [
|
|
5
|
+
"vite.config.*",
|
|
6
|
+
"plugins/*.ts",
|
|
7
|
+
"vitest.config.*",
|
|
8
|
+
"cypress.config.*",
|
|
9
|
+
"playwright.config.*",
|
|
10
|
+
"eslint.config.*"
|
|
11
|
+
],
|
|
12
|
+
"compilerOptions": {
|
|
13
|
+
// Most tools use transpilation instead of Node.js's native type-stripping.
|
|
14
|
+
// Bundler mode provides a smoother developer experience.
|
|
15
|
+
"module": "preserve",
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
|
+
|
|
18
|
+
// Include Node.js types and avoid accidentally including other `@types/*` packages.
|
|
19
|
+
"types": ["node"],
|
|
20
|
+
|
|
21
|
+
// Disable emitting output during `vue-tsc --build`, which is used for type-checking only.
|
|
22
|
+
"noEmit": true,
|
|
23
|
+
|
|
24
|
+
// `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking.
|
|
25
|
+
// Specified here to keep it out of the root directory.
|
|
26
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
import { readFileSync } from 'node:fs'
|
|
3
|
+
|
|
4
|
+
import { defineConfig, loadEnv } from 'vite'
|
|
5
|
+
import vue from '@vitejs/plugin-vue'
|
|
6
|
+
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
7
|
+
import AutoImport from 'unplugin-auto-import/vite'
|
|
8
|
+
import Components from 'unplugin-vue-components/vite'
|
|
9
|
+
import { VantResolver } from 'unplugin-vue-components/resolvers'
|
|
10
|
+
import { bumpVersion } from './plugins/bump-version'
|
|
11
|
+
|
|
12
|
+
// https://vite.dev/config/
|
|
13
|
+
export default defineConfig(({ command, mode }) => {
|
|
14
|
+
const env = loadEnv(mode, process.cwd(), '')
|
|
15
|
+
const apiBaseUrl = env.VITE_API_BASE_URL || '/api'
|
|
16
|
+
const appVersion = getAppVersion(mode, command)
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
base: './',
|
|
20
|
+
define: {
|
|
21
|
+
__APP_VERSION__: JSON.stringify(appVersion),
|
|
22
|
+
},
|
|
23
|
+
plugins: [
|
|
24
|
+
vue(),
|
|
25
|
+
env.VITE_ENABLE_VUE_DEVTOOLS === 'true' && vueDevTools(),
|
|
26
|
+
|
|
27
|
+
// 自动导入 Vue / Vue Router / Pinia / VueUse / Vant 的 API,省去手动 import
|
|
28
|
+
AutoImport({
|
|
29
|
+
imports: [
|
|
30
|
+
'vue',
|
|
31
|
+
'vue-router',
|
|
32
|
+
'pinia',
|
|
33
|
+
'@vueuse/core',
|
|
34
|
+
{
|
|
35
|
+
vant: ['showDialog', 'showConfirmDialog'],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
dts: 'src/auto-imports.d.ts',
|
|
39
|
+
vueTemplate: true,
|
|
40
|
+
}),
|
|
41
|
+
|
|
42
|
+
// 自动导入组件(Vant 按需加载)
|
|
43
|
+
Components({
|
|
44
|
+
resolvers: [VantResolver()],
|
|
45
|
+
dts: 'src/components.d.ts',
|
|
46
|
+
}),
|
|
47
|
+
|
|
48
|
+
// 打包时自增版本号,并将 plugin.properties 输出到 dist/
|
|
49
|
+
bumpVersion(mode),
|
|
50
|
+
],
|
|
51
|
+
|
|
52
|
+
server: {
|
|
53
|
+
host: '0.0.0.0',
|
|
54
|
+
port: 8080,
|
|
55
|
+
strictPort: true,
|
|
56
|
+
open: true,
|
|
57
|
+
|
|
58
|
+
proxy: {
|
|
59
|
+
'/oms': {
|
|
60
|
+
target: 'http://10.56.183.104:8090',
|
|
61
|
+
changeOrigin: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
resolve: {
|
|
67
|
+
alias: {
|
|
68
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
build: {
|
|
73
|
+
outDir: 'dist/www',
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
function getAppVersion(mode: string, command: 'build' | 'serve') {
|
|
79
|
+
const suffix = mode === 'production' ? 'pro' : 'test'
|
|
80
|
+
const content = readFileSync(`src/config/plugin.properties.${suffix}`, 'utf-8')
|
|
81
|
+
|
|
82
|
+
if (command === 'build') {
|
|
83
|
+
const versionCode = content.match(/version_code=(\d+)/)?.[1]
|
|
84
|
+
|
|
85
|
+
if (versionCode) {
|
|
86
|
+
return toVersionName(Number(versionCode) + 1)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return content.match(/version_name=([^;\n]+)/)?.[1] || '0.0.0'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function toVersionName(versionCode: number) {
|
|
94
|
+
const major = Math.floor(versionCode / 10000)
|
|
95
|
+
const minor = Math.floor((versionCode / 1000) % 10)
|
|
96
|
+
const patch = Math.floor((versionCode / 100) % 10)
|
|
97
|
+
const hotfix = String(versionCode % 100).padStart(2, '0')
|
|
98
|
+
|
|
99
|
+
return `${major}.${minor}.${patch}.${hotfix}`
|
|
100
|
+
}
|