标签 cology9 下的文章

法一、通过ecode隐藏页签

let enable = false; //总开关

const getFrameParams = () => {
  let url = window.location.href;
  let urlParams = url.slice(url.indexOf('?') + 1).split('&');
  let params = [];
  urlParams.forEach(element => {
    let datas = element.split('=');
    params[datas[0]] = datas[1];
  });
  return params;
}

ecodeSDK.overwritePropsFnQueueMapSet('WeaReqTop',{
  fn:(newProps,name)=>{
    if(!enable) return ;
    const {hash} = window.location;
    if(!hash.startsWith('#/main/workflow/req')) return;      // const baseInfo = WfForm.getBaseInfo();
    if(baseInfo.workflowid!==44) return ;
    const {ismonitor} = getFrameParams();
    newProps.tabDatas = newProps.tabDatas.filter((obj)=>{
      console.log(obj);
      if(obj.key!=='form'&&ismonitor==='1') { //监控页面,表单之外的页签屏蔽
        return false;
      }
      return true; //不屏蔽
    })
    return newProps;
  },
  order:1,
  desc:'屏蔽tab页签'
});

- 阅读剩余部分 -