import{f as $,h as I}from"./goodsManage.ac38b63c.js";import{g as O}from"./classifyManage.6f51847c.js";import{M as D}from"./index.dfdc0704.js";import{_ as q}from"./SetCalssify.vue_vue_type_script_setup_true_lang.5212bd16.js";import{d as G,b as F,r as h,c as i,e as E,f as B,g as J,h as e,i as t,u as s,F as b,j,k as z,m as r,t as P,q as R,E as f}from"./index.0308b213.js";import"./index.vue_vue_type_style_index_0_scoped_f00ed21d_lang.2c48f49b.js";import"./vuedraggable.umd.405b1bec.js";import"./index.35b8c9ab.js";import"./index.9e8820cd.js";import"./sort_out.2008c10d.js";const H={style:{"background-color":"#fff",padding:"20px"}},K=r("AI\u8BC6\u522B"),Q=r("\u6279\u91CF\u8BBE\u7F6E\u5206\u7C7B"),W=r("\u63D0\u4EA4\u5E76\u4E0A\u4F20\u5546\u54C1"),X=r("\u5220\u9664"),Y=r("\u590D\u5236"),re=G({setup(Z){const l=F({loading:!1,image:"",imageTip:"https://qny.wdsp666.com/uploads/images/20230902172548d504e0621.png",menus:[]}),y=()=>{l.loading=!0,$(l.image).then(a=>{let o=a.data||[];l.menus=o.map(d=>({name:d.text[0],price:d.text[1],image:d.text[2]})),l.menus.forEach((d,g)=>{d.id=g}),l.loading=!1}).catch(()=>{f.error("\u8BC6\u522B\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u662F\u5426\u5F00\u901A\u6B64\u529F\u80FD"),l.loading=!1})},A=a=>{l.menus.splice(a,1)},w=a=>{let o=JSON.parse(JSON.stringify(l.menus[a]));o.id=l.menus.length,l.menus.push(o),f.success("\u590D\u5236\u6210\u529F\uFF0C\u8FFD\u52A0\u5230\u6700\u540E\u4E00\u884C")},x=()=>{l.menus.length<=0&&f.error("\u83DC\u5355\u4E0D\u80FD\u4E3A\u7A7A"),I(l).then(()=>{f.success("\u83DC\u5355\u63D0\u4EA4\u6210\u529F")})},C=F({list:h([])}),v=F({page:1,limit:999});O(v).then(a=>{console.log("\u8BF7\u6C42\u7ED3\u679C:",a),C.list=a.lists});let c=h([]);const k=a=>{console.log(a,"val"),c.value=a.map(o=>Number(o.id))};let p=h(!1);const U=()=>{if(c.value.length===0){f({message:"\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u6570\u636E",type:"error"});return}p.value=!0},S=a=>{l.menus.forEach(o=>{c.value.includes(o.id)&&(o.cid=a)}),c.value=[]};return(a,o)=>{const d=i("el-image"),g=i("el-form-item"),_=i("el-button"),m=i("el-table-column"),V=i("el-input"),M=i("el-option"),N=i("el-select"),L=i("el-table"),T=i("el-form");return E(),B(b,null,[J("div",H,[e(T,{"label-width":"120px"},{default:t(()=>[e(g,{label:"\u83DC\u5355\u56FE\u7247",prop:"thumb"},{default:t(()=>[e(D,{modelValue:s(l).image,"onUpdate:modelValue":o[0]||(o[0]=u=>s(l).image=u),limit:1},null,8,["modelValue"]),e(d,{style:{width:"110px",height:"110px"},src:s(l).imageTip,"preview-src-list":[s(l).imageTip],"z-index":"9999"},null,8,["src","preview-src-list"])]),_:1}),e(g,null,{default:t(()=>[e(_,{type:"primary",onClick:y,loading:s(l).loading},{default:t(()=>[K]),_:1},8,["loading"]),e(_,{type:"primary",onClick:U},{default:t(()=>[Q]),_:1}),e(_,{type:"success",onClick:x},{default:t(()=>[W]),_:1})]),_:1}),e(L,{data:s(l).menus,onSelectionChange:k},{default:t(()=>[e(m,{align:"center",type:"selection"}),e(m,{label:"\u5546\u54C1\u540D\u79F0"},{default:t(u=>[e(V,{modelValue:u.row.name,"onUpdate:modelValue":n=>u.row.name=n},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u5546\u54C1\u4EF7\u683C"},{default:t(u=>[e(V,{modelValue:u.row.price,"onUpdate:modelValue":n=>u.row.price=n},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u6240\u5C5E\u5206\u7C7B"},{default:t(u=>[e(N,{class:"agent-select",modelValue:u.row.cid,"onUpdate:modelValue":n=>u.row.cid=n,placeholder:"\u8BF7\u9009\u62E9\u5206\u7C7B",filterable:"",clearable:""},{default:t(()=>[(E(!0),B(b,null,j(s(C).list,(n,ee)=>(E(),z(M,{value:n.id,label:n.title},{default:t(()=>[r(P(n.title),1)]),_:2},1032,["value","label"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,{label:"\u56FE\u7247(\u70B9\u51FB\u56FE\u7247\u53EF\u4EE5\u8FDB\u884C\u4FEE\u6539)"},{default:t(u=>[e(D,{modelValue:u.row.image,"onUpdate:modelValue":n=>u.row.image=n,limit:1},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(m,null,{default:t(u=>[e(_,{type:"danger",onClick:n=>A(u.$index)},{default:t(()=>[X]),_:2},1032,["onClick"]),e(_,{type:"success",onClick:n=>w(u.$index)},{default:t(()=>[Y]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),e(q,{modelValue:s(p),"onUpdate:modelValue":o[1]||(o[1]=u=>R(p)?p.value=u:p=u),ids:s(c),classifyList:s(C),onOnClose:S},null,8,["modelValue","ids","classifyList"])],64)}}});export{re as default};
