index.0102c0a4.js 4.8 KB

1
  1. import{r as p,a as _,b,o as v,c as C,w as d,d as D,e as t,f as x,_ as I,g as k,u as y,E as F,h as $}from"./index.4d409b70.js";import{D as B,F as R,_ as T}from"./index.1b48e937.js";import{_ as E}from"./Form.eadef67e.js";import{f as h}from"./config.31c979d2.js";const P=[{label:"\u83DC\u5355\u540D\u79F0",value:"menuName",width:6,type:"text"}],H=[{prop:"index",label:"\u5E8F\u53F7"},{prop:"menuName",label:"\u83DC\u5355\u540D\u79F0"},{prop:"munuPath",label:"\u83DC\u5355\u8DEF\u5F84"},{prop:"munuIcon",label:"\u83DC\u5355\u56FE\u6807"},{prop:"remarks",label:"\u83DC\u5355\u63CF\u8FF0"},{prop:"creatorName",label:"\u521B\u5EFA\u4EBA"},{prop:"createTime",label:"\u521B\u5EFA\u65F6\u95F4"}],L=[{label:"\u59D3\u540D",value:"name",width:12},{label:"\u8054\u7CFB\u7535\u8BDD",value:"phone",width:12},{label:"\u7528\u6237\u540D",value:"userName",width:12},{label:"\u5BC6\u7801",value:"password",width:12},{label:"\u90AE\u7BB1",value:"email",width:12},{label:"\u7528\u6237\u89D2\u8272",value:"roleId",width:12},{label:"\u521B\u5EFA\u65F6\u95F4",value:"createTime",width:12},{label:"\u521B\u5EFA\u4EBA",value:"creatorName",width:12}],A={class:"dialog-footer"},M=x("\u786E\u5B9A"),S=x("\u53D6\u6D88"),U={__name:"AddForm",emits:[""],setup(V,{expose:c}){const e=p({dialogVisible:!1,title:"",rules:{roleName:h("must"),roleId:h("must"),menu:h("must")},formData:{},formItem:[{label:"\u4E0A\u7EA7\u83DC\u5355",type:"select",value:"parentMenu",children:[],width:24},{label:"\u83DC\u5355\u540D\u79F0",value:"menuName",type:"text",width:24},{label:"\u83DC\u5355\u8DEF\u5F84",value:"menuPath",type:"text",width:24},{label:"\u83DC\u5355\u56FE\u6807",value:"menuIcon",type:"select",children:[],width:24}]}),n=_(null);function s(o){e.formData={},o?(e.title="\u7F16\u8F91",e.formData=o,console.log(e.formData)):e.title="\u65B0\u589E",e.dialogVisible=!0}const i=o=>{},a=()=>n.value.submitForm(),m=o=>{console.log(o)},r=()=>{e.dialogVisible=!1};return c({open:s,edit:i}),(o,u)=>{const f=b("el-button"),g=b("el-dialog");return v(),C(g,{modelValue:e.dialogVisible,"onUpdate:modelValue":u[0]||(u[0]=l=>e.dialogVisible=l),"close-on-click-modal":!1,"close-on-press-escape":!1,title:e.title,"destroy-on-close":"",width:"50%"},{footer:d(()=>[D("span",A,[t(f,{type:"primary",onClick:a},{default:d(()=>[M]),_:1}),t(f,{onClick:r},{default:d(()=>[S]),_:1})])]),default:d(()=>[t(E,{ref_key:"formRef",ref:n,"form-data":e.formData,"form-item":e.formItem,rules:e.rules,onSubmitForm:m},null,8,["form-data","form-item","rules"])]),_:1},8,["modelValue","title"])}}};const j={class:"user-detail"},q={__name:"Detail",setup(V,{expose:c}){const e=p({dialogVisible:!1,detailList:L,detailInfo:{}}),n=i=>{e.detailInfo=i,e.dialogVisible=!0},s=()=>{e.detailInfo={},e.dialogVisible=!1};return c({openDialog:n,closeDialog:s}),(i,a)=>{const m=b("el-dialog");return v(),k("div",j,[t(m,{modelValue:e.dialogVisible,"onUpdate:modelValue":a[0]||(a[0]=r=>e.dialogVisible=r),title:"\u7528\u6237\u8BE6\u60C5","close-on-click-modal":!1,"close-on-press-escape":!1,width:"800px","destroy-on-close":"","custom-class":"user-detail-dialog",onClose:a[1]||(a[1]=r=>s())},{default:d(()=>[t(B,{"detail-list":e.detailList,"detail-info":e.detailInfo},null,8,["detail-list","detail-info"])]),_:1},8,["modelValue"])])}}};var z=I(q,[["__scopeId","data-v-18d5da88"]]);const G={class:"menu-manage"},J={class:"btn-list"},K=x("\u65B0\u589E"),O={__name:"index",setup(V){const c=p({name:"",age:"",classes:""}),e=_(null),n=_(null),s=_(!0),i=p([]);setTimeout(()=>{for(let l=0;l<20;l++)i.push({index:l+1,menuName:"\u83DC\u5355\u540D\u79F0",munuPath:"/home",munuIcon:"icon",remarks:"\u8FD9\u4E2A\u4E00\u4E2A\u4E3B\u9875",createTime:"2022-5-31 09:30:00",creatorName:"admin"});s.value=!1},200);function a(){e.value.open()}function m(l){n.value.openDialog(l),console.log("\u67E5\u770B",l)}function r(l){e.value.open(l),console.log("\u7F16\u8F91",l)}function o(l){console.log("\u5220\u9664",l),F({title:"\u63D0\u793A",message:"\u786E\u5B9A\u8981\u5220\u9664\u5417?",showCancelButton:!0,confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",callback:w=>{w==="confirm"&&$.success("\u5220\u9664\u6210\u529F")}})}function u(l){console.log("\u67E5\u8BE2\u6570\u636E",l)}function f(){console.log("\u6E05\u9664\u6570\u636E")}function g(l){console.log("\u9875\u7801\u53D8\u5316",l)}return(l,w)=>{const N=b("el-button");return v(),k("div",G,[t(R,{"form-item":y(P),"form-data":c,onSearchForm:u,onClearForm:f},null,8,["form-item","form-data"]),D("div",J,[t(N,{type:"primary",icon:"Plus",onClick:a},{default:d(()=>[K]),_:1})]),t(T,{"table-head":y(H),"table-data":i,operation:["view","edit","del"],total:8e3,"list-loading":s.value,style:{height:"calc(100vh - 250px)"},onHandleView:m,onHandleEdit:r,onHandleDelete:o,onPaginationChange:g},null,8,["table-head","table-data","list-loading"]),t(U,{ref_key:"AddFormRef",ref:e},null,512),t(z,{ref_key:"DetailRef",ref:n},null,512)])}}};var Z=I(O,[["__scopeId","data-v-5cb9720e"]]);export{Z as default};