mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 10:26:43 +08:00
feat(portal):优化AI对话窗口状态管理
- 移除硬编码的HTTP地址注释 - 修改最小化窗口点击事件处理逻辑- 移除窗口状态自动恢复的旧逻辑 - 新增restore事件机制处理窗口状态- 调整按钮图标颜色值- 完善AI Call组件的状态控制逻辑 - 保留
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
<!-- 添加AI Call组件 -->
|
||||
<AICall
|
||||
:dialogVisible="showAICall"
|
||||
@close="onCloseAICall"
|
||||
@close="onCloseAICall"
|
||||
@restore="onRestoreAICall"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -31,6 +32,11 @@
|
||||
this.$store.dispatch('app/setShowAICall', false);
|
||||
},
|
||||
|
||||
onRestoreAICall() {
|
||||
// 通过Vuex显示AI Call组件
|
||||
this.$store.dispatch('app/setShowAICall', true);
|
||||
},
|
||||
|
||||
// 检查当前路由是否应该显示AI弹窗
|
||||
checkRouteForAICall() {
|
||||
const currentRoute = this.$route.name;
|
||||
@@ -38,6 +44,7 @@
|
||||
if (currentRoute === 'case' || currentRoute === 'caseDetail') {
|
||||
// 设置最小化窗口显示状态为true
|
||||
this.$store.dispatch('app/setShowAICallMinimized', true);
|
||||
// 注意:这里不再强制设置showAICall为true,保留用户之前的操作状态
|
||||
} else {
|
||||
// 其他路由关闭弹窗
|
||||
this.$store.dispatch('app/setShowAICall', false);
|
||||
|
||||
@@ -71,14 +71,14 @@
|
||||
<div
|
||||
class="minimized-window"
|
||||
v-show="windowState === 'minimized' && showMinimizedWindow"
|
||||
@click="maximizeWindow"
|
||||
@click="onMinimizedWindowClick"
|
||||
>
|
||||
<div class="minimized-content">
|
||||
<span class="window-title">案例专家</span>
|
||||
<el-button
|
||||
type="text"
|
||||
class="window-control-btn"
|
||||
@click.stop="maximizeWindow"
|
||||
@click.stop="onMinimizedWindowClick"
|
||||
>
|
||||
<i class="el-icon-full-screen"></i>
|
||||
</el-button>
|
||||
@@ -141,10 +141,7 @@ export default {
|
||||
watch: {
|
||||
dialogVisible(newVal) {
|
||||
console.log(newVal);
|
||||
if (newVal) {
|
||||
// 每次打开时默认最大化
|
||||
this.windowState = 'maximized';
|
||||
}
|
||||
// 移除之前的逻辑,因为现在通过事件机制处理状态恢复
|
||||
},
|
||||
messageList: {
|
||||
handler() {
|
||||
@@ -235,6 +232,16 @@ export default {
|
||||
if (this.isAutoScroll && this.$refs.messageContainer) {
|
||||
this.$refs.messageContainer.scrollTop = this.$refs.messageContainer.scrollHeight;
|
||||
}
|
||||
},
|
||||
|
||||
// 最小化窗口的点击事件处理方法
|
||||
onMinimizedWindowClick() {
|
||||
// 当点击最小化窗口时,如果dialogVisible为false,则通过事件通知父组件显示对话框
|
||||
if (!this.dialogVisible) {
|
||||
this.$emit('restore');
|
||||
}
|
||||
// 然后将窗口状态设置为最大化
|
||||
this.windowState = 'maximized';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,7 +284,7 @@ export default {
|
||||
.window-control-btn {
|
||||
font-size: 18px;
|
||||
padding: 5px 10px;
|
||||
color: #000000; /* 黑色图标 */
|
||||
color: #333; /* 黑色图标 */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,4 +443,4 @@ export default {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -91,7 +91,6 @@ export default {
|
||||
conversationId: this.conversationId,
|
||||
query: question
|
||||
};
|
||||
// http://192.168.3.178:9091
|
||||
// 创建POST请求
|
||||
fetch('/systemapi/xboe/m/boe/case/ai/chat',{
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user