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
3.9 KiB
2 lines
3.9 KiB
var P=(N,k,m)=>new Promise((f,d)=>{var S=a=>{try{_(m.next(a))}catch(n){d(n)}},v=a=>{try{_(m.throw(a))}catch(n){d(n)}},_=a=>a.done?f(a.value):Promise.resolve(a.value).then(S,v);_((m=m.apply(N,k)).next())});import{d as V,q as W,r as u,o as s,g as p,b as h,w as r,t as b,u as o,h as g,j as C,B as j,F as D,bt as F,a as E,bo as q,$ as G,Y as x,aT as z}from"./index-f4658ae7.js";import{D as L}from"./index-0e56c5c3.js";import{C as U,a as Y}from"./index-297faa0c.js";import{a as $,R as Q}from"./index-3590612f.js";import{C as X,a as Z}from"./index-456479d3.js";const ee={class:"p-1"},ae={key:0,class:"ant-tag-red"},te={key:1,class:"content"},le={style:{"text-align":"right",display:"inline","margin-left":"251px"}},se={style:{"max-height":"400px","overflow-y":"auto"}},ue=V({__name:"SelectEmpByDomain",props:{params:{type:Object,default:()=>{}}},emits:["AddEmps"],setup(N,{emit:k}){const m=N,f=W({hasError:!1,tips:""}),d=u(!1),S=u(""),v=u([]),_=u([]),a=u([]),n=u(!0),O=u(!1),I=u(!0),H=u(!1),B=u([]),w=u();(()=>P(this,null,function*(){var i;try{d.value=!0,w.value=m.params;const l=new G("BP.WF.HttpHandler.WF_WorkOpt");l.AddJson(w.value);const t=yield l.DoMethodReturnString("Accepter_Init");if(typeof t=="string"&&t.includes("err@")){x.error(t.replace("err@",""));return}const e=JSON.parse(JSON.stringify(t));if(S.value=e.PageName||"",H.value=!!e.IsSend,S.value==""){if(_.value=e.Emps||[],_.value.length==0){d.value=!1,x.error("\u5F53\u524D\u8282\u70B9\u8BBE\u7F6E\u7684\u63A5\u6536\u4EBA\u8303\u56F4\u4E3A\u7A7A,\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u914D\u7F6E\u63A5\u6536\u4EBA\u8303\u56F4");return}v.value=e.Depts,n.value=parseInt(((i=e.Selector[0])==null?void 0:i.IsSimpleSelector)||0)===0;const A=e.Selected||[];A.forEach(c=>{a.value.push(c.No)}),v.value.forEach(c=>{c.Emps=e.Emps.filter(y=>y.FK_Dept==c.No),B.value.push(c.No),A.length==0?c.Selected=[]:c.Emps.filter(y=>A.find(T=>T.No==y.No)).forEach(y=>c.Selected.push(y.No))})}}catch(l){f.hasError=!0,f.tips=l}finally{d.value=!1}}))();const R=i=>{v.value.forEach(l=>{l.Selected=[],i.target.checked==!0&&l.Emps.forEach(t=>{l.Selected.push(t.No)})}),I.value=!1},K=k,J=()=>{if(n.value==!0&&(a.value=[],v.value.forEach(i=>{i.Selected&&(a.value=[...a.value,...i.Selected])})),a.value.length==0){x.error("\u8BF7\u9009\u62E9\u63A5\u6536\u4EBA");return}K("AddEmps",a.value)},M=()=>{K("AddEmps",[])};return(i,l)=>(s(),p("div",ee,[h(o(q),{spinning:d.value,style:{"background-color":"white"}},{default:r(()=>[f.hasError?(s(),p("div",ae,b(f.tips),1)):(s(),p("div",te,[h(o(U),{checked:O.value,"onUpdate:checked":l[0]||(l[0]=t=>O.value=t),indeterminate:I.value,onChange:R,disabled:n.value==!1},{default:r(()=>[g(" \u5168\u9009 ")]),_:1},8,["checked","indeterminate","disabled"]),C("div",le,[h(o(j),{type:"primary",style:{"margin-right":"0.5em"},onClick:J},{default:r(()=>[g("\u786E\u5B9A")]),_:1}),h(o(j),{type:"primary",style:{"margin-right":"0.5em"},onClick:M},{default:r(()=>[g("\u53D6\u6D88")]),_:1})]),h(o(L)),C("div",se,[(s(!0),p(D,null,F(v.value,t=>(s(),p("div",{key:t.No},[h(o(X),{activeKey:B.value,"onUpdate:activeKey":l[2]||(l[2]=e=>B.value=e),ghost:""},{default:r(()=>[(s(),E(o(Z),{key:t.No,header:t.Name},{default:r(()=>[C("p",null,[n.value?(s(),E(o(Y),{key:0,value:t.Selected,"onUpdate:value":e=>t.Selected=e},{default:r(()=>[(s(!0),p(D,null,F(t.Emps,e=>(s(),E(o(U),{key:e.No,value:e.No,name:e.Name},{default:r(()=>[g(b(e.Name),1)]),_:2},1032,["value","name"]))),128))]),_:2},1032,["value","onUpdate:value"])):(s(),E(o($),{key:1,value:a.value,"onUpdate:value":l[1]||(l[1]=e=>a.value=e)},{default:r(()=>[(s(!0),p(D,null,F(t.Emps,e=>(s(),E(o(Q),{key:e.No,value:e.No,name:e.Name},{default:r(()=>[g(b(e.Name),1)]),_:2},1032,["value","name"]))),128))]),_:2},1032,["value"]))])]),_:2},1032,["header"]))]),_:2},1032,["activeKey"])]))),128))])]))]),_:1},8,["spinning"])]))}});const oe=z(ue,[["__scopeId","data-v-ce89e2b3"]]),me=Object.freeze(Object.defineProperty({__proto__:null,default:oe},Symbol.toStringTag,{value:"Module"}));export{oe as S,me as _};
|