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-CC3OF1BO.js";import{u as O}from"./index-B_2CoVdl.js";import{q as S,h as T}from"./role.api-C6wEeMAN.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./index-DAURrYyA.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.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};
