mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-09-16 18:27:13 +00:00
d4fd38ab7e
- 同步 Plus v4.3.1 功能源并移除商业 License 闭环 - 更新开源镜像命名、Docker 部署版本和 geekai 数据库配置 - 补充前端 ESLint 检查配置并修复存量解析与模板问题 - 保留 JWT、管理员权限、API Key 和 OAuth 等正常鉴权机制
71 lines
1.8 KiB
Vue
71 lines
1.8 KiB
Vue
<template>
|
|
<el-dialog
|
|
class="config-dialog"
|
|
v-model="showDialog"
|
|
:close-on-click-modal="true"
|
|
:before-close="close"
|
|
style="max-width: 600px"
|
|
title="聊天配置"
|
|
>
|
|
<div class="chat-setting">
|
|
<el-form :model="data" label-width="100px" label-position="top">
|
|
<el-form-item label="启用流式输出:">
|
|
<el-switch
|
|
v-model="data.stream"
|
|
@change="
|
|
(val) => {
|
|
store.setChatStream(val)
|
|
}
|
|
"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="朗读语音模型:">
|
|
<el-select v-model="data.ttsModel" placeholder="请选择语音音色" @change="changeTTSModel">
|
|
<el-option v-for="v in models" :value="v.id" :label="v.name" :key="v.id">
|
|
{{ v.name }}
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { useSharedStore } from '@/store/sharedata'
|
|
import { httpGet } from '@/utils/http'
|
|
import { computed, onMounted, ref } from 'vue'
|
|
const store = useSharedStore()
|
|
|
|
const data = ref({
|
|
stream: store.chatStream,
|
|
ttsModel: store.ttsModel,
|
|
})
|
|
// eslint-disable-next-line no-undef
|
|
const props = defineProps({
|
|
show: Boolean,
|
|
})
|
|
|
|
const showDialog = computed(() => props.show)
|
|
const emits = defineEmits(['hide'])
|
|
const close = function () {
|
|
emits('hide', false)
|
|
}
|
|
const models = ref([])
|
|
onMounted(() => {
|
|
// 获取模型列表
|
|
httpGet('/api/model/list?type=tts').then((res) => {
|
|
models.value = res.data
|
|
if (!data.value.ttsModel && models.value.length > 0) {
|
|
store.setTtsModel(models.value[0].id)
|
|
}
|
|
})
|
|
})
|
|
|
|
const changeTTSModel = (item) => {
|
|
store.setTtsModel(item)
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped></style>
|