ArticleForm-8d3eca80.js 8.8 KB

1
  1. import{d as Z,h as $,r as m,e as ee,l as ae,o as d,c as f,f as a,w as l,a as t,n,x as te,v as p,F as y,q as g,t as b,P as le,O as re,V as oe,A as ue,E as _e,y as se,z as de,aT as me,ah as ne,ai as ie,al as ce,C as pe,i as fe,D as ye,I as he,_ as ve,__tla as ge}from"./index-6d7b82ba.js";import{_ as be,__tla as Ve}from"./Dialog-78181bae.js";import{_ as Ie,__tla as Ue}from"./Editor-1d56306f.js";import{_ as we,__tla as ke}from"./UploadImg-f5f3b1db.js";import{a as qe,D as q,g as R,__tla as xe}from"./dict-efb5f3b6.js";import{g as Ae,c as Be,u as Fe,__tla as Ne}from"./index-bb2758c6.js";import{g as Oe,__tla as Re}from"./index-7a886ba8.js";import{h as Se,__tla as Ce}from"./spu-402402f7.js";import He,{__tla as Te}from"./SpuSelect-3f08c9f4.js";import{__tla as ze}from"./el-image-afb9e567.js";import{__tla as De}from"./el-image-viewer-4a19ded4.js";import{__tla as Ee}from"./index-8e19be94.js";import{__tla as Pe}from"./SkuList-50c3eabb.js";import{u as Le,__tla as Me}from"./useMessage-be161634.js";import{__tla as Ge}from"./ContentWrap-1ba5c8ca.js";import{__tla as Je}from"./ContentWrap.vue_vue_type_script_setup_true_lang-68bb15fa.js";import{__tla as We}from"./el-card-1a4b93b1.js";import{__tla as Ye}from"./index-a786614b.js";import{__tla as je}from"./index-e37504b6.js";import{__tla as Ke}from"./el-tree-select-23e10a37.js";import{__tla as Qe}from"./index-b18db770.js";import{__tla as Xe}from"./formatTime-d24faf41.js";import"./tree-0af4953a.js";import{__tla as Ze}from"./category-d8fb78d9.js";import{__tla as $e}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-b2231227.js";import{__tla as ea}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-aa91c91b.js";import{__tla as aa}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-5325525b.js";let S,ta=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return Je}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return aa}catch{}})()]).then(async()=>{S=ve(Z({name:"PromotionArticleForm",__name:"ArticleForm",emits:["success"],setup(la,{expose:C,emit:H}){const{t:V}=$(),x=Le(),i=m(!1),A=m(""),c=m(!1),B=m(""),o=m({id:void 0,categoryId:void 0,title:void 0,author:void 0,picUrl:void 0,introduction:void 0,sort:0,status:0,spuId:0,recommendHot:!1,recommendBanner:!1,content:void 0}),T=ee({categoryId:[{required:!0,message:"\u5206\u7C7Bid\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],title:[{required:!0,message:"\u6587\u7AE0\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],picUrl:[{required:!0,message:"\u6587\u7AE0\u5C01\u9762\u56FE\u7247\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],sort:[{required:!0,message:"\u6392\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],spuId:[{required:!0,message:"\u5546\u54C1\u5173\u8054id\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],recommendHot:[{required:!0,message:"\u662F\u5426\u70ED\u95E8(\u5C0F\u7A0B\u5E8F)\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],recommendBanner:[{required:!0,message:"\u662F\u5426\u8F6E\u64AD\u56FE(\u5C0F\u7A0B\u5E8F)\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],content:[{required:!0,message:"\u6587\u7AE0\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),h=m(),F=m(),z=u=>{o.value.spuId=u};C({open:async(u,r)=>{if(i.value=!0,A.value=V("action."+u),B.value=u,P(),r){c.value=!0;try{o.value=await Ae(r)}finally{c.value=!1}}}});const D=H,E=async()=>{if(h&&await h.value.validate()){c.value=!0;try{const u=o.value;B.value==="create"?(await Be(u),x.success(V("common.createSuccess"))):(await Fe(u),x.success(V("common.updateSuccess"))),i.value=!1,D("success")}finally{c.value=!1}}},P=()=>{var u;o.value={id:void 0,categoryId:void 0,title:void 0,author:void 0,picUrl:void 0,introduction:void 0,sort:0,status:0,spuId:0,recommendHot:!1,recommendBanner:!1,content:void 0},(u=h.value)==null||u.resetFields()},N=m([]),O=m([]);return ae(async()=>{N.value=await Oe(),O.value=await Se()}),(u,r)=>{const I=oe,_=ue,s=_e,L=se,M=de,G=we,J=me,U=ne,w=ie,W=ce,k=pe,Y=Ie,j=fe,K=ye,Q=be,X=he;return d(),f(y,null,[a(Q,{modelValue:t(i),"onUpdate:modelValue":r[12]||(r[12]=e=>re(i)?i.value=e:null),title:t(A),width:"70%"},{footer:l(()=>[a(k,{disabled:t(c),type:"primary",onClick:E},{default:l(()=>[n("\u786E \u5B9A")]),_:1},8,["disabled"]),a(k,{onClick:r[11]||(r[11]=e=>i.value=!1)},{default:l(()=>[n("\u53D6 \u6D88")]),_:1})]),default:l(()=>[te((d(),p(K,{ref_key:"formRef",ref:h,model:t(o),rules:t(T),"label-width":"110px"},{default:l(()=>[a(j,null,{default:l(()=>[a(s,{span:12},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u6807\u9898",prop:"title"},{default:l(()=>[a(I,{modelValue:t(o).title,"onUpdate:modelValue":r[0]||(r[0]=e=>t(o).title=e),placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u6807\u9898"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u5206\u7C7B",prop:"categoryId"},{default:l(()=>[a(M,{modelValue:t(o).categoryId,"onUpdate:modelValue":r[1]||(r[1]=e=>t(o).categoryId=e),placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(d(!0),f(y,null,g(t(N),e=>(d(),p(L,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u4F5C\u8005",prop:"author"},{default:l(()=>[a(I,{modelValue:t(o).author,"onUpdate:modelValue":r[2]||(r[2]=e=>t(o).author=e),placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u4F5C\u8005"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u7B80\u4ECB",prop:"introduction"},{default:l(()=>[a(I,{modelValue:t(o).introduction,"onUpdate:modelValue":r[3]||(r[3]=e=>t(o).introduction=e),placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u7B80\u4ECB"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:24},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u5C01\u9762",prop:"picUrl"},{default:l(()=>[a(G,{modelValue:t(o).picUrl,"onUpdate:modelValue":r[4]||(r[4]=e=>t(o).picUrl=e),height:"80px"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u6392\u5E8F",prop:"sort"},{default:l(()=>[a(J,{modelValue:t(o).sort,"onUpdate:modelValue":r[5]||(r[5]=e=>t(o).sort=e),min:0,clearable:"","controls-position":"right"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[a(w,{modelValue:t(o).status,"onUpdate:modelValue":r[6]||(r[6]=e=>t(o).status=e)},{default:l(()=>[(d(!0),f(y,null,g(t(qe)(t(q).COMMON_STATUS),e=>(d(),p(U,{key:e.value,label:e.value},{default:l(()=>[n(b(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u662F\u5426\u70ED\u95E8",prop:"recommendHot"},{default:l(()=>[a(w,{modelValue:t(o).recommendHot,"onUpdate:modelValue":r[7]||(r[7]=e=>t(o).recommendHot=e)},{default:l(()=>[(d(!0),f(y,null,g(t(R)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(U,{key:e.value,label:e.value},{default:l(()=>[n(b(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:l(()=>[a(_,{label:"\u662F\u5426\u8F6E\u64AD\u56FE",prop:"recommendBanner"},{default:l(()=>[a(w,{modelValue:t(o).recommendBanner,"onUpdate:modelValue":r[8]||(r[8]=e=>t(o).recommendBanner=e)},{default:l(()=>[(d(!0),f(y,null,g(t(R)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(U,{key:e.value,label:e.value},{default:l(()=>[n(b(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(s,{span:24},{default:l(()=>[a(_,{label:"\u5546\u54C1\u5173\u8054",prop:"spuId"},{default:l(()=>[t(o).spuId?(d(),p(W,{key:0,class:"mr-10px"},{default:l(()=>{var e;return[n(b((e=t(O).find(v=>v.id===t(o).spuId))==null?void 0:e.name),1)]}),_:1})):le("",!0),a(k,{onClick:r[9]||(r[9]=e=>{var v;return(v=t(F))==null?void 0:v.open()})},{default:l(()=>[n("\u9009\u62E9\u5546\u54C1")]),_:1})]),_:1})]),_:1}),a(s,{span:24},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u5185\u5BB9"},{default:l(()=>[a(Y,{modelValue:t(o).content,"onUpdate:modelValue":r[10]||(r[10]=e=>t(o).content=e),height:"150px"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[X,t(c)]])]),_:1},8,["modelValue","title"]),a(t(He),{ref_key:"spuSelectRef",ref:F,onConfirm:z},null,512)],64)}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/promotion/article/ArticleForm.vue"]])});export{ta as __tla,S as default};