import{d as Y,h as Z,r as m,e as aa,q as ea,o as d,c as f,f as e,w as l,a as t,y as n,z as ta,x as p,F as y,v as g,t as b,a0 as la,l as ra,R as oa,C as ua,E as _a,A as sa,B as da,bw as ma,ad as na,ae as ia,ah as ca,G as pa,i as fa,H as ya,K as ha,_ as va,__tla as ga}from"./index-8dc1e40a.js";import{_ as ba,__tla as Va}from"./Dialog-41802231.js";import{_ as Ua,__tla as Ia}from"./Editor-78efff00.js";import{_ as wa,__tla as ka}from"./UploadImg-c2c75279.js";import{a as qa,D as q,g as N,__tla as Ba}from"./dict-f13a3c8f.js";import{g as Aa,c as xa,u as Ha,__tla as Ra}from"./index-f66b41c5.js";import{g as Fa,__tla as Na}from"./index-80a3a50f.js";import{h as Sa,__tla as Ca}from"./spu-559f5d98.js";import Oa,{__tla as Ta}from"./SpuSelect-da2ca050.js";import{__tla as Ea}from"./el-image-6a48e9f1.js";import{__tla as Ga}from"./el-image-viewer-3b8905e6.js";import{__tla as za}from"./index-519182c1.js";import{__tla as Da}from"./SkuList-d3adf088.js";import{u as La,__tla as Pa}from"./useMessage-7a27dd80.js";import{__tla as Ma}from"./ContentWrap-0aca5216.js";import{__tla as Ja}from"./el-card-18df90f0.js";import{__tla as Ka}from"./index-64aeaa78.js";import{__tla as Wa}from"./index-803dbf9a.js";import{__tla as Xa}from"./el-tree-select-d82790d8.js";import{__tla as $a}from"./index-c31b5019.js";import{__tla as ja}from"./formatTime-8a155b2e.js";import"./tree-0af4953a.js";import{__tla as Qa}from"./category-e7433506.js";import{__tla as Ya}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-703a828c.js";import{__tla as Za}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-c25ae3d0.js";import{__tla as ae}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-fa07b40d.js";let S,ee=Promise.all([(()=>{try{return ga}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return Ma}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return Wa}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{S=va(Y({name:"PromotionArticleForm",__name:"ArticleForm",emits:["success"],setup(te,{expose:C,emit:O}){const{t:V}=Z(),B=La(),i=m(!1),A=m(""),c=m(!1),x=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=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=m(),H=m(),E=u=>{o.value.spuId=u};C({open:async(u,r)=>{if(i.value=!0,A.value=V("action."+u),x.value=u,D(),r){c.value=!0;try{o.value=await Aa(r)}finally{c.value=!1}}}});const G=O,z=async()=>{if(h&&await h.value.validate()){c.value=!0;try{const u=o.value;x.value==="create"?(await xa(u),B.success(V("common.createSuccess"))):(await Ha(u),B.success(V("common.updateSuccess"))),i.value=!1,G("success")}finally{c.value=!1}}},D=()=>{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()},R=m([]),F=m([]);return ea(async()=>{R.value=await Fa(),F.value=await Sa()}),(u,r)=>{const U=oa,_=ua,s=_a,L=sa,P=da,M=wa,J=ma,I=na,w=ia,K=ca,k=pa,W=Ua,X=fa,$=ya,j=ba,Q=ha;return d(),f(y,null,[e(j,{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:z},{default:l(()=>[n("\u786E \u5B9A")]),_:1},8,["disabled"]),e(k,{onClick:r[11]||(r[11]=a=>i.value=!1)},{default:l(()=>[n("\u53D6 \u6D88")]),_:1})]),default:l(()=>[ta((d(),p($,{ref_key:"formRef",ref:h,model:t(o),rules:t(T),"label-width":"110px"},{default:l(()=>[e(X,null,{default:l(()=>[e(s,{span:12},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u6807\u9898",prop:"title"},{default:l(()=>[e(U,{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(P,{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(R),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(U,{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(U,{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(M,{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(I,{key:a.value,label:a.value},{default:l(()=>[n(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(N)(t(q).INFRA_BOOLEAN_STRING),a=>(d(),p(I,{key:a.value,label:a.value},{default:l(()=>[n(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(N)(t(q).INFRA_BOOLEAN_STRING),a=>(d(),p(I,{key:a.value,label:a.value},{default:l(()=>[n(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[n(b((a=t(F).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(H))==null?void 0:v.open()})},{default:l(()=>[n("\u9009\u62E9\u5546\u54C1")]),_:1})]),_:1})]),_:1}),e(s,{span:24},{default:l(()=>[e(_,{label:"\u6587\u7AE0\u5185\u5BB9"},{default:l(()=>[e(W,{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"])),[[Q,t(c)]])]),_:1},8,["modelValue","title"]),e(t(Oa),{ref_key:"spuSelectRef",ref:H,onConfirm:E},null,512)],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/promotion/article/ArticleForm.vue"]])});export{ee as __tla,S as default};