af-mobile-client-vue3 1.1.7 → 1.1.8

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 (74) hide show
  1. package/.env +6 -6
  2. package/.env.development +4 -4
  3. package/.env.envoiceShow +6 -6
  4. package/.env.production +6 -6
  5. package/.husky/commit-msg +1 -1
  6. package/.husky/pre-commit +1 -1
  7. package/.vscode/settings.json +61 -61
  8. package/mock/modules/user.mock.ts +152 -152
  9. package/package.json +1 -1
  10. package/public/favicon.svg +4 -4
  11. package/public/safari-pinned-tab.svg +32 -32
  12. package/scripts/verifyCommit.js +19 -19
  13. package/src/App.vue +43 -43
  14. package/src/api/user/index.ts +40 -40
  15. package/src/bootstrap.ts +18 -18
  16. package/src/components/core/NavBar/index.vue +12 -12
  17. package/src/components/core/Tabbar/index.vue +38 -38
  18. package/src/components/core/XGridDropOption/index.vue +151 -151
  19. package/src/components/core/XMultiSelect/index.vue +183 -183
  20. package/src/components/data/XCellDetail/index.vue +106 -106
  21. package/src/components/data/XCellList/index.vue +2 -1
  22. package/src/components/data/XOlMap/utils/wgs84ToGcj02.js +154 -154
  23. package/src/components/data/XReportForm/XReportFormJsonRender.vue +220 -220
  24. package/src/components/data/XReportForm/index.vue +1079 -1079
  25. package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
  26. package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
  27. package/src/components/data/XSignature/index.vue +285 -285
  28. package/src/components/data/XTag/index.vue +10 -10
  29. package/src/components/layout/NormalDataLayout/index.vue +70 -70
  30. package/src/components/layout/TabBarLayout/index.vue +40 -40
  31. package/src/components.d.ts +53 -53
  32. package/src/env.d.ts +16 -16
  33. package/src/font-style/font.css +3 -3
  34. package/src/hooks/useCommon.ts +9 -9
  35. package/src/locales/en-US.json +25 -25
  36. package/src/locales/zh-CN.json +25 -25
  37. package/src/plugins/AppData.ts +38 -38
  38. package/src/router/guards.ts +59 -59
  39. package/src/router/index.ts +61 -61
  40. package/src/router/invoiceRoutes.ts +33 -33
  41. package/src/services/api/common.ts +109 -109
  42. package/src/services/api/manage.ts +8 -8
  43. package/src/services/api/search.ts +16 -16
  44. package/src/services/restTools.ts +56 -56
  45. package/src/services/v3Api.ts +11 -11
  46. package/src/stores/modules/setting.ts +52 -52
  47. package/src/stores/mutation-type.ts +7 -7
  48. package/src/utils/authority-utils.ts +84 -84
  49. package/src/utils/crypto.ts +39 -39
  50. package/src/utils/i18n.ts +41 -41
  51. package/src/utils/indexedDB.ts +180 -180
  52. package/src/utils/mobileUtil.ts +26 -26
  53. package/src/utils/routerUtil.ts +271 -271
  54. package/src/utils/runEvalFunction.ts +13 -13
  55. package/src/utils/wechatUtil.ts +9 -9
  56. package/src/views/common/LoadError.vue +64 -64
  57. package/src/views/common/NotFound.vue +68 -68
  58. package/src/views/component/EvaluateRecordView/index.vue +40 -40
  59. package/src/views/component/XCellDetailView/index.vue +217 -217
  60. package/src/views/component/XCellListView/index.vue +2 -2
  61. package/src/views/component/XOlMapView/XLocationPicker/index.vue +120 -120
  62. package/src/views/component/XReportFormIframeView/index.vue +47 -47
  63. package/src/views/component/XReportFormView/index.vue +13 -13
  64. package/src/views/component/XSignatureView/index.vue +50 -50
  65. package/src/views/component/menu.vue +117 -117
  66. package/src/views/component/notice.vue +46 -46
  67. package/src/views/component/topNav.vue +36 -36
  68. package/src/views/invoiceShow/index.vue +61 -61
  69. package/src/views/user/login/ForgetPasswordForm.vue +94 -94
  70. package/src/views/user/login/LoginTitle.vue +68 -68
  71. package/src/views/user/login/index.vue +22 -22
  72. package/src/views/user/my/index.vue +230 -230
  73. package/src/vue-router.d.ts +9 -9
  74. package/tsconfig.json +43 -43
