af-mobile-client-vue3 1.2.59 → 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 (53) 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 +10 -10
  18. package/src/components/data/XFormGroup/doc/FormGroupDemo.vue +4 -4
  19. package/src/components/data/XFormGroup/index.vue +11 -1
  20. package/src/components/data/XFormItem/index.vue +2 -22
  21. package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
  22. package/src/components/data/XReportForm/index.vue +23 -14
  23. package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
  24. package/src/components/data/XReportGrid/XReport.vue +3 -3
  25. package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
  26. package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
  27. package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
  28. package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
  29. package/src/components/layout/NormalDataLayout/index.vue +2 -3
  30. package/src/config/routes.ts +6 -2
  31. package/src/constants/index.ts +2 -0
  32. package/src/locales/en-US.json +52 -28
  33. package/src/locales/zh-CN.json +57 -33
  34. package/src/main.ts +0 -2
  35. package/src/router/routes.ts +0 -6
  36. package/src/router/types.ts +0 -2
  37. package/src/types/vue-router.d.ts +0 -2
  38. package/src/utils/mobileUtil.ts +2 -2
  39. package/src/utils/queryFormDefaultRangePicker.ts +57 -57
  40. package/src/utils/set-page-title.ts +3 -5
  41. package/src/views/common/LoadError.vue +1 -2
  42. package/src/views/common/NotFound.vue +2 -3
  43. package/src/views/component/XCellListView/index.vue +23 -72
  44. package/src/views/component/XFormGroupView/index.vue +7 -11
  45. package/src/views/component/XFormView/index.vue +2 -2
  46. package/tsconfig.json +5 -8
  47. package/uno.config.ts +32 -1
  48. package/vite.config.ts +1 -1
  49. package/.env.envoiceShow +0 -7
  50. package/src/components/core/App/MicroAppView.vue +0 -59
  51. package/src/components/core/SvgIcon/index.vue +0 -61
  52. package/src/utils/local-storage.ts +0 -9
  53. package/src/views/component/XFormGroupView/xformgroup222.vue +0 -97
package/.editorconfig CHANGED
@@ -1,38 +1,9 @@
1
+ root=true
2
+
1
3
  [*]
2
4
  charset=utf-8
3
- end_of_line=lf
4
- insert_final_newline=false
5
- indent_style=space
6
- indent_size=2
7
-
8
- [{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}]
9
- indent_style=space
10
- indent_size=2
11
-
12
- [{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}]
13
- indent_style=space
14
- indent_size=2
15
-
16
- [{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}]
17
- indent_style=space
18
- indent_size=2
19
-
20
- [*.svg]
21
- indent_style=space
22
- indent_size=2
23
-
24
- [*.js.map]
25
- indent_style=space
26
- indent_size=2
27
-
28
- [*.less]
29
- indent_style=space
30
- indent_size=2
31
-
32
- [{*.vue,*.ts,*.tsx}]
33
- indent_style=space
34
- indent_size=2
35
-
36
- [{.analysis_options,*.yml,*.yaml}]
37
5
  indent_style=space
38
6
  indent_size=2
7
+ end_of_line=lf
8
+ insert_final_newline=true
9
+ trim_trailing_whitespace=true
package/.env CHANGED
@@ -1,7 +1,7 @@
1
1
  VITE_APP_PUBLIC_PATH=/vue-client-app
2
2
  VITE_APP_PREVIEW=true
3
3
  VITE_APP_API_BASE_URL=/api
4
- VITE_APP_OUT_DIR=dist
4
+ VITE_APP_OUT_DIR=dist_af-library-mobile-web
5
5
  VITE_APP_VCONSOLE=false
6
6
  # 自定义参数
7
7
  VITE_APP_WEB_CONFIG_KEY=admin.webconfig
package/.env.development CHANGED
@@ -1,4 +1 @@
1
1
  NODE_ENV=development
