import{S as J,k as E,C as W,D as X,w as Y,F as Z,d as ee,f as te,O as oe,b as ae,t as le,Q as ue,v as re,G as ie,R as ne}from"./element-plus.681b9893.js";import{d as se,r as p,M as pe,o as n,c as f,U as t,L as a,aa as de,R as m,T as me,a9 as ce,K as _,S as I,Q as y,a as A}from"./@vue.18505fe0.js";import{a as _e,p as ve,s as fe,u as ye,b as we}from"./add.065a3a3d.js";import{a as ge,d as ke}from"./index.0c8416f0.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.a6528143.js";import"./@babel.16688d44.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.466e9fe4.js";import"./axios.4905d81f.js";import"./jspdf.54afd842.js";import"./fflate.fca59393.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.29b71fa4.js";import"./color.87d313dc.js";import"./clone.a63396d9.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"./vue-plugin-hiprint.a2d84e76.js";import"./jquery.c3f97e49.js";import"./jsbarcode.39151b53.js";import"./socket.io-client.0b5a7289.js";import"./engine.io-client.81030771.js";import"./engine.io-parser.c748e159.js";import"./@socket.io.77accf6a.js";import"./debug.b392f131.js";import"./socket.io-parser.b7256298.js";import"./html2canvas.0f5947bc.js";import"./canvg.a673c4b2.js";import"./core-js.97b94d69.js";import"./raf.407ad6ad.js";import"./performance-now.a710f6e4.js";import"./rgbcolor.20c71161.js";import"./svg-pathdata.eba17832.js";import"./stackblur-canvas.0fb5df18.js";import"./nprogress.3461658b.js";import"./vue-clipboard3.c63182fd.js";import"./clipboard.dd2c63d0.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const Ee={"element-loading-text":"\u52A0\u8F7D\u4E2D",class:"my-shop"},he={key:0,style:{color:"#ff4a00"}},Ce={key:1},be={key:2},Be={class:"dialog-footer"},Ve=se({__name:"index",setup(Fe){const h=p([]),w=ge(),u=p({page:1,limit:15,type:1,keyword:"",staff_id:w.userInfo.service.service_id}),g=p(!1),C=p(0),b=p([]),B=()=>{ve(w.userInfo.service.mer_id).then(l=>{b.value=l.data})};B();const i=(l=!1)=>{g.value=!0,l&&B(),fe(w.userInfo.service.mer_id,u.value).then(o=>{h.value=o.data.list,C.value=o.data.count,g.value=!1})};i();const S=l=>{u.value.page=l,i()},$=l=>{u.value.page=l,i()},U=l=>{u.value.page=l,i()},v=p(!1),s=p({}),T=l=>{s.value=l,v.value=!0},L=()=>{let l={attr:s.value.attr||[],attrValue:s.value.attrValue,mer_cate_id:s.value.merCateId||[],spec_type:s.value.spec_type,is_stock:1};ye(s.value.product_id,l).then(o=>{E({message:o.message,type:"success"}),v.value=!1,i()}).catch(o=>{E({message:o,type:"error"})})},N=p("1"),z=l=>{u.value.type=l,u.value.page=1,i()},R=l=>{we(w.userInfo.service.mer_id,l.product_id,{status:l.is_show?1:0}).then(o=>{E.success(o.message),i(!0)})},V=p(null),F=(l="add",o)=>{V.value.show(l,o)};return(l,o)=>{const M=W,k=X,c=Y,K=Z,P=ee,Q=te,r=oe,x=ae,j=le,D=ue,G=J,O=re,q=ie,H=ne;return pe((n(),f("div",Ee,[t(K,{inline:!0},{default:a(()=>[t(k,{label:"\u5173\u952E\u5B57:"},{default:a(()=>[t(M,{modelValue:u.value.keyword,"onUpdate:modelValue":o[0]||(o[0]=e=>u.value.keyword=e),placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22",style:{width:"20rem"},clearable:"",onClear:o[1]||(o[1]=e=>i(!0)),onKeydown:o[2]||(o[2]=de(e=>i(!0),["enter"]))},null,8,["modelValue"])]),_:1}),t(k,null,{default:a(()=>[t(c,{type:"primary",onClick:o[3]||(o[3]=e=>i(!0))},{default:a(()=>[m("\u641C\u7D22")]),_:1})]),_:1}),t(k,null,{default:a(()=>[t(c,{type:"primary",onClick:o[4]||(o[4]=e=>F("add"))},{default:a(()=>[m("\u65B0\u589E")]),_:1})]),_:1})]),_:1}),t(Q,{"default-active":N.value,class:"el-menu-top",mode:"horizontal",onSelect:z},{default:a(()=>[(n(!0),f(me,null,ce(b.value,(e,d)=>(n(),_(P,{index:e.type+"",key:d},{default:a(()=>[m(I(`${e.name}(${e.count})`),1)]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"]),t(D,{data:h.value,style:{width:"100%"}},{default:a(()=>[t(r,{prop:"product_id",label:"ID",width:"100"}),t(r,{prop:"image",label:"\u56FE\u7247",width:"120"},{default:a(e=>[t(x,{loading:"lazy",style:{width:"60px",height:"60px"},src:e.row.image},null,8,["src"])]),_:1}),t(r,{prop:"store_name",label:"\u5546\u54C1\u540D\u79F0",width:"500"}),t(r,{prop:"price",label:"\u552E\u4EF7"}),t(r,{prop:"stock",label:"\u5E93\u5B58"}),u.value.type<=2?(n(),_(r,{key:0,label:"\u4E0A/\u4E0B\u67B6",width:"100"},{default:a(e=>[t(j,{modelValue:e.row.is_show,"onUpdate:modelValue":d=>e.row.is_show=d,"active-value":1,"inline-prompt":"","active-text":"\u4E0A\u67B6","inactive-text":"\u4E0B\u67B6",onClick:d=>R(e.row)},null,8,["modelValue","onUpdate:modelValue","onClick"])]),_:1})):y("",!0),u.value.type<=4?(n(),_(r,{key:1,label:"\u5546\u54C1\u72B6\u6001",width:"100"},{default:a(e=>[e.row.is_used?e.row.is_show?(n(),f("span",Ce,"\u4E0A\u67B6\u663E\u793A")):(n(),f("span",be,"\u4E0B\u67B6")):(n(),f("span",he,"\u5E73\u53F0\u5173\u95ED"))]),_:1})):y("",!0),t(r,{label:"\u64CD\u4F5C",width:"120"},{default:a(e=>[u.value.type!=5?(n(),_(c,{key:0,type:"primary",link:"",onClick:d=>T(e.row)},{default:a(()=>[m("\u4FEE\u6539\u5E93\u5B58")]),_:2},1032,["onClick"])):y("",!0),u.value.type!=1&&u.value.type!=5?(n(),_(c,{key:1,type:"primary",link:"",onClick:d=>F("edit",e.row)},{default:a(()=>[m("\u7F16\u8F91")]),_:2},1032,["onClick"])):y("",!0)]),_:1})]),_:1},8,["data"]),t(G,{"page-size":u.value.limit,layout:"prev, pager, next",total:C.value,onPrevClick:S,onNextClick:$,onCurrentChange:U},null,8,["page-size","total"]),t(q,{modelValue:v.value,"onUpdate:modelValue":o[6]||(o[6]=e=>v.value=e),title:"\u7F16\u8F91\u5546\u54C1\u5E93\u5B58",width:"800"},{footer:a(()=>[A("div",Be,[t(c,{onClick:o[5]||(o[5]=e=>v.value=!1)},{default:a(()=>[m("\u53D6\u6D88")]),_:1}),t(c,{type:"primary",onClick:L},{default:a(()=>[m(" \u786E\u5B9A ")]),_:1})])]),default:a(()=>[s.value.attrValue?(n(),_(D,{key:0,data:s.value.attrValue,stripe:"",style:{width:"100%"}},{default:a(()=>[t(r,{prop:"image",label:"\u56FE\u7247",width:"180"},{default:a(e=>[t(x,{loading:"lazy",style:{width:"5rem",height:"5rem"},src:e.row.image||s.value.image},null,8,["src"])]),_:1}),t(r,{prop:"sku",label:"\u540D\u79F0",width:"180"},{default:a(e=>[A("span",null,I(e.row.sku||s.value.store_name),1)]),_:1}),t(r,{prop:"price",label:"\u4EF7\u683C"}),t(r,{prop:"stock",label:"\u5E93\u5B58"},{default:a(e=>[t(O,{modelValue:e.row.stock,"onUpdate:modelValue":d=>e.row.stock=d,"step-strictly":"",min:0,step:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])):y("",!0)]),_:1},8,["modelValue"]),t(_e,{ref_key:"addRef",ref:V,onReload:o[7]||(o[7]=e=>i(!0))},null,512)])),[[H,g.value]])}}});const Vt=ke(Ve,[["__scopeId","data-v-fde2514d"]]);export{Vt as default};