You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.81903933.js 3.0KB

3 maanden geleden
1
  1. import F from"./menuDialog.26baff0a.js";import{g as L,m as M}from"./menuManage.0974a399.js";import{d as E,b as _,r as b,o as I,c as s,e as R,f as S,h as a,i as l,j as g,g as p,F as W,q}from"./index.55251523.js";const A={class:"flex justify-between items-center"},G=["onClick"],U=["onClick"],H=E({name:"menuManage"}),Y=Object.assign(H,{setup(J){const{proxy:h}=q(),r=_({title:void 0}),C=_([{label:"\u83DC\u5355\u540D\u79F0",key:"title",prop:"title",minWidth:"200"},{label:"\u6392\u5E8F",key:"sort",prop:"sort"},{label:"\u56FE\u6807",key:"icon",prop:"icon"},{label:"\u9875\u9762\u8DEF\u5F84",key:"path",prop:"path",minWidth:"200"},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createOn",prop:"createOn",width:"180"},{label:"\u64CD\u4F5C",slot:"action",width:"120",fixed:"right"}]),c=b(),D=b(0),u=b([]),d=async(n=c.value.pageParams)=>{const e=await L({...r});u.value=e.data},x=()=>{u.value=v(u.value,r.title)},v=(n,e)=>n.map(t=>(t&&t.children&&(t.children=v(t.children,e)),t)).filter(t=>{var o;return e===""||t.title.indexOf(e)>-1||((o=t.children)==null?void 0:o.length)>0}),V=()=>{r.title=void 0,c.value.pageParams.pageNumber=1,c.value.pageParams.pageSize=10,d()},i=_({visible:!1,rowData:void 0}),P=()=>{i.visible=!0,i.rowData=void 0},$=n=>{i.visible=!0,i.rowData=n},w=n=>{const e=[];return n.forEach(t=>{var o;(o=t.children)!=null&&o.length&&w(t.children),e.push(t.id)}),e},B=n=>{const e=w([n]);h.$messageBox.confirm("\u662F\u5426\u5220\u9664\u8BE5\u6570\u636E?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await M(e),h.$message.success("\u5220\u9664\u6210\u529F\uFF01"),d()})},N=n=>{i.visible=!1,n&&d()};return I(()=>{d()}),(n,e)=>{const t=s("el-input"),o=s("el-form-item"),y=s("el-col"),f=s("el-button"),O=s("el-row"),T=s("el-form"),k=s("el-card"),j=s("table-list");return R(),S(W,null,[a(k,{shadow:"never",class:"search mb-16"},{default:l(()=>[a(T,{"label-suffix":":",model:r,size:"small"},{default:l(()=>[a(O,{gutter:16},{default:l(()=>[a(y,{span:8},{default:l(()=>[a(o,{label:"\u83DC\u5355\u540D\u79F0"},{default:l(()=>[a(t,{modelValue:r.title,"onUpdate:modelValue":e[0]||(e[0]=m=>r.title=m),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),a(y,{span:16},{default:l(()=>[a(o,{class:"btn"},{default:l(()=>[a(f,{type:"primary",onClick:x},{default:l(()=>e[1]||(e[1]=[g("\u67E5\u8BE2")])),_:1}),a(f,{onClick:V},{default:l(()=>e[2]||(e[2]=[g("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(k,{shadow:"never"},{header:l(()=>[p("div",A,[e[4]||(e[4]=p("span",null,"\u83DC\u5355\u5217\u8868",-1)),a(f,{type:"primary",icon:"Plus",size:"small",onClick:P},{default:l(()=>e[3]||(e[3]=[g(" \u65B0\u589E\u83DC\u5355 ")])),_:1})])]),default:l(()=>[a(j,{ref_key:"tableListRef",ref:c,column:C,data:u.value,total:D.value,"row-key":"id",pagination:!1,onGetTableData:d},{action:l(({scope:m})=>[p("a",{class:"text-primary",onClick:z=>$(m.row)},"\u7F16\u8F91",8,G),p("a",{class:"text-danger",onClick:z=>B(m.row)},"\u5220\u9664",8,U)]),_:1},8,["column","data","total"])]),_:1}),a(F,{visible:i.visible,data:i.rowData,onClose:N},null,8,["visible","data"])],64)}}});export{Y as default};