Skip to content

Commit b031b6a

Browse files
xingyu4jgitee-org
authored andcommitted
!176 fix: bugs
Merge pull request !176 from xingyu/dev
2 parents 66fde8c + cc3bf7e commit b031b6a

File tree

308 files changed

+405
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+405
-362
lines changed

apps/web-antd/src/components/table-action/table-action.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { PropType } from 'vue';
44
55
import type { ActionItem, PopConfirm } from './typing';
66
7-
import { computed, unref } from 'vue';
7+
import { computed, unref, watch } from 'vue';
88
99
import { useAccess } from '@vben/access';
1010
import { IconifyIcon } from '@vben/icons';
@@ -60,21 +60,20 @@ function isIfShow(action: ActionItem): boolean {
6060
6161
/** 处理按钮 actions */
6262
const getActions = computed(() => {
63-
return (props.actions || []).filter((action: ActionItem) => isIfShow(action));
63+
const actions = props.actions || [];
64+
return actions.filter((action: ActionItem) => isIfShow(action));
6465
});
6566
6667
/** 处理下拉菜单 actions */
6768
const getDropdownList = computed(() => {
68-
return (props.dropDownActions || []).filter((action: ActionItem) =>
69-
isIfShow(action),
70-
);
69+
const dropDownActions = props.dropDownActions || [];
70+
return dropDownActions.filter((action: ActionItem) => isIfShow(action));
7171
});
7272
7373
/** Space 组件的 size */
7474
const spaceSize = computed(() => {
75-
return unref(getActions)?.some((item: ActionItem) => item.type === 'link')
76-
? 0
77-
: 8;
75+
const actions = unref(getActions);
76+
return actions?.some((item: ActionItem) => item.type === 'link') ? 0 : 8;
7877
});
7978
8079
/** 获取 PopConfirm 属性 */
@@ -137,6 +136,15 @@ function handleButtonClick(action: ActionItem) {
137136
action.onClick();
138137
}
139138
}
139+
140+
// 监听props变化,强制重新计算
141+
watch(
142+
() => [props.actions, props.dropDownActions],
143+
() => {
144+
// 这里不需要额外处理,computed会自动重新计算
145+
},
146+
{ deep: true },
147+
);
140148
</script>
141149

142150
<template>

apps/web-antd/src/store/auth.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,26 @@ export const useAuthStore = defineStore('auth', () => {
4444
// 异步处理用户登录操作并获取 accessToken
4545
let userInfo: null | UserInfo = null;
4646
try {
47+
let loginResult: AuthApi.LoginResult;
4748
loginLoading.value = true;
48-
const { accessToken, refreshToken } =
49-
type === 'mobile'
50-
? await smsLogin(params as AuthApi.SmsLoginParams)
51-
: type === 'register'
52-
? await register(params as AuthApi.RegisterParams)
53-
: // eslint-disable-next-line unicorn/no-nested-ternary
54-
type === 'social'
55-
? await socialLogin(params as AuthApi.SocialLoginParams)
56-
: await loginApi(params);
49+
switch (type) {
50+
case 'mobile': {
51+
loginResult = await smsLogin(params as AuthApi.SmsLoginParams);
52+
break;
53+
}
54+
case 'register': {
55+
loginResult = await register(params as AuthApi.RegisterParams);
56+
break;
57+
}
58+
case 'social': {
59+
loginResult = await socialLogin(params as AuthApi.SocialLoginParams);
60+
break;
61+
}
62+
default: {
63+
loginResult = await loginApi(params);
64+
}
65+
}
66+
const { accessToken, refreshToken } = loginResult;
5767

5868
// 如果成功获取到 accessToken
5969
if (accessToken) {

apps/web-antd/src/views/ai/chat/manager/modules/ChatConversationList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
6969
keyField: 'id',
7070
},
7171
toolbarConfig: {
72-
refresh: { code: 'query' },
72+
refresh: true,
7373
search: true,
7474
},
7575
} as VxeTableGridOptions<AiChatConversationApi.ChatConversation>,

apps/web-antd/src/views/ai/chat/manager/modules/ChatMessageList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
6666
keyField: 'id',
6767
},
6868
toolbarConfig: {
69-
refresh: { code: 'query' },
69+
refresh: true,
7070
search: true,
7171
},
7272
} as VxeTableGridOptions<AiChatConversationApi.ChatConversation>,

apps/web-antd/src/views/ai/image/manager/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
7979
keyField: 'id',
8080
},
8181
toolbarConfig: {
82-
refresh: { code: 'query' },
82+
refresh: true,
8383
search: true,
8484
},
8585
} as VxeTableGridOptions<AiImageApi.Image>,

apps/web-antd/src/views/ai/knowledge/document/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
117117
keyField: 'id',
118118
},
119119
toolbarConfig: {
120-
refresh: { code: 'query' },
120+
refresh: true,
121121
search: true,
122122
},
123123
} as VxeTableGridOptions<AiKnowledgeDocumentApi.KnowledgeDocument>,

apps/web-antd/src/views/ai/knowledge/knowledge/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
9595
keyField: 'id',
9696
},
9797
toolbarConfig: {
98-
refresh: { code: 'query' },
98+
refresh: true,
9999
search: true,
100100
},
101101
} as VxeTableGridOptions<AiKnowledgeKnowledgeApi.Knowledge>,

apps/web-antd/src/views/ai/knowledge/segment/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
8686
keyField: 'id',
8787
},
8888
toolbarConfig: {
89-
refresh: { code: 'query' },
89+
refresh: true,
9090
search: true,
9191
},
9292
} as VxeTableGridOptions<AiKnowledgeKnowledgeApi.Knowledge>,

apps/web-antd/src/views/ai/mindmap/manager/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
7070
keyField: 'id',
7171
},
7272
toolbarConfig: {
73-
refresh: { code: 'query' },
73+
refresh: true,
7474
search: true,
7575
},
7676
} as VxeTableGridOptions<AiMindmapApi.MindMap>,

apps/web-antd/src/views/ai/model/apiKey/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
7474
keyField: 'id',
7575
},
7676
toolbarConfig: {
77-
refresh: { code: 'query' },
77+
refresh: true,
7878
search: true,
7979
},
8080
} as VxeTableGridOptions<AiModelApiKeyApi.ApiKey>,

0 commit comments

Comments
 (0)