import{d as I,z as J,r as c,f as Q,x as $,Q as L,o as p,c as T,i as a,w as l,a as o,R as W,F as D,A as X,j as d,m,B as f,t as C,aY as Z,V as aa,G as ea,C as ta,D as la,_ as oa,q as ia,H as ra,I as pa,J as ma,K as sa}from"./index-92f7a16c.js";import{_ as na}from"./index.vue_vue_type_script_setup_true_lang-059ec67a.js";import{_ as ua}from"./DictTag.vue_vue_type_script_lang-34041e25.js";import{E as ca}from"./el-image-b5c91f66.js";import"./el-image-viewer-668f12f8.js";import{_ as da}from"./ContentWrap.vue_vue_type_script_setup_true_lang-93cdc892.js";import{a as fa,D as P}from"./dict-b31d62c6.js";import{f as z,d as wa}from"./formatTime-71947df8.js";import{a as _a,b as ba,d as ya}from"./combinationActivity-2bab19d5.js";import{_ as ha}from"./CombinationActivityForm.vue_vue_type_script_setup_true_lang-cba517d6.js";import{f as ga}from"./formatter-df32efe7.js";import{u as va}from"./useMessage-f6048a9f.js";import"./index-579dde8f.js";import"./color-6e929987.js";import"./el-card-e60c275e.js";import"./Dialog-524c7d28.js";import"./_plugin-vue_export-helper-1b428a4d.js";import"./Form-0d5e375d.js";import"./el-virtual-list-ca7ab789.js";import"./el-tree-select-4c0548d3.js";import"./el-time-select-2783b2e3.js";import"./InputPassword-037ae163.js";import"./InputPassword.vue_vue_type_style_index_0_scoped_0af03974_lang-bb0df722.js";import"./style.css_vue_type_style_index_0_src_true_lang-d17c7064.js";import"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-9ca6f58d.js";import"./index-53ab5084.js";import"./UploadImg-7f651e4b.js";import"./UploadImgs-905a3324.js";import"./UploadImgs.vue_vue_type_style_index_0_scoped_bad238b9_lang-c7fc1fae.js";import"./UploadFile-2d1c39f8.js";import"./UploadFile.vue_vue_type_style_index_0_scoped_a9e67aa2_lang-10e7d64a.js";import"./formRules-ffb17ad4.js";import"./useCrudSchemas-c988da71.js";import"./tree-0af4953a.js";import"./SpuSelect.vue_vue_type_script_setup_true_lang-446b7eea.js";import"./index-2e6bfa2a.js";import"./SkuList.vue_vue_type_script_setup_true_lang-b6defbcf.js";import"./PcComponents.css_vue_type_style_index_0_src_5455114c_scoped_5455114c_lang-b0291120.js";import"./category-8e584cf1.js";import"./spu-7bbcf2cd.js";import"./SpuAndSkuList.vue_vue_type_script_setup_true_lang-c5c954fe.js";const ka=I({name:"PromotionBargainActivity",__name:"index",setup(Ca){const w=va(),{t:A}=J(),b=c(!0),x=c(0),S=c([]),r=Q({pageNo:1,pageSize:10,name:null,status:null}),M=c();c(!1);const n=async()=>{b.value=!0;try{const s=await _a(r);S.value=s.list,x.value=s.total}finally{b.value=!1}},y=()=>{r.pageNo=1,n()},O=()=>{M.value.resetFields(),y()},Y=c(),N=(s,t)=>{Y.value.open(s,t)},B=s=>{const t=Math.min(...s.map(h=>h.combinationPrice));return`\uFFE5${Z(t)}`};return $(async()=>{await n()}),(s,t)=>{const h=aa,g=ea,F=ta,K=la,v=oa,u=ia,R=ra,U=da,i=pa,q=ca,j=ua,E=ma,G=na,_=L("hasPermi"),H=sa;return p(),T(D,null,[a(U,null,{default:l(()=>[a(R,{class:"-mb-15px",model:o(r),ref_key:"queryFormRef",ref:M,inline:!0,"label-width":"68px"},{default:l(()=>[a(g,{label:"\u6D3B\u52A8\u540D\u79F0",prop:"name"},{default:l(()=>[a(h,{modelValue:o(r).name,"onUpdate:modelValue":t[0]||(t[0]=e=>o(r).name=e),placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0",clearable:"",onKeyup:W(y,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),a(g,{label:"\u6D3B\u52A8\u72B6\u6001",prop:"status"},{default:l(()=>[a(K,{modelValue:o(r).status,"onUpdate:modelValue":t[1]||(t[1]=e=>o(r).status=e),placeholder:"\u8BF7\u9009\u62E9\u6D3B\u52A8\u72B6\u6001",clearable:"",class:"!w-240px"},{default:l(()=>[(p(!0),T(D,null,X(o(fa)(o(P).COMMON_STATUS),e=>(p(),d(F,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(g,null,{default:l(()=>[a(u,{onClick:y},{default:l(()=>[a(v,{icon:"ep:search",class:"mr-5px"}),t[5]||(t[5]=m(" \u641C\u7D22"))]),_:1}),a(u,{onClick:O},{default:l(()=>[a(v,{icon:"ep:refresh",class:"mr-5px"}),t[6]||(t[6]=m(" \u91CD\u7F6E"))]),_:1}),f((p(),d(u,{type:"primary",plain:"",onClick:t[2]||(t[2]=e=>N("create"))},{default:l(()=>[a(v,{icon:"ep:plus",class:"mr-5px"}),t[7]||(t[7]=m(" \u65B0\u589E "))]),_:1})),[[_,["promotion:combination-activity:create"]]])]),_:1})]),_:1},8,["model"])]),_:1}),a(U,null,{default:l(()=>[f((p(),d(E,{data:o(S),stripe:!0,"show-overflow-tooltip":!0},{default:l(()=>[a(i,{label:"\u6D3B\u52A8\u7F16\u53F7",prop:"id","min-width":"80"}),a(i,{label:"\u6D3B\u52A8\u540D\u79F0",prop:"name","min-width":"140"}),a(i,{label:"\u6D3B\u52A8\u65F6\u95F4","min-width":"210"},{default:l(e=>[m(C(o(z)(e.row.startTime,"YYYY-MM-DD"))+" ~ "+C(o(z)(e.row.endTime,"YYYY-MM-DD")),1)]),_:1}),a(i,{label:"\u5546\u54C1\u56FE\u7247",prop:"spuName","min-width":"80"},{default:l(e=>[a(q,{src:e.row.picUrl,class:"h-40px w-40px","preview-src-list":[e.row.picUrl],"preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),a(i,{label:"\u5546\u54C1\u6807\u9898",prop:"spuName","min-width":"300"}),a(i,{label:"\u539F\u4EF7",prop:"marketPrice","min-width":"100",formatter:o(ga)},null,8,["formatter"]),a(i,{label:"\u62FC\u56E2\u4EF7",prop:"seckillPrice","min-width":"100"},{default:l(e=>[m(C(B(e.row.products)),1)]),_:1}),a(i,{label:"\u5F00\u56E2\u7EC4\u6570",prop:"groupCount","min-width":"100"}),a(i,{label:"\u6210\u56E2\u7EC4\u6570",prop:"groupSuccessCount","min-width":"100"}),a(i,{label:"\u8D2D\u4E70\u6B21\u6570",prop:"recordCount","min-width":"100"}),a(i,{label:"\u6D3B\u52A8\u72B6\u6001",align:"center",prop:"status","min-width":"100"},{default:l(e=>[a(j,{type:o(P).COMMON_STATUS,value:e.row.status},null,8,["type","value"])]),_:1}),a(i,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",formatter:o(wa),width:"180px"},null,8,["formatter"]),a(i,{label:"\u64CD\u4F5C",align:"center",width:"150px",fixed:"right"},{default:l(e=>[f((p(),d(u,{link:"",type:"primary",onClick:V=>N("update",e.row.id)},{default:l(()=>t[8]||(t[8]=[m(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[_,["promotion:combination-activity:update"]]]),e.row.status===0?f((p(),d(u,{key:0,link:"",type:"danger",onClick:V=>(async k=>{try{await w.confirm("\u786E\u8BA4\u5173\u95ED\u8BE5\u79D2\u6740\u6D3B\u52A8\u5417\uFF1F"),await ba(k),w.success("\u5173\u95ED\u6210\u529F"),await n()}catch{}})(e.row.id)},{default:l(()=>t[9]||(t[9]=[m(" \u5173\u95ED ")])),_:2},1032,["onClick"])),[[_,["promotion:combination-activity:close"]]]):f((p(),d(u,{key:1,link:"",type:"danger",onClick:V=>(async k=>{try{await w.delConfirm(),await ya(k),w.success(A("common.delSuccess")),await n()}catch{}})(e.row.id)},{default:l(()=>t[10]||(t[10]=[m(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[_,["promotion:combination-activity:delete"]]])]),_:1})]),_:1},8,["data"])),[[H,o(b)]]),a(G,{total:o(x),page:o(r).pageNo,"onUpdate:page":t[3]||(t[3]=e=>o(r).pageNo=e),limit:o(r).pageSize,"onUpdate:limit":t[4]||(t[4]=e=>o(r).pageSize=e),onPagination:n},null,8,["total","page","limit"])]),_:1}),a(ha,{ref_key:"formRef",ref:Y,onSuccess:n},null,512)],64)}}});export{ka as default};