"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4945],{41102:function(H,c,l){l.r(c);var g=l(57213),_=l.n(g),M=l(54306),h=l.n(M),u=l(93236),O=l(11776),x=l(14649),j=l(90627),f=l(19711),r=l(62086),p=j.Z.ShopController,A=p.shopTree,L=p.shopItems;c.default=function(){var m=u.useRef(null),T=(0,u.useState)(null),E=h()(T,2),v=E[0],B=E[1],I=(0,u.useState)([]),y=h()(I,2),W=y[0],R=y[1],w=(0,u.useState)(0),S=h()(w,2),P=S[0],K=S[1],U={type:"compactBox",direction:"TB",getId:function(e){return e.id},getHeight:function(){return 16},getWidth:function(){return 16},getVGap:function(){return 40},getHGap:function(){return 70}};f.ZP.registerNode("icon-node",{options:{size:[40,20],stroke:"#91d5ff",fill:"#91d5ff"},draw:function(e,n){var a=this.getShapeStyle(e),o=e.labelCfg,i=o===void 0?{}:o,s=a.width,C=a.height,b="rgb(28 25 23)";e.device_num===0&&(b="rgb(220 38 38)");var k=n.addShape("rect",{attrs:_()(_()({},a),{},{x:-s/2,y:-C/2})});return e.label&&n.addShape("text",{attrs:_()(_()({},i.style),{},{text:e.label,fill:b,x:10-s/2,y:25-C/2})}),k},update:void 0},"rect"),f.ZP.registerEdge("flow-line",{draw:function(e,n){var a=e.startPoint,o=e.endPoint,i=e.style,s=n.addShape("path",{attrs:{stroke:i.stroke,endArrow:i.endArrow,path:[["M",a.x,a.y],["L",a.x,(a.y+o.y)/2],["L",o.x,(a.y+o.y)/2],["L",o.x,o.y]]}});return s}});var D={hover:{stroke:"#1890ff",lineWidth:2}},N={fill:"#91d5ff",stroke:"#40a9ff",radius:5},Z={stroke:"#91d5ff",endArrow:{path:"M 0,0 L 12, 6 L 9,0 L 12, -6 Z",fill:"#91d5ff",d:-20}},z={style:{fill:"#000",fontSize:10}},F=new f.ZP.Minimap({size:[150,100]}),d=null;(0,u.useEffect)(function(){A({shop_id:P}).then(function(t){var e=t.data,n=t.success;n&&B(e||null)}).catch(function(){})},[P]),(0,u.useEffect)(function(){if(v){var t,e,n;d=new f.ZP.TreeGraph({container:m.current,width:1e3,height:500,linkCenter:!0,plugins:[F],modes:{default:["drag-canvas","zoom-canvas"]},defaultNode:{type:"icon-node",size:[120,40],style:N,labelCfg:z},defaultEdge:{type:"flow-line",style:Z},nodeStateStyles:D,edgeStateStyles:D,layout:U}),(t=d)===null||t===void 0||t.data(v),(e=d)===null||e===void 0||e.render(),(n=d)===null||n===void 0||n.fitView()}},[v]);var G=function(e){d&&d.destroy(),L({username:e}).then(function(n){var a,o=n.data,i=[];o==null||(a=o.data)===null||a===void 0||a.map(function(s){s.label="".concat(s.username,"   ").concat(s.mobile),i.push(s)}),R(i)})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"text-3xl font-bold	text-slate-900	",children:"\u6295\u8D44\u4EBA\u5173\u7CFB\u56FE"}),(0,r.jsx)("div",{className:"h-3.5"}),(0,r.jsx)(O.Z,{allowClear:!0,showSearch:!0,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",style:{width:"100%"},filterOption:!1,onSearch:function(e){e&&G(e)},onChange:function(e){K(e)},fieldNames:{label:"label",value:"id"},options:W}),(0,r.jsx)("div",{className:"h-6"}),(0,r.jsx)(x.ZP,{onClick:function(){d&&d.destroy()},children:"\u6E05\u7A7A\u753B\u5E03"}),(0,r.jsx)("div",{className:"h-6"}),(0,r.jsx)("div",{ref:m})]})}}}]);
