import{C as R,D as S,w as T,F as j,K,G as M,H as G,L as H,I as O}from"./element-plus.8e273e86.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{r as w,f as Q,b as W}from"./index.2078eb25.js";import{u as X}from"./vue-router.10bd5b90.js";import{u as Y}from"./usePaging.f8c888e4.js";import{u as oo}from"./useDictOptions.0f4dac76.js";import{_ as to}from"./productPop.vue_vue_type_script_setup_true_name_systemStoreLists_lang.ecdb7526.js";import{d as k,r as D,Z as eo,ap as io,o as f,c as ao,U as t,L as e,u as i,R as v,M as C,K as y,a as E,j as F}from"./@vue.76ce7aa3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.41b9567d.js";import"./axios.b4cbdbc9.js";import"./jspdf.75308076.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.f23177ae.js";import"./color.a6ad6672.js";import"./clone.954ba32c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./store_product.607bf6ee.js";function no(n){return w.get({url:"/activityzone/lists",params:n})}function lo(n){return w.post({url:"/activityzone/add",params:n})}function ro(n){return w.post({url:"/activityzone/delete",params:n})}const so={class:"mt-4"},uo={class:"flex mt-4 justify-end"},mo=k({name:"activityZoneLists"}),Xo=k({...mo,setup(n){const u=D(!1),V=X(),m=eo({form_id:V.query.id,store_name:""}),h=D([]),B=l=>{h.value=l.map(({id:o})=>o)},x=async(l,o)=>{let d={form_id:o,product_ids:[]};l.forEach(c=>{d.product_ids.find(r=>r.id==c.id)||d.product_ids.push(c.id)}),await lo(d),u.value=!1,_()},P=()=>{u.value=!0};oo("activity_zone");const{pager:p,getLists:_,resetParams:I,resetPage:Z}=Y({fetchFun:no,params:m}),z=async l=>{await Q.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ro({id:l}),_()};return _(),(l,o)=>{const d=R,c=S,r=T,L=j,b=K,A=W,s=M,$=G,U=J,q=H,g=io("perms"),N=O;return f(),ao("div",null,[t(b,{class:"!border-none mb-4",shadow:"never"},{default:e(()=>[t(L,{class:"mb-[-16px]",model:i(m),inline:""},{default:e(()=>[t(c,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:e(()=>[t(d,{class:"w-[280px]",modelValue:i(m).store_name,"onUpdate:modelValue":o[0]||(o[0]=a=>i(m).store_name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(c,null,{default:e(()=>[t(r,{type:"primary",onClick:i(Z)},{default:e(()=>o[4]||(o[4]=[v("\u67E5\u8BE2")])),_:1},8,["onClick"]),t(r,{onClick:i(I)},{default:e(()=>o[5]||(o[5]=[v("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),C((f(),y(b,{class:"!border-none",shadow:"never"},{default:e(()=>[C((f(),y(r,{type:"primary",onClick:o[1]||(o[1]=a=>P())},{icon:e(()=>[t(A,{name:"el-icon-Plus"})]),default:e(()=>[o[6]||(o[6]=v(" \u65B0\u589E "))]),_:1})),[[g,["activity_zone/add"]]]),E("div",so,[t($,{data:i(p).lists,onSelectionChange:B},{default:e(()=>[t(s,{type:"selection",width:"55"}),t(s,{label:"ID",prop:"id","show-overflow-tooltip":""}),t(s,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),t(s,{label:"\u5546\u54C1",prop:"store_name","show-overflow-tooltip":""}),t(s,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),t(s,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:e(({row:a})=>[C((f(),y(r,{type:"danger",link:"",onClick:po=>z(a.id)},{default:e(()=>o[7]||(o[7]=[v(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[g,["activity_zone/delete"]]])]),_:1})]),_:1},8,["data"])]),E("div",uo,[t(U,{modelValue:i(p),"onUpdate:modelValue":o[2]||(o[2]=a=>F(p)?p.value=a:null),onChange:i(_)},null,8,["modelValue","onChange"])])]),_:1})),[[N,i(p).loading]]),t(q,{modelValue:i(u),"onUpdate:modelValue":o[3]||(o[3]=a=>F(u)?u.value=a:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:e(()=>[t(to,{activityZoneFormId:i(m).form_id,onOnBindStore:x},null,8,["activityZoneFormId"])]),_:1},8,["modelValue"])])}}});export{Xo as default};
