mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-04 12:18:14 +00:00
2 lines
6.0 KiB
JavaScript
2 lines
6.0 KiB
JavaScript
/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-aae906bf.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{t}from"./index-5f4ce139.js";import{e as D,i as S,j}from"./article-a302dda6.js";import{i as I}from"./common-465e36b3.js";import{a as U}from"./vue-router-b5675730.js";import{E as R}from"./index-548a7823.js";import{E as M}from"./index-4862d1b3.js";import{E as q}from"./index-95693143.js";import{a as O,E as G}from"./index-624573cc.js";import{a as H,E as J}from"./index-9fbce820.js";import{E as K}from"./index-acd12562.js";import{a as Q,E as W}from"./index-a9458a49.js";import{E as X}from"./index-f97852b4.js";import{E as Y}from"./index-800b62de.js";import{v as Z}from"./directive-a07a10ed.js";import{d as ee,M as te,r as k,b as s,e as g,q as o,p as r,f,v as d,x as n,u as l,F as ae,t as oe,m as b,L as le,C as y}from"./runtime-core.esm-bundler-7c3fd514.js";import"./el-overlay-f7f710bd.js";import"./plugin-vue_export-helper-edbdb6f8.js";import"./index-f02197a7.js";import"./index-868cd458.js";import"./index-a3cf5375.js";import"./event-9519ab40.js";import"./focus-trap-bb1e8c7a.js";import"./index-7b0897f9.js";import"./error-492b6a5b.js";import"./el-switch-3d36d31d.js";import"./index-cf47f151.js";import"./index-2083be2e.js";import"./index-47617222.js";import"./validator-62f68fe3.js";import"./el-radio-c9a1047c.js";import"./index-2f0b1bf3.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./el-avatar-7d17482e.js";import"./index-be5dc120.js";import"./common-cc37bda4.js";import"./common-2cf17469.js";import"./index-c656f08b.js";import"./_baseClone-cf40e5b2.js";import"./_Uint8Array-de4f83bb.js";import"./_initCloneObject-bc5ed9bb.js";import"./index-2804b007.js";import"./isEqual-f40f939e.js";import"./index-470ade69.js";import"./flatten-b3585bb8.js";import"./_isIterateeCall-7a6fae02.js";const re={class:"main-container"},ie={class:"flex justify-between"},ne={class:"mt-[16px]"},me={key:0},se={key:1},pe={class:"mt-[16px] flex justify-end"},vt=ee({__name:"list",setup(de){const a=te({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:""}}),v=k([]),E=k();(async()=>{v.value=await(await D({})).data})();const c=(p=1)=>{a.loading=!0,a.page=p,S({page:a.page,limit:a.limit,...a.searchParam}).then(i=>{a.loading=!1,a.data=i.data.data,a.total=i.data.total}).catch(()=>{a.loading=!1})};c();const w=U(),P=()=>{w.push("/article/edit")},V=p=>{w.push(`/article/edit?id=${p.id}`)},B=p=>{R.confirm(t("articleDeleteTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{j(p).then(()=>{c()}).catch(()=>{})})};return(p,i)=>{const u=M,L=q,h=O,C=H,T=J,F=G,x=K,m=Q,z=X,A=W,N=Y,$=Z;return s(),g("div",re,[o(x,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[f("div",ie,[o(u,{type:"primary",onClick:P},{default:r(()=>[d(n(l(t)("addArticle")),1)]),_:1})]),o(x,{class:"box-card !border-none my-[16px] table-search-wrap",shadow:"never"},{default:r(()=>[o(F,{inline:!0,model:a.searchParam,ref_key:"searchFormRef",ref:E},{default:r(()=>[o(h,{label:l(t)("title"),prop:"title"},{default:r(()=>[o(L,{modelValue:a.searchParam.title,"onUpdate:modelValue":i[0]||(i[0]=e=>a.searchParam.title=e),placeholder:l(t)("titlePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(h,{label:l(t)("categoryName"),prop:"category_id"},{default:r(()=>[o(T,{modelValue:a.searchParam.category_id,"onUpdate:modelValue":i[1]||(i[1]=e=>a.searchParam.category_id=e),clearable:"",placeholder:l(t)("categoryIdPlaceholder"),class:"input-width"},{default:r(()=>[o(C,{label:l(t)("selectPlaceholder"),value:""},null,8,["label"]),(s(!0),g(ae,null,oe(v.value,e=>(s(),b(C,{label:e.name,value:e.category_id},null,8,["label","value"]))),256))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(h,null,{default:r(()=>[o(u,{type:"primary",onClick:i[2]||(i[2]=e=>c())},{default:r(()=>[d(n(l(t)("search")),1)]),_:1}),o(u,{onClick:i[3]||(i[3]=e=>{var _;return(_=E.value)==null?void 0:_.resetFields()})},{default:r(()=>[d(n(l(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),f("div",ne,[le((s(),b(A,{data:a.data,size:"large"},{empty:r(()=>[f("span",null,n(a.loading?"":l(t)("emptyData")),1)]),default:r(()=>[o(m,{prop:"title","show-overflow-tooltip":!0,label:l(t)("title"),width:"140"},null,8,["label"]),o(m,{label:l(t)("image"),"min-width":"120",align:"center"},{default:r(({row:e})=>[e.image?(s(),b(z,{key:0,class:"w-12 h-12",src:l(I)(e.image),fit:"contain"},null,8,["src"])):y("",!0)]),_:1},8,["label"]),o(m,{prop:"category_name",label:l(t)("categoryName"),align:"center","min-width":"140"},null,8,["label"]),o(m,{prop:"summary",label:l(t)("summary"),width:"180","show-overflow-tooltip":!0},null,8,["label"]),o(m,{label:l(t)("isShow"),"min-width":"120",align:"center"},{default:r(({row:e})=>[e.is_show==1?(s(),g("span",me,n(l(t)("show")),1)):y("",!0),e.is_show==0?(s(),g("span",se,n(l(t)("hidden")),1)):y("",!0)]),_:1},8,["label"]),o(m,{label:l(t)("createTime"),"min-width":"180",align:"center"},{default:r(({row:e})=>[d(n(e.create_time||""),1)]),_:1},8,["label"]),o(m,{label:l(t)("operation"),fixed:"right",width:"130"},{default:r(({row:e})=>[o(u,{type:"primary",link:"",onClick:_=>V(e)},{default:r(()=>[d(n(l(t)("edit")),1)]),_:2},1032,["onClick"]),o(u,{type:"danger",link:"",onClick:_=>B(e.id)},{default:r(()=>[d(n(l(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[$,a.loading]]),f("div",pe,[o(N,{"current-page":a.page,"onUpdate:currentPage":i[4]||(i[4]=e=>a.page=e),"page-size":a.limit,"onUpdate:pageSize":i[5]||(i[5]=e=>a.limit=e),layout:"total, sizes, prev, pager, next, jumper",total:a.total,onSizeChange:i[6]||(i[6]=e=>c()),onCurrentChange:c},null,8,["current-page","page-size","total"])])])]),_:1})])}}});export{vt as default};
|