mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-06 04:58:10 +00:00
2 lines
5.0 KiB
JavaScript
2 lines
5.0 KiB
JavaScript
import{g as $,a4 as z,r as b,m as y,n as V,F as a,E as i,q as _,L as m,u as t,K as p,a1 as N,D as S}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 */import{t as o}from"./index-047041cb.js";import{d as L,g as j}from"./article-4af479a6.js";import{_ as A}from"./edit-category.vue_vue_type_script_setup_true_lang-425880d6.js";import{h as R}from"./storage-4159d1ed.js";import{u as U}from"./vue-router-fcbaaf02.js";import{E as I}from"./index-0d830c44.js";import{E as q}from"./index-25c37860.js";import{E as K}from"./index-4ce9333e.js";import{a as M,E as G}from"./index-c4fd4c9d.js";import{E as H}from"./index-fc3020f4.js";import{a as J,E as O}from"./index-cbbcd330.js";import{E as Q}from"./index-e841b684.js";import{v as W}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";/* empty css */import"./index-038ec88a.js";import"./index-f79599e2.js";import"./castArray-df7eff2c.js";import"./_Uint8Array-e584e472.js";import"./_initCloneObject-983ff8c8.js";import"./index-c0090d79.js";import"./isEqual-f877b6c1.js";import"./flatten-0fc8b7eb.js";import"./_isIterateeCall-104f1f93.js";import"./index-cc9a73f0.js";import"./index-201145a4.js";import"./strings-2444fdb3.js";const X={class:"main-container"},Y={class:"flex justify-between items-center"},Z={class:"text-[20px]"},ee={class:"mt-[10px]"},te={class:"mt-[16px] flex justify-end"},ot=$({__name:"category",setup(oe){const v=U().meta.title,e=z({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{name:""}}),f=b(),C=n=>{n&&(n.resetFields(),s())},s=R((n=1)=>{e.loading=!0,e.page=n,j({page:e.page,limit:e.limit,...e.searchParam}).then(r=>{e.loading=!1,e.data=r.data.data,e.total=r.data.total}).catch(()=>{e.loading=!1})});s();const d=b(null),x=()=>{d.value.setFormData(),d.value.showDialog=!0},E=n=>{d.value.setFormData(n),d.value.showDialog=!0},w=n=>{I.confirm(o("articleCategoryDeleteTips"),o("warning"),{confirmButtonText:o("confirm"),cancelButtonText:o("cancel"),type:"warning"}).then(()=>{L(n).then(()=>{s()}).catch(()=>{})})};return(n,r)=>{const c=q,k=K,g=M,D=G,h=H,u=J,F=O,B=Q,P=W;return y(),V("div",X,[a(h,{class:"box-card !border-none",shadow:"never"},{default:i(()=>[_("div",Y,[_("span",Z,m(t(v)),1),a(c,{type:"primary",onClick:x},{default:i(()=>[p(m(t(o)("addArticleCategory")),1)]),_:1})]),a(h,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:i(()=>[a(D,{inline:!0,model:e.searchParam,ref_key:"searchFormRef",ref:f},{default:i(()=>[a(g,{label:t(o)("name"),prop:"name"},{default:i(()=>[a(k,{modelValue:e.searchParam.name,"onUpdate:modelValue":r[0]||(r[0]=l=>e.searchParam.name=l),placeholder:t(o)("namePlaceholder"),class:"w-[190px]","prefix-icon":"Search",clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(g,null,{default:i(()=>[a(c,{type:"primary",onClick:r[1]||(r[1]=l=>t(s)())},{default:i(()=>[p(m(t(o)("search")),1)]),_:1}),a(c,{onClick:r[2]||(r[2]=l=>C(f.value))},{default:i(()=>[p(m(t(o)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),_("div",ee,[N((y(),S(F,{data:e.data,size:"large"},{empty:i(()=>[_("span",null,m(e.loading?"":t(o)("emptyData")),1)]),default:i(()=>[a(u,{prop:"name",label:t(o)("name"),"min-width":"150"},null,8,["label"]),a(u,{prop:"article_num",label:t(o)("articleNumber"),"min-width":"140"},null,8,["label"]),a(u,{prop:"is_show",label:t(o)("isShow"),"min-width":"150"},{default:i(({row:l})=>[p(m(l.is_show==1?t(o)("show"):t(o)("hide")),1)]),_:1},8,["label"]),a(u,{prop:"sort",label:t(o)("sort"),"min-width":"120"},null,8,["label"]),a(u,{label:t(o)("operation"),fixed:"right",width:"130"},{default:i(({row:l})=>[a(c,{type:"primary",link:"",onClick:T=>E(l)},{default:i(()=>[p(m(t(o)("edit")),1)]),_:2},1032,["onClick"]),a(c,{type:"danger",link:"",onClick:T=>w(l.category_id)},{default:i(()=>[p(m(t(o)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[P,e.loading]]),_("div",te,[a(B,{"current-page":e.page,"onUpdate:currentPage":r[3]||(r[3]=l=>e.page=l),"page-size":e.limit,"onUpdate:pageSize":r[4]||(r[4]=l=>e.limit=l),layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:r[5]||(r[5]=l=>t(s)()),onCurrentChange:t(s)},null,8,["current-page","page-size","total","onCurrentChange"])])]),a(A,{ref_key:"editCategoryDialog",ref:d,onComplete:r[6]||(r[6]=l=>t(s)())},null,512)]),_:1})])}}});export{ot as default};
|