wujingjing
2024-07-15 0b238cbcce972e907fb2f6864e5f0c2772aeba0c
Merge branch 'master' of http://47.103.154.90:83/r/WI/Web.V1.0
已修改7个文件
已添加1个文件
325 ■■■■ 文件已修改
customer_list/ch/static/config/route.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/menu/menuData.ts 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/component/sidebar/components/MenuList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/AllScenario.vue 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/Scenario.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/ScenarioDetails.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/component/waterRight/bottom.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/component/waterRight/top.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
customer_list/ch/static/config/route.js
@@ -8,7 +8,7 @@
        redirect: null,
        showTitle: false,
    },
    //应用场景
    //应用场景(主场景根据当前ID显示次场景)
    {
        name: 'Scenario',
        isKeepAlive: false,
@@ -18,6 +18,16 @@
        redirect: null,
        showTitle: true,
    },
    //应用场景(主场景显示所有的次场景)
    {
        name: 'AllScenario',
        isKeepAlive: false,
        isAffix: false,
        path: '/AllScenario',
        component: '/project/ch/home/AllScenario.vue',
        redirect: null,
        showTitle: true,
    },
    //应用场景详情
    {
        name: 'ScenarioDetails',
src/api/menu/menuData.ts
@@ -79,46 +79,61 @@
        SortCode: 5,
        Description: '',
    },
    {
        Children: [],
        ID: '1',
        ParentID: '0',
        Type: 2,
        Name: '应用场景',
        Path: '/AllScenario',
        Permission: '',
        Icon: '',
        IsIframe: false,
        OutLink: '',
        IsHide: true,
        Weight: 0,
        SortCode: 5,
        Description: '',
    },
];
const c = [
    {
      "group_id": "d0b8cdd94b07407190a594eb35297055",
      "group_title": "chat room",
      "chat_count": "2",
      "create_time": "2024-07-06 19:54:10"
        group_id: 'd0b8cdd94b07407190a594eb35297055',
        group_title: 'chat room',
        chat_count: '2',
        create_time: '2024-07-06 19:54:10',
    },
    {
      "group_id": "a2daa57b53b44a089fed94cc876673d9",
      "group_title": "chat room",
      "chat_count": "0",
      "create_time": "2024-07-06 22:50:30"
        group_id: 'a2daa57b53b44a089fed94cc876673d9',
        group_title: 'chat room',
        chat_count: '0',
        create_time: '2024-07-06 22:50:30',
    },
    {
      "group_id": "89b89d6920a640a9a7179909644beca8",
      "group_title": "chat room",
      "chat_count": "0",
      "create_time": "2024-07-06 22:50:59"
        group_id: '89b89d6920a640a9a7179909644beca8',
        group_title: 'chat room',
        chat_count: '0',
        create_time: '2024-07-06 22:50:59',
    },
    {
      "group_id": "bf3e1aa15c22414faab077cffd694cf1",
      "group_title": "chat room",
      "chat_count": "0",
      "create_time": "2024-07-06 22:51:19"
        group_id: 'bf3e1aa15c22414faab077cffd694cf1',
        group_title: 'chat room',
        chat_count: '0',
        create_time: '2024-07-06 22:51:19',
    },
    {
      "group_id": "7d95ede8afab4366aaa88171d974ca4e",
      "group_title": "chat room",
      "chat_count": "0",
      "create_time": "2024-07-06 22:51:24"
        group_id: '7d95ede8afab4366aaa88171d974ca4e',
        group_title: 'chat room',
        chat_count: '0',
        create_time: '2024-07-06 22:51:24',
    },
    {
      "group_id": "f1603a395feb4fbfa52304274034346d",
      "group_title": "chat room",
      "chat_count": "0",
      "create_time": "2024-07-06 22:51:42"
    }
  ]
        group_id: 'f1603a395feb4fbfa52304274034346d',
        group_title: 'chat room',
        chat_count: '0',
        create_time: '2024-07-06 22:51:42',
    },
];
  
