2025-03-20 10:46:42 +08:00

2 lines
3.8 KiB
JavaScript

import{R,L as S,M as L,N,O as T,w as U,t as M}from"./element-plus.2acb577d.js";import{_ as P}from"./index.vue_vue_type_script_setup_true_lang.a280d02d.js";import{f as j,b as z}from"./index.81df6f20.js";import{d as K,e as O,f as Q}from"./article.dbbcde50.js";import{u as q}from"./usePaging.23706826.js";import{_ as G}from"./edit.vue_vue_type_script_setup_true_lang.a40fe094.js";import{d as F,s as H,r as I,am as J,o as n,c as W,U as t,L as i,M as d,u as s,K as p,a as g,R as E,i as X,Q as Y,n as h}from"./@vue.821a47ec.js";import"./lodash-es.df44a280.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.81e2759c.js";import"./@element-plus.dabbc398.js";import"./dayjs.d2a77ee0.js";import"./axios.9e996410.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.6bfd3540.js";import"./vue-router.4c04f9b6.js";import"./pinia.fefed778.js";import"./css-color-function.8ff67959.js";import"./color.bfa08e9a.js";import"./clone.660f80c4.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.dcb32030.js";import"./vue-clipboard3.e681583f.js";import"./clipboard.3ad9b20b.js";import"./echarts.42bea269.js";import"./tslib.60310f1a.js";import"./zrender.2cb48b70.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8864a4be.js";import"./index.f292cd50.js";const Z={class:"flex justify-end mt-4"},ee=F({name:"articleColumn"}),Me=F({...ee,setup(te){const _=H(),f=I(!1),{pager:r,getLists:l}=q({fetchFun:Q}),b=async()=>{var o;f.value=!0,await h(),(o=_.value)==null||o.open("add")},k=async o=>{var e,u;f.value=!0,await h(),(e=_.value)==null||e.open("edit"),(u=_.value)==null||u.getDetail(o)},y=async o=>{await j.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await K({id:o}),l()},A=async(o,e)=>{try{await O({id:e,is_show:o}),l()}catch{l()}};return l(),(o,e)=>{const u=R,w=S,B=z,v=U,m=L,V=M,D=N,x=P,C=J("perms"),$=T;return n(),W("div",null,[t(w,{class:"!border-none",shadow:"never"},{default:i(()=>[t(u,{type:"warning",title:"\u6E29\u99A8\u63D0\u793A\uFF1A\u7528\u4E8E\u7BA1\u7406\u7F51\u7AD9\u7684\u5206\u7C7B\uFF0C\u53EA\u53EF\u6DFB\u52A0\u5230\u4E00\u7EA7",closable:!1,"show-icon":""})]),_:1}),d((n(),p(w,{class:"!border-none mt-4",shadow:"never"},{default:i(()=>[g("div",null,[d((n(),p(v,{class:"mb-4",type:"primary",onClick:e[0]||(e[0]=a=>b())},{icon:i(()=>[t(B,{name:"el-icon-Plus"})]),default:i(()=>[e[3]||(e[3]=E(" \u65B0\u589E "))]),_:1})),[[C,["article.articleCate/add"]]])]),t(D,{size:"large",data:s(r).lists},{default:i(()=>[t(m,{label:"\u680F\u76EE\u540D\u79F0",prop:"name","min-width":"120"}),t(m,{label:"\u6587\u7AE0\u6570",prop:"article_count","min-width":"120"}),t(m,{label:"\u72B6\u6001","min-width":"120"},{default:i(({row:a})=>[d(t(V,{modelValue:a.is_show,"onUpdate:modelValue":c=>a.is_show=c,"active-value":1,"inactive-value":0,onChange:c=>A(c,a.id)},null,8,["modelValue","onUpdate:modelValue","onChange"]),[[C,["article.articleCate/updateStatus"]]])]),_:1}),t(m,{label:"\u6392\u5E8F",prop:"sort","min-width":"120"}),t(m,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:i(({row:a})=>[d((n(),p(v,{type:"primary",link:"",onClick:c=>k(a)},{default:i(()=>e[4]||(e[4]=[E(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[C,["article.articleCate/edit"]]]),d((n(),p(v,{type:"danger",link:"",onClick:c=>y(a.id)},{default:i(()=>e[5]||(e[5]=[E(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[C,["article.articleCate/delete"]]])]),_:1})]),_:1},8,["data"]),g("div",Z,[t(x,{modelValue:s(r),"onUpdate:modelValue":e[1]||(e[1]=a=>X(r)?r.value=a:null),onChange:s(l)},null,8,["modelValue","onChange"])])]),_:1})),[[$,s(r).loading]]),s(f)?(n(),p(G,{key:0,ref_key:"editRef",ref:_,onSuccess:s(l),onClose:e[2]||(e[2]=a=>f.value=!1)},null,8,["onSuccess"])):Y("",!0)])}}});export{Me as default};