import{x as b,d as g,Q as H,r as i,o as R,A as V,B as u,f,a as o,E as T,k as j,a2 as x,K as E,Z as A,__tla as O}from"./index-92ad187a.js";import{_ as B,__tla as D}from"./Dialog-44c9fa34.js";import{_ as I,__tla as K}from"./Form-e4dc4c6b.js";import{a as N,c as Q,u as Z,__tla as q}from"./seckillConfig-4d57d01d.js";import{d as z,__tla as G}from"./formatTime-c7f253d6.js";import{r as m,__tla as J}from"./formRules-bab8ffd5.js";import{D as L,__tla as W}from"./dict-221f3e01.js";import{u as X,__tla as Y}from"./useCrudSchemas-4b408cc7.js";import{u as $,__tla as ee}from"./useMessage-d9788660.js";let U,d,ae=Promise.all([(()=>{try{return O}catch{}})(),(()=>{try{return D}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return q}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return J}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return ee}catch{}})()]).then(async()=>{let p,h;p=b({name:[m],startTime:[m],endTime:[m],picUrl:[m],status:[m]}),h=b([{label:"\u79D2\u6740\u65F6\u6BB5\u540D\u79F0",field:"name",isSearch:!0},{label:"\u5F00\u59CB\u65F6\u95F4\u70B9",field:"startTime",isSearch:!1,search:{component:"TimePicker"},form:{component:"TimePicker",componentProps:{valueFormat:"HH:mm:ss"}}},{label:"\u7ED3\u675F\u65F6\u95F4\u70B9",field:"endTime",isSearch:!1,search:{component:"TimePicker"},form:{component:"TimePicker",componentProps:{valueFormat:"HH:mm:ss"}}},{label:"\u79D2\u6740\u8F6E\u64AD\u56FE",field:"sliderPicUrls",isSearch:!1,form:{component:"UploadImgs"},table:{width:300}},{label:"\u72B6\u6001",field:"status",dictType:L.COMMON_STATUS,dictClass:"number",isSearch:!0,form:{component:"Radio"}},{label:"\u521B\u5EFA\u65F6\u95F4",field:"createTime",isForm:!1,isSearch:!1,formatter:z},{label:"\u64CD\u4F5C",field:"action",isForm:!1}]),{allSchemas:d}=X(h),U=g({__name:"SeckillConfigForm",emits:["success"],setup(te,{expose:k,emit:F}){const{t:n}=H(),y=$(),r=i(!1),v=i(""),l=i(!1),S=i(""),s=i();k({open:async(t,e)=>{var a;if(r.value=!0,v.value=n("action."+t),S.value=t,e){l.value=!0;try{const c=await N(e);c.sliderPicUrls=(a=c.sliderPicUrls)==null?void 0:a.map(_=>({url:_})),s.value.setValues(c)}finally{l.value=!1}}}});const w=F,C=async()=>{if(s&&await s.value.getElFormRef().validate()){l.value=!0;try{const t=[];s.value.formModel.sliderPicUrls.forEach(a=>{typeof a=="object"?t.push(a.url):t.push(a)});const e={...s.value.formModel,sliderPicUrls:t};S.value==="create"?(await Q(e),y.success(n("common.createSuccess"))):(await Z(e),y.success(n("common.updateSuccess"))),r.value=!1,w("success")}finally{l.value=!1}}};return(t,e)=>{const a=I,c=E,_=B,M=A;return R(),V(_,{modelValue:o(r),"onUpdate:modelValue":e[1]||(e[1]=P=>x(r)?r.value=P:null),title:o(v)},{footer:u(()=>[f(c,{disabled:o(l),type:"primary",onClick:C},{default:u(()=>[T("\u786E \u5B9A")]),_:1},8,["disabled"]),f(c,{onClick:e[0]||(e[0]=P=>r.value=!1)},{default:u(()=>[T("\u53D6 \u6D88")]),_:1})]),default:u(()=>[j(f(a,{ref_key:"formRef",ref:s,rules:o(p),schema:o(d).formSchema},null,8,["rules","schema"]),[[M,o(l)]])]),_:1},8,["modelValue","title"])}}})});export{U as _,ae as __tla,d as a};