c.sort((a,b)=>a.create_time.localeCompare(b.create_time));
src/layout/component/sidebar/components/MenuList.vue
@@ -83,7 +83,7 @@
            id: 1,
            icon: '/static/images/wave/AsideIcon.png',
            title: '应用场景',
            routerName: 'Scenario',
            routerName: 'AllScenario',
        },
        {
            id: 2,
src/views/project/ch/home/AllScenario.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,150 @@
<template>
    <!-- åº”用场景 -->
    <div class="w100 h100 box-border text-[14px] bg-[#f7f8fa] overflow-auto pr-[32px] pb-[50px] pl-[32px] pt-[42px]">
        <div class="set-body">
            <!-- <div class="productivity recently">
                <p class="mb-[24px] flex items-center">
                    <el-icon color="#409eff" :size="20" class="mr-2"><Clock /></el-icon>
                    <span>最近使用</span>
                </p>
                <div class="flex flex-wrap items-center">
                    <div class="list_app" v-for="item in state.recentlyList" :key="item.ID" >
                        <img :src="item.Icon" alt="" class="w-[20px] h-[20px] mr-[14px]" />
                        <span class="text-[14px] text-[#333f4e]">{{ item.Name }}</span>
                    </div>
                </div>
            </div> -->
            <div
                class="productivity"
                v-for="product in state.productivityList"
                :key="product.section_id"
                v-show="product.children && product.children.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>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { onMounted, reactive } from 'vue';
import { getSectionByAllList } from '/@/api/ai/chat';
import router from '/@/router';
let state = reactive({
    recentlyList: [
        {
            ID: 1,
            Name: '项目管理',
            Icon: '/static/images/scene/scene_1.png',
        },
        {
            ID: 2,
            Name: '工作内容',
            Icon: '/static/images/scene/scene_2.png',
        },
    ], //最近使用
    productivityList: [], //通用的场景
});
//切换到应用场景详情的事件
const changeApp = (section_id, item: any) => {
    if (section_id === 'office_assistant') {
        router.push({
            name: 'ScenarioDetails',
            query: {
                ID: section_id,
                Name: item.section_name,
                Title: item.section_title,
            },
        });
    }
};
const getSectionByList = async () => {
    const res = await getSectionByAllList();
    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;
            });
        }
    });
    state.productivityList = res.sections;
};
onMounted(() => {
    getSectionByList();
});
</script>
<style scoped lang="scss">
.set-body {
    max-width: 1000px;
    min-height: calc(100% - 42px);
    margin: 0 auto;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    border-radius: 8px;
    margin-top: 32px;
    -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.16);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.16);
    .productivity {
        padding: 24px 30px 10px;
        background-color: #fff;
        margin-bottom: 20px;
        border-radius: 12px;
        p {
            span {
                font-size: 14px;
                color: #081735;
                line-height: 20px;
                display: flex;
                align-items: center;
            }
        }
        .list_app {
            width: 180px;
            display: flex;
            align-items: center;
            border-radius: 8px;
            border: 1px solid #ccc;
            padding: 15px;
            margin-right: 14px;
            margin-bottom: 14px;
            cursor: pointer;
            position: relative;
            background-color: #fff;
            &:hover {
                border: 1px solid #1c86ff;
            }
        }
        .productivity-span {
            font-size: 14px;
            color: #081735;
            line-height: 20px;
            display: flex;
            align-items: center;
            i {
                display: block;
                width: 4px;
                height: 14px;
                background: #1c86ff;
                border-radius: 0 100px 100px 0;
                margin-right: 10px;
            }
        }
    }
    .recently {
        border: 1px solid #e5eaf9;
        background-color: #e9eff8;
    }
}
</style>
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,9 +55,11 @@
        },
    ], //最近使用
    productivityList: [], //通用的场景
    scenarioID: null,
});
//切换到应用场景详情的事件
const changeApp = (section_id, item: any) => {
    if (section_id === 'office_summarize') {
    router.push({
        name: 'ScenarioDetails',
        query: {
@@ -65,21 +68,18 @@
            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) => {
    res.sections.forEach((child: any) => {
                child.Icon = iconList[Math.floor(Math.random() * 3)];
                return child;
            });
        }
    });
    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
@@ -54,7 +54,7 @@
</template>
<script setup lang="ts">
import { onMounted, reactive, computed } from 'vue';
import { computed, onMounted, reactive } from 'vue';
import { getSectionList } from '/@/api/ai/chat';
import router from '/@/router';
import { activeRoomId, activeSectionAId, setRoomConfig } from '/@/stores/chatRoom';
@@ -70,7 +70,17 @@
const getMainSectionList = async () => {
    const res = await getSectionList();
    let result = [];
    const iconList = ['biaodan', 'putong', 'zhongduancanshuchaxun', 'shidu'];
    const iconList = [
        'biaodan',
        'putong',
        'zhongduancanshuchaxun',
        'shidu',
        'fuwenbenkuang',
        'fuwenben',
        'jiliandongxuanzeqi',
        'jinridaiban',
        'gongju',
    ];
    res.sections.forEach((sectionItem, index) => {
        sectionItem.Icon = iconList[index];
    });
@@ -90,6 +100,9 @@
const lookMore = () => {
    router.push({
        name: 'Scenario',
        query: {
            ID: activeSectionAId.value,
        },
    });
};
onMounted(() => {
src/views/project/ch/home/component/waterRight/top.vue
@@ -4,36 +4,30 @@
        <p class="set-waterTitle"><strong>WI æ°´åŠ¡æ™ºèƒ½ä¸“å®¶</strong>智慧水务助手</p>
    </div>
    <div class="flex items-center pc-roleList">
        <div v-for="(item, index) in llmList" :key="item.logicId" class="flex items-center pl-6" @click="handleClick(item)">
        <!-- <div v-for="(item, index) in llmList" :key="item.logicId" class="flex items-center pl-6" @click="handleClick(item)">
            <div class="modelItem cursor-pointer flex items-center" :class="{ modelItemActive: item.logicId === activeLLMId }">
                <img :src="item.icon" alt="icon" class="set-icon box-border" />
                <span>{{ item.logicTitle }}</span>
            </div>
            <!-- <el-tooltip :content="item.Content" placement="top" effect="light" popper-class="my-pop">
                <div class="modelItem cursor-pointer flex items-center " :class="{ modelItemActive: item.ID === state.activeRole }">
                    <img :src="item.Icon" alt="icon" class="set-icon box-border" />
                    <span>{{ item.Title }}</span>
                </div>
            </el-tooltip> -->
        </div>
        <div class="flex items-center cursor-pointer pl-5">
            <div class="modelItem cursor-pointer flex items-center">
                <img src="/static/images/wave/More.png" alt="icon" class="set-icon-more box-border" />
                <span>更多</span>
            </div>
        </div>
        </div> -->
    </div>
    <PlayBar v-model="inputValue" @send-click="sendClick" />
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue';
import { GetLLMList, SetLLM } from '/@/api/ai/chat';
import { ElMessage } from 'element-plus';
import { onMounted, ref } from 'vue';
import { GetLLMList } from '/@/api/ai/chat';
import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue';
import router from '/@/router';
import { activeChatRoom, activeLLMId, activeSectionAId } from '/@/stores/chatRoom';
import emitter from '/@/utils/mitt';
import { ElMessage } from 'element-plus';
const emits = defineEmits(['sendClick']);
const inputValue = ref('');
@@ -52,31 +46,6 @@
        },
    });
};
let state = reactive({
    roleList: [
        {
            ID: 1,
            Icon: '/static/images/wave/Glm.jpg',
            Title: '水务GLM',
            Content: '使用最为广泛的知名AI模型,响应速度快,智能化程度高,擅长多领域问题解决,包括创作、翻译、多语种百科知识、数学问题等。',
        },
        {
            ID: 2,
            Icon: '/static/images/wave/Glm.jpg',
            Title: '水务-3.5',
            Content:
                '目前业界最强大的模型,在需要高级推理、深度指令理解和更具创造力的任务中,表现比其他模型更强,例如复杂的文本和逻辑分析、复杂的数学问题等。',
        },
        {
            ID: 3,
            Icon: '/static/images/wave/Glm.jpg',
            Title: '水务-4.0',
            Content:
                '目前业界最强大的模型,在需要高级推理、深度指令理解和更具创造力的任务中,表现比其他模型更强,例如复杂的文本和逻辑分析、复杂的数学问题等。',
        },
    ],
    activeRole: 0,
});
const llmList = ref([]);
const iconList = ['/static/images/wave/Glm.jpg', '/static/images/wave/Glm.jpg', '/static/images/wave/Glm.jpg'];
@@ -113,7 +82,7 @@
};
onMounted(() => {
    getLLMList();
    // getLLMList();
    emitter.on('updateChatInput', (value) => {
        inputValue.value = value;
    });