import{C as U,D as $,w as j,M as L,b as M,N as O,F as K,I as Z}from"./element-plus.a63a26dd.js";import{_ as q}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.3565b593.js";import{c as z}from"./store_product.22e2a1b2.js";import{a as G}from"./vue-router.101084e3.js";import{P as H}from"./index.da3823b2.js";import{d as h,s as E,Z as J,r as v,ap as Q,o as w,c as W,U as o,L as t,a as d,u as p,R as _,S as X,M as Y,K as ee,j as oe}from"./@vue.18505fe0.js";const te={class:"edit-popup"},se={class:"flex-1 w-full"},le={class:"mb-2"},ae=h({name:"storeProductEdit"}),me=h({...ae,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(ue,{expose:b,emit:C}){const c=E(),y=C,D=E(),u=J({id:"",store_name:""}),r=v(!1),n=v([]),x=s=>{n.value=n.value.filter(e=>e.id!==s)},B=s=>{s.forEach(e=>{n.value.find(i=>i.id==e.id)||n.value.push(e)}),r.value=!1},g=(s="add")=>{var e;(e=c.value)==null||e.open()},k=G(),F=async()=>{const s=n.value.map(e=>e.id);z({store_arr:s,product_id:u.id}).then(e=>{setTimeout(()=>{k.push({path:"/store/store_branch_product"})},2e3)})},V=async s=>{u.id=s.id,u.store_name=s.store_name},R=()=>{y("close")};return b({open:g,setFormData:V}),(s,e)=>{const i=U,m=$,f=j,a=L,S=M,A=O,I=K,N=q,P=Z,T=Q("perms");return w(),W("div",te,[o(H,{ref_key:"popupRef",ref:c,title:"\u590D\u5236\u5546\u54C1\u5230\u95E8\u5E97",async:!0,width:"1200px",onConfirm:F,onClose:R},{default:t(()=>[d("div",null,[o(I,{ref_key:"formRef",ref:D,model:p(u),"label-width":"90px"},{default:t(()=>[o(m,{label:"\u5546\u54C1\u540D\u79F0"},{default:t(()=>[o(i,{modelValue:p(u).store_name,"onUpdate:modelValue":e[0]||(e[0]=l=>p(u).store_name=l),type:"input",rows:"4",disabled:""},null,8,["modelValue"])]),_:1}),o(m,{label:"\u95E8\u5E97",prop:"store_id"},{default:t(()=>[d("div",se,[d("div",le,[o(f,{type:"primary",onClick:e[1]||(e[1]=l=>r.value=!0)},{default:t(()=>[_("\u6DFB\u52A0\u95E8\u5E97")]),_:1})]),o(A,{data:p(n)},{default:t(()=>[o(a,{label:"ID",prop:"id","show-overflow-tooltip":""}),o(a,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),o(a,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),o(a,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),o(a,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:t(({row:l})=>[o(S,{src:l.image,class:"w-[40px] h-[40px]","preview-teleported":!0},null,8,["src"])]),_:1}),o(a,{label:"\u8425\u4E1A\u72B6\u6001",prop:"is_show","show-overflow-tooltip":""},{default:t(({row:l})=>[_(X(l.is_show?"\u8425\u4E1A":"\u6253\u70CA"),1)]),_:1}),o(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:l})=>[Y((w(),ee(f,{type:"danger",link:"",onClick:ne=>x(l.id)},{default:t(()=>[_(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[T,["system_store.system_store/delete"]]])]),_:1})]),_:1},8,["data"])])]),_:1})]),_:1},8,["model"])]),o(P,{modelValue:p(r),"onUpdate:modelValue":e[2]||(e[2]=l=>oe(r)?r.value=l:null),title:"\u9009\u62E9\u95E8\u5E97",width:"70%"},{default:t(()=>[o(N,{onOnBindStore:B})]),_:1},8,["modelValue"])]),_:1},512)])}}});export{me as _};
