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.
Files changed (156) hide show
  1. package/.editorconfig +38 -0
  2. package/.env +7 -0
  3. package/.env.development +4 -0
  4. package/.env.envoiceShow +7 -0
  5. package/.env.production +7 -0
  6. package/.husky/commit-msg +1 -0
  7. package/.husky/pre-commit +1 -0
  8. package/.vscode/extensions.json +7 -0
  9. package/.vscode/settings.json +61 -0
  10. package/LICENSE +21 -0
  11. package/README.md +181 -0
  12. package/af-example-mobile-vue-web.iml +9 -0
  13. package/build/vite/index.ts +91 -0
  14. package/build/vite/vconsole.ts +44 -0
  15. package/eslint.config.js +7 -0
  16. package/index.html +17 -0
  17. package/mock/data.ts +20 -0
  18. package/mock/index.ts +5 -0
  19. package/mock/modules/prose.mock.ts +16 -0
  20. package/mock/modules/user.mock.ts +152 -0
  21. package/netlify.toml +12 -0
  22. package/package.json +107 -0
  23. package/public/favicon-dark.svg +4 -0
  24. package/public/favicon.ico +0 -0
  25. package/public/favicon.svg +4 -0
  26. package/public/pwa-192x192.png +0 -0
  27. package/public/pwa-512x512.png +0 -0
  28. package/public/safari-pinned-tab.svg +32 -0
  29. package/scripts/verifyCommit.js +19 -0
  30. package/src/App.vue +43 -0
  31. package/src/api/mock/index.ts +30 -0
  32. package/src/api/user/index.ts +40 -0
  33. package/src/assets/common/default-user-profile.png +0 -0
  34. package/src/assets/img/apps/apply-web.png +0 -0
  35. package/src/assets/img/apps/example-web.png +0 -0
  36. package/src/assets/img/apps/iot-web.png +0 -0
  37. package/src/assets/img/apps/linepatrol-web.png +0 -0
  38. package/src/assets/img/apps/monitor-web.png +0 -0
  39. package/src/assets/img/apps/oa-web.png +0 -0
  40. package/src/assets/img/apps/revenue-web.png +0 -0
  41. package/src/assets/img/apps/safe-check-web.png +0 -0
  42. package/src/assets/img/component/logo.png +0 -0
  43. package/src/assets/img/home/banner1.png +0 -0
  44. package/src/assets/img/home/banner2.png +0 -0
  45. package/src/assets/img/home/banner3.png +0 -0
  46. package/src/assets/img/home/banner4.png +0 -0
  47. package/src/assets/img/home/notice/icon.png +0 -0
  48. package/src/assets/img/user/login/background-shadow-1.svg +20 -0
  49. package/src/assets/img/user/login/logo-background.svg +20 -0
  50. package/src/assets/img/user/login/logo.png +0 -0
  51. package/src/assets/img/user/my/exit-login.png +0 -0
  52. package/src/assets/img/user/my/setting-arrow.png +0 -0
  53. package/src/assets/img/user/my/setting.png +0 -0
  54. package/src/bootstrap.ts +32 -0
  55. package/src/components/core/App/MicroAppView.vue +59 -0
  56. package/src/components/core/BeautifulLoading/index.vue +47 -0
  57. package/src/components/core/NavBar/index.vue +12 -0
  58. package/src/components/core/SvgIcon/index.vue +61 -0
  59. package/src/components/core/Tabbar/index.vue +38 -0
  60. package/src/components/core/Uploader/index.vue +104 -0
  61. package/src/components/core/XMultiSelect/index.vue +196 -0
  62. package/src/components/core/XSelect/index.vue +130 -0
  63. package/src/components/data/XBadge/index.vue +85 -0
  64. package/src/components/data/XCellDetail/index.vue +106 -0
  65. package/src/components/data/XCellList/index.vue +358 -0
  66. package/src/components/data/XCellListFilter/index.vue +392 -0
  67. package/src/components/data/XForm/index.vue +127 -0
  68. package/src/components/data/XFormItem/index.vue +472 -0
  69. package/src/components/data/XReportForm/XReportFormJsonRender.vue +220 -0
  70. package/src/components/data/XReportForm/index.vue +1058 -0
  71. package/src/components/layout/NormalDataLayout/index.vue +70 -0
  72. package/src/components/layout/TabBarLayout/index.vue +40 -0
  73. package/src/components.d.ts +53 -0
  74. package/src/enums/requestEnum.ts +25 -0
  75. package/src/env.d.ts +16 -0
  76. package/src/font-style/PingFangSC-Regular.woff2 +0 -0
  77. package/src/font-style/font.css +4 -0
  78. package/src/hooks/useCommon.ts +9 -0
  79. package/src/hooks/useLogin.ts +97 -0
  80. package/src/icons/svg/bird.svg +1 -0
  81. package/src/icons/svg/check-in.svg +33 -0
  82. package/src/icons/svg/dark.svg +5 -0
  83. package/src/icons/svg/github.svg +5 -0
  84. package/src/icons/svg/light.svg +5 -0
  85. package/src/icons/svg/link.svg +5 -0
  86. package/src/icons/svg/loadError.svg +1 -0
  87. package/src/icons/svg/notFound.svg +1 -0
  88. package/src/icons/svgo.yml +22 -0
  89. package/src/layout/PageLayout.vue +51 -0
  90. package/src/layout/SingleLayout.vue +35 -0
  91. package/src/locales/en-US.json +25 -0
  92. package/src/locales/zh-CN.json +25 -0
  93. package/src/main.ts +48 -0
  94. package/src/plugins/AppData.ts +38 -0
  95. package/src/plugins/GetLoginInfoService.ts +10 -0
  96. package/src/plugins/index.ts +11 -0
  97. package/src/router/README.md +8 -0
  98. package/src/router/guards.ts +60 -0
  99. package/src/router/index.ts +60 -0
  100. package/src/router/invoiceRoutes.ts +33 -0
  101. package/src/router/routes.ts +84 -0
  102. package/src/services/api/Login.ts +6 -0
  103. package/src/services/api/common.ts +98 -0
  104. package/src/services/api/index.ts +7 -0
  105. package/src/services/api/manage.ts +8 -0
  106. package/src/services/restTools.ts +37 -0
  107. package/src/settings.ts +1 -0
  108. package/src/stores/index.ts +7 -0
  109. package/src/stores/modules/cachedView.ts +31 -0
  110. package/src/stores/modules/counter.ts +19 -0
  111. package/src/stores/modules/routeTransitionName.ts +26 -0
  112. package/src/stores/modules/setting.ts +28 -0
  113. package/src/stores/modules/user.ts +180 -0
  114. package/src/stores/mutation-type.ts +7 -0
  115. package/src/styles/app.less +67 -0
  116. package/src/styles/login.less +81 -0
  117. package/src/typing.ts +3 -0
  118. package/src/utils/Storage.ts +124 -0
  119. package/src/utils/authority-utils.ts +87 -0
  120. package/src/utils/common.ts +41 -0
  121. package/src/utils/crypto.ts +39 -0
  122. package/src/utils/dataUtil.ts +42 -0
  123. package/src/utils/dictUtil.ts +51 -0
  124. package/src/utils/http/index.ts +158 -0
  125. package/src/utils/i18n.ts +41 -0
  126. package/src/utils/indexedDB.ts +180 -0
  127. package/src/utils/local-storage.ts +9 -0
  128. package/src/utils/mobileUtil.ts +26 -0
  129. package/src/utils/progress.ts +19 -0
  130. package/src/utils/routerUtil.ts +271 -0
  131. package/src/utils/set-page-title.ts +7 -0
  132. package/src/utils/validate.ts +6 -0
  133. package/src/views/chat/index.vue +153 -0
  134. package/src/views/common/LoadError.vue +64 -0
  135. package/src/views/common/NotFound.vue +68 -0
  136. package/src/views/component/EvaluateRecordView/index.vue +40 -0
  137. package/src/views/component/XCellDetailView/index.vue +216 -0
  138. package/src/views/component/XCellListView/index.vue +36 -0
  139. package/src/views/component/XFormView/index.vue +478 -0
  140. package/src/views/component/XReportFormIframeView/index.vue +45 -0
  141. package/src/views/component/XReportFormView/index.vue +295 -0
  142. package/src/views/component/index.vue +111 -0
  143. package/src/views/component/menu.vue +117 -0
  144. package/src/views/component/notice.vue +46 -0
  145. package/src/views/component/topNav.vue +36 -0
  146. package/src/views/invoiceShow/index.vue +62 -0
  147. package/src/views/user/login/ForgetPasswordForm.vue +93 -0
  148. package/src/views/user/login/LoginForm.vue +145 -0
  149. package/src/views/user/login/LoginTitle.vue +68 -0
  150. package/src/views/user/login/LoginWave.vue +109 -0
  151. package/src/views/user/login/index.vue +22 -0
  152. package/src/views/user/my/index.vue +230 -0
  153. package/src/vue-router.d.ts +9 -0
  154. package/tsconfig.json +43 -0
  155. package/uno.config.ts +32 -0
  156. 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
+ }