af-mobile-client-vue3 1.4.59 → 1.4.60
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/__dummy__ +9 -9
- package/build/vite/optimize.ts +36 -36
- package/package.json +3 -2
- package/public/favicon.svg +4 -4
- package/scripts/verifyCommit.js +19 -19
- package/src/components/common/MateChat/components/MateChatContent.vue +274 -274
- package/src/components/common/MateChat/components/MateChatHeader.vue +337 -337
- package/src/components/common/MateChat/index.vue +444 -444
- package/src/components/common/MateChat/types.ts +247 -247
- package/src/components/data/FilePreview/index.vue +141 -0
- package/src/components/data/UserDetail/types.ts +1 -1
- package/src/components/data/XOlMap/types.ts +1 -1
- package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
- package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
- package/src/components/data/XTag/index.vue +10 -10
- package/src/components/layout/TabBarLayout/index.vue +40 -40
- package/src/hooks/useCommon.ts +9 -9
- package/src/plugins/AppData.ts +38 -38
- package/src/router/invoiceRoutes.ts +33 -33
- package/src/router/routes.ts +6 -0
- package/src/services/api/common.ts +109 -109
- package/src/services/api/manage.ts +8 -8
- package/src/services/api/search.ts +16 -16
- package/src/services/restTools.ts +56 -56
- package/src/utils/authority-utils.ts +84 -84
- package/src/utils/crypto.ts +39 -39
- package/src/utils/runEvalFunction.ts +13 -13
- package/src/views/component/EvaluateRecordView/index.vue +40 -40
- package/src/views/component/FilePreviewView/index.vue +28 -0
- package/src/views/component/MateChat/MateChatView.vue +10 -10
- package/src/views/component/XCellDetailView/index.vue +217 -217
- package/src/views/component/XCellListView/index.vue +2 -78
- package/src/views/component/XFormView/index.vue +13 -28
- package/src/views/component/XOlMapView/XLocationPicker/index.vue +118 -118
- package/src/views/component/XReportFormIframeView/index.vue +47 -47
- package/src/views/component/XReportFormView/index.vue +13 -13
- package/src/views/component/XSignatureView/index.vue +50 -50
- package/src/views/component/index.vue +5 -1
- package/src/views/component/notice.vue +46 -46
- package/src/views/component/topNav.vue +36 -36
- package/src/views/invoiceShow/index.vue +61 -61
- package/src/views/user/login/index.vue +22 -22
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断是否有路由的权限
|
|
3
|
-
* @param authority 路由权限配置
|
|
4
|
-
* @param permissions 用户权限集合
|
|
5
|
-
*/
|
|
6
|
-
function hasPermission(authority: any, permissions: any): boolean {
|
|
7
|
-
let required: string = '*'
|
|
8
|
-
if (typeof authority === 'string')
|
|
9
|
-
required = authority
|
|
10
|
-
else if (Array.isArray(authority))
|
|
11
|
-
required = authority.toString()
|
|
12
|
-
else if (typeof authority === 'object')
|
|
13
|
-
required = authority.permission
|
|
14
|
-
|
|
15
|
-
return required === '*' || hasAnyItem(required, permissions, (r, t) => !!(r === t || r === t.id))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 判断是否有路由需要的角色
|
|
20
|
-
* @param authority 路由权限配置
|
|
21
|
-
* @param roles 用户角色集合
|
|
22
|
-
*/
|
|
23
|
-
function hasRole(authority, roles) {
|
|
24
|
-
let required
|
|
25
|
-
if (typeof authority === 'object')
|
|
26
|
-
required = authority.role
|
|
27
|
-
|
|
28
|
-
return authority === '*' || hasAnyItem(required, roles, (r, t) => !!(r === t || r === t.id))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 判断目标数组是否有所需元素
|
|
33
|
-
* @param {string | string[]}required 所需元素,数组或单个元素
|
|
34
|
-
* @param {string[] | object[]} source 目标数组
|
|
35
|
-
* @param {Function} filter 匹配条件
|
|
36
|
-
* (r: String, s: String|Object) => boolean
|
|
37
|
-
*/
|
|
38
|
-
function hasAnyItem(required, source, filter): boolean {
|
|
39
|
-
if (!required)
|
|
40
|
-
return false
|
|
41
|
-
|
|
42
|
-
const checkedList = Array.isArray(required) ? required : [required]
|
|
43
|
-
return !!source.find(s => checkedList.find(r => filter(r, s)))
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 路由权限校验
|
|
48
|
-
* @param route 路由
|
|
49
|
-
* @param permissions 用户权限集合
|
|
50
|
-
* @param roles 用户角色集合
|
|
51
|
-
*/
|
|
52
|
-
function hasAuthority(route, permissions, roles) {
|
|
53
|
-
// TODO 此处判断可能有问题
|
|
54
|
-
if (!route.meta.pAuthorities)
|
|
55
|
-
return true
|
|
56
|
-
|
|
57
|
-
const authorities = [...route.meta.pAuthorities, route.meta.authority]
|
|
58
|
-
for (const authority of authorities) {
|
|
59
|
-
if (!hasPermission(authority, permissions) && !hasRole(authority, roles))
|
|
60
|
-
return false
|
|
61
|
-
}
|
|
62
|
-
return true
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 根据权限配置过滤菜单数据
|
|
67
|
-
* @param menuData
|
|
68
|
-
* @param permissions
|
|
69
|
-
* @param roles
|
|
70
|
-
*/
|
|
71
|
-
function filterMenu(menuData, permissions, roles) {
|
|
72
|
-
return menuData.filter((menu) => {
|
|
73
|
-
if (menu.meta && menu.meta.invisible === undefined) {
|
|
74
|
-
if (!hasAuthority(menu, permissions, roles))
|
|
75
|
-
return false
|
|
76
|
-
}
|
|
77
|
-
if (menu.children && menu.children.length > 0)
|
|
78
|
-
menu.children = filterMenu(menu.children, permissions, roles)
|
|
79
|
-
|
|
80
|
-
return true
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { filterMenu, hasAuthority }
|
|
1
|
+
/**
|
|
2
|
+
* 判断是否有路由的权限
|
|
3
|
+
* @param authority 路由权限配置
|
|
4
|
+
* @param permissions 用户权限集合
|
|
5
|
+
*/
|
|
6
|
+
function hasPermission(authority: any, permissions: any): boolean {
|
|
7
|
+
let required: string = '*'
|
|
8
|
+
if (typeof authority === 'string')
|
|
9
|
+
required = authority
|
|
10
|
+
else if (Array.isArray(authority))
|
|
11
|
+
required = authority.toString()
|
|
12
|
+
else if (typeof authority === 'object')
|
|
13
|
+
required = authority.permission
|
|
14
|
+
|
|
15
|
+
return required === '*' || hasAnyItem(required, permissions, (r, t) => !!(r === t || r === t.id))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 判断是否有路由需要的角色
|
|
20
|
+
* @param authority 路由权限配置
|
|
21
|
+
* @param roles 用户角色集合
|
|
22
|
+
*/
|
|
23
|
+
function hasRole(authority, roles) {
|
|
24
|
+
let required
|
|
25
|
+
if (typeof authority === 'object')
|
|
26
|
+
required = authority.role
|
|
27
|
+
|
|
28
|
+
return authority === '*' || hasAnyItem(required, roles, (r, t) => !!(r === t || r === t.id))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 判断目标数组是否有所需元素
|
|
33
|
+
* @param {string | string[]}required 所需元素,数组或单个元素
|
|
34
|
+
* @param {string[] | object[]} source 目标数组
|
|
35
|
+
* @param {Function} filter 匹配条件
|
|
36
|
+
* (r: String, s: String|Object) => boolean
|
|
37
|
+
*/
|
|
38
|
+
function hasAnyItem(required, source, filter): boolean {
|
|
39
|
+
if (!required)
|
|
40
|
+
return false
|
|
41
|
+
|
|
42
|
+
const checkedList = Array.isArray(required) ? required : [required]
|
|
43
|
+
return !!source.find(s => checkedList.find(r => filter(r, s)))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 路由权限校验
|
|
48
|
+
* @param route 路由
|
|
49
|
+
* @param permissions 用户权限集合
|
|
50
|
+
* @param roles 用户角色集合
|
|
51
|
+
*/
|
|
52
|
+
function hasAuthority(route, permissions, roles) {
|
|
53
|
+
// TODO 此处判断可能有问题
|
|
54
|
+
if (!route.meta.pAuthorities)
|
|
55
|
+
return true
|
|
56
|
+
|
|
57
|
+
const authorities = [...route.meta.pAuthorities, route.meta.authority]
|
|
58
|
+
for (const authority of authorities) {
|
|
59
|
+
if (!hasPermission(authority, permissions) && !hasRole(authority, roles))
|
|
60
|
+
return false
|
|
61
|
+
}
|
|
62
|
+
return true
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 根据权限配置过滤菜单数据
|
|
67
|
+
* @param menuData
|
|
68
|
+
* @param permissions
|
|
69
|
+
* @param roles
|
|
70
|
+
*/
|
|
71
|
+
function filterMenu(menuData, permissions, roles) {
|
|
72
|
+
return menuData.filter((menu) => {
|
|
73
|
+
if (menu.meta && menu.meta.invisible === undefined) {
|
|
74
|
+
if (!hasAuthority(menu, permissions, roles))
|
|
75
|
+
return false
|
|
76
|
+
}
|
|
77
|
+
if (menu.children && menu.children.length > 0)
|
|
78
|
+
menu.children = filterMenu(menu.children, permissions, roles)
|
|
79
|
+
|
|
80
|
+
return true
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { filterMenu, hasAuthority }
|
package/src/utils/crypto.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import AesEncryptJS from 'crypto-js'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
/**
|
|
5
|
-
* AES加密
|
|
6
|
-
*
|
|
7
|
-
* @param word
|
|
8
|
-
* @param encryKey
|
|
9
|
-
*/
|
|
10
|
-
AESEncrypt(word: string, encryKey: string): string {
|
|
11
|
-
const key = AesEncryptJS.enc.Utf8.parse(encryKey)
|
|
12
|
-
const srcs = AesEncryptJS.enc.Utf8.parse(word)
|
|
13
|
-
const encrypted = AesEncryptJS.AES.encrypt(srcs, key, {
|
|
14
|
-
mode: AesEncryptJS.mode.ECB,
|
|
15
|
-
padding: AesEncryptJS.pad.Pkcs7,
|
|
16
|
-
})
|
|
17
|
-
return encrypted.toString()
|
|
18
|
-
},
|
|
19
|
-
/**
|
|
20
|
-
* AES解密
|
|
21
|
-
*
|
|
22
|
-
* @param word
|
|
23
|
-
* @param encryKey
|
|
24
|
-
*/
|
|
25
|
-
AESDecrypt(word: string, encryKey: string): any {
|
|
26
|
-
const key = AesEncryptJS.enc.Utf8.parse(encryKey)
|
|
27
|
-
const decrypt = AesEncryptJS.AES.decrypt(word, key, {
|
|
28
|
-
mode: AesEncryptJS.mode.ECB,
|
|
29
|
-
padding: AesEncryptJS.pad.Pkcs7,
|
|
30
|
-
})
|
|
31
|
-
const ret = AesEncryptJS.enc.Utf8.stringify(decrypt).toString()
|
|
32
|
-
try {
|
|
33
|
-
return JSON.parse(ret)
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return ret
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
}
|
|
1
|
+
import AesEncryptJS from 'crypto-js'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
/**
|
|
5
|
+
* AES加密
|
|
6
|
+
*
|
|
7
|
+
* @param word
|
|
8
|
+
* @param encryKey
|
|
9
|
+
*/
|
|
10
|
+
AESEncrypt(word: string, encryKey: string): string {
|
|
11
|
+
const key = AesEncryptJS.enc.Utf8.parse(encryKey)
|
|
12
|
+
const srcs = AesEncryptJS.enc.Utf8.parse(word)
|
|
13
|
+
const encrypted = AesEncryptJS.AES.encrypt(srcs, key, {
|
|
14
|
+
mode: AesEncryptJS.mode.ECB,
|
|
15
|
+
padding: AesEncryptJS.pad.Pkcs7,
|
|
16
|
+
})
|
|
17
|
+
return encrypted.toString()
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* AES解密
|
|
21
|
+
*
|
|
22
|
+
* @param word
|
|
23
|
+
* @param encryKey
|
|
24
|
+
*/
|
|
25
|
+
AESDecrypt(word: string, encryKey: string): any {
|
|
26
|
+
const key = AesEncryptJS.enc.Utf8.parse(encryKey)
|
|
27
|
+
const decrypt = AesEncryptJS.AES.decrypt(word, key, {
|
|
28
|
+
mode: AesEncryptJS.mode.ECB,
|
|
29
|
+
padding: AesEncryptJS.pad.Pkcs7,
|
|
30
|
+
})
|
|
31
|
+
const ret = AesEncryptJS.enc.Utf8.stringify(decrypt).toString()
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(ret)
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return ret
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export function executeStrFunction(funcString, args) {
|
|
2
|
-
// 使用 eval 执行传入的函数字符串
|
|
3
|
-
// eslint-disable-next-line no-eval
|
|
4
|
-
return eval(`(${funcString})`)(...args)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function executeStrFunctionByContext(context, fnStr, args) {
|
|
8
|
-
// 使用 new Function 创建函数,并绑定 context 作为 this
|
|
9
|
-
// eslint-disable-next-line no-new-func
|
|
10
|
-
const fn = new Function(`return (${fnStr});`)()
|
|
11
|
-
// 使用 bind 绑定 context,并立即调用
|
|
12
|
-
return fn.bind(context)(...args)
|
|
13
|
-
}
|
|
1
|
+
export function executeStrFunction(funcString, args) {
|
|
2
|
+
// 使用 eval 执行传入的函数字符串
|
|
3
|
+
// eslint-disable-next-line no-eval
|
|
4
|
+
return eval(`(${funcString})`)(...args)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function executeStrFunctionByContext(context, fnStr, args) {
|
|
8
|
+
// 使用 new Function 创建函数,并绑定 context 作为 this
|
|
9
|
+
// eslint-disable-next-line no-new-func
|
|
10
|
+
const fn = new Function(`return (${fnStr});`)()
|
|
11
|
+
// 使用 bind 绑定 context,并立即调用
|
|
12
|
+
return fn.bind(context)(...args)
|
|
13
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Icon as VanIcon,
|
|
7
|
-
} from 'vant'
|
|
8
|
-
import { ref } from 'vue'
|
|
9
|
-
|
|
10
|
-
const configName = ref('get_evaluate_by_id')
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<NormalDataLayout title="评价纪录">
|
|
15
|
-
<template #layout_header_row_right_col>
|
|
16
|
-
<VanIcon class="header_row_icon" name="filter-o" />
|
|
17
|
-
</template>
|
|
18
|
-
<template #layout_content>
|
|
19
|
-
<XCellList :config-name="configName" id-key="t_id" service-name="af-revenue" />
|
|
20
|
-
</template>
|
|
21
|
-
</NormalDataLayout>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<style scoped lang="less">
|
|
25
|
-
.header_row_icon {
|
|
26
|
-
font-size: 18px;
|
|
27
|
-
}
|
|
28
|
-
//.van-tabs {
|
|
29
|
-
// display: flex;
|
|
30
|
-
// flex-flow: column;
|
|
31
|
-
// height: 100%;
|
|
32
|
-
//}
|
|
33
|
-
//:deep(.van-tabs__content) {
|
|
34
|
-
// flex: 1;
|
|
35
|
-
//}
|
|
36
|
-
//:deep(.van-tab__panel) {
|
|
37
|
-
// height: 100%;
|
|
38
|
-
// max-height: 100vh;
|
|
39
|
-
//}
|
|
40
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Icon as VanIcon,
|
|
7
|
+
} from 'vant'
|
|
8
|
+
import { ref } from 'vue'
|
|
9
|
+
|
|
10
|
+
const configName = ref('get_evaluate_by_id')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<NormalDataLayout title="评价纪录">
|
|
15
|
+
<template #layout_header_row_right_col>
|
|
16
|
+
<VanIcon class="header_row_icon" name="filter-o" />
|
|
17
|
+
</template>
|
|
18
|
+
<template #layout_content>
|
|
19
|
+
<XCellList :config-name="configName" id-key="t_id" service-name="af-revenue" />
|
|
20
|
+
</template>
|
|
21
|
+
</NormalDataLayout>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<style scoped lang="less">
|
|
25
|
+
.header_row_icon {
|
|
26
|
+
font-size: 18px;
|
|
27
|
+
}
|
|
28
|
+
//.van-tabs {
|
|
29
|
+
// display: flex;
|
|
30
|
+
// flex-flow: column;
|
|
31
|
+
// height: 100%;
|
|
32
|
+
//}
|
|
33
|
+
//:deep(.van-tabs__content) {
|
|
34
|
+
// flex: 1;
|
|
35
|
+
//}
|
|
36
|
+
//:deep(.van-tab__panel) {
|
|
37
|
+
// height: 100%;
|
|
38
|
+
// max-height: 100vh;
|
|
39
|
+
//}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import FilePreview from '@af-mobile-client-vue3/components/data/FilePreview/index.vue'
|
|
3
|
+
import { onMounted, ref } from 'vue'
|
|
4
|
+
|
|
5
|
+
const previewDocType = ref('pdf')
|
|
6
|
+
const previewDocUrl = ref('/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf')
|
|
7
|
+
|
|
8
|
+
const filePreviewRef = ref<InstanceType<typeof FilePreview> | null>(null)
|
|
9
|
+
|
|
10
|
+
onMounted(() => {
|
|
11
|
+
filePreviewRef.value?.init({
|
|
12
|
+
path: '/resource/af-revenue/pdf/e0a35f3414444d009cbce020af2e617d.pdf',
|
|
13
|
+
})
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div>
|
|
19
|
+
<FilePreview
|
|
20
|
+
ref="filePreviewRef"
|
|
21
|
+
:key="`${previewDocType}-${previewDocUrl}`"
|
|
22
|
+
class="doc-preview-file"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style scoped lang="less">
|
|
28
|
+
</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import MateChat from '@af-mobile-client-vue3/components/common/MateChat/index.vue'
|
|
3
|
-
|
|
4
|
-
// 配置名称,从云端配置中心获取配置
|
|
5
|
-
const configName = '用户端AiChat配置'
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<MateChat :config-name="configName" service-name="af-wechat" />
|
|
10
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import MateChat from '@af-mobile-client-vue3/components/common/MateChat/index.vue'
|
|
3
|
+
|
|
4
|
+
// 配置名称,从云端配置中心获取配置
|
|
5
|
+
const configName = '用户端AiChat配置'
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<MateChat :config-name="configName" service-name="af-wechat" />
|
|
10
|
+
</template>
|