Files
qhmes/web-dist/js/RoleDrawer-EiutnVVg.js
2026-06-16 18:19:57 +08:00

2 lines
3.7 KiB
Java

var v=Object.defineProperty;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,R=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={}))I.call(a,t)&&w(e,t,a[t]);if(g)for(var t of g(a))R.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{B as k}from"./BasicForm-ClUSoD_-.js";import"./helper-DcLcf4v6.js";import{u as F}from"./useForm-D61zovon.js";import{s as y,b as T}from"./system-nmurLO6d.js";import{s as C,au as P}from"./index-X7Y8jykP.js";import{i as x,e as N,r as B,c as $,u as f,y as V,z as L,A as D,B as M,K as h,f as S}from"./vue-vendor-DNhG1Cve.js";import O from"./index-DsixALRt.js";import{B as U}from"./index-D9GWo192.js";import{B as A}from"./index-Bzmv9Ie7.js";import{u as j}from"./useDrawer-BDPywy9W.js";const se=[{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),x(O,{checked:e.status==="1",checkedChildren:"已启用",unCheckedChildren:"已禁用",loading:e.pendingStatus,onChange(a){e.pendingStatus=!0;const t=a?"1":"0",{createMessage:n}=C();y(e.id,t).then(()=>{e.status=t,n.success("已成功修改角色状态")}).catch(()=>{n.error("修改角色状态失败")}).finally(()=>{e.pendingStatus=!1})}}))},{title:"创建时间",dataIndex:"createTime",width:180},{title:"备注",dataIndex:"remark"}],oe=[{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"}],z=N({name:"RoleDrawer",components:{BasicDrawer:U,BasicForm:k,BasicTree:A},emits:["success","register"],setup(e,{emit:a}){const t=B(!0),n=B([]),[l,{resetFields:u,setFieldsValue:i,validate:r}]=F({labelWidth:90,schemas:q,showActionButtonGroup:!1}),[s,{setDrawerProps:o,closeDrawer:m}]=j(c=>d(null,null,function*(){u(),o({confirmLoading:!1}),f(n).length===0&&(n.value=yield T()),t.value=!!(c!=null&&c.isUpdate),f(t)&&i(b({},c.record))})),p=$(()=>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 G(e,a,t,n,l,u){const i=h("BasicTree"),r=h("BasicForm"),s=h("BasicDrawer");return L(),V(s,M(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 K=P(z,[["render",G]]),ne=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));export{K as R,ne as a,se as c,oe as s};