af-mobile-client-vue3 1.2.59 → 1.3.2

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 (56) 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 +37 -37
  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 +17 -14
  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/XOlMap/utils/wgs84ToGcj02.js +154 -154
  22. package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
  23. package/src/components/data/XReportForm/index.vue +23 -14
  24. package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
  25. package/src/components/data/XReportGrid/XReport.vue +3 -3
  26. package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
  27. package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
  28. package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
  29. package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
  30. package/src/components/layout/NormalDataLayout/index.vue +2 -3
  31. package/src/config/routes.ts +6 -2
  32. package/src/constants/index.ts +2 -0
  33. package/src/locales/en-US.json +52 -28
  34. package/src/locales/zh-CN.json +57 -33
  35. package/src/main.ts +0 -2
  36. package/src/router/routes.ts +0 -6
  37. package/src/router/types.ts +0 -2
  38. package/src/types/vue-router.d.ts +0 -2
  39. package/src/utils/mobileUtil.ts +2 -2
  40. package/src/utils/queryFormDefaultRangePicker.ts +57 -57
  41. package/src/utils/set-page-title.ts +3 -5
  42. package/src/views/common/LoadError.vue +1 -2
  43. package/src/views/common/NotFound.vue +2 -3
  44. package/src/views/component/XCellListView/index.vue +15 -142
  45. package/src/views/component/XFormGroupView/index.vue +15 -11
  46. package/src/views/component/XFormView/index.vue +17 -2
  47. package/src/views/component/XFormView/oldindex.vue +70 -0
  48. package/src/views/component/XOlMapView/XLocationPicker/index.vue +118 -118
  49. package/tsconfig.json +5 -8
  50. package/uno.config.ts +32 -1
  51. package/vite.config.ts +1 -1
  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
  56. 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,18 +1,19 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.2.59",
5
- "packageManager": "pnpm@10.12.3",
4
+ "version": "1.3.2",
5
+ "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
8
8
  "node": ">=20.19.0"
9
9
  },
10
10
  "scripts": {
11
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",
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",
14
15
  "preview": "vite preview",
15
- "lint": "eslint . && vue-tsc --noEmit",
16
+ "lint": "eslint .",
16
17
  "lint:fix": "eslint . --fix",
17
18
  "release": "bumpp --commit --push --tag",
18
19
  "typecheck": "vue-tsc --noEmit",
@@ -20,68 +21,69 @@
20
21
  "prepare": "simple-git-hooks"
21
22
  },
22
23
  "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
24
  "@iconify/vue": "4.3.0",
29
- "@micro-zoe/micro-app": "1.0.0-rc.24",
30
- "@unhead/vue": "2.0.11",
25
+ "@micro-zoe/micro-app": "1.0.0-rc.26",
26
+ "@unhead/vue": "2.0.12",
27
+ "@vant/area-data": "^2.0.0",
31
28
  "@vant/touch-emulator": "^1.4.0",
32
29
  "@vant/use": "^1.6.0",
33
- "@vueuse/core": "^13.4.0",
30
+ "@vueuse/core": "^13.5.0",
34
31
  "axios": "^1.10.0",
32
+ "crypto-js": "^4.2.0",
33
+ "dayjs": "^1.11.13",
35
34
  "echarts": "^5.6.0",
36
35
  "lodash-es": "^4.17.21",
37
36
  "nprogress": "^0.2.0",
37
+ "ol": "^10.5.0",
38
38
  "pinia": "^3.0.3",
39
- "pinia-plugin-persistedstate": "^4.3.0",
39
+ "pinia-plugin-persistedstate": "^4.4.1",
40
40
  "resize-detector": "^0.3.0",
41
- "vant": "^4.9.20",
41
+ "vant": "^4.9.21",
42
42
  "vconsole": "^3.15.1",
43
43
  "vue": "^3.5.17",
44
- "vue-i18n": "^11.1.7",
45
- "vue-router": "^4.5.1"
44
+ "vue-i18n": "^11.1.10",
45
+ "vue-router": "^4.5.1",
46
+ "vue3-hash-calendar": "^1.1.3"
46
47
  },
47
48
  "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",
