yangyin
2024-10-10 a4fc6baa8e87bd1094f76c8b6908a7673699787c
src/components/drawer/CustomDrawer.vue
@@ -40,16 +40,16 @@
                        :key="item.group_id"
                        :class="{ 'set-label-active': state.activeLabelName === item.group_id }"
                        @click="handleLabelClick(item)"
                        class="cursor-pointer m-[5px] py-[5px] px-[10px] rounded-xl border border-solid border-[#b2b2b2] bg-[#e0e7f] text-[#4c4c4c] transition-[background-color .1s, color .1s, border-color .1s]"
                        class="cursor-pointer m-[5px] py-[5px] pl-[10px] pr-[14px] rounded-xl border border-solid border-[#b2b2b2] bg-[#e0e7f] text-[#4c4c4c] transition-[background-color .1s, color .1s, border-color .1s]"
                     >
                        {{ item.section_name }}
                        {{ item.group_name }}
                     </div>
                  </div>
                  <div class="bg-[#e0e7fb] absolute right-0 top-0 text-[#131313] w-[30px] h-[26px] cursor-pointer flex items-center">
                     <i class="myiconfont icon-bolangneng" title="展开" @click="handleExpandClick(1)" v-show="!state.isShowExpand"></i>
                     <i class="myiconfont icon-zhongduancanshu" title="收缩" @click="handleExpandClick(2)" v-show="state.isShowExpand"></i>
                  </div>
                  <div class="mt20 w100">
                  <div class="mt20 w100" v-show="finalSampleList.length > 0">
                     <div class="w100 pb-[20px]" v-for="item in finalSampleList" :key="item.sample_id">
                        <div
                           class="cursor-pointer flex box-border p-[12px] w100 rounded bg-[#f5f7fd] transition-[background-color .2s]"
@@ -68,6 +68,7 @@
                        </div>
                     </div>
                  </div>
                  <div class="mt20 w100" v-show="finalSampleList.length == 0"><el-empty description="暂无数据" /></div>
               </div>
            </div>
         </div>
@@ -84,12 +85,12 @@
                  >
                     <div
                        v-for="item in state.customOfficeList"
                        :key="item.template_id"
                        :class="{ 'set-label-active': state.activeInstructName === item.template_id }"
                        :key="item.group_id"
                        :class="{ 'set-label-active': state.activeInstructName === item.group_id }"
                        @click="handleInstructClick(item)"
                        class="cursor-pointer m-[5px] py-[5px] px-[10px] rounded-xl border border-solid border-[#b2b2b2] bg-[#e0e7f] text-[#4c4c4c] transition-[background-color .1s, color .1s, border-color .1s]"
                     >
                        {{ item.section_name }}
                        {{ item.group_name }}
                     </div>
                  </div>
                  <div class="bg-[#e0e7fb] absolute right-0 top-0 text-[#131313] w-[30px] h-[26px] cursor-pointer flex items-center">
@@ -97,7 +98,7 @@
                     <i class="myiconfont 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 showInstructList" :key="item.template_id">
                     <div class="w100 pb-[20px] flex overflow-auto flex-col" v-for="item in showInstructList" :key="item.group_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>
@@ -171,7 +172,6 @@
   const res = await getSelectSample({}).finally(() => {
      state.listSampleLoading = false;
   });
   console.log(res, 63);
   state.exampleRandomContent = res.samples;
   const array = [];
@@ -183,7 +183,6 @@
      }
   });
   exampleList.value = res.samples;
   state.exampleContent = array;
};
//随机生成颜色
@@ -196,7 +195,7 @@
   emit('updateChatInput', item.sample_question);
   setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false);
   activeSampleId.value = item.sample_id;
   activeSectionAId.value = item.section_a_id;
   activeSectionAId.value = item.group_id;
};
//获取用户模板
const getUserTemplate = async () => {
@@ -252,10 +251,10 @@
      'jinridaiban',
      'gongju',
   ];
   res.sections.forEach((sectionItem, index) => {
   res.groups.forEach((sectionItem, index) => {
      sectionItem.Icon = iconList[index];
   });
   sectionAList.value = res.sections;
   sectionAList.value = res.groups;
};
const loadingData = ref(false);
const getTableData = async () => {
@@ -302,10 +301,9 @@
const { query: querySample, queryData: showSampleList } = useSearch(exampleList, queryParams);
const debounceQuery = debounce(querySample);
const finalSampleList = computed(() => {
   const result = showSampleList.value.filter((item) => item.section_a_id == state.activeLabelName);
   const result = showSampleList.value.filter((item) => item.group_id == state.activeLabelName);
   return result;
});
watch(
   () => queryParams.value.sample_title,
   (val) => {