From 9c100512a92bf3ac2f1c8b739e843199a69cd411 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期二, 26 十一月 2024 17:44:17 +0800 Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test --- src/views/project/ch/home/Scenario.vue | 44 +++++++++++++++++++++++--------------------- 1 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/views/project/ch/home/Scenario.vue b/src/views/project/ch/home/Scenario.vue index 509cf4e..53529f8 100644 --- a/src/views/project/ch/home/Scenario.vue +++ b/src/views/project/ch/home/Scenario.vue @@ -18,19 +18,19 @@ class="productivity" v-for="product in state.productivityList" :key="product.section_id" - v-show="product.children && product.children.length > 0" - @click="changeApp(product)" + v-show="state.productivityList && state.productivityList.length > 0" > <div class="mb-[24px]"> <span class="productivity-span"><i></i>{{ product.section_name }}</span> </div> <div class="flex flex-wrap items-center"> - <div class="list_app" v-for="item in product.children" :key="item.section_id"> - <img :src="item.Icon" alt="" class="w-[20px] h-[20px] mr-[14px]" /> - <span class="text-[14px] text-[#333f4e]">{{ item.section_name }}</span> + <div class="list_app" @click="changeApp(product.section_id, product)"> + <img :src="product.Icon" alt="" class="w-[20px] h-[20px] mr-[14px]" /> + <span class="text-[14px] text-[#333f4e]">{{ product.section_name }}</span> </div> </div> </div> + <el-empty description="鏆傛棤鏁版嵁" v-show="state.productivityList.length === 0" /> </div> </div> </template> @@ -38,9 +38,9 @@ <script setup lang="ts"> import { onMounted, reactive } from 'vue'; import { useRoute } from 'vue-router'; -import { getSectionByAllList } from '/@/api/ai/chat'; - +import { getSectionByIdList } from '/@/api/ai/chat'; import router from '/@/router'; +const route = useRoute(); let state = reactive({ recentlyList: [ { @@ -55,29 +55,31 @@ }, ], //鏈�杩戜娇鐢� productivityList: [], //閫氱敤鐨勫満鏅� + scenarioID: null, }); //鍒囨崲鍒板簲鐢ㄥ満鏅鎯呯殑浜嬩欢 -const changeApp = (item: any) => { - router.push({ - name: 'ScenarioDetails', - }); +const changeApp = (section_id, item: any) => { + if (section_id === 'office_summarize') { + router.push({ + name: 'ScenarioDetails', + query: { + ID: section_id, + Name: item.section_name, + Title: item.section_title, + }, + }); + } }; const getSectionByList = async () => { - const res = await getSectionByAllList(); + const res = await getSectionByIdList({ section_a_id: state.scenarioID }); const iconList = ['/static/images/scene/scene_1.png', '/static/images/scene/scene_2.png', '/static/images/scene/scene_3.png']; - res.sections.forEach((item: any) => { - if (item.children && item.children.length > 0) { - item.children = item.children.map((child: any) => { - child.Icon = iconList[Math.floor(Math.random() * 3)]; - return child; - }); - } + res.sections.forEach((child: any) => { + child.Icon = iconList[Math.floor(Math.random() * 3)]; }); state.productivityList = res.sections; }; onMounted(() => { - const route = useRoute(); - const id = route.params.id; + state.scenarioID = route.query.ID; getSectionByList(); }); </script> -- Gitblit v1.9.3