选煤厂安全管理系统前端代码
houzhongjian
2024-11-25 37b2044f04a09e89f82f8484279b5f06b7194481
1
import{d as X,z as Y,J as Z,Q as $,r as u,A as j,b as D,a1 as G,o as r,c as T,k as a,B as e,a as o,a2 as H,F as A,i as aa,a3 as ea,N as E,g as m,O as n,P as _,h as la,aF as oa,dI as F,a7 as ta,S as sa,$ as ra,R as na,U as pa,V as ia,W as ua,X as da,Y as ma,Z as ca}from"./index-BP6bNRoi.js";import{_ as fa}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{_ as _a}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{h as wa}from"./tree-BBZY150N.js";import{d as ya,e as va}from"./index-Abw9tEaW.js";import{_ as ha}from"./AppMenuForm.vue_vue_type_script_setup_true_lang-DISWSUcv.js";import"./color-DXkOL5Tu.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./Tooltip.vue_vue_type_script_setup_true_lang-DU3-PeCc.js";import"./index-BZESAUPP.js";import"./el-tree-select-pYALMRc9.js";import"./constants-CuOBQ73z.js";const ka=X({name:"SystemAppMenu",__name:"index",setup(ba){const{wsCache:S}=Y(),{t:N}=Z(),w=$(),y=u(!0),O=u([]),p=j({name:void 0,status:void 0}),R=u(),v=u(!1),h=u(!0),c=async()=>{y.value=!0;try{const f=await ya(p);O.value=wa(f)}finally{y.value=!1}},k=()=>{c()},L=()=>{R.value.resetFields(),k()},U=u(),V=(f,i,b)=>{U.value.open(f,i,b)},P=()=>{h.value=!1,v.value=!v.value,oa(()=>{h.value=!0})},q=async()=>{try{await w.confirm("\u5373\u5C06\u66F4\u65B0\u7F13\u5B58\u5237\u65B0\u6D4F\u89C8\u5668\uFF01","\u5237\u65B0\u83DC\u5355\u7F13\u5B58"),S.delete(F.USER),S.delete(F.ROLE_ROUTERS),location.reload()}catch{}};return D(()=>{c()}),(f,i)=>{const b=ta,C=sa,z=ra,B=na,d=pa,s=ia,I=ua,g=_a,t=da,J=fa,K=ma,x=G("hasPermi"),Q=ca;return r(),T(A,null,[a(g,null,{default:e(()=>[a(I,{ref_key:"queryFormRef",ref:R,inline:!0,model:o(p),class:"-mb-15px","label-width":"68px"},{default:e(()=>[a(C,{label:"\u83DC\u5355\u540D\u79F0",prop:"name"},{default:e(()=>[a(b,{modelValue:o(p).name,"onUpdate:modelValue":i[0]||(i[0]=l=>o(p).name=l),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0",onKeyup:H(k,["enter"])},null,8,["modelValue"])]),_:1}),a(C,{label:"\u72B6\u6001",prop:"status"},{default:e(()=>[a(B,{modelValue:o(p).status,"onUpdate:modelValue":i[1]||(i[1]=l=>o(p).status=l),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u83DC\u5355\u72B6\u6001"},{default:e(()=>[(r(!0),T(A,null,aa(o(ea)(o(E).COMMON_STATUS),l=>(r(),m(z,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(C,null,{default:e(()=>[a(s,{onClick:k},{default:e(()=>[a(d,{class:"mr-5px",icon:"ep:search"}),n(" \u641C\u7D22 ")]),_:1}),a(s,{onClick:L},{default:e(()=>[a(d,{class:"mr-5px",icon:"ep:refresh"}),n(" \u91CD\u7F6E ")]),_:1}),a(s,{plain:"",type:"danger",onClick:P},{default:e(()=>[a(d,{class:"mr-5px",icon:"ep:sort"}),n(" \u5C55\u5F00/\u6298\u53E0 ")]),_:1}),a(s,{plain:"",onClick:q},{default:e(()=>[a(d,{class:"mr-5px",icon:"ep:refresh"}),n(" \u5237\u65B0\u83DC\u5355\u7F13\u5B58 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(g,null,{default:e(()=>[o(h)?_((r(),m(K,{key:0,data:o(O),"default-expand-all":o(v),"row-key":"id"},{default:e(()=>[a(t,{"show-overflow-tooltip":!0,label:"\u83DC\u5355\u540D\u79F0",prop:"name",width:"250"}),a(t,{align:"center",label:"\u56FE\u6807",prop:"icon",width:"100"},{default:e(l=>[a(d,{icon:l.row.icon},null,8,["icon"])]),_:1}),a(t,{label:"\u6392\u5E8F",prop:"sort",width:"60"}),a(t,{"show-overflow-tooltip":!0,label:"\u6743\u9650\u6807\u8BC6",prop:"permission"}),a(t,{"show-overflow-tooltip":!0,label:"\u7EC4\u4EF6\u8DEF\u5F84",prop:"component"}),a(t,{"show-overflow-tooltip":!0,label:"\u7EC4\u4EF6\u540D\u79F0",prop:"componentName"}),a(t,{label:"\u72B6\u6001",prop:"status",width:"80"},{default:e(l=>[a(J,{type:o(E).COMMON_STATUS,value:l.row.status},null,8,["type","value"])]),_:1}),a(t,{align:"center",label:"\u64CD\u4F5C"},{default:e(l=>[_((r(),m(s,{link:"",type:"primary",onClick:M=>V("update",l.row.id)},{default:e(()=>[n(" \u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[x,["system:app-menu:update"]]]),_((r(),m(s,{link:"",type:"primary",onClick:M=>V("create",void 0,l.row.id)},{default:e(()=>[n(" \u65B0\u589E ")]),_:2},1032,["onClick"])),[[x,["system:app-menu:create"]]]),_((r(),m(s,{link:"",type:"danger",onClick:M=>(async W=>{try{await w.delConfirm(),await va(W),w.success(N("common.delSuccess")),await c()}catch{}})(l.row.id)},{default:e(()=>[n(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[x,["system:app-menu:delete"]]])]),_:1})]),_:1},8,["data","default-expand-all"])),[[Q,o(y)]]):la("",!0)]),_:1}),a(ha,{ref_key:"formRef",ref:U,onSuccess:c},null,512)],64)}}});export{ka as default};