物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lines
57 KiB

  1. import{p as Ke,d as Ze,t as Cn,Q as Ge,H as Qe,c as Je,o as je,b as tr,k as nr,n as er,s as rr}from"./index-bVOhw2NF.js";import{c as ir}from"./cloneDeep-C6NKQlMO.js";import"./_initCloneObject-K-Y0ueWp.js";import"./_getTag-BJ2nhJXz.js";function Rn(t,n){let e;if(n===void 0)for(const r of t)r!=null&&(e<r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e<i||e===void 0&&i>=i)&&(e=i)}return e}function ue(t,n){let e;if(n===void 0)for(const r of t)r!=null&&(e>r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e>i||e===void 0&&i>=i)&&(e=i)}return e}function Gt(t,n){let e=0;if(n===void 0)for(let r of t)(r=+r)&&(e+=r);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e}class In extends Map{constructor(n,e=le){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const[r,i]of n)this.set(r,i)}get(n){return super.get(tn(this,n))}has(n){return super.has(tn(this,n))}set(n,e){return super.set(fe(this,n),e)}delete(n){return super.delete(ce(this,n))}}class or extends Set{constructor(n,e=le){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const r of n)this.add(r)}has(n){return super.has(tn(this,n))}add(n){return super.add(fe(this,n))}delete(n){return super.delete(ce(this,n))}}function tn({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function fe({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function ce({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function le(t){return t!==null&&typeof t=="object"?t.valueOf():t}function q(t,n){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof n!="function")throw new TypeError("mapper is not a function");return Array.from(t,(e,r)=>n(e,r,t))}function sr(...t){const n=new or;for(const e of t)for(const r of e)n.add(r);return n}var ar={value:()=>{}};function he(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new Ht(e)}function Ht(t){this._=t}function ur(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}Ht.prototype=he.prototype={constructor:Ht,on:function(t,n){var e=this._,r=ur(t+"",e),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=fr(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<s;)if(i=(t=r[o]).type)e[i]=Hn(e[i],t.name,n);else if(n==null)for(i in e)e[i]=Hn(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Ht(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,o;r<i;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};function fr(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function Hn(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=ar,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var nn="http://www.w3.org/1999/xhtml";const zn={svg:"http://www.w3.org/2000/svg",xhtml:nn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ut(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),zn.hasOwnProperty(n)?{space:zn[n],local:t}:t}function cr(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===nn&&n.documentElement.namespaceURI===nn?n.createElement(t):n.createElementNS(e,t)}}function lr(t){return function(){return this.ownerDocument.createElementNS(t.space,
  2. ${o(S.value)} ${m(S)||""}`,nodeAlign:$=s,nodeSort:N,nodeWidth:C=15,nodePadding:T=14,leftNodeLabelPadding:M=6,rightNodeLabelPadding:I=6,middleNodeLabelPadding:E=6,nodeLabelFontSize:ht=14,nodeStroke:dt="currentColor",nodeStrokeWidth:G,nodeStrokeOpacity:st=1,nodeStrokeLinejoin:Q,linkSource:k=({source:S})=>S,linkTarget:F=({target:S})=>S,linkValue:L=({value:S})=>S,linkUnit:P=({unit:S})=>S,linkPath:l=ia(),linkTitle:w=S=>`${S.source.id} ${S.target.id}
  3. ${o(S.value)} ${P(S)||""}`,linkColor:g="source-target",linkStrokeOpacity:x=.5,linkColorNoOpacity:p=!1,linkMixBlendMode:b="multiply",colors:A=Fs.concat(Hs).concat(zs).concat(Ps).concat(Is),width:O=1920,height:D=1080,marginTop:J=5,marginRight:j=1,marginBottom:pt=5,marginLeft:tt=1,enableAutoFlow:Be=!0}={}){typeof $!="function"&&($={left:Ds,right:qs,center:Bs}[$]??De);function S(d){return d!==null&&typeof d=="object"?d.valueOf():d}const vn=q(i,k).map(S),bn=q(i,F).map(S),Xe=q(i,L),kn=q(i,P);r===void 0&&(r=Array.from(sr(vn,bn),d=>({id:d})));const Zt=q(r,a).map(S),V=u==null?null:q(r,u).map(S);r=q(r,(d,v)=>({id:Zt[v],unit:kn[v]})),i=q(i,(d,v)=>({source:vn[v],target:bn[v],value:Xe[v],unit:kn[v]})),!V&&["source","target","source-target"].includes(g)&&(g="currentColor"),V&&f===void 0&&(f=V);const nt=u==null?null:Oe(f,A);Us().nodeId(({index:d})=>Zt[d]).nodeAlign($).nodeWidth(C).nodePadding(T).nodeSort(N).extent([[tt,J],[O-j,D-pt]])({nodes:r,links:i}),typeof o!="function"&&(o=Pe(o));const $n=c===void 0?Zt:c==null?null:q(r,c),An=_==null?null:q(r,_),Sn=w==null?null:q(i,w),at=`O-${Math.random().toString(16).slice(2)}`,Nt=Bi("svg").attr("width",O).attr("height",D).attr("viewBox",[0,0,O,D]).attr("style","max-width: 100%; height: auto; height: intrinsic;"),Nn=Nt.append("g").attr("fill","none").attr("stroke-opacity",x).selectAll("g").data(i).join("g").style("mix-blend-mode",b),Mn=function(d){if(d.length===0)return;const v=d.pop();ut(`#${at}-path-${v.index}`).attr("stroke-dashoffset",5e3).transition().duration(1500).attr("stroke-dashoffset",0).on("end",()=>{Mn(window.structuredClone(d))})},Ve=function(){ut(this).attr("stroke-dasharray",5e3).attr("stroke-dashoffset",0)},En=Nt.append("g").attr("stroke",dt).attr("stroke-width",G).attr("stroke-opacity",st).attr("stroke-linejoin",Q).selectAll("rect").data(r).join("rect").attr("x",d=>d.x0).attr("y",d=>d.y0).attr("height",d=>d.y1-d.y0<3?3:d.y1-d.y0).attr("width",d=>d.x1-d.x0).attr("fill",(d,v)=>A[v]).attr("id",d=>d.id).on("mouseover",(d,v)=>{Mn(window.structuredClone(v.sourceLinks))}).on("mouseout",(d,v)=>{v.sourceLinks.forEach(z=>{Ve.call(document.getElementById(`#${at}-path-${z.index}`))})});V&&En.attr("fill",({index:d})=>nt(V[d])),An&&En.append("title").text(({index:d})=>An[d]),g==="source-target"&&Nn.append("linearGradient").attr("id",d=>`${at}-link-${d.index}`).attr("gradientUnits","userSpaceOnUse").attr("x1",d=>d.source.x1).attr("x2",d=>d.target.x0).call(d=>d.append("stop").attr("offset","0%").attr("stop-color",({source:{index:v}})=>nt(V[v]))).call(d=>d.append("stop").attr("offset","100%").attr("stop-color",({target:{index:v},source:{index:z}})=>nt(p?V[z]:V[v]))),Nn.append("path").attr("d",l).attr("class","sankeyPath").attr("id",({index:d})=>`${at}-path-${d}`).attr("stroke",g==="source-target"?({index:d})=>`url(#${at}-link-${d})`:g==="source"?({source:{index:d}})=>nt(V[d]):g==="target"?({target:{index:d}})=>nt(V[d]):g).attr("stroke-width",({width:d})=>Math.max(1,d)).attr("stroke-dasharray",5e3).attr("stroke-dashoffset",5e3).call(Sn?d=>{d.append("title").text(({index:v})=>Sn[v])}:()=>{}).each((d,v,z)=>{const Et=(v+1)*50;setTimeout(()=>{ut(z[v]).transition().duration(1500).attr("stroke-dashoffset",0)},Et)});const Tn=Math.max(...new Set(r.map(d=>d.layer)));$n&&Nt.append("g").attr("font-family","sans-serif").attr("font-size",10).selectAll("text").data(r).join("text").attr("x",d=>{if(h==="inside")return d.layer===0?d.x1+M:d.layer===Tn?d.x0-I:d.x1+E;if(h==="outside")return d.layer===0?d.x0-M:d.layer===Tn?d.x1+I:d.x1+E}).attr("y",d=>(d.y1+d.y0)/2).attr("dy","0.35em").attr("font-size",ht).attr("fill",y).attr("text-anchor",d=>d.x0<O/2?"start":"end").text(({index:d})=>$n[d]);const Ye=r.reduce((d,v)=>v.layer===0?d+(v.y1-v.y0)+T:d,0),Ue=r.reduce((d,v)=>v.layer===1?d+(v.y1-v.y0)+T:d,0),We=r.reduce((d,v)=>v.layer===2?d+(v.y1-v.y0)+T:d,0),Ln=Math.max(Ye,Ue,We),gt=Nt.node();gt.style.overflow="visible",gt.setAttribute("height",Ln),gt.setAttribute("viewBox",`0 0 ${O} ${Ln}`);const Mt=rr(!1);if(Be){const d=function(v){if(v.length===0){Mt.value=!1;return}const z=v.pop();ut(`#${at}-path-${z.index}`).attr("stroke