import { defineStore } from 'pinia';

export const useCloudQueryStore = defineStore({
  id: 'cloudquery',
  state: () => ({
    // 当前云查询查询的
    beforeId: '',
    geomid: '',
    caseno: '',
    // 程序锁标识
    identification: false,
    // 云查询信息
    cloudqueryInfo: {},
    // 云查询结果展示
    cloudQueryModalInfo: {
      basicQuery: {
        landClassify: {},
        plowLandOccupy: {},
      },
      timeImages: {},
    },
    // 云查询提示信息
    cloudQueryVisible: false,
  }),
  getters: {
    getBeforeId: (state) => {
      return state.beforeId;
    },
    getGeomid: (state) => {
      return state.geomid;
    },
    getCaseno: (state) => {
      return state.caseno;
    },
    getCloudQueryInfo: (state) => {
      return state.cloudqueryInfo;
    },
    getIdentification: (state) => {
      return state.identification;
    },
    getCloudQueryModalInfo: (state) => {
      return state.cloudQueryModalInfo;
    },
    getCloudQueryVisable: (state) => {
      return state.cloudQueryVisible;
    },
  },
  actions: {
    setBeforeId(info: any) {
      this.beforeId = info;
    },
    setGeomid(info: any) {
      this.geomid = info;
    },
    setCaseno(info: any) {
      this.caseno = info;
    },
    setCloudQueryInfo(info: any) {
      this.cloudqueryInfo = info;
    },
    setIdentification(state: boolean) {
      this.identification = state;
    },
    setCloudQueryModalInfo(data: any) {
      this.cloudQueryModalInfo = data;
    },
    setCloudQueryVisable(data: any) {
      this.cloudQueryVisible = data;
    },
  },
});
