var k=(y,v,u)=>new Promise((g,r)=>{var c=t=>{try{e(u.next(t))}catch(p){r(p)}},i=t=>{try{e(u.throw(t))}catch(p){r(p)}},e=t=>t.done?g(t.value):Promise.resolve(t.value).then(c,i);e((u=u.apply(y,v)).next())});import{d as U,f,u as o,U as n,a2 as m,ad as w,af as s,k as l,a3 as b,ae as j,G as h,a5 as z,F as A,a4 as D,ag as E}from"./vue-vendor-CxLCUzY4.js";import{u as G,B as K}from"./index-CJ4Xt1FM.js";import{u as O}from"./index-Cy4uayzW.js";import{q as S,h as T}from"./role.api-C1mobM9X.js";import"./antd-vue-vendor-CahNzUUa.js";import"./index-Bdn0r8CG.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useIntersectionObserver-FVRzwlSd.js";const $={style:{width:"100%","margin-top":"15px"}},H={key:1},le=U({__name:"RoleDataRuleDrawer",emits:["success","register"],setup(y,{emit:v}){const u=v,{createMessage:g}=O(),r=f(""),c=f(""),i=f([]),e=f([]),[t,{setDrawerProps:p,closeDrawer:R}]=G(d=>k(this,null,function*(){yield x(),p({confirmLoading:!1}),r.value=d.functionId,c.value=d.roleId;const a=yield S({functionId:o(r),roleId:o(c)});a.success&&(i.value=a.result.datarule,a.result.drChecked&&(e.value=a.result.drChecked.split(",")))}));function x(){r.value="",c.value="",i.value=[],e.value=[]}function C(){return k(this,null,function*(){(!o(e)||o(e).length==0)&&g.warning("请注意，现未勾选任何数据权限!");let d={permissionId:o(r),roleId:o(c),dataRuleIds:o(e).join(",")};yield T(d),R(),u("success")})}return(d,a)=>{const B=n("a-checkbox"),I=n("a-col"),N=n("Icon"),F=n("a-button"),L=n("a-row"),V=n("a-checkbox-group"),q=n("a-tab-pane"),M=n("a-tabs");return m(),w(o(K),E(d.$attrs,{onRegister:o(t),title:"数据规则配置",width:"450px",destroyOnClose:""}),{default:s(()=>[l(M,{defaultActiveKey:"1"},{default:s(()=>[l(q,{tab:"数据规则",key:"1"},{default:s(()=>[i.value.length>0?(m(),w(V,{key:0,value:e.value,"onUpdate:value":a[0]||(a[0]=_=>e.value=_)},{default:s(()=>[l(L,null,{default:s(()=>[(m(!0),b(A,null,j(i.value,(_,P)=>(m(),w(I,{span:24,key:"dr"+P},{default:s(()=>[l(B,{value:_.id},{default:s(()=>[h(z(_.ruleName),1)]),_:2},1032,["value"])]),_:2},1024))),128)),l(I,{span:24},{default:s(()=>[D("div",$,[l(F,{onClick:C,type:"primary",size:"small"},{default:s(()=>[l(N,{icon:"ant-design:save-outlined"}),a[1]||(a[1]=h("点击保存"))]),_:1})])]),_:1})]),_:1})]),_:1},8,["value"])):(m(),b("div",H,a[2]||(a[2]=[D("h3",null,"无配置信息!",-1)])))]),_:1})]),_:1})]),_:1},16,["onRegister"])}}});export{le as default};
