Files
xSynergy-manage/dist/assets/index-BTCuff5d.js
leilei f684fd49fb
Some checks failed
Deploy To Dev / deploy (push) Has been cancelled
feat:更新代码
2026-01-14 17:08:07 +08:00

2 lines
7.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{A as Y,d as Z,g as ee,r as m,b as P,t as te,e as le,c as oe,f as e,w as l,T as ne,h as r,i as n,j as ae,o as A,k as f,l as se,m as ie,q as re,p as v,E as de,s as h}from"./index-DyWI3x4X.js";import{d as ue,u as pe,a as me}from"./menu-DaF34q_h.js";const L=T=>Y({url:"/api/v1/permission/permissions/tree",method:"get",params:T}),ce={class:"p-2"},_e={class:"mb-[10px]"},fe={class:"dialog-footer"},ve=Z({name:"menuManagement"}),ge=Object.assign(ve,{setup(T){const{proxy:be}=ee(),q=m([]),y=m(!0),g=m([]),N=m(!1),d=P({visible:!1,title:""}),O=m(),w=m(),S=m(),E={permission_name:"",permission_type:2,permission_code:"",resource_path:"",http_method:"",description:"",parent_uid:""},j=P({form:{...E},queryParams:{permission_types:"2"},rules:{permission_name:[{required:!0,message:"接口名称不能为空",trigger:"blur"}],permission_code:[{required:!0,message:"权限标识不能为空",trigger:"blur"}],permission_type:[{required:!0,message:"接口类型不能为空",trigger:"change"}]}}),{queryParams:V,form:a,rules:G}=te(j),k=async()=>{y.value=!0;const o=await L(V.value);q.value=o.data,y.value=!1},M=async()=>{g.value=[];const o=await L(V.value),t={uid:"0",permission_name:"主类目",children:[]};t.children=o.data,g.value.push(t)},I=()=>{d.visible=!1},U=()=>{var o;a.value={...E},(o=w.value)==null||o.resetFields()},B=o=>{U(),M(),o&&o.uid?a.value.parent_uid=o.uid:a.value.parent_uid="",d.visible=!0,d.title="添加接口"},z=async o=>{U(),await M(),o.parent_uid==""&&(o.parent_uid="0"),a.value=o,d.visible=!0,d.title="修改接口"},H=()=>{var o;try{(o=w.value)==null||o.validate(async t=>{t&&(a.value.uid?await pe(a.value):await me(a.value),h.success("操作成功"),d.visible=!1,await k())})}catch{h.error("操作失败")}},J=async o=>{try{await de.confirm(`确认要删除"${o.permission_name}"的数据项?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const t=o==null?void 0:o.uid,i=await ue(t);if(i.meta.code!==200){h.error(i.data.message);return}await k(),h.success(`${o.permission_name}权限删除成功`)}catch(t){const i=(t==null?void 0:t.toString())||"";if(i.includes("cancel")||i.includes("取消")||i==="cancel"||t==="cancel"||i.includes("close")||t==="close")return;h.error(`${o.permission_name}权限删除失败`)}};return le(()=>{k()}),(o,t)=>{const i=r("el-form-item"),D=r("el-form"),F=r("el-card"),c=r("el-button"),u=r("el-col"),R=r("el-row"),p=r("el-table-column"),_=r("el-tooltip"),K=r("el-table"),Q=r("el-tree-select"),b=r("el-input"),x=r("question-filled"),C=r("el-icon"),W=r("el-dialog"),X=ae("loading");return A(),oe("div",ce,[e(ne,null,{default:l(()=>[f("div",_e,[e(F,{shadow:"hover"},{default:l(()=>[e(D,{ref_key:"queryFormRef",ref:O,model:n(V),inline:!0,"label-width":"68px"},{default:l(()=>[e(i)]),_:1},8,["model"])]),_:1})])]),_:1}),e(F,{shadow:"hover"},{header:l(()=>[e(R,{gutter:10},{default:l(()=>[e(u,{span:1.5},{default:l(()=>[e(c,{type:"primary",plain:"",icon:"Plus",onClick:t[0]||(t[0]=s=>B())},{default:l(()=>[...t[8]||(t[8]=[v("新增 ",-1)])]),_:1})]),_:1})]),_:1})]),default:l(()=>[se((A(),ie(K,{data:n(q),"row-key":"uid","tree-props":{children:"children",hasChildren:"hasChildren"},ref_key:"menuTableRef",ref:S,"default-expand-all":n(N)},{default:l(()=>[e(p,{prop:"permission_name",label:"接口名称","show-overflow-tooltip":!0,width:"160"}),e(p,{prop:"permission_code",label:"权限标识","show-overflow-tooltip":!0}),e(p,{prop:"resource_path",label:"组件路径","show-overflow-tooltip":!0}),e(p,{prop:"description",label:"权限描述","show-overflow-tooltip":!0}),e(p,{prop:"http_method",label:"请求方式","show-overflow-tooltip":!0,width:"80"}),e(p,{label:"创建时间",align:"center",prop:"createTime"},{default:l(s=>[f("span",null,re(o.parseTime(s.row.created_at)),1)]),_:1}),e(p,{fixed:"right",label:"操作",width:"180"},{default:l(s=>[e(_,{content:"修改",placement:"top"},{default:l(()=>[e(c,{link:"",type:"primary",icon:"Edit",onClick:$=>z(s.row)},null,8,["onClick"])]),_:2},1024),e(_,{content:"新增",placement:"top"},{default:l(()=>[e(c,{link:"",type:"primary",icon:"Plus",onClick:$=>B(s.row)},null,8,["onClick"])]),_:2},1024),e(_,{content:"删除",placement:"top"},{default:l(()=>[e(c,{link:"",type:"primary",icon:"Delete",onClick:$=>J(s.row)},null,8,["onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data","default-expand-all"])),[[X,n(y)]])]),_:1}),e(W,{title:n(d).title,modelValue:n(d).visible,"onUpdate:modelValue":t[7]||(t[7]=s=>n(d).visible=s),"destroy-on-close":"","append-to-body":"",width:"750px"},{footer:l(()=>[f("div",fe,[e(c,{type:"primary",onClick:H},{default:l(()=>[...t[12]||(t[12]=[v("确 定",-1)])]),_:1}),e(c,{onClick:I},{default:l(()=>[...t[13]||(t[13]=[v("取 消",-1)])]),_:1})])]),default:l(()=>[e(D,{ref_key:"menuFormRef",ref:w,model:n(a),rules:n(G),"label-width":"100px"},{default:l(()=>[e(R,null,{default:l(()=>[e(u,{span:24},{default:l(()=>[e(i,{label:"上级接口"},{default:l(()=>[e(Q,{modelValue:n(a).parent_uid,"onUpdate:modelValue":t[1]||(t[1]=s=>n(a).parent_uid=s),data:n(g),props:{value:"uid",label:"permission_name",children:"children"},"value-key":"uid",placeholder:"选择上级接口","check-strictly":"",style:{width:"100%"}},null,8,["modelValue","data"])]),_:1})]),_:1}),e(u,{span:24},{default:l(()=>[e(i,{label:"接口名称",prop:"permission_name"},{default:l(()=>[e(b,{modelValue:n(a).permission_name,"onUpdate:modelValue":t[2]||(t[2]=s=>n(a).permission_name=s),placeholder:"请输入接口名称"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:24},{default:l(()=>[e(i,{prop:"permission_code"},{label:l(()=>[f("span",null,[e(_,{content:"控制器中定义的权限字符xsy-delete-role')",placement:"top"},{default:l(()=>[e(C,null,{default:l(()=>[e(x)]),_:1})]),_:1}),t[9]||(t[9]=v(" 权限字符 ",-1))])]),default:l(()=>[e(b,{modelValue:n(a).permission_code,"onUpdate:modelValue":t[3]||(t[3]=s=>n(a).permission_code=s),placeholder:"请输入权限标识",maxlength:"100"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:24},{default:l(()=>[e(i,{prop:"resource_path"},{label:l(()=>[f("span",null,[e(_,{content:"接口路径,如:`/permission/roles/:role_uid`",placement:"top"},{default:l(()=>[e(C,null,{default:l(()=>[e(x)]),_:1})]),_:1}),t[10]||(t[10]=v(" 接口 路径 ",-1))])]),default:l(()=>[e(b,{modelValue:n(a).resource_path,"onUpdate:modelValue":t[4]||(t[4]=s=>n(a).resource_path=s),placeholder:"请输入接口路径"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:24},{default:l(()=>[e(i,{prop:"http_method"},{label:l(()=>[f("span",null,[e(_,{content:"请求方法,如:`GET`、`POST`、`PUT`、`DELETE`等",placement:"top"},{default:l(()=>[e(C,null,{default:l(()=>[e(x)]),_:1})]),_:1}),t[11]||(t[11]=v(" 请求方法 ",-1))])]),default:l(()=>[e(b,{modelValue:n(a).http_method,"onUpdate:modelValue":t[5]||(t[5]=s=>n(a).http_method=s),placeholder:"请输入请求方法"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:24},{default:l(()=>[e(i,{label:"权限描述",prop:"description"},{default:l(()=>[e(b,{modelValue:n(a).description,"onUpdate:modelValue":t[6]||(t[6]=s=>n(a).description=s),type:"textarea",placeholder:"请输入权限描述"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}});export{ge as default};