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
@@ -5,19 +5,16 @@ import { showDialog } from 'vant'
5
5
  import { ref } from 'vue'
6
6
  import { useRoute } from 'vue-router'
7
7
 
8
- // const configName = ref('reviewFormGroup')
9
- // const serviceName = ref('af-revenue')
10
-
11
8
  // 纯表单
12
- // const configName = ref('form_check_test')
13
- // const serviceName = ref('af-system')
9
+ const configName = ref('form_check_test')
10
+ const serviceName = ref('af-system')
14
11
 
15
12
  // const configName = ref("计划下发Form")
16
13
  // const serviceName = ref("af-linepatrol")
17
14
 
18
15
  // 表单组
19
- const configName = ref('lngChargeAuditMobileFormGroup')
20
- const serviceName = ref('af-gaslink')
16
+ // const configName = ref('lngChargeAuditMobileFormGroup')
17
+ // const serviceName = ref('af-gaslink')
21
18
 
22
19
  const formData = ref({})
23
20
  const formGroup = ref(null)
@@ -25,8 +22,7 @@ const route = useRoute()
25
22
  const isInit = ref(false)
26
23
  function submit(_result) {
27
24
  showDialog({ message: '提交成功' }).then(() => {
28
- console.log('12121')
29
- // history.back()
25
+ history.back()
30
26
  })
31
27
  }
32
28
 
@@ -67,8 +63,8 @@ function submit(_result) {
67
63
  <!-- v-if="isInit" -->
68
64
  <XFormGroup
69
65
  ref="formGroup"
70
- config-name="ceshi11111FormGroup"
71
- service-name="af-apply"
66
+ :config-name="configName"
67
+ :service-name="serviceName"
72
68
  :group-form-data="formData"
73
69
  mode="新增"
74
70
  @submit="submit"
@@ -3,8 +3,8 @@ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
3
  import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
4
  import { ref } from 'vue'
5
5
 
6
- const configName = ref('addappapplychargeForm')
7
- const serviceName = ref('af-apply')
6
+ const configName = ref('AddConstructionForm')
7
+ const serviceName = ref('af-linepatrol')
8
8
 
9
9
  const formGroupAddConstruction = ref(null)
10
10
  </script>
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
@@ -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
@@ -1,97 +0,0 @@
1
- <script setup lang="ts">
2
- import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
3
- import { runLogic } from '@af-mobile-client-vue3/services/api/common'
4
- import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
5
- import dayjs from 'dayjs/esm/index'
6
- import { showToast } from 'vant'
7
- import { onMounted, ref } from 'vue'
8
- import { useRoute } from 'vue-router'
9
-
10
- const configName = ref('appapplyuserinfoFormGroup')
11
- const serviceName = ref('af-apply')
12
- const route = useRoute()
13
- const userInfo = useUserStore().getUserInfo()
14
- const workflowId = ref('3045')
15
- const userinfoid = ref('93116')
16
- const model = ref('编辑')
17
- const groupFormData = ref({})
18
-
19
- function submit(res) {
20
- if (model.value === '新增') {
21
- res.t_userinfo.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
22
- res.t_userinfo.f_orgid = userInfo.f_orgid
23
- res.t_userinfo.f_orgname = userInfo.f_orgname
24
- res.t_userinfo.f_depid = userInfo.f_depid
25
- res.t_userinfo.f_depname = userInfo.f_depname
26
- res.t_userinfo.f_operatorid = userInfo.f_operatorid
27
- res.t_userinfo.f_operator = userInfo.f_operator
28
- res.t_userinfo.f_workflow_id = this.f_workflow_id
29
- res.t_userinfo.f_user_state = '预备'
30
-
31
- res.t_userfiles.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
32
- res.t_userfiles.f_orgid = userInfo.f_orgid
33
- res.t_userfiles.f_orgname = userInfo.f_orgname
34
- res.t_userfiles.f_depid = userInfo.f_depid
35
- res.t_userfiles.f_depname = userInfo.f_depname
36
- res.t_userfiles.f_operatorid = userInfo.f_operatorid
37
- res.t_userfiles.f_operator = userInfo.f_operator
38
- res.t_userfiles.f_workflow_id = this.f_workflow_id
39
- res.t_userfiles.f_table_state = '待开通'
40
- }
41
- let saveData = res
42
- if (saveData.t_userfiles.f_gasbrand_id.length > 0) {
43
- saveData.t_userfiles.f_gasbrand_id = saveData.t_userfiles.f_gasbrand_id[0]
44
- }
45
- if (saveData.t_userfiles.f_price_id.length > 0) {
46
- saveData.t_userfiles.f_price_id = saveData.t_userfiles.f_price_id[0]
47
- }
48
- if (model.value === '编辑') {
49
- saveData = Object.assign(saveData, {
50
- f_operator_record: userInfo.f_operator,
51
- f_operatorid_record: userInfo.f_operatorid,
52
- f_orgid_record: userInfo.f_orgid,
53
- f_orgname_record: userInfo.f_orgname,
54
- f_depid_record: userInfo.f_depid,
55
- f_depname_record: userInfo.f_depname,
56
- })
57
- }
58
- runLogic('userFIleSaveLogic', saveData, 'af-revenue').then((res) => {
59
- showToast('操作成功!')
60
- history.back()
61
- })
62
- }
63
- const isInit = ref(false)
64
- function init() {
65
- if (model.value === '编辑') {
66
- runLogic('getFileDetailForEdit', { f_userinfo_id: userinfoid.value }, 'af-revenue').then((res) => {
67
- // if (res.t_userfiles.f_gasmodel_id) {
68
- // res.t_userfiles.f_gasmodel_id = 76
69
- // }
70
- // if (res.t_userfiles.f_price_id) {
71
- // res.t_userfiles.f_price_id = [res.t_userfiles.f_price_id]
72
- // }
73
- console.log('1111111----,', res)
74
- groupFormData.value = res
75
- isInit.value = true
76
- })
77
- }
78
- }
79
- onMounted(() => {
80
- init()
81
- })
82
- </script>
83
-
84
- <template>
85
- <XFormGroup
86
- v-if="isInit"
87
- mode="修改"
88
- :config-name="configName"
89
- :service-name="serviceName"
90
- :group-form-data="groupFormData"
91
- @submit="submit"
92
- />
93
- </template>
94
-
95
- <style scoped lang="less">
96
-
97
- </style>