import{C as S}from"./client-803b3680.js";import{b as N}from"./vue-router-c1461dfc.js";import{E as V,a as d}from"./element-plus-91d6d961.js";import{H as g,_ as B,i as T,ah as i,o as U,c as E,V as t,P as r,a as _,T as m,U as M}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 P={class:"mb15"},H=["href"],R=g({name:"clientArticleManager"}),Dt=g({...R,setup($){const c=N(),u=S(),e=B({tableData:{data:[],total:0,loading:!1,param:{pageNum:1,pageSize:10,title:""}}}),n=()=>{u.getArticleList(e.tableData.param).then(o=>{e.tableData.data=o.data.records,e.tableData.total=o.data.total}).catch(()=>{})},b=o=>{V.confirm("此操作将永久删除文章, 是否继续?","提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}).then(()=>{u.delArticle(o.id).then(()=>{d.success("删除成功"),n()}).catch(l=>{d.error(l.message)})}).catch(()=>{})},f=o=>{c.push({path:"/article/write",query:{id:o.id}})},h=o=>{e.tableData.param.pageSize=o,n()},w=o=>{e.tableData.param.pageNum=o,n()},C=()=>{c.push({path:"/article/write"})};return T(()=>{n()}),(o,l)=>{const D=i("el-input"),s=i("el-button"),v=i("ele-Plus"),z=i("el-icon"),p=i("el-table-column"),y=i("el-table"),x=i("el-pagination"),k=i("el-card");return U(),E("div",null,[t(k,{shadow:"hover"},{default:r(()=>[_("div",P,[t(D,{size:"default",modelValue:e.tableData.param.title,"onUpdate:modelValue":l[0]||(l[0]=a=>e.tableData.param.title=a),placeholder:"请输入文章标题","prefix-icon":"el-icon-search",style:{"max-width":"180px"},class:"ml10"},null,8,["modelValue"]),t(s,{type:"primary",class:"ml10",size:"default",onClick:n},{default:r(()=>[m("查询")]),_:1}),t(s,{size:"default",onClick:l[1]||(l[1]=a=>C()),type:"primary"},{default:r(()=>[t(z,null,{default:r(()=>[t(v)]),_:1}),m("新建文章")]),_:1})]),t(y,{data:e.tableData.data,stripe:"",style:{width:"100%"}},{default:r(()=>[t(p,{prop:"id",label:"ID","show-overflow-tooltip":"",width:"60"}),t(p,{prop:"title",label:"标题","show-overflow-tooltip":""},{default:r(a=>[_("a",{href:a.row.url,target:"_blank"},M(a.row.title),9,H)]),_:1}),t(p,{prop:"author",label:"作者","show-overflow-tooltip":""}),t(p,{prop:"status",label:"状态","show-overflow-tooltip":""}),t(p,{prop:"viewCount",label:"浏览次数","show-overflow-tooltip":""}),t(p,{prop:"created",label:"创建时间","show-overflow-tooltip":""}),t(p,{prop:"path",label:"操作",width:"160"},{default:r(a=>[t(s,{size:"small",text:"",type:"primary",onClick:A=>f(a.row)},{default:r(()=>[m("修改")]),_:2},1032,["onClick"]),t(s,{size:"small",text:"",type:"primary",onClick:A=>b(a.row)},{default:r(()=>[m("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),t(x,{onSizeChange:h,onCurrentChange:w,class:"mt15","pager-count":5,"page-sizes":[10,20,30],"current-page":e.tableData.param.pageNum,"onUpdate:currentPage":l[2]||(l[2]=a=>e.tableData.param.pageNum=a),background:"","page-size":e.tableData.param.pageSize,"onUpdate:pageSize":l[3]||(l[3]=a=>e.tableData.param.pageSize=a),layout:"total, sizes, prev, pager, next, jumper",total:e.tableData.total},null,8,["current-page","page-size","total"])]),_:1})])}}});export{Dt as default};
