import { defineStore } from 'pinia';
import { getAllTableHeaderColumnsApi } from '/@/api/sys/vent';

export const useVentStore = defineStore({
  id: 'app-vent',
  state: () => {
    return {
      allTableHeaderColumns: {},
      resultWebSocket: null,
    };
  },
  getters: {
    getAllTableHeaderColumnsApi(): any {
      return this.allTableHeaderColumns;
    },
    getResultWebSocket(): any {
      return this.resultWebSocket;
    },
  },
  actions: {
    async setAllTableHeaderColumns() {
      this.allTableHeaderColumns = await getAllTableHeaderColumnsApi();
    },
    setResultWebSocket(resultWebSocket) {
      this.resultWebSocket = resultWebSocket;
    },
  },
});
