<template>
|
<div>
|
<el-dialog
|
:title="sessionName + '——对话设置'"
|
:visible.sync="show"
|
:close-on-click-modal="false"
|
:destroy-on-close="true"
|
width="600px"
|
>
|
<div class="config-item">
|
<div class="title">请选择对话模式:</div>
|
<div>
|
<el-select v-model="config.chatType" @change="saveConfig" size="small">
|
<el-option label="知识库问答" value="kb"/>
|
</el-select>
|
</div>
|
</div>
|
<div class="config-item">
|
<div class="title">请选择知识库:</div>
|
<div>
|
<el-select v-model="config.kb" @change="saveConfig" size="small">
|
<el-option label="知识库A" value="kb1"/>
|
</el-select>
|
</div>
|
</div>
|
<div class="config-item">
|
<div class="title">历史对话轮数:</div>
|
<div>
|
<el-input v-model="config.hisChatNum" @input="saveConfig" type="number" size="small"/>
|
</div>
|
</div>
|
<div class="config-item">
|
<div class="title">匹配知识条数:</div>
|
<div>
|
<el-input v-model="config.matchKbNum" @input="saveConfig" type="number" size="small"/>
|
</div>
|
</div>
|
<div class="config-item">
|
<div class="title">匹配知识分数阈值:</div>
|
<div>
|
<el-slider
|
v-model="config.matchKbScore"
|
@change="saveConfig"
|
:min="0.00"
|
:max="2.00"
|
:step="0.01">
|
</el-slider>
|
</div>
|
</div>
|
<div>
|
<el-checkbox v-model="config.returnMatchResult" @change="saveConfig">仅返回检索结果</el-checkbox>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="close">取 消</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "SessionConfig",
|
props: {
|
sessionName: {
|
type: String
|
}
|
},
|
data() {
|
return {
|
show: false,
|
config: {
|
chatType: 'kb',
|
kb: 'kb1',
|
hisChatNum: 3,
|
matchKbNum: 3,
|
matchKbScore: 1,
|
returnMatchResult: false
|
}
|
};
|
},
|
methods: {
|
saveConfig() {
|
console.log("触发保存了")
|
this.$emit('saveConfig', this.config)
|
},
|
setShow(value) {
|
this.show = value
|
},
|
setConfig(config) {
|
this.config = config
|
},
|
close() {
|
this.show = false
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.config-item {
|
margin-bottom: 10px;
|
}
|
.title {
|
margin-bottom: 5px;
|
}
|
</style>
|