ArticleForm-8a7fea18.js 8.6 KB

1
  1. import{d as Z,n as $,r as n,f as ee,B as ae,o as d,c as f,i as a,w as l,a as t,j as m,C as te,l as p,F as y,k as g,t as b,a2 as le,y as re,U as oe,H as ue,E as _e,D as se,G as de,c0 as ne,ag as me,ah as ie,ak as ce,J as pe,s as fe,K as ye,N as ve,_ as he,__tla as ge}from"./index-af173888.js";import{_ as be,__tla as Ve}from"./Dialog-987c90a1.js";import{_ as Ue,__tla as Ie}from"./Editor-c9f3a63b.js";import{_ as ke,__tla as we}from"./UploadImg-adf73e38.js";import{a as qe,D as q,g as R,__tla as Be}from"./dict-093d1dfa.js";import{g as Ne,c as Ae,u as He,__tla as xe}from"./index-6b555d1f.js";import{g as Fe,__tla as Re}from"./index-4e04de37.js";import{i as Se,__tla as Ce}from"./spu-41f2bf16.js";import Oe,{__tla as Te}from"./SpuSelect-fff8b892.js";import{__tla as De}from"./el-image-fdde0035.js";import{__tla as Ee}from"./el-image-viewer-0d82b94c.js";import{__tla as Ge}from"./index-4db4ba8b.js";import{__tla as Me}from"./SkuList-d8139bf9.js";import{u as ze,__tla as Je}from"./useMessage-170c1b43.js";import{__tla as Le}from"./ContentWrap-b959c1be.js";import{__tla as Pe}from"./el-card-178b9654.js";import{__tla as Xe}from"./index-a33d7937.js";import{__tla as je}from"./index-54b8f773.js";import{__tla as Ke}from"./el-tree-select-cd58540b.js";import{__tla as We}from"./index-0994e210.js";import{__tla as Ye}from"./formatTime-8a6f6c49.js";import"./tree-02f455f9.js";import{__tla as Qe}from"./category-8ca28490.js";import{__tla as Ze}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-9154d28f.js";import{__tla as $e}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-d9f75960.js";let S,ea=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Je}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return $e}catch{}})()]).then(async()=>{S=he(Z({name:"PromotionArticleForm",__name:"ArticleForm",emits:["success"],setup(aa,{expose:C,emit:O}){const{t:V}=$(),B=ze(),i=n(!1),N=n(""),c=n(!1),A=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"}]}),v=n(),H=n(),D=u=>{o.value.spuId=u};C({open:async(u,r)=>{if(i.value=!0,N.value=V("action."+u),A.value=u,M(),r){c.value=!0;try{o.value=await Ne(r)}finally{c.value=!1}}}});const E=O,G=async()=>{if(v&&await v.value.validate()){c.value=!0;try{const u=o.value;A.value==="create"?(await Ae(u),B.success(V("common.createSuccess"))):(await He(u),B.success(V("common.updateSuccess"))),i.value=!1,E("success")}finally{c.value=!1}}},M=()=>{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()},x=n([]),F=n([]);return ae(async()=>{x.value=await Fe(),F.value=await Se()}),(u,r)=>{const U=oe,_=ue,s=_e,z=se,J=de,L=ke,P=ne,I=me,k=ie,X=ce,w=pe,j=Ue,K=fe,W=ye,Y=be,Q=ve;return d(),f(y,null,[a(Y,{modelValue:t(i),"onUpdate:modelValue":r[12]||(r[12]=e=>re(i)?i.value=e:null),title:t(N),width:"70%"},{footer:l(()=>[a(w,{disabled:t(c),type:"primary",onClick:G},{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(W,{ref_key:"formRef",ref:v,model:t(o),rules:t(T),"label-width":"110px"},{default:l(()=>[a(K,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(J,{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(x),e=>(d(),p(z,{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(L,{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(P,{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(()=>[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(R)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(I,{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(R)(t(q).INFRA_BOOLEAN_STRING),e=>(d(),p(I,{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(F).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(H))==null?void 0:h.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(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"])),[[Q,t(c)]])]),_:1},8,["modelValue","title"]),a(t(Oe),{ref_key:"spuSelectRef",ref:H,onConfirm:D},null,512)],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/promotion/article/ArticleForm.vue"]])});export{ea as __tla,S as default};