针对打包做相关调整
This commit is contained in:
@@ -64,6 +64,9 @@
|
||||
|
||||
<!-- 任务中心(仅在引导页显示) -->
|
||||
<TaskCenter v-if="isGuidePage" />
|
||||
|
||||
<!-- 任务操作弹窗 -->
|
||||
<TaskOperationDialog ref="taskOperationDialogRef" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
@@ -83,6 +86,9 @@ import ChatNameTime from './components/ChatNameTime.vue';
|
||||
import ChatAttach from './components/ChatAttach.vue';
|
||||
import ChatInputArea from './components/ChatInputArea.vue';
|
||||
import TaskCenter from './TaskCenter.vue';
|
||||
import TaskOperationDialog from './components/TaskOperationDialog.vue';
|
||||
import emitter from '@utils/emitter';
|
||||
import { taskCenterItem } from '@constant/taskCenterList';
|
||||
|
||||
import { Session } from '../../utils/storage';
|
||||
|
||||
@@ -147,6 +153,16 @@ const isSessionActive = ref(false);
|
||||
/// 指令通用消息类型
|
||||
let commonTypeMessage: string = "";
|
||||
|
||||
// 任务操作弹窗ref
|
||||
const taskOperationDialogRef = ref<InstanceType<typeof TaskOperationDialog> | null>(null);
|
||||
|
||||
// 打开任务操作弹窗
|
||||
const openTaskOperationDialog = (item: taskCenterItem) => {
|
||||
if (taskOperationDialogRef.value) {
|
||||
taskOperationDialogRef.value.open(item);
|
||||
}
|
||||
};
|
||||
|
||||
// WebSocket 相关
|
||||
let webSocketManager: WebSocketManager | null = null;
|
||||
/// 使用统一的连接状态判断函数,避免状态不同步
|
||||
@@ -272,6 +288,8 @@ onMounted(() => {
|
||||
try {
|
||||
// 有token时,加载最近会话、最近消息、初始化socket
|
||||
initHandler();
|
||||
// 监听任务操作事件
|
||||
emitter.on('OPERATION_CHANNEL', openTaskOperationDialog);
|
||||
} catch (error) {
|
||||
console.error("初始化错误:", error);
|
||||
}
|
||||
@@ -822,6 +840,8 @@ const stopRequest = async () => {
|
||||
onUnmounted(() => {
|
||||
console.log("组件销毁");
|
||||
resetConfig();
|
||||
// 移除事件监听
|
||||
emitter.off('OPERATION_CHANNEL', openTaskOperationDialog);
|
||||
});
|
||||
|
||||
const resetConfig = () => {
|
||||
|
||||
Reference in New Issue
Block a user