import{k,C as A,D as L,w as I,F as N,M as U,b as M,N as T,O as j}from"./element-plus.78e68aed.js";import{_ as q}from"./index.vue_vue_type_script_setup_true_lang.3c4454b7.js";import{u as R}from"./usePaging.6a6670f9.js";import{u as O}from"./useDictOptions.83186ed0.js";import{a as Z}from"./system_store.5674343e.js";import{d as w,Z as $,r as z,o as h,c as g,U as e,L as u,u as t,R as d,M as G,S as H,a as J,j as K}from"./@vue.18505fe0.js";import"./lodash.60201f64.js";import{r as i}from"./index.df1f0bd0.js";const Q={class:"mt-4"},W={class:"flex mt-4 justify-end"},X=w({name:"systemStoreLists"}),re=w({...X,emits:["onBindStore"],setup(o,{emit:b}){const r=$({name:"",phone:""}),_=z([]),F=p=>{_.value=p.map(({id:l})=>l)};O("");const{pager:n,getLists:f,resetParams:v,resetPage:C}=R({fetchFun:Z,params:r});f();const S=b,B=()=>{let p=n.lists.filter(l=>_.value.includes(l.id));if(!p.length)return k.error("\u8BF7\u5148\u9009\u62E9\u95E8\u5E97");S("onBindStore",p)};return(p,l)=>{const E=A,c=L,m=I,D=N,s=U,V=M,x=T,y=q,P=j;return h(),g("div",null,[e(D,{class:"mb-[-16px]",model:t(r),inline:""},{default:u(()=>[e(c,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name"},{default:u(()=>[e(E,{class:"w-[200px]",modelValue:t(r).name,"onUpdate:modelValue":l[0]||(l[0]=a=>t(r).name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(c,{label:"\u624B\u673A\u53F7\u7801",prop:"phone"},{default:u(()=>[e(E,{class:"w-[200px]",modelValue:t(r).phone,"onUpdate:modelValue":l[1]||(l[1]=a=>t(r).phone=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801"},null,8,["modelValue"])]),_:1}),e(c,null,{default:u(()=>[e(m,{type:"primary",onClick:t(C)},{default:u(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(m,{onClick:t(v)},{default:u(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),G((h(),g("div",Q,[e(x,{data:t(n).lists,onSelectionChange:F,height:300},{default:u(()=>[e(s,{type:"selection",width:"55"}),e(s,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(s,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(s,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),e(s,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),e(s,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:u(({row:a})=>[e(V,{src:a.image,class:"w-[50px] h-[50px]"},null,8,["src"])]),_:1}),e(s,{label:"\u662F\u5426\u663E\u793A",prop:"is_show","show-overflow-tooltip":""},{default:u(({row:a})=>[d(H(a.is_show?"\u663E\u793A":"\u9690\u85CF"),1)]),_:1})]),_:1},8,["data"])])),[[P,t(n).loading]]),J("div",W,[e(y,{modelValue:t(n),"onUpdate:modelValue":l[2]||(l[2]=a=>K(n)?n.value=a:null),onChange:t(f)},null,8,["modelValue","onChange"])]),e(m,{class:"w-full mt-4",type:"primary",onClick:B},{default:u(()=>[d("\u6DFB\u52A0\u95E8\u5E97")]),_:1})])}}});function ne(o){return i.get({url:"/store_product/storeproduct/lists",params:o})}function ie(o){return i.post({url:"/store_product/storeproduct/add",params:o})}function pe(o){return i.post({url:"/store_product/storeproduct/edit",params:o})}function de(o){return i.post({url:"/store_product/storeproduct/delete",params:o})}function ce(o){return i.get({url:"/store_product/storeproduct/detail",params:o})}function me(o){return i.post({url:"/store_product/storeproduct/import",params:o})}export{re as _,ce as a,pe as b,ie as c,ne as d,me as e,de as f};
