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

import { defineStore } from "pinia";
import { getUserCountAPI } from "@/api/AIxiaocaishen";
export const useDeepNineStore = defineStore("deepNine", {
state: () => ({
messages: [],
isLoading: false, // 新增加载状态
UserCount: 0,
chartData: [],
kLineData: [],
dbqbClickRecord: {},
searchRecord: false,
currentUserIndex: null,
inputUserIndex:null,
announcementMsg: null,
// 调用接口状态
aiChatCall:false,
aiEmotionCall:false,
deepNineCall:false,
// 输入框控制
chatInput:false,
emotionInput:false,
deepNineInput:false,
firstAPICall:false,
dbqbScrollToTop:true,
}),
actions: {
async getUserCount() {
const result = await getUserCountAPI({
token: localStorage.getItem("localToken"),
source: "1",
});
this.UserCount = result.data;
},
setLoading(status) {
this.isLoading = status;
},
isLoadingT() {
this.isLoading = true;
},
isLoadingF() {
this.isLoading = false;
},
addKLineData(data) {
this.kLineData.push(data);
},
},
persist: {
key: "deepNine_messages",
storage: sessionStorage,
paths: ["messages", "kLineData"],
},
});