function getQueryStringMap() {
  //取得查询字符串并去掉开头的问号
  var str = (location.search.length > 0 ? location.search.substring(1) : "");
  var args = {};//保存数据的对象
  items = str.length ? str.split('&') : [];//取得每一项
  var item = null;
  var name = null;
  var value = null;
  for (var i = 0; i < items.length; i++) {
    item = items[i].split('=');
    name = decodeURIComponent(item[0]);
    value = decodeURIComponent(item[1]);
    if (name.length) {
      args[name] = value;
    }
  }
  return args;
}
var queryMap = getQueryStringMap();//解析当前的查询字符串
function addCSS(csspath) {
  var link = document.createElement('link');
  link.type = 'text/css';
  link.rel = 'stylesheet';
  link.href = csspath;
  document.getElementsByTagName("head")[0].appendChild(link);
}
var currentTheme = (queryMap["paramtheme"] && queryMap["paramtheme"] != "default") ? queryMap["paramtheme"] : "";
//axios.get("/vue/comp/base").then(function (res) {
$.base64.utf8encode = true;
basecomp.forEach(function (comp) {
  try {
    var obj = eval("(" + comp + ")");
    Vue.component(obj.vname, obj);
  } catch (e) {
    console.log(e);
  }
});
console.log("load base component finished...");
function buildPromise(compath) {
  return Promise.resolve(new Promise(function (resolve, reject) {
    //异步加载组件
    axios.get(compath, { "headers": { "theme": currentTheme } }).then(function (res) {
      console.log(compath);
      var obj = eval("(" + unescape(res.data) + ")");
      resolve(obj);
    }).catch(function (reason) {
      console.log(reason)
    })
  }));
}
function componentFactory(comname) {
  var compath = "/vue/comp/" + comname;
  var tmpFunc = function () {
    return buildPromise(compath);
  }
  return tmpFunc;
}
window.componentFactory = componentFactory;
Vue.mixin({
  props: ["modelName"],
  computed: Vuex.mapState({
    currentUser: state => {
      return state.currentUser;
    },
    currentCompany: state => {
      return state.currentCompany;
    },
    pfooterinfo: state => {
      return state.pfooterinfo;
    },
    codePath: state => {
      return state.currentCodePath;
    },
    ctlName: function () {
      return this.modelName + "Ctl";
    },
    header_height: state => {
      return state.header_height;
    },
    socketClient: state => {
      return state.socketClient;
    },
    istabclick: state => {
      return state.istabclick;
    },
  }),
  methods: {
    getUrl(md) {
      return "web/" + this.ctlName + "/" + md;
    },
  }
});

