1 |
- import{d as Z,h as $,r as n,e as aa,l as ea,o as d,c as f,f as e,w as l,a as t,n as m,x as ta,v as p,F as y,q as g,t as b,P as la,O as ra,V as oa,A as ua,E as _a,y as sa,z as da,bd as na,ah as ma,ai as ia,al as ca,C as pa,i as fa,D as ya,I as ha,_ as va,__tla as ga}from"./index-e3afde76.js";import{_ as ba,__tla as Va}from"./Dialog-c20523c4.js";import{_ as Ia,__tla as Ua}from"./Editor-9c92736f.js";import{_ as wa,__tla as ka}from"./UploadImg-78fd4518.js";import{a as qa,D as q,g as S,__tla as xa}from"./dict-a141296d.js";import{g as Aa,c as Ba,u as Fa,__tla as Na}from"./index-1e808ce2.js";import{g as Oa,__tla as Sa}from"./index-335ed373.js";import{h as Ca,__tla as Ha}from"./spu-9313bd7b.js";import Ra,{__tla as Ta}from"./SpuSelect-ba387fee.js";import{__tla as za}from"./el-image-65304aa9.js";import{__tla as Da}from"./el-image-viewer-9d1c7d33.js";import{__tla as Ea}from"./index-15373756.js";import{__tla as Pa}from"./SkuList-ea3d1cb7.js";import{u as La,__tla as Ma}from"./useMessage-0b1b25bd.js";import{__tla as Ga}from"./ContentWrap-5f2f4872.js";import{__tla as Ja}from"./el-card-6198c22a.js";import{__tla as Ka}from"./index-51c17e69.js";import{__tla as Ya}from"./index-2d20a7ff.js";import{__tla as ja}from"./el-tree-select-58251b07.js";import{__tla as Qa}from"./index-7cf37194.js";import{__tla as Wa}from"./formatTime-cee700cd.js";import"./tree-0af4953a.js";import{__tla as Xa}from"./category-e7301561.js";import{__tla as Za}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-eb39998f.js";import{__tla as $a}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-919f7924.js";import{__tla as ae}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-97b1f5ff.js";let C,ee=Promise.all([(()=>{try{return ga}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return Ma}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Wa}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{C=va(Z({name:"PromotionArticleForm",__name:"ArticleForm",emits:["success"],setup(te,{expose:H,emit:R}){const{t:V}=$(),x=La(),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=aa({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(),F=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 Aa(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 Ba(u),x.success(V("common.createSuccess"))):(await Fa(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=n([]),O=n([]);return ea(async()=>{N.value=await Oa(),O.value=await Ca()}),(u,r)=>{const I=oa,_=ua,s=_a,L=sa,M=da,G=wa,J=na,U=ma,w=ia,K=ca,k=pa,Y=Ia,j=fa,Q=ya,W=ba,X=ha;return d(),f(y,null,[e(W,{modelValue:t(i),"onUpdate:modelValue":r[12]||(r[12]=a=>ra(i)?i.value=a:null),title:t(A),width:"70%"},{footer:l(()=>[e(k,{disabled:t(c),type:"primary",onClick:E},{default:l(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),e(k,{onClick:r[11]||(r[11]=a=>i.value=!1)},{default:l(()=>[m("\u53D6 \u6D88")]),_:1})]),default:l(()=>[ta((d(),p(Q,{ref_key:"formRef",ref:h,model:t(o),rules:t(T),"label-width":"110px"},{default:l(()=>[e(j,null,{default:l(()=>[e(s,{span:12},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u6807\u9898",prop:"title"},{default:l(()=>[e(I,{modelValue:t(o).title,"onUpdate:modelValue":r[0]||(r[0]=a=>t(o).title=a),placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u6807\u9898"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u5206\u7C7B",prop:"categoryId"},{default:l(()=>[e(M,{modelValue:t(o).categoryId,"onUpdate:modelValue":r[1]||(r[1]=a=>t(o).categoryId=a),placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(d(!0),f(y,null,g(t(N),a=>(d(),p(L,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u4F5C\u8005",prop:"author"},{default:l(()=>[e(I,{modelValue:t(o).author,"onUpdate:modelValue":r[2]||(r[2]=a=>t(o).author=a),placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u4F5C\u8005"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u7B80\u4ECB",prop:"introduction"},{default:l(()=>[e(I,{modelValue:t(o).introduction,"onUpdate:modelValue":r[3]||(r[3]=a=>t(o).introduction=a),placeholder:"\u8BF7\u8F93\u5165\u6587\u7AE0\u7B80\u4ECB"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:24},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u5C01\u9762",prop:"picUrl"},{default:l(()=>[e(G,{modelValue:t(o).picUrl,"onUpdate:modelValue":r[4]||(r[4]=a=>t(o).picUrl=a),height:"80px"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u6392\u5E8F",prop:"sort"},{default:l(()=>[e(J,{modelValue:t(o).sort,"onUpdate:modelValue":r[5]||(r[5]=a=>t(o).sort=a),min:0,clearable:"","controls-position":"right"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[e(w,{modelValue:t(o).status,"onUpdate:modelValue":r[6]||(r[6]=a=>t(o).status=a)},{default:l(()=>[(d(!0),f(y,null,g(t(qa)(t(q).COMMON_STATUS),a=>(d(),p(U,{key:a.value,label:a.value},{default:l(()=>[m(b(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u662F\u5426\u70ED\u95E8",prop:"recommendHot"},{default:l(()=>[e(w,{modelValue:t(o).recommendHot,"onUpdate:modelValue":r[7]||(r[7]=a=>t(o).recommendHot=a)},{default:l(()=>[(d(!0),f(y,null,g(t(S)(t(q).INFRA_BOOLEAN_STRING),a=>(d(),p(U,{key:a.value,label:a.value},{default:l(()=>[m(b(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(s,{span:12},{default:l(()=>[e(_,{label:"\u662F\u5426\u8F6E\u64AD\u56FE",prop:"recommendBanner"},{default:l(()=>[e(w,{modelValue:t(o).recommendBanner,"onUpdate:modelValue":r[8]||(r[8]=a=>t(o).recommendBanner=a)},{default:l(()=>[(d(!0),f(y,null,g(t(S)(t(q).INFRA_BOOLEAN_STRING),a=>(d(),p(U,{key:a.value,label:a.value},{default:l(()=>[m(b(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(s,{span:24},{default:l(()=>[e(_,{label:"\u5546\u54C1\u5173\u8054",prop:"spuId"},{default:l(()=>[t(o).spuId?(d(),p(K,{key:0,class:"mr-10px"},{default:l(()=>{var a;return[m(b((a=t(O).find(v=>v.id===t(o).spuId))==null?void 0:a.name),1)]}),_:1})):la("",!0),e(k,{onClick:r[9]||(r[9]=a=>{var v;return(v=t(F))==null?void 0:v.open()})},{default:l(()=>[m("\u9009\u62E9\u5546\u54C1")]),_:1})]),_:1})]),_:1}),e(s,{span:24},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u5185\u5BB9"},{default:l(()=>[e(Y,{modelValue:t(o).content,"onUpdate:modelValue":r[10]||(r[10]=a=>t(o).content=a),height:"150px"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[X,t(c)]])]),_:1},8,["modelValue","title"]),e(t(Ra),{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{ee as __tla,C as default};
|