2 lines
3.7 KiB
Java
2 lines
3.7 KiB
Java
var v=Object.defineProperty;var g=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var w=(e,a,t)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))k.call(a,t)&&w(e,t,a[t]);if(g)for(var t of g(a))F.call(a,t)&&w(e,t,a[t]);return e};var d=(e,a,t)=>new Promise((n,l)=>{var u=s=>{try{r(t.next(s))}catch(o){l(o)}},i=s=>{try{r(t.throw(s))}catch(o){l(o)}},r=s=>s.done?n(s.value):Promise.resolve(s.value).then(u,i);r((t=t.apply(e,a)).next())});import{l as I,d as R,f as B,e as y,u as f,ah as h,aC as C,as as T,aG as P,aF as D,k as S}from"./vue-vendor-C7Zq48Yl.js";import"./index-Di-j2gt4.js";import{G as x}from"./antd-vue-vendor-BPnV8VqP.js";import{s as N,c as $}from"./system-CeA8A5vN.js";import{u as V,d as G}from"./index-BI6CMai0.js";import{B as L,u as M}from"./index-CjmLh_1m.js";import{B as O}from"./index-CUdllngZ.js";import{B as U}from"./BasicForm-BJnSRkIE.js";import{u as j}from"./useForm-BZtHZyx2.js";const ae=[{title:"角色名称",dataIndex:"roleName",width:200},{title:"角色值",dataIndex:"roleValue",width:180},{title:"排序",dataIndex:"orderNo",width:50},{title:"状态",dataIndex:"status",width:120,customRender:({record:e})=>(Reflect.has(e,"pendingStatus")||(e.pendingStatus=!1),I(x,{checked:e.status==="1",checkedChildren:"已启用",unCheckedChildren:"已禁用",loading:e.pendingStatus,onChange(a){e.pendingStatus=!0;const t=a?"1":"0",{createMessage:n}=V();N(e.id,t).then(()=>{e.status=t,n.success("已成功修改角色状态")}).catch(()=>{n.error("修改角色状态失败")}).finally(()=>{e.pendingStatus=!1})}}))},{title:"创建时间",dataIndex:"createTime",width:180},{title:"备注",dataIndex:"remark"}],se=[{field:"roleNme",label:"角色名称",component:"Input",colProps:{span:8}},{field:"status",label:"状态",component:"Select",componentProps:{options:[{label:"启用",value:"0"},{label:"停用",value:"1"}]},colProps:{span:8}}],q=[{field:"roleName",label:"角色名称",required:!0,component:"Input"},{field:"roleValue",label:"角色值",required:!0,component:"Input"},{field:"status",label:"状态",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"启用",value:"0"},{label:"停用",value:"1"}]}},{label:"备注",field:"remark",component:"InputTextArea"},{label:" ",field:"menu",slot:"menu",component:"Input"}],A=R({name:"RoleDrawer",components:{BasicDrawer:L,BasicForm:U,BasicTree:O},emits:["success","register"],setup(e,{emit:a}){const t=B(!0),n=B([]),[l,{resetFields:u,setFieldsValue:i,validate:r}]=j({labelWidth:90,schemas:q,showActionButtonGroup:!1}),[s,{setDrawerProps:o,closeDrawer:m}]=M(c=>d(null,null,function*(){u(),o({confirmLoading:!1}),f(n).length===0&&(n.value=yield $()),t.value=!!(c!=null&&c.isUpdate),f(t)&&i(b({},c.record))})),p=y(()=>f(t)?"编辑角色":"新增角色");function _(){return d(this,null,function*(){try{const c=yield r();o({confirmLoading:!0}),m(),a("success")}finally{o({confirmLoading:!1})}})}return{registerDrawer:s,registerForm:l,getTitle:p,handleSubmit:_,treeData:n}}});function z(e,a,t,n,l,u){const i=h("BasicTree"),r=h("BasicForm"),s=h("BasicDrawer");return T(),C(s,P(e.$attrs,{onRegister:e.registerDrawer,showFooter:"",title:e.getTitle,width:"500px",onOk:e.handleSubmit}),{default:D(()=>[S(r,{onRegister:e.registerForm},{menu:D(({model:o,field:m})=>[S(i,{value:o[m],"onUpdate:value":p=>o[m]=p,treeData:e.treeData,replaceFields:{title:"menuName",key:"id"},checkable:"",toolbar:"",title:"菜单分配"},null,8,["value","onUpdate:value","treeData"])]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}const W=G(A,[["render",z]]),oe=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));export{W as R,oe as a,ae as c,se as s};
|