You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

  1. import { defineStore } from "pinia";
  2. import { getUserCountAPI } from "@/api/AIxiaocaishen";
  3. export const useDeepNineStore = defineStore("deepNine", {
  4. state: () => ({
  5. messages: [],
  6. isLoading: false, // 新增加载状态
  7. UserCount: 0,
  8. chartData: [],
  9. kLineData: [],
  10. dbqbClickRecord: {},
  11. searchRecord: false,
  12. currentUserIndex: null,
  13. inputUserIndex:null,
  14. announcementMsg: null,
  15. // 调用接口状态
  16. aiChatCall:false,
  17. aiEmotionCall:false,
  18. deepNineCall:false,
  19. // 输入框控制
  20. chatInput:false,
  21. emotionInput:false,
  22. deepNineInput:false,
  23. firstAPICall:false,
  24. dbqbScrollToTop:true,
  25. allowTyping:false,
  26. }),
  27. actions: {
  28. async getUserCount() {
  29. const result = await getUserCountAPI({
  30. token: localStorage.getItem("localToken"),
  31. source: "1",
  32. });
  33. this.UserCount = result.data;
  34. },
  35. setLoading(status) {
  36. this.isLoading = status;
  37. },
  38. isLoadingT() {
  39. this.isLoading = true;
  40. },
  41. isLoadingF() {
  42. this.isLoading = false;
  43. },
  44. addKLineData(data) {
  45. this.kLineData.push(data);
  46. },
  47. },
  48. persist: {
  49. key: "deepNine_messages",
  50. storage: sessionStorage,
  51. paths: ["messages", "kLineData"],
  52. },
  53. });