2
- VITE_APP_PUBLIC_PATH=/vue-client-app
3
- VITE_APP_PREVIEW=true
4
- VITE_APP_API_BASE_URL=/api
package/.env.production CHANGED
@@ -1,7 +1 @@
1
- VITE_APP_PUBLIC_PATH=/vue-client-app
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
+ VITE_APP_PREVIEW=false
@@ -1,4 +1,4 @@
1
- import path, { dirname, resolve } from 'node:path'
1
+ import { dirname, resolve } from 'node:path'
2
2
 
3
3
  import process from 'node:process'
4
4
  import { fileURLToPath } from 'node:url'
@@ -11,12 +11,10 @@ import viteCompression from 'vite-plugin-compression'
11
11
  import { mockDevServerPlugin } from 'vite-plugin-mock-dev-server'
12
12
  import { VitePWA } from 'vite-plugin-pwa'
13
13
  import Sitemap from 'vite-plugin-sitemap'
14
- import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
15
14
  import VueDevTools from 'vite-plugin-vue-devtools'
16
15
  import { createViteVConsole } from './vconsole'
17
16
 
18
17
  export function createVitePlugins(mode: string) {
19
- const root = process.cwd()
20
18
  const env = loadEnv(mode, process.cwd())
21
19
 
22
20
  return [
@@ -31,20 +29,12 @@ export function createVitePlugins(mode: string) {
31
29
 
32
30
  // https://github.com/jbaubree/vite-plugin-sitemap
33
31
  Sitemap({
34
- outDir: env.VITE_APP_OUT_DIR || 'dist',
32
+ outDir: `./dist/${env.VITE_APP_OUT_DIR}`,
35
33
  }),
36
34
 
37
35
  // https://github.com/pengzhanbo/vite-plugin-mock-dev-server
38
36
  mockDevServerPlugin(),
39
37
 
40
- // TODO 放到统一icons处理,移除该插件
41
- createSvgIconsPlugin({
42
- // 指定图标文件夹
43
- iconDirs: [path.resolve(root, 'src/icons/svg')],
44
- // 指定 symbolId 格式
45
- symbolId: 'icon-[dir]-[name]',
46
- }),
47
-
48
38
  // 生产环境 gzip 压缩资源
49
39
  viteCompression({
50
40
  algorithm: 'gzip',
@@ -20,10 +20,10 @@ const include = [
20
20
  'vant/es/notify/style/index',
21
21
  'vant/es/config-provider/style/index',
22
22
  'vant/es/nav-bar/style/index',
23
- 'vant/es/list/style/index',
24
- 'vant/es/text-ellipsis/style/index',
25
23
  'vant/es/tabbar/style/index',
26
24
  'vant/es/tabbar-item/style/index',
25
+ 'vant/es/list/style/index',
26
+ 'vant/es/text-ellipsis/style/index',
27
27
  ]
28
28
 
29
29
  const exclude = [
package/compress.js ADDED
@@ -0,0 +1,36 @@
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+ import * as tar from 'tar'
5
+
6
+ // 当前文件所在目录
7
+ const __filename = fileURLToPath(import.meta.url)
8
+ const __dirname = path.dirname(__filename)
9
+
10
+ // 压缩源目录名(即 build 后生成的目录名)
11
+ const outputName = `dist_af-library-mobile-web`
12
+
13
+ // 源目录路径
14
+ const cwd = path.join(__dirname, 'dist', outputName)
15
+
16
+ // 输出 tar.gz 文件路径
17
+ const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
18
+
19
+ if (!fs.existsSync(cwd)) {
20
+ console.error('❌ 目录不存在:', cwd)
21
+ // eslint-disable-next-line node/prefer-global/process
22
+ process.exit(1)
23
+ }
24
+
25
+ tar.c(
26
+ {
27
+ gzip: true,
28
+ file: outputPath,
29
+ cwd,
30
+ },
31
+ ['.'],
32
+ ).then(() => {
33
+ console.log(`✅ 压缩完成: ${outputPath}`)
34
+ }).catch((err) => {
35
+ console.error('❌ 压缩失败:', err)
36
+ })
package/package.json CHANGED
@@ -1,114 +1,114 @@
1
- {
2
- "name": "af-mobile-client-vue3",
3
- "type": "module",
4
- "version": "1.2.59",
5
- "packageManager": "pnpm@10.12.3",
6
- "description": "Vue + Vite component lib",
7
- "engines": {
8
- "node": ">=20.19.0"
9
- },
10
- "scripts": {
11
- "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
12
- "build": "vue-tsc --noEmit && vite build",
13
- "build:dev": "vue-tsc --noEmit && vite build --mode=development",
14
- "preview": "vite preview",
15
- "lint": "eslint . && vue-tsc --noEmit",
16
- "lint:fix": "eslint . --fix",
17
- "release": "bumpp --commit --push --tag",
18
- "typecheck": "vue-tsc --noEmit",
19
- "commitlint": "commitlint --edit",
20
- "prepare": "simple-git-hooks"
21
- },
22
- "dependencies": {
23
- "@vant/area-data": "^2.0.0",
24
- "crypto-js": "^4.2.0",
25
- "dayjs": "^1.11.13",
26
- "ol": "^10.5.0",
27
- "vue3-hash-calendar": "^1.1.3",
28
- "@iconify/vue": "4.3.0",
29
- "@micro-zoe/micro-app": "1.0.0-rc.24",
30
- "@unhead/vue": "2.0.11",
31
- "@vant/touch-emulator": "^1.4.0",
32
- "@vant/use": "^1.6.0",
33
- "@vueuse/core": "^13.4.0",
34
- "axios": "^1.10.0",
35
- "echarts": "^5.6.0",
36
- "lodash-es": "^4.17.21",
37
- "nprogress": "^0.2.0",
38
- "pinia": "^3.0.3",
39
- "pinia-plugin-persistedstate": "^4.3.0",
40
- "resize-detector": "^0.3.0",
41
- "vant": "^4.9.20",
42
- "vconsole": "^3.15.1",
43
- "vue": "^3.5.17",
44
- "vue-i18n": "^11.1.7",
45
- "vue-router": "^4.5.1"
46
- },
47
- "devDependencies": {
48
- "vite-plugin-compression": "^0.5.1",
49
- "@iconify/json": "2.2.318",
50
- "@types/crypto-js": "^4.2.2",
51
- "@antfu/eslint-config": "4.16.1",
52
- "@commitlint/cli": "^19.8.1",
53
- "@commitlint/config-conventional": "^19.8.1",
54
- "@commitlint/types": "^19.8.1",
55
- "@intlify/unplugin-vue-i18n": "^6.0.8",
56
- "@types/lodash-es": "^4.17.12",
57
- "@types/node": "^24.0.4",
58
- "@types/nprogress": "^0.2.3",
59
- "@unocss/eslint-config": "66.2.3",
60
- "@vitejs/plugin-legacy": "^7.0.0",
61
- "@vitejs/plugin-vue": "^6.0.0",
62
- "autoprefixer": "^10.4.21",
63
- "bumpp": "^10.2.0",
64
- "consola": "^3.4.2",
65
- "cross-env": "^7.0.3",
66
- "eslint": "^9.29.0",
67
- "eslint-plugin-format": "^1.0.1",
68
- "less": "^4.3.0",
69
- "lint-staged": "^16.1.2",
70
- "mockjs": "^1.1.0",
71
- "postcss-mobile-forever": "^5.0.0",
72
- "rollup": "^4.44.0",
73
- "simple-git-hooks": "^2.13.0",
74
- "terser": "^5.43.1",
75
- "typescript": "^5.8.3",
76
- "unocss": "66.2.3",
77
- "vite": "^7.0.0",
78
- "vite-plugin-mock-dev-server": "^1.9.1",
79
- "vite-plugin-pwa": "^1.0.0",
80
- "vite-plugin-sitemap": "^0.8.2",
81
- "vite-plugin-svg-icons": "^2.0.1",
82
- "vite-plugin-vconsole": "^2.1.1",
83
- "vite-plugin-vue-devtools": "^7.7.7",
84
- "vue-tsc": "^2.2.10"
85
- },
86
- "pnpm": {
87
- "allowedDeprecatedVersions": {
88
- "glob": "7.2.3",
89
- "inflight": "1.0.6",
90
- "sourcemap-codec": "1.4.8"
91
- },
92
- "peerDependencyRules": {
93
- "allowedVersions": {
94
- "typescript": "5.8.3"
95
- }
96
- },
97
- "onlyBuiltDependencies": [
98
- "core-js",
99
- "esbuild",
100
- "simple-git-hooks",
101
- "unrs-resolver"
102
- ]
103
- },
104
- "resolutions": {
105
- "vite": "^7.0.0"
106
- },
107
- "simple-git-hooks": {
108
- "pre-commit": "pnpm lint-staged",
109
- "commit-msg": "pnpm commitlint $1"
110
- },
111
- "lint-staged": {
112
- "*.{js,ts,vue}": "eslint --fix"
113
- }
114
- }
1
+ {
2
+ "name": "af-mobile-client-vue3",
3
+ "type": "module",
4
+ "version": "1.3.1",
5
+ "packageManager": "pnpm@10.13.1",
6
+ "description": "Vue + Vite component lib",
7
+ "engines": {
8
+ "node": ">=20.19.0"
9
+ },
10
+ "scripts": {
11
+ "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
12
+ "compress": "node ./compress.js",
13
+ "build:dev": "vue-tsc --noEmit && vite build --mode development",
14
+ "build:pro": "vue-tsc --noEmit && vite build --mode production && pnpm run compress",
15
+ "preview": "vite preview",
16
+ "lint": "eslint .",
17
+ "lint:fix": "eslint . --fix",
18
+ "release": "bumpp --commit --push --tag",
19
+ "typecheck": "vue-tsc --noEmit",
20
+ "commitlint": "commitlint --edit",
21
+ "prepare": "simple-git-hooks"
22
+ },
23
+ "dependencies": {
24
+ "@iconify/vue": "4.3.0",
25
+ "@micro-zoe/micro-app": "1.0.0-rc.26",
26
+ "@unhead/vue": "2.0.12",
27
+ "@vant/area-data": "^2.0.0",
28
+ "@vant/touch-emulator": "^1.4.0",
29
+ "@vant/use": "^1.6.0",
30
+ "@vueuse/core": "^13.5.0",
31
+ "axios": "^1.10.0",
32
+ "crypto-js": "^4.2.0",
33
+ "dayjs": "^1.11.13",
34
+ "echarts": "^5.6.0",
35
+ "lodash-es": "^4.17.21",
36
+ "nprogress": "^0.2.0",
37
+ "ol": "^10.5.0",
38
+ "pinia": "^3.0.3",
39
+ "pinia-plugin-persistedstate": "^4.4.1",
40
+ "resize-detector": "^0.3.0",
41
+ "vant": "^4.9.21",
42
+ "vconsole": "^3.15.1",
43
+ "vue": "^3.5.17",
44
+ "vue-i18n": "^11.1.10",
45
+ "vue-router": "^4.5.1",
46
+ "vue3-hash-calendar": "^1.1.3"
47
+ },
48
+ "devDependencies": {
49
+ "@antfu/eslint-config": "4.17.0",
50
+ "@commitlint/cli": "^19.8.1",
51
+ "@commitlint/config-conventional": "^19.8.1",
52
+ "@commitlint/types": "^19.8.1",
53
+ "@iconify/json": "2.2.318",
54
+ "@iconify/utils": "^2.3.0",
55
+ "@intlify/unplugin-vue-i18n": "^6.0.8",
56
+ "@types/crypto-js": "^4.2.2",
57
+ "@types/lodash-es": "^4.17.12",
58
+ "@types/node": "^24.0.14",
59
+ "@types/nprogress": "^0.2.3",
60
+ "@unocss/eslint-config": "66.3.3",
61
+ "@vitejs/plugin-legacy": "^7.0.1",
62
+ "@vitejs/plugin-vue": "^6.0.0",
63
+ "autoprefixer": "^10.4.21",
64
+ "bumpp": "^10.2.0",
65
+ "consola": "^3.4.2",
66
+ "cross-env": "^7.0.3",
67
+ "eslint": "^9.31.0",
68
+ "eslint-plugin-format": "^1.0.1",
69
+ "less": "^4.4.0",
70
+ "lint-staged": "^16.1.2",
71
+ "mockjs": "^1.1.0",
72
+ "postcss-mobile-forever": "^5.0.0",
73
+ "rollup": "^4.45.1",
74
+ "simple-git-hooks": "^2.13.0",
75
+ "tar": "^7.4.3",
76
+ "terser": "^5.43.1",
77
+ "typescript": "^5.8.3",
78
+ "unocss": "66.3.3",
79
+ "vite": "^7.0.5",
80
+ "vite-plugin-compression": "^0.5.1",
81
+ "vite-plugin-mock-dev-server": "^1.9.1",
82
+ "vite-plugin-pwa": "^1.0.1",
83
+ "vite-plugin-sitemap": "^0.8.2",
84
+ "vite-plugin-vconsole": "^2.1.1",
85
+ "vite-plugin-vue-devtools": "^7.7.7",
86
+ "vue-tsc": "^3.0.2"
87
+ },
88
+ "pnpm": {
89
+ "allowedDeprecatedVersions": {
90
+ "glob": "7.2.3",
91
+ "inflight": "1.0.6",
92
+ "sourcemap-codec": "1.4.8"
93
+ },
94
+ "peerDependencyRules": {
95
+ "allowedVersions": {}
96
+ },
97
+ "onlyBuiltDependencies": [
98
+ "core-js",
99
+ "esbuild",
100
+ "simple-git-hooks",
101
+ "unrs-resolver"
102
+ ]
103
+ },
104
+ "resolutions": {
105
+ "vite": "^7.0.5"
106
+ },
107
+ "simple-git-hooks": {
108
+ "pre-commit": "pnpm lint-staged",
109
+ "commit-msg": "pnpm commitlint $1"
110
+ },
111
+ "lint-staged": {
112
+ "*": "eslint --fix"
113
+ }
114
+ }
package/src/App.vue CHANGED
@@ -9,13 +9,14 @@ import {
9
9
  ConfigProvider as VanConfigProvider,
10
10
  } from 'vant/es'
11
11
  import { computed, reactive } from 'vue'
12
+ import { appDescription, appName } from './constants'
12
13
 
13
14
  useHead({
14
- title: '智慧燃气',
15
+ title: appName,
15
16
  meta: [
16
17
  {
17
18
  name: 'description',
18
- content: '智慧燃气手机端',
19
+ content: appDescription,
19
20
  },
20
21
  {
21
22
  name: 'theme-color',
@@ -73,9 +74,6 @@ input[type='password']::-ms-clear {
73
74
  <style scoped>
74
75
  .app-wrapper {
75
76
  width: 100%;
76
- /**
77
- TODO 源框架问题:增加后动画无效
78
- */
79
77
  position: relative;
80
78
  }
81
79
  </style>
@@ -1,11 +1,10 @@
1
1
  <script setup>
2
- import SvgIcon from '@af-mobile-client-vue3/components/core/SvgIcon/index.vue'
3
2
  </script>
4
3
 
5
4
  <template>
6
5
  <div class="main">
7
6
  <div class="bird-container">
8
- <SvgIcon name="bird" class="bird" />
7
+ <div class="bird i-svg:bird" />
9
8
  </div>
10
9
  <div class="loading-text">
11
10
  加载中,请稍候...
@@ -14,6 +14,7 @@ const props = defineProps({
14
14
  authority: { default: 'user' },
15
15
  uploadMode: { default: 'server' },
16
16
  attr: { type: Object as () => { addOrEdit?: string, acceptCount?: number, uploadImage?: boolean }, default: () => ({}) },
17
+ mode: { default: '新增' }, // 预览
17
18
  })
18
19
  const emit = defineEmits(['updateFileList'])
19
20
 
@@ -170,7 +171,7 @@ function handleActionSelect(option: any) {
170
171
  <template>
171
172
  <div class="uploader-container">
172
173
  <div
173
- v-if="imageList.length < props.attr?.acceptCount && props.attr?.addOrEdit !== 'readonly'"
174
+ v-if="props.mode !== '预览' && (imageList.length < props.attr?.acceptCount && props.attr?.addOrEdit !== 'readonly')"
174
175
  class="custom-upload-area"
175
176
  @click="handleUploadAreaClick"
176
177
  >
@@ -186,7 +187,7 @@ function handleActionSelect(option: any) {
186
187
  ref="uploaderRef"
187
188
  v-model="imageList"
188
189
  :show-upload="false"
189
- :deletable="props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin'"
190
+ :deletable="(props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin') && props.mode !== '预览'"
190
191
  :multiple="props.authority === 'admin'"
191
192
  :preview-image="true"
192
193
  :before-delete="props.attr?.addOrEdit !== 'readonly' && props.authority === 'admin' ? deleteFileFunction : undefined"
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { rootRouteList } from '@af-mobile-client-vue3/config/routes'
2
3
  import { NavBar as VanNavBar } from 'vant/es'
3
4
  import { computed } from 'vue'
4
5
  import { useI18n } from 'vue-i18n'
@@ -6,27 +7,36 @@ import { useRoute, useRouter } from 'vue-router'
6
7
 
7
8
  const route = useRoute()
8
9
  const router = useRouter()
9
-
10
- // back
11
- function onBack() {
12
- if (window.history.state.back)
13
- history.back()
14
- else
15
- router.replace('/')
16
- }
17
-
18
10
  const { t } = useI18n()
19
11
 
12
+ const showNavBar = computed(() => route.meta.navBar)
13
+
14
+ /**
15
+ * Get page title
16
+ * Located in src/locales/json
17
+ */
20
18
  const title = computed(() => {
21
19
  if (!route.meta)
22
20
  return ''
23
21
 
24
- return route.meta.i18n ? t(route.meta.i18n) : (route.meta.title || '')
22
+ return route.meta.i18n ? t(route.meta.i18n as string) : (route.meta.title || '')
25
23
  })
26
24
 
27
- const showNavBar = computed(() => route.meta.navBar)
25
+ /**
26
+ * Show the left arrow
27
+ * If route name is in rootRouteList, hide left arrow
28
+ */
29
+ const showLeftArrow = computed(() => {
30
+ return !(route.name && rootRouteList.includes(route.name as string))
31
+ })
28
32
 
29
- const showLeftArrow = computed(() => route.name && route.name === 'ComponentView')
33
+ // back
34
+ function onBack() {
35
+ if (window.history.state.back)
36
+ history.back()
37
+ else
38
+ router.replace('/')
39
+ }
30
40
  </script>
31
41
 
32
42
  <template>
@@ -35,7 +45,7 @@ const showLeftArrow = computed(() => route.name && route.name === 'ComponentView
35
45
  :title="title"
36
46
  :fixed="true"
37
47
  clickable placeholder
38
- :left-arrow="!showLeftArrow"
48
+ :left-arrow="showLeftArrow"
39
49
  @click-left="onBack"
40
50
  />
41
51
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { routeWhiteList } from '@af-mobile-client-vue3/config/routes'
2
+ import { rootRouteList } from '@af-mobile-client-vue3/config/routes'
3
3
  import { Tabbar as VanTabbar, TabbarItem as VanTabbarItem } from 'vant'
4
4
  import { computed, ref } from 'vue'
5
5
  import { useRoute } from 'vue-router'
@@ -9,11 +9,13 @@ import 'vant/lib/tabbar/index.css'
9
9
  const active = ref(0)
10
10
  const route = useRoute()
11
11
 
12
- const show = computed(() => route.name && routeWhiteList.includes(route.name as string))
12
+ const show = computed(() => {
13
+ return route.name && rootRouteList.includes(route.name as string)
14
+ })
13
15
  </script>
14
16
 
15
17
  <template>
16
- <VanTabbar v-if="show" v-model="active" route placeholder>
18
+ <VanTabbar v-if="show" v-model="active" placeholder route>
17
19
  <VanTabbarItem replace to="/Component/main">
18
20
  {{ '首页' }}
19
21
  <template #icon>
@@ -2,11 +2,11 @@
2
2
  import { getDictItemByValue } from '@af-mobile-client-vue3/utils/dictUtil'
3
3
  import { ref } from 'vue'
4
4
 
5
- const { serviceName, dictName, dictValue } = withDefaults(defineProps<{
5
+ const { serviceName, dictName, dictValue } = defineProps<{
6
6
  serviceName: string
7
7
  dictName: string | null | undefined
8
8
  dictValue: string | null | undefined
9
- }>(), {})
9
+ }>()
10
10
 
11
11
  // 字面值
12
12
  const label = ref('')
@@ -23,7 +23,15 @@ import {
23
23
  import { computed, defineEmits, defineProps, getCurrentInstance, onBeforeMount, ref, useSlots, watch } from 'vue'
24
24
  import { useRouter } from 'vue-router'
25
25
 
26
- const { configName, serviceName, fixQueryForm, customAdd, customEdit } = withDefaults(defineProps<{
26
+ const {
27
+ configName = '',
28
+ fixQueryForm = null,
29
+ idKey = 'o_id',
30
+ serviceName,
31
+ scanOptions,
32
+ customAdd = false,
33
+ customEdit = false,
34
+ } = defineProps<{
27
35
  configName?: string
28
36
  fixQueryForm?: object
29
37
  idKey?: string
@@ -36,15 +44,7 @@ const { configName, serviceName, fixQueryForm, customAdd, customEdit } = withDef
36
44
  // 是否自定义新增、编辑按钮
37
45
  customAdd?: boolean
38
46
  customEdit?: boolean
39
- }>(), {
40
- configName: '',
41
- fixQueryForm: null,
42
- idKey: 'o_id',
43
- serviceName: undefined,
44
- scanOptions: undefined,
45
- customAdd: false,
46
- customEdit: false,
47
- })
47
+ }>()
48
48
 
49
49
  const emit = defineEmits<{
50
50
  (e: 'toDetail', item: any): void
@@ -33,21 +33,21 @@ function handleSubmit(result: any) {
33
33
  @submit="handleSubmit"
34
34
  >
35
35
  <!-- 用户信息插槽 -->
36
- <template #user="{ setRef, removeRef, userFormData }">
36
+ <template #user="{ setRef, removeRef, formData }">
37
37
  <UserForm
38
38
  :set-ref="setRef"
39
39
  :remove-ref="removeRef"
40
40
  form-group-name="userInfo"
41
- :form-data="userFormData"
41
+ :form-data="formData"
42
42
  />
43
43
  </template>
44
44
  <!-- 设备信息插槽 -->
45
- <template #device="{ setRef, removeRef, deviceFormData }">
45
+ <template #device="{ setRef, removeRef, formData }">
46
46
  <DeviceForm
47
47
  :set-ref="setRef"
48
48
  :remove-ref="removeRef"
49
49
  form-group-name="deviceInfo"
50
- :form-data="deviceFormData"
50
+ :form-data="formData"
51
51
  />
52
52
  </template>
53
53
  </XFormGroup>