增加供应商智能添加功能

This commit is contained in:
2026-09-04 00:09:32 +08:00
parent d8936d9730
commit 20be7f4817
29 changed files with 4317 additions and 1476 deletions
@@ -4,6 +4,7 @@
<el-button type="primary" class="new-chat-btn" :icon="ChatDotRound" @click="handleNewChat">
新建对话
</el-button>
<el-button :icon="Cpu" class="mcp-btn" @click="handleMcpConfig" title="MCP 工具中心" />
<el-button :icon="Setting" class="settings-btn" @click="settingsVisible = true" title="AI接入设置" />
</div>
@@ -52,15 +53,17 @@
</div>
<ProviderDialog v-model="settingsVisible" @change="handleProviderChange" />
<McpConfig v-model="mcpConfigVisible" />
</div>
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import { ref, onMounted, nextTick, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ChatDotRound, Setting, Delete, Edit } from '@element-plus/icons-vue'
import { ChatDotRound, Setting, Delete, Edit, Cpu } from '@element-plus/icons-vue'
import { getChatSessionList, createChatSession, deleteChatSession, updateChatSession } from '@/api/ai'
import ProviderDialog from './providerDialog.vue'
import McpConfig from './mcpConfig.vue'
const emit = defineEmits(['select', 'new', 'rename'])
@@ -68,6 +71,7 @@ const loading = ref(false)
const list = ref([])
const currentId = ref(null)
const settingsVisible = ref(false)
const mcpConfigVisible = ref(false)
// 重命名
const editingId = ref(null)
@@ -176,6 +180,10 @@ function handleProviderChange() {
// 配置变更后不需要特殊处理
}
function handleMcpConfig() {
mcpConfigVisible.value = true
}
defineExpose({
fetchList,
setCurrent: (id) => { currentId.value = id }
@@ -205,6 +213,11 @@ defineExpose({
width: 36px;
padding: 0;
}
.mcp-btn {
width: 36px;
padding: 0;
}
}
.session-list {