2023-05-31 11:51:07 +08:00

2 lines
6.1 KiB
JavaScript

import"./base-962c0c23.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-f1b9f75f.js";import"./el-tooltip-58212670.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{t}from"./index-e8f72538.js";import{f as S,j,k as R}from"./article-5449fd65.js";import{d as U}from"./storage-abe718b1.js";import{u as M,a as q}from"./vue-router-79053937.js";import{E as O}from"./index-50a00d09.js";import{E as G}from"./index-bba9e58c.js";import{E as H}from"./index-93f2c618.js";import{a as J,E as K}from"./index-61c777fa.js";import{a as Q,E as W}from"./index-b933df38.js";import{E as X}from"./index-69523418.js";import{a as Y,E as Z}from"./index-92e1b5d5.js";import{E as ee}from"./index-2d71fdea.js";import{E as te}from"./index-100b1469.js";import{v as ae}from"./directive-c0c3e9a3.js";import{d as le,M as oe,r as C,b as p,e as f,q as a,p as r,f as d,x as n,u as l,v as u,F as re,t as ie,m as h,L as ne,C as b}from"./runtime-core.esm-bundler-dc7a07d7.js";import"./el-overlay-60700377.js";import"./event-ff03ec12.js";import"./index-5d86eb33.js";import"./focus-trap-b8b5a003.js";import"./el-radio-bfd4b1ad.js";import"./index-8bcaafa6.js";import"./index-7a123a20.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./el-avatar-3bb47ce2.js";import"./index-d57cc47d.js";import"./common-6291c908.js";import"./common-2cf17469.js";import"./_Uint8Array-6ff3cafa.js";import"./_initCloneObject-28e6bdaa.js";import"./index-4f5c40a5.js";import"./strings-4868a118.js";import"./isEqual-c7d5e6d9.js";import"./index-df51d91a.js";import"./flatten-d5d1dc97.js";import"./_isIterateeCall-c579b126.js";const se={class:"main-container"},me={class:"flex justify-between items-center"},pe={class:"text-[24px]"},de={class:"mt-[10px]"},ce=["href"],ue={key:0},_e={key:1},fe={class:"mt-[16px] flex justify-end"},gt=le({__name:"list",setup(ge){const k=M().meta.title,o=oe({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:""}}),v=C([]),y=C();(async()=>{v.value=await(await S({})).data})();const c=(s=1)=>{o.loading=!0,o.page=s,j({page:o.page,limit:o.limit,...o.searchParam}).then(i=>{o.loading=!1,o.data=i.data.data,o.total=i.data.total}).catch(()=>{o.loading=!1})};c();const w=q(),P=()=>{w.push("/article/edit")},V=s=>{w.push(`/article/edit?id=${s.id}`)},B=s=>{O.confirm(t("articleDeleteTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{R(s).then(()=>{c()}).catch(()=>{})})},F=s=>{s&&(s.resetFields(),c())};return(s,i)=>{const _=G,L=H,g=J,E=Q,T=W,N=K,x=X,m=Y,z=ee,A=Z,D=te,I=ae;return p(),f("div",se,[a(x,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[d("div",me,[d("span",pe,n(l(k)),1),a(_,{type:"primary",class:"w-[100px]",onClick:P},{default:r(()=>[u(n(l(t)("addArticle")),1)]),_:1})]),a(x,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:r(()=>[a(N,{inline:!0,model:o.searchParam,ref_key:"searchFormRef",ref:y},{default:r(()=>[a(g,{label:l(t)("title"),prop:"title"},{default:r(()=>[a(L,{modelValue:o.searchParam.title,"onUpdate:modelValue":i[0]||(i[0]=e=>o.searchParam.title=e),placeholder:l(t)("titlePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(g,{label:l(t)("categoryName"),prop:"category_id"},{default:r(()=>[a(T,{modelValue:o.searchParam.category_id,"onUpdate:modelValue":i[1]||(i[1]=e=>o.searchParam.category_id=e),clearable:"",placeholder:l(t)("categoryIdPlaceholder"),class:"input-width"},{default:r(()=>[a(E,{label:l(t)("selectPlaceholder"),value:""},null,8,["label"]),(p(!0),f(re,null,ie(v.value,e=>(p(),h(E,{label:e.name,value:e.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]=e=>c())},{default:r(()=>[u(n(l(t)("search")),1)]),_:1}),a(_,{onClick:i[3]||(i[3]=e=>F(y.value))},{default:r(()=>[u(n(l(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),d("div",de,[ne((p(),h(A,{data:o.data,size:"large"},{empty:r(()=>[d("span",null,n(o.loading?"":l(t)("emptyData")),1)]),default:r(()=>[a(m,{prop:"id","show-overflow-tooltip":!0,label:l(t)("ID"),width:"100"},null,8,["label"]),a(m,{prop:"category_name",label:l(t)("categoryName"),width:"120"},null,8,["label"]),a(m,{prop:"title","show-overflow-tooltip":!0,label:l(t)("title"),width:"180"},{default:r(({row:e})=>[d("a",{href:e.article_url.web_url,target:"_blank"},n(e.title),9,ce)]),_:1},8,["label"]),a(m,{label:l(t)("image"),"min-width":"120",align:"center"},{default:r(({row:e})=>[e.image?(p(),h(z,{key:0,class:"w-12 h-12",src:l(U)(e.image),fit:"contain"},null,8,["src"])):b("",!0)]),_:1},8,["label"]),a(m,{prop:"visit",label:l(t)("visit"),width:"120",align:"center"},{default:r(({row:e})=>[d("span",null,n(parseInt(e.visit+e.visit_virtual)),1)]),_:1},8,["label"]),a(m,{label:l(t)("isShow"),"min-width":"120",align:"center"},{default:r(({row:e})=>[e.is_show==1?(p(),f("span",ue,n(l(t)("show")),1)):b("",!0),e.is_show==0?(p(),f("span",_e,n(l(t)("hidden")),1)):b("",!0)]),_:1},8,["label"]),a(m,{prop:"sort",label:l(t)("sort"),width:"100",align:"center"},null,8,["label"]),a(m,{label:l(t)("createTime"),"min-width":"180",align:"center"},{default:r(({row:e})=>[u(n(e.create_time||""),1)]),_:1},8,["label"]),a(m,{label:l(t)("operation"),fixed:"right",width:"130"},{default:r(({row:e})=>[a(_,{type:"primary",link:"",onClick:$=>V(e)},{default:r(()=>[u(n(l(t)("edit")),1)]),_:2},1032,["onClick"]),a(_,{type:"danger",link:"",onClick:$=>B(e.id)},{default:r(()=>[u(n(l(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[I,o.loading]]),d("div",fe,[a(D,{"current-page":o.page,"onUpdate:currentPage":i[4]||(i[4]=e=>o.page=e),"page-size":o.limit,"onUpdate:pageSize":i[5]||(i[5]=e=>o.limit=e),layout:"total, sizes, prev, pager, next, jumper",total:o.total,onSizeChange:i[6]||(i[6]=e=>c()),onCurrentChange:c},null,8,["current-page","page-size","total"])])])]),_:1})])}}});export{gt as default};