mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-03 11:48:14 +00:00
2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
import{g as S,a4 as j,r as k,m as p,n as g,F as a,E as r,q as c,L as n,u as l,K as u,I as R,J as U,D as h,a1 as q,T as b}from"./base-45eb5090.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-341914e3.js";import"./el-tooltip-58212670.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{t}from"./index-047041cb.js";import{f as J,j as K,k as M}from"./article-4af479a6.js";import{d as O}from"./storage-4159d1ed.js";import{u as G,a as H}from"./vue-router-fcbaaf02.js";import{E as Q}from"./index-0d830c44.js";import{E as W}from"./index-25c37860.js";import{E as X}from"./index-4ce9333e.js";import{a as Y,E as Z}from"./index-c4fd4c9d.js";import{a as ee,E as te}from"./index-cc9a73f0.js";import{E as ae}from"./index-fc3020f4.js";import{a as le,E as oe}from"./index-cbbcd330.js";import{E as re}from"./index-da8a1336.js";import{E as ie}from"./index-e841b684.js";import{v as ne}from"./directive-9f485fe5.js";import"./el-overlay-616d6124.js";import"./event-4977bef7.js";import"./index-cd1661d3.js";import"./focus-trap-318ae2e0.js";import"./el-radio-2719e44c.js";import"./index-9670e877.js";import"./index-3be486d3.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./el-avatar-bc58ad46.js";import"./index-aef37b98.js";import"./common-af78c857.js";import"./common-2cf17469.js";import"./castArray-df7eff2c.js";import"./_Uint8Array-e584e472.js";import"./_initCloneObject-983ff8c8.js";import"./index-201145a4.js";import"./strings-2444fdb3.js";import"./isEqual-f877b6c1.js";import"./index-c0090d79.js";import"./flatten-0fc8b7eb.js";import"./_isIterateeCall-104f1f93.js";const se={class:"main-container"},me={class:"flex justify-between items-center"},pe={class:"text-[20px]"},ce={class:"mt-[10px]"},de=["href"],ue={key:0},_e={key:1},ge={class:"mt-[16px] flex justify-end"},gt=S({__name:"list",setup(fe){const C=G().meta.title,o=j({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:""}}),v=k([]),y=k();(async()=>{v.value=await(await J({})).data})();const d=(s=1)=>{o.loading=!0,o.page=s,K({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})};d();const w=H(),P=()=>{w.push("/article/edit")},V=s=>{w.push(`/article/edit?id=${s.id}`)},T=s=>{Q.confirm(t("articleDeleteTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{M(s).then(()=>{d()}).catch(()=>{})})},B=s=>{s&&(s.resetFields(),d())};return(s,i)=>{const _=W,F=X,f=Y,E=ee,L=te,D=Z,x=ae,m=le,I=re,N=oe,z=ie,A=ne;return p(),g("div",se,[a(x,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[c("div",me,[c("span",pe,n(l(C)),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(D,{inline:!0,model:o.searchParam,ref_key:"searchFormRef",ref:y},{default:r(()=>[a(f,{label:l(t)("title"),prop:"title"},{default:r(()=>[a(F,{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(f,{label:l(t)("categoryName"),prop:"category_id"},{default:r(()=>[a(L,{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),g(R,null,U(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(f,null,{default:r(()=>[a(_,{type:"primary",onClick:i[2]||(i[2]=e=>d())},{default:r(()=>[u(n(l(t)("search")),1)]),_:1}),a(_,{onClick:i[3]||(i[3]=e=>B(y.value))},{default:r(()=>[u(n(l(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),c("div",ce,[q((p(),h(N,{data:o.data,size:"large"},{empty:r(()=>[c("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})=>[c("a",{href:e.article_url.web_url,target:"_blank"},n(e.title),9,de)]),_:1},8,["label"]),a(m,{label:l(t)("image"),"min-width":"120",align:"center"},{default:r(({row:e})=>[e.image?(p(),h(I,{key:0,class:"w-12 h-12",src:l(O)(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})=>[c("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(),g("span",ue,n(l(t)("show")),1)):b("",!0),e.is_show==0?(p(),g("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:$=>T(e.id)},{default:r(()=>[u(n(l(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[A,o.loading]]),c("div",ge,[a(z,{"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=>d()),onCurrentChange:d},null,8,["current-page","page-size","total"])])])]),_:1})])}}});export{gt as default};
|