wujingjing
2024-10-28 feb89d709f61ee862d5914f429a855f3e990898b
src/views/project/ch/home/component/waterRight/top.vue
@@ -1,7 +1,7 @@
<template>
   <div class="flex items-center">
      <img src="/static/images/logo/logo-mini.svg" alt="logo" class="layout-logo-medium-img" />
      <p class="set-waterTitle"><strong>WI 水务智能专家</strong>智慧水务助手</p>
      <img src="/static/images/logo/logoWithNoName.png" alt="logo" class="layout-logo-medium-img" />
      <p class="set-waterTitle"><strong>WI 水务智能管家</strong>智慧水务助手</p>
   </div>
   <div class="flex items-center pc-roleList">
      <!-- <div v-for="(item, index) in llmList" :key="item.logicId" class="flex items-center pl-6" @click="handleClick(item)">
@@ -17,26 +17,40 @@
         </div>
      </div> -->
   </div>
   <PlayBar v-model="inputValue" @send-click="sendClick" />
   <PlayBar v-model="inputValue" @send-click="sendClick" :is-home="true" />
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus';
import { onMounted, ref } from 'vue';
import { GetLLMList } from '/@/api/ai/chat';
import { ref } from 'vue';
import { GetLLMList, setHistoryGroupTitle } from '/@/api/ai/chat';
import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue';
import router from '/@/router';
import { activeChatRoom, activeLLMId, activeSectionAId } from '/@/stores/chatRoom';
import emitter from '/@/utils/mitt';
const emits = defineEmits(['sendClick']);
const inputValue = ref('');
import { handleNormalAuth } from '/@/utils/request';
const sendClick = () => {
   if (!inputValue.value) return;
import logo from './logo.png'
const emits = defineEmits(['sendClick']);
const inputValue = ref('你是谁?');
const sendClick = async (cb) => {
   if (!inputValue.value.trim()) return;
   if (!activeSectionAId.value) {
      ElMessage.warning('请选择应用场景');
      return;
   }
   if (!handleNormalAuth()) {
      return;
   }
   const res = await setHistoryGroupTitle({
      history_group_id: activeChatRoom.value.id,
      title: inputValue.value,
   });
   if (!res.json_ok) {
      return ElMessage.error('修改聊天室名称失败');
   }
   activeChatRoom.value.title = inputValue.value;
   activeChatRoom.value.isInitial = false;
   router.push({
@@ -81,11 +95,12 @@
   setLLm(item.logicId);
};
onMounted(() => {
   // getLLMList();
   emitter.on('updateChatInput', (value) => {
      inputValue.value = value;
   });
const updateChatInput = (val) => {
   inputValue.value = val;
};
defineExpose({
   updateChatInput,
});
</script>
<style scoped lang="scss">