fix(mobile): 待审批时自动弹出并审批后收回面板

This commit is contained in:
JOJO 2026-04-11 18:59:14 +08:00
parent eba36c46da
commit e3bf67d25d
2 changed files with 17 additions and 0 deletions

View File

@ -824,6 +824,9 @@ export const taskPollingMethods = {
if (this.rightWidth < this.minPanelWidth) {
this.rightWidth = this.minPanelWidth;
}
if (this.isMobileViewport && this.activeMobileOverlay !== 'approval') {
this.openMobileOverlay('approval');
}
this.$forceUpdate();
},
@ -837,6 +840,9 @@ export const taskPollingMethods = {
);
if (!this.pendingToolApprovals.length) {
this.rightCollapsed = true;
if (this.isMobileViewport && this.activeMobileOverlay === 'approval') {
this.closeMobileOverlay();
}
}
this.$forceUpdate();
},

View File

@ -689,6 +689,9 @@ export const uiMethods = {
async fetchPendingToolApprovals() {
if (!this.currentConversationId) {
this.pendingToolApprovals = [];
if (this.isMobileViewport && this.activeMobileOverlay === 'approval') {
this.closeMobileOverlay();
}
return;
}
try {
@ -706,6 +709,11 @@ export const uiMethods = {
if (this.rightWidth < this.minPanelWidth) {
this.rightWidth = this.minPanelWidth;
}
if (this.isMobileViewport && this.activeMobileOverlay !== 'approval') {
this.openMobileOverlay('approval');
}
} else if (this.isMobileViewport && this.activeMobileOverlay === 'approval') {
this.closeMobileOverlay();
}
} catch (_error) {
// ignore
@ -740,6 +748,9 @@ export const uiMethods = {
);
if (!this.pendingToolApprovals.length) {
this.rightCollapsed = true;
if (this.isMobileViewport && this.activeMobileOverlay === 'approval') {
this.closeMobileOverlay();
}
}
} catch (error) {
const msg = error instanceof Error ? error.message : String(error || '审批失败');