ArticleForm-cee0b553.js 8.8 KB

1
  1. import{d as Y,h as Z,r as n,e as ee,l as ae,o as d,c as f,f as a,w as l,a as t,n as m,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,bb as ne,ah as me,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-bd9277a1.js";import{_ as be,__tla as Ve}from"./Dialog-eba103da.js";import{_ as Ie,__tla as Ue}from"./Editor-f8dc75b1.js";import{_ as ke,__tla as we}from"./UploadImg-be688408.js";import{a as qe,D as q,g as O,__tla as xe}from"./dict-4b2e9fd3.js";import{g as Ae,c as Be,u as Ce,__tla as Fe}from"./index-89014124.js";import{g as Ne,__tla as Oe}from"./index-5a187613.js";import{k as Se,__tla as He}from"./spu-1de6da31.js";import Re,{__tla as Te}from"./SpuSelect-17e456e9.js";import{__tla as ze}from"./el-image-c6b72263.js";import{__tla as De}from"./el-image-viewer-995341ab.js";import{__tla as Ee}from"./index-b80ba4d7.js";import{__tla as Pe}from"./SkuList-b349d344.js";import{u as Ge,__tla as Le}from"./useMessage-274788d4.js";import{__tla as Me}from"./ContentWrap-7c73ab26.js";import{__tla as We}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5f6a2d0d.js";import{__tla as Xe}from"./el-card-bc8cec83.js";import{__tla as $e}from"./index-3118d255.js";import{__tla as je}from"./index-49ecf2ef.js";import{__tla as Je}from"./el-tree-select-9425e295.js";import{__tla as Ke}from"./index-c22719d0.js";import{__tla as Qe}from"./formatTime-8639ba1a.js";import"./tree-0af4953a.js";import{__tla as Ye}from"./category-ca717d96.js";import{__tla as Ze}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-24a8f241.js";import{__tla as ea}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-fb87e632.js";import{__tla as aa}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-806a322e.js";let S,ta=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Je}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return aa}catch{}})()]).then(async()=>{S=ve(Y({name:"PromotionArticleForm",__name:"ArticleForm",emits:["success"],setup(la,{expose:H,emit:R}){const{t:V}=Z(),x=Ge(),i=n(!1),A=n(""),c=n(!1),B=n(""),o=n({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=n(),C=n(),z=u=>{o.value.spuId=u};H({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=R,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 Ce(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()},F=n([]),N=n([]);return ae(async()=>{F.value=await Ne(),N.value=await Se()}),(u,r)=>{const I=oe,_=ue,s=_e,G=se,L=de,M=ke,W=ne,U=me,k=ie,X=ce,w=pe,$=Ie,j=fe,J=ye,K=be,Q=he;return d(),f(y,null,[a(K,{modelValue:t(i),"onUpdate:modelValue":r[12]||(r[12]=e=>re(i)?i.value=e:null),title:t(A),width:"70%"},{footer:l(()=>[a(w,{disabled:t(c),type:"primary",onClick:E},{default:l(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),a(w,{onClick:r[11]||(r[11]=e=>i.value=!1)},{default:l(()=>[m("\u53D6 \u6D88")]),_:1})]),default:l(()=>[te((d(),p(J,{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(L,{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(F),e=>(d(),p(G,{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(M,{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(W,{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(k,{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(()=>[m(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(k,{modelValue:t(o).recommendHot,"onUpdate:modelValue":r[7]||(r[7]=e=>t(o).recommendHot=e)},{default:l(()=>[(d(!0),f(y,null,g(t(O)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(U,{key:e.value,label:e.value},{default:l(()=>[m(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(k,{modelValue:t(o).recommendBanner,"onUpdate:modelValue":r[8]||(r[8]=e=>t(o).recommendBanner=e)},{default:l(()=>[(d(!0),f(y,null,g(t(O)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(U,{key:e.value,label:e.value},{default:l(()=>[m(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(X,{key:0,class:"mr-10px"},{default:l(()=>{var e;return[m(b((e=t(N).find(v=>v.id===t(o).spuId))==null?void 0:e.name),1)]}),_:1})):le("",!0),a(w,{onClick:r[9]||(r[9]=e=>{var v;return(v=t(C))==null?void 0:v.open()})},{default:l(()=>[m("\u9009\u62E9\u5546\u54C1")]),_:1})]),_:1})]),_:1}),a(s,{span:24},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u5185\u5BB9"},{default:l(()=>[a($,{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"])),[[Q,t(c)]])]),_:1},8,["modelValue","title"]),a(t(Re),{ref_key:"spuSelectRef",ref:C,onConfirm:z},null,512)],64)}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/mall/promotion/article/ArticleForm.vue"]])});export{ta as __tla,S as default};