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.

53 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. }),
  26. actions: {
  27. async getUserCount() {
  28. const result = await getUserCountAPI({
  29. token: localStorage.getItem("localToken"),
  30. source: "1",
  31. });
  32. this.UserCount = result.data;
  33. },
  34. setLoading(status) {
  35. this.isLoading = status;
  36. },
  37. isLoadingT() {
  38. this.isLoading = true;
  39. },
  40. isLoadingF() {
  41. this.isLoading = false;
  42. },
  43. addKLineData(data) {
  44. this.kLineData.push(data);
  45. },
  46. },
  47. persist: {
  48. key: "deepNine_messages",
  49. storage: sessionStorage,
  50. paths: ["messages", "kLineData"],
  51. },
  52. });