ArticleForm-b69c25cf.js 8.7 KB

1
  1. import{d as Y,P as $,r as m,x as ee,b as ae,o as d,c as f,f as a,A as l,a as t,D as n,k as te,C as p,F as y,R as g,E as b,a3 as le,a2 as re,a9 as oe,V as ue,H as _e,S as se,U as de,bQ as me,at as ne,au as ie,aw as ce,J as pe,K as fe,W as ye,Z as ve,_ as he,__tla as ge}from"./index-286756b9.js";import{_ as be,__tla as Ve}from"./Dialog-4c2de357.js";import{_ as Ue,__tla as Ie}from"./Editor-514f76f8.js";import{_ as ke,__tla as we}from"./UploadImg-d2713eac.js";import{a as qe,D as q,g as N,__tla as xe}from"./dict-82dca549.js";import{g as Ae,c as Be,u as Se,__tla as Fe}from"./index-641c04d0.js";import{g as He,__tla as Ne}from"./index-7a024e0c.js";import{h as Re,__tla as Ce}from"./spu-c6e01563.js";import Oe,{__tla as Te}from"./SpuSelect-ad7305a3.js";import{__tla as De}from"./el-image-73c105b7.js";import{__tla as Ee}from"./el-image-viewer-e0e5d3be.js";import{__tla as Pe}from"./index-5a40c383.js";import{__tla as ze}from"./SkuList-7139770f.js";import{u as Ge,__tla as Le}from"./useMessage-084b1e70.js";import{__tla as Ke}from"./ContentWrap-83998678.js";import{__tla as Me}from"./el-card-d3d5a654.js";import{__tla as We}from"./index-ed6c67a8.js";import{__tla as Je}from"./index-fb47c94c.js";import{__tla as Qe}from"./el-tree-select-7a83bfa8.js";import{__tla as Xe}from"./index-99c3aa61.js";import{__tla as Ze}from"./formatTime-83e416ef.js";import"./tree-0af4953a.js";import{__tla as je}from"./category-2d544841.js";import{__tla as Ye}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-6643271d.js";import{__tla as $e}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-a65d467a.js";import{__tla as ea}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-3e346ba0.js";let R,aa=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Je}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return ea}catch{}})()]).then(async()=>{R=he(Y({name:"PromotionArticleForm",__name:"ArticleForm",emits:["success"],setup(ta,{expose:C,emit:O}){const{t:V}=$(),x=Ge(),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"}]}),v=m(),S=m(),D=u=>{o.value.spuId=u};C({open:async(u,r)=>{if(i.value=!0,A.value=V("action."+u),B.value=u,z(),r){c.value=!0;try{o.value=await Ae(r)}finally{c.value=!1}}}});const E=O,P=async()=>{if(v&&await v.value.validate()){c.value=!0;try{const u=o.value;B.value==="create"?(await Be(u),x.success(V("common.createSuccess"))):(await Se(u),x.success(V("common.updateSuccess"))),i.value=!1,E("success")}finally{c.value=!1}}},z=()=>{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=v.value)==null||u.resetFields()},F=m([]),H=m([]);return ae(async()=>{F.value=await He(),H.value=await Re()}),(u,r)=>{const U=oe,_=ue,s=_e,G=se,L=de,K=ke,M=me,I=ne,k=ie,W=ce,w=pe,J=Ue,Q=fe,X=ye,Z=be,j=ve;return d(),f(y,null,[a(Z,{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:P},{default:l(()=>[n("\u786E \u5B9A")]),_:1},8,["disabled"]),a(w,{onClick:r[11]||(r[11]=e=>i.value=!1)},{default:l(()=>[n("\u53D6 \u6D88")]),_:1})]),default:l(()=>[te((d(),p(X,{ref_key:"formRef",ref:v,model:t(o),rules:t(T),"label-width":"110px"},{default:l(()=>[a(Q,null,{default:l(()=>[a(s,{span:12},{default:l(()=>[a(_,{label:"\u6587\u7AE0\u6807\u9898",prop:"title"},{default:l(()=>[a(U,{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(U,{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(U,{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(K,{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(M,{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(I,{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(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(N)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(I,{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(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(N)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(I,{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(H).find(h=>h.id===t(o).spuId))==null?void 0:e.name),1)]}),_:1})):le("",!0),a(w,{onClick:r[9]||(r[9]=e=>{var h;return(h=t(S))==null?void 0:h.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(J,{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"])),[[j,t(c)]])]),_:1},8,["modelValue","title"]),a(t(Oe),{ref_key:"spuSelectRef",ref:S,onConfirm:D},null,512)],64)}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/promotion/article/ArticleForm.vue"]])});export{aa as __tla,R as default};