import{u as e,r as a,b as t,ad as r,c as s,bQ as i,d as o,e as l,h as n,f as d,k as c,g as p,n as m,w as u,j as f,am as y,aO as b,E as g,q as v,p as h}from"./index.286e9b79.js";import{v as j}from"./loading.c49775a6.js";import{E as k}from"./pagination.22bb50f6.js";import{E as w}from"./input.31de1b37.js";/* empty css            */import"./select.297a82d5.js";import{E as x,a as _}from"./table-column.7b4f59a2.js";import"./checkbox.f06171a4.js";import{E as z,a as C}from"./form.ad10dcd5.js";import"./form-item.9355e6dc.js";import{E}from"./message-box.6a8eb828.js";import"./overlay.2c1583ac.js";import{g as q}from"./http.f588794f.js";import{f as T}from"./days.686d9566.js";import"./isEqual.57d72c4a.js";import"./_initCloneObject.fb8fbaea.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./strings.8c60bfae.js";import"./scroll.a50153b5.js";import"./_baseIteratee.9ead53a1.js";import"./debounce.caafe00b.js";import"./validator.18338d56.js";const U={class:"search"},V={class:"search-box"},B={canplay:"search-wrap"},F={class:"table-wrap"},O={class:"table-box"},R={class:"toolbar"},S={class:"tabs-content"},G=n("span",{style:{"font-size":"14px","margin-left":"5px"}},"暂无数据",-1),I={class:"page"},P=n("div",{class:"l"},null,-1),Q={class:"r"},W={__name:"index",setup(W){const $=e(),A=a([]);let D=a(!1),H=a("all"),J=a();const K=t({keywords:"",current:1,size:10,total:0}),L=()=>{D.value=!0,K.active=H.value,q("diy.topic/index",K).then((e=>{D.value=!1,e.code?(A.value=e.data.list,K.total=e.data.total):g.error(e.msg)})).catch((e=>{D.value=!1,g.error(e)}))};r((()=>{L()}));const M=e=>{K.size=e,K.current=1,L()},N=e=>{K.current=e,L()},X=()=>{$.push("/mobile/topic/editor")},Y=a(),Z=t({keywords:""}),ee=()=>{if(Z.keywords.trim().length<=0)return g({message:"请输入搜索关键字",type:"warning"}),!1;K.keywords=Z.keywords,L()},ae=()=>{K.keywords="",L(),Y.value.resetFields()};return(e,a)=>{const t=w,r=z,W=v,H=C,L=s("Warning"),te=h,re=x,se=_,ie=k,oe=i("auth"),le=j;return o(),l("div",null,[n("div",U,[n("div",V,[n("div",B,[d(H,{ref_key:"searchFormRef",ref:Y,inline:!0,model:p(Z)},{default:c((()=>[d(r,{label:"搜索内容",prop:"keywords"},{default:c((()=>[d(t,{modelValue:p(Z).keywords,"onUpdate:modelValue":a[0]||(a[0]=e=>p(Z).keywords=e),placeholder:"请输入搜索信息",class:"search-item-box"},null,8,["modelValue"])])),_:1}),d(r,null,{default:c((()=>[d(W,{type:"primary",onClick:ee},{default:c((()=>[m("搜索")])),_:1}),d(W,{onClick:ae},{default:c((()=>[m("重置")])),_:1})])),_:1})])),_:1},8,["model"])])])]),n("div",F,[n("div",O,[n("div",R,[u((o(),f(W,{onClick:X},{default:c((()=>[m("添加")])),_:1})),[[oe,["diy.topic/editor"]]])]),n("div",S,[u((o(),f(se,{ref_key:"GoodsTableRef",ref:J,data:p(A),size:"large",style:{width:"100%"}},{empty:c((()=>[d(te,{size:"18",style:{position:"relative",top:"4px"}},{default:c((()=>[d(L)])),_:1}),G])),default:c((()=>[d(re,{type:"selection",width:"55"}),d(re,{prop:"name",label:"专题名称","header-align":"center",align:"center"}),d(re,{prop:"intro",label:"备注","header-align":"center",align:"center",width:"150"}),d(re,{prop:"maxexp",label:"建立时间","header-align":"center",align:"center",width:"180"},{default:c((e=>[m(y(p(T)(e.row.create_time)||""),1)])),_:1}),d(re,{label:"操作","header-align":"center",align:"center",width:"150"},{default:c((e=>[u((o(),f(W,{type:"success",size:"small",onClick:b((a=>{return t=e.row.id,void $.push({path:"/diy/index",query:{id:t}});var t}),["prevent"]),link:""},{default:c((()=>[m("装修")])),_:2},1032,["onClick"])),[[oe,["diy.topic/diy"]]]),u((o(),f(W,{type:"primary",size:"small",onClick:b((a=>{return t=e.row.id,void $.push({path:"/mobile/topic/editor",query:{id:t}});var t}),["prevent"]),link:""},{default:c((()=>[m("编辑")])),_:2},1032,["onClick"])),[[oe,["diy.topic/editor"]]]),u((o(),f(W,{type:"danger",size:"small",onClick:b((a=>{return t=e.row.id,r=e.$index,void E.confirm("您确定要删除选中内容吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{q("diy.topic/delete",{id:t}).then((e=>{e.code?(A.value.splice(r,1),g.success(e.msg)):g.error(e.msg)}))}));var t,r}),["prevent"]),link:""},{default:c((()=>[m("删除")])),_:2},1032,["onClick"])),[[oe,["diy.topic/delete"]]])])),_:1})])),_:1},8,["data"])),[[le,p(D)]])]),n("div",I,[P,n("div",Q,[d(ie,{"current-page":p(K).current,"onUpdate:currentPage":a[1]||(a[1]=e=>p(K).current=e),"page-size":p(K).size,"onUpdate:pageSize":a[2]||(a[2]=e=>p(K).size=e),small:!0,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"prev, pager, next, jumper, sizes, total",total:p(K).total,onSizeChange:M,onCurrentChange:N},null,8,["current-page","page-size","total"])])])])])])}}};export{W as default};
