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.
- package/.editorconfig +5 -34
- package/.env +1 -1
- package/.env.development +0 -3
- package/.env.production +1 -7
- package/build/vite/index.ts +2 -12
- package/build/vite/optimize.ts +2 -2
- package/compress.js +36 -0
- package/package.json +114 -114
- package/src/App.vue +3 -5
- package/src/assets/img/banner/appraise-banner-1.png +0 -0
- package/src/assets/img/banner/appraise-banner-2.png +0 -0
- package/src/components/core/BeautifulLoading/index.vue +1 -2
- package/src/components/core/ImageUploader/index.vue +3 -2
- package/src/components/core/NavBar/index.vue +23 -13
- package/src/components/core/Tabbar/index.vue +5 -3
- package/src/components/data/XBadge/index.vue +2 -2
- package/src/components/data/XCellList/index.vue +20 -66
- package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
- package/src/components/data/XFormGroup/doc/FormGroupDemo.vue +4 -4
- package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
- package/src/components/data/XFormGroup/index.vue +11 -1
- package/src/components/data/XFormItem/index.vue +2 -22
- package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
- package/src/components/data/XReportForm/index.vue +23 -14
- package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
- package/src/components/data/XReportGrid/XReport.vue +3 -3
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
- package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
- package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
- package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/components/layout/NormalDataLayout/index.vue +2 -3
- package/src/config/routes.ts +6 -2
- package/src/constants/index.ts +2 -0
- package/src/locales/en-US.json +52 -28
- package/src/locales/zh-CN.json +57 -33
- package/src/main.ts +0 -2
- package/src/router/types.ts +0 -2
- package/src/types/vue-router.d.ts +0 -2
- package/src/utils/mobileUtil.ts +2 -2
- package/src/utils/set-page-title.ts +3 -5
- package/src/views/common/LoadError.vue +1 -2
- package/src/views/common/NotFound.vue +2 -3
- package/src/views/component/XCellListView/index.vue +94 -133
- package/src/views/component/XFormGroupView/index.vue +7 -16
- package/src/views/component/XFormView/index.vue +15 -95
- package/src/views/user/login/LoginForm.vue +3 -3
- package/tsconfig.json +5 -8
- package/uno.config.ts +32 -1
- package/vite.config.ts +3 -3
- package/.env.envoiceShow +0 -7
- package/src/components/core/App/MicroAppView.vue +0 -59
- package/src/components/core/SvgIcon/index.vue +0 -61
- 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
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"src/
|
|
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
|
|
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://
|
|
15
|
-
const v3Server = '
|
|
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
|
|
98
|
+
outDir: `./dist/${env.VITE_APP_OUT_DIR}`,
|
|
99
99
|
rollupOptions: {
|
|
100
100
|
output: {
|
|
101
101
|
// 打包时分割资源
|
package/.env.envoiceShow
DELETED
|
@@ -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>
|