var routes = [];
var codepaths = {};
var mapTile = {};
var mapRouterEntry = {};
var isp = 0;
//菜单的全局缓存
//var global_rsconfig=null;
//axios.get("/web/metaCtl/getRouteConfigWithoutProduct").then(d => {
isp = routePath.isp;
Object.keys(routePath.bizs).map((k) => {
  //path是路由，静态的路由
  var pathTmp = routePath.bizs[k].path;
  var codepath = routePath.bizs[k].codepath;
  if (!routePath.bizs[k].isDynamicRoute) {//如果不忽略静态路由
    var tmp = { "path": pathTmp, "components": {} };
    var vname = routePath.bizs[k].comname;
    //设置要显示的rouer-view的名字

    tmp.components[pathTmp] = componentFactory(routePath.bizs[k].comname);
    mapTile[pathTmp] = routePath.bizs[k].title;
    if (isp == 0) {
      if (pathTmp == "/") {
        tmp.components[pathTmp] = componentFactory("moreservice");
        tmp["query"] = { "itemtype": "ip" };
        console.log("ppppppppppppppppppppppppppppppppp", tmp);
      }
    }
    routes.push(tmp);
    mapRouterEntry[pathTmp] = tmp;
  }

  codepaths[pathTmp] = codepath;//暂存每个叶子节点对应的codepath
});
//元数据分析时会为每个叶子节点动态生成codepath,按照code生成从根开始的路径
console.log(JSON.stringify(codepaths));
var router = new VueRouter({
  routes: routes,
});
router.mapTile = mapTile;
router.mapRouterEntry = mapRouterEntry;
const store = new Vuex.Store({
  state: {
    popupsCode: null,
    count: 1,
    products: null,
    currentCodePath: "",
    istabclick: false,
    currentUser: null,
    currentCompany: null,
    curSelRow: {},
    header_height: "200",
    socketClient: null,
    logoUrl: "",
    appimgUrl: "",
    currentChatTo: "",
    pfooterinfo: null,
  },
  mutations: {
    increment(state) {
      state.count++
    },
  }
});
function headtransparent() {
  // $("#header").addClass("headtransparent");
  $("#leftmenudiv").addClass("menutransparent");
  $(".spechorizotal .nav_color").css("color", "white");
  // $("#header").css("background-color", "transparent");
  // $("#header").css("border-bottom", "0px solid black");
  $("#welcome").css("color", "#fff");
  $("#exitbtn").css("color", "#fff");
  $("#adminbtn").css("color", "#fff");
  $("#adminbtn").css("display", "display");
  $("#loginbtn").css("color", "white");
  $("#appname").css("color", "white");
  // $("#footer").show();
}
function headnotransparent() {
  $(".spechorizotal .nav_color").css("color", "black");
  $(".spechorizotal .nav_color:hover").css("color", "#2692FF");
  // $("#header").removeClass("headtransparent");
  // $("#header").css("background-color", "white");
  $("#loginbtn").css("color", "#2692FF");
  $("#appname").css("color", "#2692FF");
  $("#footer").hide();
  $('.app-stage').css('min-height', '0px');
}
router.beforeEach((to, from, next) => {
  console.log("enter before...........................");
  console.log(to);
  //设置当前访问的叶子节点的codepath
  //对于静态路由按照路由条目，获取codepath
  //对于工具产品，按照去掉最后一个数字后的路径去获取codepath,要求
  //配置工具类产品的path时，路径要按照products/code(组件名字来设置)
  //--可以添加静态路由，再次映射到产品，比如实现平台功能
  var keyCodePath = to.path;
  if (keyCodePath != '/') {
    this.isfront = false
  }
  if (keyCodePath == '/login') {
    $('.app-stage').css('min-height', '0px');
  } else {
    $('.app-stage').css('min-height', '100%');
  }
  if (keyCodePath != '/' && keyCodePath != '/bycquerytm' && keyCodePath != '/bytmmonit' && keyCodePath != '/tmtransactionmarket'
    && keyCodePath != '/selftmreg' && keyCodePath != '/bytmmonitlist' && keyCodePath != '/bytmmonitlistdetails' && keyCodePath != '/bytmmonitagency'
    && keyCodePath != '/bycdetailtm' && keyCodePath != '/tmtransactiondetail' && keyCodePath != '/bycncldetail' && keyCodePath != '/bycnoticedetailtm'
    && keyCodePath != '/bycnoticetm' && keyCodePath != '/servicedetails' && keyCodePath != '/bycnoticeindex' && keyCodePath != '/icorder' && keyCodePath != '/entdrawing'
    && keyCodePath != '/icproductdetail' && keyCodePath != '/icnameresult' && keyCodePath != '/iframehtml') {
    $('#header_row').addClass('houtai');
    $('#header_row').removeClass('qiantai');
  } else {
    $('#header_row').removeClass('houtai');
    $('#header_row').addClass('qiantai');
  }
  if (keyCodePath == "/" || keyCodePath.indexOf("login") > 0 || keyCodePath.indexOf("more") > 0 || keyCodePath.indexOf("about") > 0) {
    $('#header_row').removeClass('houtai');
    headtransparent();
  } else {
    headnotransparent();
  }
  if (keyCodePath == '/bycquerytm' || keyCodePath == '/bytmmonit' || keyCodePath == '/tmtransactionmarket'
    || keyCodePath == '/selftmreg' || keyCodePath == '/bytmmonitlist' || keyCodePath == '/bytmmonitlistdetails' || keyCodePath == '/bytmmonitagency'
    || keyCodePath == '/bycdetailtm' || keyCodePath == '/tmtransactiondetail' || keyCodePath == '/bycncldetail' || keyCodePath == '/bycnoticedetailtm'
    || keyCodePath == '/bycnoticetm' || keyCodePath == '/servicedetails' || keyCodePath == '/bycnoticeindex' || keyCodePath == '/icorder' || keyCodePath == '/entdrawing'
    || keyCodePath == '/icproductdetail' || keyCodePath == '/icnameresult' || keyCodePath == '/iframehtml') {
    $("#welcome").css("color", "#2692ff");
    $("#exitbtn").css("color", "#2692ff");
    $("#adminbtn").css("color", "#2692ff");
  } else {
    $("#welcome").css("color", "#fff");
    $("#exitbtn").css("color", "#fff");
    $("#adminbtn").css("color", "#fff");
  }
  if (keyCodePath == "" || keyCodePath == "/") {
    keyCodePath = "/"
  } else {
    var indexTmp = keyCodePath.lastIndexOf("/");
    var laststr = keyCodePath.substring(indexTmp + 1);
    console.log(laststr);
    if (!isNaN(laststr)) {
      keyCodePath = keyCodePath.substring(0, indexTmp);
    }
  }
  store.state.currentCodePath = codepaths[keyCodePath];
  if (!codepaths[keyCodePath]) {
    //解决静态:id路由配置的问题
    keyCodePath = keyCodePath + "/:id";
    store.state.currentCodePath = codepaths[keyCodePath];
  }
  next();
});
Vue.use(window['vue-cropper'])
var app = new Vue({
  el: "#app",
  router: router,
  store: store,
  data: function () {
    return {
      areaName: '北京',
      areaArr: [
        {
          name: 'A-G',
          lists: ['北京＞', '安徽＞', '重庆＞', '福建＞', '广东＞', '广西＞', '甘肃＞', '贵州＞']
        },
        {
          name: 'H-J',
          lists: ['河北＞', '河南＞', '海南＞', '湖北＞', '湖南＞', '黑龙江＞', '吉林＞', '江苏＞', '江西＞']
        },
        {
          name: 'L-S',
          lists: ['辽宁＞', '内蒙古＞', '宁夏＞', '青海＞', '上海＞', '四川＞', '山东＞', '山西＞', '陕西＞']
        },
        {
          name: 'T-Z',
          lists: ['天津＞', '新疆＞', '西藏＞', '云南＞', '浙江＞']
        }
      ],
      loadingHome: false,
      headerRowType: false,
      popupsHeight: null,
      popupslineHeight: null,
      popupsType: false,
      popupsDataList: [],
      pDataKey: 0,
      pTowDataKey: null,
      popupsData: [],
      // 
      switchcompany: null,
      companys: [],
      catas: [

      ],
      loading: false,
      items: [
      ],
      logins: [
        // {"icon":"fa fa-home","title":"首页","type":"text",key:"login","isOnGrid":true},
        { "icon": "el-icon-arrow-right", "title": "专利检索", "type": "text", key: "login", "isOnGrid": true },
        { "icon": "el-icon-arrow-right", "title": "专利分析", "type": "text", key: "login", "isOnGrid": true },
        { "icon": "el-icon-arrow-right", "title": "专利竞争分析", "type": "text", key: "login", "isOnGrid": true },
      ],
      editableTabs2: [
        {
          title: '首页',
          name: '/',
        }
      ],
      editableTabsValue2: '/',
      isShowMenu: "true",
      currentCompany: null,
      bankAccount: null,
      footerInfo: null,
      qrcodeurl: "",
      pfooterinfo: null,
      serviceqq: null,
      servicetel: null,
      wxJpg: '/imgs/wxJpg.jpg',
      homeobj: null,
      isfront: true,
      stageType: true,
      isleyu: true,
      isphone: false,
      istop: false,
      iswx: false,
      themename: "",
      showWxrm: false,
      showPhoneNum: false,
      rsData: [],
      titles: [{
        title: 'declare',
        name: '申报通知'
      },
      {
        title: 'projectpublicity',
        name: '立项公示'
      },
      {
        title: 'managementmeasures',
        name: '管理办法'
      }]
    };
  },
  created() {
    var url = window.location.href;
    var arr1 = url.replace("?paramtheme=spring", "").split("/#");
    var titleValue = "";
    if (url.indexOf("isModifyTitle=1") >= 0) {
      titleValue = localStorage.getItem("titleValue");
      // localStorage.setItem("lastaccess","");
    } else {
      titleValue = "";
      // localStorage.setItem("titleValue","");
    }
    if (url.indexOf("isDirectJump=1") >= 0 && arr1.length == 2) {
      this.refreshLoginState(() => {
        this.directJump();
        //需要返回公司信息和主题信息后更新顶部菜单
        this.showtopmenu();
        // if(titleValue){
        //   $("#idtitle").text(titleValue);
        // }
      });
    } else {
      this.refreshLoginState(() => {
        this.initIndexPage();
        //需要返回公司信息和主题信息后更新顶部菜单
        this.showtopmenu();
        // if(titleValue){
        //   $("#idtitle").text(titleValue);
        // }
      });
    }
    this.fetchMetaData()
  },
  updated() {

  },
  computed: {
    isdefault: function () {
      if (this.currentCompany && this.currentCompany.siteTheme != "default") {
        return true;
      } else {
        return false;
      }
    },
  },
  mounted() {
    var sself = this;
    if (queryMap["paramtheme"]) {
      companyinfo.company.siteTheme = queryMap["paramtheme"];
    }
    this.currentCompany = companyinfo.company;

    if (this.currentCompany.siteTheme && this.currentCompany.siteTheme != "") {
      currentTheme = this.currentCompany.siteTheme;
      this.themename = (currentTheme == "default" ? "" : currentTheme);
      if (this.themename != "") {
        addCSS("/css/" + this.themename + ".css");
      }
    }
    this.$store.state.currentCompany = this.currentCompany;
    this.bankAccount = companyinfo.bankAccount;
    this.footerInfo = companyinfo.footerinfo;
    this.pfooterinfo = this.footerInfo;
    this.$store.state.pfooterinfo = this.footerInfo;
    this.serviceqq = "http://wpa.qq.com/msgrd?v=3&uin=" + this.currentCompany.serviceqq + "&site=qq&menu=yes";
    if (this.footerInfo) {
      this.servicetel = this.footerInfo.serviceTel;
    } else {
      this.servicetel = "请完善客服电话";
    }
    var own = sself;
    if (companyinfo) {
      own.findAllServicesitemA();

      own.showtopmenu();
      own.popupsHeight = 'height:' + 390 * document.body.clientWidth / 1920 + "px";
      own.popupslineHeight = 'line-height:' + (350 * document.body.clientWidth / 1920 / 5) + "px";

      //  sself.getReq("/wxop/pushmsgWxop/getQr", {scene:"18396816928"}).then(function (r) {
      //    console.log("11111111rrrrrrrrrrrrrrrrrrrrrrrrr");
      //    console.log(r);
      //  });
      //  sself.getReq("/wxop/pushmsgWxop/getQr", {}).then(function (r) {
      //   console.log("2222222222222rrrrrrrrrrrrrrrrrrrrrrrrr");
      //   console.log(r);
      // });
      //  sself.getReq("/wxop/empowerWxop/componentloginpage", null).then(function (r) {
      //    console.log("rrrrrrrrrrr222222222222rrrrrrrrrrrrrr");
      //    console.log(r);
      //  })
    }
    console.log(productLst);
    // var f=function(){
    //   var own=sself;
    //   var t=setTimeout(()=>{
    //   if(companyinfo){
    //      own.findAllServicesitemA();
    //       own.showtopmenu();
    //       own.popupsHeight = 'height:' + 390*document.body.clientWidth/1920 + "px";
    //       own.popupslineHeight = 'line-height:' + (350*document.body.clientWidth/1920/5) + "px";
    //       clearTimeout(t);
    //       sself.getReq("/wxop/pushmsgWxop/getQr", {scene:"13075556693_4"}).then(function (r) {
    //         console.log("rrrrrrrrrrrrrrrrrrrrrrrrr");
    //         console.log(r);
    //       });
    //       sself.getReq("/wxop/empowerWxop/componentloginpage", null).then(function (r) {
    //         console.log("rrrrrrrrrrr222222222222rrrrrrrrrrrrrr");
    //         console.log(r);
    //       })
    //   }else{
    //       f();
    //   }
    //   },100);
    // };
    // f();
    //获取被授权的公司列表
    this.postReq("/web/companyCtl/refQuery", { fields: ["id", "name"], datapriv: true }).then(d => {
      if (d && d.data) {
        d.data.forEach(r => {
          sself.companys.push({ label: r.name, value: r.id });
        });
      }
    });
    // if (this.$refs.topmenu) {
    //   this.$refs.topmenu.fetchMetaData();
    // }

    // function initMainHeight(){
    //   var appheight=$("#app").height();
    //   var headheight=60;
    //   var footerheight=140;
    //   var minMainHeight=appheight-headheight-footerheight;
    //   console.log("minMainHeightxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    //   console.log(minMainHeight);
    //   $("#stage").css("min-height",minMainHeight+"px");
    // };
    // $(window).resize(()=>{
    //     initMainHeight();
    // });
    // initMainHeight();
    $('#app').scroll(() => {
      if (this.homeobj && this.homeobj.doScroll) {
        this.homeobj.doScroll($('#app').scrollTop());
      }
    });


    this.hidetabs();
    localStorage.removeItem("afterLogin");
    if (window.history && window.history.pushState) {
      window.addEventListener('popstate', this.goBack, false);
    }
    this.isShowMenu = false;
    setTimeout(() => {
      $("#app").css("visibility", "visible");
      $("#imglogo").css("visibility", "visible");
    }, 100);
    setTimeout(() => {
      $("#footer").css("visibility", "visible");
    }, 3000);
    localStorage.setItem("areaName", this.areaName);
  },
  methods: {
    areachoice(name) {
      this.areaName = name.slice(0, name.indexOf('＞'));
      console.log(name.slice(0, name.indexOf('＞')))
    },
    fetchMetaData(cbk) {
      if (global_rsconfig) {
        cfg = global_rsconfig;
        if (cfg) {
          this.rsData = [];
          cfg.children.forEach(r => {
            if (r.istop) {
              this.rsData.push(r);
            }

          });
          if (cbk) {
            cbk();
          }

        }
      } else {
        this.$root.getReq("/web/metaCtl/getRsConfig", null).then(cfg => {
          global_rsconfig = cfg;
          if (cfg) {
            this.rsData = [];
            cfg.children.forEach(r => {
              if (r.istop) {
                this.rsData.push(r);
              }

            });
            if (cbk) {
              cbk();
            }

          }
        });

      }
      console.log(this.rsData, '======___________________+++++++++++++++++++++++')
    },
    backstageHandleCommand(name) {
      console.log(name);
      if (name == '退出') {
        this.onselect('exit')
      } else {
        this.goadmin()
      }
    },
    handleCommand(item) {
      // this.$message('click on item ' + command);
      console.log(item, "----------------");
      // let obj = command.split('/')
      // this.onMenuSelect(obj[1])
      var index = item.code;
      var self = this;
      if (item == "declare") {
        this.stageType = false;
        this.pushx({
          title: "政策资讯",
          name: "/declare"
        });
        return false;
      }
      if (item == "projectpublicity") {
        this.stageType = false;
        this.pushx({
          title: "立项公示",
          name: "/projectpublicity"
        });
        return false;
      }
      if (item == "managementmeasures") {
        this.stageType = false;
        this.pushx({
          title: "管理办法",
          name: "/managementmeasures"
        });
        return false;
      }
      if (index == 'areapatentmonitor') {
        this.stageType = false;

        this.pushx({
          title: "区域专利监控",
          name: "/iframehtmlone",
          params: { url: 'https://zhuanzhidao.gongsibao.com/#/regionalpatentmonitoring' }
        })
        // this.loadingHome = true;
        // setTimeout(()=>{
        //   this.loadingHome = false;
        // },3000);
        return false;
      }
      if (index == 'entdecide') {
        this.stageType = false;
        this.pushx({
          title: "企业决策",
          name: "/iframehtmltwo",
          params: { url: 'https://zhuanzhidao.gongsibao.com/#/businessdecisions' }
        })
        return false;
      }
      this.pushx({
        title: item.label,
        name: item.path
      });
    },
    getQrCode() {
      if (this.footerInfo) {
        return this.footerInfo.wxQrCodeUrl;
      } else {
        return "";
      }
    },
    /**
     * @param {*} obj 
     * {
     *  title:"title", 标题名称，非必填
     *  url:xxxxxxxx.com/xxxxx/xxxxxx, 地址 必填
     *  params:[//参数 非必填
     *    {name:"name",value:"value"},
     *    {name:"name2",value:"value2"},
     *    ...
     *  ]
     *  }
     */
      goShop(){
        window.location.href='#';
        this.windowOpen({url:"/?paramtheme=policyShop#/",params:[]})
      },
    windowOpen(obj) {
      if (!obj) {
        this.$message.warning("参数错误");
        return;
      }
      if (!obj.url) {
        this.$message.warning("url参数错误");
        return;
      }
      var param = "?isDirectJump=1";
      if (obj.title) {
        param = param + "&isModifyTitle=1";
        localStorage.setItem("titleValue", obj.title);
      } else {
        localStorage.setItem("titleValue", "");
      }
      var params = obj.params;
      for (var i = 0; i < params.length; i++) {
        if (params[i] && params[i].name && params[i].value) {
          param = param + "&" + params[i].name + "=" + params[i].value;
        }
      }
      var qurl = obj.url + param;
      window.open(qurl);
    },
    leyuhover() {
      var self = this;
      self.isleyu = false;
      self.isphone = false;
      self.istop = false;
      self.iswx = false;
    },
    phonehover() {
      var self = this;
      self.isleyu = true;
      self.isphone = true;
      self.istop = false;
      self.iswx = false;
      self.showPhoneNum = true;
    },
    phoneleave() {
      var self = this;
      console.log(123);
      self.showPhoneNum = false;
    },
    rwmhover() {
      var self = this;
      self.showWxrm = true;
      self.isleyu = true;
      self.isphone = false;
      self.istop = false;
      self.iswx = true;
    },
    rwmover() {
      var self = this;
      self.showWxrm = false;
    },
    tophover() {
      var self = this;
      self.isleyu = true;
      self.isphone = false;
      self.istop = true;
      self.iswx = false;
    },
    goServiceDetails(item) {
      if (item.code == 'zzsbzc') {
        $('.popups').fadeOut(0);
        this.popupsType = false;
        this.$root.pushx({
          title: "自主商标注册",
          name: "/selftmreg",
          params: { itemCode: item.code }
        });
      } else {
        headnotransparent();
        this.windowOpen({
          url: window.location.href.split("#")[0] + "#/servicedetails",
          title: "服务详情",
          params: [
            { name: "sdsId", value: item.id }
          ]
        })
        // window.open(window.location.href.split("#")[0]+"#/servicedetails?isDirectJump=1&sdsId=" + item.id)
      }
      setTimeout(() => {
        this.$refs.topmenu.fetchMetaData(() => {

        });
      }, 300);
    },
    popupsList(list, key) {
      this.popupsDataList = list.smallList;
      this.pDataKey = key;
      this.pTowDataKey = key;
    },
    popupsLeave() {
      this.pTowDataKey = null;
    },
    findAllServicesitemA() {
      this.company_id = this.$root.currentCompany.id;
      var params = { company_id: this.$root.currentCompany.id };
      var that = this;
      // this.$root.postReq("/web/serviceitemCtl/getAllProducts", params).then(function(d) {
      // console.log(d,"，getAllProducts-----------------");
      that.popupsData = [];
      // if(d.status==0 && d.data){
      productLst.forEach(r => {
        if (r) {
          that.popupsData.push(r);
        }
        that.popupsDataList = that.popupsData[0].smallList;
      })
      // }
      // })
    },
    hidePanel(event) {
      var ap = $("#servicecat")[0];
      var sp = document.getElementsByClassName("popups")[0];
      if (sp && ap) {
        if (!sp.contains(event.target) && !ap.contains(event.target)) {
          $('.popups').fadeOut(0);
        } else {
          var leftNum = $("#header_row")[0].offsetLeft - 10;
          var leftLong = $("#servicecat")[0].offsetLeft + ($("#servicecat")[0].offsetLeft / 2);
          var widthImg = $("#elImg").width();
          $('.popups-kailong').css("left", (widthImg + leftLong) + 'px');
          $('.popups').css("left", leftNum + 'px');
          $('.popups').fadeIn(0);
        }
      }
    },
    directJump() {
      // debugger
      var url = location.href;
      var params = url.replace("?paramtheme=spring", "").split("/#")[1];
      var arr1 = params.split("?");
      var jumpName = arr1[0];
      var jumpObj = {};
      if (arr1.length == 2) {
        var arr2 = arr1[1].split("&");
        for (var i = 0; i < arr2.length; i++) {
          if (arr2[i]) {
            var arr3 = arr2[i].split("=");
            var name = arr3[0];
            var value = arr3[1];
            jumpObj[name] = value;
          }
        }
      }
      this.pushx({
        title: "",
        name: jumpName,
        params: jumpObj
      });

    },
    initIndexPage() {
      var url = location.href;
      console.log(url);
      if (url.indexOf("bycdetailtm?sbzch") > 0) {
        var obj1 = url.split("bycdetailtm?sbzch=")[1];
        var obj2 = obj1.split("&gjfl=");
        this.pushx({
          title: "",
          name: "/bycdetailtm",
          params: { sbzch: obj2[0], gjfl: obj2[1] }
        });
        // headnotransparent();
      } else if (url.indexOf("bycquerytm?tmmonitzcr") > 0) {
        var obj1 = url.split("bycquerytm?tmmonitzcr=")[1];
        var obj1 = decodeURI(obj1);
        this.pushx({
          title: "",
          name: "/bycquerytm",
          params: { tmmonitzcr: obj1 }
        });
        // headnotransparent();
      } else if (url.indexOf("bycquerytm") > 0) {
        // alert("bycquerytm");
        this.pushx({
          title: "",
          name: "/bycquerytm"
        });
        // headnotransparent();
      } else if (url.indexOf("bycnoticedetailtm?name") > 0) {
        var obj1 = url.split("bycnoticedetailtm?name=")[1];
        var obj2 = obj1.split("&imgurl=");
        var na = decodeURI(obj2[0]);
        var url = decodeURI(obj2[1]);
        console.log(url);
        this.pushx({
          title: "",
          name: "/bycnoticedetailtm",
          params: { name: na, imgurl: url }
        });
        // headnotransparent();
      } else if (url.indexOf("bytmmonitlistdetails?code=") > 0) {
        var obj1 = url.split("bytmmonitlistdetails?code=")[1];
        this.pushx({
          title: "",
          name: "/bytmmonitlistdetails",
          params: { code: obj1 }
        });
        // headnotransparent();
      } else if (url.indexOf("bytmmonitagency?agency_name=") > 0) {
        var obj1 = url.split("bytmmonitagency?agency_name=")[1];
        var obj1 = decodeURI(obj1);
        this.pushx({
          title: "",
          name: "/bytmmonitagency",
          params: { agency_name: obj1 }
        });
      } else if (url.indexOf("bycncldetail") > 0) {
        this.pushx({
          title: "商标尼斯查询",
          name: "/bycncldetail"
        });
      } else if (url.indexOf("bycnoticetm") > 0) {
        this.pushx({
          title: "商标公告查询",
          name: "/bycnoticetm"
        });
      } else if (url.indexOf("bycnoticeindex") > 0) {
        var obj1 = url.split("bycnoticeindex?noticetype=")[1];
        var obj2 = obj1.split("&noticenumber=");
        var noticetype = decodeURI(obj2[0]);
        var noticenumber = decodeURI(obj2[1]);
        this.pushx({
          title: "商标公告查询",
          name: "/bycnoticeindex",
          params: { noticetype: noticetype, noticenumber: noticenumber }
        });
      } else if (url.indexOf("selftmreg") > 0) {
        this.$root.pushx({
          title: "自主商标注册",
          name: "/selftmreg",
          params: { itemCode: "zzsbzc" }
        });
      }
      else if (url.indexOf("bytmmonitlist") > 0) {
        this.pushx({
          title: "监控列表",
          name: "/bytmmonitlist"
        });
        // headnotransparent();
      } else if (url.indexOf("bytmmonitdynamics") > 0) {
        this.pushx({
          title: "",
          name: "/bytmmonitdynamics"
        });
        // headnotransparent();
      } else if (url.indexOf("bytmmonit") > 0) {
        this.pushx({
          title: "商标监控",
          name: "/bytmmonit"
        });
        // headnotransparent();
      } else {
        //检查lastaccess
        var to = this.localdata("lastaccess");
        if (to && to.name.indexOf("roleview") >= 0) {
          this.isfront = false;
        }
        if (to && to.name.indexOf("login") < 0 && this.currentUser) {
          this.pushx(to);
        } else {
          if (this.currentUser) {
            this.$root.pushx({
              "title": "首页",
              "name": "/"
            });
          } else {
            this.$router.push("/");
          }
        }
      }

    },
    showHeadLogo() {
      $("#imglogo").css("visibility", "visible");
    },
    contextCompany() {
      if (this.switchcompany) {
        return this.switchcompany;
      } else {
        if (location.host.indexOf("igirl.gongsibao.com") < 0) {

        } else {
          this.showHeadLogo();
        }
        return this.currentCompany;
      }
    },
    channelchange(v) {
      /*获取当前公司信息，获取当前公司的管理员，作登录，
      重定向对应公司子域名，重写退出方法，
      发送切换前平台账号并登录后重定向平台
      检查平台登录成功要清空本地缓存的平台账号
      */
      this.localdata("beforeswitchinfo", { "userid": this.currentUser.id });
      if (v) {
        this.postReq("/web/userCtl/switchUser", { companyid: v }).then(d => {
          if (d.status == 0 && d.data) {
            var redirecthost = d.data.domainname;
            var urlpath = "";
            if (d.data.env == "dev") {
              urlpath = "http://" + redirecthost;
            } else {
              urlpath = "https://" + redirecthost;
            }
            //新域登录,不允许跨域
            //  this.postReq(urlpath+"/web/userCtl/switchLogin",{companyid:v}).then(d=>{
            //   window.location.href=urlpath;
            //  });
            window.location.href = urlpath + "?sw=0162951413";
          }
        });
      }
      /*if(v){
        this.postReq("/web/companyCtl/getInitCompanyInfo",{id:v}).then(d=>{
          if(d && d.status==0){
            // this.currentCompany = d.data.company;
            // this.$store.state.currentCompany = d.data.company;
            this.switchcompany=d.data.company;
            this.footerInfo = d.data.footerinfo;

            this.homeobj.initMounted();
            this.homeobj.initCreated();
          }
        });
      }else{
        this.switchcompany=null;
        this.footerInfo=this.pfooterinfo;
        this.homeobj.initMounted();
        this.homeobj.initCreated();

      }
      if (this.$refs.topmenu) {
        console.log("xxxxxxxxxxxxxxxxxxxxxxxxxx=====");
        this.$refs.topmenu.fetchMetaData();
      }*/
    },
    functest(item) {
      if (item.code == "forus" || item.code == "solvr" || item.code == "opmethods" || item.code == "clientdemos") {
        return true;
      } else {
        return false;
      }
    },
    mnufunc(item) {
      item = {
        code: item.split('/')[1]
      }
      if (item.code == 'login') {
        return false;
      }
      if (currentTheme == "winter") {
        if (item.code == 'home' || item.code == 'patentsearch' || item.code == 'entdecide' || item.code == 'areapatentmonitor' || item.code == 'servicecat') {
          return true;
        } else {
          return false;
        }
      } else {
        if (item.code == 'patentsearch' || item.code == 'entdecide' || item.code == 'areapatentmonitor') {
          return false;
        }
        if (this.contextCompany() && this.contextCompany().id != 1) {/* 其它站点*/
          // console.log(JSON.stringify(this.contextCompany()));
          if (currentTheme != "autumn" && item.code == "zcfw") {
            return false;
          }
          if (item.code == "siteapply" || ((item.code == "servicecat") && !this.isfront)
            || (item.code == "servicecat" && this.contextCompany().siteTheme != "default") ||
            (item.code == "servicecat" && this.contextCompany().siteTheme == "default" && window.location.hash.indexOf("login") >= 0)
            || item.code == "forus" || item.code == "solvr" || item.code == "opmethods" || item.code == "clientdemos") {
            return false;
          } else {
            return true;
          }
        } else {
          if (item.code == "servicecat" || item.code == "tmtransactionmarket" || item.code == "home" || item.code == "bycquerytm" || item.code == "bytmmonit") {
            return false;
          }
          if (this.codePath.indexOf("bycquerytm") >= 0 && this.functest(item)) {
            return false;
          }
          if (this.codePath.indexOf("bytmmonit") >= 0 && this.functest(item)) {
            return false;
          }
          if (this.codePath.indexOf("tmtransactionmarket") >= 0 && this.functest(item)) {
            return false;
          }
          if (item.code == "zcfw") {
            return false;
          }

          return true;
        }

      }
    },
    goBack(event) {
      if (!this.isfront) {
        alert("请选择后台页面中的页签进行快捷导航");
        history.go(1);
        return;
      } else {
        this.pushx({
          title: "首页",
          name: "/"
        });
        this.stageType = true;
      }

    },
    backhome() {

      this.pushx({
        title: "首页",
        name: "/"
      });
      this.isfront = true;
      this.stageType = true;
      this.isShowMenu = false;
      this.hidetabs();
      // setTimeout(()=>{
      //   this.$refs.topmenu.fetchMetaData(()=>{

      //   });
      // },300);
      this.popupsType = true;

    },
    goadmin() {
      this.isfront = false;
      this.pushx({
        title: "每日概览",
        name: "/roleview"
      });

    },
    aboutus: function () {
      console.log("---------------------------------------");
      this.popupsType = false;
      this.pushx({
        title: "关于我们",
        name: "/aboutus"
      });
    },
    showtabs: function () {
      $(".maintab .el-tabs__nav-scroll").show();
      $(".maintab  .el-tabs--border-card > .el-tabs__header").css("border-bottom", "solid 1px #eee");
    },
    hidetabs: function () {
      $(".el-tabs__nav-scroll").hide();
      $(".el-tabs--border-card > .el-tabs__header").css("border-bottom", "none");
    },
    localdata(key, item) {
      if (item) {
        localStorage.setItem(key, JSON.stringify(item));
      } else {
        var strobj = localStorage.getItem(key);
        if (strobj) {
          return JSON.parse(strobj);
        } else {
          return null;
        }

      }
    },
    pushx: function (to) {
      console.log(to);
      let exittabs = this.editableTabs2.filter(tab => tab.name == to.name);

      if (window.location.href.indexOf("isModifyTitle=1") < 0) {//若是window.open 打开的页面 则不记录最后一次的点击
        var beforeaccess = this.localdata("lastaccess");
        //缓存记录倒数第二次的点击,目前用于订单修改返回
        this.localdata("beforeaccess", beforeaccess);
        //缓存记录最后一次的点击
        this.localdata("lastaccess", to);
      }
      //记录当前to到内存,key是路由路径
      this.localdata(to.name, to);
      if (exittabs.length > 0) {
        this.editableTabsValue2 = to.name;
        this.$nextTick(() => {
          // this.$router.push(to.name);
          if (to.params) {
            this.$router.push({ path: to.name, query: to.params });
          } else {
            this.$router.push({ path: to.name });
          }

        });
        return;
      }
      this.editableTabs2.push({
        title: to.title,
        name: to.name,
      });
      this.editableTabsValue2 = to.name;
      this.$nextTick(() => {
        //this.$router.push(to.name);
        if (to.params) {
          this.$router.push({ path: to.name, query: to.params });
        } else {
          this.$router.push({ path: to.name });
        }
      });

    },
    showtopmenu() {
      console.log('检索');
      this.isfront = true;
      var test = window.location.hash;
      console.log("nnnnnnnnnnnnnnnnnnnnnnnnn===============", test);
      if (test.indexOf('moreservice') == '-1' && test != "#/") {
        this.popupsType = false;
        $(".spechorizotal .nav_color").css("color", "black");
        $(".spechorizotal .nav_color:hover").css("color", "#2692FF");
      } else {
        this.popupsType = true;

      }

      // setTimeout(()=>{
      //   this.$refs.topmenu.fetchMetaData(()=>{
      //     $("#servicecat").mouseenter(()=>{    
      //       // var leftNum = $("#header_row")[0].offsetLeft - 10;
      //       // console.log(leftNum,'kanzhenliaaaaaaaaaaaaaaaaaaaaaa');
      //       // $('.popups').css("left", leftNum + 'px');
      //       // $('.popups').fadeIn(200);
      //     });
      //     // $(".popups").mouseleave(()=>{
      //     //   $('.popups').fadeOut(200);
      //     // });
      //   });
      // },300);

    },
    tabclick: function (tab) {
      console.log(tab.name);
      console.log("..................................................");
      console.log(this.currentCodePath);
      this.editableTabsValue2 = tab.name;
      //点击页签时，先获取以前的缓存to
      var tovalue = this.localdata(tab.name);
      //点击页签时，设置一个全局的环境变量宣称当前的操作为点击页签
      this.$store.state.istabclick = true;
      if (tab.name == "/") {
        this.showtopmenu();
        this.hidetabs();
        this.isShowMenu = false;
      }
      if (tab.name == "home") {
        this.$router.push("/");
        this.hidetabs();
        this.isShowMenu = false;
      } else {
        console.log("================mmmmmmmmmmmmmmmmmmmmmmmmmmmmm===============");
        console.log(JSON.stringify(this.editableTabs2));
        console.log(tab.name);
        if (tovalue) {
          if (tovalue.params) {
            this.$router.push({ path: tovalue.name, query: tovalue.params });
          } else {
            this.$router.push({ path: tovalue.name });
          }
        } else {
          this.$router.push(tab.name);
        }
      }
    },
    // addTab(to){
    //   this.editableTabs2.push({
    //     title: to.title,
    //     name:  to.name,
    //   });
    //   this.editableTabsValue2 =  to.name;
    // },
    removetab: function (targetName) {
      console.log("removeTab");
      if (targetName != "/home" || targetName != "/") {
        let tabs = this.editableTabs2;
        let activeName = this.editableTabsValue2;
        if (activeName === targetName) {
          tabs.forEach((tab, index) => {
            console.log();
            if (tab.name === targetName) {
              let nextTab = tabs[index + 1] || tabs[index - 1];
              if (nextTab) {
                activeName = nextTab.name;
              }
            }
          });
        }
        this.editableTabsValue2 = activeName;
        this.editableTabs2 = tabs.filter(tab => tab.name !== targetName);
        this.tabclick({ name: activeName });
      } else {
        return false;
      }

    },
    showMask() {
      var self = this;
      setTimeout((function () {
        self.loading = true;
      }), 10);
    },
    hideMask() {
      var self = this;
      setTimeout((function () {
        self.loading = false;
      }), 10);
    },
    refreshLoginState(cbk) {
      var self = this;
      //检查登录状态
      self.checkLogin(() => {
        if (cbk) {
          cbk();
        }
        $("#leftmenudiv").addClass("menutransparent");
        //setTimeout(() => {
        //$("#leftmenudiv").addClass("menutransparent");
        // if (self.$refs.leftmenu) {
        //   self.$refs.leftmenu.fetchMetaData();
        // }
        // if (self.$refs.topmenu) {
        //   self.$refs.topmenu.fetchMetaData();
        // }

        // }, 100);
        //   setTimeout(() => {
        //     if (self.$refs.leftmenu) {
        //       alert("left menu");
        //       self.$refs.leftmenu.subsystemReload();
        //     }

        //  }, 2000);

      });
    },
    isUrlSw() {
      var pas = location.href.split("?");
      if (pas && pas.length == 2) {
        var swnames = pas[1].split("=");
        if (swnames && swnames[0] == "sw") {
          return true;
        }
      }
      return false;
    },
    checkLogin: function (cbk) {
      var self = this;
      var param = {};
      var puser = this.localdata("beforeswitchinfo");
      if (puser && puser.userid) {
        param.isswitch = 1;//表示当前是切换
        param.userid = puser.userid;
      }

      if (queryMap["sw"]) {
        param.isswitch = 1;
      }
      if (queryMap["paramtheme"]) {
        param.paramtheme = queryMap["paramtheme"];
      }
      // var pas=location.href.split("?");
      // if(pas && pas.length==2){
      //     var swnames=pas[1].split("=");
      //     if(swnames && swnames[0]=="sw"){
      //       param.isswitch=1;
      //     }
      // }
      var owner = self;
      self.postReq("/web/userCtl/checkLogin", param).then(function (d) {
        //登录igirl--平台刷新页面后，清空beforeswitchinfo
        if (location.host.indexOf("igirl.gongsibao.com") >= 0 || location.host.indexOf("igsuper.gongsibao.com") >= 0) {
          localStorage.removeItem("beforeswitchinfo");
        }
        // alert(d.data.company.siteTheme);
        if (d && d.status == 0 && d.data.status != -99) {
          //修改样式header
          self.$store.state.currentUser = d.data;
          self.currentUser = d.data;
          //  if (d.data.company) {
          //    self.currentCompany = d.data.company;
          //    //设置全具主题
          //    if(self.currentCompany.siteTheme && self.currentCompany.siteTheme!=""){
          //    self. currentTheme=currentCompany.siteTheme;
          //     self.themename=(currentTheme=="default"?"":currentTheme);
          //     if(self.themename!=""){
          //       addCSS("/css/"+self.themename+".css");
          //     }
          //    }
          //    self.$store.state.currentCompany = d.data.company;
          //    self.bankAccount=d.data.bankAccount;
          //    self.footerInfo = d.data.footerinfo;
          //    self.pfooterinfo= d.data.footerinfo;;
          //    self.$store.state.pfooterinfo = self.footerInfo;
          //    self.serviceqq = "http://wpa.qq.com/msgrd?v=3&uin=" + self.currentCompany.serviceqq + "&site=qq&menu=yes";
          //    if (self.footerInfo) {
          //      self.servicetel = self.footerInfo.serviceTel;
          //    } else {
          //      self.servicetel = "请完善客服电话";
          //    }
          //    $("#idtitle").text(self.currentCompany.sitename);
          //  }
          if (cbk) {
            cbk(d.data);
          }
        } else {
          if (d && d.data) {
            self.$store.state.currentUser = null;
            self.currentUser = null;
            // self.currentCompany = d.data.company;
            //   //设置全具主题
            //   if(self.currentCompany.siteTheme && self.currentCompany.siteTheme!=""){
            //     currentTheme=self.currentCompany.siteTheme;
            //     self.themename=(currentTheme=="default"?"":currentTheme);
            //     if(self.themename!=""){
            //       addCSS("/css/"+self.themename+".css");
            //     }
            //    }
            // self.footerInfo = d.data.footerinfo;
            // self.pfooterinfo=d.data.footerinfo;
            // self.$store.state.pfooterinfo = d.data.footerinfo;
            // self.serviceqq = "http://wpa.qq.com/msgrd?v=3&uin=" + self.currentCompany.serviceqq + "&site=qq&menu=yes";
            // if (self.footerInfo) {
            //   self.servicetel = self.footerInfo.serviceTel;
            // } else {
            //   self.servicetel = "请完善客服电话";
            // }
            // $("#idtitle").text(self.currentCompany.sitename);
          }
          if (d.data.isJump == 1) {
            self.$message({
              type: 'error',
              message: '您访问的地址未申请站点或还在审核中，请申请站点或耐心等待.',
              delay: 5000
            });
          }
          if (cbk) {
            cbk(null);
          }
        }
      });
    },
    showLogin: function () {

    },
    siteapply() {
      this.pushx({
        title: "站点申请",
        name: "/siteapply"
      });
    },
    hideLogin: function () {

    },
    onselect: function (k) {
      console.log(k);

      this.popupsType = false;
      var self = this;
      if (k == "subscription") {
        this.pushx({
          title: "政策订阅",
          name: "/subscription"
        });
      }
      if (k == "declare") {
        this.pushx({
          title: "政策资讯",
          name: "/declare"
        });
      }
      if (k == "policybigdata") {
        this.pushx({
          title: "政策大数据",
          name: "/policybigdata"
        });
      }
      if (k == "register") {
        this.pushx({
          title: "注册",
          name: "/register"
        });
      }
      if (k == "login") {
        this.pushx({
          title: "登录",
          name: "/login"
        });
        setTimeout(() => {
          this.$refs.topmenu.fetchMetaData(() => {

          });
        }, 300);
      }
      if (k == "roleview") {
        this.pushx({
          title: "概况",
          name: "/roleview"
        });
      }


      if (k == "exit") {
        var objuser = this.localdata("beforeswitchinfo");
        var param = null;
        var isRtnPlatform = false;
        if (objuser && objuser.userid) {
          isRtnPlatform = true;
          param = { "userid": objuser.userid };
        }
        this.getReq("/web/userCtl/exit", null).then(function (r) {
          if (!self.isUrlSw()) {//如果不是渠道退出，否则返回平台
            self.$store.state.currentUser = null;
            self.hidetabs();
            self.$nextTick(() => {
              self.backhome();
            });
          } else {
            if (r.data && r.data.env == "dev") {
              location.href = "http://igsuper.gongsibao.com";
            } else {
              location.href = "https://igirl.gongsibao.com";
            }
          }
        });
      }
    },
    onMenuSelect: function (index) {
      // index = index.replace("/","");
      // if (index != '/') {
      //   headnotransparent()
      // }else {
      //   headtransparent()
      // }
      console.log(index, 'sssssssssssssss');
      var self = this;
      if (index == 'patentsearch') {
        this.stageType = false;
        this.pushx({
          title: "区域专利监控",
          name: "/iframehtml",
          params: { url: 'https://zhuanzhidao.gongsibao.com/#/patentsimplesearch' }
        })
        return false;
      }
      if (index == 'areapatentmonitor') {
        this.stageType = false;

        this.pushx({
          title: "区域专利监控",
          name: "/iframehtmlone",
          params: { url: 'https://zhuanzhidao.gongsibao.com/#/regionalpatentmonitoring' }
        })
        // this.loadingHome = true;
        // setTimeout(()=>{
        //   this.loadingHome = false;
        // },3000);
        return false;
      }
      if (index == 'entdecide') {
        this.stageType = false;
        this.pushx({
          title: "企业决策",
          name: "/iframehtmltwo",
          params: { url: 'https://zhuanzhidao.gongsibao.com/#/businessdecisions' }
        })
        return false;
      }
      if (index == "forus" || index == "solvr" || index == "opmethods" || index == "clientdemos") {
        self.homeobj.getNavIndex(index);
        $("#app").animate({ scrollTop: window.innerHeight }, 500)
        return false;
      }
      if (index == "servicecat") {
        // var leftNum = ($('#servicecat')[0].offsetLeft + $('.spechorizotal')[0].offsetLeft) - 20;
        // $('.popups').css("left", leftNum + 'px');
        // $('.popups')[0].css("left",$('#servicecat')[0].offsetLeft + $('.spechorizotal')[0].offsetLeft;)
        // $('.popups').fadeIn(200);
        // this.$store.state.popupsCode = index;
        return;
      }
      // if(index == "tmtransactionmarket"){
      //   this.popupsType = false;

      //   return;
      // }
      if (index == "zcfw") {
        if (location.href.indexOf("https") >= 0) {
          window.open("https://" + location.host + "?paramtheme=spring");
        } else {
          window.open("https://" + location.host + "?paramtheme=spring");
        }

        return;
      }
      if (index == "/") {
        this.stageType = true;
        if (this.homeobj && this.currentCompany.id == 1) {

          this.homeobj.a = false;
        }
        if (this.homeobj && this.currentCompany.id != 1) {
          this.homeobj.moreservice("ip");
        }
        this.popupsType = true;
      }
      if (index == "home") {
        this.editableTabsValue2 = "/";
        this.$router.push("/");
        //this.$router.push({path:"/",query:{"from":"1"}});
      } else {
        var title = this.$router.mapTile[index];
        // var to=index.substring(1);
        this.pushx({
          title: title,
          name: index
        });
      }

    },
    formatItem: function (t, label) {
      if (t) {
        if (!label && t.src) {//表示当前是image元素
          if (this.currentUser) {
            return this.currentUser.imgUrl;
          }
          return t.src;
        } else {
          return label;
        }
      }
    },
    getReq(path, data) {
      var self = this;
      return new Promise(function (resv, reject) {
        axios.get(path, { params: data, "headers": { "theme": currentTheme, "codepath": self.codePath, "companyid": self.contextCompany() ? self.contextCompany().id : "" } }).then(function (r) {
          if (r && r.data && r.data.status == -99) {
            self.$store.state.currentUser = null;
            self.hideMask();
            // self.$message({
            //   type: 'error',
            //   message: '请检查权限.'
            // });
            resv(null);
          } else {
            if (r.data && r.data.bizmsg && r.data.bizmsg != "empty") {
              self.$message({
                message: r.data.bizmsg,
                type: 'warning'
              });
            }
            if (r.data.status < 0) {
              self.$message({
                type: 'error',
                message: r.data.msg
              });
            }
            resv(r.data ? r.data : null);
          }
        }).catch(function (e) {
          reject(e);
        });
      });

    },
    postReq(path, data) {
      var self = this;
      return axios.post(path, data, { "headers": { "theme": currentTheme, 'codepath': self.codePath, "companyid": self.contextCompany() ? self.contextCompany().id : "" } }).then(function (r) {
        if (r && r.data && r.data.status == -99) {
          self.$store.state.currentUser = null;
          self.hideMask();
          // self.$message({
          //   type: 'error',
          //   message: '请检查权限.'
          // });
          return null;
        } else {
          if (r.data.status < 0) {
            self.$message({
              type: 'error',
              message: r.data.msg
            });
          }
          return r.data ? r.data : null;
        }
      });
    },
  },
});
  //});
//});
