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
17 KiB
2 lines
17 KiB
var U=(W,K,B)=>new Promise((x,E)=>{var S=v=>{try{G(B.next(v))}catch(h){E(h)}},R=v=>{try{G(B.throw(v))}catch(h){E(h)}},G=v=>v.done?x(v.value):Promise.resolve(v.value).then(S,R);G((B=B.apply(W,K)).next())});import{d as ke,cb as Te,bl as ge,r as O,f as ye,q as $,o as c,g,aV as Ee,i as T,a as N,bF as ie,b as C,w as k,aP as Ie,u as f,bu as se,a9 as z,bE as q,Y as P,bp as De,aT as _e,b9 as Ue,j as te,bo as Oe,t as re,B as me,h as ae,bq as Ke,bt as ue,bf as Se,F as fe,bw as Re,I as Me,ah as Ne,bs as xe}from"./index-f4658ae7.js";import{ClassFactory as pe}from"./ClassFactory-66077970.js";import{S as Pe}from"./index-70ffad01.js";import{D as ve}from"./index-8336ee2d.js";import"./index-134963ca.js";import{a as We,R as Ge}from"./index-3590612f.js";import Ve from"./BasicTable-90e6228c.js";import he from"./TableAction-8031dbc2.js";import"./TableImg.vue_vue_type_style_index_0_lang-0c448231.js";import{useTable as Ae}from"./useTable-9d73cb2d.js";import{WF_Comm_Dtl as be}from"./WF_Comm_Dtl-7da219a1.js";import{useDDLDataLoader as je}from"./useDDLDataLoader-5d08990e.js";import{UIContralType as de}from"./EnumLab-3cbd0812.js";import $e from"./ThemeWrapper-10a23ac0.js";import{D as we}from"./index-eb3034da.js";import{GPNReturnType as i,GPNReturnObj as Le}from"./PageBaseGroupNew-ee20c033.js";import{windowOpen as qe}from"./windowOpen-b8703c39.js";import ze from"./EnOnly-9c74cb0c.js";import He from"./GroupPageNew-58abee1a.js";import{useThirdPartUrl as Ye}from"./useThirdPartUrl-8ecf6c87.js";import Je from"./Events-141c34ea.js";const Qe={class:"base-component-wrapper"},Xe=["src"],Ze=["src"],et=["src"],tt=["src","alt"],at=ke({__name:"BaseComponent",props:{closeModalFunc:{type:Function,default:null},closeDrawerFunc:{type:Function,default:null},updateFunc:{type:Function,default:null}},emits:["editClosed","close-self"],setup(W,{expose:K,emit:B}){const x=Te(),E=ge(),S=B,R=O(!0),G=ye(()=>({padding:"0",backgroundColor:"#f2f5f7"})),v=ye(()=>({padding:"0",backgroundColor:"#f2f5f7",minHeight:"600px",height:"600px"})),h=W,p=$({title:"",visible:!1,width:"70%",component:{},bindAttrs:{},params:{}}),r=$({title:"",visible:!1,width:"70%",src:"",openType:1}),I=$({title:"",visible:!1,width:"70%",src:"",openType:1}),l=$({title:"",visible:!1,component:{},params:{},showFooter:!0,width:"800px",height:"auto",fullScreen:!1}),M={width:"100%",height:"100%",objectFit:"cover"},d=$({url:"",title:"",showFooter:!1,visible:!1,width:"600px",style:M}),m=$({title:"",visible:!1,width:"70%",component:{},params:{}}),{getComponentParamsByUrl:F}=De(),_=n=>{const{title:a,width:t,component:s,params:e,bindAttrs:o}=n;p.title=a||" ",p.params=e||{},p.width=t||"70%",p.bindAttrs=o||{},p.component=s||{},p.visible=!0},A=n=>{const{title:a,width:t,component:s,params:e}=n;m.title=a||" ",m.params=e||{},m.width=t||"70%",m.component=s||{},m.visible=!0},H=(n,a,t,s=null)=>{p.component=q(L(a)),p.title=n,p.width=t||"70%",p.params=s||F(a)||{},p.visible=!0},Z=()=>U(this,null,function*(){p.visible=!1,p.title=" ",p.params={},p.width="70%",p.component={},typeof h.closeDrawerFunc=="function"&&(yield h.closeDrawerFunc())}),ne=()=>U(this,null,function*(){m.visible=!1,m.title=" ",m.params={},m.width="70%",m.component={},typeof h.closeDrawerFunc=="function"&&(yield h.closeDrawerFunc())}),Y=n=>{const{title:a,component:t,params:s,showFooter:e=!0,width:o="800px",height:u="auto",fullScreen:b=!1}=n;l.title=a||" ",l.params=s||{},l.component=t||{},l.visible=!0,l.showFooter=e,l.width=o,l.height=u,l.fullScreen=b},j=()=>U(this,null,function*(){l.visible=!1,l.title="",l.component={},l.params={},l.showFooter=!0,l.width="800px",typeof h.closeModalFunc=="function"&&(yield h.closeModalFunc())}),oe=(n,a,t="600px",s=M)=>{d.title=n||" ",d.url=a,d.visible=!0,d.showFooter=!1,d.width=t,d.style=s},J=()=>{d.visible=!1,d.title=" ",d.url="",d.showFooter=!1,d.style=M},Q=n=>U(this,null,function*(){const{title:a,width:t,src:s,openType:e=1}=n;r.title=a||" ",r.width=t||"70%",r.src=s,r.openType=e,r.visible=!0}),ee=()=>U(this,null,function*(){r.visible=!1,r.src="",r.title="",r.width="70%",typeof h.closeDrawerFunc=="function"&&(yield h.closeDrawerFunc())}),le=(n,a,t=null)=>{l.component=q(L(a)),l.title=n,l.params=t||F(a)||{},l.visible=!0},V={[i.OpenIframeByDrawer100]:"100%",[i.OpenIframeByDrawer90]:"90%",[i.OpenIframeByDrawer75]:"75%",[i.OpenIframeByDrawer30]:"30%",[i.OpenIframeByDrawer]:"60%",[i.OpenUrlByDrawer90]:"90%",[i.OpenUrlByDrawer75]:"75%",[i.OpenUrlByDrawer30]:"30%",[i.OpenUrlByDrawer]:"60%",[i.OpenUrlByDrawer100]:"100%"};return K({openModal:Y,openModalByUrl:le,openDrawer:_,openIframe:Q,openDrawerByUrl:H,previewImg:oe,handleGPNCallback:(n,a="")=>{const{getValidHashUrl:t}=Ye();switch(a||(a=n.title),n.ReturnType){case i.Message:P.info(n.data);break;case i.Error:P.error(n.data);break;case i.GoToUrl:window.location.replace(n.data);break;case i.Close:S("close-self");break;case i.CloseAndReload:S("close-self"),R.value=!1,setTimeout(()=>{R.value=!0},16);break;case i.Reload:R.value=!1,setTimeout(()=>{R.value=!0,typeof h.updateFunc=="function"&&h.updateFunc()},16);break;case i.OpenIframeByDrawer:case i.OpenIframeByDrawer90:case i.OpenIframeByDrawer75:case i.OpenIframeByDrawer30:case i.OpenIframeByDrawer100:Q({title:a,width:V[n.ReturnType],src:t(n.data),openType:1});break;case i.OpenIframeByModal:Q({title:a,width:V[n.ReturnType],src:t(n.data),openType:0});break;case i.OpenUrlByDrawer:case i.OpenUrlByDrawer90:case i.OpenUrlByDrawer75:case i.OpenUrlByDrawer30:case i.OpenUrlByDrawer100:{if(n.data.startsWith("/#/")){r.src=t(n.data),r.title=a,r.visible=!0;return}const e=n.data.split("?");if(e.length>1){n.title&&(a=n.title);const o=e[0].endsWith(".vue")?e[0]:e[0]+".vue";_({title:a,width:V[n.ReturnType],params:F(n.data.substring(5)),component:q(L(o))})}}break;case i.Replace:{if(R.value=!1,n.data.startsWith("/#/")){I.src=t(n.data),I.title=a,I.visible=!0;return}const e=n.data.split("?");if(e.length>1){const o=e[0].endsWith(".vue")?e[0]:e[0]+".vue";A({title:a,width:V[n.ReturnType],params:F(n.data.substring(5)),component:q(L(o))})}}break;case i.OpenUrlByModal:{const e=n.data.split("?");if(e.length>1){const o=e[0].endsWith(".vue")?e[0]:e[0]+".vue";Y({title:a,width:V[n.ReturnType],params:F(n.data.substring(5)),component:q(L(o)),showFooter:!1})}}break;case i.OpenUrlByModalFull:{const e=n.data.split("?");if(e.length>1){const o=e[0].endsWith(".vue")?e[0]:e[0]+".vue";Y({title:a,params:F(n.data.substring(5)),component:q(L(o)),showFooter:!1,width:"100%",height:"100vh",fullScreen:!0})}}break;case i.OpenUrlByNewWindow:qe(n.data);break;case i.Update:typeof h.updateFunc=="function"&&h.updateFunc();break;case i.OpenUrlByTab:const s=E.fullPath;s.startsWith("/Middle/")||s.startsWith("/wf/")?Je.emit("middleware_open_tab",{path:"TabWrapper",query:{url:n.data,title:a}}):s.startsWith("/WF/Comm/")||s.startsWith("/WF/GL/")?x.push({path:"/WF/Comm/TabWrapper",query:{url:encodeURIComponent(n.data),title:a}}):P.error("\u4EC5\u4E2D\u95F4\u4EF6\u6A21\u5F0F\u548C\u4F4E\u4EE3\u7801\u652F\u6301tab\u6253\u5F00");break;case i.DoNothing:break;default:P.warning("\u7C7B\u578B:"+n.ReturnType+"\u8FD8\u672A\u89E3\u6790");break}},resetModal:j}),(n,a)=>(c(),g("div",Qe,[R.value?Ee(n.$slots,"default",{key:0},void 0,!0):T("",!0),m.visible?(c(),N(ie(m.component),{key:1,params:m.params,onTriggerClose:ne,onUpdateTitle:a[0]||(a[0]=t=>m.title=t)},null,40,["params"])):T("",!0),I.visible?(c(),g("iframe",{key:2,src:I.src,style:{width:"100%",height:"100%",border:"none"}},null,8,Xe)):T("",!0),C(f(we),{visible:p.visible,"onUpdate:visible":a[2]||(a[2]=t=>p.visible=t),title:p.title,width:p.width,onClose:Z,"body-style":G.value},{default:k(()=>[p.visible?(c(),N(ie(p.component),Ie({key:0},p.bindAttrs,{params:p.params,onTriggerClose:Z,onUpdateTitle:a[1]||(a[1]=t=>p.title=t)}),null,16,["params"])):T("",!0)]),_:1},8,["visible","title","width","body-style"]),r.openType===1?(c(),N(f(we),{key:3,visible:r.visible,"onUpdate:visible":a[3]||(a[3]=t=>r.visible=t),title:r.title,width:r.width,onClose:ee,"body-style":G.value},{default:k(()=>[r.visible?(c(),g("iframe",{key:0,src:r.src,style:{width:"100%",height:"100%",border:"none"}},null,8,Ze)):T("",!0)]),_:1},8,["visible","title","width","body-style"])):T("",!0),r.openType===0?(c(),N(f(se),{key:4,visible:r.visible,"onUpdate:visible":a[4]||(a[4]=t=>r.visible=t),title:r.title,width:r.width,params:l.params,onClose:ee,"body-style":v.value,footer:null},{default:k(()=>[r.visible?(c(),g("iframe",{key:0,src:r.src,style:{width:"100%",height:"100%",border:"none"}},null,8,et)):T("",!0)]),_:1},8,["visible","title","width","params","body-style"])):T("",!0),C(f(se),{visible:l.visible,"onUpdate:visible":a[5]||(a[5]=t=>l.visible=t),width:l.width,height:l.height,footer:l.showFooter,title:l.title,"wrap-class-name":l.fullScreen?"full-modal":"",onOk:a[6]||(a[6]=t=>l.visible=!1),onCancel:j,onClose:j,destroyOnClose:"",centered:""},{default:k(()=>[l.visible?(c(),N(ie(l.component),{key:0,onClose:j,params:l.params,onTriggerClose:j},null,40,["params"])):T("",!0)]),_:1},8,["visible","width","height","footer","title","wrap-class-name"]),C(f(se),{visible:d.visible,"onUpdate:visible":a[7]||(a[7]=t=>d.visible=t),width:d.width,footer:d.showFooter,title:d.title,onOk:a[8]||(a[8]=t=>d.visible=!1),onCancel:J,onClose:J,destroyOnClose:"",centered:""},{default:k(()=>[d.visible?(c(),g("img",{key:0,src:d.url,alt:d.title,style:z(d.style)},null,12,tt)):T("",!0)]),_:1},8,["visible","width","footer","title"])]))}});const Ce=_e(at,[["__scopeId","data-v-10fc4add"]]),Pt=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"})),st={class:"en-wrapper"},nt={key:0,class:"ant-tag-red"},ot={key:1,class:"p-1"},lt={class:"p-4",style:{"box-sizing":"border-box","text-align":"right",padding:"0.5rem"}},it={key:0},rt={key:0},ut={key:1},pt={key:2},dt={key:3},ct={key:4},yt={key:5},mt=ke({__name:"Ens",props:{params:{type:Object,default:()=>({})}},setup(W){var n,a;const K=O([]),B=ge(),x=O(!1),E=W,{PKVal:S,ButsTableTop:R,ButsItem:G}=E.params||B.query;let v=((n=E.params)==null?void 0:n.EnName)||((a=E.params)==null?void 0:a.EnsName);v||(v=B.query.EnName||B.query.EnsName);const h=Ue(),p=t=>({width:(t.width>120?t.width-20:t.width==75?75:100)+"px",textAlign:[2,3,8].includes(t.params.MyDataType)?"right":"left"}),r=O({});let I=O({});const l=O([]),M=$({hasError:!1,tips:""});let d=null;const m=O([]),F=O({}),_=O(""),A=t=>!!t.UIIsReadonly,H=()=>U(this,null,function*(){try{if(x.value=!0,!v){M.hasError=!0,M.tips="\u7F3A\u5C11\u53C2\u6570 [ EnName ]";return}const t=Object.assign(Ne(E.params));delete t.EnName,delete t.EnsName;const s=[],e=Object.keys(t);for(const w of e)w.toLowerCase()!=="orderby"&&s.push(w,t[w]);const o=e.find(w=>w.toLowerCase()==="orderby");o&&s.push(t[o]);const u=yield pe.GetEns(v);yield u.Init(),yield u.Retrieve(...s),d=u,K.value=[];const b=u.GetNewEntity;yield b.Init(),F.value=b.HisUAC,_.value=b._enMap.PKs;const X=b._enMap.attrs,{getDDLData:Fe}=je(b);for(let w=0;w<X.length;w++){const y=X[w];y.UIVisible&&(y.binddata=[],y.UIContralType==de.DDL&&(y.binddata=yield Fe(y)),K.value.push({key:y.Key,title:y.Desc,dataIndex:y.Key,params:y,slots:{customRender:y.Key},width:y.UIWidth<20?80:y.UIWidth})),y.MyDataType==6||y.MyDataType==7?I.value[y.Key]=O():y.MyDataType==2||y.MyDataType==3||y.MyDataType==8?I.value[y.Key]=0:y.UIContralType==1?I.value[y.Key]=y.binddata[0].value:I.value[y.Key]=void 0}l.value=[],u.forEach((w,y)=>{r.value={},w._enMap.attrs.forEach(D=>{D.MyDataType==6||D.MyDataType==7?r.value[D.Key]=w.GetValByKey(D.Key)==null||w.GetValByKey(D.Key).length==0?O():xe(w.GetValByKey(D.Key)):D.MyDataType==8||D.MyDataType==5?r.value[D.Key]=w.GetValByKey(D.Key)==null?0:w.GetValByKey(D.Key).toFixed(2):r.value[D.Key]=D.MyDataType==4?w.GetValByKey(D.Key)==1:w.GetValByKey(D.Key)}),r.value.key=y,l.value.push(r.value)})}catch(t){M.hasError=!0,M.tips=t,P.error(t.toString())}finally{x.value=!1}}),Z=()=>{const t=R||[],s=[];return F.value.IsInsert&&s.push({label:"\u65B0\u589E",onClick:J.bind(null)}),F.value.IsUpdate&&s.push({label:"\u4FDD\u5B58",onClick:V.bind(null)}),F.value.IsDelete&&s.push({label:"\u5220\u9664",onClick:oe.bind(null)}),t==null||t.split(",").forEach(e=>{s.push({label:e,onClick:be.TableTopBtnClick.bind(e,v,S,v,m.value.join())})}),s},ne=(t,s)=>{var o;const e=`/src/WF/Comm/En.vue?EnName=${t}&PKVal=${s}`;(o=h.value)==null||o.handleGPNCallback(new Le(i.OpenUrlByDrawer,e,"\u8BE6\u60C5"))},Y=(t,s)=>{const e=G,o=[];return o.push({label:"\u8BE6\u60C5",onClick:ne.bind(null,v,t[_.value])},{label:"\u5220\u9664",icon:"clarity:close-line",popConfirm:{title:"\u786E\u5B9A\u5220\u9664\u5417\uFF1F",confirm:j.bind(null,s,t[_.value])}}),e==null||e.split(",").forEach(u=>{o.push({label:u,onClick:be.TableTopBtnClick.bind(u,v,S,v,t[_.value])})}),o},j=(t,s)=>U(this,null,function*(){if(s){let e=yield pe.GetEn(v);yield e.Init(),e.SetValByKey(_.value,s),yield e.RetrieveFromDBSources(),yield e.Delete(),l.value.splice(t,1),P.success("\u5220\u9664\u6210\u529F")}else l.value.splice(t,1)}),oe=()=>U(this,null,function*(){if(m.value==null||m.value.length==0){P.info("\u8BF7\u9009\u62E9\u5220\u9664\u9879");return}se.confirm({title:()=>"\u63D0\u793A",content:()=>"\u786E\u5B9A\u5220\u9664\u9009\u62E9\u9879\u5417\uFF1F",onOk(){return U(this,null,function*(){let s=[],e=yield pe.GetEns(v);yield e.Init(),yield e.Retrieve(),e.forEach((o,u)=>{s[u]=new Promise(b=>U(this,null,function*(){m.value.indexOf(o[_.value])!=-1&&(o.SetValByKey(_.value,o[_.value]),yield o.Delete()),b("finish")}))}),Promise.all(s).then(()=>{P.success("\u5220\u9664\u6210\u529F"),m.value=[],le(),H()})})},onCancel(){}})}),J=()=>{let t={};Object.keys(I.value).forEach(s=>{t[s]=I.value[s]}),t.key="t0",l.value.push(t)},Q=(t,s)=>{m.value=[],s.forEach(e=>{m.value.push(e[_.value])})},[ee,{clearSelectedRowKeys:le}]=Ae({title:"",rowKey:"key",dataSource:l,columns:K,clickToRowSelect:!1,rowSelection:{type:"checkbox",onChange:Q},bordered:!0,pagination:!1,maxHeight:700,actionColumn:{width:70,title:"\u64CD\u4F5C",dataIndex:"action",slots:{customRender:"action"}},formConfig:{labelWidth:120,autoSubmitOnEnter:!1,showResetButton:!1,showSubmitButton:!1}}),V=()=>{let t=[];l.value.forEach((s,e)=>{t[e]=new Promise((o,u)=>U(this,null,function*(){const b=d==null?void 0:d.GetNewEntity;if(!b){u("\u6CA1\u6709\u627E\u5230\u5B9E\u4F53");return}Object.keys(s).forEach(X=>{b.SetValByKey(X,s[X])}),b.SetValByKey(_.value,s[_.value]),yield b.Save(),o("finish")}))}),Promise.all(t).then(()=>{P.success("\u4FDD\u5B58\u6210\u529F"),H()})},ce=(t,s,e)=>{(t==2||t==3||t==8)&&isNaN(s[e])&&(s[e]=0)};return H(),(t,s)=>(c(),N(Ce,{ref_key:"wrapperRef",ref:h,"close-drawer-func":t.InitSearch,"close-modal-func":t.InitSearch},{default:k(()=>[te("div",st,[C($e,null,{default:k(()=>[C(f(Oe),{spinning:x.value},{default:k(()=>[M.hasError?(c(),g("div",nt,re(M.tips),1)):(c(),g("div",ot,[te("div",lt,[F.value.IsInsert?(c(),N(f(me),{key:0,type:"primary",class:"btn_style",style:{"margin-right":"20px"},onClick:J},{default:k(()=>[ae("\u65B0\u589E ")]),_:1})):T("",!0),F.value.IsUpdate?(c(),N(f(me),{key:1,type:"primary",class:"btn_style",onClick:V},{default:k(()=>[ae("\u4FDD\u5B58")]),_:1})):T("",!0)]),C(f(Ve),{onRegister:f(ee)},Ke({action:k(({record:e,index:o})=>[C(f(he),{actions:Y(e,o)},null,8,["actions"])]),"form-resetBefore":k(()=>[C(f(he),{actions:Z()},null,8,["actions"])]),_:2},[ue(K.value,e=>({name:e.key,fn:k(({record:o})=>[e.params!=null?(c(),g("div",it,[e.params.UIContralType===f(de).DDL?(c(),g("div",rt,[C(f(Se),{ref:"select",value:o[e.key],"onUpdate:value":u=>o[e.key]=u,disabled:A(e.params),style:z("width:"+(e.width-20)+"px")},{default:k(()=>[(c(!0),g(fe,null,ue(e.params.binddata,(u,b)=>(c(),N(f(Re),{key:b,value:u.value},{default:k(()=>[ae(re(u.label),1)]),_:2},1032,["value"]))),128))]),_:2},1032,["value","onUpdate:value","disabled","style"])])):e.params.UIContralType===f(de).RadioBtn?(c(),g("div",ut,[C(f(We),{value:o[e.key],"onUpdate:value":u=>o[e.key]=u,disabled:A(e.params),style:z("width:"+(e.width-20)+"px")},{default:k(()=>[(c(!0),g(fe,null,ue(e.params.binddata,(u,b)=>(c(),N(f(Ge),{key:b,value:u.value},{default:k(()=>[ae(re(u.label),1)]),_:2},1032,["value"]))),128))]),_:2},1032,["value","onUpdate:value","disabled","style"])])):e.params.MyDataType===4?(c(),g("div",pt,[C(f(Pe),{disabled:A(e.params),checked:o[e.key],"onUpdate:checked":u=>o[e.key]=u},null,8,["disabled","checked","onUpdate:checked"])])):e.params.MyDataType===6?(c(),g("div",dt,[te("div",{style:z("width:"+(e.width-20)+"px;")},[C(f(ve),{disabled:A(e.params),value:o[e.key],"onUpdate:value":u=>o[e.key]=u},null,8,["disabled","value","onUpdate:value"])],4)])):e.params.MyDataType===7?(c(),g("div",ct,[te("div",{style:z("width:"+(e.width-20)+"px;")},[C(f(ve),{disabled:A(e.params),"show-time":!0,value:o[e.key],"onUpdate:value":u=>o[e.key]=u},null,8,["disabled","value","onUpdate:value"])],4)])):(c(),g("div",yt,[C(f(Me),{value:o[e.key],"onUpdate:value":u=>o[e.key]=u,style:z(p(e)),disabled:e.params.UIIsReadonly,onKeyup:u=>ce(e.params.MyDataType,o,e)},null,8,["value","onUpdate:value","style","disabled","onKeyup"])]))])):T("",!0)])}))]),1032,["onRegister"])]))]),_:1},8,["spinning"])]),_:1})])]),_:1},8,["close-drawer-func","close-modal-func"]))}});const Be=_e(mt,[["__scopeId","data-v-435989f3"]]),Wt=Object.freeze(Object.defineProperty({__proto__:null,default:Be},Symbol.toStringTag,{value:"Module"})),ft=new Map([["Ens.vue",Be],["EnOnly.vue",ze],["GroupPageNew.vue",He]]);function L(W){const{loadComponent:K}=De(),B=W.split("?")[0],x=B.lastIndexOf("/"),E=B.substring(x+1);if(!E.endsWith(".vue"))throw new Error("\u8DEF\u5F84\u9700\u8981\u4EE5.vue\u7ED3\u5C3E");const S=ft.get(E);return S||K(W)}const Gt=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));export{Ce as B,Be as E,Pt as a,Wt as b,Gt as c,L as u};
|