From 5d7b63225ca327aee2650fd6d36c3a7fc8f11cf1 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期一, 28 十月 2024 15:40:51 +0800 Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test --- src/components/drawer/CustomDrawer.vue | 76 +++++++++++++++++++------------------- 1 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/components/drawer/CustomDrawer.vue b/src/components/drawer/CustomDrawer.vue index e1c3f1c..de14af5 100644 --- a/src/components/drawer/CustomDrawer.vue +++ b/src/components/drawer/CustomDrawer.vue @@ -5,26 +5,26 @@ </div> <div class="pc-mouldboard column exampleSlide"> <div class="header flex items-center justify-center"> - <div + <!-- <div class="box-border flex w-[234px] h-[32px] rounded-md items-center justify-between cursor-pointer relative border border-solid border-[#2c2d33]" > <div class="tabbar-item" - :class="state.activeName === item.ID ? 'set-tabbar-active' : ''" + :class="activeGroupType.value === item.ID ? 'set-tabbar-active' : ''" @click="handleTabClick(item)" v-for="item in state.tabNameList" :key="item.ID" > {{ item.Name }} </div> - </div> + </div> --> <i class="ywifont ywicon-guanbi text-[#999] text-[18px] absolute right-[14px] top-5 cursor-pointer" @click="handleCloseTemplate" ></i> </div> - <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 1"> + <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="activeGroupType == '涓氬姟鍦烘櫙'"> <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px]"> <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl"> <el-input v-model="queryParams.sample_title" placeholder="鎼滅储鏇村" class="set-input" :prefix-icon="Search" clearable> @@ -37,7 +37,7 @@ v-for="(item, index) in state.customBusinessList" :key="index" :class="{ 'set-group-label-active': state.activeBusinessName === item.group_id }" - class="flex items-center" + class="flex items-center border border-solid border-[#b2b2b2] rounded-xl mx-[3px] leading-6" @click="handleBusinessClick(item)" > <span class="set-group-name">{{ item.group_name }}</span> @@ -45,7 +45,7 @@ </div> </div> <div - class="overflow-hidden min-h-[38px] transition-[max-height 0.2s] w100 flex flex-wrap text-xs leading-[14px] items-center" + class="overflow-hidden min-h-[34px] transition-[max-height 0.2s] w100 flex flex-wrap text-xs leading-[14px] items-center bg-[#f5f7fd]" > <div v-for="(itemChildren, index) in state.customBusinessChildList" @@ -80,7 +80,7 @@ </div> </div> </div> - <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 2"> + <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="activeGroupType == '鍔炲叕鍔╂墜'"> <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px]"> <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl"> <el-input v-model="officeParams.template_title" placeholder="鎼滅储鏇村" class="set-input" :prefix-icon="Search" clearable> @@ -93,7 +93,7 @@ v-for="(item, index) in state.customOfficeList" :key="index" :class="{ 'set-group-label-active': state.activeOfficeName === item.group_id }" - class="flex items-center" + class="flex items-center border border-solid border-[#b2b2b2] rounded-xl mx-[3px] leading-6" @click="handleOfficeClick(item)" > <span class="set-group-name">{{ item.group_name }}</span> @@ -101,7 +101,7 @@ </div> </div> <div - class="overflow-hidden min-h-[38px] transition-[max-height 0.2s] w100 flex flex-wrap text-xs leading-[14px] items-center" + class="overflow-hidden min-h-[34px] transition-[max-height 0.2s] w100 flex flex-wrap text-xs leading-[14px] items-center bg-[#f5f7fd]" > <div v-for="(itemChildren, index) in state.customOfficeChildList" @@ -130,7 +130,7 @@ </div> </div> </div> - <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 3"> + <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="activeGroupType == '鐭ヨ瘑搴�'"> <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px]"> <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl"> <el-input v-model="queryParams.sample_title" placeholder="鎼滅储鏇村" class="set-input" :prefix-icon="Search" clearable> @@ -143,7 +143,7 @@ v-for="(item, index) in state.knowledgeBaseList" :key="index" :class="{ 'set-group-label-active': state.activeKnowledgeName === item.group_id }" - class="flex items-center" + class="flex items-center border border-solid border-[#b2b2b2] rounded-xl mx-[3px] leading-6" @click="handleKnowledgeClick(item)" > <span class="set-group-name">{{ item.group_name }}</span> @@ -151,7 +151,7 @@ </div> </div> <div - class="overflow-hidden min-h-[38px] transition-[max-height 0.2s] w100 flex flex-wrap text-xs leading-[14px] items-center" + class="overflow-hidden min-h-[34px] transition-[max-height 0.2s] w100 flex flex-wrap text-xs leading-[14px] items-center bg-[#f5f7fd]" > <div v-for="(itemChildren, index) in state.customKnowledgeChildList" @@ -204,16 +204,10 @@ import { computed, reactive, ref, watch } from 'vue'; import { getSectionList, getSelectSample, getUserTemplateList } from '/@/api/ai/chat'; import { useSearch } from '/@/hooks/useSearch'; -import { activeRoomId, activeSampleId, activeSectionAId, sectionAList, setRoomConfig } from '/@/stores/chatRoom'; +import { activeGroupType, activeRoomId, activeSampleId, activeSectionAId, sectionAList, setRoomConfig } from '/@/stores/chatRoom'; import { convertListToTree, debounce } from '/@/utils/util'; import { OptClassificationMap, classificationEnum } from '/@/views/types/processDrawing/index'; let state = reactive({ - tabNameList: [ - { ID: 1, Name: '涓氬姟鍦烘櫙' }, - { ID: 2, Name: '鍔炲叕鍔╂墜' }, - { ID: 3, Name: '鐭ヨ瘑搴�' }, - ], - activeName: 1, activeBusinessName: '', //鍦烘櫙 activeBusinessChildName: '', customBusinessList: [], @@ -286,16 +280,7 @@ }; //#endregion //#region ====================== 榛樿閫夋嫨绗竴涓殑鍦烘櫙鐨勫瓙鍦烘櫙 ====================== -//tags鏍囩鍒囨崲 -const handleTabClick = async (item) => { - state.activeName = item.ID; - if (state.activeName == 2) { - if (state.listInstructExpand) return; - await getUserTemplate(); - state.listInstructExpand = true; - } - tagListClick(sectionAList.value); -}; + //鍦烘櫙瀛愬満鏅� const handleBusinessClick = (item) => { state.activeBusinessName = item.group_id; @@ -375,7 +360,7 @@ await getMainSectionList().finally(() => { loadingData.value = false; }); - if (state.activeName == 1 || state.activeName == 3) { + if (activeGroupType.value == '涓氬姟鍦烘櫙' || activeGroupType.value == '鐭ヨ瘑搴�') { if (state.listSampleExpand) return; await getSelectListSample(); state.listSampleExpand = true; @@ -469,8 +454,8 @@ officeList.push(item); } }); - switch (state.activeName) { - case 1: + switch (activeGroupType.value) { + case '涓氬姟鍦烘櫙': const treeBusinessList = convertListToTree(businessList, { ID: 'group_id', Children: 'Children', @@ -481,7 +466,7 @@ state.customBusinessChildList = treeBusinessList[0].Children; //榛樿閫変腑绗竴涓笟鍔″満鏅殑绗竴涓瓙鍦烘櫙鐨勬暟鎹簮 state.activeBusinessChildName = treeBusinessList[0].Children[0].group_id; break; - case 2: + case '鍔炲叕鍔╂墜': const treeOfficeList = convertListToTree(officeList, { ID: 'group_id', Children: 'Children', @@ -492,7 +477,7 @@ state.customOfficeChildList = treeOfficeList[0].Children; //榛樿閫変腑绗竴涓姙鍏姪鎵嬬殑绗竴涓瓙鍦烘櫙鐨勬暟鎹簮 state.activeOfficeChildName = treeOfficeList[0].Children[0].group_id; //榛樿閫変腑绗竴涓姙鍏姪鎵嬬殑绗竴涓瓙鍦烘櫙 break; - case 3: + case '鐭ヨ瘑搴�': const treeTagList = convertListToTree(selectTagList, { ID: 'group_id', Children: 'Children', @@ -521,6 +506,20 @@ }; //#endregion +watch( + () => activeGroupType.value, + async (val) => { + if (val == '鍔炲叕鍔╂墜') { + if (state.listInstructExpand) return; + await getUserTemplate(); + state.listInstructExpand = true; + } + tagListClick(sectionAList.value); + }, + { + immediate: true, + } +); defineExpose({ getTableData }); </script> <style scoped lang="scss"> @@ -552,10 +551,10 @@ .set-group-name { margin: 0px 7px; white-space: nowrap; - border: 1px solid #999; - border-radius: 0.75rem; - padding: 0 6px; - line-height: 22px; + // border: 1px solid #999; + // border-radius: 0.75rem; + // padding: 0 6px; + // line-height: 22px; } } } @@ -640,6 +639,7 @@ max-height: 180px; } .set-group-label-active { + border-color: #161616; color: #000; } .set-label-active { -- Gitblit v1.9.3