af-mobile-client-vue3 1.0.54
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 +38 -0
- package/.env +7 -0
- package/.env.development +4 -0
- package/.env.envoiceShow +7 -0
- package/.env.production +7 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.vscode/extensions.json +7 -0
- package/.vscode/settings.json +61 -0
- package/LICENSE +21 -0
- package/README.md +181 -0
- package/af-example-mobile-vue-web.iml +9 -0
- package/build/vite/index.ts +91 -0
- package/build/vite/vconsole.ts +44 -0
- package/eslint.config.js +7 -0
- package/index.html +17 -0
- package/mock/data.ts +20 -0
- package/mock/index.ts +5 -0
- package/mock/modules/prose.mock.ts +16 -0
- package/mock/modules/user.mock.ts +152 -0
- package/netlify.toml +12 -0
- package/package.json +107 -0
- package/public/favicon-dark.svg +4 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +4 -0
- package/public/pwa-192x192.png +0 -0
- package/public/pwa-512x512.png +0 -0
- package/public/safari-pinned-tab.svg +32 -0
- package/scripts/verifyCommit.js +19 -0
- package/src/App.vue +43 -0
- package/src/api/mock/index.ts +30 -0
- package/src/api/user/index.ts +40 -0
- package/src/assets/common/default-user-profile.png +0 -0
- package/src/assets/img/apps/apply-web.png +0 -0
- package/src/assets/img/apps/example-web.png +0 -0
- package/src/assets/img/apps/iot-web.png +0 -0
- package/src/assets/img/apps/linepatrol-web.png +0 -0
- package/src/assets/img/apps/monitor-web.png +0 -0
- package/src/assets/img/apps/oa-web.png +0 -0
- package/src/assets/img/apps/revenue-web.png +0 -0
- package/src/assets/img/apps/safe-check-web.png +0 -0
- package/src/assets/img/component/logo.png +0 -0
- package/src/assets/img/home/banner1.png +0 -0
- package/src/assets/img/home/banner2.png +0 -0
- package/src/assets/img/home/banner3.png +0 -0
- package/src/assets/img/home/banner4.png +0 -0
- package/src/assets/img/home/notice/icon.png +0 -0
- package/src/assets/img/user/login/background-shadow-1.svg +20 -0
- package/src/assets/img/user/login/logo-background.svg +20 -0
- package/src/assets/img/user/login/logo.png +0 -0
- package/src/assets/img/user/my/exit-login.png +0 -0
- package/src/assets/img/user/my/setting-arrow.png +0 -0
- package/src/assets/img/user/my/setting.png +0 -0
- package/src/bootstrap.ts +32 -0
- package/src/components/core/App/MicroAppView.vue +59 -0
- package/src/components/core/BeautifulLoading/index.vue +47 -0
- package/src/components/core/NavBar/index.vue +12 -0
- package/src/components/core/SvgIcon/index.vue +61 -0
- package/src/components/core/Tabbar/index.vue +38 -0
- package/src/components/core/Uploader/index.vue +104 -0
- package/src/components/core/XMultiSelect/index.vue +196 -0
- package/src/components/core/XSelect/index.vue +130 -0
- package/src/components/data/XBadge/index.vue +85 -0
- package/src/components/data/XCellDetail/index.vue +106 -0
- package/src/components/data/XCellList/index.vue +358 -0
- package/src/components/data/XCellListFilter/index.vue +392 -0
- package/src/components/data/XForm/index.vue +127 -0
- package/src/components/data/XFormItem/index.vue +472 -0
- package/src/components/data/XReportForm/XReportFormJsonRender.vue +220 -0
- package/src/components/data/XReportForm/index.vue +1058 -0
- package/src/components/layout/NormalDataLayout/index.vue +70 -0
- package/src/components/layout/TabBarLayout/index.vue +40 -0
- package/src/components.d.ts +53 -0
- package/src/enums/requestEnum.ts +25 -0
- package/src/env.d.ts +16 -0
- package/src/font-style/PingFangSC-Regular.woff2 +0 -0
- package/src/font-style/font.css +4 -0
- package/src/hooks/useCommon.ts +9 -0
- package/src/hooks/useLogin.ts +97 -0
- package/src/icons/svg/bird.svg +1 -0
- package/src/icons/svg/check-in.svg +33 -0
- package/src/icons/svg/dark.svg +5 -0
- package/src/icons/svg/github.svg +5 -0
- package/src/icons/svg/light.svg +5 -0
- package/src/icons/svg/link.svg +5 -0
- package/src/icons/svg/loadError.svg +1 -0
- package/src/icons/svg/notFound.svg +1 -0
- package/src/icons/svgo.yml +22 -0
- package/src/layout/PageLayout.vue +51 -0
- package/src/layout/SingleLayout.vue +35 -0
- package/src/locales/en-US.json +25 -0
- package/src/locales/zh-CN.json +25 -0
- package/src/main.ts +48 -0
- package/src/plugins/AppData.ts +38 -0
- package/src/plugins/GetLoginInfoService.ts +10 -0
- package/src/plugins/index.ts +11 -0
- package/src/router/README.md +8 -0
- package/src/router/guards.ts +60 -0
- package/src/router/index.ts +60 -0
- package/src/router/invoiceRoutes.ts +33 -0
- package/src/router/routes.ts +84 -0
- package/src/services/api/Login.ts +6 -0
- package/src/services/api/common.ts +98 -0
- package/src/services/api/index.ts +7 -0
- package/src/services/api/manage.ts +8 -0
- package/src/services/restTools.ts +37 -0
- package/src/settings.ts +1 -0
- package/src/stores/index.ts +7 -0
- package/src/stores/modules/cachedView.ts +31 -0
- package/src/stores/modules/counter.ts +19 -0
- package/src/stores/modules/routeTransitionName.ts +26 -0
- package/src/stores/modules/setting.ts +28 -0
- package/src/stores/modules/user.ts +180 -0
- package/src/stores/mutation-type.ts +7 -0
- package/src/styles/app.less +67 -0
- package/src/styles/login.less +81 -0
- package/src/typing.ts +3 -0
- package/src/utils/Storage.ts +124 -0
- package/src/utils/authority-utils.ts +87 -0
- package/src/utils/common.ts +41 -0
- package/src/utils/crypto.ts +39 -0
- package/src/utils/dataUtil.ts +42 -0
- package/src/utils/dictUtil.ts +51 -0
- package/src/utils/http/index.ts +158 -0
- package/src/utils/i18n.ts +41 -0
- package/src/utils/indexedDB.ts +180 -0
- package/src/utils/local-storage.ts +9 -0
- package/src/utils/mobileUtil.ts +26 -0
- package/src/utils/progress.ts +19 -0
- package/src/utils/routerUtil.ts +271 -0
- package/src/utils/set-page-title.ts +7 -0
- package/src/utils/validate.ts +6 -0
- package/src/views/chat/index.vue +153 -0
- package/src/views/common/LoadError.vue +64 -0
- package/src/views/common/NotFound.vue +68 -0
- package/src/views/component/EvaluateRecordView/index.vue +40 -0
- package/src/views/component/XCellDetailView/index.vue +216 -0
- package/src/views/component/XCellListView/index.vue +36 -0
- package/src/views/component/XFormView/index.vue +478 -0
- package/src/views/component/XReportFormIframeView/index.vue +45 -0
- package/src/views/component/XReportFormView/index.vue +295 -0
- package/src/views/component/index.vue +111 -0
- package/src/views/component/menu.vue +117 -0
- package/src/views/component/notice.vue +46 -0
- package/src/views/component/topNav.vue +36 -0
- package/src/views/invoiceShow/index.vue +62 -0
- package/src/views/user/login/ForgetPasswordForm.vue +93 -0
- package/src/views/user/login/LoginForm.vue +145 -0
- package/src/views/user/login/LoginTitle.vue +68 -0
- package/src/views/user/login/LoginWave.vue +109 -0
- package/src/views/user/login/index.vue +22 -0
- package/src/views/user/my/index.vue +230 -0
- package/src/vue-router.d.ts +9 -0
- package/tsconfig.json +43 -0
- package/uno.config.ts +32 -0
- package/vite.config.ts +110 -0
package/tsconfig.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"jsx": "preserve",
|
|
5
|
+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
|
|
6
|
+
"experimentalDecorators": true,
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"module": "esnext",
|
|
9
|
+
"moduleResolution": "Bundler",
|
|
10
|
+
"paths": {
|
|
11
|
+
"@af-mobile-client-vue3/*": ["src/*"]
|
|
12
|
+
},
|
|
13
|
+
"types": [
|
|
14
|
+
"node",
|
|
15
|
+
"unplugin-vue-router/client",
|
|
16
|
+
"vite-plugin-vue-layouts/client",
|
|
17
|
+
"vite-plugin-pwa/client"
|
|
18
|
+
],
|
|
19
|
+
"allowJs": true,
|
|
20
|
+
"strictNullChecks": false,
|
|
21
|
+
"noImplicitAny": false,
|
|
22
|
+
"noUnusedLocals": false,
|
|
23
|
+
"noUnusedParameters": false,
|
|
24
|
+
"importHelpers": true,
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"allowSyntheticDefaultImports": true,
|
|
27
|
+
"esModuleInterop": true,
|
|
28
|
+
"verbatimModuleSyntax": true,
|
|
29
|
+
"skipLibCheck": true
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"src/App.vue",
|
|
33
|
+
"src/**/*.ts",
|
|
34
|
+
"src/**/*.tsx",
|
|
35
|
+
"src/**/*.vue",
|
|
36
|
+
"tests/**/*.ts",
|
|
37
|
+
"tests/**/*.tsx",
|
|
38
|
+
"src/components.d.ts",
|
|
39
|
+
"src/auto-imports.d.ts",
|
|
40
|
+
"src/typed-router.d.ts",
|
|
41
|
+
"tests/*.ts"
|
|
42
|
+
]
|
|
43
|
+
}
|
package/uno.config.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineConfig, presetAttributify, presetMini, presetUno } from 'unocss'
|
|
2
|
+
import presetRemToPx from '@unocss/preset-rem-to-px'
|
|
3
|
+
|
|
4
|
+
// 刚使用unocss的朋友,可以借助这个工具: https://to-unocss.netlify.app
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
presets: [
|
|
8
|
+
presetUno,
|
|
9
|
+
presetAttributify,
|
|
10
|
+
// 为什么要用到这个插件?
|
|
11
|
+
// 模板使用 viewport 作为移动端适配方案,unocss 默认单位为 rem
|
|
12
|
+
// 所以需要转成 px,然后由 postcss 把 px 转成 vw/vh,完成适配
|
|
13
|
+
presetRemToPx({
|
|
14
|
+
// 这里为什么要设置基础字体大小?看下面这篇文章
|
|
15
|
+
// https://juejin.cn/post/7262975395620618298
|
|
16
|
+
baseFontSize: 4,
|
|
17
|
+
}),
|
|
18
|
+
presetMini({
|
|
19
|
+
dark: {
|
|
20
|
+
dark: '.van-theme-dark',
|
|
21
|
+
light: '.van-theme-light',
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
shortcuts: {
|
|
26
|
+
// shortcuts to multiple utilities
|
|
27
|
+
'btn': 'py-2 px-4 font-semibold rounded-lg shadow-md',
|
|
28
|
+
'btn-green': 'text-white bg-green-500 hover:bg-green-700',
|
|
29
|
+
'btn-blue': 'text-white bg-blue-500 hover:bg-blue-700',
|
|
30
|
+
'centered': 'absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2',
|
|
31
|
+
},
|
|
32
|
+
})
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import process from 'node:process'
|
|
3
|
+
import { loadEnv } from 'vite'
|
|
4
|
+
import type { ConfigEnv, UserConfig } from 'vite'
|
|
5
|
+
import viewport from 'postcss-mobile-forever'
|
|
6
|
+
import autoprefixer from 'autoprefixer'
|
|
7
|
+
import { createVitePlugins } from './build/vite'
|
|
8
|
+
|
|
9
|
+
export default ({ mode }: ConfigEnv): UserConfig => {
|
|
10
|
+
const root = process.cwd()
|
|
11
|
+
const env = loadEnv(mode, root)
|
|
12
|
+
|
|
13
|
+
const appProxys = {}
|
|
14
|
+
|
|
15
|
+
const v4Server = 'http://192.168.50.67:31567'
|
|
16
|
+
const v3Server = 'http://123.60.214.109:8406'
|
|
17
|
+
const OSSServerDev = 'http://192.168.50.67:30351'
|
|
18
|
+
// const OSSServerProd = 'http://192.168.50.67:31351'
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
base: env.VITE_APP_PUBLIC_PATH,
|
|
22
|
+
plugins: createVitePlugins(),
|
|
23
|
+
|
|
24
|
+
server: {
|
|
25
|
+
host: true,
|
|
26
|
+
port: 7190,
|
|
27
|
+
proxy: Object.assign({
|
|
28
|
+
'/api/af-system/resource': {
|
|
29
|
+
target: v4Server,
|
|
30
|
+
ws: false,
|
|
31
|
+
changeOrigin: true,
|
|
32
|
+
},
|
|
33
|
+
'/api/invoice': {
|
|
34
|
+
target: 'http://219.153.176.6:8400/',
|
|
35
|
+
rewrite: (path: string) => path.replace(/^\/api\//, '/'),
|
|
36
|
+
ws: false,
|
|
37
|
+
changeOrigin: true,
|
|
38
|
+
},
|
|
39
|
+
'/api/af-system/entity/t_files': {
|
|
40
|
+
target: v3Server,
|
|
41
|
+
ws: false,
|
|
42
|
+
changeOrigin: true,
|
|
43
|
+
},
|
|
44
|
+
'/resource': {
|
|
45
|
+
// pathRewrite: { '^/resource': '/' },
|
|
46
|
+
target: v4Server,
|
|
47
|
+
changeOrigin: true,
|
|
48
|
+
},
|
|
49
|
+
'/api': {
|
|
50
|
+
// v3用
|
|
51
|
+
// rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),
|
|
52
|
+
target: v4Server,
|
|
53
|
+
ws: false,
|
|
54
|
+
changeOrigin: true,
|
|
55
|
+
},
|
|
56
|
+
'/oss': {
|
|
57
|
+
target: OSSServerDev,
|
|
58
|
+
rewrite: (path: string) => path.replace(/^\/oss\//, '/'),
|
|
59
|
+
changeOrigin: true,
|
|
60
|
+
},
|
|
61
|
+
}, appProxys),
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
resolve: {
|
|
65
|
+
alias: {
|
|
66
|
+
'~@': path.join(__dirname, './src'),
|
|
67
|
+
'@': path.join(__dirname, './src'),
|
|
68
|
+
'~': path.join(__dirname, './src/assets'),
|
|
69
|
+
'@af-mobile-client-vue3': path.join(__dirname, './src'),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
css: {
|
|
74
|
+
// postcss 官网:www.postcss.com.cn/
|
|
75
|
+
postcss: {
|
|
76
|
+
plugins: [
|
|
77
|
+
// 自动获取浏览器的流行度和能够支持的属性,并为 CSS 规则添加前缀
|
|
78
|
+
autoprefixer(),
|
|
79
|
+
viewport({
|
|
80
|
+
appSelector: '#system-app',
|
|
81
|
+
viewportWidth: 375,
|
|
82
|
+
maxDisplayWidth: 600,
|
|
83
|
+
appContainingBlock: 'auto',
|
|
84
|
+
necessarySelectorWhenAuto: '.app-wrapper',
|
|
85
|
+
rootContainingBlockSelectorList: ['van-tabbar', 'van-popup'],
|
|
86
|
+
}),
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
build: {
|
|
92
|
+
chunkSizeWarningLimit: 2048,
|
|
93
|
+
rollupOptions: {
|
|
94
|
+
output: {
|
|
95
|
+
// 打包时分割资源
|
|
96
|
+
chunkFileNames: 'static/js/[name]-[hash].js',
|
|
97
|
+
entryFileNames: 'static/js/[name]-[hash].js',
|
|
98
|
+
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
|
|
99
|
+
manualChunks(id) {
|
|
100
|
+
if (id.includes('node_modules'))
|
|
101
|
+
return 'third' // 代码分割为第三方包
|
|
102
|
+
|
|
103
|
+
if (id.includes('views'))
|
|
104
|
+
return 'views' // 代码分割为业务视图
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
}
|