af-mobile-client-vue3 1.3.43 → 1.3.45
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/package.json
CHANGED
|
@@ -75,6 +75,8 @@ const emit = defineEmits<{
|
|
|
75
75
|
// 多选相关事件
|
|
76
76
|
(e: 'multiSelectAction', action: string, selectedItems: any[], selectedItemsArray: any[]): void
|
|
77
77
|
(e: 'selectionChange', selectedItems: any[]): void
|
|
78
|
+
// 加载完成后触发事件
|
|
79
|
+
(e: 'afterLoad', params: any): void
|
|
78
80
|
}>()
|
|
79
81
|
|
|
80
82
|
const userState = useUserStore().getLogin()
|
|
@@ -385,6 +387,8 @@ function onLoad(defaultParams = {}) {
|
|
|
385
387
|
finished.value = true
|
|
386
388
|
isError.value = true
|
|
387
389
|
}).finally(() => {
|
|
390
|
+
// 加载完成后,触发afterLoad事件
|
|
391
|
+
emit('afterLoad', { searchVal, ...fixQueryForm, ...mergedParams })
|
|
388
392
|
// 加载状态结束
|
|
389
393
|
loading.value = false
|
|
390
394
|
refreshing.value = false
|
|
@@ -54,7 +54,7 @@ export function getExternalUserRoutes(): RouteRecordRaw[] {
|
|
|
54
54
|
* 检查路由是否为外部用户路由
|
|
55
55
|
*/
|
|
56
56
|
export function isExternalUserRoute(path: string): boolean {
|
|
57
|
-
return path.startsWith('/ex')
|
|
57
|
+
return path.startsWith('/ex/')
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export default externalUserRoutes
|
package/src/router/routes.ts
CHANGED
|
@@ -61,7 +61,7 @@ const routes: Array<RouteRecordRaw> = [
|
|
|
61
61
|
// 外部用户:尝试获取平台路由前缀
|
|
62
62
|
const platformPrefix = getPlatformRoutePrefix(platformType)
|
|
63
63
|
|
|
64
|
-
if (platformPrefix && platformPrefix !== '/ex') {
|
|
64
|
+
if (platformPrefix && platformPrefix !== '/ex/') {
|
|
65
65
|
return platformPrefix
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/types/platform.ts
CHANGED
|
@@ -63,14 +63,14 @@ export interface PlatformConfig {
|
|
|
63
63
|
* 平台类型与路由前缀的映射配置
|
|
64
64
|
*/
|
|
65
65
|
export const PLATFORM_ROUTE_MAP: Record<PlatformType, string> = {
|
|
66
|
-
[PlatformType.WECHAT_OFFICIAL]: '/wechat',
|
|
67
|
-
[PlatformType.WECHAT_MINI]: '/wx-mini-program',
|
|
68
|
-
[PlatformType.ALIPAY]: '/alipay',
|
|
69
|
-
[PlatformType.DINGTALK]: '/ding-talk',
|
|
70
|
-
[PlatformType.THIRD_PARTY_APP]: '/app',
|
|
71
|
-
[PlatformType.FEISHU]: '/feishu',
|
|
72
|
-
[PlatformType.TIKTOK]: '/tiktok',
|
|
73
|
-
[PlatformType.CUSTOM]: '/custom',
|
|
66
|
+
[PlatformType.WECHAT_OFFICIAL]: '/wechat/',
|
|
67
|
+
[PlatformType.WECHAT_MINI]: '/wx-mini-program/',
|
|
68
|
+
[PlatformType.ALIPAY]: '/alipay/',
|
|
69
|
+
[PlatformType.DINGTALK]: '/ding-talk/',
|
|
70
|
+
[PlatformType.THIRD_PARTY_APP]: '/app/',
|
|
71
|
+
[PlatformType.FEISHU]: '/feishu/',
|
|
72
|
+
[PlatformType.TIKTOK]: '/tiktok/',
|
|
73
|
+
[PlatformType.CUSTOM]: '/custom/',
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|
|
@@ -80,49 +80,49 @@ export const PLATFORM_CONFIGS: Record<PlatformType, PlatformConfig> = {
|
|
|
80
80
|
[PlatformType.WECHAT_OFFICIAL]: {
|
|
81
81
|
type: PlatformType.WECHAT_OFFICIAL,
|
|
82
82
|
name: '微信公众号',
|
|
83
|
-
routePrefix: '/wechat',
|
|
83
|
+
routePrefix: '/wechat/',
|
|
84
84
|
description: '微信公众号外部用户',
|
|
85
85
|
},
|
|
86
86
|
[PlatformType.WECHAT_MINI]: {
|
|
87
87
|
type: PlatformType.WECHAT_MINI,
|
|
88
88
|
name: '微信小程序',
|
|
89
|
-
routePrefix: '/wx-mini-program',
|
|
89
|
+
routePrefix: '/wx-mini-program/',
|
|
90
90
|
description: '微信小程序用户',
|
|
91
91
|
},
|
|
92
92
|
[PlatformType.ALIPAY]: {
|
|
93
93
|
type: PlatformType.ALIPAY,
|
|
94
94
|
name: '支付宝',
|
|
95
|
-
routePrefix: '/alipay',
|
|
95
|
+
routePrefix: '/alipay/',
|
|
96
96
|
description: '支付宝用户',
|
|
97
97
|
},
|
|
98
98
|
[PlatformType.DINGTALK]: {
|
|
99
99
|
type: PlatformType.DINGTALK,
|
|
100
100
|
name: '钉钉',
|
|
101
|
-
routePrefix: '/ding-talk',
|
|
101
|
+
routePrefix: '/ding-talk/',
|
|
102
102
|
description: '钉钉用户',
|
|
103
103
|
},
|
|
104
104
|
[PlatformType.THIRD_PARTY_APP]: {
|
|
105
105
|
type: PlatformType.THIRD_PARTY_APP,
|
|
106
106
|
name: '第三方应用',
|
|
107
|
-
routePrefix: '/app',
|
|
107
|
+
routePrefix: '/app/',
|
|
108
108
|
description: '第三方应用用户',
|
|
109
109
|
},
|
|
110
110
|
[PlatformType.FEISHU]: {
|
|
111
111
|
type: PlatformType.FEISHU,
|
|
112
112
|
name: '飞书',
|
|
113
|
-
routePrefix: '/feishu',
|
|
113
|
+
routePrefix: '/feishu/',
|
|
114
114
|
description: '飞书用户',
|
|
115
115
|
},
|
|
116
116
|
[PlatformType.TIKTOK]: {
|
|
117
117
|
type: PlatformType.TIKTOK,
|
|
118
118
|
name: '抖音',
|
|
119
|
-
routePrefix: '/tiktok',
|
|
119
|
+
routePrefix: '/tiktok/',
|
|
120
120
|
description: '抖音用户',
|
|
121
121
|
},
|
|
122
122
|
[PlatformType.CUSTOM]: {
|
|
123
123
|
type: PlatformType.CUSTOM,
|
|
124
124
|
name: '自定义平台',
|
|
125
|
-
routePrefix: '/custom',
|
|
125
|
+
routePrefix: '/custom/',
|
|
126
126
|
description: '自定义平台用户',
|
|
127
127
|
},
|
|
128
128
|
}
|
|
@@ -130,15 +130,15 @@ export const PLATFORM_CONFIGS: Record<PlatformType, PlatformConfig> = {
|
|
|
130
130
|
/**
|
|
131
131
|
* 根据平台类型获取路由前缀
|
|
132
132
|
* @param platformType 平台类型
|
|
133
|
-
* @returns 路由前缀,默认为 '/ex'
|
|
133
|
+
* @returns 路由前缀,默认为 '/ex/'
|
|
134
134
|
*/
|
|
135
135
|
export function getPlatformRoutePrefix(platformType?: string): string {
|
|
136
136
|
if (!platformType) {
|
|
137
|
-
return '/ex' // 默认外部用户路径
|
|
137
|
+
return '/ex/' // 默认外部用户路径
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
const route = PLATFORM_ROUTE_MAP[platformType as PlatformType]
|
|
141
|
-
return route || '/ex' // 找不到时使用默认路径
|
|
141
|
+
return route || '/ex/' // 找不到时使用默认路径
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
/**
|
|
@@ -127,8 +127,7 @@ export function isExternalUser(to: RouteLocationNormalized): ExternalUserResult
|
|
|
127
127
|
// 第三层检测:路由前缀检测
|
|
128
128
|
// 检查路径是否以外部用户路由前缀开头
|
|
129
129
|
const platformPrefixes = Object.values(PLATFORM_ROUTE_MAP)
|
|
130
|
-
const isExternalRoute = platformPrefixes.some(prefix => to.path.startsWith(prefix)) || to.path.startsWith('/ex')
|
|
131
|
-
|
|
130
|
+
const isExternalRoute = platformPrefixes.some(prefix => to.path.startsWith(prefix)) || to.path.startsWith('/ex/')
|
|
132
131
|
if (isExternalRoute) {
|
|
133
132
|
// 暂未实现 后续需要增加登陆参数
|
|
134
133
|
return {
|
|
@@ -106,6 +106,11 @@ function handleSelectionChange(selectedItems: any[]) {
|
|
|
106
106
|
console.log('选择变化,当前选中:', selectedItems.length, '个项目')
|
|
107
107
|
// 可以在这里更新UI状态,比如显示选中数量等
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
// 数据加载完成后处理 @after-load
|
|
111
|
+
function afterLoad(result) {
|
|
112
|
+
console.log('afterLoad:', result)
|
|
113
|
+
}
|
|
109
114
|
</script>
|
|
110
115
|
|
|
111
116
|
<template>
|