af-mobile-client-vue3 1.2.57 → 1.3.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 (55) hide show
  1. package/.editorconfig +5 -34
  2. package/.env +1 -1
  3. package/.env.development +0 -3
  4. package/.env.production +1 -7
  5. package/build/vite/index.ts +2 -12
  6. package/build/vite/optimize.ts +2 -2
  7. package/compress.js +36 -0
  8. package/package.json +114 -114
  9. package/src/App.vue +3 -5
  10. package/src/assets/img/banner/appraise-banner-1.png +0 -0
  11. package/src/assets/img/banner/appraise-banner-2.png +0 -0
  12. package/src/components/core/BeautifulLoading/index.vue +1 -2
  13. package/src/components/core/ImageUploader/index.vue +3 -2
  14. package/src/components/core/NavBar/index.vue +23 -13
  15. package/src/components/core/Tabbar/index.vue +5 -3
  16. package/src/components/data/XBadge/index.vue +2 -2
  17. package/src/components/data/XCellList/index.vue +20 -66
  18. package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
  19. package/src/components/data/XFormGroup/doc/FormGroupDemo.vue +4 -4
  20. package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
  21. package/src/components/data/XFormGroup/index.vue +11 -1
  22. package/src/components/data/XFormItem/index.vue +2 -22
  23. package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
  24. package/src/components/data/XReportForm/index.vue +23 -14
  25. package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
  26. package/src/components/data/XReportGrid/XReport.vue +3 -3
  27. package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
  28. package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
  29. package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
  30. package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
  31. package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
  32. package/src/components/data/XReportGrid/print.js +184 -184
  33. package/src/components/layout/NormalDataLayout/index.vue +2 -3
  34. package/src/config/routes.ts +6 -2
  35. package/src/constants/index.ts +2 -0
  36. package/src/locales/en-US.json +52 -28
  37. package/src/locales/zh-CN.json +57 -33
  38. package/src/main.ts +0 -2
  39. package/src/router/types.ts +0 -2
  40. package/src/types/vue-router.d.ts +0 -2
  41. package/src/utils/mobileUtil.ts +2 -2
  42. package/src/utils/set-page-title.ts +3 -5
  43. package/src/views/common/LoadError.vue +1 -2
  44. package/src/views/common/NotFound.vue +2 -3
  45. package/src/views/component/XCellListView/index.vue +94 -133
  46. package/src/views/component/XFormGroupView/index.vue +7 -16
  47. package/src/views/component/XFormView/index.vue +15 -95
  48. package/src/views/user/login/LoginForm.vue +3 -3
  49. package/tsconfig.json +5 -8
  50. package/uno.config.ts +32 -1
  51. package/vite.config.ts +3 -3
  52. package/.env.envoiceShow +0 -7
  53. package/src/components/core/App/MicroAppView.vue +0 -59
  54. package/src/components/core/SvgIcon/index.vue +0 -61
  55. package/src/utils/local-storage.ts +0 -9
package/tsconfig.json CHANGED
@@ -8,11 +8,11 @@
8
8
  "module": "esnext",
9
9
  "moduleResolution": "Bundler",
10
10
  "paths": {
11
- "@af-mobile-client-vue3/*": ["src/*"]
11
+ "@af-mobile-client-vue3/*": ["src/*"],
12
+ "~root/*": ["./*"]
12
13
  },
13
14
  "types": [
14
15
  "node",
15
- "unplugin-vue-router/client",
16
16
  "vite-plugin-pwa/client"
17
17
  ],
18
18
  "allowJs": true,
@@ -32,11 +32,8 @@
32
32
  "src/**/*.ts",
33
33
  "src/**/*.tsx",
34
34
  "src/**/*.vue",
35
- "tests/**/*.ts",
36
- "tests/**/*.tsx",
37
- "src/components.d.ts",
38
- "src/auto-imports.d.ts",
39
- "src/typed-router.d.ts",
40
- "tests/*.ts"
35
+ "src/types/components.d.ts",
36
+ "src/types/auto-imports.d.ts",
37
+ "src/types/typed-router.d.ts"
41
38
  ]
