yifengyide/public/dist/assets/permission-5e142161.js

2 lines
6.2 KiB
JavaScript
Raw Normal View History

import{p as X,d as z,a as s,C as Y,s as E,b as _,j as f,k as ee,r as le,o as te,P as oe,h as i,ak as ae,e as l,w as t,A as u,f as h,t as b,l as ne,z as k,F as se,al as de,am as ie,an as re,Z as ue,$ as ce,a2 as me,U as pe}from"./index-7b3f5fdc.js";import{b as _e}from"./index-c31677f3.js";import{Z as fe}from"./index-44f083e6.js";import{c as ye}from"./index-a832a56d.js";import{a as ve,E as ge}from"./index-e96dc078.js";import{w as be}from"./index-354ab616.js";import{w as xe}from"./index-81f068f9.js";import{V as Ve}from"./index-a513db85.js";import{y as he,f as ke}from"./index-4ab1e1d9.js";import{j as we}from"./index-d0b57c12.js";const Ce={class:"layui-radio-group"},Se=X(z({name:"LayRadioGroup",__name:"index",props:{modelValue:{type:[String,Boolean,Number]},name:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(w,{emit:e}){const r=w,y=e,v=s(r.modelValue),c=s(r.disabled);return Y("radioGroup",{name:"LayRadioGroup",modelValue:v,naiveName:r.name,disabled:c,changeRadioGroup:d=>{y("change",d),y("update:modelValue",d)}}),E(()=>r.modelValue,d=>v.value=d),E(()=>r.disabled,d=>c.value=d),(d,C)=>(_(),f("div",Ce,[ee(d.$slots,"default")]))}}));const De={style:{padding:"10px"}},Fe=["onClick"],Ge={key:0,style:{color:"#00A394",cursor:"pointer"}},Ue={key:1},Me=z({__name:"permission",setup(w){const e=le({name:"",describe:"",rules:[],level:2,id:0}),r=s(1);te(()=>{c(),C()});const y=()=>{m.value=!0,e.id=0,e.name="",e.describe="",e.rules=[],e.level=2},v=n=>{console.log(n),m.value=!0,e.name=n.name,e.describe=n.describe,e.rules=n.rules.split(",").map(Number),e.id=n.id,e.level=n.level,console.log(e.rules),r.value=2},c=()=>{oe({}).then(n=>{console.log(n),n.code==1?D.value=n.data:i.msg(n.msg,{icon:2})})},d=async n=>{var o=await de({id:n.id});console.log(o),o.code==1?(i.msg("删除成功!",{icon:1}),c()):i.msg(o.msg,{icon:2})},C=()=>{ae({}).then(n=>{console.log(n),n.code==1?S.value=n.data:i.msg(n.msg,{icon:2})})},B=s([{text:"确认",callback:async()=>{if(console.log(e),e.name==""){i.msg("角色名称不能为空!",{icon:2});return}if(e.describe==""){i.msg("角色描述不能为空!",{icon:2});return}if(e.describe.length==0||e.describe==""){i.msg("请选择菜单!",{icon:2});return}if(typeof e.rules!="string"&&(e.rules=e.rules.join(",")),r.value==1)var n=await ie(e);else var n=await re(e);n.code==1?(i.msg("提交成功!",{icon:1}),m.value=!1,c()):i.msg(n.msg,{icon:2})}},{text:"取消",callback:()=>{m.value=!1}}]),L=s(!0),R=s({id:"id",title:"title",children:"children"}),S=s([]),m=s(!1),j=s({total:1,limit:10,current:1}),K=[{title:"序号",width:"50px",customSlot:"id",align:"center",key:"id"},{title:"角色名称",width:"100px",align:"center",key:"name"},{title:"角色描述",width:"150px",key:"describe"},{title:"审核权限",width:"100px",customSlot:"level",align:"center",key:"level"},{title:"操作",width:"180px",customSlot:"operator",key:"operator",align:"center",fixed:"right"}],D=s([]);function M(){i.load(2,{time:3e3})}const x=s(""),Z=s("");function H(){x.value="",Z.value=""}return(n,o)=>{const F=ue,p=ce,g=he,V=me,G=ke,U=we,N=Ve,I=xe,P=be,T=ve,$=ye,q=fe,A=ge,J=Se,O=_e,Q=pe;return _(),f(se,null,[l($,{fluid:"true",style:{padding:"20px"}},{default:t(()=>[l(G,{space:10},{default:t(()=>[l(g,{md:24},{default:t(()=>[l(N,null,{default:t(()=>[l(U,{style:{"margin-top":"20px"}},{default:t(()=>[l(G,null,{default:t(()=>[l(g,{md:5},{default:t(()=>[l(p,{label:"角色名称:","label-width":"50"},{default:t(()=>[l(F,{modelValue:x.value,"onUpdate:modelValue":o[0]||(o[0]=a=>x.value=a),style:{width:"90%"},placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),l(g,{md:4},{default:t(()=>[l(p,{"label-width":"0"},{default:t(()=>[l(V,{type:"primary",onClick:M},{default:t(()=>o[6]||(o[6]=[u("查询")])),_:1}),l(V,{onClick:H},{default:t(()=>o[7]||(o[7]=[u("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),l(g,{md:24},{default:t(()=>[l(N,null,{default:t(()=>[h("div",De,[o[9]||(o[9]=h("span",{style:{"font-size":"18px","vertical-align":"center","margin-right":"20px"}},"角色列表",-1)),l(V,{type:"primary",onCli