liuyg
2022-03-22 e03c1cc18b888731130b92ad518a0dee6de2e479
src/store/modules/map.js
@@ -1,6 +1,11 @@
import { getStore, setStore } from "@/util/store";
import {
  getStore,
  setStore
} from "@/util/store";
import { getDictionary } from "@/api/system/dict";
import {
  getDictionary
} from "@/api/system/dict";
const map = {
  state: {
@@ -26,6 +31,23 @@
    setPointData(state, data) {
      state.pointData = data;
    },
    readDom(state, data) {
      //时间
      let time = null;
      //判断dom
      let checkDom = () => {
        let dom = data.this.$refs[data.refName];
        if (dom) {
          if (data.fn) {
            data.fn(dom);
          }
          return;
        } else {
          time = setTimeout(checkDom, 100); //自我调用
        }
      }
      checkDom(); //首次运行
    },
  },
};