af-mobile-client-vue3 1.1.53 → 1.2.1

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 (70) hide show
  1. package/.env +4 -1
  2. package/.node-version +1 -0
  3. package/.vscode/extensions.json +6 -1
  4. package/.vscode/settings.json +32 -27
  5. package/build/vite/index.ts +29 -29
  6. package/build/vite/optimize.ts +34 -0
  7. package/build/vite/vconsole.ts +5 -2
  8. package/commitlint.config.ts +32 -0
  9. package/eslint.config.ts +30 -0
  10. package/index.html +15 -9
  11. package/mock/data.ts +15 -15
  12. package/mock/index.ts +2 -0
  13. package/mock/modules/prose.mock.ts +5 -8
  14. package/mock/util.ts +19 -0
  15. package/netlify.toml +2 -2
  16. package/package.json +66 -66
  17. package/postcss.config.ts +27 -0
  18. package/public/favicon.ico +0 -0
  19. package/public/pwa-192x192.png +0 -0
  20. package/public/pwa-512x512.png +0 -0
  21. package/public/safari-pinned-tab.svg +3 -31
  22. package/src/App.vue +45 -7
  23. package/src/components/core/ImageUploader/index.vue +159 -159
  24. package/src/components/core/NavBar/index.vue +33 -2
  25. package/src/components/core/Tabbar/index.vue +17 -25
  26. package/src/components/data/XBadge/index.vue +4 -9
  27. package/src/components/data/XCellDetail/index.vue +0 -1
  28. package/src/components/data/XCellList/index.vue +2 -1
  29. package/src/components/data/XFormItem/index.vue +1 -1
  30. package/src/components/data/XOlMap/utils/wgs84ToGcj02.js +154 -154
  31. package/src/composables/dark.ts +5 -0
  32. package/src/config/routes.ts +5 -0
  33. package/src/layout/PageLayout.vue +1 -43
  34. package/src/locales/en-US.json +81 -2
  35. package/src/locales/zh-CN.json +81 -2
  36. package/src/main.ts +6 -6
  37. package/src/router/index.ts +13 -39
  38. package/src/router/routes.ts +6 -4
  39. package/src/stores/index.ts +4 -0
  40. package/src/stores/modules/routeCache.ts +1 -1
  41. package/src/stores/modules/user.ts +11 -10
  42. package/src/styles/app.less +16 -57
  43. package/src/styles/login.less +22 -8
  44. package/src/styles/var.less +16 -0
  45. package/src/{vue-router.d.ts → types/vue-router.d.ts} +2 -0
  46. package/src/utils/i18n.ts +72 -41
  47. package/src/utils/inline-px-to-vw.ts +28 -0
  48. package/src/utils/set-page-title.ts +1 -1
  49. package/src/views/component/XCellListView/index.vue +96 -13
  50. package/src/views/component/XFormGroupView/index.vue +39 -2
  51. package/src/views/component/XFormView/index.vue +9 -30
  52. package/src/views/component/XOlMapView/XLocationPicker/index.vue +118 -118
  53. package/src/views/component/index.vue +36 -6
  54. package/src/views/user/login/LoginForm.vue +6 -6
  55. package/src/views/user/login/LoginTitle.vue +14 -6
  56. package/src/views/user/my/index.vue +17 -14
  57. package/tsconfig.json +0 -1
  58. package/uno.config.ts +39 -24
  59. package/vite.config.ts +7 -29
  60. package/.husky/commit-msg +0 -1
  61. package/.husky/pre-commit +0 -1
  62. package/LICENSE +0 -21
  63. package/eslint.config.js +0 -15
  64. package/mock/modules/demo.mock.ts +0 -20
  65. package/src/components.d.ts +0 -53
  66. package/src/stores/modules/routeTransitionName.ts +0 -26
  67. package/src/typing.ts +0 -3
  68. package/src/views/component/XFormView/oldindex.vue +0 -70
  69. /package/src/{env.d.ts → types/env.d.ts} +0 -0
  70. /package/src/{settings.ts → types/settings.ts} +0 -0
package/vite.config.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  import type { ConfigEnv, UserConfig } from 'vite'
2
2
  import path from 'node:path'
3
3
  import process from 'node:process'
4
- import autoprefixer from 'autoprefixer'
5
- import viewport from 'postcss-mobile-forever'
6
4
  import { loadEnv } from 'vite'
7
5
  import { createVitePlugins } from './build/vite'
6
+ import { exclude, include } from './build/vite/optimize'
8
7
 
