Commit 1cbbd392a773a25281a1819f541d51f6eb847293
1 parent
8156d13f
盒型设计新增贴边
Showing
2 changed files
with
203 additions
and
156 deletions
src/components/Common/BoxDesign/createAirplaneBox.js
| @@ -2,8 +2,9 @@ | @@ -2,8 +2,9 @@ | ||
| 2 | // 创建飞机盒盒身 | 2 | // 创建飞机盒盒身 |
| 3 | const boxContent = (width, height, offsetX, offsetY) => { | 3 | const boxContent = (width, height, offsetX, offsetY) => { |
| 4 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 4 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 5 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} L ${offsetX + width} ${offsetY + height} L ${offsetX + | ||
| 6 | - width} ${offsetY} L ${offsetX} ${offsetY} Z`; | 5 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} L ${offsetX + width} ${offsetY + height} L ${ |
| 6 | + offsetX + width | ||
| 7 | + } ${offsetY} L ${offsetX} ${offsetY} Z`; | ||
| 7 | svg.setAttribute("d", d); | 8 | svg.setAttribute("d", d); |
| 8 | svg.setAttribute("fill", "transparent"); | 9 | svg.setAttribute("fill", "transparent"); |
| 9 | svg.setAttribute("stroke", "#333"); | 10 | svg.setAttribute("stroke", "#333"); |
| @@ -14,8 +15,9 @@ const boxContent = (width, height, offsetX, offsetY) => { | @@ -14,8 +15,9 @@ const boxContent = (width, height, offsetX, offsetY) => { | ||
| 14 | // 创建飞机盒上盒部件 | 15 | // 创建飞机盒上盒部件 |
| 15 | const createBoxTop = (width, height, offsetX, offsetY, outerWidth) => { | 16 | const createBoxTop = (width, height, offsetX, offsetY, outerWidth) => { |
| 16 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 17 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 17 | - const d = `M ${offsetX} ${offsetY} L ${width} ${offsetY} A ${height} ${height} 0 0 1 ${width + outerWidth} ${offsetX} L ${offsetX - | ||
| 18 | - outerWidth} ${offsetY + height} A ${height} ${height} 0 0 1 ${offsetX} ${offsetY}`; | 18 | + const d = `M ${offsetX} ${offsetY} L ${width} ${offsetY} A ${height} ${height} 0 0 1 ${width + outerWidth} ${offsetX} L ${offsetX - outerWidth} ${ |
| 19 | + offsetY + height | ||
| 20 | + } A ${height} ${height} 0 0 1 ${offsetX} ${offsetY}`; | ||
| 19 | svg.setAttribute("d", d); | 21 | svg.setAttribute("d", d); |
| 20 | svg.setAttribute("fill", "transparent"); | 22 | svg.setAttribute("fill", "transparent"); |
| 21 | svg.setAttribute("stroke", "#333"); | 23 | svg.setAttribute("stroke", "#333"); |
| @@ -25,8 +27,9 @@ const createBoxTop = (width, height, offsetX, offsetY, outerWidth) => { | @@ -25,8 +27,9 @@ const createBoxTop = (width, height, offsetX, offsetY, outerWidth) => { | ||
| 25 | // 创建飞机左上部件 | 27 | // 创建飞机左上部件 |
| 26 | const createBoxLeftTop = (width, height, offsetX, offsetY, isLeft) => { | 28 | const createBoxLeftTop = (width, height, offsetX, offsetY, isLeft) => { |
| 27 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 29 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 28 | - const d = `M ${offsetX} ${offsetY} L ${offsetX - width + (isLeft ? 5 : -5)} ${offsetY + 5} A 10 10 0 0 ${isLeft ? 0 : 1} ${offsetX - | ||
| 29 | - width} ${offsetY + 15} L ${offsetX - width} ${offsetY + height - 15} | 30 | + const d = `M ${offsetX} ${offsetY} L ${offsetX - width + (isLeft ? 5 : -5)} ${offsetY + 5} A 10 10 0 0 ${isLeft ? 0 : 1} ${offsetX - width} ${ |
| 31 | + offsetY + 15 | ||
| 32 | + } L ${offsetX - width} ${offsetY + height - 15} | ||
| 30 | A 10 10 0 0 ${isLeft ? 0 : 1} ${offsetX - width + (isLeft ? 5 : -5)} ${offsetY + height - 5} L ${offsetX} ${offsetY + height}`; | 33 | A 10 10 0 0 ${isLeft ? 0 : 1} ${offsetX - width + (isLeft ? 5 : -5)} ${offsetY + height - 5} L ${offsetX} ${offsetY + height}`; |
| 31 | svg.setAttribute("d", d); | 34 | svg.setAttribute("d", d); |
| 32 | svg.setAttribute("fill", "transparent"); | 35 | svg.setAttribute("fill", "transparent"); |
| @@ -117,9 +120,9 @@ export const createTrapezoid = (height, offsetX, offsetY, size) => { | @@ -117,9 +120,9 @@ export const createTrapezoid = (height, offsetX, offsetY, size) => { | ||
| 117 | // 左上盒舌 盒舌 x轴原点 y轴原点 高度 x轴方向偏移 y轴方向偏移 是否瞬时针 是否镜像 type0 | 120 | // 左上盒舌 盒舌 x轴原点 y轴原点 高度 x轴方向偏移 y轴方向偏移 是否瞬时针 是否镜像 type0 |
| 118 | export const createTopTongue = (width, offsetX, offsetY, size, xz, yz, clockwise, isMirror, az, jxY) => { | 121 | export const createTopTongue = (width, offsetX, offsetY, size, xz, yz, clockwise, isMirror, az, jxY) => { |
| 119 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 122 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 120 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + xz} ${offsetY + az} L ${offsetX + xz} ${offsetY - size} L ${offsetX + | ||
| 121 | - width - | ||
| 122 | - (isMirror ? -(yz * 2) : yz * 2)} ${offsetY - size} | 123 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + xz} ${offsetY + az} L ${offsetX + xz} ${offsetY - size} L ${ |
| 124 | + offsetX + width - (isMirror ? -(yz * 2) : yz * 2) | ||
| 125 | + } ${offsetY - size} | ||
| 123 | A ${yz} ${yz} 0 0 ${clockwise} ${offsetX + width - (isMirror ? -yz : yz)} ${offsetY - size + jxY} L ${offsetX + width} ${offsetY}`; | 126 | A ${yz} ${yz} 0 0 ${clockwise} ${offsetX + width - (isMirror ? -yz : yz)} ${offsetY - size + jxY} L ${offsetX + width} ${offsetY}`; |
| 124 | svg.setAttribute("d", d); | 127 | svg.setAttribute("d", d); |
| 125 | svg.setAttribute("fill", "transparent"); | 128 | svg.setAttribute("fill", "transparent"); |
| @@ -130,9 +133,9 @@ export const createTopTongue = (width, offsetX, offsetY, size, xz, yz, clockwise | @@ -130,9 +133,9 @@ export const createTopTongue = (width, offsetX, offsetY, size, xz, yz, clockwise | ||
| 130 | // 下边 | 133 | // 下边 |
| 131 | export const createBottomTongue = (width, offsetX, offsetY, size, xz, yz, clockwise, isMirror, az, jxY) => { | 134 | export const createBottomTongue = (width, offsetX, offsetY, size, xz, yz, clockwise, isMirror, az, jxY) => { |
| 132 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 135 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 133 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + xz} ${offsetY + az} L ${offsetX + xz} ${offsetY - size} L ${offsetX + | ||
| 134 | - width - | ||
| 135 | - (isMirror ? -(yz * 2) : yz * 2)} ${offsetY - size} | 136 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + xz} ${offsetY + az} L ${offsetX + xz} ${offsetY - size} L ${ |
| 137 | + offsetX + width - (isMirror ? -(yz * 2) : yz * 2) | ||
| 138 | + } ${offsetY - size} | ||
| 136 | A ${yz} ${yz} 0 0 ${clockwise} ${offsetX + width - (isMirror ? -yz : yz)} ${offsetY - size + jxY} L ${offsetX + width} ${offsetY}`; | 139 | A ${yz} ${yz} 0 0 ${clockwise} ${offsetX + width - (isMirror ? -yz : yz)} ${offsetY - size + jxY} L ${offsetX + width} ${offsetY}`; |
| 137 | svg.setAttribute("d", d); | 140 | svg.setAttribute("d", d); |
| 138 | svg.setAttribute("fill", "transparent"); | 141 | svg.setAttribute("fill", "transparent"); |
| @@ -143,8 +146,9 @@ export const createBottomTongue = (width, offsetX, offsetY, size, xz, yz, clockw | @@ -143,8 +146,9 @@ export const createBottomTongue = (width, offsetX, offsetY, size, xz, yz, clockw | ||
| 143 | // 上盒舌类型1 | 146 | // 上盒舌类型1 |
| 144 | export const createTopTongueType1 = (width, offsetX, offsetY, size, xz, yz) => { | 147 | export const createTopTongueType1 = (width, offsetX, offsetY, size, xz, yz) => { |
| 145 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 148 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 146 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + xz} ${offsetY + size} L ${offsetX + width - xz + yz} ${offsetY + size} L${offsetX + | ||
| 147 | - width} ${offsetY} `; | 149 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + xz} ${offsetY + size} L ${offsetX + width - xz + yz} ${offsetY + size} L${ |
| 150 | + offsetX + width | ||
| 151 | + } ${offsetY} `; | ||
| 148 | svg.setAttribute("d", d); | 152 | svg.setAttribute("d", d); |
| 149 | svg.setAttribute("fill", "transparent"); | 153 | svg.setAttribute("fill", "transparent"); |
| 150 | svg.setAttribute("stroke", "#333"); | 154 | svg.setAttribute("stroke", "#333"); |
| @@ -156,8 +160,9 @@ export const createDynamicTop = (width, height, deep, offsetX, offsetY, size) => | @@ -156,8 +160,9 @@ export const createDynamicTop = (width, height, deep, offsetX, offsetY, size) => | ||
| 156 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 160 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 157 | // 动态生成路径,基于输入参数 | 161 | // 动态生成路径,基于输入参数 |
| 158 | const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY - deep - size + isSignNum} A 2 2 0 0 1 ${offsetX + 2} ${offsetY - deep - size} | 162 | const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY - deep - size + isSignNum} A 2 2 0 0 1 ${offsetX + 2} ${offsetY - deep - size} |
| 159 | - L ${offsetX + width - 2} ${offsetY - deep - size} A 2 2 0 0 1 ${offsetX + width} ${offsetY - deep - size + isSignNum} L ${offsetX + | ||
| 160 | - width} ${offsetY - deep} | 163 | + L ${offsetX + width - 2} ${offsetY - deep - size} A 2 2 0 0 1 ${offsetX + width} ${offsetY - deep - size + isSignNum} L ${offsetX + width} ${ |
| 164 | + offsetY - deep | ||
| 165 | + } | ||
| 161 | L ${offsetX} ${offsetY - deep} L ${offsetX + width} ${offsetY - deep} L ${offsetX + width} ${offsetY} `; | 166 | L ${offsetX} ${offsetY - deep} L ${offsetX + width} ${offsetY - deep} L ${offsetX + width} ${offsetY} `; |
| 162 | svg.setAttribute("d", d); | 167 | svg.setAttribute("d", d); |
| 163 | svg.setAttribute("fill", "transparent"); | 168 | svg.setAttribute("fill", "transparent"); |
| @@ -203,12 +208,13 @@ export const createText = (offsetX, offsetY, size, textContent) => { | @@ -203,12 +208,13 @@ export const createText = (offsetX, offsetY, size, textContent) => { | ||
| 203 | export const createDoubleArrow = (height, offsetX, offsetY, scale) => { | 208 | export const createDoubleArrow = (height, offsetX, offsetY, scale) => { |
| 204 | const Y = -3 * (scale ? scale : 1); | 209 | const Y = -3 * (scale ? scale : 1); |
| 205 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 210 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 206 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY - height / 2 - Y} L ${offsetX + Y} ${offsetY - height / 2 - Y} L ${offsetX} ${offsetY - | ||
| 207 | - height / 2} | 211 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY - height / 2 - Y} L ${offsetX + Y} ${offsetY - height / 2 - Y} L ${offsetX} ${ |
| 212 | + offsetY - height / 2 | ||
| 213 | + } | ||
| 208 | L ${offsetX - Y} ${offsetY - height / 2 - Y} L ${offsetX} ${offsetY - height / 2 - Y} L ${offsetX} ${offsetY + height / 2 + Y} L | 214 | L ${offsetX - Y} ${offsetY - height / 2 - Y} L ${offsetX} ${offsetY - height / 2 - Y} L ${offsetX} ${offsetY + height / 2 + Y} L |
| 209 | - ${offsetX - Y} ${offsetY + height / 2 + Y} L ${offsetX} ${offsetY + height / 2} L ${offsetX + Y} ${offsetY + | ||
| 210 | - height / 2 + | ||
| 211 | - Y} L ${offsetX} ${offsetY + height / 2 + Y}`; | 215 | + ${offsetX - Y} ${offsetY + height / 2 + Y} L ${offsetX} ${offsetY + height / 2} L ${offsetX + Y} ${offsetY + height / 2 + Y} L ${offsetX} ${ |
| 216 | + offsetY + height / 2 + Y | ||
| 217 | + }`; | ||
| 212 | svg.setAttribute("d", d); | 218 | svg.setAttribute("d", d); |
| 213 | svg.setAttribute("fill", "#F5AD6C"); | 219 | svg.setAttribute("fill", "#F5AD6C"); |
| 214 | svg.setAttribute("stroke", "#F5AD6C"); | 220 | svg.setAttribute("stroke", "#F5AD6C"); |
| @@ -220,11 +226,12 @@ export const createDoubleArrow = (height, offsetX, offsetY, scale) => { | @@ -220,11 +226,12 @@ export const createDoubleArrow = (height, offsetX, offsetY, scale) => { | ||
| 220 | export const createHorizontalDoubleArrow = (width, offsetX, offsetY, scale) => { | 226 | export const createHorizontalDoubleArrow = (width, offsetX, offsetY, scale) => { |
| 221 | const Y = 3 * (scale ? scale : 1); | 227 | const Y = 3 * (scale ? scale : 1); |
| 222 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 228 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 223 | - const d = `M ${offsetX} ${offsetY} L ${offsetX - width / 2 + Y} ${offsetY} L ${offsetX - width / 2 + Y} ${offsetY - Y} L ${offsetX - | ||
| 224 | - width / 2} ${offsetY} | ||
| 225 | - L ${offsetX - width / 2 + Y} ${offsetY + Y} L ${offsetX - width / 2 + Y} ${offsetY} L ${offsetX + width / 2 - Y} ${offsetY} L ${offsetX + | ||
| 226 | - width / 2 - | ||
| 227 | - Y} ${offsetY + Y} L ${offsetX + width / 2} ${offsetY} | 229 | + const d = `M ${offsetX} ${offsetY} L ${offsetX - width / 2 + Y} ${offsetY} L ${offsetX - width / 2 + Y} ${offsetY - Y} L ${ |
| 230 | + offsetX - width / 2 | ||
| 231 | + } ${offsetY} | ||
| 232 | + L ${offsetX - width / 2 + Y} ${offsetY + Y} L ${offsetX - width / 2 + Y} ${offsetY} L ${offsetX + width / 2 - Y} ${offsetY} L ${ | ||
| 233 | + offsetX + width / 2 - Y | ||
| 234 | + } ${offsetY + Y} L ${offsetX + width / 2} ${offsetY} | ||
| 228 | L ${offsetX + width / 2 - Y} ${offsetY - Y} L ${offsetX + width / 2 - Y} ${offsetY}`; | 235 | L ${offsetX + width / 2 - Y} ${offsetY - Y} L ${offsetX + width / 2 - Y} ${offsetY}`; |
| 229 | svg.setAttribute("d", d); | 236 | svg.setAttribute("d", d); |
| 230 | svg.setAttribute("fill", "#F5AD6C"); | 237 | svg.setAttribute("fill", "#F5AD6C"); |
| @@ -437,7 +444,10 @@ export function createBoxs(slaveRowData) { | @@ -437,7 +444,10 @@ export function createBoxs(slaveRowData) { | ||
| 437 | export function createHeavenBox(slaveRowData) { | 444 | export function createHeavenBox(slaveRowData) { |
| 438 | const pathList = []; | 445 | const pathList = []; |
| 439 | const { W, L, D, dF, dF1, dD1, dZBJJ } = slaveRowData; | 446 | const { W, L, D, dF, dF1, dD1, dZBJJ } = slaveRowData; |
| 440 | - const rectangles = [{ x: 0, y: 0, width: L, height: W }, { x: L + D + dZBJJ + dD1, y: -2, width: L + 4, height: W + 4 }]; | 447 | + const rectangles = [ |
| 448 | + { x: 0, y: 0, width: L, height: W }, | ||
| 449 | + { x: L + D + dZBJJ + dD1, y: -2, width: L + 4, height: W + 4 }, | ||
| 450 | + ]; | ||
| 441 | rectangles.forEach(x => { | 451 | rectangles.forEach(x => { |
| 442 | pathList.push(boxContent(x.width, x.height, x.x, x.y)); | 452 | pathList.push(boxContent(x.width, x.height, x.x, x.y)); |
| 443 | }); | 453 | }); |
| @@ -513,8 +523,9 @@ export function createDiscBox(slaveRowData) { | @@ -513,8 +523,9 @@ export function createDiscBox(slaveRowData) { | ||
| 513 | // 展示盒f1 | 523 | // 展示盒f1 |
| 514 | const createShowBoxF1 = (width, height, offsetX, offsetY, size) => { | 524 | const createShowBoxF1 = (width, height, offsetX, offsetY, size) => { |
| 515 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 525 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 516 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + size} L ${offsetX - width} ${offsetY + size + 1} L ${offsetX - width} ${offsetY + | ||
| 517 | - height} L ${offsetX} ${offsetY + height} Z`; | 526 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + size} L ${offsetX - width} ${offsetY + size + 1} L ${offsetX - width} ${ |
| 527 | + offsetY + height | ||
| 528 | + } L ${offsetX} ${offsetY + height} Z`; | ||
| 518 | svg.setAttribute("d", d); | 529 | svg.setAttribute("d", d); |
| 519 | svg.setAttribute("fill", "transparent"); | 530 | svg.setAttribute("fill", "transparent"); |
| 520 | svg.setAttribute("stroke", "#333"); | 531 | svg.setAttribute("stroke", "#333"); |
| @@ -546,7 +557,11 @@ const createShowBoxF2 = (width, height, offsetX, offsetY, size) => { | @@ -546,7 +557,11 @@ const createShowBoxF2 = (width, height, offsetX, offsetY, size) => { | ||
| 546 | export function createShowBox(slaveRowData) { | 557 | export function createShowBox(slaveRowData) { |
| 547 | const pathList = []; | 558 | const pathList = []; |
| 548 | const { L, W, D, dD2, dF1, dF2 } = slaveRowData; | 559 | const { L, W, D, dD2, dF1, dF2 } = slaveRowData; |
| 549 | - const rectangles = [{ x: 0, y: 0, width: D, height: W }, { x: D, y: 0, width: L, height: W }, { x: D + L, y: 0, width: dD2, height: W }]; | 560 | + const rectangles = [ |
| 561 | + { x: 0, y: 0, width: D, height: W }, | ||
| 562 | + { x: D, y: 0, width: L, height: W }, | ||
| 563 | + { x: D + L, y: 0, width: dD2, height: W }, | ||
| 564 | + ]; | ||
| 550 | rectangles.forEach(x => { | 565 | rectangles.forEach(x => { |
| 551 | pathList.push(boxContent(x.width, x.height, x.x, x.y)); | 566 | pathList.push(boxContent(x.width, x.height, x.x, x.y)); |
| 552 | }); | 567 | }); |
| @@ -578,8 +593,9 @@ export function createShowBox(slaveRowData) { | @@ -578,8 +593,9 @@ export function createShowBox(slaveRowData) { | ||
| 578 | // 内衬槽 | 593 | // 内衬槽 |
| 579 | const createInnerLiningGroove = (width, height, offsetX, offsetY) => { | 594 | const createInnerLiningGroove = (width, height, offsetX, offsetY) => { |
| 580 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 595 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 581 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height - width / 2} A ${width / 2} ${width / 2} 0 0 0 ${offsetX - width} ${offsetY + | ||
| 582 | - height} L ${offsetX - width} ${offsetY}`; | 596 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height - width / 2} A ${width / 2} ${width / 2} 0 0 0 ${offsetX - width} ${ |
| 597 | + offsetY + height | ||
| 598 | + } L ${offsetX - width} ${offsetY}`; | ||
| 583 | svg.setAttribute("d", d); | 599 | svg.setAttribute("d", d); |
| 584 | svg.setAttribute("fill", "transparent"); | 600 | svg.setAttribute("fill", "transparent"); |
| 585 | svg.setAttribute("stroke", "#333"); | 601 | svg.setAttribute("stroke", "#333"); |
| @@ -610,8 +626,9 @@ export function createLiningBox(slaveRowData) { | @@ -610,8 +626,9 @@ export function createLiningBox(slaveRowData) { | ||
| 610 | } | 626 | } |
| 611 | const createDiagonalEdging = (width, height, offsetX, offsetY) => { | 627 | const createDiagonalEdging = (width, height, offsetX, offsetY) => { |
| 612 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); | 628 | const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
| 613 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + 5} ${offsetY + height} L ${offsetX + width - 5} ${offsetY + height} L${offsetX + | ||
| 614 | - width} ${offsetY}`; | 629 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + 5} ${offsetY + height} L ${offsetX + width - 5} ${offsetY + height} L${ |
| 630 | + offsetX + width | ||
| 631 | + } ${offsetY}`; | ||
| 615 | svg.setAttribute("d", d); | 632 | svg.setAttribute("d", d); |
| 616 | svg.setAttribute("fill", "transparent"); | 633 | svg.setAttribute("fill", "transparent"); |
| 617 | svg.setAttribute("stroke", "#333"); | 634 | svg.setAttribute("stroke", "#333"); |
| @@ -671,14 +688,16 @@ export const createLineWeltTop = (width, height, offsetX, offsetY) => { | @@ -671,14 +688,16 @@ export const createLineWeltTop = (width, height, offsetX, offsetY) => { | ||
| 671 | 688 | ||
| 672 | // 上方盒舌等腰梯形 | 689 | // 上方盒舌等腰梯形 |
| 673 | export const createIsoscelesTrapezoidWeltTop = (width, height, offsetX, offsetY) => { | 690 | export const createIsoscelesTrapezoidWeltTop = (width, height, offsetX, offsetY) => { |
| 674 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.1} ${offsetY + height} L ${offsetX + width * 0.9} ${offsetY + height} L ${offsetX + | ||
| 675 | - width} ${offsetY}`; | 691 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.1} ${offsetY + height} L ${offsetX + width * 0.9} ${offsetY + height} L ${ |
| 692 | + offsetX + width | ||
| 693 | + } ${offsetY}`; | ||
| 676 | return createSvg(d); | 694 | return createSvg(d); |
| 677 | }; | 695 | }; |
| 678 | // 盒舌梯形 | 696 | // 盒舌梯形 |
| 679 | export const createTrapezoidWeltTop = (width, height, offsetX, offsetY) => { | 697 | export const createTrapezoidWeltTop = (width, height, offsetX, offsetY) => { |
| 680 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.5} ${offsetY + height} L ${offsetX + width * 0.9} ${offsetY + height} L ${offsetX + | ||
| 681 | - width} ${offsetY}`; | 698 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.5} ${offsetY + height} L ${offsetX + width * 0.9} ${offsetY + height} L ${ |
| 699 | + offsetX + width | ||
| 700 | + } ${offsetY}`; | ||
| 682 | return createSvg(d); | 701 | return createSvg(d); |
| 683 | }; | 702 | }; |
| 684 | // 盒舌折叠 | 703 | // 盒舌折叠 |
| @@ -698,8 +717,9 @@ export const createFoldWeltTopLine = (width, height, offsetX, offsetY) => { | @@ -698,8 +717,9 @@ export const createFoldWeltTopLine = (width, height, offsetX, offsetY) => { | ||
| 698 | export const createRoundedCornersWeltTop = (width, height, offsetX, offsetY) => { | 717 | export const createRoundedCornersWeltTop = (width, height, offsetX, offsetY) => { |
| 699 | const isNegative = (width > 0 && height > 0) || (width < 0 && height < 0); | 718 | const isNegative = (width > 0 && height > 0) || (width < 0 && height < 0); |
| 700 | 719 | ||
| 701 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.1} ${offsetY + height * 0.9} L ${offsetX + width} ${offsetY + height} L ${offsetX + | ||
| 702 | - width} ${offsetY}`; | 720 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.1} ${offsetY + height * 0.9} L ${offsetX + width} ${offsetY + height} L ${ |
| 721 | + offsetX + width | ||
| 722 | + } ${offsetY}`; | ||
| 703 | return createSvg(d); | 723 | return createSvg(d); |
| 704 | }; | 724 | }; |
| 705 | // 盒底组件 直角 | 725 | // 盒底组件 直角 |
| @@ -707,29 +727,28 @@ export const createRightAngleBoxBottomComponent = (width, deep, size, offsetX, o | @@ -707,29 +727,28 @@ export const createRightAngleBoxBottomComponent = (width, deep, size, offsetX, o | ||
| 707 | const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + size} L ${offsetX + width} ${offsetY + size} L ${offsetX + width} ${offsetY} | 727 | const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + size} L ${offsetX + width} ${offsetY + size} L ${offsetX + width} ${offsetY} |
| 708 | L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep} ${offsetY} | 728 | L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep} ${offsetY} |
| 709 | L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} | 729 | L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} |
| 710 | - L ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width + deep} ${offsetY + size} L ${offsetX + | ||
| 711 | - width + | ||
| 712 | - deep + | ||
| 713 | - width + | ||
| 714 | - deep} ${offsetY}`; | 730 | + L ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width + deep} ${offsetY + size} L ${ |
| 731 | + offsetX + width + deep + width + deep | ||
| 732 | + } ${offsetY}`; | ||
| 715 | return createSvg(d); | 733 | return createSvg(d); |
| 716 | }; | 734 | }; |
| 717 | // 盒底组件 5002 | 735 | // 盒底组件 5002 |
| 718 | export const createBoxBottomComponent1 = (width, deep, size, offsetX, offsetY) => { | 736 | export const createBoxBottomComponent1 = (width, deep, size, offsetX, offsetY) => { |
| 719 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.2} ${offsetY + size * 0.5} L ${offsetX + width * 0.2} ${offsetY + size} L ${offsetX + | ||
| 720 | - width * 0.8} ${offsetY + size} L ${offsetX + width * 0.8} ${offsetY + size * 0.5} L ${offsetX + width} ${offsetY} | ||
| 721 | - L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + | ||
| 722 | - size * 0.5} L ${offsetX + width + deep} ${offsetY} | ||
| 723 | - L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width * 0.2} ${offsetY + size} L ${offsetX + | ||
| 724 | - width + | ||
| 725 | - deep + | ||
| 726 | - width * 0.2} ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.8} ${offsetY + size * 0.5} L ${offsetX + | ||
| 727 | - width + | ||
| 728 | - deep + | ||
| 729 | - width * 0.8} ${offsetY + size} | 737 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.2} ${offsetY + size * 0.5} L ${offsetX + width * 0.2} ${offsetY + size} L ${ |
| 738 | + offsetX + width * 0.8 | ||
| 739 | + } ${offsetY + size} L ${offsetX + width * 0.8} ${offsetY + size * 0.5} L ${offsetX + width} ${offsetY} | ||
| 740 | + L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${ | ||
| 741 | + offsetY + size * 0.5 | ||
| 742 | + } L ${offsetX + width + deep} ${offsetY} | ||
| 743 | + L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width * 0.2} ${offsetY + size} L ${ | ||
| 744 | + offsetX + width + deep + width * 0.2 | ||
| 745 | + } ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.8} ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.8} ${ | ||
| 746 | + offsetY + size | ||
| 747 | + } | ||
| 730 | L ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} | 748 | L ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} |
| 731 | - L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + size * 0.5} L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + | ||
| 732 | - size} L ${offsetX + width + deep + width + deep} ${offsetY + size} L ${offsetX + width + deep + width + deep} ${offsetY} | 749 | + L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + size * 0.5} L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + size} L ${ |
| 750 | + offsetX + width + deep + width + deep | ||
| 751 | + } ${offsetY + size} L ${offsetX + width + deep + width + deep} ${offsetY} | ||
| 733 | `; | 752 | `; |
| 734 | return createSvg(d); | 753 | return createSvg(d); |
| 735 | }; | 754 | }; |
| @@ -737,17 +756,17 @@ export const createBoxBottomComponent1 = (width, deep, size, offsetX, offsetY) = | @@ -737,17 +756,17 @@ export const createBoxBottomComponent1 = (width, deep, size, offsetX, offsetY) = | ||
| 737 | export const createBoxBottomComponent2 = (width, deep, size, offsetX, offsetY) => { | 756 | export const createBoxBottomComponent2 = (width, deep, size, offsetX, offsetY) => { |
| 738 | const d = `M ${offsetX} ${offsetY} | 757 | const d = `M ${offsetX} ${offsetY} |
| 739 | L ${offsetX + width * 0.2} ${offsetY + size} L ${offsetX + width * 0.8} ${offsetY + size} L ${offsetX + width} ${offsetY} | 758 | L ${offsetX + width * 0.2} ${offsetY + size} L ${offsetX + width * 0.8} ${offsetY + size} L ${offsetX + width} ${offsetY} |
| 740 | - L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + | ||
| 741 | - size * 0.5} L ${offsetX + width + deep} ${offsetY} | ||
| 742 | - L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width * 0.2} ${offsetY + size} L ${offsetX + | ||
| 743 | - width + | ||
| 744 | - deep + | ||
| 745 | - width * 0.2} ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.8} ${offsetY + size * 0.5} L ${offsetX + | ||
| 746 | - width + | ||
| 747 | - deep + | ||
| 748 | - width * 0.8} ${offsetY + size} ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} | ||
| 749 | - L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + size * 0.5} L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + | ||
| 750 | - size} L ${offsetX + width + deep + width + deep} ${offsetY + size} L ${offsetX + width + deep + width + deep} ${offsetY} | 759 | + L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${ |
| 760 | + offsetY + size * 0.5 | ||
| 761 | + } L ${offsetX + width + deep} ${offsetY} | ||
| 762 | + L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width * 0.2} ${offsetY + size} L ${ | ||
| 763 | + offsetX + width + deep + width * 0.2 | ||
| 764 | + } ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.8} ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.8} ${ | ||
| 765 | + offsetY + size | ||
| 766 | + } ${offsetX + width + deep + width} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} | ||
| 767 | + L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + size * 0.5} L ${offsetX + width + deep + width + deep * 0.5} ${offsetY + size} L ${ | ||
| 768 | + offsetX + width + deep + width + deep | ||
| 769 | + } ${offsetY + size} L ${offsetX + width + deep + width + deep} ${offsetY} | ||
| 751 | 770 | ||
| 752 | `; | 771 | `; |
| 753 | return createSvg(d); | 772 | return createSvg(d); |
| @@ -755,20 +774,18 @@ export const createBoxBottomComponent2 = (width, deep, size, offsetX, offsetY) = | @@ -755,20 +774,18 @@ export const createBoxBottomComponent2 = (width, deep, size, offsetX, offsetY) = | ||
| 755 | // 盒底组件 5004 | 774 | // 盒底组件 5004 |
| 756 | export const createBoxBottomComponent3 = (width, deep, size, offsetX, offsetY) => { | 775 | export const createBoxBottomComponent3 = (width, deep, size, offsetX, offsetY) => { |
| 757 | const d = `M ${offsetX} ${offsetY} | 776 | const d = `M ${offsetX} ${offsetY} |
| 758 | - L ${offsetX + width * 0.05} ${offsetY + size} L ${offsetX + width * 0.25} ${offsetY + size} L ${offsetX + width * 0.5} ${offsetY + | ||
| 759 | - size * 0.5} L ${offsetX + width * 0.75} ${offsetY + size} L ${offsetX + width * 0.95} ${offsetY + size} L ${offsetX + width} ${offsetY} | 777 | + L ${offsetX + width * 0.05} ${offsetY + size} L ${offsetX + width * 0.25} ${offsetY + size} L ${offsetX + width * 0.5} ${offsetY + size * 0.5} L ${ |
| 778 | + offsetX + width * 0.75 | ||
| 779 | + } ${offsetY + size} L ${offsetX + width * 0.95} ${offsetY + size} L ${offsetX + width} ${offsetY} | ||
| 760 | L ${offsetX + width + deep * 0.1} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + size} L ${offsetX + width + deep} ${offsetY} | 780 | L ${offsetX + width + deep * 0.1} ${offsetY + size} L ${offsetX + width + deep * 0.5} ${offsetY + size} L ${offsetX + width + deep} ${offsetY} |
| 761 | - L ${offsetX + width + deep + width * 0.05} ${offsetY + size} L ${offsetX + width + deep + width * 0.25} ${offsetY + size} L ${offsetX + | ||
| 762 | - width + | ||
| 763 | - deep + | ||
| 764 | - width * 0.5} ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.75} ${offsetY + size} L ${offsetX + | ||
| 765 | - width + | ||
| 766 | - deep + | ||
| 767 | - width * 0.95} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} | ||
| 768 | - L ${offsetX + width * 2 + deep + deep * 0.5} ${offsetY + size} L ${offsetX + width * 2 + deep + deep * 0.9} ${offsetY + size} L ${offsetX + | ||
| 769 | - width * 2 + | ||
| 770 | - deep + | ||
| 771 | - deep} ${offsetY + size} L ${offsetX + width * 2 + deep * 2} ${offsetY} | 781 | + L ${offsetX + width + deep + width * 0.05} ${offsetY + size} L ${offsetX + width + deep + width * 0.25} ${offsetY + size} L ${ |
| 782 | + offsetX + width + deep + width * 0.5 | ||
| 783 | + } ${offsetY + size * 0.5} L ${offsetX + width + deep + width * 0.75} ${offsetY + size} L ${offsetX + width + deep + width * 0.95} ${ | ||
| 784 | + offsetY + size | ||
| 785 | + } L ${offsetX + width + deep + width} ${offsetY} | ||
| 786 | + L ${offsetX + width * 2 + deep + deep * 0.5} ${offsetY + size} L ${offsetX + width * 2 + deep + deep * 0.9} ${offsetY + size} L ${ | ||
| 787 | + offsetX + width * 2 + deep + deep | ||
| 788 | + } ${offsetY + size} L ${offsetX + width * 2 + deep * 2} ${offsetY} | ||
| 772 | `; | 789 | `; |
| 773 | return createSvg(d); | 790 | return createSvg(d); |
| 774 | }; | 791 | }; |
| @@ -778,9 +795,9 @@ export const createBoxBottomComponent4 = (width, deep, size, offsetX, offsetY) = | @@ -778,9 +795,9 @@ export const createBoxBottomComponent4 = (width, deep, size, offsetX, offsetY) = | ||
| 778 | L ${offsetX} ${offsetY + size} L ${offsetX + width * 0.3} ${offsetY + size} L ${offsetX + width} ${offsetY} | 795 | L ${offsetX} ${offsetY + size} L ${offsetX + width * 0.3} ${offsetY + size} L ${offsetX + width} ${offsetY} |
| 779 | L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep * 0.3} ${offsetY + size} L ${offsetX + width + deep} ${offsetY} | 796 | L ${offsetX + width} ${offsetY + size} L ${offsetX + width + deep * 0.3} ${offsetY + size} L ${offsetX + width + deep} ${offsetY} |
| 780 | L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width * 0.3} ${offsetY + size} L ${offsetX + width * 2 + deep} ${offsetY} | 797 | L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + deep + width * 0.3} ${offsetY + size} L ${offsetX + width * 2 + deep} ${offsetY} |
| 781 | - L ${offsetX + width * 2 + deep} ${offsetY + size} L ${offsetX + width * 2 + deep + deep * 0.3} ${offsetY + size} L ${offsetX + | ||
| 782 | - width * 2 + | ||
| 783 | - deep * 2} ${offsetY} | 798 | + L ${offsetX + width * 2 + deep} ${offsetY + size} L ${offsetX + width * 2 + deep + deep * 0.3} ${offsetY + size} L ${ |
| 799 | + offsetX + width * 2 + deep * 2 | ||
| 800 | + } ${offsetY} | ||
| 784 | `; | 801 | `; |
| 785 | return createSvg(d); | 802 | return createSvg(d); |
| 786 | }; // 盒底组件 5006 | 803 | }; // 盒底组件 5006 |
| @@ -801,16 +818,12 @@ export const createBoxBottomComponent6 = (width, deep, size, offsetX, offsetY) = | @@ -801,16 +818,12 @@ export const createBoxBottomComponent6 = (width, deep, size, offsetX, offsetY) = | ||
| 801 | L ${offsetX + width + deep * 0.8} ${offsetY + size} A ${size * 0.1} ${size * 0.1} 0 0 0 ${offsetX + width + deep * 0.8} ${offsetY + size * 0.7} | 818 | L ${offsetX + width + deep * 0.8} ${offsetY + size} A ${size * 0.1} ${size * 0.1} 0 0 0 ${offsetX + width + deep * 0.8} ${offsetY + size * 0.7} |
| 802 | L ${offsetX + width + deep} ${offsetY} | 819 | L ${offsetX + width + deep} ${offsetY} |
| 803 | L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + width + deep} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} | 820 | L ${offsetX + width + deep} ${offsetY + size} L ${offsetX + width + width + deep} ${offsetY + size} L ${offsetX + width + deep + width} ${offsetY} |
| 804 | - L ${offsetX + width + deep + width + deep * 0.2} ${offsetY + size * 0.7} A ${size * 0.1} ${size * 0.1} 0 0 0 ${offsetX + | ||
| 805 | - width + | ||
| 806 | - deep + | ||
| 807 | - width + | ||
| 808 | - deep * 0.2} ${offsetY + size} | ||
| 809 | - L ${offsetX + width + deep + width + deep * 0.8} ${offsetY + size} A ${size * 0.1} ${size * 0.1} 0 0 0 ${offsetX + | ||
| 810 | - width + | ||
| 811 | - deep + | ||
| 812 | - width + | ||
| 813 | - deep * 0.8} ${offsetY + size * 0.7} | 821 | + L ${offsetX + width + deep + width + deep * 0.2} ${offsetY + size * 0.7} A ${size * 0.1} ${size * 0.1} 0 0 0 ${ |
| 822 | + offsetX + width + deep + width + deep * 0.2 | ||
| 823 | + } ${offsetY + size} | ||
| 824 | + L ${offsetX + width + deep + width + deep * 0.8} ${offsetY + size} A ${size * 0.1} ${size * 0.1} 0 0 0 ${ | ||
| 825 | + offsetX + width + deep + width + deep * 0.8 | ||
| 826 | + } ${offsetY + size * 0.7} | ||
| 814 | L ${offsetX + width + deep + width + deep} ${offsetY} | 827 | L ${offsetX + width + deep + width + deep} ${offsetY} |
| 815 | `; | 828 | `; |
| 816 | return createSvg(d); | 829 | return createSvg(d); |
| @@ -828,31 +841,35 @@ export const createBoxComponentNew1 = (width, deep, size, offsetX, offsetY) => { | @@ -828,31 +841,35 @@ export const createBoxComponentNew1 = (width, deep, size, offsetX, offsetY) => { | ||
| 828 | }; | 841 | }; |
| 829 | // 部件2 | 842 | // 部件2 |
| 830 | export const createBoxComponentNew2 = (width, deep, size, offsetX, offsetY) => { | 843 | export const createBoxComponentNew2 = (width, deep, size, offsetX, offsetY) => { |
| 831 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.4} ${offsetY} L ${offsetX + width * 0.4} ${offsetY + size} L ${offsetX + | ||
| 832 | - width * 0.6} ${offsetY + size} L ${offsetX + width * 0.6} ${offsetY} L ${offsetX + width} ${offsetY}`; | 844 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + width * 0.4} ${offsetY} L ${offsetX + width * 0.4} ${offsetY + size} L ${offsetX + width * 0.6} ${ |
| 845 | + offsetY + size | ||
| 846 | + } L ${offsetX + width * 0.6} ${offsetY} L ${offsetX + width} ${offsetY}`; | ||
| 833 | return createSvg(d); | 847 | return createSvg(d); |
| 834 | }; | 848 | }; |
| 835 | // 部件3 | 849 | // 部件3 |
| 836 | export const createBoxComponentNew3 = (width, deep, size, offsetX, offsetY) => { | 850 | export const createBoxComponentNew3 = (width, deep, size, offsetX, offsetY) => { |
| 837 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + deep * 2} L ${offsetX + width * 0.2} ${offsetY + deep * 2} L ${offsetX + | ||
| 838 | - width * 0.2} ${offsetY + deep * 2 + size} L ${offsetX + width * 0.4} ${offsetY + deep * 2 + size} | ||
| 839 | - L ${offsetX + width * 0.4} ${offsetY + deep * 2} L ${offsetX + width * 0.6} ${offsetY + deep * 2} L${offsetX + width * 0.6} ${offsetY + | ||
| 840 | - deep * 2 + | ||
| 841 | - size} L ${offsetX + width * 0.8} ${offsetY + deep * 2 + size} L ${offsetX + width * 0.8} ${offsetY + deep * 2} | ||
| 842 | - L ${offsetX + width} ${offsetY + deep * 2} L ${offsetX + width} ${offsetY + deep} L ${offsetX} ${offsetY + deep} L ${offsetX + width} ${offsetY + | ||
| 843 | - deep} ${offsetX + width} ${offsetY}`; | 851 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + deep * 2} L ${offsetX + width * 0.2} ${offsetY + deep * 2} L ${offsetX + width * 0.2} ${ |
| 852 | + offsetY + deep * 2 + size | ||
| 853 | + } L ${offsetX + width * 0.4} ${offsetY + deep * 2 + size} | ||
| 854 | + L ${offsetX + width * 0.4} ${offsetY + deep * 2} L ${offsetX + width * 0.6} ${offsetY + deep * 2} L${offsetX + width * 0.6} ${ | ||
| 855 | + offsetY + deep * 2 + size | ||
| 856 | + } L ${offsetX + width * 0.8} ${offsetY + deep * 2 + size} L ${offsetX + width * 0.8} ${offsetY + deep * 2} | ||
| 857 | + L ${offsetX + width} ${offsetY + deep * 2} L ${offsetX + width} ${offsetY + deep} L ${offsetX} ${offsetY + deep} L ${offsetX + width} ${ | ||
| 858 | + offsetY + deep | ||
| 859 | + } ${offsetX + width} ${offsetY}`; | ||
| 844 | return createSvg(d); | 860 | return createSvg(d); |
| 845 | }; | 861 | }; |
| 846 | // 部件4 | 862 | // 部件4 |
| 847 | export const createBoxComponentNew4 = (width, deep, size, offsetX, offsetY) => { | 863 | export const createBoxComponentNew4 = (width, deep, size, offsetX, offsetY) => { |
| 848 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + deep * 2} L ${offsetX + width} ${offsetY + deep * 2} L ${offsetX + width} ${offsetY + | ||
| 849 | - deep} L ${offsetX} ${offsetY + deep} L ${offsetX + width} ${offsetY + deep} L ${offsetX + width} ${offsetY} | ||
| 850 | - M ${offsetX + width * 0.3} ${offsetY + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep * 0.6} L ${offsetX + width * 0.7} ${offsetY + | ||
| 851 | - deep * 0.6} L ${offsetX + width * 0.7} ${offsetY + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep * 0.8} | ||
| 852 | - M ${offsetX + width * 0.3} ${offsetY + deep + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep + deep * 0.6} L ${offsetX + | ||
| 853 | - width * 0.7} ${offsetY + deep + deep * 0.6} L ${offsetX + width * 0.7} ${offsetY + deep + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + | ||
| 854 | - deep + | ||
| 855 | - deep * 0.8} | 864 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + deep * 2} L ${offsetX + width} ${offsetY + deep * 2} L ${offsetX + width} ${ |
| 865 | + offsetY + deep | ||
| 866 | + } L ${offsetX} ${offsetY + deep} L ${offsetX + width} ${offsetY + deep} L ${offsetX + width} ${offsetY} | ||
| 867 | + M ${offsetX + width * 0.3} ${offsetY + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep * 0.6} L ${offsetX + width * 0.7} ${ | ||
| 868 | + offsetY + deep * 0.6 | ||
| 869 | + } L ${offsetX + width * 0.7} ${offsetY + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep * 0.8} | ||
| 870 | + M ${offsetX + width * 0.3} ${offsetY + deep + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep + deep * 0.6} L ${offsetX + width * 0.7} ${ | ||
| 871 | + offsetY + deep + deep * 0.6 | ||
| 872 | + } L ${offsetX + width * 0.7} ${offsetY + deep + deep * 0.8} L ${offsetX + width * 0.3} ${offsetY + deep + deep * 0.8} | ||
| 856 | `; | 873 | `; |
| 857 | return createSvg(d); | 874 | return createSvg(d); |
| 858 | }; | 875 | }; |
| @@ -884,47 +901,68 @@ export const createBoxComponentNew6 = (width, deep, size, offsetX, offsetY) => { | @@ -884,47 +901,68 @@ export const createBoxComponentNew6 = (width, deep, size, offsetX, offsetY) => { | ||
| 884 | }; | 901 | }; |
| 885 | // 贴边1 | 902 | // 贴边1 |
| 886 | export const createWelt = (height, size, offsetX, offsetY) => { | 903 | export const createWelt = (height, size, offsetX, offsetY) => { |
| 887 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + size * 0.6} ${offsetY} L ${offsetX + size * 0.6} ${offsetY + height} L ${offsetX + | ||
| 888 | - size * 0.6} ${offsetY} L ${offsetX + size} ${offsetY + height * 0.1} L ${offsetX + size} ${offsetY + height * 0.9} L ${offsetX + | ||
| 889 | - size * 0.6} ${offsetY + height} L ${offsetX} ${offsetY + height}`; | 904 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + size * 0.6} ${offsetY} L ${offsetX + size * 0.6} ${offsetY + height} L ${ |
| 905 | + offsetX + size * 0.6 | ||
| 906 | + } ${offsetY} L ${offsetX + size} ${offsetY + height * 0.1} L ${offsetX + size} ${offsetY + height * 0.9} L ${offsetX + size * 0.6} ${ | ||
| 907 | + offsetY + height | ||
| 908 | + } L ${offsetX} ${offsetY + height}`; | ||
| 890 | return createSvg(d); | 909 | return createSvg(d); |
| 891 | }; | 910 | }; |
| 892 | // 贴边1 | 911 | // 贴边1 |
| 893 | export const createWelt1 = (height, size, offsetX, offsetY) => { | 912 | export const createWelt1 = (height, size, offsetX, offsetY) => { |
| 894 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + size} ${offsetY + height * 0.1} L ${offsetX + size} ${offsetY + | ||
| 895 | - height * 0.9} L ${offsetX} ${offsetY + height}`; | 913 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + size} ${offsetY + height * 0.1} L ${offsetX + size} ${offsetY + height * 0.9} L ${offsetX} ${ |
| 914 | + offsetY + height | ||
| 915 | + }`; | ||
| 896 | return createSvg(d); | 916 | return createSvg(d); |
| 897 | }; | 917 | }; |
| 898 | // 贴边2 | 918 | // 贴边2 |
| 899 | export const createWelt2 = (height, size, offsetX, offsetY) => { | 919 | export const createWelt2 = (height, size, offsetX, offsetY) => { |
| 900 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + size} ${offsetY} A ${size * 0.5} ${size} 0 0 1 ${offsetX + size * 0.5} ${offsetY + | ||
| 901 | - size} A ${size * 0.5} ${size} 0 0 1 ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} A ${size * 0.5} ${size} 0 0 1 ${offsetX + | ||
| 902 | - size * 0.5} ${offsetY + height + Math.abs(size)} A ${size * 0.5} ${size} 0 0 1 ${offsetX + size} ${offsetY + height} L ${offsetX + | ||
| 903 | - size} ${offsetY} L ${offsetX + size} ${offsetY + height} L ${offsetX} ${offsetY + height}`; | 920 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + size} ${offsetY} A ${size * 0.5} ${size} 0 0 1 ${offsetX + size * 0.5} ${offsetY + size} A ${ |
| 921 | + size * 0.5 | ||
| 922 | + } ${size} 0 0 1 ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} A ${size * 0.5} ${size} 0 0 1 ${offsetX + size * 0.5} ${ | ||
| 923 | + offsetY + height + Math.abs(size) | ||
| 924 | + } A ${size * 0.5} ${size} 0 0 1 ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${offsetY} L ${offsetX + size} ${ | ||
| 925 | + offsetY + height | ||
| 926 | + } L ${offsetX} ${offsetY + height}`; | ||
| 904 | return createSvg(d); | 927 | return createSvg(d); |
| 905 | }; | 928 | }; |
| 906 | export const createWelt2Right = (height, size, offsetX, offsetY) => { | 929 | export const createWelt2Right = (height, size, offsetX, offsetY) => { |
| 907 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + size} ${offsetY} A ${size * 0.5} ${size} 0 0 0 ${offsetX + size * 0.5} ${offsetY - size} A ${size * | ||
| 908 | - 0.5} ${size} 0 0 0 ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} A ${size * 0.5} ${size} 0 0 0 ${offsetX + size * 0.5} ${offsetY + | ||
| 909 | - height + | ||
| 910 | - Math.abs(size)} A ${size * 0.5} ${size} 0 0 0 ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${offsetY} L ${offsetX + size} ${offsetY + | ||
| 911 | - height} L ${offsetX} ${offsetY + height}`; | 930 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + size} ${offsetY} A ${size * 0.5} ${size} 0 0 0 ${offsetX + size * 0.5} ${offsetY - size} A ${ |
| 931 | + size * 0.5 | ||
| 932 | + } ${size} 0 0 0 ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} A ${size * 0.5} ${size} 0 0 0 ${offsetX + size * 0.5} ${ | ||
| 933 | + offsetY + height + Math.abs(size) | ||
| 934 | + } A ${size * 0.5} ${size} 0 0 0 ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${offsetY} L ${offsetX + size} ${ | ||
| 935 | + offsetY + height | ||
| 936 | + } L ${offsetX} ${offsetY + height}`; | ||
| 912 | return createSvg(d); | 937 | return createSvg(d); |
| 913 | }; | 938 | }; |
| 914 | export const createWelt3 = (height, size, offsetX, offsetY) => { | 939 | export const createWelt3 = (height, size, offsetX, offsetY) => { |
| 915 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} L ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${offsetY + | ||
| 916 | - size * 0.3} L ${offsetX} ${offsetY + size * 0.3} L ${offsetX} ${offsetY}`; | 940 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} L ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${ |
| 941 | + offsetY + size * 0.3 | ||
| 942 | + } L ${offsetX} ${offsetY + size * 0.3} L ${offsetX} ${offsetY}`; | ||
| 943 | + return createSvg(d); | ||
| 944 | +}; | ||
| 945 | +export const createWelt4 = (height, size, offsetX, offsetY, dSFHS, dXFHS) => { | ||
| 946 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY - dSFHS} L ${offsetX + size} ${offsetY - dSFHS} L ${offsetX + size} ${offsetY + height+dXFHS} | ||
| 947 | + L ${offsetX} ${offsetY + height+dXFHS} L ${offsetX} ${offsetY + height}`; | ||
| 917 | return createSvg(d); | 948 | return createSvg(d); |
| 918 | }; | 949 | }; |
| 919 | export const createWelt3Right = (height, size, offsetX, offsetY) => { | 950 | export const createWelt3Right = (height, size, offsetX, offsetY) => { |
| 920 | - const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} L ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${offsetY - | ||
| 921 | - size * 0.3} L ${offsetX} ${offsetY - size * 0.3} L ${offsetX} ${offsetY}`; | 951 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY + height} L ${offsetX + size} ${offsetY + height} L ${offsetX + size} ${ |
| 952 | + offsetY - size * 0.3 | ||
| 953 | + } L ${offsetX} ${offsetY - size * 0.3} L ${offsetX} ${offsetY}`; | ||
| 954 | + return createSvg(d); | ||
| 955 | +}; | ||
| 956 | +export const createWelt4Right = (height, size, offsetX, offsetY, dSFHS, dXFHS) => { | ||
| 957 | + const d = `M ${offsetX} ${offsetY} L ${offsetX} ${offsetY - dSFHS} L ${offsetX + size} ${offsetY - dSFHS} | ||
| 958 | + L ${offsetX + size} ${offsetY + height + dXFHS} L ${offsetX } ${offsetY + height + dXFHS} L ${offsetX} ${offsetY + height}`; | ||
| 922 | return createSvg(d); | 959 | return createSvg(d); |
| 923 | }; | 960 | }; |
| 924 | // 天地盒 | 961 | // 天地盒 |
| 925 | export const createFullTelescope = (width, height, deep, offsetX, offsetY) => { | 962 | export const createFullTelescope = (width, height, deep, offsetX, offsetY) => { |
| 926 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + width} ${offsetY} L ${offsetX + width} ${offsetY + height} L ${offsetX} ${offsetY + | ||
| 927 | - height} L ${offsetX} ${offsetY} | 963 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + width} ${offsetY} L ${offsetX + width} ${offsetY + height} L ${offsetX} ${ |
| 964 | + offsetY + height | ||
| 965 | + } L ${offsetX} ${offsetY} | ||
| 928 | L ${offsetX - deep} ${offsetY} L ${offsetX - deep} ${offsetY + height} L ${offsetX} ${offsetY + height} | 966 | L ${offsetX - deep} ${offsetY} L ${offsetX - deep} ${offsetY + height} L ${offsetX} ${offsetY + height} |
| 929 | L ${offsetX} ${offsetY + height + deep} L ${offsetX + width} ${offsetY + height + deep} L ${offsetX + width} ${offsetY + height} | 967 | L ${offsetX} ${offsetY + height + deep} L ${offsetX + width} ${offsetY + height + deep} L ${offsetX + width} ${offsetY + height} |
| 930 | L ${offsetX + width + deep} ${offsetY + height} L ${offsetX + width + deep} ${offsetY} L ${offsetX + width} ${offsetY} | 968 | L ${offsetX + width + deep} ${offsetY + height} L ${offsetX + width + deep} ${offsetY} L ${offsetX + width} ${offsetY} |
| @@ -969,14 +1007,15 @@ export const createBoxComponentNewFul3 = (width, deep, size, offsetX, offsetY) = | @@ -969,14 +1007,15 @@ export const createBoxComponentNewFul3 = (width, deep, size, offsetX, offsetY) = | ||
| 969 | }; | 1007 | }; |
| 970 | // 天地部件4 | 1008 | // 天地部件4 |
| 971 | export const createBoxComponentNewFul4 = (width, deep, size, offsetX, offsetY) => { | 1009 | export const createBoxComponentNewFul4 = (width, deep, size, offsetX, offsetY) => { |
| 972 | - const d = `M ${offsetX} ${offsetY} L ${offsetX + deep * 2} ${offsetY} L ${offsetX + deep * 2} ${offsetY + width} L ${offsetX + deep} ${offsetY + | ||
| 973 | - width} L ${offsetX + deep} ${offsetY} L ${offsetX + deep} ${offsetY + width} L ${offsetX} ${offsetY + width} | ||
| 974 | - M ${offsetX + deep * 0.8} ${offsetY + width * 0.3} L ${offsetX + deep * 0.6} ${offsetY + width * 0.3} L ${offsetX + deep * 0.6} ${offsetY + | ||
| 975 | - width * 0.7} L ${offsetX + deep * 0.8} ${offsetY + width * 0.7} L ${offsetX + deep * 0.8} ${offsetY + width * 0.3} | ||
| 976 | - M ${offsetX + deep + deep * 0.8} ${offsetY + width * 0.3} L ${offsetX + deep + deep * 0.6} ${offsetY + width * 0.3} L ${offsetX + | ||
| 977 | - deep + | ||
| 978 | - deep * 0.6} ${offsetY + width * 0.7} L ${offsetX + deep + deep * 0.8} ${offsetY + width * 0.7} L ${offsetX + deep + deep * 0.8} ${offsetY + | ||
| 979 | - width * 0.3} | 1010 | + const d = `M ${offsetX} ${offsetY} L ${offsetX + deep * 2} ${offsetY} L ${offsetX + deep * 2} ${offsetY + width} L ${offsetX + deep} ${ |
| 1011 | + offsetY + width | ||
| 1012 | + } L ${offsetX + deep} ${offsetY} L ${offsetX + deep} ${offsetY + width} L ${offsetX} ${offsetY + width} | ||
| 1013 | + M ${offsetX + deep * 0.8} ${offsetY + width * 0.3} L ${offsetX + deep * 0.6} ${offsetY + width * 0.3} L ${offsetX + deep * 0.6} ${ | ||
| 1014 | + offsetY + width * 0.7 | ||
| 1015 | + } L ${offsetX + deep * 0.8} ${offsetY + width * 0.7} L ${offsetX + deep * 0.8} ${offsetY + width * 0.3} | ||
| 1016 | + M ${offsetX + deep + deep * 0.8} ${offsetY + width * 0.3} L ${offsetX + deep + deep * 0.6} ${offsetY + width * 0.3} L ${ | ||
| 1017 | + offsetX + deep + deep * 0.6 | ||
| 1018 | + } ${offsetY + width * 0.7} L ${offsetX + deep + deep * 0.8} ${offsetY + width * 0.7} L ${offsetX + deep + deep * 0.8} ${offsetY + width * 0.3} | ||
| 980 | `; | 1019 | `; |
| 981 | return createSvg(d); | 1020 | return createSvg(d); |
| 982 | }; | 1021 | }; |
| @@ -993,10 +1032,10 @@ export const createBoxComponentNewFul6 = (width, deep, size, offsetX, offsetY) = | @@ -993,10 +1032,10 @@ export const createBoxComponentNewFul6 = (width, deep, size, offsetX, offsetY) = | ||
| 993 | const d = `M ${offsetX} ${offsetY} L ${offsetX + deep} ${offsetY} L ${offsetX + deep} ${offsetY + width * 0.3} | 1032 | const d = `M ${offsetX} ${offsetY} L ${offsetX + deep} ${offsetY} L ${offsetX + deep} ${offsetY + width * 0.3} |
| 994 | L ${offsetX + deep + size * 0.5} ${offsetY + width * 0.3} L ${offsetX + deep + size * 0.5} ${offsetY + width * 0.7} | 1033 | L ${offsetX + deep + size * 0.5} ${offsetY + width * 0.3} L ${offsetX + deep + size * 0.5} ${offsetY + width * 0.7} |
| 995 | L ${offsetX + deep} ${offsetY + width * 0.7} L ${offsetX + deep} ${offsetY + width} L ${offsetX + deep} ${offsetY} | 1034 | L ${offsetX + deep} ${offsetY + width * 0.7} L ${offsetX + deep} ${offsetY + width} L ${offsetX + deep} ${offsetY} |
| 996 | - L ${offsetX+ deep + size} ${offsetY } L ${offsetX + deep + size} ${offsetY + width * 0.1} | ||
| 997 | - L ${offsetX + deep + size * 0.8} ${offsetY + width * 0.1} L ${offsetX + deep + size} ${offsetY+ width * 0.2} | ||
| 998 | - L ${offsetX + deep + size} ${offsetY+ width * 0.8} L ${offsetX + deep + size * 0.8} ${offsetY+ width * 0.9} | 1035 | + L ${offsetX + deep + size} ${offsetY} L ${offsetX + deep + size} ${offsetY + width * 0.1} |
| 1036 | + L ${offsetX + deep + size * 0.8} ${offsetY + width * 0.1} L ${offsetX + deep + size} ${offsetY + width * 0.2} | ||
| 1037 | + L ${offsetX + deep + size} ${offsetY + width * 0.8} L ${offsetX + deep + size * 0.8} ${offsetY + width * 0.9} | ||
| 999 | L ${offsetX + deep + size} ${offsetY + width * 0.9}L ${offsetX + deep + size} ${offsetY + width}L ${offsetX} ${offsetY + width} | 1038 | L ${offsetX + deep + size} ${offsetY + width * 0.9}L ${offsetX + deep + size} ${offsetY + width}L ${offsetX} ${offsetY + width} |
| 1000 | `; | 1039 | `; |
| 1001 | return createSvg(d); | 1040 | return createSvg(d); |
| 1002 | -}; | ||
| 1003 | \ No newline at end of file | 1041 | \ No newline at end of file |
| 1042 | +}; |
src/components/Common/BoxDesignCompontent/svg.js
| @@ -35,7 +35,9 @@ import { | @@ -35,7 +35,9 @@ import { | ||
| 35 | createWelt2, | 35 | createWelt2, |
| 36 | createWelt2Right, | 36 | createWelt2Right, |
| 37 | createWelt3, | 37 | createWelt3, |
| 38 | + createWelt4, | ||
| 38 | createWelt3Right, | 39 | createWelt3Right, |
| 40 | + createWelt4Right, | ||
| 39 | createText, | 41 | createText, |
| 40 | createDoubleArrow, | 42 | createDoubleArrow, |
| 41 | createHorizontalDoubleArrow, | 43 | createHorizontalDoubleArrow, |
| @@ -122,7 +124,7 @@ const SvgBox = props => { | @@ -122,7 +124,7 @@ const SvgBox = props => { | ||
| 122 | let viewBoxHeight = Number(boxHeight) + max; | 124 | let viewBoxHeight = Number(boxHeight) + max; |
| 123 | if (Number(svgType) === 1) { | 125 | if (Number(svgType) === 1) { |
| 124 | // 四面盒身 | 126 | // 四面盒身 |
| 125 | - viewBoxWidth = dZTBW + Number(boxLength) * 2 + Number(boxWidth) * 2; | 127 | + viewBoxWidth = Number(boxLength) * 2 + Number(boxWidth) * 2 + dZTBW + dYTBW; |
| 126 | } else if (Number(svgType) === 2) { | 128 | } else if (Number(svgType) === 2) { |
| 127 | viewBoxWidth = boxLength * 2 + boxWidth + dYTBW + dZTBW; | 129 | viewBoxWidth = boxLength * 2 + boxWidth + dYTBW + dZTBW; |
| 128 | } else if (Number(svgType) === 3) { | 130 | } else if (Number(svgType) === 3) { |
| @@ -269,7 +271,7 @@ const SvgBox = props => { | @@ -269,7 +271,7 @@ const SvgBox = props => { | ||
| 269 | } else { | 271 | } else { |
| 270 | leftSize = zbtb?.value; | 272 | leftSize = zbtb?.value; |
| 271 | } | 273 | } |
| 272 | - svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth} ${viewBoxHeight}`); | 274 | + svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth + 2} ${viewBoxHeight + 2}`); |
| 273 | svg.setAttribute("width", `${viewBoxWidth}px`); | 275 | svg.setAttribute("width", `${viewBoxWidth}px`); |
| 274 | svg.setAttribute("height", `${viewBoxHeight}px`); | 276 | svg.setAttribute("height", `${viewBoxHeight}px`); |
| 275 | svgContainerRef.current.style.width = `${viewBoxWidth}px`; | 277 | svgContainerRef.current.style.width = `${viewBoxWidth}px`; |
| @@ -364,12 +366,12 @@ const SvgBox = props => { | @@ -364,12 +366,12 @@ const SvgBox = props => { | ||
| 364 | } | 366 | } |
| 365 | 367 | ||
| 366 | // 左边贴边 | 368 | // 左边贴边 |
| 367 | - pathList.push(createTrapezoidLeft(zbtb?.type, scaledDeep, -dZTBW * scale, 0, 0)); | 369 | + pathList.push(createTrapezoidLeft(zbtb?.type, scaledDeep, -dZTBW * scale, 0, 0, dSFHS * scale, dXFHS * scale)); |
| 368 | if (zbtb?.type && dZTBW) { | 370 | if (zbtb?.type && dZTBW) { |
| 369 | pathList.push(createText(-dZTBW * 0.4, scaledDeep / 2, 10 * scales, dZTBW)); | 371 | pathList.push(createText(-dZTBW * 0.4, scaledDeep / 2, 10 * scales, dZTBW)); |
| 370 | } | 372 | } |
| 371 | // 右边贴边 | 373 | // 右边贴边 |
| 372 | - pathList.push(createTrapezoidRight(ybtb?.type, scaledDeep, dYTBW * scale, scaledWidth * 2 + scaledHeight * 2, 0)); | 374 | + pathList.push(createTrapezoidRight(ybtb?.type, scaledDeep, dYTBW * scale, scaledWidth * 2 + scaledHeight * 2, 0, dSFHS * scale, dXFHS * scale)); |
| 373 | if (ybtb?.type && dYTBW) { | 375 | if (ybtb?.type && dYTBW) { |
| 374 | pathList.push(createText(scaledWidth * 2 + scaledHeight * 2 + dYTBW * 0.4, scaledDeep / 2, 10 * scales, dYTBW)); | 376 | pathList.push(createText(scaledWidth * 2 + scaledHeight * 2 + dYTBW * 0.4, scaledDeep / 2, 10 * scales, dYTBW)); |
| 375 | } | 377 | } |
| @@ -528,12 +530,12 @@ const SvgBox = props => { | @@ -528,12 +530,12 @@ const SvgBox = props => { | ||
| 528 | pathList.push(createText(scaledWidth + scaledHeight / 2, scaledDeep + (dXFHS / 2 - 5) * scales, 10 * scales, dSFHS)); | 530 | pathList.push(createText(scaledWidth + scaledHeight / 2, scaledDeep + (dXFHS / 2 - 5) * scales, 10 * scales, dSFHS)); |
| 529 | } | 531 | } |
| 530 | // 左边贴边 | 532 | // 左边贴边 |
| 531 | - pathList.push(createTrapezoidLeft(zbtb?.type, scaledDeep, -dZTBW * scale, 0, 0)); | 533 | + pathList.push(createTrapezoidLeft(zbtb?.type, scaledDeep, -dZTBW * scale, 0, 0, dSFHS * scale, dXFHS * scale)); |
| 532 | if (zbtb?.type && dZTBW) { | 534 | if (zbtb?.type && dZTBW) { |
| 533 | pathList.push(createText(-dZTBW / 2, scaledDeep / 2, 10 * scales, dZTBW)); | 535 | pathList.push(createText(-dZTBW / 2, scaledDeep / 2, 10 * scales, dZTBW)); |
| 534 | } | 536 | } |
| 535 | // 右边贴边 | 537 | // 右边贴边 |
| 536 | - pathList.push(createTrapezoidRight(ybtb?.type, scaledDeep, dYTBW * scale, scaledWidth * 2 + scaledHeight, 0)); | 538 | + pathList.push(createTrapezoidRight(ybtb?.type, scaledDeep, dYTBW * scale, scaledWidth * 2 + scaledHeight, 0, dSFHS * scale, dXFHS * scale)); |
| 537 | if (zbtb?.type && dYTBW) { | 539 | if (zbtb?.type && dYTBW) { |
| 538 | pathList.push(createText(scaledWidth * 2 + scaledHeight + dYTBW / 2, scaledDeep / 2, 10 * scales, dYTBW)); | 540 | pathList.push(createText(scaledWidth * 2 + scaledHeight + dYTBW / 2, scaledDeep / 2, 10 * scales, dYTBW)); |
| 539 | } | 541 | } |
| @@ -673,12 +675,12 @@ const SvgBox = props => { | @@ -673,12 +675,12 @@ const SvgBox = props => { | ||
| 673 | pathList.push(createText(scaledWidth + scaledHeight + scaledHeight / 2, scaledDeep + (dXFHS / 2 - 5) * scales, 10 * scales, dXFHS)); | 675 | pathList.push(createText(scaledWidth + scaledHeight + scaledHeight / 2, scaledDeep + (dXFHS / 2 - 5) * scales, 10 * scales, dXFHS)); |
| 674 | } | 676 | } |
| 675 | // 左边贴边 | 677 | // 左边贴边 |
| 676 | - pathList.push(createTrapezoidLeft(zbtb?.type, scaledDeep, -dZTBW * scale, 0, 0)); | 678 | + pathList.push(createTrapezoidLeft(zbtb?.type, scaledDeep, -dZTBW * scale, 0, 0, dSFHS * scale, dXFHS * scale)); |
| 677 | if (zbtb?.type && dZTBW) { | 679 | if (zbtb?.type && dZTBW) { |
| 678 | pathList.push(createText(-dZTBW / 2, scaledDeep / 2, 10 * scales, dZTBW)); | 680 | pathList.push(createText(-dZTBW / 2, scaledDeep / 2, 10 * scales, dZTBW)); |
| 679 | } | 681 | } |
| 680 | // 右边贴边 | 682 | // 右边贴边 |
| 681 | - pathList.push(createTrapezoidRight(ybtb?.type, scaledDeep, dYTBW * scale, scaledWidth + scaledHeight * 2, 0)); | 683 | + pathList.push(createTrapezoidRight(ybtb?.type, scaledDeep, dYTBW * scale, scaledWidth + scaledHeight * 2, 0, dSFHS * scale, dXFHS * scale)); |
| 682 | if (zbtb?.type && dYTBW) { | 684 | if (zbtb?.type && dYTBW) { |
| 683 | pathList.push(createText(scaledWidth + scaledHeight * 2 + dYTBW / 2, scaledDeep / 2, 10 * scales, dYTBW)); | 685 | pathList.push(createText(scaledWidth + scaledHeight * 2 + dYTBW / 2, scaledDeep / 2, 10 * scales, dYTBW)); |
| 684 | } | 686 | } |
| @@ -899,12 +901,12 @@ const SvgBox = props => { | @@ -899,12 +901,12 @@ const SvgBox = props => { | ||
| 899 | } | 901 | } |
| 900 | 902 | ||
| 901 | // 左边贴边 | 903 | // 左边贴边 |
| 902 | - pathList.push(createTrapezoidLeft(zbtb?.type, scaledWidth, -dZTBW * scale, 0, 0)); | 904 | + pathList.push(createTrapezoidLeft(zbtb?.type, scaledWidth, -dZTBW * scale, 0, 0, dSFHS * scale, dXFHS * scale)); |
| 903 | if (zbtb?.type && dZTBW) { | 905 | if (zbtb?.type && dZTBW) { |
| 904 | pathList.push(createText(-dZTBW * 0.4, scaledWidth / 2, 10 * scales, dZTBW)); | 906 | pathList.push(createText(-dZTBW * 0.4, scaledWidth / 2, 10 * scales, dZTBW)); |
| 905 | } | 907 | } |
| 906 | // 右边贴边 | 908 | // 右边贴边 |
| 907 | - pathList.push(createTrapezoidRight(ybtb?.type, scaledWidth, dYTBW * scale, scaledHeight * 2 + scaledDeep * 2, 0)); | 909 | + pathList.push(createTrapezoidRight(ybtb?.type, scaledWidth, dYTBW * scale, scaledHeight * 2 + scaledDeep * 2, 0, dSFHS * scale, dXFHS * scale)); |
| 908 | if (ybtb?.type && dYTBW) { | 910 | if (ybtb?.type && dYTBW) { |
| 909 | pathList.push(createText(scaledHeight * 2 + scaledDeep * 2 + dYTBW * 0.4, scaledWidth / 2, 10 * scales, dYTBW)); | 911 | pathList.push(createText(scaledHeight * 2 + scaledDeep * 2 + dYTBW * 0.4, scaledWidth / 2, 10 * scales, dYTBW)); |
| 910 | } | 912 | } |
| @@ -1364,7 +1366,7 @@ const SvgBox = props => { | @@ -1364,7 +1366,7 @@ const SvgBox = props => { | ||
| 1364 | }; | 1366 | }; |
| 1365 | 1367 | ||
| 1366 | // 左边贴位 | 1368 | // 左边贴位 |
| 1367 | - const createTrapezoidLeft = (trapezoidLeftType, height, size, offsetX, offsetY) => { | 1369 | + const createTrapezoidLeft = (trapezoidLeftType, height, size, offsetX, offsetY, dSFHS, dXFHS) => { |
| 1368 | if (!size) return createNoneProject(); | 1370 | if (!size) return createNoneProject(); |
| 1369 | let data = {}; | 1371 | let data = {}; |
| 1370 | switch (trapezoidLeftType) { | 1372 | switch (trapezoidLeftType) { |
| @@ -1380,6 +1382,9 @@ const SvgBox = props => { | @@ -1380,6 +1382,9 @@ const SvgBox = props => { | ||
| 1380 | case "8004": | 1382 | case "8004": |
| 1381 | data = createWelt3(height, size, offsetX, offsetY); | 1383 | data = createWelt3(height, size, offsetX, offsetY); |
| 1382 | break; | 1384 | break; |
| 1385 | + case "8005": | ||
| 1386 | + data = createWelt4(height, size, offsetX, offsetY, dSFHS, dXFHS); | ||
| 1387 | + break; | ||
| 1383 | default: | 1388 | default: |
| 1384 | data = createNoneProject(); | 1389 | data = createNoneProject(); |
| 1385 | break; | 1390 | break; |
| @@ -1387,7 +1392,7 @@ const SvgBox = props => { | @@ -1387,7 +1392,7 @@ const SvgBox = props => { | ||
| 1387 | return data; | 1392 | return data; |
| 1388 | }; | 1393 | }; |
| 1389 | // 右边贴位 | 1394 | // 右边贴位 |
| 1390 | - const createTrapezoidRight = (trapezoidLeftType, height, size, offsetX, offsetY) => { | 1395 | + const createTrapezoidRight = (trapezoidLeftType, height, size, offsetX, offsetY,dSFHS,dXFHS) => { |
| 1391 | if (!size) return createNoneProject(); | 1396 | if (!size) return createNoneProject(); |
| 1392 | let data = {}; | 1397 | let data = {}; |
| 1393 | switch (trapezoidLeftType) { | 1398 | switch (trapezoidLeftType) { |
| @@ -1403,6 +1408,9 @@ const SvgBox = props => { | @@ -1403,6 +1408,9 @@ const SvgBox = props => { | ||
| 1403 | case "9004": | 1408 | case "9004": |
| 1404 | data = createWelt3Right(height, size, offsetX, offsetY); | 1409 | data = createWelt3Right(height, size, offsetX, offsetY); |
| 1405 | break; | 1410 | break; |
| 1411 | + case "9005": | ||
| 1412 | + data = createWelt4Right(height, size, offsetX, offsetY,dSFHS,dXFHS); | ||
| 1413 | + break; | ||
| 1406 | default: | 1414 | default: |
| 1407 | data = createNoneProject(); | 1415 | data = createNoneProject(); |
| 1408 | break; | 1416 | break; |