yangyin
2024-07-22 945a91d069a5188c55e973b40f02fc5ce07a99c3
src/components/drawer/CustomDrawer.vue
@@ -50,7 +50,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]" v-for="item in queryData" :key="item.sample_id">
                     <div class="w100 pb-[20px]" v-for="item in showSampleList" :key="item.sample_id">
                        <div
                           class="cursor-pointer flex box-border p-[12px] w100 rounded bg-[#f5f7fd] transition-[background-color .2s]"
                           @click="changeExample(item)"
@@ -140,8 +140,7 @@
      { ID: 2, Name: '指令模板' },
   ],
   activeName: 1,
   exampleTabList: [],
   instructList: [],
   activeLabelName: 0,
   activeInstructName: 0,
   isShowExpand: false,
@@ -157,7 +156,6 @@
});
const instructContentList = ref([]); //指令列表
const exampleList = ref([]); //示例列表
const isShow = defineModel('isShow', {
   type: Boolean,
});
@@ -197,7 +195,6 @@
   });
   exampleList.value = res.samples;
   state.exampleContent = array;
   state.listSampleExpand = true;
};
//随机生成颜色
const randomHexColor = () => {
@@ -226,6 +223,13 @@
//标签点击事件(提问示例)
const handleLabelClick = (item) => {
   state.activeLabelName = item.section_id;
   const exampleShowLabelList = [];
   exampleList.value.forEach((exampleItem) => {
      if (exampleItem.section_a_id == item.section_id) {
         exampleShowLabelList.push(exampleItem);
      }
   });
   showSampleList.value = exampleShowLabelList;
};
//标签点击事件(指令模板)
const handleInstructClick = (item) => {
@@ -281,9 +285,8 @@
const queryParams = ref({
   sample_title: '',
});
const { query, queryData } = useSearch(exampleList, queryParams);
const debounceQuery = debounce(query);
const { query: querySample, queryData: showSampleList } = useSearch(exampleList, queryParams);
const debounceQuery = debounce(querySample);
watch(
   () => queryParams.value.sample_title,