9
- // import fs from 'fs'
10
8
  export default ({ mode }: ConfigEnv): UserConfig => {
11
9
  const root = process.cwd()
12
10
  const env = loadEnv(mode, root)
@@ -21,17 +19,11 @@ export default ({ mode }: ConfigEnv): UserConfig => {
21
19
 
22
20
  return {
23
21
  base: env.VITE_APP_PUBLIC_PATH,
24
- plugins: [
25
- createVitePlugins(),
26
- ],
22
+ plugins: createVitePlugins(mode),
27
23
 
28
24
  server: {
29
25
  host: true,
30
26
  port: 7190,
31
- // https: {
32
- // key: fs.readFileSync('certs/127.0.0.1+2-key.pem'),
33
- // cert: fs.readFileSync('certs/127.0.0.1+2.pem')
34
- // },
35
27
  proxy: Object.assign({
36
28
  '/api/af-system/resource': {
37
29
  target: v4Server,
@@ -83,33 +75,17 @@ export default ({ mode }: ConfigEnv): UserConfig => {
83
75
 
84
76
  resolve: {
85
77
  alias: {
86
- '~@': path.join(__dirname, './src'),
87
78
  '@': path.join(__dirname, './src'),
88
79
  '~': path.join(__dirname, './src/assets'),
80
+ '~root': path.join(__dirname, '.'),
89
81
  '@af-mobile-client-vue3': path.join(__dirname, './src'),
90
82
  },
91
83
  },
92
84
 
93
- css: {
94
- // postcss 官网:www.postcss.com.cn/
95
- postcss: {
96
- plugins: [
97
- // 自动获取浏览器的流行度和能够支持的属性,并为 CSS 规则添加前缀
98
- autoprefixer(),
99
- viewport({
100
- appSelector: '#system-app',
101
- viewportWidth: 375,
102
- maxDisplayWidth: 800,
103
- appContainingBlock: 'auto',
104
- necessarySelectorWhenAuto: '.app-wrapper',
105
- rootContainingBlockSelectorList: ['van-tabbar', 'van-popup'],
106
- }),
107
- ],
108
- },
109
- },
110
-
111
85
  build: {
86
+ cssCodeSplit: false,
112
87
  chunkSizeWarningLimit: 2048,
88
+ outDir: env.VITE_APP_OUT_DIR || 'dist',
113
89
  rollupOptions: {
114
90
  output: {
115
91
  // 打包时分割资源
@@ -126,5 +102,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
126
102
  },
127
103
  },
128
104
  },
105
+
106
+ optimizeDeps: { include, exclude },
129
107
  }
130
108
  }
package/.husky/commit-msg DELETED
@@ -1 +0,0 @@
1
- node scripts/verifyCommit.js
package/.husky/pre-commit DELETED
@@ -1 +0,0 @@
1
- pnpm lint
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Charlie Wang
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/eslint.config.js DELETED
@@ -1,15 +0,0 @@
1
- import antfu from '@antfu/eslint-config'
2
-
3
- export default antfu({
4
- // enable UnoCSS support
5
- // https://unocss.dev/integrations/vscode
6
- ignorePatterns: ['package.json'],
7
- // 禁用对 package.json 中键排序的检查
8
- rules: {
9
- 'jsonc/sort-keys': 'off',
10
- 'imports/no-unused-vars': 'off',
11
- 'ts/no-unsafe-function-type': 'off',
12
- 'unused-imports/no-unused-vars': 'off',
13
- 'no-console': ['error', { allow: ['warn', 'error', 'log', 'info'] }],
14
- },
15
- })
@@ -1,20 +0,0 @@
1
- // https://github.com/pengzhanbo/vite-plugin-mock-dev-server
2
- import { defineMock } from 'vite-plugin-mock-dev-server'
3
-
4
- export default defineMock([
5
- {
6
- url: '/api/demo/post',
7
- method: 'POST',
8
- body: (params) => {
9
- return {
10
- code: 200,
11
- msg: '操作成功',
12
- data: {
13
- ...params,
14
- id: Math.floor(Math.random() * 1000),
15
- timestamp: new Date().toISOString(),
16
- },
17
- }
18
- },
19
- },
20
- ])
@@ -1,53 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- // @ts-nocheck
4
- // Generated by unplugin-vue-components
5
- // Read more: https://github.com/vuejs/core/pull/3399
6
- export {}
7
-
8
- declare module 'vue' {
9
- export interface GlobalComponents {
10
- BeautifulLoading: typeof import('./components/core/BeautifulLoading/index.vue')['default']
11
- MicroAppView: typeof import('./components/core/App/MicroAppView.vue')['default']
12
- NavBar: typeof import('./components/core/NavBar/index.vue')['default']
13
- NormalDataLayout: typeof import('./components/layout/NormalDataLayout/index.vue')['default']
14
- RouterLink: typeof import('vue-router')['RouterLink']
15
- RouterView: typeof import('vue-router')['RouterView']
16
- SvgIcon: typeof import('./components/core/SvgIcon/index.vue')['default']
17
- Tabbar: typeof import('./components/core/Tabbar/index.vue')['default']
18
- TabBarLayout: typeof import('./components/layout/TabBarLayout/index.vue')['default']
19
- Uploader: typeof import('./components/core/Uploader/index.vue')['default']
20
- VanArea: typeof import('vant/es')['Area']
21
- VanButton: typeof import('vant/es')['Button']
22
- VanCalendar: typeof import('vant/es')['Calendar']
23
- VanCell: typeof import('vant/es')['Cell']
24
- VanCellGroup: typeof import('vant/es')['CellGroup']
25
- VanCheckbox: typeof import('vant/es')['Checkbox']
26
- VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
27
- VanDatePicker: typeof import('vant/es')['DatePicker']
28
- VanField: typeof import('vant/es')['Field']
29
- VanForm: typeof import('vant/es')['Form']
30
- VanLoading: typeof import('vant/es')['Loading']
31
- VanNavBar: typeof import('vant/es')['NavBar']
32
- VanPicker: typeof import('vant/es')['Picker']
33
- VanPopup: typeof import('vant/es')['Popup']
34
- VanRadio: typeof import('vant/es')['Radio']
35
- VanRadioGroup: typeof import('vant/es')['RadioGroup']
36
- VanRate: typeof import('vant/es')['Rate']
37
- VanRow: typeof import('vant/es')['Row']
38
- VanSlider: typeof import('vant/es')['Slider']
39
- VanSpace: typeof import('vant/es')['Space']
40
- VanStepper: typeof import('vant/es')['Stepper']
41
- VanSwitch: typeof import('vant/es')['Switch']
42
- VanTimePicker: typeof import('vant/es')['TimePicker']
43
- XBadge: typeof import('./components/data/XBadge/index.vue')['default']
44
- XCellDetail: typeof import('./components/data/XCellDetail/index.vue')['default']
45
- XCellList: typeof import('./components/data/XCellList/index.vue')['default']
46
- XForm: typeof import('./components/data/XForm/index.vue')['default']
47
- XFormItem: typeof import('./components/data/XFormItem/index.vue')['default']
48
- XMultiSelect: typeof import('./components/core/XMultiSelect/index.vue')['default']
49
- XReportForm: typeof import('./components/data/XReportForm/index.vue')['default']
50
- XReportFormJsonRender: typeof import('./components/data/XReportForm/XReportFormJsonRender.vue')['default']
51
- XSelect: typeof import('./components/core/XSelect/index.vue')['default']
52
- }
53
- }
@@ -1,26 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- const useRouteTransitionNameStore = defineStore('route-transition-name', () => {
5
- // 过渡动画名称
6
- const routeTransitionName = ref('')
7
- // homeLayout动画名称
8
- const routeTransitionHomeName = ref('')
9
-
10
- const setName = (name: string) => {
11
- routeTransitionName.value = name
12
- }
13
-
14
- const setHomeName = (name: string) => {
15
- routeTransitionHomeName.value = name
16
- }
17
-
18
- return {
19
- routeTransitionName,
20
- routeTransitionHomeName,
21
- setName,
22
- setHomeName,
23
- }
24
- })
25
-
26
- export default useRouteTransitionNameStore
package/src/typing.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Ref } from 'vue'
2
-
3
- export type MaybeRef<T> = T | Ref<T>
@@ -1,70 +0,0 @@
1
- <script setup lang="ts">
2
- import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
- import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
5
- import { onBeforeMount, ref, toRaw } from 'vue'
6
-
7
- const configName = ref('AddConstructionForm')
8
- const serviceName = ref('af-linepatrol')
9
- const formGroup = ref(null)
10
- const formConfig = ref(null)
11
- const submitSimple = ref(null)
12
- const isLoading = ref(true)
13
-
14
- function safeStringify(obj) {
15
- const seen = new WeakSet()
16
- return JSON.stringify(toRaw(obj), (key, val) => {
17
- if (typeof val === 'object' && val !== null) {
18
- if (seen.has(val))
19
- return
20
- seen.add(val)
21
- }
22
- return val
23
- }, 2)
24
- }
25
-
26
- function submit(result) {
27
- console.log('>>>> result: ', safeStringify(result))
28
- }
29
-
30
- function loadConfig() {
31
- return new Promise((resolve) => {
32
- getConfigByName(configName.value, (result) => {
33
- submitSimple.value = result.showSubmitBtn
34
- formConfig.value = result
35
- resolve(result)
36
- }, serviceName.value)
37
- })
38
- }
39
-
40
- onBeforeMount(async () => {
41
- try {
42
- await loadConfig()
43
- }
44
- finally {
45
- isLoading.value = false
46
- }
47
- })
48
- </script>
49
-
50
- <template>
51
- <NormalDataLayout id="XFormGroupView" title="纯表单">
52
- <template #layout_content>
53
- <van-loading v-if="isLoading" />
54
- <XForm
55
- v-else
56
- ref="formGroup"
57
- mode="查询"
58
- :service-name="serviceName"
59
- :group-form-items="formConfig"
60
- :form-data="{}"
61
- :form-name="formConfig?.groupName || '11111'"
62
- :submit-button="submitSimple"
63
- @on-submit="submit"
64
- />
65
- </template>
66
- </NormalDataLayout>
67
- </template>
68
-
69
- <style scoped lang="less">
70
- </style>
File without changes
File without changes