| | |
| | | <div class="p-[32px]"> |
| | | <div class="flex justify-between items-center"> |
| | | <div class="flex items-center"> |
| | | <i class="ywicon icon-gongzuozongjie text-[#1c86ff]" style="font-size: 20px !important"></i> |
| | | <span class="text-[14px] text-[#000] leading-5 ml-1">工作总结</span> |
| | | <i class="ywifont ywicon-gongzuozongjie text-[#1c86ff]" style="font-size: 20px !important"></i> |
| | | <span class="text-[14px] text-[#000] leading-5 ml-1">{{ state.select_name ? state.select_name : '' }}</span> |
| | | </div> |
| | | <el-select v-model="state.seriesModel" placeholder="请选择" size="large" @change="handleModelChange"> |
| | | <!-- <el-select v-model="state.seriesModel" placeholder="请选择" size="large" @change="handleModelChange"> |
| | | <el-option v-for="item in state.modelOptionList" :key="item.id" :label="item.title" :value="item.id" /> |
| | | </el-select> |
| | | </el-select> --> |
| | | </div> |
| | | <div class="pt-[30px]"> |
| | | <el-form |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | | <div class="right" v-loading="state.contentLoading"> |
| | | <div class="top"> |
| | | <div class="left"> |
| | | <i></i> |
| | | <span>工作总结</span> |
| | | <span>{{ state.select_name ? state.select_name : '' }}总结</span> |
| | | </div> |
| | | </div> |
| | | <div class="output"> |
| | |
| | | <script setup lang="ts"> |
| | | import type { FormRules } from 'element-plus'; |
| | | import { onMounted, reactive, ref } from 'vue'; |
| | | import { useRoute } from 'vue-router'; |
| | | import { QuestionWorkAi, getBigModelList } from '/@/api/ai/chat'; |
| | | import { activeRoomId, activeSectionAId } from '/@/stores/chatRoom'; |
| | | let state = reactive({ |
| | |
| | | ], |
| | | workContent: '在左侧输入内容并提交,将自动为您生成工作总结', |
| | | llm_id: '', |
| | | select_question: null, |
| | | select_name: null, |
| | | contentLoading: false, |
| | | }); |
| | | const modelRules = reactive<FormRules>({ |
| | | theme: [{ required: true, message: '必填项', trigger: 'blur' }], |
| | |
| | | const handleSubmit = async () => { |
| | | const valid = await modelFormRef.value.validate().catch(() => {}); |
| | | if (!valid) return; |
| | | return; |
| | | state.contentLoading = true; |
| | | const res = await QuestionWorkAi({ |
| | | section_a_id: activeSectionAId.value, //当前问题对应的主场景 |
| | | sample_id: '', //当前问题对应的sample_id(可不填或为空) |
| | | llm_id: state.llm_id ? state.llm_id : '', //当前问题对应的llm_id(不填则用缺省llm) |
| | | history_group_id: activeRoomId.value, //当前问题对应的history group id |
| | | raw_mode: true, //是否直接调用大模型回答问题(不填为false) |
| | | question: '', //提出的问题 |
| | | question: state.select_question, //提出的问题 |
| | | }).finally(() => { |
| | | state.contentLoading = false; |
| | | }); |
| | | const { theme, modelType, supplementContenT } = state.modelForm; |
| | | const modelTypeText = state.modelTypeList.find((item) => item.Name === modelType)?.Name || ''; |
| | | const content = `## ${theme} ${modelTypeText}\n${supplementContenT}`; |
| | | state.workContent = content; |
| | | state.workContent = res.answer; |
| | | }; |
| | | onMounted(() => { |
| | | const route = useRoute(); |
| | | const pathInfo = route.query; |
| | | activeSectionAId.value = pathInfo.ID; |
| | | state.select_question = pathInfo.Title; |
| | | state.select_name = pathInfo.Name; |
| | | getModelList(); |
| | | }); |
| | | </script> |