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

2 lines
6.3 KiB
JavaScript

import{G as Q,H as Z,L as J,M as W,N as X,O as Y,B as ee,C as te,w as le,D as ae,t as oe}from"./element-plus.2acb577d.js";import{_ as ie}from"./index.vue_vue_type_script_setup_true_lang.a280d02d.js";import{f as ne,b as se,_ as re}from"./index.81df6f20.js";import{d as L,s as B,r as $,Z as ue,bk as me,am as pe,o as n,c as A,U as t,L as a,u as o,aa as de,T as ce,a9 as _e,K as r,R as _,a as R,M as f,Q as y,i as fe,n as F}from"./@vue.821a47ec.js";import{g as ve,k as we,l as Ce,j as be,m as Ee}from"./article.dbbcde50.js";import{a as ke}from"./useDictOptions.4fbfb4d7.js";import{u as ge}from"./usePaging.23706826.js";import ye from"./detail.4a6dd910.js";import{_ as Fe}from"./edit.vue_vue_type_script_setup_true_lang.e90fff50.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";import"./index.vue_vue_type_style_index_0_lang.8a52bc86.js";import"./@wangeditor.cffe0e53.js";import"./picker.c51c629b.js";import"./index.c82c3401.js";import"./index.8caf87ac.js";import"./vuedraggable.38fc8f37.js";import"./vue.93503b42.js";import"./sortablejs.f19edb47.js";const he={class:"article-lists"},Ve={class:"flex justify-end mt-4"},De=L({name:"articleLists"}),kt=L({...De,setup(xe){const b=B(),E=$(!1),u=ue({title:"",cid:"",is_show:""}),{pager:v,getLists:p,resetPage:h,resetParams:S}=ge({fetchFun:Ee,params:u}),{optionsData:U}=ke({article_cate:{api:ve}}),P=async(i,e)=>{try{await we({id:e,is_show:i}),p()}catch{p()}},N=async i=>{await ne.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await Ce({id:i}),p()},V=B(),g=$(!1),T=async i=>{var m;let e=await be({id:i});g.value=!0,await F(),(m=V.value)==null||m.open(e)},K=async()=>{var i;E.value=!0,await F(),(i=b.value)==null||i.open("add")},I=async i=>{var e,m;E.value=!0,await F(),(e=b.value)==null||e.open("edit"),(m=b.value)==null||m.getDetail(i)};return me(()=>{p()}),p(),(i,e)=>{const m=ee,k=te,w=Q,D=Z,d=le,O=ae,x=J,j=se,s=W,M=re,q=oe,z=X,G=ie,C=pe("perms"),H=Y;return n(),A("div",he,[t(x,{class:"!border-none",shadow:"never"},{default:a(()=>[t(O,{ref:"formRef",class:"mb-[-16px]",model:o(u),inline:!0},{default:a(()=>[t(k,{label:"\u6587\u7AE0\u6807\u9898"},{default:a(()=>[t(m,{class:"w-[280px]",modelValue:o(u).title,"onUpdate:modelValue":e[0]||(e[0]=l=>o(u).title=l),clearable:"",onKeyup:de(o(h),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),t(k,{label:"\u680F\u76EE\u540D\u79F0"},{default:a(()=>[t(D,{class:"w-[280px]",modelValue:o(u).cid,"onUpdate:modelValue":e[1]||(e[1]=l=>o(u).cid=l)},{default:a(()=>[t(w,{label:"\u5168\u90E8",value:""}),(n(!0),A(ce,null,_e(o(U).article_cate,l=>(n(),r(w,{key:l.id,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(k,{label:"\u6587\u7AE0\u72B6\u6001"},{default:a(()=>[t(D,{class:"w-[280px]",modelValue:o(u).is_show,"onUpdate:modelValue":e[2]||(e[2]=l=>o(u).is_show=l)},{default:a(()=>[t(w,{label:"\u5168\u90E8",value:""}),t(w,{label:"\u663E\u793A",value:1}),t(w,{label:"\u9690\u85CF",value:0})]),_:1},8,["modelValue"])]),_:1}),t(k,null,{default:a(()=>[t(d,{type:"primary",onClick:o(h)},{default:a(()=>e[7]||(e[7]=[_("\u67E5\u8BE2")])),_:1},8,["onClick"]),t(d,{onClick:o(S)},{default:a(()=>e[8]||(e[8]=[_("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),t(x,{class:"!border-none mt-4",shadow:"never"},{default:a(()=>[R("div",null,[f((n(),r(d,{class:"mb-4",type:"primary",onClick:e[3]||(e[3]=l=>K())},{icon:a(()=>[t(j,{name:"el-icon-Plus"})]),default:a(()=>[e[9]||(e[9]=_(" \u53D1\u5E03\u6587\u7AE0 "))]),_:1})),[[C,["article.articleCate/add"]]])]),f((n(),r(z,{size:"large",data:o(v).lists},{default:a(()=>[t(s,{label:"ID",prop:"id","min-width":"80"}),t(s,{label:"\u5C01\u9762","min-width":"100"},{default:a(({row:l})=>[l.image?(n(),r(M,{key:0,src:l.image,width:60,height:45,"preview-src-list":[l.image],"preview-teleported":"",fit:"contain"},null,8,["src","preview-src-list"])):y("",!0)]),_:1}),t(s,{label:"\u6807\u9898",prop:"title","min-width":"160","show-tooltip-when-overflow":""}),t(s,{label:"\u680F\u76EE",prop:"cate_name","min-width":"100"}),t(s,{label:"\u4F5C\u8005",prop:"author","min-width":"120"}),t(s,{label:"\u6D4F\u89C8\u91CF",prop:"click","min-width":"100"}),t(s,{label:"\u72B6\u6001","min-width":"100"},{default:a(({row:l})=>[f(t(q,{modelValue:l.is_show,"onUpdate:modelValue":c=>l.is_show=c,"active-value":1,"inactive-value":0,onChange:c=>P(c,l.id)},null,8,["modelValue","onUpdate:modelValue","onChange"]),[[C,["article.article/updateStatus"]]])]),_:1}),t(s,{label:"\u6392\u5E8F",prop:"sort","min-width":"100"}),t(s,{label:"\u53D1\u5E03\u65F6\u95F4",prop:"create_time","min-width":"120"}),t(s,{label:"\u64CD\u4F5C",width:"170",fixed:"right"},{default:a(({row:l})=>[f((n(),r(d,{type:"primary",link:"",onClick:c=>I(l)},{default:a(()=>e[10]||(e[10]=[_(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[C,["article.article/edit","article.article/add:edit"]]]),f((n(),r(d,{type:"danger",link:"",onClick:c=>N(l.id)},{default:a(()=>e[11]||(e[11]=[_(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[C,["article.article/delete"]]]),f((n(),r(d,{link:"",onClick:c=>T(l.id)},{default:a(()=>e[12]||(e[12]=[_(" \u8BE6\u60C5 ")])),_:2},1032,["onClick"])),[[C,["article.article/detail"]]])]),_:1})]),_:1},8,["data"])),[[H,o(v).loading]]),R("div",Ve,[t(G,{modelValue:o(v),"onUpdate:modelValue":e[4]||(e[4]=l=>fe(v)?v.value=l:null),onChange:o(p)},null,8,["modelValue","onChange"])])]),_:1}),o(g)?(n(),r(ye,{key:0,ref_key:"detailRef",ref:V,onClose:e[5]||(e[5]=l=>g.value=!1)},null,512)):y("",!0),o(E)?(n(),r(Fe,{key:1,ref_key:"editRef",ref:b,onSuccess:o(p),onClose:e[6]||(e[6]=l=>E.value=!1)},null,8,["onSuccess"])):y("",!0)])}}});export{kt as default};