import{u as e,a,G as l,o as t,e as n,f as s,g as r,w as i,H as d,c as o,I as u,J as c,r as g,L as p,h,t as m,p as b,i as f}from"./vendor.08ecc2ea.js";import{g as w,d as v,a as _}from"./slider.4df0f081.js";import{_ as C}from"./index.034a9ca9.js";import"./request.64c76035.js";const y={name:"slider-list",setup(){const t=e(),n=a({title:"",page:1,pageSize:10}),s=l(!0),r=l([]),i=l(0),d=()=>{w(n).then((e=>{r.value=e.data.data,i.value=e.data.total||0,s.value=!1}))};d();return{query:n,loading:s,tableData:r,pageTotal:i,handleEdit:(e,a)=>{t.push({path:"/slider/add",query:{id:a.id}})},handleSearch:()=>{s.value=!0,n.page=1,d()},handlePageChange:e=>{s.value=!0,n.page=e,d()},handleDisable:(e,l)=>{const t=a({id:l.id,status:l.status});v(t).then((a=>{200==a.status?u.success(a.msg):(r.value[e].status=!l.status,u.error(a.msg))}))},handleDelete:(e,l)=>{c.confirm("确定要删除吗？","提示",{type:"warning"}).then((()=>{const t=a({id:l.id});_(t).then((a=>{200==a.status?(u.success("删除成功"),r.value.splice(e,1)):u.error(a.msg)}))})).catch((()=>{u.success("删除失败")}))}}}},x={class:"crumbs"},k=(e=>(b("data-v-4c2d2ed3"),e=e(),f(),e))((()=>s("i",{class:"el-icon-lx-sort"},null,-1))),q=h(" 文档列表 "),D={class:"container"},V={class:"handle-box"},z=h("搜索"),j=h("编辑"),S=h("删除"),I={class:"pagination"};var T=C(y,[["render",function(e,a,l,u,c,b){const f=g("el-breadcrumb-item"),w=g("el-breadcrumb"),v=g("el-input"),_=g("el-button"),C=g("el-table-column"),y=g("el-image"),T=g("el-switch"),U=g("el-table"),$=g("el-pagination"),E=p("loading");return t(),n("div",null,[s("div",x,[r(w,{separator:"/"},{default:i((()=>[r(f,null,{default:i((()=>[k,q])),_:1})])),_:1})]),s("div",D,[s("div",V,[r(v,{modelValue:u.query.title,"onUpdate:modelValue":a[0]||(a[0]=e=>u.query.title=e),placeholder:"输入标题",class:"handle-input mr10",clearable:""},null,8,["modelValue"]),r(_,{type:"primary",icon:"el-icon-search",onClick:u.handleSearch},{default:i((()=>[z])),_:1},8,["onClick"])]),d((t(),o(U,{data:u.tableData,border:"",class:"table",ref:"multipleTable","header-cell-class-name":"table-header"},{default:i((()=>[r(C,{label:"ID",width:"80",align:"center"},{default:i((e=>[h(m(e.row.id),1)])),_:1}),r(C,{label:"标题",align:"center",width:"250"},{default:i((e=>[h(m(e.row.title),1)])),_:1}),r(C,{label:"图片(查看大图)",align:"center"},{default:i((e=>[r(y,{class:"table-td-thumb",fit:"contain",lazy:"true",src:e.row.img_url,"preview-src-list":[e.row.img_url]},null,8,["src","preview-src-list"])])),_:1}),r(C,{label:"链接",align:"center",width:"200"},{default:i((e=>[h(m(e.row.url),1)])),_:1}),r(C,{label:"排序",align:"center",width:"100"},{default:i((e=>[h(m(e.row.sort),1)])),_:1}),r(C,{label:"状态",align:"center",width:"100"},{default:i((e=>[r(T,{"active-value":1,"inactive-value":0,modelValue:e.row.status,"onUpdate:modelValue":a=>e.row.status=a,onChange:a=>u.handleDisable(e.$index,e.row)},null,8,["modelValue","onUpdate:modelValue","onChange"])])),_:1}),r(C,{label:"更新时间",align:"center",width:"180"},{default:i((e=>[h(m(e.row.create_time||"--"),1)])),_:1}),r(C,{label:"操作",align:"center",width:"180"},{default:i((e=>[r(_,{type:"text",icon:"el-icon-edit",onClick:a=>u.handleEdit(e.$index,e.row)},{default:i((()=>[j])),_:2},1032,["onClick"]),r(_,{type:"text",icon:"el-icon-delete",onClick:a=>u.handleDelete(e.$index,e.row)},{default:i((()=>[S])),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])),[[E,u.loading]]),s("div",I,[r($,{background:"",layout:"total, prev, pager, next","current-page":u.query.page,"page-size":u.query.pageSize,total:u.pageTotal,onCurrentChange:u.handlePageChange},null,8,["current-page","page-size","total","onCurrentChange"])])])])}],["__scopeId","data-v-4c2d2ed3"]]);export{T as default};