@@ -1,70 +1,70 @@
1
- <script setup lang="ts">
2
- import {
3
- Col as VanCol,
4
- Icon as VanIcon,
5
- Row as VanRow,
6
- } from 'vant'
7
-
8
- const { title } = withDefaults(defineProps<{
9
- // 标题
10
- title: string
11
- }>(), {
12
- })
13
-
14
- // back
15
- const onClickLeft = () => history.back()
16
- </script>
17
-
18
- <template>
19
- <!-- 常规数据布局 -->
20
- <main class="layout_main">
21
- <!-- 布局头部 -->
22
- <div class="layout_header">
23
- <VanRow class="header_row" justify="space-between">
24
- <VanCol class="header_row_left_col">
25
- <VanIcon class="header_row_icon" name="arrow-left" @click="onClickLeft" />
26
- <span class="header_row_title">{{ title }}</span>
27
- </VanCol>
28
- <VanCol class="header_row_right_col">
29
- <!-- 右侧区域 -->
30
- <slot name="layout_header_row_right_col" />
31
- </VanCol>
32
- </VanRow>
33
- </div>
34
- <!-- 布局主体 -->
35
- <div class="layout_content">
36
- <slot name="layout_content" />
37
- </div>
38
- </main>
39
- </template>
40
-
41
- <style scoped lang="less">
42
- .layout_main {
43
- display: flex;
44
- flex-flow: column;
45
- width: 100%;
46
- height: 100vh;
47
- .layout_header {
48
- padding: var(--base-interval-1);
49
- .header_row {
50
- align-items: center;
51
- .header_row_left_col {
52
- flex-grow: 1;
53
- .header_row_title {
54
- margin-left: var(--van-padding-xs);
55
- font-size: 20px;
56
- font-weight: bold;
57
- }
58
- }
59
- .header_row_icon {
60
- font-size: 18px;
61
- }
62
- }
63
- }
64
- .layout_content {
65
- flex: 1;
66
- margin-top: var(--van-padding-base);
67
- height: 0;
68
- }
69
- }
70
- </style>
1
+ <script setup lang="ts">
2
+ import {
3
+ Col as VanCol,
4
+ Icon as VanIcon,
5
+ Row as VanRow,
6
+ } from 'vant'
7
+
8
+ const { title } = withDefaults(defineProps<{
9
+ // 标题
10
+ title: string
11
+ }>(), {
12
+ })
13
+
14
+ // back
15
+ const onClickLeft = () => history.back()
16
+ </script>
17
+
18
+ <template>
19
+ <!-- 常规数据布局 -->
20
+ <main class="layout_main">
21
+ <!-- 布局头部 -->
22
+ <div class="layout_header">
23
+ <VanRow class="header_row" justify="space-between">
24
+ <VanCol class="header_row_left_col">
25
+ <VanIcon class="header_row_icon" name="arrow-left" @click="onClickLeft" />
26
+ <span class="header_row_title">{{ title }}</span>
27
+ </VanCol>
28
+ <VanCol class="header_row_right_col">
29
+ <!-- 右侧区域 -->
30
+ <slot name="layout_header_row_right_col" />
31
+ </VanCol>
32
+ </VanRow>
33
+ </div>
34
+ <!-- 布局主体 -->
35
+ <div class="layout_content">
36
+ <slot name="layout_content" />
37
+ </div>
38
+ </main>
39
+ </template>
40
+
41
+ <style scoped lang="less">
42
+ .layout_main {
43
+ display: flex;
44
+ flex-flow: column;
45
+ width: 100%;
46
+ height: 100vh;
47
+ .layout_header {
48
+ padding: var(--base-interval-1);
49
+ .header_row {
50
+ align-items: center;
51
+ .header_row_left_col {
52
+ flex-grow: 1;
53
+ .header_row_title {
54
+ margin-left: var(--van-padding-xs);
55
+ font-size: 20px;
56
+ font-weight: bold;
57
+ }
58
+ }
59
+ .header_row_icon {
60
+ font-size: 18px;
61
+ }
62
+ }
63
+ }
64
+ .layout_content {
65
+ flex: 1;
66
+ margin-top: var(--van-padding-base);
67
+ height: 0;
68
+ }
69
+ }
70
+ </style>
@@ -1,40 +1,40 @@
1
- <script setup lang="ts">
2
- import {
3
- Tabbar as VanTabbar,
4
- TabbarItem as VanTabbarItem,
5
- } from 'vant'
6
- import { defineProps } from 'vue'
7
-
8
- const { barList, callbacks } = defineProps<{
9
- barList?: Array<{ icon: string, text: string, method: string }>
10
- callbacks?: object
11
- }>()
12
-
13
- function handleClick(index) {
14
- const methodName = (barList[index] as any).method
15
- callbacks[methodName]()
16
- }
17
- </script>
18
-
19
- <template>
20
- <VanTabbar class="van-bar">
21
- <VanTabbarItem v-for="(item, index) in barList" :key="index" :icon="(item as any).icon" @click="handleClick(index)">
22
- {{ (item as any).text }}
23
- </VanTabbarItem>
24
- </VanTabbar>
25
- </template>
26
-
27
- <style scoped lang="less">
28
- .van-bar {
29
- height: 8vh;
30
- background-color: #f7f8fa;
31
- color: black;
32
- }
33
- .van-tabbar-item:hover {
34
- color: var(--van-text-color-2);
35
- }
36
- :deep(.van-tabbar-item--active) {
37
- background-color: #f7f8fa;
38
- color: black;
39
- }
40
- </style>
1
+ <script setup lang="ts">
2
+ import {
3
+ Tabbar as VanTabbar,
4
+ TabbarItem as VanTabbarItem,
5
+ } from 'vant'
6
+ import { defineProps } from 'vue'
7
+
8
+ const { barList, callbacks } = defineProps<{
9
+ barList?: Array<{ icon: string, text: string, method: string }>
10
+ callbacks?: object
11
+ }>()
12
+
13
+ function handleClick(index) {
14
+ const methodName = (barList[index] as any).method
15
+ callbacks[methodName]()
16
+ }
17
+ </script>
18
+
19
+ <template>
20
+ <VanTabbar class="van-bar">
21
+ <VanTabbarItem v-for="(item, index) in barList" :key="index" :icon="(item as any).icon" @click="handleClick(index)">
22
+ {{ (item as any).text }}
23
+ </VanTabbarItem>
24
+ </VanTabbar>
25
+ </template>
26
+
27
+ <style scoped lang="less">
28
+ .van-bar {
29
+ height: 8vh;
30
+ background-color: #f7f8fa;
31
+ color: black;
32
+ }
33
+ .van-tabbar-item:hover {
34
+ color: var(--van-text-color-2);
35
+ }
36
+ :deep(.van-tabbar-item--active) {
37
+ background-color: #f7f8fa;
38
+ color: black;
39
+ }
40
+ </style>
@@ -1,53 +1,53 @@
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
+ /* 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
+ }
package/src/env.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare module '*.vue' {
4
- import type { DefineComponent } from 'vue'
5
-
6
- // eslint-disable-next-line ts/no-empty-object-type
7
- const component: DefineComponent<{}, {}, any>
8
- export default component
9
- }
10
-
11
- interface Window {
12
- mount: any
13
- remount: any
14
- unmount: any
15
- readonly __MICRO_APP_ENVIRONMENT__: any
16
- }
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+
6
+ // eslint-disable-next-line ts/no-empty-object-type
7
+ const component: DefineComponent<{}, {}, any>
8
+ export default component
9
+ }
10
+
11
+ interface Window {
12
+ mount: any
13
+ remount: any
14
+ unmount: any
15
+ readonly __MICRO_APP_ENVIRONMENT__: any
16
+ }
@@ -1,4 +1,4 @@
1
- @font-face {
2
- font-family: 'PingFangSC-Regular-woff2';
3
- src: url('./PingFangSC-Regular.woff2') format('woff2');
1
+ @font-face {
2
+ font-family: 'PingFangSC-Regular-woff2';
3
+ src: url('./PingFangSC-Regular.woff2') format('woff2');
4
4
  }
@@ -1,9 +1,9 @@
1
- export function formatDate(date) {
2
- const year = date.getFullYear()
3
- const month = (date.getMonth() + 1).toString().padStart(2, '0') // 月份加1,并补零
4
- const day = date.getDate().toString().padStart(2, '0') // 日期补零
5
- const hours = date.getHours().toString().padStart(2, '0') // 小时补零
6
- const minutes = date.getMinutes().toString().padStart(2, '0') // 分钟补零
7
- const seconds = date.getSeconds().toString().padStart(2, '0') // 秒数补零
8
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
9
- }
1
+ export function formatDate(date) {
2
+ const year = date.getFullYear()
3
+ const month = (date.getMonth() + 1).toString().padStart(2, '0') // 月份加1,并补零
4
+ const day = date.getDate().toString().padStart(2, '0') // 日期补零
5
+ const hours = date.getHours().toString().padStart(2, '0') // 小时补零
6
+ const minutes = date.getMinutes().toString().padStart(2, '0') // 分钟补零
7
+ const seconds = date.getSeconds().toString().padStart(2, '0') // 秒数补零
8
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
9
+ }
@@ -1,25 +1,25 @@
1
- {
2
- "home": {
3
- "darkMode": "🌗 Dark Mode",
4
- "mockGuide": "💿 Mock Guide",
5
- "language": "📚 Language",
6
- "404Demo": "🙅 Page 404 Demo",
7
- "echartsDemo": "📊 Echarts Demo",
8
- "persistPiniaState": "🍍 Persistent Pinia state",
9
- "unocssExample": "🎨 Unocss example"
10
- },
11
- "mock": {
12
- "fromAsyncData": "Data from asynchronous requests",
13
- "noData": "No data",
14
- "pull": "Pull",
15
- "reset": "Reset"
16
- },
17
- "charts": {
18
- "January": "Jan",
19
- "February": "Feb",
20
- "March": "Mar",
21
- "April": "Apr",
22
- "May": "May",
23
- "June": "Jun"
24
- }
25
- }
1
+ {
2
+ "home": {
3
+ "darkMode": "🌗 Dark Mode",
4
+ "mockGuide": "💿 Mock Guide",
5
+ "language": "📚 Language",
6
+ "404Demo": "🙅 Page 404 Demo",
7
+ "echartsDemo": "📊 Echarts Demo",
8
+ "persistPiniaState": "🍍 Persistent Pinia state",
9
+ "unocssExample": "🎨 Unocss example"
10
+ },
11
+ "mock": {
12
+ "fromAsyncData": "Data from asynchronous requests",
13
+ "noData": "No data",
14
+ "pull": "Pull",
15
+ "reset": "Reset"
16
+ },
17
+ "charts": {
18
+ "January": "Jan",
19
+ "February": "Feb",
20
+ "March": "Mar",
21
+ "April": "Apr",
22
+ "May": "May",
23
+ "June": "Jun"
24
+ }
25
+ }
@@ -1,25 +1,25 @@
1
- {
2
- "home": {
3
- "darkMode": "🌗 暗黑模式",
4
- "mockGuide": "💿 Mock 指南",
5
- "language": "📚 语言",
6
- "echartsDemo": "📊 Echarts 演示",
7
- "persistPiniaState": "🍍 持久化 Pinia 状态",
8
- "404Demo": "🙅 404页 演示",
9
- "unocssExample": "🎨 Unocss 示例"
10
- },
11
- "mock": {
12
- "fromAsyncData": "来自异步请求的数据",
13
- "pull": "请求",
14
- "reset": "清空",
15
- "noData": "暂无数据"
16
- },
17
- "charts": {
18
- "January": "1月",
19
- "February": "2月",
20
- "March": "3月",
21
- "April": "4月",
22
- "May": "5月",
23
- "June": "6月"
24
- }
25
- }
1
+ {
2
+ "home": {
3
+ "darkMode": "🌗 暗黑模式",
4
+ "mockGuide": "💿 Mock 指南",
5
+ "language": "📚 语言",
6
+ "echartsDemo": "📊 Echarts 演示",
7
+ "persistPiniaState": "🍍 持久化 Pinia 状态",
8
+ "404Demo": "🙅 404页 演示",
9
+ "unocssExample": "🎨 Unocss 示例"
10
+ },
11
+ "mock": {
12
+ "fromAsyncData": "来自异步请求的数据",
13
+ "pull": "请求",
14
+ "reset": "清空",
15
+ "noData": "暂无数据"
16
+ },
17
+ "charts": {
18
+ "January": "1月",
19
+ "February": "2月",
20
+ "March": "3月",
21
+ "April": "4月",
22
+ "May": "5月",
23
+ "June": "6月"
24
+ }
25
+ }
@@ -1,38 +1,38 @@
1
- import type { App } from 'vue'
2
- import { manageApi } from '@af-mobile-client-vue3/services/api/manage'
3
- import { APP_WEB_CONFIG_KEY } from '@af-mobile-client-vue3/stores/mutation-type'
4
- import { handleTree } from '@af-mobile-client-vue3/utils/dataUtil'
5
- import { indexedDB } from '@af-mobile-client-vue3/utils/indexedDB'
6
- import { createStorage } from '@af-mobile-client-vue3/utils/Storage'
7
-
8
- const Storage = createStorage({ storage: localStorage })
9
-
10
- export const GetAppDataService = {
11
- install(app: App<Element>) {
12
- app.provide('$appdata', GetAppDataService)
13
- },
14
- async load() {
15
- },
16
- // 返回树形省市区
17
- async getDivisionsOhChinaForTree() {
18
- // 获取省市区数据
19
- return new Promise((resolve, reject) => {
20
- try {
21
- indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, (res) => {
22
- resolve(res)
23
- }, (processRes) => {
24
- return handleTree(processRes, 'code', 'parentcode', null)
25
- })
26
- }
27
- catch (e) {
28
- reject(e)
29
- }
30
- })
31
- },
32
- getWebConfigByKey(key: string) {
33
- const object = Storage.get(APP_WEB_CONFIG_KEY)
34
- return object[key]
35
- },
36
- }
37
-
38
- export default GetAppDataService
1
+ import type { App } from 'vue'
2
+ import { manageApi } from '@af-mobile-client-vue3/services/api/manage'
3
+ import { APP_WEB_CONFIG_KEY } from '@af-mobile-client-vue3/stores/mutation-type'
4
+ import { handleTree } from '@af-mobile-client-vue3/utils/dataUtil'
5
+ import { indexedDB } from '@af-mobile-client-vue3/utils/indexedDB'
6
+ import { createStorage } from '@af-mobile-client-vue3/utils/Storage'
7
+
8
+ const Storage = createStorage({ storage: localStorage })
9
+
10
+ export const GetAppDataService = {
11
+ install(app: App<Element>) {
12
+ app.provide('$appdata', GetAppDataService)
13
+ },
14
+ async load() {
15
+ },
16
+ // 返回树形省市区
17
+ async getDivisionsOhChinaForTree() {
18
+ // 获取省市区数据
19
+ return new Promise((resolve, reject) => {
20
+ try {
21
+ indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, (res) => {
22
+ resolve(res)
23
+ }, (processRes) => {
24
+ return handleTree(processRes, 'code', 'parentcode', null)
25
+ })
26
+ }
27
+ catch (e) {
28
+ reject(e)
29
+ }
30
+ })
31
+ },
32
+ getWebConfigByKey(key: string) {
33
+ const object = Storage.get(APP_WEB_CONFIG_KEY)
34
+ return object[key]
35
+ },
36
+ }
37
+
38
+ export default GetAppDataService