yangyin
2024-07-15 0e982d78030d36d6048532f5d4a848ad9a22a13f
fix: 修改办公助手
已修改3个文件
51 ■■■■ 文件已修改
src/views/project/ch/home/Scenario.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/ScenarioDetails.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/component/waterRight/bottom.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/Scenario.vue
@@ -18,28 +18,29 @@
                class="productivity"
                v-for="product in state.productivityList"
                :key="product.section_id"
                v-show="product.children && product.children.length > 0"
                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" @click="changeApp(product.section_id, item)">
                        <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>
<script setup lang="ts">
import { onMounted, reactive } from 'vue';
import { getSectionByAllList } from '/@/api/ai/chat';
import { useRoute } from 'vue-router';
import { getSectionByIdList } from '/@/api/ai/chat';
import router from '/@/router';
const route = useRoute();
let state = reactive({
    recentlyList: [
        {
@@ -54,32 +55,31 @@
        },
    ], //最近使用
    productivityList: [], //通用的场景
    scenarioID: null,
});
//切换到应用场景详情的事件
const changeApp = (section_id, item: any) => {
    router.push({
        name: 'ScenarioDetails',
        query: {
            ID: section_id,
            Name: item.section_name,
            Title: item.section_title,
        },
    });
    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(() => {
    state.scenarioID = route.query.ID;
    getSectionByList();
});
</script>
src/views/project/ch/home/ScenarioDetails.vue
@@ -8,9 +8,9 @@
                            <i class="ywicon icon-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
src/views/project/ch/home/component/waterRight/bottom.vue
@@ -65,7 +65,6 @@
});
const changeScenarios = async (item) => {
    activeSectionAId.value = item.section_id;
    console.log('🚀 ~ activeSectionAId.value:', activeSectionAId.value);
    setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false);
};
const getMainSectionList = async () => {