2025-03-14 23:48:59 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="welcome">
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<HeaderBar/>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
|
|
|
|
|
|
<div class="operation-bar">
|
|
|
|
|
|
<h2 class="page-title">角色配置</h2>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="main-wrapper">
|
|
|
|
|
|
<div class="content-panel">
|
|
|
|
|
|
<div class="content-area">
|
|
|
|
|
|
<el-card class="config-card" shadow="never">
|
|
|
|
|
|
<div class="config-header">
|
|
|
|
|
|
<div class="header-icon">
|
|
|
|
|
|
<img loading="lazy" src="@/assets/home/setting-user.png" alt="">
|
2025-03-14 23:48:59 +08:00
|
|
|
|
</div>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
<span class="header-title">{{ form.agentName }}</span>
|
2025-05-14 12:09:29 +08:00
|
|
|
|
<div class="header-actions">
|
|
|
|
|
|
<div class="hint-text">
|
|
|
|
|
|
<img loading="lazy" src="@/assets/home/info.png" alt="">
|
|
|
|
|
|
<span>保存配置后,需要重启设备,新的配置才会生效。</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-button type="primary" class="save-btn" @click="saveConfig">保存配置</el-button>
|
|
|
|
|
|
<el-button class="reset-btn" @click="resetConfig">重置</el-button>
|
|
|
|
|
|
<button class="custom-close-btn" @click="goToHome">
|
|
|
|
|
|
×
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="divider"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form ref="form" :model="form" label-width="72px">
|
|
|
|
|
|
<div class="form-content">
|
|
|
|
|
|
<div class="form-grid">
|
|
|
|
|
|
<div class="form-column">
|
|
|
|
|
|
<el-form-item label="助手昵称:">
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<el-input v-model="form.agentName" class="form-input" maxlength="10"/>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="角色模版:">
|
|
|
|
|
|
<div class="template-container">
|
2025-05-01 16:57:58 +08:00
|
|
|
|
<div v-for="(template, index) in templates" :key="`template-${index}`" class="template-item"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
:class="{ 'template-loading': loadingTemplate }" @click="selectTemplate(template)">
|
2025-04-16 11:17:02 +08:00
|
|
|
|
{{ template.agentName }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="角色介绍:">
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<el-input type="textarea" rows="9" resize="none" placeholder="请输入内容"
|
|
|
|
|
|
v-model="form.systemPrompt"
|
|
|
|
|
|
maxlength="2000" show-word-limit class="form-textarea"/>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</el-form-item>
|
2025-05-14 12:09:29 +08:00
|
|
|
|
|
|
|
|
|
|
<el-form-item label="记忆:">
|
2025-05-14 22:28:36 +08:00
|
|
|
|
<el-input type="textarea" rows="6" resize="none" v-model="form.summaryMemory" maxlength="2000"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
show-word-limit class="form-textarea"
|
|
|
|
|
|
:disabled="form.model.memModelId !== 'Memory_mem_local_short'"/>
|
2025-05-14 03:27:32 +08:00
|
|
|
|
</el-form-item>
|
2025-05-01 16:57:58 +08:00
|
|
|
|
<el-form-item label="语言编码:" style="display: none;">
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<el-input v-model="form.langCode" placeholder="请输入语言编码,如:zh_CN" maxlength="10"
|
|
|
|
|
|
show-word-limit
|
|
|
|
|
|
class="form-input"/>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</el-form-item>
|
2025-05-01 16:57:58 +08:00
|
|
|
|
<el-form-item label="交互语种:" style="display: none;">
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<el-input v-model="form.language" placeholder="请输入交互语种,如:中文" maxlength="10"
|
|
|
|
|
|
show-word-limit
|
|
|
|
|
|
class="form-input"/>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</el-form-item>
|
2025-04-06 15:45:18 +08:00
|
|
|
|
</div>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
<div class="form-column">
|
2025-06-01 13:34:32 +08:00
|
|
|
|
<div class="model-row">
|
|
|
|
|
|
<el-form-item label="语音活动检测(VAD)" class="model-item">
|
|
|
|
|
|
<div class="model-select-wrapper">
|
|
|
|
|
|
<el-select v-model="form.model.vadModelId" filterable placeholder="请选择" class="form-select"
|
|
|
|
|
|
@change="handleModelChange('VAD', $event)">
|
|
|
|
|
|
<el-option v-for="(item, optionIndex) in modelOptions['VAD']"
|
|
|
|
|
|
:key="`option-vad-${optionIndex}`" :label="item.label" :value="item.value" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="语音识别(ASR)" class="model-item">
|
|
|
|
|
|
<div class="model-select-wrapper">
|
|
|
|
|
|
<el-select v-model="form.model.asrModelId" filterable placeholder="请选择" class="form-select"
|
|
|
|
|
|
@change="handleModelChange('ASR', $event)">
|
|
|
|
|
|
<el-option v-for="(item, optionIndex) in modelOptions['ASR']"
|
|
|
|
|
|
:key="`option-asr-${optionIndex}`" :label="item.label" :value="item.value" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-form-item v-for="(model, index) in models.slice(2)" :key="`model-${index}`" :label="model.label"
|
2025-05-01 16:57:58 +08:00
|
|
|
|
class="model-item">
|
2025-05-12 14:10:05 +08:00
|
|
|
|
<div class="model-select-wrapper">
|
2025-05-12 15:49:44 +08:00
|
|
|
|
<el-select v-model="form.model[model.key]" filterable placeholder="请选择" class="form-select"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
@change="handleModelChange(model.type, $event)">
|
2025-05-12 15:49:44 +08:00
|
|
|
|
<el-option v-for="(item, optionIndex) in modelOptions[model.type]"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
:key="`option-${index}-${optionIndex}`" :label="item.label" :value="item.value"/>
|
2025-05-12 14:10:05 +08:00
|
|
|
|
</el-select>
|
2025-05-12 15:49:44 +08:00
|
|
|
|
<div v-if="showFunctionIcons(model.type)" class="function-icons">
|
|
|
|
|
|
<el-tooltip v-for="func in currentFunctions" :key="func.name" effect="dark" placement="top"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
popper-class="custom-tooltip">
|
2025-05-12 15:49:44 +08:00
|
|
|
|
<div slot="content">
|
|
|
|
|
|
<div><strong>功能名称:</strong> {{ func.name }}</div>
|
|
|
|
|
|
<div v-if="Object.keys(func.params).length > 0">
|
|
|
|
|
|
<strong>参数配置:</strong>
|
|
|
|
|
|
<div v-for="(value, key) in func.params" :key="key">
|
|
|
|
|
|
{{ key }}: {{ value }}
|
2025-05-12 14:10:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-05-12 15:49:44 +08:00
|
|
|
|
<div v-else>无参数配置</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="icon-dot" :style="{ backgroundColor: getFunctionColor(func.name) }">
|
|
|
|
|
|
{{ func.name.charAt(0) }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-tooltip>
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<el-button
|
|
|
|
|
|
class="edit-function-btn"
|
|
|
|
|
|
@click="openFunctionDialog"
|
|
|
|
|
|
:class="{ 'active-btn': showFunctionDialog }">
|
2025-05-12 15:49:44 +08:00
|
|
|
|
编辑功能
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="model.type === 'Memory' && form.model.memModelId !== 'Memory_nomem'"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
class="chat-history-options">
|
2025-05-12 15:49:44 +08:00
|
|
|
|
<el-radio-group v-model="form.chatHistoryConf" @change="updateChatHistoryConf">
|
|
|
|
|
|
<el-radio-button :label="1">上报文字</el-radio-button>
|
|
|
|
|
|
<el-radio-button :label="2">上报文字+语音</el-radio-button>
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</div>
|
2025-05-12 14:10:05 +08:00
|
|
|
|
</div>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</el-form-item>
|
2025-05-11 03:19:40 +08:00
|
|
|
|
<el-form-item label="角色音色">
|
2025-05-01 16:57:58 +08:00
|
|
|
|
<el-select v-model="form.ttsVoiceId" placeholder="请选择" class="form-select">
|
|
|
|
|
|
<el-option v-for="(item, index) in voiceOptions" :key="`voice-${index}`" :label="item.label"
|
2025-05-29 00:58:20 +08:00
|
|
|
|
:value="item.value"/>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</el-card>
|
2025-03-14 23:48:59 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</div>
|
2025-05-12 14:10:05 +08:00
|
|
|
|
|
2025-05-29 00:58:20 +08:00
|
|
|
|
<function-dialog
|
|
|
|
|
|
v-model="showFunctionDialog"
|
|
|
|
|
|
:functions="currentFunctions"
|
|
|
|
|
|
:all-functions="allFunctions"
|
|
|
|
|
|
@update-functions="handleUpdateFunctions"
|
|
|
|
|
|
@dialog-closed="handleDialogClosed"/>
|
2025-03-14 23:48:59 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-04-05 21:03:46 +08:00
|
|
|
|
import Api from '@/apis/api';
|
2025-05-12 14:10:05 +08:00
|
|
|
|
import FunctionDialog from "@/components/FunctionDialog.vue";
|
2025-05-12 15:49:44 +08:00
|
|
|
|
import HeaderBar from "@/components/HeaderBar.vue";
|
2025-03-14 23:48:59 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'RoleConfigPage',
|
2025-05-29 00:58:20 +08:00
|
|
|
|
components: {HeaderBar, FunctionDialog},
|
2025-03-14 23:48:59 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
form: {
|
2025-03-28 11:20:08 +08:00
|
|
|
|
agentCode: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
agentName: "",
|
|
|
|
|
|
ttsVoiceId: "",
|
2025-05-12 15:49:44 +08:00
|
|
|
|
chatHistoryConf: 0,
|
2025-03-24 17:27:08 +08:00
|
|
|
|
systemPrompt: "",
|
2025-05-14 03:27:32 +08:00
|
|
|
|
summaryMemory: "",
|
2025-03-28 11:20:08 +08:00
|
|
|
|
langCode: "",
|
|
|
|
|
|
language: "",
|
|
|
|
|
|
sort: "",
|
2025-03-18 21:49:57 +08:00
|
|
|
|
model: {
|
2025-03-24 17:27:08 +08:00
|
|
|
|
ttsModelId: "",
|
|
|
|
|
|
vadModelId: "",
|
2025-03-28 11:20:08 +08:00
|
|
|
|
asrModelId: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
llmModelId: "",
|
2025-06-01 13:34:32 +08:00
|
|
|
|
vllmModelId: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
memModelId: "",
|
|
|
|
|
|
intentModelId: "",
|
2025-03-18 21:49:57 +08:00
|
|
|
|
}
|
2025-03-14 23:48:59 +08:00
|
|
|
|
},
|
2025-03-18 23:08:13 +08:00
|
|
|
|
models: [
|
2025-05-01 16:57:58 +08:00
|
|
|
|
{ label: '语音活动检测(VAD)', key: 'vadModelId', type: 'VAD' },
|
|
|
|
|
|
{ label: '语音识别(ASR)', key: 'asrModelId', type: 'ASR' },
|
|
|
|
|
|
{ label: '大语言模型(LLM)', key: 'llmModelId', type: 'LLM' },
|
2025-06-03 17:30:35 +08:00
|
|
|
|
{ label: '视觉大模型(VLLM)', key: 'vllmModelId', type: 'VLLM' },
|
2025-05-01 16:57:58 +08:00
|
|
|
|
{ label: '意图识别(Intent)', key: 'intentModelId', type: 'Intent' },
|
|
|
|
|
|
{ label: '记忆(Memory)', key: 'memModelId', type: 'Memory' },
|
|
|
|
|
|
{ label: '语音合成(TTS)', key: 'ttsModelId', type: 'TTS' },
|
2025-03-24 17:27:08 +08:00
|
|
|
|
],
|
2025-04-06 15:45:18 +08:00
|
|
|
|
modelOptions: {},
|
|
|
|
|
|
templates: [],
|
|
|
|
|
|
loadingTemplate: false,
|
|
|
|
|
|
voiceOptions: [],
|
2025-05-12 14:10:05 +08:00
|
|
|
|
showFunctionDialog: false,
|
|
|
|
|
|
currentFunctions: [],
|
|
|
|
|
|
functionColorMap: [
|
|
|
|
|
|
'#FF6B6B', '#4ECDC4', '#45B7D1',
|
|
|
|
|
|
'#96CEB4', '#FFEEAD', '#D4A5A5', '#A2836E'
|
|
|
|
|
|
],
|
2025-05-29 00:58:20 +08:00
|
|
|
|
allFunctions: [],
|
|
|
|
|
|
originalFunctions: [],
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2025-04-21 10:24:04 +08:00
|
|
|
|
goToHome() {
|
|
|
|
|
|
this.$router.push('/home');
|
|
|
|
|
|
},
|
2025-03-14 23:48:59 +08:00
|
|
|
|
saveConfig() {
|
2025-03-28 11:20:08 +08:00
|
|
|
|
const configData = {
|
|
|
|
|
|
agentCode: this.form.agentCode,
|
|
|
|
|
|
agentName: this.form.agentName,
|
|
|
|
|
|
asrModelId: this.form.model.asrModelId,
|
|
|
|
|
|
vadModelId: this.form.model.vadModelId,
|
|
|
|
|
|
llmModelId: this.form.model.llmModelId,
|
2025-06-01 13:34:32 +08:00
|
|
|
|
vllmModelId: this.form.model.vllmModelId,
|
2025-03-28 11:20:08 +08:00
|
|
|
|
ttsModelId: this.form.model.ttsModelId,
|
|
|
|
|
|
ttsVoiceId: this.form.ttsVoiceId,
|
2025-05-11 03:19:40 +08:00
|
|
|
|
chatHistoryConf: this.form.chatHistoryConf,
|
2025-03-28 11:20:08 +08:00
|
|
|
|
memModelId: this.form.model.memModelId,
|
|
|
|
|
|
intentModelId: this.form.model.intentModelId,
|
|
|
|
|
|
systemPrompt: this.form.systemPrompt,
|
2025-05-14 03:27:32 +08:00
|
|
|
|
summaryMemory: this.form.summaryMemory,
|
2025-03-28 11:20:08 +08:00
|
|
|
|
langCode: this.form.langCode,
|
|
|
|
|
|
language: this.form.language,
|
2025-05-12 14:10:05 +08:00
|
|
|
|
sort: this.form.sort,
|
2025-05-29 00:58:20 +08:00
|
|
|
|
functions: this.currentFunctions.map(item => {
|
|
|
|
|
|
return ({
|
|
|
|
|
|
pluginId: item.id,
|
|
|
|
|
|
paramInfo: item.params
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2025-03-28 11:20:08 +08:00
|
|
|
|
};
|
2025-05-29 00:58:20 +08:00
|
|
|
|
Api.agent.updateAgentConfig(this.$route.query.agentId, configData, ({data}) => {
|
2025-04-05 21:03:46 +08:00
|
|
|
|
if (data.code === 0) {
|
2025-04-07 15:14:20 +08:00
|
|
|
|
this.$message.success({
|
|
|
|
|
|
message: '配置保存成功',
|
|
|
|
|
|
showClose: true
|
|
|
|
|
|
});
|
2025-04-05 21:03:46 +08:00
|
|
|
|
} else {
|
2025-04-07 15:14:20 +08:00
|
|
|
|
this.$message.error({
|
|
|
|
|
|
message: data.msg || '配置保存失败',
|
|
|
|
|
|
showClose: true
|
|
|
|
|
|
});
|
2025-04-05 21:03:46 +08:00
|
|
|
|
}
|
2025-03-28 11:20:08 +08:00
|
|
|
|
});
|
2025-03-14 23:48:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
resetConfig() {
|
|
|
|
|
|
this.$confirm('确定要重置配置吗?', '提示', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
this.form = {
|
2025-03-28 11:20:08 +08:00
|
|
|
|
agentCode: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
agentName: "",
|
|
|
|
|
|
ttsVoiceId: "",
|
2025-05-12 15:49:44 +08:00
|
|
|
|
chatHistoryConf: 0,
|
2025-03-24 17:27:08 +08:00
|
|
|
|
systemPrompt: "",
|
2025-05-14 03:27:32 +08:00
|
|
|
|
summaryMemory: "",
|
2025-03-28 11:20:08 +08:00
|
|
|
|
langCode: "",
|
|
|
|
|
|
language: "",
|
|
|
|
|
|
sort: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
model: {
|
|
|
|
|
|
ttsModelId: "",
|
|
|
|
|
|
vadModelId: "",
|
2025-03-28 11:20:08 +08:00
|
|
|
|
asrModelId: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
llmModelId: "",
|
2025-06-01 13:34:32 +08:00
|
|
|
|
vllmModelId: "",
|
2025-03-24 17:27:08 +08:00
|
|
|
|
memModelId: "",
|
|
|
|
|
|
intentModelId: "",
|
|
|
|
|
|
}
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
2025-05-12 14:10:05 +08:00
|
|
|
|
this.currentFunctions = [];
|
2025-04-07 15:14:20 +08:00
|
|
|
|
this.$message.success({
|
|
|
|
|
|
message: '配置已重置',
|
|
|
|
|
|
showClose: true
|
|
|
|
|
|
})
|
2025-05-29 00:58:20 +08:00
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
});
|
2025-03-18 23:08:13 +08:00
|
|
|
|
},
|
2025-04-06 15:45:18 +08:00
|
|
|
|
fetchTemplates() {
|
2025-05-29 00:58:20 +08:00
|
|
|
|
Api.agent.getAgentTemplate(({data}) => {
|
2025-04-06 15:45:18 +08:00
|
|
|
|
if (data.code === 0) {
|
|
|
|
|
|
this.templates = data.data;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(data.msg || '获取模板列表失败');
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
selectTemplate(template) {
|
2025-04-05 20:19:28 +08:00
|
|
|
|
if (this.loadingTemplate) return;
|
|
|
|
|
|
this.loadingTemplate = true;
|
2025-04-06 15:45:18 +08:00
|
|
|
|
try {
|
|
|
|
|
|
this.applyTemplateData(template);
|
2025-04-07 15:14:20 +08:00
|
|
|
|
this.$message.success({
|
|
|
|
|
|
message: `「${template.agentName}」模板已应用`,
|
|
|
|
|
|
showClose: true
|
|
|
|
|
|
});
|
2025-04-06 15:45:18 +08:00
|
|
|
|
} catch (error) {
|
2025-04-07 15:14:20 +08:00
|
|
|
|
this.$message.error({
|
|
|
|
|
|
message: '应用模板失败',
|
|
|
|
|
|
showClose: true
|
|
|
|
|
|
});
|
2025-04-06 15:45:18 +08:00
|
|
|
|
console.error('应用模板失败:', error);
|
|
|
|
|
|
} finally {
|
2025-04-05 21:03:46 +08:00
|
|
|
|
this.loadingTemplate = false;
|
2025-04-06 15:45:18 +08:00
|
|
|
|
}
|
2025-03-24 22:41:32 +08:00
|
|
|
|
},
|
2025-03-28 11:20:08 +08:00
|
|
|
|
applyTemplateData(templateData) {
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
...this.form,
|
|
|
|
|
|
agentName: templateData.agentName || this.form.agentName,
|
|
|
|
|
|
ttsVoiceId: templateData.ttsVoiceId || this.form.ttsVoiceId,
|
2025-05-11 03:19:40 +08:00
|
|
|
|
chatHistoryConf: templateData.chatHistoryConf || this.form.chatHistoryConf,
|
2025-03-28 11:20:08 +08:00
|
|
|
|
systemPrompt: templateData.systemPrompt || this.form.systemPrompt,
|
2025-05-14 03:27:32 +08:00
|
|
|
|
summaryMemory: templateData.summaryMemory || this.form.summaryMemory,
|
2025-03-28 11:20:08 +08:00
|
|
|
|
langCode: templateData.langCode || this.form.langCode,
|
|
|
|
|
|
model: {
|
|
|
|
|
|
ttsModelId: templateData.ttsModelId || this.form.model.ttsModelId,
|
|
|
|
|
|
vadModelId: templateData.vadModelId || this.form.model.vadModelId,
|
|
|
|
|
|
asrModelId: templateData.asrModelId || this.form.model.asrModelId,
|
|
|
|
|
|
llmModelId: templateData.llmModelId || this.form.model.llmModelId,
|
2025-06-01 13:34:32 +08:00
|
|
|
|
vllmModelId: templateData.vllmModelId || this.form.model.vllmModelId,
|
2025-03-28 11:20:08 +08:00
|
|
|
|
memModelId: templateData.memModelId || this.form.model.memModelId,
|
|
|
|
|
|
intentModelId: templateData.intentModelId || this.form.model.intentModelId
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2025-03-24 22:41:32 +08:00
|
|
|
|
},
|
2025-04-05 20:19:28 +08:00
|
|
|
|
fetchAgentConfig(agentId) {
|
2025-05-29 00:58:20 +08:00
|
|
|
|
Api.agent.getDeviceConfig(agentId, ({data}) => {
|
2025-04-05 21:03:46 +08:00
|
|
|
|
if (data.code === 0) {
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
...this.form,
|
|
|
|
|
|
...data.data,
|
|
|
|
|
|
model: {
|
|
|
|
|
|
ttsModelId: data.data.ttsModelId,
|
|
|
|
|
|
vadModelId: data.data.vadModelId,
|
|
|
|
|
|
asrModelId: data.data.asrModelId,
|
|
|
|
|
|
llmModelId: data.data.llmModelId,
|
2025-06-01 13:34:32 +08:00
|
|
|
|
vllmModelId: data.data.vllmModelId,
|
2025-04-05 21:03:46 +08:00
|
|
|
|
memModelId: data.data.memModelId,
|
|
|
|
|
|
intentModelId: data.data.intentModelId
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2025-05-29 00:58:20 +08:00
|
|
|
|
// 后端只给了最小映射:[{ id, agentId, pluginId }, ...]
|
|
|
|
|
|
const savedMappings = data.data.functions || [];
|
|
|
|
|
|
|
|
|
|
|
|
// 先保证 allFunctions 已经加载(如果没有,则先 fetchAllFunctions)
|
|
|
|
|
|
const ensureFuncs = this.allFunctions.length
|
|
|
|
|
|
? Promise.resolve()
|
|
|
|
|
|
: this.fetchAllFunctions();
|
|
|
|
|
|
|
|
|
|
|
|
ensureFuncs.then(() => {
|
|
|
|
|
|
// 合并:按照 pluginId(id 字段)把全量元数据信息补齐
|
|
|
|
|
|
this.currentFunctions = savedMappings.map(mapping => {
|
|
|
|
|
|
const meta = this.allFunctions.find(f => f.id === mapping.pluginId);
|
|
|
|
|
|
if (!meta) {
|
|
|
|
|
|
// 插件定义没找到,退化处理
|
|
|
|
|
|
return { id: mapping.pluginId, name: mapping.pluginId, params: {} };
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
|
|
|
id: mapping.pluginId,
|
|
|
|
|
|
name: meta.name,
|
|
|
|
|
|
// 后端如果还有 paramInfo 字段就用 mapping.paramInfo,否则用 meta.params 默认值
|
|
|
|
|
|
params: mapping.paramInfo || { ...meta.params },
|
|
|
|
|
|
fieldsMeta: meta.fieldsMeta // 保留以便对话框渲染 tooltip
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
|
|
|
|
|
// 备份原始,以备取消时恢复
|
|
|
|
|
|
this.originalFunctions = JSON.parse(JSON.stringify(this.currentFunctions));
|
|
|
|
|
|
});
|
2025-04-05 21:03:46 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(data.msg || '获取配置失败');
|
|
|
|
|
|
}
|
2025-03-28 11:20:08 +08:00
|
|
|
|
});
|
2025-04-05 20:19:28 +08:00
|
|
|
|
},
|
2025-04-06 15:45:18 +08:00
|
|
|
|
fetchModelOptions() {
|
|
|
|
|
|
this.models.forEach(model => {
|
2025-05-29 00:58:20 +08:00
|
|
|
|
Api.model.getModelNames(model.type, '', ({data}) => {
|
2025-04-06 15:45:18 +08:00
|
|
|
|
if (data.code === 0) {
|
|
|
|
|
|
this.$set(this.modelOptions, model.type, data.data.map(item => ({
|
|
|
|
|
|
value: item.id,
|
|
|
|
|
|
label: item.modelName
|
|
|
|
|
|
})));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(data.msg || '获取模型列表失败');
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
2025-04-05 20:19:28 +08:00
|
|
|
|
},
|
2025-04-06 15:45:18 +08:00
|
|
|
|
fetchVoiceOptions(modelId) {
|
|
|
|
|
|
if (!modelId) {
|
|
|
|
|
|
this.voiceOptions = [];
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-05-29 00:58:20 +08:00
|
|
|
|
Api.model.getModelVoices(modelId, '', ({data}) => {
|
2025-04-06 15:45:18 +08:00
|
|
|
|
if (data.code === 0 && data.data) {
|
|
|
|
|
|
this.voiceOptions = data.data.map(voice => ({
|
|
|
|
|
|
value: voice.id,
|
|
|
|
|
|
label: voice.name
|
|
|
|
|
|
}));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.voiceOptions = [];
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-05-12 14:10:05 +08:00
|
|
|
|
},
|
|
|
|
|
|
getFunctionColor(name) {
|
|
|
|
|
|
const hash = [...name].reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
2025-05-29 00:58:20 +08:00
|
|
|
|
return this.functionColorMap[hash % this.functionColorMap.length];
|
2025-05-12 14:10:05 +08:00
|
|
|
|
},
|
|
|
|
|
|
showFunctionIcons(type) {
|
2025-05-29 00:58:20 +08:00
|
|
|
|
return type === 'Intent' &&
|
|
|
|
|
|
this.form.model.intentModelId !== 'Intent_nointent';
|
2025-05-12 14:10:05 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleModelChange(type, value) {
|
2025-05-12 16:48:34 +08:00
|
|
|
|
if (type === 'Intent' && value !== 'Intent_nointent') {
|
2025-05-29 00:58:20 +08:00
|
|
|
|
this.fetchAllFunctions();
|
2025-05-12 14:10:05 +08:00
|
|
|
|
}
|
2025-05-12 15:49:44 +08:00
|
|
|
|
if (type === 'Memory' && value === 'Memory_nomem') {
|
|
|
|
|
|
this.form.chatHistoryConf = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (type === 'Memory' && value !== 'Memory_nomem' && (this.form.chatHistoryConf === 0 || this.form.chatHistoryConf === null)) {
|
|
|
|
|
|
this.form.chatHistoryConf = 2;
|
|
|
|
|
|
}
|
2025-05-12 14:10:05 +08:00
|
|
|
|
},
|
2025-05-29 00:58:20 +08:00
|
|
|
|
fetchAllFunctions() {
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
|
Api.model.getPluginFunctionList(null, ({ data }) => {
|
|
|
|
|
|
if (data.code === 0) {
|
|
|
|
|
|
this.allFunctions = data.data.map(item => {
|
|
|
|
|
|
const meta = JSON.parse(item.fields || '[]');
|
|
|
|
|
|
const params = meta.reduce((m, f) => {
|
|
|
|
|
|
m[f.key] = f.default;
|
|
|
|
|
|
return m;
|
|
|
|
|
|
}, {});
|
|
|
|
|
|
return { ...item, fieldsMeta: meta, params };
|
|
|
|
|
|
});
|
|
|
|
|
|
resolve();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(data.msg || '获取插件列表失败');
|
|
|
|
|
|
reject();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-05-12 14:10:05 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-05-29 00:58:20 +08:00
|
|
|
|
openFunctionDialog() {
|
|
|
|
|
|
// 显示编辑对话框时,确保 allFunctions 已经加载
|
|
|
|
|
|
if (this.allFunctions.length === 0) {
|
|
|
|
|
|
this.fetchAllFunctions().then(() => this.showFunctionDialog=true);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.showFunctionDialog = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-05-12 14:10:05 +08:00
|
|
|
|
handleUpdateFunctions(selected) {
|
|
|
|
|
|
this.currentFunctions = selected;
|
|
|
|
|
|
this.$message.success('功能配置已保存');
|
|
|
|
|
|
},
|
|
|
|
|
|
handleDialogClosed(saved) {
|
|
|
|
|
|
if (!saved) {
|
|
|
|
|
|
this.currentFunctions = JSON.parse(JSON.stringify(this.originalFunctions));
|
2025-05-29 00:58:20 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.originalFunctions = JSON.parse(JSON.stringify(this.currentFunctions));
|
2025-05-12 14:10:05 +08:00
|
|
|
|
}
|
2025-05-29 00:58:20 +08:00
|
|
|
|
this.showFunctionDialog = false;
|
2025-05-12 14:10:05 +08:00
|
|
|
|
},
|
2025-05-12 15:49:44 +08:00
|
|
|
|
updateChatHistoryConf() {
|
|
|
|
|
|
if (this.form.model.memModelId === 'Memory_nomem') {
|
|
|
|
|
|
this.form.chatHistoryConf = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-04-06 15:45:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
'form.model.ttsModelId': {
|
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
|
if (oldVal && newVal !== oldVal) {
|
|
|
|
|
|
this.form.ttsVoiceId = '';
|
|
|
|
|
|
this.fetchVoiceOptions(newVal);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.fetchVoiceOptions(newVal);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
},
|
|
|
|
|
|
voiceOptions: {
|
|
|
|
|
|
handler(newVal) {
|
|
|
|
|
|
if (newVal && newVal.length > 0 && !this.form.ttsVoiceId) {
|
|
|
|
|
|
this.form.ttsVoiceId = newVal[0].value;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
}
|
2025-03-28 11:20:08 +08:00
|
|
|
|
},
|
2025-03-24 17:27:08 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
|
const agentId = this.$route.query.agentId;
|
|
|
|
|
|
if (agentId) {
|
|
|
|
|
|
this.fetchAgentConfig(agentId);
|
2025-05-29 00:58:20 +08:00
|
|
|
|
this.fetchAllFunctions();
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
2025-04-06 15:45:18 +08:00
|
|
|
|
this.fetchModelOptions();
|
|
|
|
|
|
this.fetchTemplates();
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.welcome {
|
2025-03-18 21:49:57 +08:00
|
|
|
|
min-width: 900px;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
height: 100vh;
|
2025-03-18 21:49:57 +08:00
|
|
|
|
display: flex;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
position: relative;
|
2025-03-18 21:49:57 +08:00
|
|
|
|
flex-direction: column;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
background: linear-gradient(to bottom right, #dce8ff, #e4eeff, #e6cbfd);
|
2025-03-14 23:48:59 +08:00
|
|
|
|
background-size: cover;
|
|
|
|
|
|
-webkit-background-size: cover;
|
|
|
|
|
|
-o-background-size: cover;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
overflow: hidden;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
2025-03-18 21:49:57 +08:00
|
|
|
|
|
2025-04-16 11:17:02 +08:00
|
|
|
|
.operation-bar {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
2025-05-08 17:57:11 +08:00
|
|
|
|
padding: 1.5vh 24px;
|
2025-03-18 21:49:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-16 11:17:02 +08:00
|
|
|
|
.page-title {
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
color: #2c3e50;
|
2025-03-18 23:08:13 +08:00
|
|
|
|
}
|
2025-03-18 21:49:57 +08:00
|
|
|
|
|
2025-04-16 11:17:02 +08:00
|
|
|
|
.main-wrapper {
|
2025-05-08 17:57:11 +08:00
|
|
|
|
margin: 1vh 22px;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
border-radius: 15px;
|
|
|
|
|
|
height: calc(100vh - 24vh);
|
|
|
|
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
background: rgba(237, 242, 255, 0.5);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.content-panel {
|
2025-03-14 23:48:59 +08:00
|
|
|
|
flex: 1;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
border-radius: 15px;
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
border: 1px solid #fff;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-16 11:17:02 +08:00
|
|
|
|
.content-area {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
min-width: 600px;
|
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-16 11:17:02 +08:00
|
|
|
|
.config-card {
|
|
|
|
|
|
background: white;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
box-shadow: none;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.config-header {
|
2025-04-21 10:24:04 +08:00
|
|
|
|
position: relative;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
gap: 13px;
|
2025-04-16 14:25:46 +08:00
|
|
|
|
padding: 0 0 5px 0;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
font-size: 19px;
|
|
|
|
|
|
color: #3d4566;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-icon {
|
|
|
|
|
|
width: 37px;
|
|
|
|
|
|
height: 37px;
|
|
|
|
|
|
background: #5778ff;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-icon img {
|
|
|
|
|
|
width: 19px;
|
|
|
|
|
|
height: 19px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.divider {
|
|
|
|
|
|
height: 1px;
|
|
|
|
|
|
background: #e8f0ff;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-content {
|
2025-05-08 17:57:11 +08:00
|
|
|
|
padding: 2vh 0;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-grid {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
|
|
gap: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-column {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2025-04-16 17:18:11 +08:00
|
|
|
|
gap: 6px;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-input {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-select {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-textarea {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.template-container {
|
|
|
|
|
|
display: flex;
|
2025-03-18 21:49:57 +08:00
|
|
|
|
gap: 8px;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
flex-wrap: wrap;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.template-item {
|
2025-05-08 17:57:11 +08:00
|
|
|
|
height: 4vh;
|
2025-03-18 23:08:13 +08:00
|
|
|
|
width: 76px;
|
2025-03-18 21:49:57 +08:00
|
|
|
|
border-radius: 8px;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
background: #e6ebff;
|
2025-05-08 17:57:11 +08:00
|
|
|
|
line-height: 4vh;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
font-weight: 400;
|
2025-03-18 21:49:57 +08:00
|
|
|
|
font-size: 11px;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
text-align: center;
|
|
|
|
|
|
color: #5778ff;
|
2025-03-18 23:08:13 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: background-color 0.3s ease;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.template-item:hover {
|
|
|
|
|
|
background-color: #d0d8ff;
|
2025-03-14 23:48:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-12 14:10:05 +08:00
|
|
|
|
.model-select-wrapper {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-01 13:34:32 +08:00
|
|
|
|
.model-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 20px;
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-row .model-item {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-row .el-form-item__label {
|
|
|
|
|
|
font-size: 12px !important;
|
|
|
|
|
|
color: #3d4566 !important;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
line-height: 22px;
|
|
|
|
|
|
padding-bottom: 2px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-12 14:10:05 +08:00
|
|
|
|
.function-icons {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.icon-dot {
|
|
|
|
|
|
width: 25px;
|
|
|
|
|
|
height: 25px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-16 11:17:02 +08:00
|
|
|
|
::v-deep .el-form-item__label {
|
2025-05-12 14:16:08 +08:00
|
|
|
|
font-size: 12px !important;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
color: #3d4566 !important;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
line-height: 22px;
|
|
|
|
|
|
padding-bottom: 2px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
::v-deep .el-textarea .el-input__count {
|
|
|
|
|
|
color: #909399;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
font-size: 12px;
|
2025-04-21 10:24:04 +08:00
|
|
|
|
right: 3%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.custom-close-btn {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 25%;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
|
width: 35px;
|
|
|
|
|
|
height: 35px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
border: 2px solid #cfcfcf;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
|
font-weight: lighter;
|
|
|
|
|
|
color: #cfcfcf;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.custom-close-btn:hover {
|
|
|
|
|
|
color: #409EFF;
|
|
|
|
|
|
border-color: #409EFF;
|
2025-04-16 11:17:02 +08:00
|
|
|
|
}
|
2025-05-12 14:10:05 +08:00
|
|
|
|
|
|
|
|
|
|
.edit-function-btn {
|
|
|
|
|
|
background: #e6ebff;
|
|
|
|
|
|
color: #5778ff;
|
|
|
|
|
|
border: 1px solid #adbdff;
|
|
|
|
|
|
border-radius: 18px;
|
|
|
|
|
|
padding: 10px 20px;
|
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.edit-function-btn.active-btn {
|
|
|
|
|
|
background: #5778ff;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-12 15:49:44 +08:00
|
|
|
|
.chat-history-options {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
min-width: 250px;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
}
|
2025-05-14 12:09:29 +08:00
|
|
|
|
|
|
|
|
|
|
.header-actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-actions .hint-text {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 4px;
|
|
|
|
|
|
color: #979db1;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-actions .hint-text img {
|
|
|
|
|
|
width: 16px;
|
|
|
|
|
|
height: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-actions .save-btn {
|
|
|
|
|
|
background: #5778ff;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
border-radius: 18px;
|
|
|
|
|
|
padding: 8px 16px;
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-actions .reset-btn {
|
|
|
|
|
|
background: #e6ebff;
|
|
|
|
|
|
color: #5778ff;
|
|
|
|
|
|
border: 1px solid #adbdff;
|
|
|
|
|
|
border-radius: 18px;
|
|
|
|
|
|
padding: 8px 16px;
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-actions .custom-close-btn {
|
|
|
|
|
|
position: static;
|
|
|
|
|
|
transform: none;
|
|
|
|
|
|
width: 32px;
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
margin-left: 8px;
|
|
|
|
|
|
}
|
2025-04-16 11:17:02 +08:00
|
|
|
|
</style>
|