1 |
- import{e as L,d as K,h as X,r as c,o as M,c as q,f as _,w as i,a as o,y as g,z as J,x as O,l as W,F as Z,bi as $,aG as B,bj as Q,aj as tt,G as at,bw as et,I as rt,K as lt,_ as ot,__tla as st}from"./index-8dc1e40a.js";import{_ as _t,__tla as ct}from"./Dialog-41802231.js";import{_ as it,__tla as mt}from"./Form-03af17d7.js";import ut,{__tla as nt}from"./SpuSelect-da2ca050.js";import pt,{__tla as ft}from"./SpuAndSkuList-9680abd3.js";import{b as R,__tla as dt}from"./formatTime-8a155b2e.js";import{g as ht,__tla as yt}from"./seckillConfig-da21e7d1.js";import{r as m,__tla as vt}from"./formRules-467f9efe.js";import{u as kt,__tla as bt}from"./useCrudSchemas-2adc3ead.js";import{g as wt,c as gt,u as Pt,__tla as St}from"./seckillActivity-e10725f3.js";import{e as Ct,__tla as It}from"./spu-559f5d98.js";import{g as Ft,__tla as Vt}from"./index-c31b5019.js";import{u as Dt,__tla as xt}from"./useMessage-7a27dd80.js";import{__tla as Yt}from"./el-virtual-list-7d2f4f55.js";import{__tla as Lt}from"./el-tree-select-d82790d8.js";import{__tla as Mt}from"./el-time-select-c3304867.js";import{__tla as Rt}from"./InputPassword-edfbc29e.js";import{__tla as Ut}from"./Editor-78efff00.js";import{__tla as At}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-703a828c.js";import{__tla as Tt}from"./index-519182c1.js";import{__tla as Et}from"./el-image-viewer-3b8905e6.js";import{__tla as Nt}from"./UploadImg-c2c75279.js";import{__tla as jt}from"./UploadImgs-c9e344db.js";import{__tla as zt}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-c25ae3d0.js";import{__tla as Gt}from"./UploadFile-8d93ebfd.js";import{__tla as Ht}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-fa07b40d.js";import{__tla as Kt}from"./fixed-size-list-1ef224b0.js";import{__tla as Xt}from"./ContentWrap-0aca5216.js";import{__tla as qt}from"./el-card-18df90f0.js";import{__tla as Jt}from"./index-64aeaa78.js";import{__tla as Ot}from"./index-803dbf9a.js";import{__tla as Wt}from"./el-image-6a48e9f1.js";import"./tree-0af4953a.js";import{__tla as Zt}from"./category-e7433506.js";import{__tla as $t}from"./SkuList-d3adf088.js";import{__tla as Bt}from"./dict-f13a3c8f.js";import{__tla as Qt}from"./DictTag-85aade2b.js";import"./color-6e929987.js";let U,ta=Promise.all([(()=>{try{return st}catch{}})(),(()=>{try{return ct}catch{}})(),(()=>{try{return mt}catch{}})(),(()=>{try{return nt}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return dt}catch{}})(),(()=>{try{return yt}catch{}})(),(()=>{try{return vt}catch{}})(),(()=>{try{return bt}catch{}})(),(()=>{try{return St}catch{}})(),(()=>{try{return It}catch{}})(),(()=>{try{return Vt}catch{}})(),(()=>{try{return xt}catch{}})(),(()=>{try{return Yt}catch{}})(),(()=>{try{return Lt}catch{}})(),(()=>{try{return Mt}catch{}})(),(()=>{try{return Rt}catch{}})(),(()=>{try{return Ut}catch{}})(),(()=>{try{return At}catch{}})(),(()=>{try{return Tt}catch{}})(),(()=>{try{return Et}catch{}})(),(()=>{try{return Nt}catch{}})(),(()=>{try{return jt}catch{}})(),(()=>{try{return zt}catch{}})(),(()=>{try{return Gt}catch{}})(),(()=>{try{return Ht}catch{}})(),(()=>{try{return Kt}catch{}})(),(()=>{try{return Xt}catch{}})(),(()=>{try{return qt}catch{}})(),(()=>{try{return Jt}catch{}})(),(()=>{try{return Ot}catch{}})(),(()=>{try{return Wt}catch{}})(),(()=>{try{return Zt}catch{}})(),(()=>{try{return $t}catch{}})(),(()=>{try{return Bt}catch{}})(),(()=>{try{return Qt}catch{}})()]).then(async()=>{let P,S,C;P=L({spuId:[m],name:[m],startTime:[m],endTime:[m],sort:[m],configIds:[m],totalLimitCount:[m],singleLimitCount:[m],totalStock:[m]}),S=L([{label:"\u79D2\u6740\u6D3B\u52A8\u540D\u79F0",field:"name",isSearch:!0,form:{colProps:{span:24}},table:{width:120}},{label:"\u6D3B\u52A8\u5F00\u59CB\u65F6\u95F4",field:"startTime",formatter:R,isSearch:!0,search:{component:"DatePicker",componentProps:{valueFormat:"YYYY-MM-DD",type:"daterange"}},form:{component:"DatePicker",componentProps:{type:"date",valueFormat:"x"}},table:{width:120}},{label:"\u6D3B\u52A8\u7ED3\u675F\u65F6\u95F4",field:"endTime",formatter:R,isSearch:!0,search:{component:"DatePicker",componentProps:{valueFormat:"YYYY-MM-DD",type:"daterange"}},form:{component:"DatePicker",componentProps:{type:"date",valueFormat:"x"}},table:{width:120}},{label:"\u79D2\u6740\u65F6\u6BB5",field:"configIds",form:{component:"Select",componentProps:{multiple:!0,optionsAlias:{labelField:"name",valueField:"id"}},api:ht},table:{width:300}},{label:"\u603B\u9650\u8D2D\u6570\u91CF",field:"totalLimitCount",form:{component:"InputNumber",value:0},table:{width:120}},{label:"\u5355\u6B21\u9650\u591F\u6570\u91CF",field:"singleLimitCount",form:{component:"InputNumber",value:0},table:{width:120}},{label:"\u6392\u5E8F",field:"sort",form:{component:"InputNumber",value:0},table:{width:80}},{label:"\u79D2\u6740\u6D3B\u52A8\u5546\u54C1",field:"spuId",isTable:!0,isSearch:!1,form:{colProps:{span:24}},table:{width:300}},{label:"\u5907\u6CE8",field:"remark",isSearch:!1,form:{component:"Input",componentProps:{type:"textarea",rows:4},colProps:{span:24}},table:{width:300}}]),{allSchemas:C}=kt(S),U=ot(K({name:"PromotionSeckillActivityForm",__name:"SeckillActivityForm",emits:["success"],setup(aa,{expose:A,emit:T}){const{t:b}=X(),I=Dt(),f=c(!1),F=c(""),d=c(!1),V=c(""),u=c(),D=c(),x=c(),E=[{name:"productConfig.stock",rule:a=>a>=1,message:"\u5546\u54C1\u79D2\u6740\u5E93\u5B58\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 1 \uFF01\uFF01\uFF01"},{name:"productConfig.seckillPrice",rule:a=>a>=.01,message:"\u5546\u54C1\u79D2\u6740\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \uFF01\uFF01\uFF01"}],y=c([]),w=c([]),N=(a,t)=>{u.value.setValues({spuId:a}),Y(a,t)},Y=async(a,t,l)=>{var v;const s=[],n=await Ct([a]);if(n.length==0)return;y.value=[];const r=n[0],h=t===void 0?r==null?void 0:r.skus:(v=r==null?void 0:r.skus)==null?void 0:v.filter(e=>t.includes(e.id));h==null||h.forEach(e=>{let p={skuId:e.id,stock:0,seckillPrice:0};if(l!==void 0){const k=l.find(H=>H.skuId===e.id);k&&(k.seckillPrice=$(k.seckillPrice)),p=k||p}e.productConfig=p}),r.skus=h,s.push({spuId:r.id,spuDetail:r,propertyList:Ft(r)}),y.value.push(r),w.value=s};A({open:async(a,t)=>{var l;if(f.value=!0,F.value=b("action."+a),V.value=a,await G(),t){d.value=!0;try{const s=await wt(t);await Y(s.spuId,(l=s.products)==null?void 0:l.map(n=>n.skuId),s.products),u.value.setValues(s)}finally{d.value=!1}}}});const j=T,z=async()=>{if(u&&await u.value.getElFormRef().validate()){d.value=!0;try{const a=B(x.value.getSkuConfigs("productConfig"));a.forEach(l=>{l.seckillPrice=Q(l.seckillPrice)});const t=u.value.formModel;t.products=a,V.value==="create"?(await gt(t),I.success(b("common.createSuccess"))):(await Pt(t),I.success(b("common.updateSuccess"))),f.value=!1,j("success")}finally{d.value=!1}}},G=async()=>{y.value=[],w.value=[],await tt(),u.value.getElFormRef().resetFields()};return(a,t)=>{const l=at,s=et,n=rt,r=it,h=_t,v=lt;return M(),q(Z,null,[_(h,{modelValue:o(f),"onUpdate:modelValue":t[2]||(t[2]=e=>W(f)?f.value=e:null),title:o(F),width:"65%"},{footer:i(()=>[_(l,{disabled:o(d),type:"primary",onClick:z},{default:i(()=>[g("\u786E \u5B9A")]),_:1},8,["disabled"]),_(l,{onClick:t[1]||(t[1]=e=>f.value=!1)},{default:i(()=>[g("\u53D6 \u6D88")]),_:1})]),default:i(()=>[J((M(),O(r,{ref_key:"formRef",ref:u,isCol:!0,rules:o(P),schema:o(C).formSchema},{spuId:i(()=>[_(l,{onClick:t[0]||(t[0]=e=>o(D).open())},{default:i(()=>[g("\u9009\u62E9\u5546\u54C1")]),_:1}),_(o(pt),{ref_key:"spuAndSkuListRef",ref:x,"rule-config":E,"spu-list":o(y),"spu-property-list-p":o(w)},{default:i(()=>[_(n,{align:"center",label:"\u79D2\u6740\u5E93\u5B58","min-width":"168"},{default:i(({row:e})=>[_(s,{modelValue:e.productConfig.stock,"onUpdate:modelValue":p=>e.productConfig.stock=p,min:0,class:"w-100%"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),_(n,{align:"center",label:"\u79D2\u6740\u4EF7\u683C(\u5143)","min-width":"168"},{default:i(({row:e})=>[_(s,{modelValue:e.productConfig.seckillPrice,"onUpdate:modelValue":p=>e.productConfig.seckillPrice=p,min:0,precision:2,step:.1,class:"w-100%"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["spu-list","spu-property-list-p"])]),_:1},8,["rules","schema"])),[[v,o(d)]])]),_:1},8,["modelValue","title"]),_(o(ut),{ref_key:"spuSelectRef",ref:D,isSelectSku:!0,onConfirm:N},null,512)],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue"]])});export{ta as __tla,U as default};
|