gerson
2024-07-06 542b404c51f67b8fb9e56ed0ba0562e31af7d257
Merge branch 'master' of http://47.103.154.90:83/r/WI/Web.V1.0
已修改2个文件
81 ■■■■■ 文件已修改
src/views/project/ch/home/component/waterRight/bottom.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/component/waterRight/center.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/ch/home/component/waterRight/bottom.vue
@@ -17,7 +17,7 @@
        <div class="main">
            <div
                class="main_item flex cursor-pointer"
                v-for="(item, index) in state.applicationScenarios"
                v-for="item in state.applicationScenarios"
                :key="item.section_id"
                :class="{ main_item_active: item.section_id === activeSectionAId }"
                @click="changeScenarios(item)"
@@ -30,11 +30,14 @@
                </div>
            </div>
        </div>
        <div class="set-page">
            <el-pagination size="small" background layout="prev, pager, next" class="mt-4" />
        </div>
    </div>
</template>
<script setup lang="ts">
import { onMounted, reactive } from 'vue';
import { onMounted, reactive, computed } from 'vue';
import { getSectionList } from '/@/api/ai/chat';
import router from '/@/router';
import { activeSectionAId } from '/@/stores/chatRoom';
@@ -45,25 +48,34 @@
});
const changeScenarios = async (item) => {
    activeSectionAId.value = item.section_id;
    return;
    router.push({
        name: 'Scenario',
        query: { ID: item.section_id },
    });
};
const getMainSectionList = async () => {
    const res = await getSectionList();
    let result = res.sections;
    let result = [];
    const iconList = ['biaodan', 'putong', 'zhongduancanshuchaxun', 'shidu'];
    res.sections.forEach((sectionItem, index) => {
        sectionItem.Icon = iconList[index];
        if (index < 4) {
            result.push(sectionItem);
        }
    });
    state.applicationScenarios = res.sections;
    state.applicationScenarios = result;
    res.sections?.[0] && changeScenarios(res.sections[0]);
    // state.scenariosIds = result.map((item) => item.section_id);
};
const groupedArray = computed(() => {
    const groups = [];
    let i = 0;
    while (state.applicationScenarios.length > i) {
        groups.push(state.applicationScenarios.slice(i, (i += 4)));
    }
    return groups;
});
const nextPage = () => {
    const index = Math.floor(Math.random() * groupedArray.value.length);
    state.applicationScenarios = groupedArray.value[index];
};
// 查看更多
const lookMore = () => {
    router.push({
@@ -191,7 +203,11 @@
            }
        }
    }
    .set-page {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 10px 0px;
    }
}
</style>
import item from 'element-plus/es/components/space/src/item';import item from 'element-plus/es/components/space/src/item';import item
from 'element-plus/es/components/space/src/item';
src/views/project/ch/home/component/waterRight/center.vue
@@ -50,7 +50,7 @@
            <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 1">
                <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px] overflow-auto">
                    <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl">
                        <el-input v-model="queryParams.searchInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable>
                        <el-input v-model="queryParams.sample_title" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable>
                        </el-input>
                    </div>
                    <div class="mt20 w100 relative">
@@ -97,7 +97,7 @@
            <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 2">
                <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px] overflow-auto">
                    <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl">
                        <el-input v-model="queryParams.instructInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable>
                        <el-input v-model="instructParams.template_title" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable>
                        </el-input>
                    </div>
                    <div class="mt20 w100 relative">
@@ -120,11 +120,7 @@
                            <i class="iconfont icon-zhongduancanshu" title="收缩" @click="handleExpandClick(2)" v-show="state.isShowExpand"></i>
                        </div>
                        <div class="mt20 w100">
                            <div
                                class="w100 pb-[20px] flex overflow-auto flex-col"
                                v-for="item in state.instructContentList"
                                :key="item.template_id"
                            >
                            <div class="w100 pb-[20px] flex overflow-auto flex-col" v-for="item in showInstructList" :key="item.template_id">
                                <div class="bg-[#f5f7fd] p-[12px] transition-[background-color .2s] flex flex-col rounded-2xl">
                                    <div class="flex justify-between">
                                        <span class="set-title">{{ item.template_title }}</span>
@@ -230,14 +226,13 @@
            Title: '发现探索',
        },
    ],
    instructContentList: [],
    activeLabelName: 0,
    activeInstructName: 0,
    isShowExpand: false,
});
const exampleList = ref([]);
const exampleList = ref([]); //模版列表
const instructContentList = ref([]); //指令列表
onMounted(() => {
    getSelectListSample();
    getUserTemplate();
@@ -277,13 +272,12 @@
//获取用户模板
const getUserTemplate = async () => {
    const res = await getUserTemplateList();
    state.instructContentList = res.templates;
    instructContentList.value = res.templates;
};
//换一批
const batchChange = () => {
    const index = Math.floor(Math.random() * groupedArray.value.length);
    state.exampleContent = groupedArray.value[index];
    // console.log(state.exampleContent, 341);
};
//高级示例
const advanceExampleClick = () => {
@@ -316,21 +310,34 @@
        .toString(16)
        .padEnd(6, '0')}`;
};
//#region ====================== 搜索聊天室 ======================
//#region ====================== 搜索模板/指令 ======================
const queryParams = ref({
    searchInput: '',
    instructInput: '',
    sample_title: '',
});
const { query, queryData } = useSearch(exampleList, queryParams);
const debounceQuery = debounce(query);
watch(
    () => queryParams.value.searchInput,
    () => queryParams.value.sample_title,
    (val) => {
        debounceQuery();
    }
);
//指令
const instructParams = ref({
    template_title: '',
});
const { query: queryInstruct, queryData: showInstructList } = useSearch(instructContentList, instructParams);
const instructQuery = debounce(queryInstruct);
watch(
    () => instructParams.value.template_title,
    (val) => {
        instructQuery();
    }
);
//#endregion
</script>
<style scoped lang="scss">