49
+ "@antfu/eslint-config": "4.17.0",
52
50
  "@commitlint/cli": "^19.8.1",
53
51
  "@commitlint/config-conventional": "^19.8.1",
54
52
  "@commitlint/types": "^19.8.1",
53
+ "@iconify/json": "2.2.318",
54
+ "@iconify/utils": "^2.3.0",
55
55
  "@intlify/unplugin-vue-i18n": "^6.0.8",
56
+ "@types/crypto-js": "^4.2.2",
56
57
  "@types/lodash-es": "^4.17.12",
57
- "@types/node": "^24.0.4",
58
+ "@types/node": "^24.0.14",
58
59
  "@types/nprogress": "^0.2.3",
59
- "@unocss/eslint-config": "66.2.3",
60
- "@vitejs/plugin-legacy": "^7.0.0",
60
+ "@unocss/eslint-config": "66.3.3",
61
+ "@vitejs/plugin-legacy": "^7.0.1",
61
62
  "@vitejs/plugin-vue": "^6.0.0",
62
63
  "autoprefixer": "^10.4.21",
63
64
  "bumpp": "^10.2.0",
64
65
  "consola": "^3.4.2",
65
66
  "cross-env": "^7.0.3",
66
- "eslint": "^9.29.0",
67
+ "eslint": "^9.31.0",
67
68
  "eslint-plugin-format": "^1.0.1",
68
- "less": "^4.3.0",
69
+ "less": "^4.4.0",
69
70
  "lint-staged": "^16.1.2",
70
71
  "mockjs": "^1.1.0",
71
72
  "postcss-mobile-forever": "^5.0.0",
72
- "rollup": "^4.44.0",
73
+ "rollup": "^4.45.1",
73
74
  "simple-git-hooks": "^2.13.0",
75
+ "tar": "^7.4.3",
74
76
  "terser": "^5.43.1",
75
77
  "typescript": "^5.8.3",
76
- "unocss": "66.2.3",
77
- "vite": "^7.0.0",
78
+ "unocss": "66.3.3",
79
+ "vite": "^7.0.5",
80
+ "vite-plugin-compression": "^0.5.1",
78
81
  "vite-plugin-mock-dev-server": "^1.9.1",
79
- "vite-plugin-pwa": "^1.0.0",
82
+ "vite-plugin-pwa": "^1.0.1",
80
83
  "vite-plugin-sitemap": "^0.8.2",
81
- "vite-plugin-svg-icons": "^2.0.1",
82
84
  "vite-plugin-vconsole": "^2.1.1",
83
85
  "vite-plugin-vue-devtools": "^7.7.7",
84
- "vue-tsc": "^2.2.10"
86
+ "vue-tsc": "^3.0.2"
85
87
  },
86
88
  "pnpm": {
87
89
  "allowedDeprecatedVersions": {
@@ -90,9 +92,7 @@
90
92
  "sourcemap-codec": "1.4.8"
91
93
  },
92
94
  "peerDependencyRules": {
93
- "allowedVersions": {
94
- "typescript": "5.8.3"
95
- }
95
+ "allowedVersions": {}
96
96
  },
97
97
  "onlyBuiltDependencies": [
98
98
  "core-js",
@@ -102,13 +102,13 @@
102
102
  ]
103
103
  },
104
104
  "resolutions": {
105
- "vite": "^7.0.0"
105
+ "vite": "^7.0.5"
106
106
  },
107
107
  "simple-git-hooks": {
108
108
  "pre-commit": "pnpm lint-staged",
109
109
  "commit-msg": "pnpm commitlint $1"
110
110
  },
111
111
  "lint-staged": {
112
- "*.{js,ts,vue}": "eslint --fix"
112
+ "*": "eslint --fix"
113
113
  }
114
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,16 @@ 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
+ hideAllActions = false,
35
+ } = defineProps<{
27
36
  configName?: string
28
37
  fixQueryForm?: object
29
38
  idKey?: string
@@ -36,15 +45,9 @@ const { configName, serviceName, fixQueryForm, customAdd, customEdit } = withDef
36
45
  // 是否自定义新增、编辑按钮
37
46
  customAdd?: boolean
38
47
  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
- })
48
+ // 是否隐藏所有操作按钮
49
+ hideAllActions?: boolean
50
+ }>()
48
51
 
