yangyin
2024-11-03 e8926403c7f190aee079ded3cc11213312087368
src/components/chat/components/playBar/phrase/CommonPhrases.vue
@@ -9,9 +9,9 @@
            <div class="w-full h-full absolute top-0">
               <div class="py-0 mt-0 box-border h-full">
                  <div style="overflow-anchor: none" v-for="(item, index) in commonPhrases" :key="index">
                     <div class="phase_item">
                     <div class="phase_item" @click="titleClick(item)">
                        <div class="flex flex-col">
                           <div class="title" @click="titleClick(item)">
                           <div class="title">
                              {{ item.title }}
                           </div>
                           <!-- <div class="content">
@@ -21,11 +21,11 @@
                        <div class="py-2">
                           <span
                              class="ywifont ywicon-bianji cursor-pointer text-[#767a97] pt-[4px] pr-[6px] pb-[2px] pl-0 rounded-lg !text-[13px]"
                              @click="editCommonPhrases(item)"
                              @click.stop="editCommonPhrases(item)"
                           ></span>
                           <span
                              class="ywifont ywicon-shanchu3 cursor-pointer text-[red] pt-[4px] pr-[6px] pb-[2px] pl-0 rounded-lg"
                              @click="deleteCommonPhrases(item)"
                              @click.stop="deleteCommonPhrases(item)"
                           ></span>
                        </div>
                     </div>
@@ -62,7 +62,7 @@
import { ElMessageBox } from 'element-plus';
import { computed, reactive, ref } from 'vue';
import { addUserSample } from '/@/api/ai/chat';
import { activeGroupType } from '/@/stores/chatRoom';
import { activeGroupType, activeRoomId, activeSampleId, setRoomConfig } from '/@/stores/chatRoom';
const state = reactive({
   useCommonPhrasesDialog: false,
   show_sample_title: false,
@@ -99,8 +99,8 @@
};
const editCommonPhrases = (item) => {
   state.useCommonPhrasesDialog = true;
   state.inputCommonPhrases = item.content;
   state.show_sample_title = true;
   state.inputCommonPhrases = item.title;
};
const deleteCommonPhrases = (item) => {
   ElMessageBox.confirm(`你确定要删除常用语吗?<div style="white-space: pre-line;">[${item.title}]</div>`, '提示', {
@@ -128,7 +128,14 @@
};
//#endregion
//#region ====================== 常用语到对话框 ======================
const titleClick = (item) => {};
const emits = defineEmits<{
   (event: 'updateCommonChatInput', val): void;
}>();
const titleClick = (item) => {
   emits('updateCommonChatInput', item.title);
   setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false);
   activeSampleId.value = item.id;
};
//#endregion
</script>
<style scoped lang="scss">
@@ -189,14 +196,17 @@
            }
            .title {
               font-size: 14px;
               color: #060607;
               font-family: PingFang HK;
               font-weight: 600;
               color: #8d8e99;
               font-weight: 400;
               font-style: normal;
               white-space: nowrap;
               text-overflow: ellipsis;
               overflow: hidden;
               &:hover {
                  color: #060607;
               }
            }
            .content {
               font-size: 12px;
               color: #5e6772;