index-53d0222c.js 5.8 KB

123456789
  1. /**
  2. * 由 Fantastic-admin 提供技术支持
  3. * Powered by Fantastic-admin
  4. * Gitee https://gitee.com/hooray/fantastic-admin
  5. * Github https://github.com/hooray/fantastic-admin
  6. */
  7. import{_ as X}from"./index-ce0821b6.js";import{_ as Y}from"./index-da9247ec.js";import{_ as Z}from"./index-7a6bdd94.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_name_SvgIcon_lang-9ad2d3e0.js";import{a as I}from"./runtime-dom.esm-bundler-e65f1c43.js";import{_ as te,g as oe,d as ae}from"./index-ce63bcde.js";import{_ as ne,g as le,d as se,u as ie}from"./index-50f54fbe.js";import{K as w}from"./index-cd68550b.js";import{aU as C}from"./index-5cddd228.js";import{j as de,J as ce,r as f,o as re,a3 as d,ad as ue,k as g,l as M,E as e,y as o,C as h,m as p,u as m,x,B as A,D as _e,z as pe,I as me}from"./runtime-core.esm-bundler-5fc1c360.js";import{b as T}from"./route-block-83d24a4e.js";import{_ as fe}from"./_plugin-vue_export-helper-c27b6911.js";import"./iconify-3d8b277a.js";import"./menu-2c9c5182.js";import"./settings-be8974ad.js";import"./pinia-7162f4ce.js";import"./_MapCache-1b613190.js";import"./vue-router-8a13d09b.js";import"./index-c228ae8f.js";import"./iframe-10768394.js";const ge={class:"absolute-container"},he={class:"page-main"},be={class:"custom-tree-node"},ye=["title"],ve={class:"text"},Ie={key:0,class:"actions"},ke={class:"container"},E=de({__name:"index",setup(we){const a=ce({loading:!1,keywords:"",Modules:[],curModuleId:0,objectList:[],dialogState:1,search:{keywords:""}}),k=f(),b=f(),_=async()=>{const t=a.curModuleId;if(t>0){a.loading=!0;const{data:n}=await le({modId:t});a.objectList=n,a.loading=!1}},y=async()=>{const{data:t}=await oe(""),n=[];t.forEach(l=>n.push({label:l.modTitle,modId:l.modId,isLeaf:!0})),a.Modules=[{label:"API模块列表",isLeaf:!1,modId:-1,children:n}],t&&t.length>0&&(a.curModuleId=t[0].modId,me(()=>{k.value.setCurrentKey(t[0].modId)}),await _())},L=()=>{b.value.showAddModule()},V=t=>{const n=t.ModuleId;b.value.showEditModule(n)},B=t=>{w.confirm(`确认删除「${t.modTitle}」吗?`,"确认信息").then(async()=>{await ae(t.modId),await y(),C.success({message:"删除成功",center:!0})})},D=t=>{t.isLeaf&&(a.curModuleId=t.modId,_())},$=f(),v=f(),R=()=>{_()},S=()=>{v.value.showAddApi(a.curModuleId)},z=t=>{const n=t.apiId,l=t.modId;v.value.showEditApi(l,n)},j=t=>{const{apiId:n,apiTitle:l}=t;w.confirm(`确认删除「${l}」吗?`,"确认信息").then(async()=>{await se(n),await _(),C.success({message:"删除成功",center:!0})})};async function N(t){await ie(t.modId,t.apiId,t.status)}return re(()=>{y()}),(t,n)=>{const l=ee,r=d("el-icon"),c=d("el-button"),P=Z,U=d("el-button-group"),K=d("ElTree"),J=d("el-scrollbar"),q=d("el-input"),F=Y,u=d("el-table-column"),G=d("el-switch"),H=d("el-table"),O=X,Q=ue("loading");return g(),M("div",ge,[e(P,{title:"API接口"},{right:o(()=>[e(c,{plain:"",onClick:L},{icon:o(()=>[e(r,null,{default:o(()=>[e(l,{name:"i-ep:plus"})]),_:1})]),default:o(()=>[h(" 新增API模块 ")]),_:1})]),_:1}),p("div",he,[e(O,{"left-side-width":"300px","hide-left-side-toggle":""},{leftSide:o(()=>[e(J,{class:"tree"},{default:o(()=>[e(K,{ref_key:"leftTreeRef",ref:k,data:m(a).Modules,"default-expand-all":"","node-key":"modId",onNodeClick:D},{default:o(({node:s,data:i})=>[p("div",be,[p("div",{class:"label",title:s.label},[i.isLeaf?(g(),x(r,{key:0,size:"16px",style:{"margin-right":"5px"}},{default:o(()=>[e(l,{name:"uim:box"})]),_:1})):A("",!0),p("div",ve,_e(i.label),1)],8,ye),i.isLeaf?(g(),M("div",Ie,[e(U,null,{default:o(()=>[e(c,{type:"info",plain:"",size:"small",onClick:I(W=>V(i),["stop"])},{icon:o(()=>[e(r,null,{default:o(()=>[e(l,{name:"i-ep:edit"})]),_:1})]),_:2},1032,["onClick"]),e(c,{type:"danger",plain:"",size:"small",onClick:I(W=>B(i),["stop"])},{icon:o(()=>[e(r,null,{default:o(()=>[e(l,{name:"i-ep:delete"})]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)])):A("",!0)])]),_:1},8,["data"])]),_:1})]),default:o(()=>[p("div",ke,[e(F,null,{right:o(()=>[e(q,{modelValue:m(a).search.keywords,"onUpdate:modelValue":n[0]||(n[0]=s=>m(a).search.keywords=s),placeholder:"请输入名称,支持模糊查询",style:{"padding-right":"10px"},clearable:""},null,8,["modelValue"]),e(c,{type:"primary",onClick:R},{icon:o(()=>[e(r,null,{default:o(()=>[e(l,{name:"i-ep:search"})]),_:1})]),_:1}),e(c,{plain:"",size:"default",onClick:I(S,["stop"])},{icon:o(()=>[e(r,null,{default:o(()=>[e(l,{name:"i-ep:plus"})]),_:1})]),default:o(()=>[h(" 新增API ")]),_:1},8,["onClick"])]),_:1}),pe((g(),x(H,{ref_key:"objectTableRef",ref:$,class:"list-table",data:m(a).objectList,border:"",stripe:"","highlight-current-row":"",height:"100%"},{default:o(()=>[e(u,{type:"index",label:"序号","header-align":"center",align:"center",width:"70"}),e(u,{prop:"apiTitle",label:"名称","header-align":"center",align:"center",width:"200"}),e(u,{prop:"apiCode",label:"代码","header-align":"center",align:"center",width:"150"}),e(u,{prop:"status",label:"status","header-align":"center",align:"center",width:"150"},{default:o(({row:s})=>[e(G,{modelValue:s.status,"onUpdate:modelValue":i=>s.status=i,"active-value":0,"inactive-value":1,"inline-prompt":"","active-text":"启用","inactive-text":"禁用",onChange:i=>N(s)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(u,{prop:"apiDesc",label:"说明","header-align":"center",align:"left"}),e(u,{label:"操作","header-align":"center",align:"center",width:"200"},{default:o(s=>[e(c,{type:"primary",size:"small",plain:"",onClick:i=>z(s.row)},{default:o(()=>[h(" 编辑 ")]),_:2},1032,["onClick"]),e(c,{type:"danger",size:"small",plain:"",onClick:i=>j(s.row)},{default:o(()=>[h(" 删除 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[Q,m(a).loading]])])]),_:1})]),e(te,{ref_key:"ModuleRef",ref:b,onSuccess:y},null,512),e(ne,{ref_key:"apiRef",ref:v,onSuccess:_},null,512)])}}});typeof T=="function"&&T(E);const qe=fe(E,[["__scopeId","data-v-bc5f78ad"]]);export{qe as default};