RoleDrawer-a945ff1e.js 4.1 KB

1
  1. var F=Object.defineProperty;var y=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var v=(t,r,a)=>r in t?F(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,B=(t,r)=>{for(var a in r||(r={}))T.call(r,a)&&v(t,a,r[a]);if(y)for(var a of y(r))N.call(r,a)&&v(t,a,r[a]);return t};var p=(t,r,a)=>new Promise((e,o)=>{var s=l=>{try{d(a.next(l))}catch(i){o(i)}},n=l=>{try{d(a.throw(l))}catch(i){o(i)}},d=l=>l.done?e(l.value):Promise.resolve(l.value).then(s,n);d((a=a.apply(t,r)).next())});import{B as C,u as O,__tla as V}from"./index-016fd85f.js";import{h as L,bj as j,E as A,d as M,r as D,A as U,u as g,_ as q,y as b,o as G,c as W,w as I,e as S,P as $,__tla as z}from"./index-b5895273.js";import{s as E,d as H,__tla as J}from"./system-2845f670.js";import{B as K,u as Q,__tla as X}from"./index-49a1c061.js";import{B as Y,__tla as Z}from"./Tree-6c35f2c0.js";let w,k,x,R,ee=Promise.all([(()=>{try{return V}catch(t){}})(),(()=>{try{return z}catch(t){}})(),(()=>{try{return J}catch(t){}})(),(()=>{try{return X}catch(t){}})(),(()=>{try{return Z}catch(t){}})()]).then(()=>p(void 0,null,function*(){let t,r;x=[{title:"\u89D2\u8272\u540D\u79F0",dataIndex:"roleName",width:200},{title:"\u89D2\u8272\u503C",dataIndex:"roleValue",width:180},{title:"\u6392\u5E8F",dataIndex:"orderNo",width:50},{title:"\u72B6\u6001",dataIndex:"status",width:120,customRender:({record:e})=>(Reflect.has(e,"pendingStatus")||(e.pendingStatus=!1),L(j,{checked:e.status==="1",checkedChildren:"\u5DF2\u542F\u7528",unCheckedChildren:"\u5DF2\u7981\u7528",loading:e.pendingStatus,onChange(o){e.pendingStatus=!0;const s=o?"1":"0",{createMessage:n}=A();E(e.id,s).then(()=>{e.status=s,n.success("\u5DF2\u6210\u529F\u4FEE\u6539\u89D2\u8272\u72B6\u6001")}).catch(()=>{n.error("\u4FEE\u6539\u89D2\u8272\u72B6\u6001\u5931\u8D25")}).finally(()=>{e.pendingStatus=!1})}}))},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createTime",width:180},{title:"\u5907\u6CE8",dataIndex:"remark"}],R=[{field:"roleNme",label:"\u89D2\u8272\u540D\u79F0",component:"Input",colProps:{span:8}},{field:"status",label:"\u72B6\u6001",component:"Select",componentProps:{options:[{label:"\u542F\u7528",value:"0"},{label:"\u505C\u7528",value:"1"}]},colProps:{span:8}}],t=[{field:"roleName",label:"\u89D2\u8272\u540D\u79F0",required:!0,component:"Input"},{field:"roleValue",label:"\u89D2\u8272\u503C",required:!0,component:"Input"},{field:"status",label:"\u72B6\u6001",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u542F\u7528",value:"0"},{label:"\u505C\u7528",value:"1"}]}},{label:"\u5907\u6CE8",field:"remark",component:"InputTextArea"},{label:" ",field:"menu",slot:"menu",component:"Input"}],r=M({name:"RoleDrawer",components:{BasicDrawer:K,BasicForm:C,BasicTree:Y},emits:["success","register"],setup(e,{emit:o}){const s=D(!0),n=D([]),[d,{resetFields:l,setFieldsValue:i,validate:_}]=O({labelWidth:90,schemas:t,showActionButtonGroup:!1}),[h,{setDrawerProps:u,closeDrawer:m}]=Q(c=>p(this,null,function*(){l(),u({confirmLoading:!1}),g(n).length===0&&(n.value=yield H()),s.value=!!(c!=null&&c.isUpdate),g(s)&&i(B({},c.record))})),f=U(()=>g(s)?"\u7F16\u8F91\u89D2\u8272":"\u65B0\u589E\u89D2\u8272");function P(){return p(this,null,function*(){try{const c=yield _();u({confirmLoading:!0}),m(),o("success")}finally{u({confirmLoading:!1})}})}return{registerDrawer:h,registerForm:d,getTitle:f,handleSubmit:P,treeData:n}}});function a(e,o,s,n,d,l){const i=b("BasicTree"),_=b("BasicForm"),h=b("BasicDrawer");return G(),W(h,$(e.$attrs,{onRegister:e.registerDrawer,showFooter:"",title:e.getTitle,width:"500px",onOk:e.handleSubmit}),{default:I(()=>[S(_,{onRegister:e.registerForm},{menu:I(({model:u,field:m})=>[S(i,{value:u[m],"onUpdate:value":f=>u[m]=f,treeData:e.treeData,fieldNames:{title:"menuName",key:"id"},checkable:"",toolbar:"",title:"\u83DC\u5355\u5206\u914D"},null,8,["value","onUpdate:value","treeData"])]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}w=q(r,[["render",a]]),k=Object.freeze(Object.defineProperty({__proto__:null,default:w},Symbol.toStringTag,{value:"Module"}))}));export{w as R,ee as __tla,k as a,x as c,R as s};