全栈小学生 26524c4bf5 update admin
2023-08-12 16:21:13 +08:00

2 lines
6.6 KiB
JavaScript

import{d as R,R as S,r as k,e as p,f,y as a,x as r,g as c,B as n,u as o,A as u,F as j,z as U,v as h,Q as H,H as b}from"./base-04829be5.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{t as e}from"./index-043d021e.js";import{f as M,j as O,k as Q}from"./article-082cb1c5.js";import{f as q}from"./storage-1a3ddb14.js";import{u as G,b as J}from"./vue-router-fee568b2.js";import{E as K}from"./index-d60f63e2.js";import{E as W}from"./index-eb678249.js";import{E as X}from"./index-db9b8d96.js";import{a as Y,E as Z}from"./index-6bd50bb5.js";import{a as tt,E as et}from"./index-02bf3820.js";import{E as at}from"./index-88566e4e.js";import{a as ot,E as lt}from"./index-ed9a1afd.js";import{E as rt}from"./index-c4af56cf.js";import{E as it}from"./index-1808e3f9.js";import{v as nt}from"./directive-013f0a4e.js";import"./common-111e3797.js";import"./common-2cf17469.js";import"./index-faea7bd5.js";import"./index-236cb599.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./index-30df2c14.js";import"./index-7e933ae4.js";import"./index-92283b18.js";import"./typescript-defaf979.js";import"./index-a2524300.js";import"./index-9a9de0a3.js";import"./error-78e43d3e.js";import"./scroll-e5463626.js";import"./vnode-85ccdc7f.js";import"./aria-adfa05c5.js";import"./focus-trap-be36cfe9.js";import"./validator-6838b9a3.js";import"./index-1d455165.js";import"./index-de053f2e.js";import"./index-4edf2cad.js";import"./index-d7f4b4bb.js";import"./event-9519ab40.js";import"./castArray-11aea762.js";import"./_Uint8Array-99b916e9.js";import"./_initCloneObject-e5a1aa13.js";import"./index-94a82d50.js";import"./index-e9e16697.js";import"./index-bf9de702.js";import"./strings-4ec3ae35.js";import"./isEqual-ba353d68.js";import"./debounce-f064e94e.js";import"./index-b519934c.js";import"./index-c3b3b83a.js";import"./flatten-94587e2b.js";import"./_isIterateeCall-f0970b1f.js";import"./index-ed22fe56.js";import"./position-b298e95e.js";const st={class:"main-container"},mt={class:"flex justify-between items-center"},pt={class:"text-[20px]"},ct={class:"mt-[10px]"},dt=["href"],ut={key:0},_t={key:1},ft={class:"mt-[16px] flex justify-end"},Le=R({__name:"list",setup(gt){const C=G().meta.title,l=S({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:""}}),v=k([]),y=k();(async()=>{v.value=await(await M({})).data})();const d=(s=1)=>{l.loading=!0,l.page=s,O({page:l.page,limit:l.limit,...l.searchParam}).then(i=>{l.loading=!1,l.data=i.data.data,l.total=i.data.total}).catch(()=>{l.loading=!1})};d();const w=J(),P=()=>{w.push("/article/edit")},V=s=>{w.push(`/article/edit?id=${s.id}`)},B=s=>{K.confirm(e("articleDeleteTips"),e("warning"),{confirmButtonText:e("confirm"),cancelButtonText:e("cancel"),type:"warning"}).then(()=>{Q(s).then(()=>{d()}).catch(()=>{})})},F=s=>{s&&(s.resetFields(),d())};return(s,i)=>{const _=W,T=X,g=Y,E=tt,z=et,A=Z,x=at,m=ot,L=rt,N=lt,D=it,I=nt;return p(),f("div",st,[a(x,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[c("div",mt,[c("span",pt,n(o(C)),1),a(_,{type:"primary",class:"w-[100px]",onClick:P},{default:r(()=>[u(n(o(e)("addArticle")),1)]),_:1})]),a(x,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:r(()=>[a(A,{inline:!0,model:l.searchParam,ref_key:"searchFormRef",ref:y},{default:r(()=>[a(g,{label:o(e)("title"),prop:"title"},{default:r(()=>[a(T,{modelValue:l.searchParam.title,"onUpdate:modelValue":i[0]||(i[0]=t=>l.searchParam.title=t),placeholder:o(e)("titlePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(g,{label:o(e)("categoryName"),prop:"category_id"},{default:r(()=>[a(z,{modelValue:l.searchParam.category_id,"onUpdate:modelValue":i[1]||(i[1]=t=>l.searchParam.category_id=t),clearable:"",placeholder:o(e)("categoryIdPlaceholder"),class:"input-width"},{default:r(()=>[a(E,{label:o(e)("selectPlaceholder"),value:""},null,8,["label"]),(p(!0),f(j,null,U(v.value,t=>(p(),h(E,{label:t.name,value:t.category_id},null,8,["label","value"]))),256))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),a(g,null,{default:r(()=>[a(_,{type:"primary",onClick:i[2]||(i[2]=t=>d())},{default:r(()=>[u(n(o(e)("search")),1)]),_:1}),a(_,{onClick:i[3]||(i[3]=t=>F(y.value))},{default:r(()=>[u(n(o(e)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),c("div",ct,[H((p(),h(N,{data:l.data,size:"large"},{empty:r(()=>[c("span",null,n(l.loading?"":o(e)("emptyData")),1)]),default:r(()=>[a(m,{prop:"id","show-overflow-tooltip":!0,label:o(e)("ID"),width:"100"},null,8,["label"]),a(m,{prop:"category_name",label:o(e)("categoryName"),width:"120"},null,8,["label"]),a(m,{prop:"title","show-overflow-tooltip":!0,label:o(e)("title"),width:"180"},{default:r(({row:t})=>[c("a",{href:t.article_url.web_url,target:"_blank"},n(t.title),9,dt)]),_:1},8,["label"]),a(m,{label:o(e)("image"),"min-width":"120",align:"center"},{default:r(({row:t})=>[t.image?(p(),h(L,{key:0,class:"w-12 h-12",src:o(q)(t.image),fit:"contain"},null,8,["src"])):b("",!0)]),_:1},8,["label"]),a(m,{prop:"visit",label:o(e)("visit"),width:"120",align:"center"},{default:r(({row:t})=>[c("span",null,n(parseInt(t.visit+t.visit_virtual)),1)]),_:1},8,["label"]),a(m,{label:o(e)("isShow"),"min-width":"120",align:"center"},{default:r(({row:t})=>[t.is_show==1?(p(),f("span",ut,n(o(e)("show")),1)):b("",!0),t.is_show==0?(p(),f("span",_t,n(o(e)("hidden")),1)):b("",!0)]),_:1},8,["label"]),a(m,{prop:"sort",label:o(e)("sort"),width:"100",align:"center"},null,8,["label"]),a(m,{label:o(e)("createTime"),"min-width":"180",align:"center"},{default:r(({row:t})=>[u(n(t.create_time||""),1)]),_:1},8,["label"]),a(m,{label:o(e)("operation"),fixed:"right",width:"130"},{default:r(({row:t})=>[a(_,{type:"primary",link:"",onClick:$=>V(t)},{default:r(()=>[u(n(o(e)("edit")),1)]),_:2},1032,["onClick"]),a(_,{type:"danger",link:"",onClick:$=>B(t.id)},{default:r(()=>[u(n(o(e)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[I,l.loading]]),c("div",ft,[a(D,{"current-page":l.page,"onUpdate:currentPage":i[4]||(i[4]=t=>l.page=t),"page-size":l.limit,"onUpdate:pageSize":i[5]||(i[5]=t=>l.limit=t),layout:"total, sizes, prev, pager, next, jumper",total:l.total,onSizeChange:i[6]||(i[6]=t=>d()),onCurrentChange:d},null,8,["current-page","page-size","total"])])])]),_:1})])}}});export{Le as default};