42
39
  }
package/uno.config.ts CHANGED
@@ -1,5 +1,7 @@
1
- import { createRemToPxProcessor } from '@unocss/preset-wind4/utils'
1
+ import * as fs from 'node:fs'
2
2
 
3
+ import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
4
+ import { createRemToPxProcessor } from '@unocss/preset-wind4/utils'
3
5
  import {
4
6
  defineConfig,
5
7
  presetAttributify,
@@ -9,8 +11,25 @@ import {
9
11
  transformerVariantGroup,
10
12
  } from 'unocss'
11
13
 
14
+ // 本地 SVG 图标存放目录
15
+ const iconsDir = './src/icons/svg'
16
+
12
17
  const BASE_FONT_SIZE = 4
13
18
 
19
+ // 读取本地 SVG 目录,自动生成 `safelist`
20
+ function generateSafeList() {
21
+ try {
22
+ return fs
23
+ .readdirSync(iconsDir)
24
+ .filter(file => file.endsWith('.svg'))
25
+ .map(file => `i-svg:${file.replace('.svg', '')}`)
26
+ }
27
+ catch (error) {
28
+ console.error('无法读取图标目录:', error)
29
+ return []
30
+ }
31
+ }
32
+
14
33
  export default defineConfig({
15
34
  shortcuts: [
16
35
  ['btn', 'px-6 py-3 rounded-4 border-none inline-block bg-green-400 text-white cursor-pointer outline-hidden hover:bg-green-600 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
@@ -34,9 +53,21 @@ export default defineConfig({
34
53
  'width': 'var(--van-font-size-md)',
35
54
  'height': 'var(--van-font-size-md)',
36
55
  },
56
+ // 注册本地 SVG 图标
57
+ collections: {
58
+ // svg 是图标集合名称,使用 `i-svg:图标名` 调用
59
+ svg: FileSystemIconLoader(iconsDir, (svg) => {
60
+ // 如果 SVG 文件未定义 `fill` 属性,则默认填充 `currentColor`
61
+ // 这样图标颜色会继承文本颜色,方便在不同场景下适配
62
+ return svg.includes('fill="')
63
+ ? svg
64
+ : svg.replace(/^<svg /, '<svg fill="currentColor" ')
65
+ }),
66
+ },
37
67
  },
38
68
  ),
39
69
  ],
70
+ safelist: generateSafeList(), // 动态生成 `safelist`
40
71
  postprocess: [
41
72
  createRemToPxProcessor(BASE_FONT_SIZE),
42
73
  ],
package/vite.config.ts CHANGED
@@ -11,8 +11,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
11
11
 
12
12
  const appProxys = {}
13
13
 
14
- const v4Server = 'http://192.168.50.67:31577'
15
- const v3Server = 'https://wkf.qhgas.com'
14
+ const v4Server = 'http://aote-office.8866.org:31567'
15
+ const v3Server = 'http://aote-office.8866.org:31567'
16
16
  const OSSServerDev = 'http://192.168.50.67:30351'
17
17
  const geoserver = 'http://39.104.49.8:30372'
18
18
  // const OSSServerProd = 'http://192.168.50.67:31351'
@@ -95,7 +95,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
95
95
  build: {
96
96
  cssCodeSplit: false,
97
97
  chunkSizeWarningLimit: 2048,
98
- outDir: env.VITE_APP_OUT_DIR || 'dist',
98
+ outDir: `./dist/${env.VITE_APP_OUT_DIR}`,
99
99
  rollupOptions: {
100
100
  output: {
101
101
  // 打包时分割资源
package/.env.envoiceShow DELETED
@@ -1,7 +0,0 @@
1
- VITE_APP_PUBLIC_PATH=/invoiceShow
2
- VITE_APP_PREVIEW=true
3
- VITE_APP_API_BASE_URL=/api
4
- VITE_APP_WEB_CONFIG_KEY=admin.webconfig
5
- VITE_APP_SYSTEM_NAME=af-system
6
- # 最低兼容性 V4(最新产品)V3(V3产品) OA(公司OA)
7
- VITE_APP_COMPATIBLE=V4
@@ -1,59 +0,0 @@
1
- <script setup lang="ts">
2
- import router from '@af-mobile-client-vue3/router'
3
- import { getAppStatus } from '@micro-zoe/micro-app'
4
- import { ref } from 'vue'
5
- import { useRoute } from 'vue-router'
6
-
7
- const origin = window.location.origin
8
-
9
- const route = useRoute()
10
-
11
- const href = `${origin}/${route.params.module}`
12
-
13
- const state = ref('beforeLoad')
14
-
15
- function created() {
16
- const appStatus = getAppStatus(route.params.module as string)
17
- console.warn('created')
18
- console.warn(appStatus)
19
- // afterhidden代表已经通过keep-alive缓存了,直接显示
20
- if (appStatus === 'afterhidden')
21
- state.value = 'ready'
22
- else if (appStatus === 'unmount' || appStatus === 'error')
23
- router.replace('/404')
24
- }
25
-
26
- function error() {
27
- router.replace('/404')
28
- console.warn('error')
29
- state.value = 'error'
30
- }
31
-
32
- function mounted() {
33
- console.warn('mounted')
34
- state.value = 'ready'
35
- }
36
- </script>
37
-
38
- <template>
39
- <div class="app-wrapper">
40
- <div v-show="state === 'beforeLoad'">
41
- <BeautifulLoading />
42
- </div>
43
- <div v-show="state === 'ready'">
44
- <micro-app
45
- :name="route.params.module" :url="href" iframe keep-alive @created="created"
46
- @mounted="mounted"
47
- @error="error"
48
- />
49
- </div>
50
- </div>
51
- </template>
52
-
53
- <style lang="less" scoped>
54
- .app-wrapper {
55
- position: relative;
56
- height: 100%;
57
- width: 100%;
58
- }
59
- </style>
@@ -1,61 +0,0 @@
1
- <script setup lang="ts">
2
- import { isExternal } from '@af-mobile-client-vue3/utils/validate'
3
- import { computed } from 'vue'
4
-
5
- interface Props {
6
- name: string
7
- className?: string
8
- }
9
- const props = withDefaults(defineProps<Props>(), {
10
- name: '',
11
- className: '',
12
- })
13
-
14
- const isExternalIcon = computed(() => isExternal(props.name))
15
- const iconName = computed(() => `#icon-${props.name}`)
16
- const svgClass = computed(() => {
17
- if (props.className)
18
- return `svg-icon ${props.className}`
19
- else
20
- return 'svg-icon'
21
- })
22
- // 外链 icon
23
- const styleExternalIcon = computed(() => {
24
- return {
25
- 'mask': `url(${props.name}) no-repeat 50% 50%`,
26
- '-webkit-mask': `url(${props.name}) no-repeat 50% 50%`,
27
- }
28
- })
29
- </script>
30
-
31
- <template>
32
- <div
33
- v-if="isExternalIcon"
34
- :style="styleExternalIcon"
35
- class="svg-external-icon svg-icon"
36
- v-bind="$attrs"
37
- />
38
- <svg v-else :class="svgClass" aria-hidden="true" v-bind="$attrs">
39
- <use :xlink:href="iconName" />
40
- </svg>
41
- </template>
42
-
43
- <style scoped>
44
- .svg-icon {
45
- width: 1em;
46
- height: 1em;
47
- vertical-align: -0.15em;
48
- fill: currentColor;
49
- overflow: hidden;
50
- }
51
-
52
- .svg-external-icon {
53
- background-color: currentColor;
54
- mask-size: cover !important;
55
- display: inline-block;
56
- }
57
-
58
- .svg-icon-active-blue {
59
- color: #1989fa;
60
- }
61
- </style>
@@ -1,9 +0,0 @@
1
- import store from 'store'
2
- import expirePlugin from 'store/plugins/expire'
3
-
4
- // plugin usage:
5
- store.addPlugin(expirePlugin)
6
-
7
- export { store as localStorage }
8
-
9
- export default store