You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.9 KiB

var M=(d,c,i)=>new Promise((s,r)=>{var t=o=>{try{w(i.next(o))}catch(e){r(e)}},F=o=>{try{w(i.throw(o))}catch(e){r(e)}},w=o=>o.done?s(o.value):Promise.resolve(o.value).then(t,F);w((i=i.apply(d,c)).next())});import{d as u,bl as _,r as h,q as m,o as p,g as y,b as f,w as g,u as W,bo as P,$ as T,bx as l}from"./index-f4658ae7.js";import{_ as S}from"./FlowError.vue_vue_type_script_setup_true_lang-e426ac70.js";import{MessageTypeEnum as N}from"./messageTypeEnum-5cbcc471.js";const I={class:"en-wrapper"},b={key:0},v={key:1,class:"en-body"},H=u({__name:"MyFlow",props:{params:{type:Object,default:()=>{}}},setup(d){const c=d,i=_();let s=(c.params.hasOwnProperty("PKVal")?i.query:c.params)||{};const r=h(!1),t=m({tips:"",hasError:!1});(()=>M(this,null,function*(){try{r.value=!0;const o=new T("BP.WF.HttpHandler.WF_MyFlow");o.AddJson(s);const e=(yield o.DoMethodReturnString("MyFlow_Init"))||"";if(typeof e=="string"&&e.includes("err@")){t.hasError=!0,t.tips=e.replace("err@","");return}if(r.value=!1,typeof e=="object"){delete e.DoMethod,delete e.DoType,delete e.HttpHandlerName;const n=e.PageName||"";delete e.PageName;const a=window.location.hash;n===""||n==="MyFlowGener"?a.includes("S_MyFlow")?window.location.replace("/#/WF/S_MyFlowGener?"+l(e)):a.includes("M_MyFlow")?window.location.replace("/#/WF/M_MyFlowGener?"+l(e)):window.location.replace("/#/WF/MyFlowGener?"+l(e)):n==="MyView"?a.includes("S_MyFlow")?window.location.replace("/#/WF/S_MyView?"+l(e)):a.includes("M_MyFlow")?window.location.replace("/#/WF/M_MyView?"+l(e)):window.location.replace("/#/WF/MyView?"+l(e)):n==="MyFlowTree"?a.includes("S_MyFlow")?window.location.replace("/#/WF/S_MyFlowTree?"+l(e)+"&PageType=MyFlow"):a.includes("M_MyFlow")?window.location.replace("/#/WF/M_MyFlowTree?"+l(e)+"&PageType=MyFlow"):window.location.replace("/#/WF/MyFlowTree?"+l(e)+"&PageType=MyFlow"):n==="MyFlowSelfForm"?a.includes("S_MyFlow")?window.location.replace("/#/WF/S_MyFlowSelfForm?"+l(e)+"&IsReadonly=0&PageType=MyFlow"):a.includes("M_MyFlow")?window.location.replace("/#/WF/M_MyFlowSelfForm?"+l(e)+"&IsReadonly=0&PageType=MyFlow"):window.location.replace("/#/WF/MyFlowSelfForm?"+l(e)+"&IsReadonly=0&PageType=MyFlow"):window.location.replace("/#/"+n+"?"+l(e));return}}catch(o){t.hasError=!0,t.tips=o;return}finally{r.value=!1}}))();const w=()=>{const o=window.top===window?window:window.top,e=o.location.hash;if(e.includes("/WF/TestingContainer/Default")){const n=s.FK_Flow||s.FlowNo;o.location.replace("/#/WF/TestingContainer/Default?FlowNo="+n+"&WorkID="+s.WorkID+"&TesterNo="+s.TesterNo+"&CurrPage=FlowInstance&t="+Math.random())}else{try{window.parent.postMessage({type:N.ReloadPage,url:"/"+e},"*")}catch(n){const a=e.includes("?")?"&1=1":"?1=1";o.location.replace("/"+e+a)}window.close()}};return(o,e)=>(p(),y("div",I,[f(W(P),{spinning:r.value},{default:g(()=>[t.hasError?(p(),y("div",b,[f(S,{doc:t.tips,onCloseWindow:w,isShowCloseBtn:!1},null,8,["doc"])])):(p(),y("div",v))]),_:1},8,["spinning"])]))}});export{H as default};