1 |
- import{d as W,H as X,r as n,x as j,b as J,a1 as Z,o as p,c as k,f as e,B as o,a as t,a2 as F,F as C,P as H,A as m,G as u,l as y,D as $,Q as ee,R as ae,S as le,a6 as te,K as oe,_ as re,L as ie,U as pe,V as ne,W as se,X as me}from"./index-bf9ff227.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang-d90f8b28.js";import{_ as de}from"./DictTag.vue_vue_type_script_lang-a9dd3e98.js";import{E as ce}from"./el-image-0ccbae3c.js";import"./el-image-viewer-a3b9f5bd.js";import{_ as fe}from"./ContentWrap.vue_vue_type_script_setup_true_lang-e7a6a44f.js";import{a as we,D as K}from"./dict-3320eb00.js";import{d as ge}from"./formatTime-7c094983.js";import{a as _e,d as ye}from"./index-4dde234d.js";import{_ as be}from"./ArticleForm.vue_vue_type_script_setup_true_lang-cab080f9.js";import{g as he}from"./index-316bbad0.js";import{i as ve}from"./spu-3efee143.js";import{c as xe}from"./index-15566098.js";import{u as ke}from"./useMessage-5b7a04fd.js";import"./index-1943929a.js";import"./color-6e929987.js";import"./el-card-3ab8deb4.js";import"./Dialog-e1cdd070.js";import"./_plugin-vue_export-helper-1b428a4d.js";import"./style.css_vue_type_style_index_0_src_true_lang-ff69e76a.js";import"./UploadImg-0b316bf5.js";import"./SpuSelect.vue_vue_type_script_setup_true_lang-20417a23.js";import"./el-tree-select-e41a3368.js";import"./index-c91d8315.js";import"./SkuList.vue_vue_type_script_setup_true_lang-e1527210.js";import"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-81b2cf23.js";import"./UploadImgs.vue_vue_type_style_index_0_scoped_bad238b9_lang-dc853bc1.js";import"./UploadFile.vue_vue_type_style_index_0_scoped_a9e67aa2_lang-53cb6d4a.js";import"./tree-fd3a041e.js";import"./category-4db81323.js";const Ce=W({name:"PromotionArticle",__name:"index",setup(Ve){const V=ke(),{t:O}=X(),b=n(!0),U=n(0),S=n([]),r=j({pageNo:1,pageSize:10,categoryId:void 0,title:null,status:void 0,spuId:void 0,createTime:[]}),T=n(),d=async()=>{b.value=!0;try{const c=await _e(r);S.value=c.list,U.value=c.total}finally{b.value=!1}},_=()=>{r.pageNo=1,d()},P=()=>{T.value.resetFields(),_()},I=n(),D=(c,l)=>{I.value.open(c,l)},h=n([]),R=n([]);return J(async()=>{await d(),h.value=await he(),R.value=await ve()}),(c,l)=>{const M=ee,N=ae,f=le,Y=te,z=oe,v=re,w=ie,L=pe,A=fe,q=ce,i=ne,B=de,E=se,G=ue,x=Z("hasPermi"),Q=me;return p(),k(C,null,[e(A,null,{default:o(()=>[e(L,{ref_key:"queryFormRef",ref:T,inline:!0,model:t(r),class:"-mb-15px","label-width":"80px"},{default:o(()=>[e(f,{label:"\u6587\u7AE0\u5206\u7C7B",prop:"categoryId"},{default:o(()=>[e(N,{modelValue:t(r).categoryId,"onUpdate:modelValue":l[0]||(l[0]=a=>t(r).categoryId=a),class:"!w-240px",placeholder:"\u5168\u90E8",onKeyup:F(_,["enter"])},{default:o(()=>[(p(!0),k(C,null,H(t(h),a=>(p(),m(M,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(f,{label:"\u6587\u7AE0\u6807\u9898",prop:"title"},{default:o(()=>[e(Y,{modelValue:t(r).title,"onUpdate:modelValue":l[1]||(l[1]=a=>t(r).title=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u6807\u9898",onKeyup:F(_,["enter"])},null,8,["modelValue"])]),_:1}),e(f,{label:"\u72B6\u6001",prop:"status"},{default:o(()=>[e(N,{modelValue:t(r).status,"onUpdate:modelValue":l[2]||(l[2]=a=>t(r).status=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:o(()=>[(p(!0),k(C,null,H(t(we)(t(K).COMMON_STATUS),a=>(p(),m(M,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(f,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:o(()=>[e(z,{modelValue:t(r).createTime,"onUpdate:modelValue":l[3]||(l[3]=a=>t(r).createTime=a),"default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px","end-placeholder":"\u7ED3\u675F\u65E5\u671F","start-placeholder":"\u5F00\u59CB\u65E5\u671F",type:"daterange","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","default-time"])]),_:1}),e(f,null,{default:o(()=>[e(w,{onClick:_},{default:o(()=>[e(v,{class:"mr-5px",icon:"ep:search"}),l[7]||(l[7]=u(" \u641C\u7D22 "))]),_:1}),e(w,{onClick:P},{default:o(()=>[e(v,{class:"mr-5px",icon:"ep:refresh"}),l[8]||(l[8]=u(" \u91CD\u7F6E "))]),_:1}),y((p(),m(w,{plain:"",type:"primary",onClick:l[4]||(l[4]=a=>D("create"))},{default:o(()=>[e(v,{class:"mr-5px",icon:"ep:plus"}),l[9]||(l[9]=u(" \u65B0\u589E "))]),_:1})),[[x,["promotion:article:create"]]])]),_:1})]),_:1},8,["model"])]),_:1}),e(A,null,{default:o(()=>[y((p(),m(E,{data:t(S),"show-overflow-tooltip":!0,stripe:!0},{default:o(()=>[e(i,{align:"center",label:"\u5C01\u9762","min-width":"80",prop:"picUrl"},{default:o(({row:a})=>[e(q,{src:a.picUrl,class:"h-30px w-30px",onClick:g=>{return s=a.picUrl,void xe({urlList:[s]});var s}},null,8,["src","onClick"])]),_:1}),e(i,{align:"center",label:"\u6807\u9898","min-width":"180",prop:"title"}),e(i,{align:"center",label:"\u5206\u7C7B","min-width":"180",prop:"categoryId"},{default:o(a=>{var g;return[u($((g=t(h).find(s=>s.id===a.row.categoryId))==null?void 0:g.name),1)]}),_:1}),e(i,{align:"center",label:"\u6D4F\u89C8\u91CF","min-width":"180",prop:"browseCount"}),e(i,{align:"center",label:"\u4F5C\u8005","min-width":"180",prop:"author"}),e(i,{align:"center",label:"\u6587\u7AE0\u7B80\u4ECB","min-width":"250",prop:"introduction"}),e(i,{align:"center",label:"\u6392\u5E8F","min-width":"60",prop:"sort"}),e(i,{align:"center",label:"\u72B6\u6001","min-width":"60",prop:"status"},{default:o(a=>[e(B,{type:t(K).COMMON_STATUS,value:a.row.status},null,8,["type","value"])]),_:1}),e(i,{formatter:t(ge),align:"center",label:"\u53D1\u5E03\u65F6\u95F4",prop:"createTime",width:"180px"},null,8,["formatter"]),e(i,{align:"center",fixed:"right",label:"\u64CD\u4F5C",width:"120"},{default:o(a=>[y((p(),m(w,{link:"",type:"primary",onClick:g=>D("update",a.row.id)},{default:o(()=>l[10]||(l[10]=[u(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[x,["promotion:article:update"]]]),y((p(),m(w,{link:"",type:"danger",onClick:g=>(async s=>{try{await V.delConfirm(),await ye(s),V.success(O("common.delSuccess")),await d()}catch{}})(a.row.id)},{default:o(()=>l[11]||(l[11]=[u(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[x,["promotion:article:delete"]]])]),_:1})]),_:1},8,["data"])),[[Q,t(b)]]),e(G,{limit:t(r).pageSize,"onUpdate:limit":l[5]||(l[5]=a=>t(r).pageSize=a),page:t(r).pageNo,"onUpdate:page":l[6]||(l[6]=a=>t(r).pageNo=a),total:t(U),onPagination:d},null,8,["limit","page","total"])]),_:1}),e(be,{ref_key:"formRef",ref:I,onSuccess:d},null,512)],64)}}});export{Ce as default};
|