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
4.1 KiB
2 lines
4.1 KiB
var D=(C,p,f)=>new Promise((y,v)=>{var L=u=>{try{r(f.next(u))}catch(m){v(m)}},g=u=>{try{r(f.throw(u))}catch(m){v(m)}},r=u=>u.done?y(u.value):Promise.resolve(u.value).then(L,g);r((f=f.apply(C,p)).next())});import{d as z,q as F,r as B,aU as T,o as c,g as h,b as o,w as n,t as N,j as b,u as i,I as Y,B as P,h as O,F as U,bt as I,a as A,a9 as H,bo as J,Y as Q}from"./index-f4658ae7.js";/* empty css *//* empty css */import{a as W,C as X}from"./index-297faa0c.js";import{C as Z,a as $}from"./index-456479d3.js";import{ClassFactory as V}from"./ClassFactory-66077970.js";import{F as ee}from"./index-d51f1b4b.js";import{F as S}from"./FormItem-a040ce00.js";import"./Checkbox-abf1420e.js";import"./createForOfIteratorHelper-eb4541b9.js";import"./useSize-90c5eaba.js";import"./Col-dfe054f2.js";import"./index-2c9d82ce.js";const te={class:"p-1"},ae={key:0,class:"ant-tag-red"},le={key:1},se={class:"vben-container"},ne={style:{background:"#fff",padding:"10px","padding-left":"20px"}},ie=b("div",null,null,-1),Ee=z({__name:"GroupList",props:["params"],setup(C){const p=F({key:""});let f=C;const{PKVal:y,EnsOfMyPK:v,EnsOfDict:L,KeyRefPK:g,KeyDict:r,EnsOfGroup:u,KeyGroupDict:m}=f.params,E=B([]),k=B([]),x=B([]);let d;const M=B(!1),K=F({hasError:!1,tips:""}),G=()=>D(this,null,function*(){if(!v){K.hasError=!0,K.tips="\u7F3A\u5C11\u53C2\u6570 [ EnsOfMyPK ]";return}d=yield V.GetEns(v),yield d.Init(),yield d.Retrieve(g,y);let a=yield V.GetEns(L);yield a.Init(),yield a.RetrieveAll();const t=yield V.GetEns(u);yield t.Init(),yield t.RetrieveAll(),k.value=[],t.forEach(_=>{let e={label:_.Name,value:_.No,checkAll:!1,indeterminate:!1,checkedList:[],item:[]};a.filter(l=>l.GetValByKey(m)==_.No).forEach(l=>{e.item.push({label:l.Name,value:l.No})}),e.item=e.item.filter(l=>l.label.indexOf(p.key)!=-1),e.item.length>0?(k.value.push(e),x.value.push(e.value)):k.value.push(e),e.checkedList=[],d.filter(l=>e.item.find(s=>s.value==l.GetValByKey(r))).forEach(l=>{e.checkedList.push(l.GetValByKey(r))}),e.checkedList.length>0&&(e.indeterminate=!0,e.checkedList.length==e.item.length&&(e.checkAll=!0)),e.item.forEach(l=>{l.checked=e.checkedList.find(s=>s==l.value)})})});G();function R(){E.value=[],k.value.forEach(a=>{a.checkedList.forEach(t=>{E.value.push(t)})}),d.forEach(a=>{E.value.indexOf(a.GetValByKey(r))==-1&&a.Delete()}),E.value.filter(a=>!d.find(t=>t.GetValByKey(r)==a)).forEach(a=>{let t=d.GetNewEntity;t.SetValByKey(g,y),t.SetValByKey(r,a),t.SetValByKey("MyPK",y+"_"+a),t.Insert()}),Q.success("\u4FDD\u5B58\u6210\u529F"),G()}const j=(a,t)=>{t.checkedList.length>0&&(t.indeterminate=!0,t.checkedList.length==t.item.length&&(t.checkAll=!0))};return(a,t)=>{const _=T("UserOutlined");return c(),h("div",te,[o(i(J),{spinning:M.value,style:{"background-color":"white"}},{default:n(()=>[K.hasError?(c(),h("div",ae,N(K.tips),1)):(c(),h("div",le,[b("div",se,[o(i(ee),{layout:"inline",model:p},{default:n(()=>[o(i(S),null,{default:n(()=>[o(i(Y),{value:p.key,"onUpdate:value":t[0]||(t[0]=e=>p.key=e),placeholder:"\u5173\u952E\u5B57"},{prefix:n(()=>[o(_,{style:{color:"rgba(0, 0, 0, 0.25)"}})]),_:1},8,["value"])]),_:1}),o(i(S),null,{default:n(()=>[o(i(P),{type:"primary","html-type":"submit",onClick:G},{default:n(()=>[O(" \u67E5\u8BE2 ")]),_:1}),o(i(P),{type:"primary",style:{"margin-left":"10px"},onClick:R},{default:n(()=>[O(" \u4FDD\u5B58 ")]),_:1})]),_:1})]),_:1},8,["model"])]),b("div",ne,[(c(!0),h(U,null,I(k.value,(e,l)=>(c(),h("div",{key:l},[o(i(Z),{activeKey:x.value,"onUpdate:activeKey":t[1]||(t[1]=s=>x.value=s),ghost:""},{default:n(()=>[(c(),A(i($),{key:e.value,header:e.label},{default:n(()=>[b("p",null,[o(i(W),{class:"lie",onChange:s=>j(s,e),style:{"margin-left":"10px",padding:"10px"},value:e.checkedList,"onUpdate:value":s=>e.checkedList=s},{default:n(()=>[(c(!0),h(U,null,I(e.item,(s,q)=>(c(),A(i(X),{key:q,style:H(e.checkedList.find(w=>s.checked&&s.value==w)?"font-weight: bold":""),value:s.value,"onUpdate:value":w=>s.value=w},{default:n(()=>[O(N(s.label),1)]),_:2},1032,["style","value","onUpdate:value"]))),128))]),_:2},1032,["onChange","value","onUpdate:value"])])]),_:2},1032,["header"]))]),_:2},1032,["activeKey"]),ie]))),128))])]))]),_:1},8,["spinning"])])}}});export{Ee as default};
|