test_lgq/niucloud/public/admin/assets/site_menu-53b6eb4a.js
2024-01-24 17:36:08 +08:00

2 lines
6.0 KiB
JavaScript

import{d as z,O as I,r as B,n as j,h as s,c as d,e as n,w as l,a as h,i as r,t as i,u as t,N as e,y as M,I as u,B as c,a8 as F,E as L,ah as O,aw as P,aj as R,aD as S,aE as U,$ as q,a0 as A}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css */import{_ as G}from"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */import{a as H,d as J}from"./sys-8ead7f22.js";import{_ as K}from"./edit-menu.vue_vue_type_script_setup_true_lang-38bd25dd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-2d277c91.js";import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";import"./attachment-c69dd9fd.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./tools-123d2a10.js";const Q={class:"main-container"},W={class:"flex justify-between items-center mb-[20px]"},X=h("span",{class:"text-[20px]"},null,-1),Y={key:0},Z={key:1},ee={key:2},te={key:0},ae={key:1},le={key:2},Ue=z({__name:"site_menu",setup(ne){I();const v=B("system"),m=j({loading:!0,system:[],application:[]}),g=()=>{m.loading=!0,H("site").then(({data:_})=>{m.loading=!1;const y=[],p=[];_.forEach(o=>{o.addon==""?y.push(o):p.push(o)}),m.system=y,m.application=p}).catch(()=>{})};g();const f=B(null),N=()=>{f.value.setFormData({app_type:"site"}),f.value.showDialog=!0},w=_=>{f.value.setFormData(_),f.value.showDialog=!0},T=_=>{F.confirm(e("menuDeleteTips"),e("warning"),{confirmButtonText:e("confirm"),cancelButtonText:e("cancel"),type:"warning"}).then(()=>{J("site",_).then(y=>{g()}).catch(()=>{})})};return(_,y)=>{const p=L,o=O,x=G,b=P,D=R,C=S,V=U,$=q,E=A;return s(),d("div",Q,[n($,{class:"box-card !border-none",shadow:"never"},{default:l(()=>[h("div",W,[X,n(p,{type:"primary",class:"w-[100px]",onClick:N},{default:l(()=>[r(i(t(e)("addMenu")),1)]),_:1})]),n(V,{modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=a=>v.value=a)},{default:l(()=>[n(C,{label:t(e)("system"),name:"system"},{default:l(()=>[M((s(),u(D,{data:m.system,"row-key":"menu_key",size:"large"},{empty:l(()=>[h("span",null,i(m.loading?"":t(e)("emptyData")),1)]),default:l(()=>[n(o,{prop:"menu_name","show-overflow-tooltip":!0,label:t(e)("menuName"),"min-width":"150"},null,8,["label"]),n(o,{label:t(e)("icon"),width:"100",align:"center"},{default:l(({row:a})=>[a.icon?(s(),u(x,{key:0,name:a.icon,size:"18px"},null,8,["name"])):c("",!0)]),_:1},8,["label"]),n(o,{label:t(e)("menuType"),width:"80"},{default:l(({row:a})=>[a.menu_type==0?(s(),d("div",Y,i(t(e)("menuTypeDir")),1)):a.menu_type==1?(s(),d("div",Z,i(t(e)("menuTypeMenu")),1)):a.menu_type==2?(s(),d("div",ee,i(t(e)("menuTypeButton")),1)):c("",!0)]),_:1},8,["label"]),n(o,{prop:"api_url",label:t(e)("authId"),"min-width":"150",align:"center"},null,8,["label"]),n(o,{label:t(e)("status"),"min-width":"120",align:"center"},{default:l(({row:a})=>[a.status==1?(s(),u(b,{key:0,class:"ml-2",type:"success"},{default:l(()=>[r(i(t(e)("statusNormal")),1)]),_:1})):c("",!0),a.status==0?(s(),u(b,{key:1,class:"ml-2",type:"error"},{default:l(()=>[r(i(t(e)("statusDeactivate")),1)]),_:1})):c("",!0)]),_:1},8,["label"]),n(o,{prop:"sort",label:t(e)("sort"),"min-width":"100"},null,8,["label"]),n(o,{label:t(e)("operation"),align:"right",fixed:"right",width:"130"},{default:l(({row:a})=>[n(p,{type:"primary",link:"",onClick:k=>w(a)},{default:l(()=>[r(i(t(e)("edit")),1)]),_:2},1032,["onClick"]),n(p,{type:"primary",link:"",onClick:k=>T(a.menu_key)},{default:l(()=>[r(i(t(e)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[E,m.loading]])]),_:1},8,["label"]),n(C,{label:t(e)("application"),name:"application"},{default:l(()=>[M((s(),u(D,{data:m.application,"row-key":"menu_key",size:"large"},{empty:l(()=>[h("span",null,i(m.loading?"":t(e)("emptyData")),1)]),default:l(()=>[n(o,{prop:"menu_name","show-overflow-tooltip":!0,label:t(e)("menuName"),"min-width":"150"},null,8,["label"]),n(o,{label:t(e)("icon"),width:"100",align:"center"},{default:l(({row:a})=>[a.icon?(s(),u(x,{key:0,name:a.icon,size:"18px"},null,8,["name"])):c("",!0)]),_:1},8,["label"]),n(o,{label:t(e)("menuType"),width:"80"},{default:l(({row:a})=>[a.menu_type==0?(s(),d("div",te,i(t(e)("menuTypeDir")),1)):a.menu_type==1?(s(),d("div",ae,i(t(e)("menuTypeMenu")),1)):a.menu_type==2?(s(),d("div",le,i(t(e)("menuTypeButton")),1)):c("",!0)]),_:1},8,["label"]),n(o,{prop:"api_url",label:t(e)("authId"),"min-width":"150",align:"center"},null,8,["label"]),n(o,{label:t(e)("status"),"min-width":"120",align:"center"},{default:l(({row:a})=>[a.status==1?(s(),u(b,{key:0,class:"ml-2",type:"success"},{default:l(()=>[r(i(t(e)("statusNormal")),1)]),_:1})):c("",!0),a.status==0?(s(),u(b,{key:1,class:"ml-2",type:"error"},{default:l(()=>[r(i(t(e)("statusDeactivate")),1)]),_:1})):c("",!0)]),_:1},8,["label"]),n(o,{prop:"sort",label:t(e)("sort"),"min-width":"100"},null,8,["label"]),n(o,{label:t(e)("operation"),align:"right",fixed:"right",width:"130"},{default:l(({row:a})=>[n(p,{type:"primary",link:"",onClick:k=>w(a)},{default:l(()=>[r(i(t(e)("edit")),1)]),_:2},1032,["onClick"]),n(p,{type:"primary",link:"",onClick:k=>T(a.menu_key)},{default:l(()=>[r(i(t(e)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[E,m.loading]])]),_:1},8,["label"])]),_:1},8,["modelValue"]),n(K,{ref_key:"editMenuDialog",ref:f,"menu-tree":m.data,onComplete:g},null,8,["menu-tree"])]),_:1})])}}});export{Ue as default};