import{G as R,H as G,D as H,C as J,w as Q,F as W,M as X,I as Y,J as ee,N as te,K as oe}from"./element-plus.7e54903f.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.7f121250.js";import{r as B,f as ae,b as ne}from"./index.aacc8c66.js";import{u as ie}from"./usePaging.f8c888e4.js";import{u as re}from"./useDictOptions.99e549ee.js";import{d as S,r as x,Z as se,ap as ue,o as n,c as v,U as t,L as o,u as a,T as z,a9 as h,K as y,R as C,M as g,a as P,S as pe,Q as de,j as L}from"./@vue.76ce7aa3.js";import"./lodash.905d29aa.js";import{_ as me}from"./productPop.vue_vue_type_script_setup_true_name_systemStoreLists_lang.bb66cb67.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"./axios.74873e41.js";import"./jspdf.9e946b0e.js";import"./fflate.0418c72f.js";import"./vue-router.10bd5b90.js";import"./pinia.f3529286.js";import"./css-color-function.5dec0992.js";import"./color.f3e3a53f.js";import"./clone.8eedf8fa.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.024dce8e.js";function ce(r){return B.get({url:"/activityzone/lists",params:r})}function _e(r){return B.post({url:"/activityzone/add",params:r})}function fe(r){return B.post({url:"/activityzone/delete",params:r})}const ve={class:"mt-4"},ye={key:0},Ce={class:"flex mt-4 justify-end"},we=S({name:"activityZoneLists"}),it=S({...we,setup(r){const d=x(!1),s=se({type:"",keyword:""}),k=x([]),$=u=>{k.value=u.map(({id:e})=>e)},A=async(u,e)=>{let p={type:e,product_ids:[]};u.forEach(b=>{p.product_ids.find(c=>c.id==b.id)||p.product_ids.push(b.id)}),await _e(p),d.value=!1,w()},I=()=>{d.value=!0},{dictData:D}=re("activity_zone"),{pager:m,getLists:w,resetParams:N,resetPage:U}=ie({fetchFun:ce,params:s}),V=async u=>{await ae.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await fe({id:u}),w()};return w(),(u,e)=>{const p=R,b=G,c=H,Z=J,_=Q,T=W,F=X,M=ne,i=Y,j=ee,q=le,K=te,E=ue("perms"),O=oe;return n(),v("div",null,[t(F,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[t(T,{class:"mb-[-16px]",model:a(s),inline:""},{default:o(()=>[t(c,{class:"w-[180px]",label:"\u7C7B\u578B",prop:"type"},{default:o(()=>[t(b,{modelValue:a(s).type,"onUpdate:modelValue":e[0]||(e[0]=l=>a(s).type=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B"},{default:o(()=>[t(p,{label:"\u5168\u90E8",value:""}),(n(!0),v(z,null,h(a(D).activity_zone,(l,f)=>(n(),y(p,{key:f,label:l.remark,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:"\u5546\u54C1",prop:"keyword"},{default:o(()=>[t(Z,{class:"w-[280px]",modelValue:a(s).keyword,"onUpdate:modelValue":e[1]||(e[1]=l=>a(s).keyword=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1"},null,8,["modelValue"])]),_:1}),t(c,null,{default:o(()=>[t(_,{type:"primary",onClick:a(U)},{default:o(()=>e[6]||(e[6]=[C("\u67E5\u8BE2")])),_:1},8,["onClick"]),t(_,{onClick:a(N)},{default:o(()=>e[7]||(e[7]=[C("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),g((n(),y(F,{class:"!border-none",shadow:"never"},{default:o(()=>[g((n(),y(_,{type:"primary",onClick:e[2]||(e[2]=l=>I())},{icon:o(()=>[t(M,{name:"el-icon-Plus"})]),default:o(()=>[e[8]||(e[8]=C(" \u65B0\u589E "))]),_:1})),[[E,["activity_zone/add"]]]),g((n(),y(_,{disabled:!a(k).length,onClick:e[3]||(e[3]=l=>V(a(k)))},{default:o(()=>e[9]||(e[9]=[C(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[E,["activity_zone/delete"]]]),P("div",ve,[t(j,{data:a(m).lists,onSelectionChange:$},{default:o(()=>[t(i,{type:"selection",width:"55"}),t(i,{label:"ID",prop:"id","show-overflow-tooltip":""}),t(i,{label:"\u7C7B\u578B",prop:"type"},{default:o(({row:l})=>[(n(!0),v(z,null,h(a(D).activity_zone,(f,be)=>(n(),v("div",null,[f.value==l.type?(n(),v("div",ye,pe(f.remark),1)):de("",!0)]))),256))]),_:1}),t(i,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),t(i,{label:"\u5546\u54C1",prop:"store_name","show-overflow-tooltip":""}),t(i,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),t(i,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:l})=>[g((n(),y(_,{type:"danger",link:"",onClick:f=>V(l.id)},{default:o(()=>e[10]||(e[10]=[C(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[E,["activity_zone/delete"]]])]),_:1})]),_:1},8,["data"])]),P("div",Ce,[t(q,{modelValue:a(m),"onUpdate:modelValue":e[4]||(e[4]=l=>L(m)?m.value=l:null),onChange:a(w)},null,8,["modelValue","onChange"])])]),_:1})),[[O,a(m).loading]]),t(K,{modelValue:a(d),"onUpdate:modelValue":e[5]||(e[5]=l=>L(d)?d.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:o(()=>[t(me,{onOnBindStore:A})]),_:1},8,["modelValue"])])}}});export{it as default};