From ce0f88226b114ca59dd0d3ffc197885d8d44b24f Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期一, 28 十月 2024 15:56:43 +0800
Subject: [PATCH] 修改应用场景的样式

---
 src/views/project/ch/home/ScenarioDetails.vue |  118 ++++++++++++++++++++++++++---------------------------------
 1 files changed, 52 insertions(+), 66 deletions(-)

diff --git a/src/views/project/ch/home/ScenarioDetails.vue b/src/views/project/ch/home/ScenarioDetails.vue
index d0bd469..76fdac9 100644
--- a/src/views/project/ch/home/ScenarioDetails.vue
+++ b/src/views/project/ch/home/ScenarioDetails.vue
@@ -5,12 +5,12 @@
 				<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">
-							<el-option v-for="item in state.modelOptionList" :key="item.ID" :label="item.Name" :value="item.Name" />
-						</el-select>
+						<!-- <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> -->
 					</div>
 					<div class="pt-[30px]">
 						<el-form
@@ -33,11 +33,7 @@
 									popper-class="custom-select-style"
 									:teleported="false"
 								>
-									<el-option v-for="item in state.modelTypeList" :key="item.ID" :label="item.Name" :value="item.Name">
-										<!-- <div style="max-width: 200px !important; display: flex; flex-wrap: wrap; margin-bottom: 10px">
-											{{ item.Name }}
-										</div> -->
-									</el-option>
+									<el-option v-for="item in state.modelTypeList" :key="item.ID" :label="item.Name" :value="item.Name"> </el-option>
 								</el-select>
 							</el-form-item>
 							<el-form-item label="琛ュ厖鍐呭" prop="supplementContenT">
@@ -50,11 +46,11 @@
 					</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">
@@ -67,61 +63,13 @@
 
 <script setup lang="ts">
 import type { FormRules } from 'element-plus';
-import { reactive } from 'vue';
+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({
 	seriesModel: '',
-	modelOptionList: [
-		{
-			ID: 2,
-			Name: '绔惛娉礒N733',
-			SeriesID: '2,41,18,4,42,26',
-		},
-		{
-			ID: 7,
-			Name: '绔惛娉礗SO2858',
-			SeriesID: '12,47,14,48',
-		},
-		{
-			ID: 3,
-			Name: '鍙屽惛娉�',
-			SeriesID: '30,29,3,28,40,44',
-		},
-		{
-			ID: 4,
-			Name: '绠¢亾娉�',
-			SeriesID: '6,51,5,46',
-		},
-		{
-			ID: 6,
-			Name: '娑堥槻娉礒HF',
-			SeriesID: '15',
-		},
-		{
-			ID: 8,
-			Name: '娑堥槻娉礒SF',
-			SeriesID: '16',
-		},
-		{
-			ID: 5,
-			Name: '鑷惛姹℃按娉�',
-			SeriesID: '8',
-		},
-		{
-			ID: 9,
-			Name: '绔惛娉电數鏈虹洿杩�',
-			SeriesID: '33,38,35,37',
-		},
-		{
-			ID: 10,
-			Name: '绔嬪紡澶氱骇娉�',
-			SeriesID: '60,61',
-		},
-		{
-			ID: 11,
-			Name: '鍗曠骇绠¢亾娉�',
-			SeriesID: '59',
-		},
-	],
+	modelOptionList: [],
 	modelForm: {
 		theme: '',
 		modelType: '',
@@ -146,13 +94,51 @@
 		},
 	],
 	workContent: '鍦ㄥ乏渚ц緭鍏ュ唴瀹瑰苟鎻愪氦锛屽皢鑷姩涓烘偍鐢熸垚宸ヤ綔鎬荤粨',
+	llm_id: '',
+	select_question: null,
+	select_name: null,
+	contentLoading: false,
 });
 const modelRules = reactive<FormRules>({
 	theme: [{ required: true, message: '蹇呭~椤�', trigger: 'blur' }],
 	supplementContenT: [{ required: true, message: '蹇呭~椤�', trigger: 'blur' }],
 	modelType: [{ required: true, message: '蹇呭~椤�', trigger: 'change' }],
 });
-const handleSubmit = () => {};
+const modelFormRef = ref(null);
+//鑾峰彇澶фā鍨嬪垪琛�
+const getModelList = async () => {
+	const res = await getBigModelList();
+	state.modelOptionList = res.llm_list || [];
+};
+//鍒囨崲妯″瀷
+const handleModelChange = async (val: string) => {
+	state.llm_id = val;
+};
+//绔嬪嵆鐢熸垚
+const handleSubmit = async () => {
+	const valid = await modelFormRef.value.validate().catch(() => {});
+	if (!valid) return;
+	state.contentLoading = true;
+	const res = await QuestionWorkAi({
+		section_a_id: activeSectionAId.value, //褰撳墠闂瀵瑰簲鐨勪富鍦烘櫙
+		sample_id: '', //褰撳墠闂瀵瑰簲鐨剆ample_id(鍙笉濉垨涓虹┖)
+		llm_id: state.llm_id ? state.llm_id : '', //褰撳墠闂瀵瑰簲鐨刲lm_id(涓嶅~鍒欑敤缂虹渷llm)
+		history_group_id: activeRoomId.value, //褰撳墠闂瀵瑰簲鐨刪istory group id
+		raw_mode: true, //鏄惁鐩存帴璋冪敤澶фā鍨嬪洖绛旈棶棰�(涓嶅~涓篺alse)
+		question: state.select_question, //鎻愬嚭鐨勯棶棰�
+	}).finally(() => {
+		state.contentLoading = false;
+	});
+	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>
 <style scoped lang="scss">
 .pc-detail {

--
Gitblit v1.9.3