mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
2 lines
6.4 KiB
JavaScript
2 lines
6.4 KiB
JavaScript
var Q=Object.defineProperty;var w=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var F=(o,a,e)=>a in o?Q(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e,D=(o,a)=>{for(var e in a||(a={}))j.call(a,e)&&F(o,e,a[e]);if(w)for(var e of w(a))G.call(a,e)&&F(o,e,a[e]);return o};import{r as R,i as T,o as U,j as x,t as I,k as d,a4 as B,l as z,y as t,z as n,F as L,E as W,b as X,C as g,D as b,X as H,W as J,P as q,w as h,s as c,x as Y,K as Z,v as $,m as ee}from"./vendor.14d7a511.js";import{l as te,d as oe}from"./api.833823b3.js";import ae from"./editModule.53da5e28.js";import{_ as le}from"./index.1f7143d6.js";const ne={name:"index",components:{EditModule:ae},setup(){const{proxy:o}=L(),a=R(),e=T({loading:!0,ids:[],single:!0,multiple:!0,title:"",tableData:[],total:0,methodOptions:[],queryParams:{pageNum:1,pageSize:10,path:void 0,description:void 0,method:void 0,apiGroup:void 0}}),i=()=>{e.loading=!0,te(e.queryParams).then(l=>{e.tableData=l.data.data,e.total=l.data.total,e.loading=!1})},E=()=>{e.queryParams.path=void 0,e.queryParams.description=void 0,e.queryParams.method=void 0,e.queryParams.apiGroup=void 0,i()},v=l=>{l=[],e.title="\u6DFB\u52A0Api\u53C2\u6570",a.value.openDialog(l)},_=l=>{e.title="\u4FEE\u6539Api\u53C2\u6570",a.value.openDialog(l)},s=l=>{const p=l.id||e.ids;W({message:'\u662F\u5426\u786E\u8BA4\u5220\u9664\u914D\u7F6E\u53C2\u6570\u7F16\u53F7\u4E3A"'+p+'"\u7684\u6570\u636E\u9879?',title:"\u8B66\u544A",showCancelButton:!0,confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(function(){return oe(p).then(()=>{i(),X.success("\u5220\u9664\u6210\u529F")})})},C=l=>{e.ids=l.map(p=>p.id),e.single=l.length!=1,e.multiple=!l.length},f=l=>{e.queryParams.pageSize=l,i()},r=l=>{e.queryParams.pageNum=l,i()};return U(()=>{i(),o.getDicts("sys_method_api").then(l=>{e.methodOptions=l.data}),o.mittBus.on("onEditApiModule",l=>{i()})}),x(()=>{o.mittBus.off("onEditApiModule")}),D({editModuleRef:a,handleSelectionChange:C,handleSizeChange:f,handleCurrentChange:r,handleQuery:i,resetQuery:E,onOpenAddModule:v,onOpenEditModule:_,onTabelRowDel:s},I(e))}},ie={class:"app-container"},ue=c("\u641C\u7D22"),de=c("\u91CD\u7F6E"),re=c("\u65B0\u589E"),se=c("\u5220\u9664"),pe=c("\u4FEE\u6539"),me=c("\u5220\u9664");function ce(o,a,e,i,E,v){const _=d("el-input"),s=d("el-form-item"),C=d("el-option"),f=d("el-select"),r=d("el-button"),l=d("el-form"),p=d("el-col"),P=d("el-row"),m=d("el-table-column"),k=d("el-tag"),A=d("el-table"),V=d("el-divider"),M=d("el-pagination"),S=d("el-card"),K=d("EditModule"),y=B("auth"),N=B("loading");return g(),z("div",ie,[t(S,{shadow:"always"},{default:n(()=>[t(l,{model:o.queryParams,ref:"queryForm",inline:!0,"label-width":"68px"},{default:n(()=>[t(s,{label:"\u8DEF\u5F84",prop:"path"},{default:n(()=>[t(_,{placeholder:"Api\u8DEF\u5F84\u6A21\u7CCA\u67E5\u8BE2",clearable:"",size:"small",onKeyup:b(i.handleQuery,["enter"]),style:{width:"240px"},modelValue:o.queryParams.path,"onUpdate:modelValue":a[0]||(a[0]=u=>o.queryParams.path=u)},null,8,["onKeyup","modelValue"])]),_:1}),t(s,{label:"\u63CF\u8FF0",prop:"description"},{default:n(()=>[t(_,{placeholder:"\u63CF\u8FF0\u6A21\u7CCA\u67E5\u8BE2",clearable:"",size:"small",onKeyup:b(i.handleQuery,["enter"]),style:{width:"240px"},modelValue:o.queryParams.description,"onUpdate:modelValue":a[1]||(a[1]=u=>o.queryParams.description=u)},null,8,["onKeyup","modelValue"])]),_:1}),t(s,{label:"\u5206\u7EC4",prop:"apiGroup"},{default:n(()=>[t(_,{placeholder:"\u5206\u7EC4\u67E5\u8BE2",clearable:"",size:"small",onKeyup:b(i.handleQuery,["enter"]),style:{width:"240px"},modelValue:o.queryParams.apiGroup,"onUpdate:modelValue":a[2]||(a[2]=u=>o.queryParams.apiGroup=u)},null,8,["onKeyup","modelValue"])]),_:1}),t(s,{label:"\u65B9\u6CD5",prop:"method"},{default:n(()=>[t(f,{modelValue:o.queryParams.method,"onUpdate:modelValue":a[3]||(a[3]=u=>o.queryParams.method=u),placeholder:"\u65B9\u6CD5",clearable:"",size:"small",style:{width:"240px"}},{default:n(()=>[(g(!0),z(H,null,J(o.methodOptions,u=>(g(),q(C,{key:u.dictValue,label:u.dictLabel,value:u.dictValue},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(s,null,{default:n(()=>[t(r,{type:"primary",icon:"el-icon-search",size:"mini",onClick:i.handleQuery},{default:n(()=>[ue]),_:1},8,["onClick"]),t(r,{icon:"el-icon-refresh",size:"mini",onClick:i.resetQuery},{default:n(()=>[de]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),t(P,{gutter:10,class:"mb8"},{default:n(()=>[t(p,{span:1.5},{default:n(()=>[h(t(r,{type:"primary",plain:"",icon:"el-icon-plus",size:"mini",onClick:i.onOpenAddModule},{default:n(()=>[re]),_:1},8,["onClick"]),[[y,"system:api:add"]])]),_:1},8,["span"]),t(p,{span:1.5},{default:n(()=>[h(t(r,{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:o.multiple,onClick:i.onTabelRowDel},{default:n(()=>[se]),_:1},8,["disabled","onClick"]),[[y,"system:api:delete"]])]),_:1},8,["span"])]),_:1}),h(t(A,{data:o.tableData,onSelectionChange:i.handleSelectionChange},{default:n(()=>[t(m,{type:"selection",width:"55",align:"center"}),t(m,{label:"id",align:"center",prop:"id"}),t(m,{label:"\u8DEF\u5F84",align:"center",prop:"path","show-overflow-tooltip":!0}),t(m,{label:"\u5206\u7EC4",align:"center",prop:"apiGroup"}),t(m,{label:"\u7B80\u4ECB",align:"center",prop:"description"}),t(m,{label:"\u8BF7\u6C42",align:"center",prop:"method","show-overflow-tooltip":!0},{default:n(u=>[t(k,{type:"success"},{default:n(()=>[c(Y(u.row.method),1)]),_:2},1024)]),_:1}),t(m,{label:"\u64CD\u4F5C",align:"center",width:"200","class-name":"medium-padding fixed-width"},{default:n(u=>[h(t(r,{size:"mini",type:"text",icon:"el-icon-edit",onClick:O=>i.onOpenEditModule(u.row)},{default:n(()=>[pe]),_:2},1032,["onClick"]),[[y,"system:api:edit"]]),u.row.parentId!=0?h((g(),q(r,{key:0,size:"mini",type:"text",icon:"el-icon-delete",onClick:O=>i.onTabelRowDel(u.row)},{default:n(()=>[me]),_:2},1032,["onClick"])),[[y,"system:api:delete"]]):Z("",!0)]),_:1})]),_:1},8,["data","onSelectionChange"]),[[N,o.loading]]),h(ee("div",null,[t(V),t(M,{background:"",total:o.total,"current-page":o.queryParams.pageNum,"page-size":o.queryParams.pageSize,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:i.handleSizeChange,onCurrentChange:i.handleCurrentChange},null,8,["total","current-page","page-size","onSizeChange","onCurrentChange"])],512),[[$,o.total>0]])]),_:1}),t(K,{ref:"editModuleRef",title:o.title},null,8,["title"])])}var fe=le(ne,[["render",ce]]);export{fe as default};
|