yangyin
2024-10-29 5cb1b28d760e268a9e0bdb96843a654c240915b6
src/stores/chatRoom.ts
@@ -1,5 +1,5 @@
import { computed, ref } from 'vue';
import { getSectionList,getSelectSample, getUserTemplateList } from '../api/ai/chat';
import { getSectionList, getSelectSample, getUserTemplateList } from '../api/ai/chat';
import type { ChatRoomItem } from '../layout/component/sidebar/components/types';
/**
 * Room 关联的一些配置
@@ -103,7 +103,15 @@
      isTemplate: true,
      //#endregion
   }));
   exampleSceneList.value = samples.concat(templateSamples).map((item) => ({ ...item, Icon: '/static/images/wave/ChatImg.png' }));
   exampleSceneList.value = samples
      .concat(templateSamples)
      .map((item) => ({ ...item, Icon: '/static/images/wave/ChatImg.png', BgColor: randomHexColor() }));
};
//随机生成颜色
const randomHexColor = () => {
   return `#${Math.floor(Math.random() * 16777215)
      .toString(16)
      .padEnd(6, '0')}`;
};
/**
 * 获取全局所有数据