import{P as N}from"./index-1779eb5c.js";import{b as B}from"./vue-router-c1461dfc.js";import{E as T,a as _}from"./element-plus-91d6d961.js";import{H as f,_ as E,i as M,ah as r,o as U,c as V,V as t,P as l,a as g,T as m,U as H}from"./@vue-6dabbe94.js";import"./index-a6ee13d3.js";import"./pinia-b6f74250.js";import"./vue-i18n-b3581196.js";import"./@intlify-ea47d1db.js";import"./source-map-7d7e1c08.js";import"./vue-b1ba6f14.js";import"./js-cookie-edb2da2a.js";import"./@element-plus-64e6e14a.js";import"./nprogress-08a53ce8.js";import"./axios-4a70c6fc.js";import"./qs-c5b6dbf2.js";import"./side-channel-394f276c.js";import"./get-intrinsic-bd2830fd.js";import"./has-symbols-e8f3ca0e.js";import"./has-proto-f7d0b240.js";import"./function-bind-22e7ee79.js";import"./has-26d28e02.js";import"./call-bind-e5c1c8b0.js";import"./object-inspect-8fd4bade.js";import"./mitt-f7ef348c.js";import"./vue-grid-layout-ec2a62c3.js";import"./lodash-es-9851428c.js";import"./@vueuse-e129c873.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-f6fdf7b4.js";import"./async-validator-dee29e8b.js";import"./memoize-one-297ddbcb.js";import"./escape-html-b8998962.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-880a26aa.js";const R={class:"mb15"},$=["href"],A=f({name:"pageManager"}),Dt=f({...A,setup(j){const c=N(),e=E({tableData:{data:[],total:0,loading:!1,param:{pageNum:1,pageSize:10}}}),u=B(),i=()=>{c.getPageList(e.tableData.param).then(a=>{e.tableData.data=a.data.records,e.tableData.total=a.data.total}).catch(()=>{})},h=a=>{T.confirm("此操作将永久删除页面, 是否继续?","提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}).then(()=>{c.delPage(a.id).then(()=>{_.success("删除成功"),i()}).catch(p=>{_.error(p.message)})}).catch(()=>{})},b=a=>{u.push({path:"/page/write",query:{id:a.id}})},w=a=>{e.tableData.param.pageSize=a,i()},v=a=>{e.tableData.param.pageNum=a,i()},z=()=>{u.push({path:"/page/write"})};return M(()=>{i()}),(a,p)=>{const D=r("el-input"),C=r("ele-Search"),d=r("el-icon"),s=r("el-button"),y=r("ele-Plus"),n=r("el-table-column"),x=r("el-table"),S=r("el-pagination"),k=r("el-card");return U(),V("div",null,[t(k,{shadow:"hover"},{default:l(()=>[g("div",R,[t(D,{size:"default",placeholder:"请输入标题","prefix-icon":"el-icon-search",style:{"max-width":"180px"},class:"ml10"}),t(s,{size:"default",type:"primary",class:"ml10"},{default:l(()=>[t(d,null,{default:l(()=>[t(C)]),_:1}),m("查询")]),_:1}),t(s,{size:"default",onClick:p[0]||(p[0]=o=>z()),type:"primary"},{default:l(()=>[t(d,null,{default:l(()=>[t(y)]),_:1}),m("新建页面")]),_:1})]),t(x,{data:e.tableData.data,stripe:"",style:{width:"100%"}},{default:l(()=>[t(n,{prop:"id",label:"ID","show-overflow-tooltip":"",width:"60"}),t(n,{prop:"title",label:"标题","show-overflow-tooltip":""},{default:l(o=>[g("a",{href:o.row.url,target:"_blank"},H(o.row.title),9,$)]),_:1}),t(n,{prop:"author",label:"作者","show-overflow-tooltip":""}),t(n,{prop:"status",label:"状态","show-overflow-tooltip":""}),t(n,{prop:"viewCount",label:"浏览次数","show-overflow-tooltip":""}),t(n,{prop:"created",label:"创建时间","show-overflow-tooltip":""}),t(n,{prop:"path",label:"操作",width:"180"},{default:l(o=>[t(s,{size:"small",text:"",type:"primary",onClick:P=>b(o.row)},{default:l(()=>[m("修改")]),_:2},1032,["onClick"]),t(s,{size:"small",text:"",type:"primary",onClick:P=>h(o.row)},{default:l(()=>[m("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),t(S,{onSizeChange:w,onCurrentChange:v,class:"mt15","pager-count":5,"page-sizes":[10,20,30],"current-page":e.tableData.param.pageNum,"onUpdate:currentPage":p[1]||(p[1]=o=>e.tableData.param.pageNum=o),background:"","page-size":e.tableData.param.pageSize,"onUpdate:pageSize":p[2]||(p[2]=o=>e.tableData.param.pageSize=o),layout:"total, sizes, prev, pager, next, jumper",total:e.tableData.total},null,8,["current-page","page-size","total"])]),_:1})])}}});export{Dt as default};
