物管理前端
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.

2 lines
17 KiB

  1. import{N as L}from"./index-3c234266.js";function q(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const z=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function g(t){const e=[];for(let r=0,n=t.length;r<n;r++)e.push(t[r]);return e}function p(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function G(t){const e=p(t,"border-left-width"),r=p(t,"border-right-width");return t.clientWidth+e+r}function J(t){const e=p(t,"border-top-width"),r=p(t,"border-bottom-width");return t.clientHeight+e+r}function D(t,e={}){const r=e.width||G(t),n=e.height||J(t);return{width:r,height:n}}function X(){let t,e;try{e=process}catch{}const r=e&&e.env?e.env.devicePixelRatio:null;return r&&(t=parseInt(r,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const h=16384;function Z(t){(t.width>h||t.height>h)&&(t.width>h&&t.height>h?t.width>t.height?(t.height*=h/t.width,t.width=h):(t.width*=h/t.height,t.height=h):t.width>h?(t.height*=h/t.width,t.width=h):(t.width*=h/t.height,t.height=h))}function y(t){return new Promise((e,r)=>{const n=new Image;n.decode=()=>e(n),n.onload=()=>e(n),n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function K(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Q(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(t),K(i)}const u=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||u(r,e)};function Y(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function N(t){return g(t).map(e=>{const r=t.getPropertyValue(e),n=t.getPropertyPriority(e);return`${e}: ${r}${n?" !important":""};`}).join(" ")}function tt(t,e,r){const n=`.${t}:${e}`,i=r.cssText?Y(r):N(r);return document.createTextNode(`${n}{${i}}`)}function v(t,e,r){const n=window.getComputedStyle(t,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const s=z();try{e.className=`${e.className} ${s}`}catch{return}const o=document.createElement("style");o.appendChild(tt(s,r,n)),e.appendChild(o)}function et(t,e){v(t,e,":before"),v(t,e,":after")}const M="application/font-woff",T="image/jpeg",nt={woff:M,woff2:M,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:T,jpeg:T,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function rt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function R(t){const e=rt(t).toLowerCase();return nt[e]||""}function it(t){return t.split(/,/)[1]}function E(t){return t.search(/^(data:)/)!==-1}function O(t,e){return`data:${e};base64,${t}`}async function U(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((s,o)=>{const c=new FileReader;c.onerror=o,c.onloadend=()=>{try{s(r({res:n,result:c.result}))}catch(a){o(a)}},c.readAsDataURL(i)})}const x={};function st(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function C(t,e,r){const n=st(t,e,r.includeQueryParams);if(x[n]!=null)return x[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const s=await U(t,r.fe
  2. `)}async function It(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await $t(t,e);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function At(t,e={}){const{width:r,height:n}=D(t,e),i=await w(t,e,!0);return await It(i,e),await W(i,e),vt(i,e),await Q(i,r,n)}async function Bt(t,e={}){const{width:r,height:n}=D(t,e),i=await At(t,e),s=await y(i),o=document.createElement("canvas"),c=o.getContext("2d"),a=e.pixelRatio||X(),l=e.canvasWidth||r,f=e.canvasHeight||n;return o.width=l*a,o.height=f*a,e.skipAutoScale||Z(o),o.style.width=`${l}`,o.style.height=`${f}`,e.backgroundColor&&(c.fillStyle=e.backgroundColor,c.fillRect(0,0,o.width,o.height)),c.drawImage(s,0,0,o.width,o.height),o}async function kt(t,e={}){return(await Bt(t,e)).toDataURL()}function Ht(){const t=[],e="0123456789abcdef";for(let n=0;n<36;n++)t[n]=e.substr(Math.floor(Math.random()*16),1);return t[14]="4",t[19]=e.substr(t[19]&3|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function jt(t){const e=document.querySelector(t);return kt(e).then(r=>r).catch(r=>{console.error("oops, something went wrong!",r)})}function Wt(t,e,r,n){let i=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${n}">`;i+="<g>";const s=document.createElement("div"),o=document.createElement("image");o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("href",e),s.appendChild(o),i+=s.innerHTML,i+="</g>";const a=document.querySelector(".lf-canvas-overlay g").cloneNode(!0);a.setAttribute("transform","");const l=document.createElement("div");return l.appendChild(a),i+=l.innerHTML,i+="</svg>",i}function B(t,e){const r=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",e),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(r)}const Vt=(t="",e,r,n,i,s)=>{const o=document.createElement("canvas");o.width=n*2,o.height=i*2;const c=o.getContext("2d");r&&(c.fillStyle=r,c.fillRect(0,0,o.width,o.height));const a=document.createElement("img");if(a.width=n,a.height=i,e)a.src=e,a.setAttribute("crossOrigin","Anonymous"),a.onload=function(){c.drawImage(a,0,0,n*2,i*2);const l=document.createElement("img");l.width=n,l.height=i,l.src=t,l.setAttribute("crossOrigin","Anonymous"),l.onload=function(){c.drawImage(l,0,0,n*2,i*2),B(o.toDataURL(),s),L.success("下载成功!")}};else{const l=document.createElement("img");l.width=n,l.height=i,l.src=t,l.onload=function(){c.drawImage(l,0,0,n*2,i*2),B(o.toDataURL(),s),L.success("下载成功!")}}},_t=(t,e)=>{const r=new Blob([t],{type:"application/json;charset=utf-8"}),n=URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.download=e,i.href=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)},qt=(t,e)=>{const r=new Blob([t],{type:"application/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.download=e,i.href=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)},zt=t=>{if(typeof t=="string")try{const e=JSON.parse(t);return!!(typeof e=="object"&&e)}catch{return!1}return!1};function V(t){const e=t.x,r=t.x+t.width||t.properties.width,n=t.y,i=t.y+t.height||t.properties.height;return{boundingBoxLeft:e,boundingBoxRight:r,boundingBoxTop:n,boundingBoxBottom:i}}function Gt(t,e){const r=t.x,n=t.x+t.width,i=t.y,s=t.y+t.height,{boundingBoxLeft:o,boundingBoxRight:c,boundingBoxBottom:a,boundingBoxTop:l}=V(e);return!(n<o||r>c||i>a||s<l)}function Dt(t,e){const r=t.x,n=t.x+t.width,i=t.y,s=t.y+t.height,{boundingBoxLeft:o,boundingBoxRight:c,boundingBoxBottom:a,boundingBoxTop:l}=V(e);return r>=o&&r<c&&n<=c&&n>o&&i>=l&&i<a&&s<=a&&s>l}function k(t){if(!t)return;let e={x:0,y:0},r={x:0,y:0};t.modelType==="line-edge"?(e=t.startPoint,r=t.endPoint):(e=t.pointsList[0],r=t.pointsList[t.pointsList.length-1]);const n=Math.abs(r.x-e.x),i=Math.abs(r.y-e.y);return{x:e.x<r.x?e.x:r.x,y:e.y<r.y?e.y:r.y,width:n,heig