49
52
  const emit = defineEmits<{
50
53
  (e: 'toDetail', item: any): void
@@ -151,7 +154,7 @@ const currInst = getCurrentInstance()
151
154
 
152
155
  // 列表底部的文字显示
153
156
  function finishedBottomText() {
154
- if (buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
157
+ if (!hideAllActions && buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
155
158
  return '已加载全部内容,如需新增请点击右上角的 + 号'
156
159
  else
157
160
  return '已加载全部内容'
@@ -560,7 +563,7 @@ defineExpose({
560
563
  />
561
564
  </VanCol>
562
565
  <!-- 新增按钮,放在查询框后、查询条件下拉按钮前 -->
563
- <VanCol v-if="buttonState?.add && buttonState.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr)))))" class="add-col">
566
+ <VanCol v-if="!hideAllActions && buttonState?.add && buttonState.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr)))))" class="add-col">
564
567
  <VanButton
565
568
  icon="add"
566
569
  type="primary"
@@ -629,7 +632,7 @@ defineExpose({
629
632
  />
630
633
  </p>
631
634
  </div>
632
- <div class="action-buttons">
635
+ <div v-if="!hideAllActions" class="action-buttons">
633
636
  <VanButton
634
637
  v-for="btn in btnList"
635
638
  :key="btn.dataIndex"
@@ -704,7 +707,7 @@ defineExpose({
704
707
  </VanRow>
705
708
  <!-- 添加详情插槽 -->
706
709
  <slot name="item-detail" :item="item" />
707
- <VanRow v-if="allActions.length > 0" gutter="20" class="card_item_bottom">
710
+ <VanRow v-if="!hideAllActions && allActions.length > 0" gutter="20" class="card_item_bottom">
708
711
  <VanCol span="4">
709
712
  <VanPopover
710
713
  v-if="getActionGroups(item, index).more.length"
@@ -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>
@@ -10,12 +10,14 @@ const props = withDefaults(defineProps<{
10
10
  groupFormData?: object
11
11
  mode?: string
12
12
  isScrollspy?: boolean
13
+ formShow?: any
13
14
  }>(), {
14
15
  configName: '',
15
16
  serviceName: undefined,
16
17
  groupFormData: () => ({}),
17
18
  mode: '查询',
18
19
  isScrollspy: true,
20
+ formShow: undefined,
19
21
  })
20
22
  const emit = defineEmits(['submit', 'xFormItemEmitFunc'])
21
23
 
@@ -25,6 +27,7 @@ interface Form {
25
27
  groupFormData?: object
26
28
  mode?: string
27
29
  isScrollspy?: boolean
30
+ formShow?: any
28
31
  }
29
32
 
30
33
  const groupItems = ref([])
@@ -38,6 +41,12 @@ const propsData = ref<Partial<Form>>({})
38
41
  const slots = useSlots()
39
42
  const renderableGroupItems = computed(() => {
40
43
  return groupItems.value.filter((item) => {
44
+ if (props.formShow && (item.groupName || item.slotName)) {
45
+ const showKey = `show${item.groupName || item.slotName}`
46
+ if (props.formShow[showKey] === false) {
47
+ return false
48
+ }
49
+ }
41
50
  if (item.formGroupType === 'slot') {
42
51
  return !!(item.slotName && slots[item.slotName])
43
52
  }
@@ -53,6 +62,7 @@ function init(params: Form) {
53
62
  serviceName: props.serviceName,
54
63
  groupFormData: props.groupFormData,
55
64
  mode: props.mode,
65
+ formShow: props.formShow,
56
66
  ...params,
57
67
  }
58
68
  formData.value = propsData.value.groupFormData
@@ -141,7 +151,7 @@ defineExpose({ init, removeRef, xFormListRef })
141
151
  >
142
152
  <div
143
153
  class="x-form-group-item"
144
- :class="{ 'is-last': index === groupItems.length - 1 }"
154
+ :class="{ 'is-last': index === renderableGroupItems.length - 1 }"
145
155
  >
146
156
  <div v-if="item.describe && propsData.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
147
157
  <span class="form-group-bar" />