Commit 3e4c4ec82a0de0b5f60681bfce023244478103ff
1 parent
f412b387
同步报价
Showing
6 changed files
with
1051 additions
and
700 deletions
src/components/Common/BoxDesignCompontent/index.js
| ... | ... | @@ -24,6 +24,7 @@ const BoxDesignEvent = props => { |
| 24 | 24 | setLoading(false); |
| 25 | 25 | if (!tableData?.length) return |
| 26 | 26 | const shape = tableData?.find(x => x.iTag === 70)?.showDropDown |
| 27 | + if (!shape) return | |
| 27 | 28 | const JsonShape = JSON.parse(shape) |
| 28 | 29 | const arr = Array.from(Object.values(JsonShape)); |
| 29 | 30 | setOptions([ |
| ... | ... | @@ -166,6 +167,7 @@ const BoxDesignCompontent = baseProps => { |
| 166 | 167 | setTableDataList(newList); |
| 167 | 168 | setTableDataLists(newList); |
| 168 | 169 | const shape = tableData.find(x => x.iTag === 70)?.showDropDown |
| 170 | + if (!shape) return | |
| 169 | 171 | const JsonShape = JSON.parse(shape) |
| 170 | 172 | const shapeLists = Array.from(Object.values(JsonShape)) |
| 171 | 173 | setShapeList(shapeLists) |
| ... | ... | @@ -437,6 +439,10 @@ const BoxDesignCompontent = baseProps => { |
| 437 | 439 | setTopDoubleBoxList(box.filter(topBoxFilter)); |
| 438 | 440 | setLeftDoubleBoxList(box.filter(leftBoxFilter)); |
| 439 | 441 | setRightDoubleBoxList(box.filter(rightBoxFilter)); |
| 442 | + } else if (Number(type) === 9) { | |
| 443 | + setTopBoxList([]) | |
| 444 | + setLeftBoxList([]) | |
| 445 | + setRightBoxList([]) | |
| 440 | 446 | } else { |
| 441 | 447 | const box = [...boxList]; |
| 442 | 448 | box.forEach(x => { |
| ... | ... | @@ -558,11 +564,7 @@ const BoxDesignCompontent = baseProps => { |
| 558 | 564 | } |
| 559 | 565 | setBoxList(updatedBoxList); |
| 560 | 566 | }; |
| 561 | - // const getImage = fileName => { | |
| 562 | - // // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&sModelsId=100&token=${props.token}`; | |
| 563 | - // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&scale=0.1&sModelsId=100&token=${props.token}`; | |
| 564 | - // return imageUrl; | |
| 565 | - // }; | |
| 567 | + | |
| 566 | 568 | const removeExtension = (filename) => { |
| 567 | 569 | const lastDotIndex = filename.lastIndexOf('.'); |
| 568 | 570 | if (lastDotIndex === -1) { | ... | ... |
src/components/Common/BoxDesignCompontent/svg.js
| ... | ... | @@ -69,9 +69,10 @@ const SvgBox = props => { |
| 69 | 69 | useEffect(() => { |
| 70 | 70 | setTimeout(() => { |
| 71 | 71 | const svg = svgRef.current; |
| 72 | - if (svg) { | |
| 73 | - initSVG(); | |
| 72 | + if (svg) { | |
| 73 | + initSVG() | |
| 74 | 74 | } |
| 75 | + | |
| 75 | 76 | }, 0); |
| 76 | 77 | }, [boxList, svgType]); |
| 77 | 78 | |
| ... | ... | @@ -343,6 +344,8 @@ const SvgBox = props => { |
| 343 | 344 | const rightOffect = boxList.find(x => x.sName === "右偏移")?.value || 0; |
| 344 | 345 | viewBoxWidth = Math.max(topLength, bottomLength) + Number(leftOffect) + Number(rightOffect); |
| 345 | 346 | viewBoxHeight = Number(headWidth) + Number(orderWidth) + max; |
| 347 | + } else if (Number(svgType) === 9) { | |
| 348 | + | |
| 346 | 349 | } |
| 347 | 350 | // 计算缩放比例 |
| 348 | 351 | let scale = 1; |
| ... | ... | @@ -412,6 +415,10 @@ const SvgBox = props => { |
| 412 | 415 | xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength)); |
| 413 | 416 | } else if (Number(svgType) === 4) { |
| 414 | 417 | xSvg = (boxHeight * 2 + boxLength) / 2; |
| 418 | + } else if (Number(svgType) === 9) { | |
| 419 | + // const data = calculateCupDimensionsAndStart(boxLength, boxWidth, boxHeight, g) | |
| 420 | + // xSvg = (data?.startX + 100) * scale | |
| 421 | + // ySvg = (data?.startDistance + 100) * scale | |
| 415 | 422 | } else { |
| 416 | 423 | xSvg = zbtb?.value; |
| 417 | 424 | } |
| ... | ... | @@ -423,6 +430,7 @@ const SvgBox = props => { |
| 423 | 430 | `${-(xSvg * scale)} ${dSvgBoxWidth ? (dSvgBoxWidth === 100 ? -ySvg : 0) : -ySvg} ${dSvgBoxWidth ? dSvgBoxWidth + ySvg : 500} ${dSvgBoxHeight ? dSvgBoxHeight - ySvg - bottom * scale : 250 + ySvg |
| 424 | 431 | }` |
| 425 | 432 | ); |
| 433 | + | |
| 426 | 434 | svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`); |
| 427 | 435 | svg.setAttribute("height", `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`); |
| 428 | 436 | svgContainerRef.current.style.width = `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`; |
| ... | ... | @@ -481,6 +489,10 @@ const SvgBox = props => { |
| 481 | 489 | xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength)); |
| 482 | 490 | } else if (Number(svgType) === 4) { |
| 483 | 491 | xSvg = (boxHeight * 2 + boxLength) / 2; |
| 492 | + } else if (Number(svgType) === 9) { | |
| 493 | + // const data = calculateCupDimensionsAndStart(boxLength, boxWidth, boxHeight, g) | |
| 494 | + // xSvg = (data?.startX + 150) * scale | |
| 495 | + // ySvg = (data?.startDistance + 100) * scale | |
| 484 | 496 | } else { |
| 485 | 497 | xSvg = zbtb?.value; |
| 486 | 498 | } |
| ... | ... | @@ -492,6 +504,7 @@ const SvgBox = props => { |
| 492 | 504 | "viewBox", |
| 493 | 505 | `${-xSvg} ${dSvgBoxWidth ? -0 : -ySvg} ${dSvgBoxWidth ? dSvgBoxWidth : 500} ${dSvgBoxHeight ? dSvgBoxHeight : 250}` |
| 494 | 506 | ); |
| 507 | + | |
| 495 | 508 | svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`); |
| 496 | 509 | svg.setAttribute("height", `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`); |
| 497 | 510 | svgContainerRef.current.style.width = `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`; |
| ... | ... | @@ -567,6 +580,10 @@ const SvgBox = props => { |
| 567 | 580 | const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); |
| 568 | 581 | leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength)); |
| 569 | 582 | ySvg = topOffect(boxList, headLength, headWidth, props); |
| 583 | + } else if (Number(svgType) === 9) { | |
| 584 | + // const data = calculateCupDimensionsAndStart(boxLength, boxWidth, boxHeight, g) | |
| 585 | + // leftSize = -data?.startX | |
| 586 | + // ySvg = (data?.startDistance) * scale | |
| 570 | 587 | } else { |
| 571 | 588 | leftSize = zbtb?.value; |
| 572 | 589 | if (zbtb?.type === "8009") { |
| ... | ... | @@ -658,6 +675,10 @@ const SvgBox = props => { |
| 658 | 675 | const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); |
| 659 | 676 | leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength)); |
| 660 | 677 | ySvg = topOffect(boxList, headLength, headWidth, props); |
| 678 | + } else if (Number(svgType) === 9) { | |
| 679 | + // const data = calculateCupDimensionsAndStart(boxLength, boxWidth, boxHeight, g) | |
| 680 | + // leftSize = -data?.startX | |
| 681 | + // ySvg = (data?.startDistance) * scale | |
| 661 | 682 | } else { |
| 662 | 683 | leftSize = zbtb?.value; |
| 663 | 684 | } |
| ... | ... | @@ -5179,10 +5200,107 @@ const SvgBox = props => { |
| 5179 | 5200 | |
| 5180 | 5201 | svg.appendChild(g); |
| 5181 | 5202 | } else if (Number(svgType) === 9) { |
| 5182 | - // g.appendChild(createPathElement(rect.x, rect.y, rect.width, rect.height)) | |
| 5183 | - svg.appendChild(g); | |
| 5203 | + svg.appendChild(drawCup(boxLength, boxWidth, boxHeight, g)); | |
| 5204 | + const result = calculateCupUnfoldDimensions(boxLength, boxWidth, boxHeight) | |
| 5205 | + if (props.showNew !== 0) { | |
| 5206 | + const w = result.width | |
| 5207 | + const h = result.height | |
| 5208 | + svg.setAttribute('viewBox', `${result.points.outerLeft.x} ${result.points.topCenter.y} ${w} ${h}`); | |
| 5209 | + svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`); | |
| 5210 | + svg.setAttribute("height", `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`); | |
| 5211 | + } | |
| 5212 | + | |
| 5184 | 5213 | } |
| 5214 | + | |
| 5185 | 5215 | }; |
| 5216 | + function calculateCupUnfoldDimensions(D, d, h) { | |
| 5217 | + | |
| 5218 | + const R1 = D / 2; // 上口半径 | |
| 5219 | + const R2 = d / 2; // 底部半径 | |
| 5220 | + | |
| 5221 | + // 1. 计算母线长 l | |
| 5222 | + const deltaR = R1 - R2; | |
| 5223 | + const l = Math.sqrt(deltaR * deltaR + h * h); | |
| 5224 | + | |
| 5225 | + // 2. 计算外半径 R 和内半径 r | |
| 5226 | + const R = (R1 * l) / deltaR; // 外半径 | |
| 5227 | + const r = R - l; // 内半径 | |
| 5228 | + | |
| 5229 | + // 3. 计算圆心角 θ(弧度) | |
| 5230 | + const theta_rad = (2 * Math.PI * R1) / R; | |
| 5231 | + const halfTheta = theta_rad / 2; | |
| 5232 | + | |
| 5233 | + // 4. 计算弦长(水平宽度) | |
| 5234 | + const chord = 2 * R * Math.sin(halfTheta); | |
| 5235 | + | |
| 5236 | + // 5. 展开图垂直高度 | |
| 5237 | + const y_top = -R; // 外弧中点(最高点) | |
| 5238 | + const y_inner_end = -r * Math.cos(halfTheta); | |
| 5239 | + const verticalHeight = y_inner_end - y_top; | |
| 5240 | + | |
| 5241 | + // ✅ 新增:计算关键点坐标(以圆心为原点,y 向上为正) | |
| 5242 | + // 注意:数学坐标系中,角度从 x 轴开始逆时针,但我们希望顶部在 y 轴负方向 | |
| 5243 | + // 所以我们把角度偏移 -90°(即 -π/2),让 0° 指向正上方 | |
| 5244 | + | |
| 5245 | + const angleOffset = -Math.PI / 2; // 使 0° 指向顶部 | |
| 5246 | + | |
| 5247 | + const points = { | |
| 5248 | + outerCenter: { | |
| 5249 | + x: R * Math.cos(halfTheta + angleOffset), | |
| 5250 | + y: R * Math.sin(halfTheta + angleOffset) | |
| 5251 | + }, | |
| 5252 | + outerLeft: { | |
| 5253 | + x: R * Math.cos(-halfTheta + angleOffset), | |
| 5254 | + y: R * Math.sin(-halfTheta + angleOffset) | |
| 5255 | + }, | |
| 5256 | + outerRight: { | |
| 5257 | + x: R * Math.cos(halfTheta + angleOffset), | |
| 5258 | + y: R * Math.sin(halfTheta + angleOffset) | |
| 5259 | + }, | |
| 5260 | + innerLeft: { | |
| 5261 | + x: r * Math.cos(-halfTheta + angleOffset), | |
| 5262 | + y: r * Math.sin(-halfTheta + angleOffset) | |
| 5263 | + }, | |
| 5264 | + innerRight: { | |
| 5265 | + x: r * Math.cos(halfTheta + angleOffset), | |
| 5266 | + y: r * Math.sin(halfTheta + angleOffset) | |
| 5267 | + }, | |
| 5268 | + // 也可以计算顶部中点(0° 方向) | |
| 5269 | + topCenter: { | |
| 5270 | + x: 0, | |
| 5271 | + y: -R // 正上方 | |
| 5272 | + }, | |
| 5273 | + bottomLeft: { | |
| 5274 | + x: -chord / 2, | |
| 5275 | + y: -r * Math.cos(halfTheta) | |
| 5276 | + }, | |
| 5277 | + bottomRight: { | |
| 5278 | + x: chord / 2, | |
| 5279 | + y: -r * Math.cos(halfTheta) | |
| 5280 | + } | |
| 5281 | + }; | |
| 5282 | + | |
| 5283 | + // 如果你需要用于 SVG(y 向下为正),可以转换 | |
| 5284 | + const pointsForSVG = Object.keys(points).reduce((acc, key) => { | |
| 5285 | + acc[key] = { | |
| 5286 | + x: points[key].x, | |
| 5287 | + y: -points[key].y // 反转 y 轴 | |
| 5288 | + }; | |
| 5289 | + return acc; | |
| 5290 | + }, {}); | |
| 5291 | + | |
| 5292 | + return { | |
| 5293 | + width: chord, | |
| 5294 | + height: verticalHeight, | |
| 5295 | + R, r, l, | |
| 5296 | + theta_deg: (theta_rad * 180) / Math.PI, | |
| 5297 | + points, // 数学坐标系(y 向上) | |
| 5298 | + pointsForSVG, // SVG 坐标系(y 向下) | |
| 5299 | + chord, | |
| 5300 | + verticalHeight | |
| 5301 | + }; | |
| 5302 | + } | |
| 5303 | + | |
| 5186 | 5304 | // 计算头部偏移 |
| 5187 | 5305 | const topOffect = (list, length, width, height, props) => { |
| 5188 | 5306 | const val = list.filter(x => x.type); |
| ... | ... | @@ -5369,6 +5487,119 @@ const SvgBox = props => { |
| 5369 | 5487 | // if (svg === 4) top = Number(top) + Number(height); |
| 5370 | 5488 | return isNaN(top) ? 0 : top; |
| 5371 | 5489 | }; |
| 5490 | + // 将角度转换为弧度 | |
| 5491 | + const degToRad = (degrees) => { | |
| 5492 | + return degrees * (Math.PI / 180); | |
| 5493 | + } | |
| 5494 | + | |
| 5495 | + // 将弧度转换为角度 | |
| 5496 | + const radToDeg = (radians) => { | |
| 5497 | + return radians * (180 / Math.PI); | |
| 5498 | + } | |
| 5499 | + const drawCup = (w, h, d, g) => { | |
| 5500 | + const R1 = w / 2; | |
| 5501 | + const R2 = h / 2; | |
| 5502 | + const H = d; | |
| 5503 | + | |
| 5504 | + // 1. 计算基础参数 | |
| 5505 | + const l = Math.sqrt(Math.pow(R1 - R2, 2) + Math.pow(H, 2)); // 斜高 | |
| 5506 | + const R = (R1 * l) / (R1 - R2); // 扇形外弧半径 | |
| 5507 | + const r = R - l; // 扇形内弧半径 | |
| 5508 | + const theta_rad = (2 * Math.PI * R1) / R; // 圆心角(弧度) | |
| 5509 | + const theta_deg = radToDeg(theta_rad); // 圆心角(度) | |
| 5510 | + | |
| 5511 | + // 2. 计算SVG路径关键点坐标 | |
| 5512 | + // 外弧起点和终点 (相对于新的坐标系) | |
| 5513 | + const x1_outer = R * Math.sin(-theta_rad / 2); // 使用 sin 对应 x | |
| 5514 | + const y1_outer = -R * Math.cos(-theta_rad / 2); // 使用 -cos 对应 y,使其开口向上 | |
| 5515 | + const x2_outer = R * Math.sin(theta_rad / 2); | |
| 5516 | + const y2_outer = -R * Math.cos(theta_rad / 2); | |
| 5517 | + | |
| 5518 | + // 内弧起点和终点 (现在与外弧圆心角相同) | |
| 5519 | + const x1_inner = r * Math.sin(-theta_rad / 2); | |
| 5520 | + const y1_inner = -r * Math.cos(-theta_rad / 2); | |
| 5521 | + const x2_inner = r * Math.sin(theta_rad / 2); | |
| 5522 | + const y2_inner = -r * Math.cos(theta_rad / 2); | |
| 5523 | + | |
| 5524 | + // 3. 计算主展开形状SVG路径 | |
| 5525 | + // 大扇形外弧路径 (逆时针) | |
| 5526 | + const isLargeArcOuter = theta_deg > 180 ? 1 : 0; | |
| 5527 | + const outerArcPath = `M ${x1_outer} ${y1_outer} A ${R} ${R} 0 ${isLargeArcOuter} 1 ${x2_outer} ${y2_outer}`; | |
| 5528 | + | |
| 5529 | + // 连接到内弧终点的直线 | |
| 5530 | + const lineToInnerEnd = `L ${x2_inner} ${y2_inner}`; | |
| 5531 | + | |
| 5532 | + // 内弧路径 (顺时针) | |
| 5533 | + const isLargeArcInner = theta_deg > 180 ? 1 : 0; // 内弧圆心角与外弧相同 | |
| 5534 | + const innerArcPath = `A ${r} ${r} 0 ${isLargeArcInner} 0 ${x1_inner} ${y1_inner}`; | |
| 5535 | + | |
| 5536 | + // 连接回外弧起点的直线并闭合 | |
| 5537 | + const lineToOuterStartClose = `L ${x1_outer} ${y1_outer} Z`; | |
| 5538 | + | |
| 5539 | + // 4. 组合路径数据 | |
| 5540 | + const pathData = `${outerArcPath} ${lineToInnerEnd} ${innerArcPath} ${lineToOuterStartClose}`; | |
| 5541 | + | |
| 5542 | + // 5. 创建SVG Path元素 | |
| 5543 | + const svgNS = "http://www.w3.org/2000/svg"; | |
| 5544 | + const pathElement = document.createElementNS(svgNS, 'path'); | |
| 5545 | + pathElement.setAttribute('d', pathData); | |
| 5546 | + pathElement.setAttribute('fill', 'transparent'); | |
| 5547 | + pathElement.setAttribute('stroke', '#7588B9'); | |
| 5548 | + pathElement.setAttribute('stroke-width', '1'); | |
| 5549 | + pathElement.setAttribute('id', 'cupPath'); | |
| 5550 | + g.appendChild(pathElement); | |
| 5551 | + return pathElement; | |
| 5552 | + } | |
| 5553 | + | |
| 5554 | + const calculateCupDimensionsAndStart = (w, h, d) => { | |
| 5555 | + const R1 = w / 2; | |
| 5556 | + const R2 = h / 2; | |
| 5557 | + const H = d; | |
| 5558 | + | |
| 5559 | + // 输入验证 | |
| 5560 | + if (isNaN(R1) || isNaN(R2) || isNaN(H) || | |
| 5561 | + R1 <= R2 || R1 <= 0 || R2 < 0 || H <= 0) { | |
| 5562 | + console.error("calculateCupDimensionsAndStart: 请输入有效的参数:R1 > R2 >= 0, H > 0"); | |
| 5563 | + return null; | |
| 5564 | + } | |
| 5565 | + | |
| 5566 | + // 1. 计算基础参数 | |
| 5567 | + const l = Math.sqrt(Math.pow(R1 - R2, 2) + Math.pow(H, 2)); // 斜高 | |
| 5568 | + const R = (R1 * l) / (R1 - R2); // 扇形外弧半径 | |
| 5569 | + const r = R - l; // 扇形内弧半径 | |
| 5570 | + const theta_rad = (2 * Math.PI * R1) / R; // 圆心角(弧度) | |
| 5571 | + | |
| 5572 | + // 2. 计算SVG路径关键点坐标 | |
| 5573 | + // 外弧起点和终点 (相对于新的坐标系) | |
| 5574 | + // 起始点是路径的第一个点 | |
| 5575 | + const startX = R * Math.sin(-theta_rad / 2); // 使用 sin 对应 x | |
| 5576 | + const startY = -R * Math.cos(-theta_rad / 2); // 使用 -cos 对应 y,使其开口向上 | |
| 5577 | + const x2_outer = R * Math.sin(theta_rad / 2); | |
| 5578 | + const y2_outer = -R * Math.cos(theta_rad / 2); | |
| 5579 | + | |
| 5580 | + // 内弧起点和终点 (现在与外弧圆心角相同) | |
| 5581 | + const x1_inner = r * Math.sin(-theta_rad / 2); | |
| 5582 | + const y1_inner = -r * Math.cos(-theta_rad / 2); | |
| 5583 | + const x2_inner = r * Math.sin(theta_rad / 2); | |
| 5584 | + const y2_inner = -r * Math.cos(theta_rad / 2); | |
| 5585 | + | |
| 5586 | + // 3. 计算起始点到原点 (0,0) 的距离 | |
| 5587 | + const startDistance = Math.sqrt(startX * startX + startY * startY); | |
| 5588 | + | |
| 5589 | + // 4. 确定所有点的边界框 (Bounding Box) 以计算总宽度和高度 | |
| 5590 | + const allX = [startX, x2_outer, x1_inner, x2_inner]; | |
| 5591 | + const allY = [startY, y2_outer, y1_inner, y2_inner]; | |
| 5592 | + | |
| 5593 | + const minX = Math.min(...allX); | |
| 5594 | + const maxX = Math.max(...allX); | |
| 5595 | + const minY = Math.min(...allY); | |
| 5596 | + const maxY = Math.max(...allY); | |
| 5597 | + | |
| 5598 | + const width = maxX - minX; | |
| 5599 | + const height = maxY - minY; | |
| 5600 | + | |
| 5601 | + return { width, height, startX, startY, startDistance }; | |
| 5602 | + }; | |
| 5372 | 5603 | // 上方盒舌左边 |
| 5373 | 5604 | const createUpperBoxTongueLeft = (upperBoxTongueType, width, height, offsetX, offsetY) => { |
| 5374 | 5605 | if (!height) return createNoneProject(); |
| ... | ... | @@ -5694,7 +5925,6 @@ const SvgBox = props => { |
| 5694 | 5925 | style={{ |
| 5695 | 5926 | width: "100%", |
| 5696 | 5927 | height: "100%", |
| 5697 | - margin: "0 auto", | |
| 5698 | 5928 | }} |
| 5699 | 5929 | > |
| 5700 | 5930 | <svg | ... | ... |
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -1260,7 +1260,7 @@ export default class CommonComponent extends Component { |
| 1260 | 1260 | </> |
| 1261 | 1261 | ); |
| 1262 | 1262 | } |
| 1263 | - const removeExtension = (filename) => { | |
| 1263 | + const removeExtension = (filename) => { | |
| 1264 | 1264 | const lastDotIndex = filename.lastIndexOf('.'); |
| 1265 | 1265 | if (lastDotIndex === -1) { |
| 1266 | 1266 | // 如果字符串中没有点,则返回原字符串 |
| ... | ... | @@ -1269,7 +1269,8 @@ export default class CommonComponent extends Component { |
| 1269 | 1269 | return filename.substring(0, lastDotIndex); |
| 1270 | 1270 | } |
| 1271 | 1271 | if (sName === "sPackPath" || sName === "sPackDetailPathUpLoad" || sName === "sSvgPath") { |
| 1272 | - const uploadProps = { | |
| 1272 | + let imageUrls = ""; | |
| 1273 | + const uploadProps = { | |
| 1273 | 1274 | listType: "picture-card", |
| 1274 | 1275 | className: "avatar-uploader", |
| 1275 | 1276 | action: `${commonConfig.server_host}file/uploadPrice?sLogoName=logo${sName}${this.props.record.sName}`, |
| ... | ... | @@ -1304,21 +1305,28 @@ export default class CommonComponent extends Component { |
| 1304 | 1305 | const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`; |
| 1305 | 1306 | return imageUrlNew |
| 1306 | 1307 | } |
| 1308 | + const uploadName = commonFunc.showLocalMessage(this.props, "BtnUpload", "上传"); | |
| 1309 | + | |
| 1307 | 1310 | const imageUrl = sName === "sPackPath" ? (this.props.record.sPackPath ? getImageUrl(this.props.record.sPackPath) : '') : sName === "sPackDetailPathUpLoad" ? (this.props.record.sPackDetailPathUpLoad ? getImageUrl(this.props.record.sPackDetailPathUpLoad) : '') : (this.props.record.sSvgPath ? getImageUrl(this.props.record.sSvgPath) : ''); |
| 1308 | 1311 | return ( |
| 1309 | 1312 | <div> |
| 1310 | 1313 | <Upload {...uploadProps}> |
| 1311 | 1314 | {imageUrl ? ( |
| 1312 | - <Image key={imageUrl} src={imageUrl} alt="avatar" style={{ width: "100%" }} preview={!this.props.enabled} /> | |
| 1315 | + <Image | |
| 1316 | + key={imageUrl} | |
| 1317 | + src={imageUrl} | |
| 1318 | + alt="avatar" | |
| 1319 | + style={{ width: '100%' }} | |
| 1320 | + preview={!this.props.enabled} | |
| 1321 | + /> | |
| 1322 | + | |
| 1313 | 1323 | ) : ( |
| 1314 | 1324 | <div> |
| 1315 | - <div style={{ marginTop: 8 }}>上传</div> | |
| 1325 | + <div style={{ marginTop: 8 }}>{uploadName}</div> | |
| 1316 | 1326 | </div> |
| 1317 | 1327 | )} |
| 1318 | 1328 | </Upload> |
| 1319 | - <Button {...this.getUploadButtonProps()}> | |
| 1320 | - <DeleteOutlined /> | |
| 1321 | - </Button> | |
| 1329 | + <Button {...this.getUploadButtonProps()}><DeleteOutlined /></Button> | |
| 1322 | 1330 | </div> |
| 1323 | 1331 | ); |
| 1324 | 1332 | } |
| ... | ... | @@ -1343,28 +1351,20 @@ export default class CommonComponent extends Component { |
| 1343 | 1351 | { name: "右贴边位", value: "dYTBW" }, |
| 1344 | 1352 | { name: "右(下)插位组件", value: "dYXCW" }, |
| 1345 | 1353 | ]; |
| 1346 | - const doubleTitlieList1 = [ | |
| 1347 | - { name: "左上插位组件", value: "dZSCW" }, | |
| 1348 | - { name: "上插位组件", value: "dSCW" }, | |
| 1349 | - { name: "右上插位组件", value: "dYSCW" }, | |
| 1350 | - { name: "左偏移", value: "dZPY" }, | |
| 1351 | - { name: "左插位组件", value: "dZCW" }, | |
| 1352 | - { name: "左下插位组件", value: "dZXCW" }, | |
| 1353 | - { name: "右偏移", value: "dYPY" }, | |
| 1354 | - { name: "右插位组件", value: "dYCW" }, | |
| 1355 | - { name: "右下插位组件", value: "dYXCW" }, | |
| 1356 | - { name: "首盒长", value: "dSHC" }, | |
| 1357 | - { name: "首盒宽", value: "dSHK" }, | |
| 1358 | - { name: "次盒长", value: "dCHC" }, | |
| 1359 | - { name: "次盒宽", value: "dCHK" }, | |
| 1360 | - ]; | |
| 1361 | - const boxTypes = this.props.record.sTypes; | |
| 1362 | - const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1; | |
| 1363 | - | |
| 1364 | - slaveData.forEach(x => | |
| 1354 | + slaveData.forEach(x => { | |
| 1355 | + let key = 0; | |
| 1356 | + if (x.sTypes && x.sTypes.includes('09')) { | |
| 1357 | + if (x.sCode === 'dZTBW' || x.sCode === 'dYTBW') { | |
| 1358 | + key = x.iSLength + x.iCLength | |
| 1359 | + } else { | |
| 1360 | + key = x.iSWidth+ x.iCWidth | |
| 1361 | + } | |
| 1362 | + } else { | |
| 1363 | + key = x.iValue | |
| 1364 | + } | |
| 1365 | 1365 | boxList.push({ |
| 1366 | - value: x.iValue, | |
| 1367 | - sName: srcList.find(item => item.value === x.sCode)?.name || "", | |
| 1366 | + value: key, | |
| 1367 | + sName: titleList1.find(item => item.value === x.sCode)?.name || "", | |
| 1368 | 1368 | isEditable: true, |
| 1369 | 1369 | isSelect: false, |
| 1370 | 1370 | selectValue: null, |
| ... | ... | @@ -1372,7 +1372,7 @@ export default class CommonComponent extends Component { |
| 1372 | 1372 | selectImage: null, |
| 1373 | 1373 | type: x.sTypes || null, |
| 1374 | 1374 | show: true, |
| 1375 | - showName: x.sName, | |
| 1375 | + showName: x.sName, // 参数名称 | |
| 1376 | 1376 | sLength: x.iSLength, |
| 1377 | 1377 | sWidth: x.iSWidth, |
| 1378 | 1378 | sType: x.iSType, |
| ... | ... | @@ -1385,9 +1385,8 @@ export default class CommonComponent extends Component { |
| 1385 | 1385 | cTypeName: Number(x.iCType) === 0 ? "矩形" : "梯形", |
| 1386 | 1386 | cOffset: x.sCOffset, |
| 1387 | 1387 | cQuantity: x.iCQuantity, |
| 1388 | - }) | |
| 1389 | - ); | |
| 1390 | - | |
| 1388 | + }); | |
| 1389 | + }); | |
| 1391 | 1390 | tables.forEach(x => { |
| 1392 | 1391 | boxList.push({ |
| 1393 | 1392 | value: x.value, |
| ... | ... | @@ -1402,23 +1401,7 @@ export default class CommonComponent extends Component { |
| 1402 | 1401 | showName: x.name, // 参数名称 |
| 1403 | 1402 | }); |
| 1404 | 1403 | }); |
| 1405 | - // if (sDoubleSizeList && sDoubleSizeList.length) { | |
| 1406 | - // const titles = ["首盒长", "首盒宽", "次盒长", "次盒宽"]; | |
| 1407 | - // sDoubleSizeList.forEach((x, i) => { | |
| 1408 | - // boxList.push({ | |
| 1409 | - // value: x, | |
| 1410 | - // sName: titles[i], | |
| 1411 | - // isEditable: true, | |
| 1412 | - // isSelect: false, | |
| 1413 | - // selectValue: null, | |
| 1414 | - // selectLabel: "", | |
| 1415 | - // selectImage: null, | |
| 1416 | - // type: null, | |
| 1417 | - // show: true, | |
| 1418 | - // showName: titles[i], // 参数名称 | |
| 1419 | - // }); | |
| 1420 | - // }); | |
| 1421 | - // } | |
| 1404 | + | |
| 1422 | 1405 | const svgProps = { |
| 1423 | 1406 | ...this.props, |
| 1424 | 1407 | boxList, |
| ... | ... | @@ -1426,7 +1409,6 @@ export default class CommonComponent extends Component { |
| 1426 | 1409 | dSvgBoxHeight: 100, |
| 1427 | 1410 | showNew: 1, |
| 1428 | 1411 | }; |
| 1429 | - | |
| 1430 | 1412 | return ( |
| 1431 | 1413 | <div style={{ width: "100px", height: "100px" }}> |
| 1432 | 1414 | <SvgBox {...svgProps} /> | ... | ... |
src/components/Common/CommonTable/index.js
| ... | ... | @@ -31,7 +31,7 @@ import { |
| 31 | 31 | import { Icon as LegacyIcon } from '@ant-design/compatible'; |
| 32 | 32 | // import '@ant-design/compatible/assets/index.css'; |
| 33 | 33 | import lodash from 'lodash'; |
| 34 | -import { Table, Input, Checkbox, Button, Upload, message, Popover, Spin, Space, Form, Tooltip, Row, Progress,Modal, Col, Pagination } from 'antd-v4'; | |
| 34 | +import { Table, Input, Checkbox, Button, Upload, message, Popover, Spin, Space, Form, Tooltip, Row, Progress, Modal, Col, Pagination } from 'antd-v4'; | |
| 35 | 35 | import { DndProvider, DropTarget, DragSource } from 'react-dnd'; |
| 36 | 36 | import { |
| 37 | 37 | sortableContainer, |
| ... | ... | @@ -126,10 +126,10 @@ const BodyRow = (props) => { |
| 126 | 126 | // DragSource 拖拽事件的方法对象 |
| 127 | 127 | const rowSource = { |
| 128 | 128 | beginDrag(props) { |
| 129 | - const dragingKey = props["data-row-key"] | |
| 129 | + const dragingKey = props["data-row-key"] | |
| 130 | 130 | dragingIndex = props.index; |
| 131 | 131 | return { |
| 132 | - 'data-row-key':dragingKey, | |
| 132 | + 'data-row-key': dragingKey, | |
| 133 | 133 | index: props.index, |
| 134 | 134 | } |
| 135 | 135 | // dragingIndex = props.index; |
| ... | ... | @@ -148,7 +148,7 @@ const rowTarget = { |
| 148 | 148 | if (dragKey === hoverKey) { |
| 149 | 149 | return; |
| 150 | 150 | } |
| 151 | - props.moveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 151 | + props.moveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 152 | 152 | monitor.getItem().index = hoverIndex; |
| 153 | 153 | monitor.getItem()["data-row-key"] = hoverKey; |
| 154 | 154 | }, |
| ... | ... | @@ -183,11 +183,11 @@ class CommonTableRc extends React.Component { |
| 183 | 183 | totalData1: [], /* 总计数据1 */ |
| 184 | 184 | enabled: false, /* 是否为编辑 */ |
| 185 | 185 | filteredValue: [], /* 过滤数据值 */ |
| 186 | - expKeys:[], /* 展开数据行(数据格式:数组) */ | |
| 186 | + expKeys: [], /* 展开数据行(数据格式:数组) */ | |
| 187 | 187 | showimgs: false, // 必须字段控制弹框显示隐藏 |
| 188 | 188 | firstIndex: 0, // 点击时默认下标 |
| 189 | - commonPopupVisible:false, | |
| 190 | - commonFieldPopupVisible:false, | |
| 189 | + commonPopupVisible: false, | |
| 190 | + commonFieldPopupVisible: false, | |
| 191 | 191 | openNewTabFlag: false, // 是否因在弹窗中打开新页签离开本页; |
| 192 | 192 | randomId: commonUtils.createSid(), |
| 193 | 193 | realizeHeight: 0, |
| ... | ... | @@ -195,7 +195,7 @@ class CommonTableRc extends React.Component { |
| 195 | 195 | commonFileDownloadVisible: false, // 多文件下载弹窗 |
| 196 | 196 | commonFileDownloadList: [], // 多文件列表 |
| 197 | 197 | pdfFileVisible: false, // pdf文件弹窗 |
| 198 | - bOperateMoreVisible : false, /* 复制更多弹窗 */ | |
| 198 | + bOperateMoreVisible: false, /* 复制更多弹窗 */ | |
| 199 | 199 | pdfFileUrl: '', |
| 200 | 200 | currentHoverSid: '', |
| 201 | 201 | simpleModalVisible: false, |
| ... | ... | @@ -292,20 +292,20 @@ class CommonTableRc extends React.Component { |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | document.addEventListener('mouseover', this.handleLastTdMouseOver); |
| 295 | - | |
| 295 | + | |
| 296 | 296 | // 监听鼠标右击事件 |
| 297 | 297 | this.mydiv.addEventListener('contextmenu', this.handleContextMenu); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | componentDidUpdate() { |
| 301 | - if( | |
| 301 | + if ( | |
| 302 | 302 | this.props.app && this.props.app.currentPane && (this.props.app.currentPane.route.indexOf('commonList') !== -1 |
| 303 | - || | |
| 304 | - this.props.app.currentPane.route.indexOf('productionScheduleTree') !== -1) | |
| 303 | + || | |
| 304 | + this.props.app.currentPane.route.indexOf('productionScheduleTree') !== -1) | |
| 305 | 305 | ) { |
| 306 | 306 | if (this.tableHeight !== '100%' && this.tableHeight !== 0) { |
| 307 | 307 | if (this.props.name !== 'report') { |
| 308 | - this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = this.tableHeight ? this.tableHeight + 'px': 80 + 'px'; | |
| 308 | + this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = this.tableHeight ? this.tableHeight + 'px' : 80 + 'px'; | |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | } |
| ... | ... | @@ -437,7 +437,7 @@ class CommonTableRc extends React.Component { |
| 437 | 437 | oResizable.style.cursor = 'col-resize'; |
| 438 | 438 | const tempDom = document.createElement('div'); |
| 439 | 439 | const mask = document.createElement('div'); |
| 440 | - mask.style= "position: absolute; width: 100%; height: 100%; left: 0; top: 0; z-index: 9999;" | |
| 440 | + mask.style = "position: absolute; width: 100%; height: 100%; left: 0; top: 0; z-index: 9999;" | |
| 441 | 441 | const resizableMousemove = (e) => { |
| 442 | 442 | const { clientX } = e; |
| 443 | 443 | const left = Math.min(Math.max(minLeft, clientX), maxLeft + 200); |
| ... | ... | @@ -504,7 +504,7 @@ class CommonTableRc extends React.Component { |
| 504 | 504 | } |
| 505 | 505 | } |
| 506 | 506 | oResizable.onmousedown = () => { |
| 507 | - const { y, height } = event.target.getBoundingClientRect(); | |
| 507 | + const { y, height } = event.target.getBoundingClientRect(); | |
| 508 | 508 | minLeft = event.target.parentNode.getBoundingClientRect().x + 50; |
| 509 | 509 | maxLeft = event.target.parentNode.getBoundingClientRect().x + event.target.parentNode.getBoundingClientRect().width; |
| 510 | 510 | Object.assign(tempDom.style, { |
| ... | ... | @@ -525,7 +525,7 @@ class CommonTableRc extends React.Component { |
| 525 | 525 | document.addEventListener('mousemove', resizableMousemove); |
| 526 | 526 | }; |
| 527 | 527 | } |
| 528 | - } catch (error) {} | |
| 528 | + } catch (error) { } | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | /** 列拖动s */ |
| ... | ... | @@ -553,7 +553,7 @@ class CommonTableRc extends React.Component { |
| 553 | 553 | width: column.width, |
| 554 | 554 | onResize: !bNotResize ? this.handleResize(index, column, isSlaveInfo) : null, |
| 555 | 555 | bnotresize: bNotResize ? 'bNotResize' : null, |
| 556 | - onClick: () => {}, | |
| 556 | + onClick: () => { }, | |
| 557 | 557 | onMouseDown: () => { |
| 558 | 558 | if (this.lastTdMouseOver) { |
| 559 | 559 | return; |
| ... | ... | @@ -836,7 +836,7 @@ class CommonTableRc extends React.Component { |
| 836 | 836 | const oDiv = { |
| 837 | 837 | 'span': target.parentNode, |
| 838 | 838 | 'td': target.childNodes[0].childNodes[0], |
| 839 | - 'div': target.getAttribute('data-name') ? target : target.childNodes[0], | |
| 839 | + 'div': target.getAttribute('data-name') ? target : target.childNodes[0], | |
| 840 | 840 | }[tagName.toLowerCase()]; |
| 841 | 841 | |
| 842 | 842 | if (!oDiv) return; |
| ... | ... | @@ -848,7 +848,7 @@ class CommonTableRc extends React.Component { |
| 848 | 848 | |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | - onRowMouseEnter= (record) => { // recor | |
| 851 | + onRowMouseEnter = (record) => { // recor | |
| 852 | 852 | if (this.props.enabled && this.props.tableBelone !== 'list' && commonUtils.isNotEmptyObject(this.props.tableProps) && |
| 853 | 853 | !this.beSelectDropdownOpen && commonUtils.isEmptyObject(this.props.tableProps.rowSelection) && this.state.currentHoverSid !== record.sId) { |
| 854 | 854 | if (this.timerSelectRowChange) { |
| ... | ... | @@ -864,7 +864,7 @@ class CommonTableRc extends React.Component { |
| 864 | 864 | } |
| 865 | 865 | } |
| 866 | 866 | |
| 867 | - onRowMouseLeave= () => { | |
| 867 | + onRowMouseLeave = () => { | |
| 868 | 868 | if (this.timerSelectRowChange) { |
| 869 | 869 | this.setState({ |
| 870 | 870 | currentHoverSid: '', |
| ... | ... | @@ -879,7 +879,7 @@ class CommonTableRc extends React.Component { |
| 879 | 879 | /** 行选择 */ |
| 880 | 880 | onRowClick = (record, index, type, name, tabType) => { |
| 881 | 881 | if (this.handleCellClick(record)) return; |
| 882 | - | |
| 882 | + | |
| 883 | 883 | if (this.stopRowClick) { |
| 884 | 884 | this.stopRowClick = false; |
| 885 | 885 | return; |
| ... | ... | @@ -1010,11 +1010,11 @@ class CommonTableRc extends React.Component { |
| 1010 | 1010 | } else if (e.ctrlKey && e.keyCode === 65) { |
| 1011 | 1011 | console.log('全选成功!'); |
| 1012 | 1012 | } else if (e.ctrlKey && (e.altKey || e.metaKey) && e.keyCode === 71) { /* CTRL+ALT+G F7 设置界面 */ |
| 1013 | - const {name, config, data, configName } = this.props; | |
| 1014 | - const { sType } = this.props?.app?.userinfo || {}; | |
| 1015 | - if (!['sysadmin'].includes(sType)) { | |
| 1016 | - return; | |
| 1017 | - } | |
| 1013 | + const { name, config, data, configName } = this.props; | |
| 1014 | + const { sType } = this.props?.app?.userinfo || {}; | |
| 1015 | + if (!['sysadmin'].includes(sType)) { | |
| 1016 | + return; | |
| 1017 | + } | |
| 1018 | 1018 | if (commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.config) && commonUtils.isNotEmptyObject(this.props.data)) { |
| 1019 | 1019 | const bInModal = (el) => { |
| 1020 | 1020 | if (commonUtils.isEmpty(el) || commonUtils.isEmpty(el.classList)) { |
| ... | ... | @@ -1110,13 +1110,13 @@ class CommonTableRc extends React.Component { |
| 1110 | 1110 | allRowClassName = record.sColor; |
| 1111 | 1111 | } else { |
| 1112 | 1112 | if (commonUtils.isEmptyObject(allRowClassName) || commonUtils.isEmptyObject(allRowClassName.trim())) { /* 设置奇 偶行背景色 */ |
| 1113 | - allRowClassName = (index % 2 === 1) ? 'dark-record-row' : ''; | |
| 1113 | + allRowClassName = (index % 2 === 1) ? 'dark-record-row' : ''; | |
| 1114 | 1114 | } |
| 1115 | 1115 | } |
| 1116 | 1116 | /* 如果行字段的sDivRow有值 则做成特殊样式 */ |
| 1117 | - if(commonUtils.isNotEmptyObject(record) && commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 1117 | + if (commonUtils.isNotEmptyObject(record) && commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 1118 | 1118 | allRowClassName = 'split-record-row'; |
| 1119 | - if (this.props.skipSlaveInfo){ | |
| 1119 | + if (this.props.skipSlaveInfo) { | |
| 1120 | 1120 | allRowClassName = 'split-record-row-skip'; |
| 1121 | 1121 | } |
| 1122 | 1122 | } |
| ... | ... | @@ -1200,24 +1200,24 @@ class CommonTableRc extends React.Component { |
| 1200 | 1200 | const fileType = fileName.split('.').pop().toLowerCase(); |
| 1201 | 1201 | const previewFileList = ['jpg', 'png', 'jepg', 'webp', 'svg', 'bmp', 'apng', 'pdf']; |
| 1202 | 1202 | return <div> |
| 1203 | - <a style={!previewFileList.includes(fileType) ? { visibility: 'hidden' } : {}} onClick={e => { | |
| 1204 | - if (fileType === 'pdf') { | |
| 1205 | - this.setState({ | |
| 1206 | - pdfFileVisible: true, | |
| 1207 | - pdfFileUrl: fileList[0], | |
| 1208 | - }); | |
| 1209 | - } else { | |
| 1210 | - this.handlePreviewImage(e, fileList); | |
| 1211 | - } | |
| 1212 | - }} title="预览"><EyeOutlined /></a> | |
| 1213 | - <a target="_blank" key="sDownload" href={picHref} title="下载"><DownloadOutlined /></a> | |
| 1214 | - <span>{fileName}</span> | |
| 1215 | - </div> | |
| 1203 | + <a style={!previewFileList.includes(fileType) ? { visibility: 'hidden' } : {}} onClick={e => { | |
| 1204 | + if (fileType === 'pdf') { | |
| 1205 | + this.setState({ | |
| 1206 | + pdfFileVisible: true, | |
| 1207 | + pdfFileUrl: fileList[0], | |
| 1208 | + }); | |
| 1209 | + } else { | |
| 1210 | + this.handlePreviewImage(e, fileList); | |
| 1211 | + } | |
| 1212 | + }} title="预览"><EyeOutlined /></a> | |
| 1213 | + <a target="_blank" key="sDownload" href={picHref} title="下载"><DownloadOutlined /></a> | |
| 1214 | + <span>{fileName}</span> | |
| 1215 | + </div> | |
| 1216 | 1216 | } else { |
| 1217 | 1217 | return <a target="_blank" key="sDownload" title="附件列表" onClick={() => { |
| 1218 | 1218 | this.setState({ |
| 1219 | 1219 | commonFileDownloadVisible: true, |
| 1220 | - commonFileDownloadList: fileList.map(item => {return { url: item, checked: false }}), | |
| 1220 | + commonFileDownloadList: fileList.map(item => { return { url: item, checked: false } }), | |
| 1221 | 1221 | }) |
| 1222 | 1222 | }} |
| 1223 | 1223 | >{`附件(${fileList.length})`}</a>; |
| ... | ... | @@ -1228,12 +1228,12 @@ class CommonTableRc extends React.Component { |
| 1228 | 1228 | if (commonUtils.isNotEmptyArr(sMakeUpPath)) { |
| 1229 | 1229 | sMakeUpPath.forEach(item => { |
| 1230 | 1230 | item.render = (value = '', record) => { |
| 1231 | - const { formId, name, enabled } = this.props; | |
| 1232 | - const { token } = this.props.app; | |
| 1231 | + const { formId, name, enabled, config } = this.props; | |
| 1232 | + const { token } = this.props.app; | |
| 1233 | 1233 | const divProps = { |
| 1234 | 1234 | action: `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`, |
| 1235 | 1235 | onChange: (info) => { |
| 1236 | - this.handleUploadChange(info, () => {}); | |
| 1236 | + this.handleUploadChange(info, () => { }); | |
| 1237 | 1237 | const savePathStr = info?.file?.response?.dataset?.rows?.[0]?.savePathStr; |
| 1238 | 1238 | this.props.onDataChange(name, item.dataIndex, { [item.dataIndex]: savePathStr }, record.sId, []); |
| 1239 | 1239 | }, |
| ... | ... | @@ -1254,32 +1254,48 @@ class CommonTableRc extends React.Component { |
| 1254 | 1254 | }) |
| 1255 | 1255 | } |
| 1256 | 1256 | }; |
| 1257 | - | |
| 1257 | + const removeExtension = (filename) => { | |
| 1258 | + const lastDotIndex = filename.lastIndexOf('.'); | |
| 1259 | + if (lastDotIndex === -1) { | |
| 1260 | + // 如果字符串中没有点,则返回原字符串 | |
| 1261 | + return filename; | |
| 1262 | + } | |
| 1263 | + return filename.substring(0, lastDotIndex); | |
| 1264 | + } | |
| 1265 | + const getImageUrl = (sName) => { | |
| 1266 | + const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`; | |
| 1267 | + return imageUrlNew | |
| 1268 | + } | |
| 1258 | 1269 | const picAddr = commonUtils.isNotEmptyObject(value) ? value.split(',') : ''; |
| 1259 | - const dataUrl = picAddr[0].includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` : picAddr[0]; /* 缩略图 */ | |
| 1260 | - | |
| 1270 | + let dataUrl = picAddr[0].includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` : picAddr[0]; /* 缩略图 */ | |
| 1271 | + if (config.sTbName === "sisboxcomponent") { | |
| 1272 | + dataUrl = getImageUrl(removeExtension(picAddr[0])); | |
| 1273 | + } | |
| 1274 | + // const picAddr = commonUtils.isNotEmptyObject(value) ? value.split(',') : ''; | |
| 1275 | + // const dataUrl = picAddr[0].includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` : picAddr[0]; /* 缩略图 */ | |
| 1276 | + | |
| 1261 | 1277 | const officeFileTypeList = ['PDF', 'DOCX', 'XLSX', 'MP4', 'WEBM', 'OGG']; |
| 1262 | 1278 | const imgTypeList = ['PNG', 'SVG', 'JPG', 'JPEG', 'GIF', 'BMP', 'TIFF', 'ICO']; |
| 1263 | 1279 | const officeFileType = picAddr[0].split('.').pop().toUpperCase(); |
| 1264 | - let fileIcon = <FilePdfOutlined { ...iconProps } />; | |
| 1265 | - | |
| 1280 | + let fileIcon = <FilePdfOutlined {...iconProps} />; | |
| 1281 | + | |
| 1266 | 1282 | if (officeFileType === 'DOCX') { |
| 1267 | - fileIcon = <FileWordOutlined { ...iconProps } />; | |
| 1283 | + fileIcon = <FileWordOutlined {...iconProps} />; | |
| 1268 | 1284 | } else if (officeFileType === 'XLSX') { |
| 1269 | - fileIcon = <FileExcelOutlined { ...iconProps } />; | |
| 1285 | + fileIcon = <FileExcelOutlined {...iconProps} />; | |
| 1270 | 1286 | } else if (['MP4', 'WEBM', 'OGG'].includes(officeFileType)) { |
| 1271 | - fileIcon = <PlaySquareOutlined { ...iconProps } />; | |
| 1287 | + fileIcon = <PlaySquareOutlined {...iconProps} />; | |
| 1272 | 1288 | } |
| 1273 | - | |
| 1289 | + | |
| 1274 | 1290 | let imgBox = <FileOutlined />; |
| 1275 | - | |
| 1291 | + | |
| 1276 | 1292 | if (officeFileTypeList.includes(officeFileType)) { |
| 1277 | 1293 | imgBox = fileIcon; |
| 1278 | 1294 | } else if (imgTypeList.includes(officeFileType)) { |
| 1279 | 1295 | imgBox = <span style={{ cursor: 'pointer' }}> <img src={dataUrl} alt="img" onFocus={() => 0} onClick={e => this.handlePreviewImage(e, picAddr)} style={{ width: '30px', height: '20px' }} /></span>; |
| 1280 | 1296 | } |
| 1281 | 1297 | |
| 1282 | - return imgBox; | |
| 1298 | + return imgBox; | |
| 1283 | 1299 | }) |
| 1284 | 1300 | } |
| 1285 | 1301 | { |
| ... | ... | @@ -1341,9 +1357,9 @@ class CommonTableRc extends React.Component { |
| 1341 | 1357 | } |
| 1342 | 1358 | } |
| 1343 | 1359 | return ( |
| 1344 | - <div style={{ display: 'inline-block', color:colorValue }} key={i} onClick={this.handlesPartNameStatus.bind(this, 'sPartNameStatus', t.sWorkOrderId)} > | |
| 1360 | + <div style={{ display: 'inline-block', color: colorValue }} key={i} onClick={this.handlesPartNameStatus.bind(this, 'sPartNameStatus', t.sWorkOrderId)} > | |
| 1345 | 1361 | {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ''} |
| 1346 | - { i + 1 === sPartItemLength ? '' : <RightOutlined />} | |
| 1362 | + {i + 1 === sPartItemLength ? '' : <RightOutlined />} | |
| 1347 | 1363 | </div> |
| 1348 | 1364 | ); |
| 1349 | 1365 | }) |
| ... | ... | @@ -1385,9 +1401,9 @@ class CommonTableRc extends React.Component { |
| 1385 | 1401 | } |
| 1386 | 1402 | } |
| 1387 | 1403 | return ( |
| 1388 | - <div style={{ display: 'inline-block', color:colorValue }} key={i} onClick={this.handlesPartNameStatus.bind(this, 'sPartNameStatus', t.sWorkOrderId)} > | |
| 1404 | + <div style={{ display: 'inline-block', color: colorValue }} key={i} onClick={this.handlesPartNameStatus.bind(this, 'sPartNameStatus', t.sWorkOrderId)} > | |
| 1389 | 1405 | {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ''} |
| 1390 | - { i + 1 === sPartItemLength ? '' : <RightOutlined />} | |
| 1406 | + {i + 1 === sPartItemLength ? '' : <RightOutlined />} | |
| 1391 | 1407 | </div> |
| 1392 | 1408 | ); |
| 1393 | 1409 | }) |
| ... | ... | @@ -1415,9 +1431,9 @@ class CommonTableRc extends React.Component { |
| 1415 | 1431 | const ArrItemTime = t.split('#')[4]; /* 排单时间 */ |
| 1416 | 1432 | const ArrItemPCNum = t.split('#')[5]; /* 排程数 */ |
| 1417 | 1433 | const ArrItemSBNum = t.split('#')[6]; /* 上报数 */ |
| 1418 | - const ArrItem7Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 8 ? t.split('#')[8] : ''; /* 包数 */ | |
| 1419 | - const ArrItem8Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 9 ? t.split('#')[9]: ''; /* 每包数量 */ | |
| 1420 | - const ArrItem9Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 10 ? t.split('#')[10]: ''; /* 零头数量 */ | |
| 1434 | + const ArrItem7Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 8 ? t.split('#')[8] : ''; /* 包数 */ | |
| 1435 | + const ArrItem8Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 9 ? t.split('#')[9] : ''; /* 每包数量 */ | |
| 1436 | + const ArrItem9Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 10 ? t.split('#')[10] : ''; /* 零头数量 */ | |
| 1421 | 1437 | let ArrItemNumChange = ''; |
| 1422 | 1438 | let icon; |
| 1423 | 1439 | // eslint-disable-next-line default-case |
| ... | ... | @@ -1458,13 +1474,13 @@ class CommonTableRc extends React.Component { |
| 1458 | 1474 | <div><span style={{ color: '#fbca7b' }}>排程数:</span>{ArrItemPCNum}</div> |
| 1459 | 1475 | <div><span style={{ color: '#fbca7b' }}>上报数:</span>{ArrItemSBNum}</div> |
| 1460 | 1476 | { |
| 1461 | - ArrItem7Num ? <div><span style={{ color: '#fbca7b' }}>包数:</span>{ArrItem7Num}</div> :'' | |
| 1477 | + ArrItem7Num ? <div><span style={{ color: '#fbca7b' }}>包数:</span>{ArrItem7Num}</div> : '' | |
| 1462 | 1478 | } |
| 1463 | 1479 | { |
| 1464 | - ArrItem8Num ? <div><span style={{ color: '#fbca7b' }}>每包数量:</span>{ArrItem8Num}</div> :'' | |
| 1480 | + ArrItem8Num ? <div><span style={{ color: '#fbca7b' }}>每包数量:</span>{ArrItem8Num}</div> : '' | |
| 1465 | 1481 | } |
| 1466 | 1482 | { |
| 1467 | - ArrItem9Num ? <div><span style={{ color: '#fbca7b' }}>零头数量:</span>{ArrItem9Num}</div> :'' | |
| 1483 | + ArrItem9Num ? <div><span style={{ color: '#fbca7b' }}>零头数量:</span>{ArrItem9Num}</div> : '' | |
| 1468 | 1484 | } |
| 1469 | 1485 | </div> |
| 1470 | 1486 | ); |
| ... | ... | @@ -1514,7 +1530,7 @@ class CommonTableRc extends React.Component { |
| 1514 | 1530 | } |
| 1515 | 1531 | } |
| 1516 | 1532 | return ( |
| 1517 | - <Tooltip placement="right" color="#fff" title={() => { | |
| 1533 | + <Tooltip placement="right" color="#fff" title={() => { | |
| 1518 | 1534 | return <div style={{ whiteSpace: 'normal' }}> |
| 1519 | 1535 | { |
| 1520 | 1536 | // eslint-disable-next-line array-callback-return; |
| ... | ... | @@ -1546,12 +1562,12 @@ class CommonTableRc extends React.Component { |
| 1546 | 1562 | } |
| 1547 | 1563 | } |
| 1548 | 1564 | return ( |
| 1549 | - <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1565 | + <div style={{ display: 'inline-block', width: '100%', color: colorValue }} key={i} > | |
| 1550 | 1566 | {commonUtils.isNotEmptyObject(t.sMaterialsName) ? |
| 1551 | 1567 | <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> |
| 1552 | - {t.sMaterialsName} | |
| 1553 | - </span> : ''} | |
| 1554 | - { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1568 | + {t.sMaterialsName} | |
| 1569 | + </span> : ''} | |
| 1570 | + {i + 1 === sPartItemLength ? '' : <span style={{ color: '#000000', margin: '0 2px' }}>-</span>} | |
| 1555 | 1571 | </div> |
| 1556 | 1572 | ); |
| 1557 | 1573 | }) |
| ... | ... | @@ -1589,12 +1605,12 @@ class CommonTableRc extends React.Component { |
| 1589 | 1605 | } |
| 1590 | 1606 | } |
| 1591 | 1607 | return ( |
| 1592 | - <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1608 | + <div style={{ display: 'inline-block', width: '100%', color: colorValue }} key={i} > | |
| 1593 | 1609 | {commonUtils.isNotEmptyObject(t.sMaterialsName) ? |
| 1594 | 1610 | <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> |
| 1595 | - {t.sMaterialsName} | |
| 1596 | - </span> : ''} | |
| 1597 | - { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1611 | + {t.sMaterialsName} | |
| 1612 | + </span> : ''} | |
| 1613 | + {i + 1 === sPartItemLength ? '' : <span style={{ color: '#000000', margin: '0 2px' }}>-</span>} | |
| 1598 | 1614 | </div> |
| 1599 | 1615 | ); |
| 1600 | 1616 | }) |
| ... | ... | @@ -1624,8 +1640,8 @@ class CommonTableRc extends React.Component { |
| 1624 | 1640 | } |
| 1625 | 1641 | } |
| 1626 | 1642 | return ( |
| 1627 | - <Tooltip color='#f1f2f8' placement='right' overlayInnerStyle ={{ width: dWidth, paddingLeft:'6px' }} defaultOpen={false} title={() => { | |
| 1628 | - return <div style={{ whiteSpace: 'normal', backgroundColor:'#f1f2f8', borderRight:'1px solid #f0f0f0', width: dWidth - 8 }}> | |
| 1643 | + <Tooltip color='#f1f2f8' placement='right' overlayInnerStyle={{ width: dWidth, paddingLeft: '6px' }} defaultOpen={false} title={() => { | |
| 1644 | + return <div style={{ whiteSpace: 'normal', backgroundColor: '#f1f2f8', borderRight: '1px solid #f0f0f0', width: dWidth - 8 }}> | |
| 1629 | 1645 | { |
| 1630 | 1646 | // eslint-disable-next-line array-callback-return; |
| 1631 | 1647 | sPartItem.map((t, i) => { |
| ... | ... | @@ -1656,12 +1672,12 @@ class CommonTableRc extends React.Component { |
| 1656 | 1672 | } |
| 1657 | 1673 | } |
| 1658 | 1674 | return ( |
| 1659 | - <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1675 | + <div style={{ display: 'inline-block', width: '100%', color: colorValue }} key={i} > | |
| 1660 | 1676 | {commonUtils.isNotEmptyObject(t.sMaterialsName) ? |
| 1661 | 1677 | <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> |
| 1662 | - {t.sMaterialsName} | |
| 1663 | - </span> : ''} | |
| 1664 | - { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1678 | + {t.sMaterialsName} | |
| 1679 | + </span> : ''} | |
| 1680 | + {i + 1 === sPartItemLength ? '' : <span style={{ color: '#000000', margin: '0 2px' }}>-</span>} | |
| 1665 | 1681 | </div> |
| 1666 | 1682 | ); |
| 1667 | 1683 | }) |
| ... | ... | @@ -1699,12 +1715,12 @@ class CommonTableRc extends React.Component { |
| 1699 | 1715 | } |
| 1700 | 1716 | } |
| 1701 | 1717 | return ( |
| 1702 | - <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1718 | + <div style={{ display: 'inline-block', width: '100%', color: colorValue }} key={i} > | |
| 1703 | 1719 | {commonUtils.isNotEmptyObject(t.sMaterialsName) ? |
| 1704 | 1720 | <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> |
| 1705 | - {t.sMaterialsName} | |
| 1706 | - </span> : ''} | |
| 1707 | - { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1721 | + {t.sMaterialsName} | |
| 1722 | + </span> : ''} | |
| 1723 | + {i + 1 === sPartItemLength ? '' : <span style={{ color: '#000000', margin: '0 2px' }}>-</span>} | |
| 1708 | 1724 | </div> |
| 1709 | 1725 | ); |
| 1710 | 1726 | }) |
| ... | ... | @@ -1713,7 +1729,7 @@ class CommonTableRc extends React.Component { |
| 1713 | 1729 | </Tooltip> |
| 1714 | 1730 | ); |
| 1715 | 1731 | } else { |
| 1716 | - return <div className='noInput readonlySpanStyle' style={{ backgroundColor: sBackGroundColor, height: '29px' }}> {itemStr} </div>; | |
| 1732 | + return <div className='noInput readonlySpanStyle' style={{ backgroundColor: sBackGroundColor, height: '29px' }}> {itemStr} </div>; | |
| 1717 | 1733 | } |
| 1718 | 1734 | }; |
| 1719 | 1735 | } |
| ... | ... | @@ -1725,13 +1741,13 @@ class CommonTableRc extends React.Component { |
| 1725 | 1741 | if (commonUtils.isNotEmptyArr(dynamicColumn) && commonUtils.isNotEmptyArr(dataSource)) { |
| 1726 | 1742 | dynamicColumn.forEach((jsonStatus, index) => { |
| 1727 | 1743 | if (commonUtils.isNotEmptyArr(jsonStatus.children)) { /* 嵌套列头JSON解析 */ |
| 1728 | - const childrenJson = jsonStatus.children.filter(itemChild=> itemChild.dataIndex && itemChild.dataIndex.includes('json')); | |
| 1744 | + const childrenJson = jsonStatus.children.filter(itemChild => itemChild.dataIndex && itemChild.dataIndex.includes('json')); | |
| 1729 | 1745 | for (const obj of childrenJson) { |
| 1730 | 1746 | obj.render = (itemStr) => { |
| 1731 | 1747 | if (commonUtils.isNotEmptyObject(itemStr) && commonUtils.isJSON(itemStr)) { |
| 1732 | 1748 | const sPartItem = JSON.parse(itemStr); |
| 1733 | 1749 | return ( |
| 1734 | - <div style={{ whiteSpace: 'normal', position:'absolute', width:'100%', left:0, top:0, bottom:0 }}> | |
| 1750 | + <div style={{ whiteSpace: 'normal', position: 'absolute', width: '100%', left: 0, top: 0, bottom: 0 }}> | |
| 1735 | 1751 | { |
| 1736 | 1752 | // eslint-disable-next-line array-callback-return; |
| 1737 | 1753 | sPartItem.map((t, i) => { |
| ... | ... | @@ -1757,7 +1773,7 @@ class CommonTableRc extends React.Component { |
| 1757 | 1773 | return ( |
| 1758 | 1774 | <div |
| 1759 | 1775 | className="dynamicColumnStyle" |
| 1760 | - style={{ display:'flex', alignItems:'center', padding:'4px', backgroundColor: colorValue, color: '#000', width:'100%', height:'100%' }} | |
| 1776 | + style={{ display: 'flex', alignItems: 'center', padding: '4px', backgroundColor: colorValue, color: '#000', width: '100%', height: '100%' }} | |
| 1761 | 1777 | key={i} |
| 1762 | 1778 | > |
| 1763 | 1779 | <div>{t.dSchedulHours}</div> |
| ... | ... | @@ -1823,7 +1839,7 @@ class CommonTableRc extends React.Component { |
| 1823 | 1839 | const sPartItem = JSON.parse(itemStr); |
| 1824 | 1840 | const linkStyle = 'sTimeStatusStyle';/* 弹窗 */ |
| 1825 | 1841 | return ( |
| 1826 | - <div style={{ display:'flex' }}> | |
| 1842 | + <div style={{ display: 'flex' }}> | |
| 1827 | 1843 | { |
| 1828 | 1844 | // eslint-disable-next-line array-callback-return; |
| 1829 | 1845 | sPartItem.map((t, i) => { |
| ... | ... | @@ -1841,7 +1857,7 @@ class CommonTableRc extends React.Component { |
| 1841 | 1857 | <div |
| 1842 | 1858 | className={linkStyle} |
| 1843 | 1859 | style={{ |
| 1844 | - width:dWidth, color:'#000', textAlign: 'center', backgroundColor:sColor, fontSize:'10px', height:'20px', borderRadius:i === 0 ? '10px 0 0 10px' : ( i === sPartItemLength - 1 ? '0 10px 10px 0' : '0px'), | |
| 1860 | + width: dWidth, color: '#000', textAlign: 'center', backgroundColor: sColor, fontSize: '10px', height: '20px', borderRadius: i === 0 ? '10px 0 0 10px' : (i === sPartItemLength - 1 ? '0 10px 10px 0' : '0px'), | |
| 1845 | 1861 | }} |
| 1846 | 1862 | key={i} |
| 1847 | 1863 | > |
| ... | ... | @@ -1869,7 +1885,7 @@ class CommonTableRc extends React.Component { |
| 1869 | 1885 | const { sState, sColor = '#000000', sName = '' } = t; |
| 1870 | 1886 | return ( |
| 1871 | 1887 | <div style={{ display: 'inline-block', color: sColor }} key={i} > |
| 1872 | - {sName}{ i + 1 === itemLength ? '' : <RightOutlined />} | |
| 1888 | + {sName}{i + 1 === itemLength ? '' : <RightOutlined />} | |
| 1873 | 1889 | </div> |
| 1874 | 1890 | ); |
| 1875 | 1891 | }) |
| ... | ... | @@ -1884,11 +1900,11 @@ class CommonTableRc extends React.Component { |
| 1884 | 1900 | lineHeight: '29px', |
| 1885 | 1901 | textOverflow: 'ellipsis' |
| 1886 | 1902 | }}> |
| 1887 | - <Tooltip color="#fff" title={() => { | |
| 1888 | - return <div>{content}</div> | |
| 1889 | - }}> | |
| 1890 | - {content} | |
| 1891 | - </Tooltip> | |
| 1903 | + <Tooltip color="#fff" title={() => { | |
| 1904 | + return <div>{content}</div> | |
| 1905 | + }}> | |
| 1906 | + {content} | |
| 1907 | + </Tooltip> | |
| 1892 | 1908 | </div> |
| 1893 | 1909 | ); |
| 1894 | 1910 | } |
| ... | ... | @@ -1903,16 +1919,16 @@ class CommonTableRc extends React.Component { |
| 1903 | 1919 | } |
| 1904 | 1920 | let bPagination = true; /* 默认表格分页s */ |
| 1905 | 1921 | if (commonUtils.isNotEmptyObject(this.props)) { |
| 1906 | - bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination)); | |
| 1922 | + bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination)); | |
| 1907 | 1923 | } |
| 1908 | 1924 | let noVlistController = false; |
| 1909 | - if(this.props.config && this.props.config.gdsconfigformslave.filter(item => item.sControlName === 'bNoVlist')[0]) { | |
| 1925 | + if (this.props.config && this.props.config.gdsconfigformslave.filter(item => item.sControlName === 'bNoVlist')[0]) { | |
| 1910 | 1926 | noVlistController = true; |
| 1911 | 1927 | } |
| 1912 | 1928 | |
| 1913 | 1929 | /* 特殊情况的表格 在虚拟列表情况 会无法滑动 */ |
| 1914 | 1930 | let noVlistTable = false; |
| 1915 | - if(this.props.noVlistTable) { | |
| 1931 | + if (this.props.noVlistTable) { | |
| 1916 | 1932 | noVlistTable = true; |
| 1917 | 1933 | } |
| 1918 | 1934 | // 判断是否有合并单元格, 有的话默认关闭虚拟滚动 |
| ... | ... | @@ -1937,18 +1953,20 @@ class CommonTableRc extends React.Component { |
| 1937 | 1953 | oBody && (oBody.scrollTop = 0); |
| 1938 | 1954 | } |
| 1939 | 1955 | window.vlistNewSearh = null; |
| 1940 | - this.Vcomponents = VListNew({height: this.scrollY, vid: this.uniqueId, onScroll: () => { | |
| 1941 | - setTimeout(() => { | |
| 1942 | - let divs = document.getElementsByClassName('noInputInsert'); | |
| 1943 | - if (divs.length) { | |
| 1944 | - Array.prototype.forEach.call(divs, item => { | |
| 1945 | - item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 1946 | - }); | |
| 1947 | - } | |
| 1948 | - }, 20); | |
| 1949 | - }}); | |
| 1956 | + this.Vcomponents = VListNew({ | |
| 1957 | + height: this.scrollY, vid: this.uniqueId, onScroll: () => { | |
| 1958 | + setTimeout(() => { | |
| 1959 | + let divs = document.getElementsByClassName('noInputInsert'); | |
| 1960 | + if (divs.length) { | |
| 1961 | + Array.prototype.forEach.call(divs, item => { | |
| 1962 | + item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 1963 | + }); | |
| 1964 | + } | |
| 1965 | + }, 20); | |
| 1966 | + } | |
| 1967 | + }); | |
| 1950 | 1968 | } |
| 1951 | - components = {...this.Vcomponents, ...components}; | |
| 1969 | + components = { ...this.Vcomponents, ...components }; | |
| 1952 | 1970 | } else { |
| 1953 | 1971 | // vid是多个列表在同个页面中,同时渲染会促发问题 |
| 1954 | 1972 | // vid不可以为随机数,随机数会导致双击时,点击的两个VList id不同 |
| ... | ... | @@ -1963,23 +1981,25 @@ class CommonTableRc extends React.Component { |
| 1963 | 1981 | oBody && (oBody.scrollTop = 0); |
| 1964 | 1982 | } |
| 1965 | 1983 | window.vlistNewSearh = null; |
| 1966 | - this.Vcomponents1 = VList({ height: this.scrollY, vid: this.uniqueId, rowKey: this.rowKey, onScroll: () => { | |
| 1967 | - setTimeout(() => { | |
| 1968 | - let divs = document.getElementsByClassName('noInputInsert'); | |
| 1969 | - if (divs.length) { | |
| 1970 | - Array.prototype.forEach.call(divs, item => { | |
| 1971 | - item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 1972 | - }); | |
| 1973 | - } | |
| 1974 | - }, 20); | |
| 1975 | - } }); | |
| 1984 | + this.Vcomponents1 = VList({ | |
| 1985 | + height: this.scrollY, vid: this.uniqueId, rowKey: this.rowKey, onScroll: () => { | |
| 1986 | + setTimeout(() => { | |
| 1987 | + let divs = document.getElementsByClassName('noInputInsert'); | |
| 1988 | + if (divs.length) { | |
| 1989 | + Array.prototype.forEach.call(divs, item => { | |
| 1990 | + item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 1991 | + }); | |
| 1992 | + } | |
| 1993 | + }, 20); | |
| 1994 | + } | |
| 1995 | + }); | |
| 1976 | 1996 | } |
| 1977 | 1997 | components = { ...this.Vcomponents1, ...components }; |
| 1978 | 1998 | } |
| 1979 | 1999 | } |
| 1980 | 2000 | if (this.props.config && this.props.config.iFreezeColumn) { |
| 1981 | 2001 | tableColumn.forEach((val, index) => { |
| 1982 | - if(tableColumn[index].fixedHelp) { | |
| 2002 | + if (tableColumn[index].fixedHelp) { | |
| 1983 | 2003 | tableColumn[index].fixed = false; |
| 1984 | 2004 | tableColumn[index].fixedHelp = false; |
| 1985 | 2005 | } |
| ... | ... | @@ -1991,14 +2011,14 @@ class CommonTableRc extends React.Component { |
| 1991 | 2011 | } |
| 1992 | 2012 | // 处理拖拽排序 |
| 1993 | 2013 | if (this.props.dragHandle) { |
| 1994 | - const handleSortTitle = commonFunc.showMessage(this.props.app.commonConst, 'sort') || '排序' ; | |
| 2014 | + const handleSortTitle = commonFunc.showMessage(this.props.app.commonConst, 'sort') || '排序'; | |
| 1995 | 2015 | const handleSort = tableColumn.filter(item => item.dataIndex === 'handleSort').length; |
| 1996 | 2016 | if (tableColumn[0]) { |
| 1997 | 2017 | function arrayMoveMutable(array, fromIndex, toIndex) { |
| 1998 | 2018 | const startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex; |
| 1999 | 2019 | if (startIndex >= 0 && startIndex < array.length) { |
| 2000 | 2020 | const endIndex = toIndex < 0 ? array.length + toIndex : toIndex; |
| 2001 | - if(commonUtils.isNotEmptyObject(array[fromIndex].sWorkOrderUsed)) { | |
| 2021 | + if (commonUtils.isNotEmptyObject(array[fromIndex].sWorkOrderUsed)) { | |
| 2002 | 2022 | message.error(array[fromIndex].sWorkOrderUsed); |
| 2003 | 2023 | return; |
| 2004 | 2024 | } |
| ... | ... | @@ -2034,11 +2054,11 @@ class CommonTableRc extends React.Component { |
| 2034 | 2054 | const { dataSource } = this.state; |
| 2035 | 2055 | // function findIndex base on Table rowKey props and should always be a right array index |
| 2036 | 2056 | const index = dataSource.findIndex(x => x.index === restProps['data-row-key']); |
| 2037 | - return <SortableItem index={index} className={className} style={{...style}} {...restProps} />; | |
| 2057 | + return <SortableItem index={index} className={className} style={{ ...style }} {...restProps} />; | |
| 2038 | 2058 | }; |
| 2039 | 2059 | // 处理渲染后丢失input focus的bug. |
| 2040 | 2060 | let bDrag = this.props.enabled && !this.props.bForbiddenDrag;/* 是否可以拖动 */ |
| 2041 | - if(bDrag) { | |
| 2061 | + if (bDrag) { | |
| 2042 | 2062 | if (!this.DraggableContainer) { |
| 2043 | 2063 | this.DraggableContainer = DraggableContainer; |
| 2044 | 2064 | } |
| ... | ... | @@ -2046,10 +2066,10 @@ class CommonTableRc extends React.Component { |
| 2046 | 2066 | this.DraggableBodyRow = DraggableBodyRow; |
| 2047 | 2067 | } |
| 2048 | 2068 | } |
| 2049 | - if(!handleSort) { | |
| 2050 | - components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}}; | |
| 2069 | + if (!handleSort) { | |
| 2070 | + components = { ...components, body: { wrapper: this.DraggableContainer, row: this.DraggableBodyRow } }; | |
| 2051 | 2071 | } else { |
| 2052 | - components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}}; | |
| 2072 | + components = { ...components, body: { wrapper: this.DraggableContainer, row: this.DraggableBodyRow } }; | |
| 2053 | 2073 | tableColumn.shift(); |
| 2054 | 2074 | } |
| 2055 | 2075 | tableColumn.unshift( |
| ... | ... | @@ -2103,8 +2123,8 @@ class CommonTableRc extends React.Component { |
| 2103 | 2123 | onMouseEnter: () => { this.onRowMouseEnter(record); }, |
| 2104 | 2124 | onMouseLeave: () => { this.onRowMouseLeave(record); }, |
| 2105 | 2125 | onDoubleClick: () => { this.onDoubleClick(this.props.name, record); }, |
| 2106 | - moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => { | |
| 2107 | - this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 2126 | + moveRow: (dragIndex, hoverIndex, dragKey, hoverKey) => { | |
| 2127 | + this.moveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 2108 | 2128 | }, |
| 2109 | 2129 | onDragClick: (type) => { this.onRowClick(record, index, type, this.props.name, 'slave'); }, |
| 2110 | 2130 | }; |
| ... | ... | @@ -2232,8 +2252,8 @@ class CommonTableRc extends React.Component { |
| 2232 | 2252 | onDoubleClick: () => { |
| 2233 | 2253 | this.onDoubleClick(record, index, undefined, slaveInfoName, 'slaveInfo'); |
| 2234 | 2254 | }, |
| 2235 | - moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => { | |
| 2236 | - this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 2255 | + moveRow: (dragIndex, hoverIndex, dragKey, hoverKey) => { | |
| 2256 | + this.moveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 2237 | 2257 | }, |
| 2238 | 2258 | onDragClick: (type) => { |
| 2239 | 2259 | this.onRowClick(record, index, type, slaveInfoName, 'slaveInfo'); |
| ... | ... | @@ -2271,8 +2291,8 @@ class CommonTableRc extends React.Component { |
| 2271 | 2291 | } else { |
| 2272 | 2292 | filterData = dataSource.length; |
| 2273 | 2293 | } |
| 2274 | - if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) { | |
| 2275 | - if(masterData.sZczlxShowName === '删除' || masterData.sZczlxShowName === '恢复'){ | |
| 2294 | + if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) { | |
| 2295 | + if (masterData.sZczlxShowName === '删除' || masterData.sZczlxShowName === '恢复') { | |
| 2276 | 2296 | filterData += 1; |
| 2277 | 2297 | } |
| 2278 | 2298 | } |
| ... | ... | @@ -2299,7 +2319,7 @@ class CommonTableRc extends React.Component { |
| 2299 | 2319 | if (isSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo) && commonUtils.isNotEmptyObject(this.props.slaveInfo.config)) { |
| 2300 | 2320 | const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter(item => item.sName === sName && item.bVisible); |
| 2301 | 2321 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 2302 | - showConfig = showConfigArr[0]; | |
| 2322 | + showConfig = showConfigArr[0]; | |
| 2303 | 2323 | } |
| 2304 | 2324 | } |
| 2305 | 2325 | |
| ... | ... | @@ -2377,11 +2397,11 @@ class CommonTableRc extends React.Component { |
| 2377 | 2397 | } |
| 2378 | 2398 | if (isRow && isRowShow && !commonUtils.isEmpty(record[column]) && commonUtils.isNotEmptyObject(record[column].toString())) { /* 配置行 */ |
| 2379 | 2399 | let { conditionValue: conditionValueOld } = item; |
| 2380 | - const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld; | |
| 2400 | + const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld; | |
| 2381 | 2401 | if (condition === '=') { |
| 2382 | - if(commonUtils.isNotEmptyObject(conditionValue) && conditionValue.includes('#')) { | |
| 2383 | - const sXName = conditionValue.replace('#','').replace('#','').trim(); | |
| 2384 | - if(sXName && commonUtils.isNotEmptyObject(this.props[sXName])) { | |
| 2402 | + if (commonUtils.isNotEmptyObject(conditionValue) && conditionValue.includes('#')) { | |
| 2403 | + const sXName = conditionValue.replace('#', '').replace('#', '').trim(); | |
| 2404 | + if (sXName && commonUtils.isNotEmptyObject(this.props[sXName])) { | |
| 2385 | 2405 | const sXValue = this.props[sXName]; |
| 2386 | 2406 | styleColor = record[column] === sXValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; |
| 2387 | 2407 | } |
| ... | ... | @@ -2449,7 +2469,7 @@ class CommonTableRc extends React.Component { |
| 2449 | 2469 | } = item; |
| 2450 | 2470 | if (!isRow) { /* 根据配置设置单元格颜色 */ |
| 2451 | 2471 | let { conditionValue: conditionValueOld } = item; |
| 2452 | - const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld; | |
| 2472 | + const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld; | |
| 2453 | 2473 | if (column === sName && (column === showConfig.sName || showConfig.sControlName?.startsWith('canOtherConfig'))) { /* 只控制该配置的单元格 */ |
| 2454 | 2474 | if (condition === '=') { |
| 2455 | 2475 | styleColor = record[column] === conditionValue ? color : ''; |
| ... | ... | @@ -2478,13 +2498,13 @@ class CommonTableRc extends React.Component { |
| 2478 | 2498 | styleColor = record[column] <= conditionValue ? color : ''; |
| 2479 | 2499 | styleBackground = record[column] <= conditionValue ? background : ''; |
| 2480 | 2500 | } else if (Array.isArray(condition)) { /* 通过其他列条件控制该字段的颜色显示 */ |
| 2481 | - if(commonUtils.isNotEmptyArr(condition)) { | |
| 2501 | + if (commonUtils.isNotEmptyArr(condition)) { | |
| 2482 | 2502 | for (const itemConditon of condition) { |
| 2483 | 2503 | const { |
| 2484 | 2504 | bFilterName, bFilterCondition, color, background, |
| 2485 | 2505 | } = itemConditon; |
| 2486 | 2506 | let { bFilterValue: bFilterValueOld } = itemConditon; |
| 2487 | - const bFilterValue = record[bFilterValueOld] ? record[bFilterValueOld]: bFilterValueOld; | |
| 2507 | + const bFilterValue = record[bFilterValueOld] ? record[bFilterValueOld] : bFilterValueOld; | |
| 2488 | 2508 | if (bFilterCondition === '=') { |
| 2489 | 2509 | styleColor = record[bFilterName] === bFilterValue ? color : ''; |
| 2490 | 2510 | styleBackground = record[bFilterName] === bFilterValue ? background : ''; |
| ... | ... | @@ -2495,7 +2515,7 @@ class CommonTableRc extends React.Component { |
| 2495 | 2515 | } |
| 2496 | 2516 | } else if (bFilterCondition === '!=') { |
| 2497 | 2517 | styleColor = record[bFilterName] !== bFilterValue ? color : ''; |
| 2498 | - styleBackground = record[bFilterName] !== bFilterValue ? background : ''; | |
| 2518 | + styleBackground = record[bFilterName] !== bFilterValue ? background : ''; | |
| 2499 | 2519 | } else if (bFilterCondition === '>') { |
| 2500 | 2520 | styleColor = record[bFilterName] > bFilterValue ? color : ''; |
| 2501 | 2521 | styleBackground = record[bFilterName] > bFilterValue ? background : ''; |
| ... | ... | @@ -2516,10 +2536,10 @@ class CommonTableRc extends React.Component { |
| 2516 | 2536 | } |
| 2517 | 2537 | styleColorArr += styleColor; |
| 2518 | 2538 | styleColorArrB += styleBackground; |
| 2519 | - if(styleColor) { | |
| 2539 | + if (styleColor) { | |
| 2520 | 2540 | styleColorArr = styleColor; |
| 2521 | 2541 | } |
| 2522 | - if(styleBackground) { | |
| 2542 | + if (styleBackground) { | |
| 2523 | 2543 | styleColorArrB = styleBackground; |
| 2524 | 2544 | } |
| 2525 | 2545 | } |
| ... | ... | @@ -2593,10 +2613,10 @@ class CommonTableRc extends React.Component { |
| 2593 | 2613 | result = false; |
| 2594 | 2614 | } |
| 2595 | 2615 | /* 若红冲单据 则按钮锁定 不能操作 */ |
| 2596 | - if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === '1') { | |
| 2616 | + if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === '1') { | |
| 2597 | 2617 | result = false; |
| 2598 | 2618 | } |
| 2599 | - if(btnName === 'BtnAdd' && bLimitOperate){ | |
| 2619 | + if (btnName === 'BtnAdd' && bLimitOperate) { | |
| 2600 | 2620 | result = false; |
| 2601 | 2621 | } |
| 2602 | 2622 | |
| ... | ... | @@ -2699,25 +2719,25 @@ class CommonTableRc extends React.Component { |
| 2699 | 2719 | } |
| 2700 | 2720 | |
| 2701 | 2721 | /* 工单、工艺卡、报价单 去掉排序 */ |
| 2702 | - if (this.props.name === 'sParam' || specialRoute.includes('workOrder') || specialRoute.includes('processCard') || specialRoute.includes('quotation')) { | |
| 2722 | + if (this.props.name === 'sParam' || specialRoute.includes('workOrder') || specialRoute.includes('processCard') || specialRoute.includes('quotation')) { | |
| 2703 | 2723 | sorter = false; |
| 2704 | 2724 | } |
| 2705 | 2725 | /* 默认字段是排序的 通过配置bNotSort来设置字段不排序 */ |
| 2706 | 2726 | if (config && commonUtils.isNotEmptyStr(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex))) { |
| 2707 | - if(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex).length > 0 && config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSort){ | |
| 2727 | + if (config.gdsconfigformslave.filter(item => item.sName === column.dataIndex).length > 0 && config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSort) { | |
| 2708 | 2728 | sorter = false; |
| 2709 | 2729 | } |
| 2710 | 2730 | } |
| 2711 | 2731 | if (config && commonUtils.isNotEmptyStr(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex))) { |
| 2712 | - if(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSearch){ | |
| 2732 | + if (config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSearch) { | |
| 2713 | 2733 | search = false; |
| 2714 | 2734 | } |
| 2715 | 2735 | } |
| 2716 | 2736 | if (column.dataIndex === "spicture" || column.dataIndex === "tableLastEmpty") { |
| 2717 | 2737 | sorter = false; |
| 2718 | 2738 | } |
| 2719 | - let sTitleBgColor =commonUtils.isNotEmptyObject(column.sTitleBgColor) ? column.sTitleBgColor : ''; /* 标题背景颜色 */ | |
| 2720 | - let sTitleColor =commonUtils.isNotEmptyObject(column.sTitleColor) ? column.sTitleColor : ''; /* 标题字体颜色 */ | |
| 2739 | + let sTitleBgColor = commonUtils.isNotEmptyObject(column.sTitleBgColor) ? column.sTitleBgColor : ''; /* 标题背景颜色 */ | |
| 2740 | + let sTitleColor = commonUtils.isNotEmptyObject(column.sTitleColor) ? column.sTitleColor : ''; /* 标题字体颜色 */ | |
| 2721 | 2741 | const styleObj = {}; |
| 2722 | 2742 | if (commonUtils.isNotEmptyObject(sTitleBgColor)) { |
| 2723 | 2743 | styleObj.background = sTitleBgColor; |
| ... | ... | @@ -2753,7 +2773,7 @@ class CommonTableRc extends React.Component { |
| 2753 | 2773 | <button |
| 2754 | 2774 | class={`table-expAllIcon ant-table-row-expand-icon ${this.tableCollapsed ? 'ant-table-row-expand-icon-collapsed' : ''}`} |
| 2755 | 2775 | style={{ margin: `1px 4px 0 ${marginLeft}` }} |
| 2756 | - ref={(ref) => {this.expRef = ref}} | |
| 2776 | + ref={(ref) => { this.expRef = ref }} | |
| 2757 | 2777 | onClick={(e) => { |
| 2758 | 2778 | e.stopPropagation(); |
| 2759 | 2779 | if (this.tableCollapsed) { |
| ... | ... | @@ -2785,8 +2805,8 @@ class CommonTableRc extends React.Component { |
| 2785 | 2805 | } else { |
| 2786 | 2806 | res = <div className='th-div' style={styleObj}>{expandedAllIcon}{column.title}</div>; |
| 2787 | 2807 | } |
| 2788 | - if (column.dataIndex ==='bSelfCbx') { | |
| 2789 | - res = <div style={{marginLeft:'5px'}}><Checkbox disabled={!props.enabled} checked={column.bCheckAll} onChange={(e) =>this.onParamChange(e)}></Checkbox></div>; | |
| 2808 | + if (column.dataIndex === 'bSelfCbx') { | |
| 2809 | + res = <div style={{ marginLeft: '5px' }}><Checkbox disabled={!props.enabled} checked={column.bCheckAll} onChange={(e) => this.onParamChange(e)}></Checkbox></div>; | |
| 2790 | 2810 | } |
| 2791 | 2811 | |
| 2792 | 2812 | return res; |
| ... | ... | @@ -2854,11 +2874,11 @@ class CommonTableRc extends React.Component { |
| 2854 | 2874 | /* 获取复制全部的props */ |
| 2855 | 2875 | // const copyAllProps = { ...this.getCopyAllProps(), disabled: false, style: { display: 'block', margin: '0 10px' } }; |
| 2856 | 2876 | const copyAllProps = { ...this.getCopyAllProps(), disabled: false }; |
| 2857 | - const uploadProps = { ...this.getUploadProps(), disabled: false, style: { margin: '0 10px', 'caret-color': 'transparent'} }; | |
| 2877 | + const uploadProps = { ...this.getUploadProps(), disabled: false, style: { margin: '0 10px', 'caret-color': 'transparent' } }; | |
| 2858 | 2878 | const downloadProps = { ...this.getDownProps(), disabled: false, style: { display: 'block', margin: '0 5px' } }; |
| 2859 | - if(isSlaveInfoM) { | |
| 2860 | - addProps.style.display ='block'; | |
| 2861 | - delProps.style.display ='block'; | |
| 2879 | + if (isSlaveInfoM) { | |
| 2880 | + addProps.style.display = 'block'; | |
| 2881 | + delProps.style.display = 'block'; | |
| 2862 | 2882 | } |
| 2863 | 2883 | const { formId } = props; |
| 2864 | 2884 | const { token } = props.app; |
| ... | ... | @@ -2867,7 +2887,7 @@ class CommonTableRc extends React.Component { |
| 2867 | 2887 | onChange: this.handleUploadChange, |
| 2868 | 2888 | accept: '*/*', |
| 2869 | 2889 | showUploadList: false, |
| 2870 | - multiple:true, | |
| 2890 | + multiple: true, | |
| 2871 | 2891 | beforeUpload: this.handleBeforeUpload, |
| 2872 | 2892 | }; |
| 2873 | 2893 | const addIcon = props.tableProps.setAdd; /* 增加操作 */ |
| ... | ... | @@ -2898,8 +2918,8 @@ class CommonTableRc extends React.Component { |
| 2898 | 2918 | bShowProductMaterials = props.tableProps.bShowProductMaterials;/* 选择成品工序 */ |
| 2899 | 2919 | } |
| 2900 | 2920 | /* 操作栏设置上传 */ |
| 2901 | - uploadIcon = this.findVisibleControlName(this.props, 'BtnSetUpload') ; | |
| 2902 | - downloadIcon = this.findVisibleControlName(this.props, 'BtnSetDownload') ; | |
| 2921 | + uploadIcon = this.findVisibleControlName(this.props, 'BtnSetUpload'); | |
| 2922 | + downloadIcon = this.findVisibleControlName(this.props, 'BtnSetDownload'); | |
| 2903 | 2923 | headPopup = this.findVisibleControlName(this.props, 'BtnHeadPopup'); /* 表头放大镜 */ |
| 2904 | 2924 | sAlumitePopup = this.findVisibleControlName(this.props, 'BtnPopupsAlumiteBomBillNo'); /* 表头放大镜 */ |
| 2905 | 2925 | bCopyMore = this.findVisibleControlName(this.props, 'BtnCopyMore'); /* 复制多行 */ |
| ... | ... | @@ -2952,7 +2972,7 @@ class CommonTableRc extends React.Component { |
| 2952 | 2972 | operateWidth += 40; |
| 2953 | 2973 | } |
| 2954 | 2974 | |
| 2955 | - if (bShowProductProcess ) { | |
| 2975 | + if (bShowProductProcess) { | |
| 2956 | 2976 | operateWidth += 40; |
| 2957 | 2977 | } |
| 2958 | 2978 | if (bShowTreeAdd) { |
| ... | ... | @@ -2967,7 +2987,7 @@ class CommonTableRc extends React.Component { |
| 2967 | 2987 | if (bShowTreeCopyAll) { |
| 2968 | 2988 | operateWidth += 40; |
| 2969 | 2989 | } |
| 2970 | - if (bShowProductMaterials ) { | |
| 2990 | + if (bShowProductMaterials) { | |
| 2971 | 2991 | operateWidth += 40; |
| 2972 | 2992 | } |
| 2973 | 2993 | if (exitIcon) { |
| ... | ... | @@ -3047,22 +3067,22 @@ class CommonTableRc extends React.Component { |
| 3047 | 3067 | /** 树节点添加 */ |
| 3048 | 3068 | if (bShowTreeAdd) { |
| 3049 | 3069 | const enabled = this.getTableBtnState('BtnAdd', record); |
| 3050 | - operateTreeAdd = <a title="添加同级" alt="添加同级" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeAdd.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon>}</a> | |
| 3070 | + operateTreeAdd = <a title="添加同级" alt="添加同级" style={{ margin: '0 10px' }} onClick={enabled ? this.handleTreeAdd.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon>}</a> | |
| 3051 | 3071 | } |
| 3052 | 3072 | /** 树节点删除 */ |
| 3053 | 3073 | if (bShowTreeDel) { |
| 3054 | 3074 | const enabled = this.getTableBtnState('BtnDel', record); |
| 3055 | - operateTreeDel = <a title="删除" alt="删除" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeDel.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> : <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon>}</a> | |
| 3075 | + operateTreeDel = <a title="删除" alt="删除" style={{ margin: '0 10px' }} onClick={enabled ? this.handleTreeDel.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> : <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon>}</a> | |
| 3056 | 3076 | } |
| 3057 | 3077 | /** 树节点添加子类 */ |
| 3058 | 3078 | if (bShowTreeAddChild) { |
| 3059 | 3079 | const enabled = this.getTableBtnState('BtnAddChildNode', record); |
| 3060 | - operateTreeAddChild = <a title="添加子级" alt="添加子级" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeAddChild.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="tree" fill="#1296db" size="14"alt="增加"></SvgIcon> : <SvgIcon iconClass="tree" fill="rgb(189, 189, 189)" size="14" alt="增加"></SvgIcon>}</a> | |
| 3080 | + operateTreeAddChild = <a title="添加子级" alt="添加子级" style={{ margin: '0 10px' }} onClick={enabled ? this.handleTreeAddChild.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="tree" fill="#1296db" size="14" alt="增加"></SvgIcon> : <SvgIcon iconClass="tree" fill="rgb(189, 189, 189)" size="14" alt="增加"></SvgIcon>}</a> | |
| 3061 | 3081 | } |
| 3062 | 3082 | /** 树节点复制 */ |
| 3063 | 3083 | if (bShowTreeCopyAll) { |
| 3064 | 3084 | const enabled = this.getTableBtnState('BtnCopyAll', record); |
| 3065 | - operateTreeCopyAll = <a title="复制全部" alt="复制全部" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeCopyAll.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon>}</a> | |
| 3085 | + operateTreeCopyAll = <a title="复制全部" alt="复制全部" style={{ margin: '0 10px' }} onClick={enabled ? this.handleTreeCopyAll.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon>}</a> | |
| 3066 | 3086 | } |
| 3067 | 3087 | /** 放置添加图标 添加为默认显示 */ |
| 3068 | 3088 | if (!commonUtils.isEmpty(addIcon)) { |
| ... | ... | @@ -3077,44 +3097,44 @@ class CommonTableRc extends React.Component { |
| 3077 | 3097 | /** 放置复制图标 */ |
| 3078 | 3098 | if (!commonUtils.isEmpty(copyIcon)) { |
| 3079 | 3099 | const enabled = this.getTableBtnState('BtnCopy', record); |
| 3080 | - operateCopy = <a title={setCopy} {...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14"alt="复制"></SvgIcon>}</a>; | |
| 3100 | + operateCopy = <a title={setCopy} {...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon>}</a>; | |
| 3081 | 3101 | } else if (setNoCommonOperate || this.props.name === 'sWorkOrderParamList') { |
| 3082 | 3102 | operateCopy = ''; |
| 3083 | 3103 | } else { |
| 3084 | 3104 | const enabled = this.getTableBtnState('BtnCopy', record); |
| 3085 | - operateCopy = <a title={setCopy}{...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null} > {enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14"alt="复制"></SvgIcon>}</a>; | |
| 3105 | + operateCopy = <a title={setCopy}{...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null} > {enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon>}</a>; | |
| 3086 | 3106 | } |
| 3087 | 3107 | /** 放置复制部件图标 */ |
| 3088 | 3108 | if (!commonUtils.isEmpty(copyAllIcon)) { |
| 3089 | 3109 | const enabled = this.getTableBtnState('BtnCopyAll', record); |
| 3090 | - operateCopyAll = <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : this.handleTbRowUsed.bind(this, index, record, 'copyAll')}>{enabled ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14"alt="复制全部"></SvgIcon>}</a>; | |
| 3110 | + operateCopyAll = <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : this.handleTbRowUsed.bind(this, index, record, 'copyAll')}>{enabled ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制全部"></SvgIcon>}</a>; | |
| 3091 | 3111 | } else if (setNoCommonOperate || this.props.bHideCopyAll || this.props.name === 'sWorkOrderParamList') { |
| 3092 | 3112 | operateCopyAll = ''; |
| 3093 | 3113 | } else { |
| 3094 | 3114 | const enabled = this.getTableBtnState('BtnCopyAll', record); |
| 3095 | - operateCopyAll = <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : null}>{enabled || this.findIsUpdByControlName(this.props, 'BtnCopyAll') ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14"alt="复制全部"></SvgIcon> }</a>; | |
| 3115 | + operateCopyAll = <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : null}>{enabled || this.findIsUpdByControlName(this.props, 'BtnCopyAll') ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制全部"></SvgIcon>}</a>; | |
| 3096 | 3116 | } |
| 3097 | 3117 | /** 放置删除图标 删除为默认显示 */ |
| 3098 | 3118 | if (!commonUtils.isEmpty(delIcon)) { |
| 3099 | 3119 | const enabled = this.getTableBtnState('BtnDel', record); |
| 3100 | - operateDel = <a title={setDelete} {...delProps} onClick={props.bDirectDel || (enabled && rowTag !== 1) ? this.delTbRow.bind(this, index, record) : this.handleTbRowUsed.bind(this, index, record, 'del')} >{props.bDirectDel || (enabled && rowTag !== 1) ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> :<SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> }</a>; | |
| 3120 | + operateDel = <a title={setDelete} {...delProps} onClick={props.bDirectDel || (enabled && rowTag !== 1) ? this.delTbRow.bind(this, index, record) : this.handleTbRowUsed.bind(this, index, record, 'del')} >{props.bDirectDel || (enabled && rowTag !== 1) ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> : <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon>}</a>; | |
| 3101 | 3121 | } else if (setNoCommonOperate) { |
| 3102 | 3122 | operateDel = ''; |
| 3103 | 3123 | } else { |
| 3104 | 3124 | const enabled = this.getTableBtnState('BtnDel', record); |
| 3105 | - operateDel = <a title={setDelete} {...delProps} onClick={props.bDirectDel || (enabled || this.findIsUpdByControlName(this.props, 'BtnDel')) ? this.delTbRow.bind(this, index, record) : null} >{props.bDirectDel || (enabled || this.findIsUpdByControlName(this.props, 'BtnDel')) ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> :<SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> }</a>; | |
| 3125 | + operateDel = <a title={setDelete} {...delProps} onClick={props.bDirectDel || (enabled || this.findIsUpdByControlName(this.props, 'BtnDel')) ? this.delTbRow.bind(this, index, record) : null} >{props.bDirectDel || (enabled || this.findIsUpdByControlName(this.props, 'BtnDel')) ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> : <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon>}</a>; | |
| 3106 | 3126 | } |
| 3107 | 3127 | |
| 3108 | 3128 | /* 复制多行 */ |
| 3109 | 3129 | if (bCopyMore) { |
| 3110 | 3130 | const enabled = this.getTableBtnState('BtnDelMore', record); |
| 3111 | - operateCopyMore = <a title={setCopyMore} {...copyMoreProps} onClick={enabled ? this.copyTbMoreRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14"alt="复制多行"></SvgIcon>}</a>; | |
| 3131 | + operateCopyMore = <a title={setCopyMore} {...copyMoreProps} onClick={enabled ? this.copyTbMoreRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14" alt="复制多行"></SvgIcon>}</a>; | |
| 3112 | 3132 | |
| 3113 | 3133 | } |
| 3114 | 3134 | /* 提取数据 */ |
| 3115 | 3135 | if (bReplace) { |
| 3116 | 3136 | const enabled = this.getTableBtnState('BtnReplace', record); |
| 3117 | - operateReplace = <a title={setReplace} onClick={enabled ? this.replaceTbRow.bind(this, index, record) : null} >{enabled ?<img src={ReplaceIcon} alt="提取数据" width="18px" height="18px" />:<img src={DisReplaceIcon} alt="查看工艺参数" width="16px" height="16px" />}</a>; | |
| 3137 | + operateReplace = <a title={setReplace} onClick={enabled ? this.replaceTbRow.bind(this, index, record) : null} >{enabled ? <img src={ReplaceIcon} alt="提取数据" width="18px" height="18px" /> : <img src={DisReplaceIcon} alt="查看工艺参数" width="16px" height="16px" />}</a>; | |
| 3118 | 3138 | |
| 3119 | 3139 | } |
| 3120 | 3140 | |
| ... | ... | @@ -3148,10 +3168,10 @@ class CommonTableRc extends React.Component { |
| 3148 | 3168 | <a |
| 3149 | 3169 | title={setMaterailRemark} |
| 3150 | 3170 | {...modalRemarkProps} |
| 3151 | - onClick={enabled ? this.modalRemarkTbRow.bind(this, index) : () => {}} | |
| 3171 | + onClick={enabled ? this.modalRemarkTbRow.bind(this, index) : () => { }} | |
| 3152 | 3172 | > |
| 3153 | - <SvgIcon iconClass="material" fill={enabled ? "#1296db": "rgb(189, 189, 189)"} size="14" alt="选择材料"> | |
| 3154 | - </SvgIcon></a> | |
| 3173 | + <SvgIcon iconClass="material" fill={enabled ? "#1296db" : "rgb(189, 189, 189)"} size="14" alt="选择材料"> | |
| 3174 | + </SvgIcon></a> | |
| 3155 | 3175 | ) |
| 3156 | 3176 | } |
| 3157 | 3177 | /** 放置选择工序材料图标 */ |
| ... | ... | @@ -3175,7 +3195,7 @@ class CommonTableRc extends React.Component { |
| 3175 | 3195 | |
| 3176 | 3196 | if (downloadIcon) { |
| 3177 | 3197 | const setDownload = commonFunc.showMessage(props.app.commonConst, 'setDownload');/* 下载 */ |
| 3178 | - operateDownload = <a title={setDownload} {...downloadProps} onClick={this.downloadTbRow.bind(this, index, record)}>{ <DownloadOutlined />}</a>; | |
| 3198 | + operateDownload = <a title={setDownload} {...downloadProps} onClick={this.downloadTbRow.bind(this, index, record)}>{<DownloadOutlined />}</a>; | |
| 3179 | 3199 | } |
| 3180 | 3200 | |
| 3181 | 3201 | if (this.isPopupShow) { |
| ... | ... | @@ -3185,18 +3205,18 @@ class CommonTableRc extends React.Component { |
| 3185 | 3205 | } |
| 3186 | 3206 | |
| 3187 | 3207 | if (this.isParamShow) { |
| 3188 | - const setParam = commonUtils.isNotEmptyObject(commonFunc.showMessage(props.app.commonConst, 'setParam')) ? commonFunc.showMessage(props.app.commonConst, 'setParam') : '查看参数' ;/* 参数 */ | |
| 3208 | + const setParam = commonUtils.isNotEmptyObject(commonFunc.showMessage(props.app.commonConst, 'setParam')) ? commonFunc.showMessage(props.app.commonConst, 'setParam') : '查看参数';/* 参数 */ | |
| 3189 | 3209 | operateParamModal = <a title={setParam} {...chooseParamProps} onClick={this.paramModalTbRow.bind(this, index, record)}>{<img src={ParamIcon} alt="查看工艺参数" width="16px" height="16px" />}</a>; |
| 3190 | 3210 | } |
| 3191 | 3211 | |
| 3192 | 3212 | if (exitIcon) { |
| 3193 | 3213 | const setExit = '退出'; |
| 3194 | - operateExit = <a title={setExit} onClick={this.exitTbRow.bind(this, index, record)}>{ <ExportOutlined style={{color: '#8e1f13'}}/>}</a>; | |
| 3214 | + operateExit = <a title={setExit} onClick={this.exitTbRow.bind(this, index, record)}>{<ExportOutlined style={{ color: '#8e1f13' }} />}</a>; | |
| 3195 | 3215 | } |
| 3196 | 3216 | if (sAlumitePopup) { |
| 3197 | 3217 | const setAlumitePopup = '电化铝'; |
| 3198 | 3218 | const enabled = this.getTableBtnState('BtnPopupsAlumiteBomBillNo', record); |
| 3199 | - operatesAlumitePopup = <a title={setAlumitePopup} onClick={enabled ? this.popupModalTbRow.bind(this, index, record, 'BtnPopupsAlumiteBomBillNo') : null}>{ enabled ? <img src={sAlumiteIcon} alt="电化铝" width="18px" height="18px" /> : <img src={DisAlumiteIcon} alt="电化铝" width="18px" height="18px" />}</a>; | |
| 3219 | + operatesAlumitePopup = <a title={setAlumitePopup} onClick={enabled ? this.popupModalTbRow.bind(this, index, record, 'BtnPopupsAlumiteBomBillNo') : null}>{enabled ? <img src={sAlumiteIcon} alt="电化铝" width="18px" height="18px" /> : <img src={DisAlumiteIcon} alt="电化铝" width="18px" height="18px" />}</a>; | |
| 3200 | 3220 | } |
| 3201 | 3221 | |
| 3202 | 3222 | return (<div |
| ... | ... | @@ -3208,51 +3228,51 @@ class CommonTableRc extends React.Component { |
| 3208 | 3228 | </div>); |
| 3209 | 3229 | }, |
| 3210 | 3230 | title: () => (this.props.setOpterationColumn === 'Y' && this.getTableFilterData() === 0 ? <span |
| 3211 | - style={{ | |
| 3212 | - width: '100%', height: '100%', display: 'flex', justifyContent: 'left', textDecoration: 'none', | |
| 3231 | + style={{ | |
| 3232 | + width: '100%', height: '100%', display: 'flex', justifyContent: 'left', textDecoration: 'none', | |
| 3233 | + }} | |
| 3234 | + >{setOperation} {uploadIcon ? <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3235 | + <a {...uploadProps} | |
| 3236 | + contenteditable="true" | |
| 3237 | + ref={(ref) => { this.uploadRef1 = ref; }} | |
| 3238 | + onPaste={this.handleUploadByClipboard} | |
| 3239 | + onMouseOver={() => { | |
| 3240 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3213 | 3241 | }} |
| 3214 | - >{setOperation} {uploadIcon ? <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3215 | - <a {...uploadProps} | |
| 3216 | - contenteditable="true" | |
| 3217 | - ref={(ref) => {this.uploadRef1 = ref;}} | |
| 3218 | - onPaste={this.handleUploadByClipboard} | |
| 3219 | - onMouseOver={() => { | |
| 3220 | - this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3221 | - }} | |
| 3222 | - onKeyDown={() => { | |
| 3223 | - this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 3224 | - }} | |
| 3225 | - onKeyUp={() => { | |
| 3226 | - this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3227 | - }} | |
| 3228 | - > | |
| 3229 | - { | |
| 3230 | - this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{color:'rgb(189, 189, 189)'}} /> | |
| 3231 | - } | |
| 3232 | - </a> | |
| 3233 | - </Upload> : <span><a {...addProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd')) ? this.addTbRowInHeader : null}>{!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> | |
| 3234 | - { headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : '' }</span>} | |
| 3242 | + onKeyDown={() => { | |
| 3243 | + this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 3244 | + }} | |
| 3245 | + onKeyUp={() => { | |
| 3246 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3247 | + }} | |
| 3248 | + > | |
| 3249 | + { | |
| 3250 | + this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{ color: 'rgb(189, 189, 189)' }} /> | |
| 3251 | + } | |
| 3252 | + </a> | |
| 3253 | + </Upload> : <span><a {...addProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd')) ? this.addTbRowInHeader : null}>{!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> | |
| 3254 | + {headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : ''}</span>} | |
| 3235 | 3255 | </span> : |
| 3236 | - uploadIcon ? <span> <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3256 | + uploadIcon ? <span> <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3237 | 3257 | <a {...uploadProps} |
| 3238 | - contenteditable="true" | |
| 3239 | - ref={(ref) => {this.uploadRef1 = ref;}} | |
| 3240 | - onPaste={this.handleUploadByClipboard} | |
| 3241 | - onMouseOver={() => { | |
| 3242 | - this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3243 | - }} | |
| 3244 | - onKeyDown={() => { | |
| 3245 | - this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 3246 | - }} | |
| 3247 | - onKeyUp={() => { | |
| 3248 | - this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3249 | - }} | |
| 3258 | + contenteditable="true" | |
| 3259 | + ref={(ref) => { this.uploadRef1 = ref; }} | |
| 3260 | + onPaste={this.handleUploadByClipboard} | |
| 3261 | + onMouseOver={() => { | |
| 3262 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3263 | + }} | |
| 3264 | + onKeyDown={() => { | |
| 3265 | + this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 3266 | + }} | |
| 3267 | + onKeyUp={() => { | |
| 3268 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3269 | + }} | |
| 3250 | 3270 | > |
| 3251 | 3271 | { |
| 3252 | - this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{color:'rgb(189, 189, 189)'}} /> | |
| 3272 | + this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{ color: 'rgb(189, 189, 189)' }} /> | |
| 3253 | 3273 | } |
| 3254 | - </a> | |
| 3255 | - </Upload></span> : <span> {setOperation} { headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && ( props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : '' } </span>), | |
| 3274 | + </a> | |
| 3275 | + </Upload></span> : <span> {setOperation} {headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : ''} </span>), | |
| 3256 | 3276 | width: operateWidth + 'px', |
| 3257 | 3277 | // fixed: commonUtils.isNotEmptyObject(this.props.tableProps.AutoTableHeight) ? 'right' : false, |
| 3258 | 3278 | fixed: 'right', |
| ... | ... | @@ -3280,8 +3300,8 @@ class CommonTableRc extends React.Component { |
| 3280 | 3300 | return false; |
| 3281 | 3301 | } |
| 3282 | 3302 | returnProps.filterDropdown = ({ |
| 3283 | - setSelectedKeys, selectedKeys, confirm, clearFilters, | |
| 3284 | - }) => { | |
| 3303 | + setSelectedKeys, selectedKeys, confirm, clearFilters, | |
| 3304 | + }) => { | |
| 3285 | 3305 | return ( |
| 3286 | 3306 | <div style={{ padding: 8 }}> |
| 3287 | 3307 | <Input |
| ... | ... | @@ -3381,7 +3401,7 @@ class CommonTableRc extends React.Component { |
| 3381 | 3401 | const { enabled, sUseInfo, app, masterData } = props; |
| 3382 | 3402 | /* 待用数据 */ |
| 3383 | 3403 | const showConfig = this.getShowConfig(props, sName); /* 配置信息 */ |
| 3384 | - if(commonUtils.isEmptyObject(showConfig)) { | |
| 3404 | + if (commonUtils.isEmptyObject(showConfig)) { | |
| 3385 | 3405 | console.log('渲染失败:', showConfig, sName); |
| 3386 | 3406 | } |
| 3387 | 3407 | /* 返回值 */ |
| ... | ... | @@ -3389,7 +3409,7 @@ class CommonTableRc extends React.Component { |
| 3389 | 3409 | if (showConfig.iTag === 1) { |
| 3390 | 3410 | enabledNew = false; |
| 3391 | 3411 | } else if (showConfig.iTag === 3) { |
| 3392 | - if(commonUtils.isNotEmptyObject(masterData) && !masterData.bCheck) { | |
| 3412 | + if (commonUtils.isNotEmptyObject(masterData) && !masterData.bCheck) { | |
| 3393 | 3413 | enabledNew = true; |
| 3394 | 3414 | } |
| 3395 | 3415 | } else if (record.rowTag === 1) { /* 当rowTag为1时,锁定该行不可编辑 */ |
| ... | ... | @@ -3398,7 +3418,7 @@ class CommonTableRc extends React.Component { |
| 3398 | 3418 | enabledNew = false; |
| 3399 | 3419 | } |
| 3400 | 3420 | /* 红冲中的单据 不可修改 */ |
| 3401 | - if (commonUtils.isNotEmptyObject(masterData) && ((commonUtils.isNotEmptyObject(masterData.sMinusSrcId)) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) ) { | |
| 3421 | + if (commonUtils.isNotEmptyObject(masterData) && ((commonUtils.isNotEmptyObject(masterData.sMinusSrcId)) || commonUtils.isNotEmptyObject(masterData.sMinusUsed))) { | |
| 3402 | 3422 | enabledNew = false; |
| 3403 | 3423 | if (app?.currentPane?.copyTo?.name && app.currentPane.copyTo.name.toLowerCase().includes('portion')) { |
| 3404 | 3424 | // 部分红冲中可修改的字段 |
| ... | ... | @@ -3407,9 +3427,9 @@ class CommonTableRc extends React.Component { |
| 3407 | 3427 | } |
| 3408 | 3428 | } |
| 3409 | 3429 | |
| 3410 | - enabledNew= this.getSelectRowEditState(sName, record, enabledNew); | |
| 3430 | + enabledNew = this.getSelectRowEditState(sName, record, enabledNew); | |
| 3411 | 3431 | |
| 3412 | - typeof props.otherlimitDisabled === 'function' && (enabledNew = props.otherlimitDisabled({enabledNew, record, sName})); | |
| 3432 | + typeof props.otherlimitDisabled === 'function' && (enabledNew = props.otherlimitDisabled({ enabledNew, record, sName })); | |
| 3413 | 3433 | |
| 3414 | 3434 | const showConfigAll = this.getColorConfig(); /* 拿到颜色配置json */ |
| 3415 | 3435 | const showConfigArr = commonUtils.isNotEmptyArr(showConfigAll) ? showConfigAll.filter(item => item.sName === sName) : []; /* 找到该字段颜色配置 */ |
| ... | ... | @@ -3430,7 +3450,7 @@ class CommonTableRc extends React.Component { |
| 3430 | 3450 | } = item; |
| 3431 | 3451 | if (!isRow) { /* 根据配置设置单元格颜色 */ |
| 3432 | 3452 | let { conditionValue: conditionValueOld } = item; |
| 3433 | - const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld; | |
| 3453 | + const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld; | |
| 3434 | 3454 | if (column === sName && !commonUtils.isEmpty(record[column])) { |
| 3435 | 3455 | if (condition === '=') { |
| 3436 | 3456 | styleColor = record[column] === conditionValue ? `SetCell_${background}` : ''; |
| ... | ... | @@ -3484,7 +3504,7 @@ class CommonTableRc extends React.Component { |
| 3484 | 3504 | onPreviewOffice: this.handlePreviewOffice, |
| 3485 | 3505 | onDropdownVisibleChange: this.handleDropdownVisibleChange, |
| 3486 | 3506 | onFilterDropDownData: props.onFilterDropDownData, |
| 3487 | - onFieldPopupModal:this.handleFieldPopupModal, /* 字段选择弹窗 */ | |
| 3507 | + onFieldPopupModal: this.handleFieldPopupModal, /* 字段选择弹窗 */ | |
| 3488 | 3508 | onFieldDoubleClick: this.props.onFieldDoubleClick, |
| 3489 | 3509 | onDropDownBlur: props.onDropDownBlur, /* 下拉框多选离开事件 */ |
| 3490 | 3510 | className: styleColorArr, |
| ... | ... | @@ -3500,7 +3520,7 @@ class CommonTableRc extends React.Component { |
| 3500 | 3520 | /** 获取上传控件的props */ |
| 3501 | 3521 | getUploadProps = () => { |
| 3502 | 3522 | return { |
| 3503 | - disabled:this.props.name === 'picFile' ? !this.findIsUpdByControlName(this.props, 'BtnUpload') : !this.props.enabled, /* 是否可用 */ | |
| 3523 | + disabled: this.props.name === 'picFile' ? !this.findIsUpdByControlName(this.props, 'BtnUpload') : !this.props.enabled, /* 是否可用 */ | |
| 3504 | 3524 | style: { display: commonUtils.convertBooleanToDisplayBlock(this.isUploadShow) }, /* 是否显示 */ |
| 3505 | 3525 | }; |
| 3506 | 3526 | }; |
| ... | ... | @@ -3661,7 +3681,7 @@ class CommonTableRc extends React.Component { |
| 3661 | 3681 | let bPagination = true; /* 默认表格分页s */ |
| 3662 | 3682 | let pagination = {}; |
| 3663 | 3683 | if (commonUtils.isNotEmptyObject(this.props)) { |
| 3664 | - bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination)); | |
| 3684 | + bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination)); | |
| 3665 | 3685 | pagination = this.props.tableProps.pagination; |
| 3666 | 3686 | } |
| 3667 | 3687 | |
| ... | ... | @@ -3690,7 +3710,7 @@ class CommonTableRc extends React.Component { |
| 3690 | 3710 | return; |
| 3691 | 3711 | } |
| 3692 | 3712 | /* 如果是树形 则返回 */ |
| 3693 | - if(this.props.sTableType && this.props.sTableType !='zero') { | |
| 3713 | + if (this.props.sTableType && this.props.sTableType != 'zero') { | |
| 3694 | 3714 | return; |
| 3695 | 3715 | } |
| 3696 | 3716 | const obj = {}; |
| ... | ... | @@ -3715,7 +3735,7 @@ class CommonTableRc extends React.Component { |
| 3715 | 3735 | let flag = false; |
| 3716 | 3736 | for (const key in item) { |
| 3717 | 3737 | // 判断是否与上一个值相同 |
| 3718 | - if (item[key] !== '' && item[key] === prevData[key] && (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true) ) { | |
| 3738 | + if (item[key] !== '' && item[key] === prevData[key] && (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true)) { | |
| 3719 | 3739 | if (!obj[key]) { |
| 3720 | 3740 | obj[key] = []; |
| 3721 | 3741 | } |
| ... | ... | @@ -3761,7 +3781,7 @@ class CommonTableRc extends React.Component { |
| 3761 | 3781 | const prevData = this.curSlaveInfoData[index - 1]; |
| 3762 | 3782 | for (const key in item) { |
| 3763 | 3783 | // 判断是否与上一个值相同 |
| 3764 | - if (item[key] !== '' && item[key] === prevData[key] && (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true) ) { | |
| 3784 | + if (item[key] !== '' && item[key] === prevData[key] && (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true)) { | |
| 3765 | 3785 | if (!obj[key]) { |
| 3766 | 3786 | obj[key] = []; |
| 3767 | 3787 | } |
| ... | ... | @@ -3837,18 +3857,18 @@ class CommonTableRc extends React.Component { |
| 3837 | 3857 | }; |
| 3838 | 3858 | handleSelectCancel = (modelVisible) => { |
| 3839 | 3859 | this.setState({ |
| 3840 | - [modelVisible]:false, | |
| 3860 | + [modelVisible]: false, | |
| 3841 | 3861 | }); |
| 3842 | 3862 | }; |
| 3843 | 3863 | handleSelectCommonPopup = (name, selectConfig, selectData) => { |
| 3844 | 3864 | const { commonPopupTbName, commonPopupShowConfig, commonFieldPopupVisible, commonPopupVisible, commonFieldPopupTbName, commonFieldPopupShowConfig, |
| 3845 | 3865 | commonModalVisible, commonModalShowConfig, commonModalTbName } = this.state; |
| 3846 | 3866 | /* 若是产品名称弹窗 并且配置了调用产品工艺卡标识copyFromTechnology 则走自己的逻辑 */ |
| 3847 | - if(selectConfig.sCompareColor === 'copyFromTechnology') { | |
| 3867 | + if (selectConfig.sCompareColor === 'copyFromTechnology') { | |
| 3848 | 3868 | this.props.onSelectCommonPopupProduct(name, selectConfig, selectData, commonPopupTbName, commonPopupShowConfig); |
| 3849 | 3869 | } else { |
| 3850 | - let tb = commonPopupVisible ? { name: commonPopupTbName, config: commonPopupShowConfig } : commonFieldPopupVisible ? { name: commonFieldPopupTbName, config: commonFieldPopupShowConfig } : undefined; | |
| 3851 | - tb = commonModalVisible ? { name: commonModalTbName, config: commonModalShowConfig }: tb; | |
| 3870 | + let tb = commonPopupVisible ? { name: commonPopupTbName, config: commonPopupShowConfig } : commonFieldPopupVisible ? { name: commonFieldPopupTbName, config: commonFieldPopupShowConfig } : undefined; | |
| 3871 | + tb = commonModalVisible ? { name: commonModalTbName, config: commonModalShowConfig } : tb; | |
| 3852 | 3872 | if (selectConfig.sControlName?.startsWith('BtnPopupEdit')) { |
| 3853 | 3873 | this.props.onSelectCommonPopup(name, selectConfig, selectData, tb?.name, tb?.config, { index: this.rowClickRef.current }); |
| 3854 | 3874 | return; |
| ... | ... | @@ -3945,7 +3965,7 @@ class CommonTableRc extends React.Component { |
| 3945 | 3965 | } |
| 3946 | 3966 | |
| 3947 | 3967 | /* 快捷键跳转 */ |
| 3948 | - handleQuickViewClick = async (name, sName, record, index , myConfigArr) => { | |
| 3968 | + handleQuickViewClick = async (name, sName, record, index, myConfigArr) => { | |
| 3949 | 3969 | const { |
| 3950 | 3970 | slaveConfig, |
| 3951 | 3971 | slaveData, |
| ... | ... | @@ -3964,10 +3984,10 @@ class CommonTableRc extends React.Component { |
| 3964 | 3984 | // employeeConfig, |
| 3965 | 3985 | } = this.props; |
| 3966 | 3986 | let picArr = '' |
| 3967 | - if(commonUtils.isNotEmptyArr(slaveConfig)){ | |
| 3968 | - picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === sName)); | |
| 3987 | + if (commonUtils.isNotEmptyArr(slaveConfig)) { | |
| 3988 | + picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === sName)); | |
| 3969 | 3989 | } |
| 3970 | - if(commonUtils.isNotEmptyArr(myConfigArr)) { | |
| 3990 | + if (commonUtils.isNotEmptyArr(myConfigArr)) { | |
| 3971 | 3991 | picArr = myConfigArr; |
| 3972 | 3992 | } |
| 3973 | 3993 | if (picArr.length > 0) { |
| ... | ... | @@ -4074,14 +4094,14 @@ class CommonTableRc extends React.Component { |
| 4074 | 4094 | } |
| 4075 | 4095 | }; |
| 4076 | 4096 | }) |
| 4077 | - }; | |
| 4097 | + }; | |
| 4078 | 4098 | |
| 4079 | 4099 | /* 所有备注非编辑状态下点击链接可以弹出备注窗体 */ |
| 4080 | 4100 | handleMemoShow = (name, sName, record, index, showConfig) => { |
| 4081 | 4101 | if (commonUtils.isNotEmptyObject(record)) { |
| 4082 | 4102 | const sMemo = showConfig.sName; |
| 4083 | 4103 | const title = showConfig.showName; |
| 4084 | - if (sName.includes(['sTemplateFullMemo','sContentMemo'])) { | |
| 4104 | + if (sName.includes(['sTemplateFullMemo', 'sContentMemo'])) { | |
| 4085 | 4105 | return this.setState({ simpleModalVisible: true, simpleModalWord: record[sName] }); |
| 4086 | 4106 | } |
| 4087 | 4107 | const sCurrMemoProps = { |
| ... | ... | @@ -4097,30 +4117,30 @@ class CommonTableRc extends React.Component { |
| 4097 | 4117 | this.props.onSaveState({ sCurrMemoProps }); |
| 4098 | 4118 | } |
| 4099 | 4119 | } |
| 4100 | - handleViewChoose= (name, sName, record, index) => { | |
| 4120 | + handleViewChoose = (name, sName, record, index) => { | |
| 4101 | 4121 | this.props.onViewChoose(name, sName, record, index); |
| 4102 | 4122 | } |
| 4103 | 4123 | /* 弹出通用窗体 */ |
| 4104 | - handlePopupModal= (showConfig, name) => { | |
| 4124 | + handlePopupModal = (showConfig, name) => { | |
| 4105 | 4125 | this.setState({ |
| 4106 | - commonPopupVisible:true, | |
| 4107 | - commonPopupTbName:name, | |
| 4108 | - commonPopupShowConfig:showConfig, | |
| 4126 | + commonPopupVisible: true, | |
| 4127 | + commonPopupTbName: name, | |
| 4128 | + commonPopupShowConfig: showConfig, | |
| 4109 | 4129 | }); |
| 4110 | 4130 | } |
| 4111 | 4131 | |
| 4112 | 4132 | /* 字段弹窗 */ |
| 4113 | - handleFieldPopupModal= (showConfig, name, record) => { | |
| 4133 | + handleFieldPopupModal = (showConfig, name, record) => { | |
| 4114 | 4134 | this.setState({ |
| 4115 | - commonFieldPopupVisible:true, | |
| 4116 | - commonFieldPopupTbName:name, | |
| 4117 | - commonFieldPopupShowConfig:showConfig, | |
| 4135 | + commonFieldPopupVisible: true, | |
| 4136 | + commonFieldPopupTbName: name, | |
| 4137 | + commonFieldPopupShowConfig: showConfig, | |
| 4118 | 4138 | commonFieldPopupShowRecord: record, |
| 4119 | 4139 | }); |
| 4120 | 4140 | } |
| 4121 | 4141 | |
| 4122 | 4142 | /* 蓝色链接弹出通用窗体 */ |
| 4123 | - handleTabModalClick= (name, sName, record, index, showConfig, configName) => { | |
| 4143 | + handleTabModalClick = (name, sName, record, index, showConfig, configName) => { | |
| 4124 | 4144 | // const { sourceAllData:data } = this.props; |
| 4125 | 4145 | // let commonModalData = []; |
| 4126 | 4146 | // if(sName === 'dSumCompleteAvailableStockQty' && commonUtils.isNotEmptyArr(data)) { |
| ... | ... | @@ -4129,11 +4149,11 @@ class CommonTableRc extends React.Component { |
| 4129 | 4149 | // item.bSecondMainMaterials); |
| 4130 | 4150 | // } |
| 4131 | 4151 | this.setState({ |
| 4132 | - commonModalVisible:true, | |
| 4133 | - commonModalTbName:name, | |
| 4134 | - commonModalShowConfig:showConfig, | |
| 4135 | - commonModalRecord:record, | |
| 4136 | - commonModalConfigName:configName, | |
| 4152 | + commonModalVisible: true, | |
| 4153 | + commonModalTbName: name, | |
| 4154 | + commonModalShowConfig: showConfig, | |
| 4155 | + commonModalRecord: record, | |
| 4156 | + commonModalConfigName: configName, | |
| 4137 | 4157 | // commonModalData, |
| 4138 | 4158 | }); |
| 4139 | 4159 | } |
| ... | ... | @@ -4147,7 +4167,7 @@ class CommonTableRc extends React.Component { |
| 4147 | 4167 | const oDiv = { |
| 4148 | 4168 | 'span': target.parentNode, |
| 4149 | 4169 | 'td': target.childNodes[0].childNodes[0], |
| 4150 | - 'div': target.getAttribute('data-name') ? target : target.childNodes[0], | |
| 4170 | + 'div': target.getAttribute('data-name') ? target : target.childNodes[0], | |
| 4151 | 4171 | }[tagName.toLowerCase()]; |
| 4152 | 4172 | |
| 4153 | 4173 | if (!oDiv || window.getSelection().toString()) return false; |
| ... | ... | @@ -4199,7 +4219,7 @@ class CommonTableRc extends React.Component { |
| 4199 | 4219 | } |
| 4200 | 4220 | |
| 4201 | 4221 | /* 点击图片预览 */ |
| 4202 | - handlePreviewImage= (e, dataUrlArr) => { | |
| 4222 | + handlePreviewImage = (e, dataUrlArr) => { | |
| 4203 | 4223 | e.stopPropagation(); /* 阻止父级穿透 */ |
| 4204 | 4224 | if (commonUtils.isNotEmptyObject(dataUrlArr)) { |
| 4205 | 4225 | const { token } = this.props.app; |
| ... | ... | @@ -4209,7 +4229,7 @@ class CommonTableRc extends React.Component { |
| 4209 | 4229 | previewImageArr.push(dataPreviewUrl); |
| 4210 | 4230 | }); |
| 4211 | 4231 | this.setState({ |
| 4212 | - previewImage:previewImageArr, | |
| 4232 | + previewImage: previewImageArr, | |
| 4213 | 4233 | previewVisible: true, |
| 4214 | 4234 | showimgs: true, |
| 4215 | 4235 | firstIndex: 0, |
| ... | ... | @@ -4244,16 +4264,16 @@ class CommonTableRc extends React.Component { |
| 4244 | 4264 | const sBtnName = sName; |
| 4245 | 4265 | const sBtnContent = record[sName]; |
| 4246 | 4266 | const sFormId = commonUtils.isNotEmptyObject(record.sId) ? record.sId : ''; |
| 4247 | - const sBtnControlName = commonUtils.isNotEmptyObject(showConfig.sControlName) ? showConfig.sControlName : '' ; | |
| 4267 | + const sBtnControlName = commonUtils.isNotEmptyObject(showConfig.sControlName) ? showConfig.sControlName : ''; | |
| 4248 | 4268 | console.log('sFormId:', sFormId); |
| 4249 | - if(commonUtils.isNotEmptyObject(sBtnContent)) { | |
| 4269 | + if (commonUtils.isNotEmptyObject(sBtnContent)) { | |
| 4250 | 4270 | const urlPrint = `${commonConfig.server_host}template/getSql/${sBtnName}/?sBtnContent=${sBtnContent}&sBtnControlName=${sBtnControlName}&sFormId=${sFormId}`; |
| 4251 | - const w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | |
| 4252 | - const h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; | |
| 4271 | + const w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | |
| 4272 | + const h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; | |
| 4253 | 4273 | //const newWin = window.open('','_blank'); |
| 4254 | - const features = "width="+(w+350)+",height="+(h+300)+", top=0, left=0, toolbar=no, menubar=no,scrollbars=no,resizable=no, location =no, status=no"; | |
| 4274 | + const features = "width=" + (w + 350) + ",height=" + (h + 300) + ", top=0, left=0, toolbar=no, menubar=no,scrollbars=no,resizable=no, location =no, status=no"; | |
| 4255 | 4275 | const newWin = window.open("", "SQL查看器", features); |
| 4256 | - newWin.document.write('<body scroll="no" style="margin: 0px;padding: 0px;border:0px;overflow:hidden;"><iframe style="margin: 0px;padding: 0px;border: 0px;width:100%;height:100%" src="'+urlPrint+'"></iframe></body>'); | |
| 4276 | + newWin.document.write('<body scroll="no" style="margin: 0px;padding: 0px;border:0px;overflow:hidden;"><iframe style="margin: 0px;padding: 0px;border: 0px;width:100%;height:100%" src="' + urlPrint + '"></iframe></body>'); | |
| 4257 | 4277 | // window.open(urlPrint); |
| 4258 | 4278 | } else { |
| 4259 | 4279 | message.error('未找到对应过程名'); |
| ... | ... | @@ -4262,7 +4282,7 @@ class CommonTableRc extends React.Component { |
| 4262 | 4282 | |
| 4263 | 4283 | /* 右箭头点击 */ |
| 4264 | 4284 | handleRightArrow = (name, sName, record, index, showConfig) => { |
| 4265 | - if(this.props.onRightArrow) { | |
| 4285 | + if (this.props.onRightArrow) { | |
| 4266 | 4286 | this.props.onRightArrow(name, sName, record, index, showConfig); |
| 4267 | 4287 | } |
| 4268 | 4288 | |
| ... | ... | @@ -4272,9 +4292,9 @@ class CommonTableRc extends React.Component { |
| 4272 | 4292 | handleOperateMoreOk = () => { |
| 4273 | 4293 | const sNumber = document.getElementById('iNumber').value; |
| 4274 | 4294 | console.log('sNumber', sNumber); |
| 4275 | - if(commonUtils.isNotEmptyObject(iNumber) && Number(sNumber) > 0 ) { | |
| 4276 | - const iNumber = Number(sNumber); | |
| 4277 | - for(let i = 0; i< iNumber ; i++) { | |
| 4295 | + if (commonUtils.isNotEmptyObject(iNumber) && Number(sNumber) > 0) { | |
| 4296 | + const iNumber = Number(sNumber); | |
| 4297 | + for (let i = 0; i < iNumber; i++) { | |
| 4278 | 4298 | this.handleCopyRow(0); |
| 4279 | 4299 | } |
| 4280 | 4300 | } |
| ... | ... | @@ -4426,10 +4446,10 @@ class CommonTableRc extends React.Component { |
| 4426 | 4446 | }; |
| 4427 | 4447 | } |
| 4428 | 4448 | |
| 4429 | - genFooter= () => { | |
| 4449 | + genFooter = () => { | |
| 4430 | 4450 | const { tableColumn, totalData: totalData0, totalDataNew, sumGroup = {}, totalData1 } = this.state; |
| 4431 | 4451 | const totalData = Object.keys(sumGroup).some(key => sumGroup[key]?.length) ? totalDataNew : totalData0; |
| 4432 | - const { dNetMoney, dNetPrice } = this.props.app.decimals; | |
| 4452 | + const { dNetMoney, dNetPrice } = this.props.app.decimals; | |
| 4433 | 4453 | const sModelsType = commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.app) ? this.props.app.currentPane.sModelsType : ''; |
| 4434 | 4454 | const sumset = commonFunc.showMessage(this.props.app.commonConst, 'sumSet') || '合计'; |
| 4435 | 4455 | |
| ... | ... | @@ -4437,13 +4457,13 @@ class CommonTableRc extends React.Component { |
| 4437 | 4457 | if ((!totalData.length && !totalData1.length) || this.props.footer !== undefined) { |
| 4438 | 4458 | return (<></>); |
| 4439 | 4459 | } |
| 4440 | - if(this.props.tableProps.rowSelection !== null && !(this.props.config && !this.props.config.bisMutiSelect)) { | |
| 4460 | + if (this.props.tableProps.rowSelection !== null && !(this.props.config && !this.props.config.bisMutiSelect)) { | |
| 4441 | 4461 | colSpan = colSpan + 1; |
| 4442 | 4462 | } |
| 4443 | - if(this.props.slaveInfo) { | |
| 4463 | + if (this.props.slaveInfo) { | |
| 4444 | 4464 | colSpan = colSpan + 1; |
| 4445 | 4465 | } |
| 4446 | - if(this.props.dragHandle) { | |
| 4466 | + if (this.props.dragHandle) { | |
| 4447 | 4467 | // colSpan = colSpan + 1; // 临时处理标准精准报价单据工序信息表合计错位问题 |
| 4448 | 4468 | } |
| 4449 | 4469 | const cells = []; |
| ... | ... | @@ -4451,7 +4471,7 @@ class CommonTableRc extends React.Component { |
| 4451 | 4471 | if (totalData.length) { |
| 4452 | 4472 | let summaryCellTotal = ''; |
| 4453 | 4473 | summaryCellTotal = ( |
| 4454 | - <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan: 1} index={0}> | |
| 4474 | + <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan : 1} index={0}> | |
| 4455 | 4475 | <span className={styles.summaryCellTotal}>{sumset}</span> |
| 4456 | 4476 | </Table.Summary.Cell> |
| 4457 | 4477 | ); |
| ... | ... | @@ -4471,7 +4491,7 @@ class CommonTableRc extends React.Component { |
| 4471 | 4491 | |
| 4472 | 4492 | cells.push(summaryCellTotal); |
| 4473 | 4493 | tableColumn.forEach((item, index) => { |
| 4474 | - if(colSpan === 0 && index === 0) { | |
| 4494 | + if (colSpan === 0 && index === 0) { | |
| 4475 | 4495 | return; |
| 4476 | 4496 | } |
| 4477 | 4497 | let iTag = index + colSpan; |
| ... | ... | @@ -4483,39 +4503,39 @@ class CommonTableRc extends React.Component { |
| 4483 | 4503 | if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.substring(0, 1) === 'd' && columnConfig?.sDateFormat === 'decimalPoint' && columnConfig?.sFieldValidation) { |
| 4484 | 4504 | /* 取小数点位数 */ |
| 4485 | 4505 | const point = columnConfig.sFieldValidation.split(',')[1] || 2; |
| 4486 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4506 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4487 | 4507 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 4488 | - if(!isNaN(dConfigResult)) { | |
| 4508 | + if (!isNaN(dConfigResult)) { | |
| 4489 | 4509 | sValue = dConfigResult; |
| 4490 | 4510 | } |
| 4491 | 4511 | } |
| 4492 | - } else if( commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('commonList') || (sModelsType && sModelsType.indexOf('commonMultiList') > -1)) { | |
| 4512 | + } else if (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('commonList') || (sModelsType && sModelsType.indexOf('commonMultiList') > -1)) { | |
| 4493 | 4513 | /* 有配置以配置为主 否则以系统设定为主 */ |
| 4494 | - if(commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.substring(0, 1) === 'd' && commonUtils.isNotEmptyObject(itemChild.sDateFormat)) { | |
| 4514 | + if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.substring(0, 1) === 'd' && commonUtils.isNotEmptyObject(itemChild.sDateFormat)) { | |
| 4495 | 4515 | /* 取小数点位数 */ |
| 4496 | 4516 | let point = 0; |
| 4497 | 4517 | let strIndex = itemChild.sDateFormat.indexOf('.'); |
| 4498 | - if(strIndex > -1 && itemChild.sDateFormat.length > 1) { | |
| 4518 | + if (strIndex > -1 && itemChild.sDateFormat.length > 1) { | |
| 4499 | 4519 | point = itemChild.sDateFormat.substring(strIndex + 1, itemChild.sDateFormat.length).length; |
| 4500 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4520 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4501 | 4521 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 4502 | - if(!isNaN(dConfigResult)) { | |
| 4522 | + if (!isNaN(dConfigResult)) { | |
| 4503 | 4523 | sValue = dConfigResult; |
| 4504 | 4524 | } |
| 4505 | 4525 | } |
| 4506 | 4526 | } |
| 4507 | 4527 | } else { |
| 4508 | - if ( commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith('price')) { /* 列表单价格式化显示1 */ | |
| 4509 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4528 | + if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith('price')) { /* 列表单价格式化显示1 */ | |
| 4529 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4510 | 4530 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice).toFixed(dNetPrice); |
| 4511 | - if(!isNaN(dResult)) { | |
| 4531 | + if (!isNaN(dResult)) { | |
| 4512 | 4532 | sValue = dResult; |
| 4513 | 4533 | } |
| 4514 | 4534 | } |
| 4515 | 4535 | } else if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ |
| 4516 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4536 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4517 | 4537 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney).toFixed(dNetMoney); |
| 4518 | - if(!isNaN(dResult)) { | |
| 4538 | + if (!isNaN(dResult)) { | |
| 4519 | 4539 | sValue = dResult; |
| 4520 | 4540 | } |
| 4521 | 4541 | } |
| ... | ... | @@ -4535,19 +4555,19 @@ class CommonTableRc extends React.Component { |
| 4535 | 4555 | let cell = ''; |
| 4536 | 4556 | /* commonList 格式化单价、金额 */ |
| 4537 | 4557 | let sValue = totalData[0][item.dataIndex]; |
| 4538 | - if( commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('commonList') || (sModelsType && sModelsType.indexOf('commonMultiList') > -1)) { | |
| 4558 | + if (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('commonList') || (sModelsType && sModelsType.indexOf('commonMultiList') > -1)) { | |
| 4539 | 4559 | /* 有配置以配置为主 否则以系统设定为主 */ |
| 4540 | 4560 | const columnConfig = this.props.config.gdsconfigformslave.find(item1 => item1.sName === item.dataIndex); |
| 4541 | 4561 | if (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.substring(0, 1) === 'd' && columnConfig?.sDateFormat === 'decimalPoint' && columnConfig?.sFieldValidation) { |
| 4542 | 4562 | /* 取小数点位数 */ |
| 4543 | 4563 | const point = columnConfig.sFieldValidation.split(',')[1] || 2; |
| 4544 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4564 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4545 | 4565 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 4546 | - if(!isNaN(dConfigResult)) { | |
| 4566 | + if (!isNaN(dConfigResult)) { | |
| 4547 | 4567 | sValue = dConfigResult; |
| 4548 | 4568 | } |
| 4549 | 4569 | } |
| 4550 | - } else if ( commonUtils.isNotEmptyObject(item.sDateFormat)) { | |
| 4570 | + } else if (commonUtils.isNotEmptyObject(item.sDateFormat)) { | |
| 4551 | 4571 | /* 取小数点位数 */ |
| 4552 | 4572 | let point = 0; |
| 4553 | 4573 | let strIndex = item.sDateFormat.indexOf('.'); |
| ... | ... | @@ -4593,13 +4613,13 @@ class CommonTableRc extends React.Component { |
| 4593 | 4613 | if (totalData1.length) { |
| 4594 | 4614 | let summaryCellTotal1 = ''; |
| 4595 | 4615 | summaryCellTotal1 = ( |
| 4596 | - <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan: 1} index={0}> | |
| 4616 | + <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan : 1} index={0}> | |
| 4597 | 4617 | <span className={styles.summaryCellTotal}>总计</span> |
| 4598 | 4618 | </Table.Summary.Cell> |
| 4599 | 4619 | ); |
| 4600 | 4620 | cells1.push(summaryCellTotal1); |
| 4601 | 4621 | tableColumn.forEach((item, index) => { |
| 4602 | - if(colSpan === 0 && index === 0) { | |
| 4622 | + if (colSpan === 0 && index === 0) { | |
| 4603 | 4623 | return; |
| 4604 | 4624 | } |
| 4605 | 4625 | let iTag = index + colSpan; |
| ... | ... | @@ -4690,15 +4710,15 @@ class CommonTableRc extends React.Component { |
| 4690 | 4710 | } else { |
| 4691 | 4711 | /* 如果设置格式 按照设置格式来,否则按照系统设定 */ |
| 4692 | 4712 | const sFieldConfigArr = config.gdsconfigformslave.filter(item => item.sName === sumItem.sName && item.bVisible); |
| 4693 | - if(commonUtils.isNotEmptyArr(sFieldConfigArr)) { | |
| 4713 | + if (commonUtils.isNotEmptyArr(sFieldConfigArr)) { | |
| 4694 | 4714 | const { sFieldValidation: sFieldValidationOld, sName } = sFieldConfigArr[0]; |
| 4695 | - if(commonUtils.isNotEmptyObject(sFieldValidationOld)) { | |
| 4715 | + if (commonUtils.isNotEmptyObject(sFieldValidationOld)) { | |
| 4696 | 4716 | const [length1, length2] = sFieldValidationOld.split(','); |
| 4697 | - if(commonUtils.isNotEmptyNumber(length2)) { | |
| 4717 | + if (commonUtils.isNotEmptyNumber(length2)) { | |
| 4698 | 4718 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 4699 | 4719 | commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(length2)); |
| 4700 | 4720 | } |
| 4701 | - }else { | |
| 4721 | + } else { | |
| 4702 | 4722 | tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + |
| 4703 | 4723 | commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); |
| 4704 | 4724 | } |
| ... | ... | @@ -4727,11 +4747,11 @@ class CommonTableRc extends React.Component { |
| 4727 | 4747 | const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== '' && item.bVisible && item.bSum); |
| 4728 | 4748 | if (commonUtils.isNotEmptyArr(sumConfig)) { |
| 4729 | 4749 | if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource)) { |
| 4730 | - const { selectedRowKeys } =this.state; | |
| 4750 | + const { selectedRowKeys } = this.state; | |
| 4731 | 4751 | /* 生产排程对选中行进行汇总 */ |
| 4732 | - if(commonUtils.isNotEmptyArr(selectedRowKeys)) { | |
| 4752 | + if (commonUtils.isNotEmptyArr(selectedRowKeys)) { | |
| 4733 | 4753 | const selectedData = dataSource.filter(item => selectedRowKeys.includes(item.sSlaveId)); |
| 4734 | - if(commonUtils.isNotEmptyArr(selectedData)) { | |
| 4754 | + if (commonUtils.isNotEmptyArr(selectedData)) { | |
| 4735 | 4755 | selectedData.forEach((tableDataRow) => { |
| 4736 | 4756 | sumConfig.forEach((sumItem) => { |
| 4737 | 4757 | if (tableDataRow.handleType !== 'del') { |
| ... | ... | @@ -4776,10 +4796,10 @@ class CommonTableRc extends React.Component { |
| 4776 | 4796 | |
| 4777 | 4797 | handleSumChildColumn = (config, dataSource) => { |
| 4778 | 4798 | const tableDataTotal = {}; |
| 4779 | - const { filteredValue } =this.state; | |
| 4799 | + const { filteredValue } = this.state; | |
| 4780 | 4800 | const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== '' && item.bVisible && item.bSum); |
| 4781 | 4801 | if (commonUtils.isNotEmptyArr(sumConfig)) { |
| 4782 | - if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource) && commonUtils.isNotEmptyArr(filteredValue)) { | |
| 4802 | + if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource) && commonUtils.isNotEmptyArr(filteredValue)) { | |
| 4783 | 4803 | /* 序号根据sSqlConditonId分组 序号重排 */ |
| 4784 | 4804 | const groupedData = commonUtils.groupBy(dataSource, item => item.sSqlConditionId); |
| 4785 | 4805 | let selectedData = []; |
| ... | ... | @@ -4789,14 +4809,14 @@ class CommonTableRc extends React.Component { |
| 4789 | 4809 | if (commonUtils.isNotEmptyArr(eachData)) { |
| 4790 | 4810 | /* 看当前选中在哪个组里 */ |
| 4791 | 4811 | const iIndex = eachData.findIndex(item => filteredValue.includes(item.sSqlConditionId)); |
| 4792 | - if(iIndex > -1){ | |
| 4812 | + if (iIndex > -1) { | |
| 4793 | 4813 | selectedData = eachData; |
| 4794 | 4814 | } |
| 4795 | 4815 | } |
| 4796 | 4816 | } |
| 4797 | 4817 | } |
| 4798 | 4818 | |
| 4799 | - if(commonUtils.isNotEmptyArr(selectedData)) { | |
| 4819 | + if (commonUtils.isNotEmptyArr(selectedData)) { | |
| 4800 | 4820 | selectedData.forEach((tableDataRow) => { |
| 4801 | 4821 | sumConfig.forEach((sumItem) => { |
| 4802 | 4822 | if (tableDataRow.handleType !== 'del') { |
| ... | ... | @@ -4825,7 +4845,7 @@ class CommonTableRc extends React.Component { |
| 4825 | 4845 | } |
| 4826 | 4846 | // 表格按钮点击后调用指令集 |
| 4827 | 4847 | handleInstruct = (btnName, callback) => { |
| 4828 | - const { sInstruct:sInstructStr } = this.props.config; | |
| 4848 | + const { sInstruct: sInstructStr } = this.props.config; | |
| 4829 | 4849 | const sInstruct = commonUtils.convertStrToObj(sInstructStr, {}); |
| 4830 | 4850 | const { data = [] } = sInstruct; |
| 4831 | 4851 | |
| ... | ... | @@ -4871,19 +4891,19 @@ class CommonTableRc extends React.Component { |
| 4871 | 4891 | if (commonUtils.isNotEmptyObject(this.props.tableProps.chooseProcessConfigRow)) { |
| 4872 | 4892 | this.handleInstruct('BtnChooseProcess', () => { |
| 4873 | 4893 | const iIndex = this.props.tableProps.chooseProcessConfigRow; |
| 4874 | - if(this.props.name === 'slave0Child1') { | |
| 4875 | - const { name } = this.props; | |
| 4876 | - let btnPupopConfig = this.props.tableProps.chooseProcessConfigRow; | |
| 4877 | - this.setState({ | |
| 4878 | - commonPopupVisible: true, | |
| 4879 | - commonPopupTbName: name, | |
| 4880 | - commonPopupShowConfig: btnPupopConfig, | |
| 4881 | - commonPopupRecord: record, | |
| 4882 | - }); | |
| 4883 | - | |
| 4884 | - } else { | |
| 4885 | - this.props.onBtnChoose('process', 'BtnChooseProcess', iIndex); | |
| 4886 | - } | |
| 4894 | + if (this.props.name === 'slave0Child1') { | |
| 4895 | + const { name } = this.props; | |
| 4896 | + let btnPupopConfig = this.props.tableProps.chooseProcessConfigRow; | |
| 4897 | + this.setState({ | |
| 4898 | + commonPopupVisible: true, | |
| 4899 | + commonPopupTbName: name, | |
| 4900 | + commonPopupShowConfig: btnPupopConfig, | |
| 4901 | + commonPopupRecord: record, | |
| 4902 | + }); | |
| 4903 | + | |
| 4904 | + } else { | |
| 4905 | + this.props.onBtnChoose('process', 'BtnChooseProcess', iIndex); | |
| 4906 | + } | |
| 4887 | 4907 | }); |
| 4888 | 4908 | } |
| 4889 | 4909 | }; |
| ... | ... | @@ -4910,7 +4930,7 @@ class CommonTableRc extends React.Component { |
| 4910 | 4930 | handleAddRow = (index, bModalAdd) => { |
| 4911 | 4931 | this.stopRowClick = true; |
| 4912 | 4932 | /* 多表树形删除 */ |
| 4913 | - if(this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 4933 | + if (this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 4914 | 4934 | this.handleAddInfoRow(index); |
| 4915 | 4935 | return; |
| 4916 | 4936 | } |
| ... | ... | @@ -4961,10 +4981,10 @@ class CommonTableRc extends React.Component { |
| 4961 | 4981 | }, 0) |
| 4962 | 4982 | }; |
| 4963 | 4983 | handleTreeDel = (index, record) => { |
| 4964 | - if(this.props.name === 'control') { | |
| 4965 | - const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'SureDel') : '确认要删除吗?' ; | |
| 4966 | - const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?' ; | |
| 4967 | - const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?' ; | |
| 4984 | + if (this.props.name === 'control') { | |
| 4985 | + const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'SureDel') : '确认要删除吗?'; | |
| 4986 | + const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?'; | |
| 4987 | + const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?'; | |
| 4968 | 4988 | const _this = this; |
| 4969 | 4989 | confirm({ |
| 4970 | 4990 | title: sureDel, |
| ... | ... | @@ -4988,7 +5008,7 @@ class CommonTableRc extends React.Component { |
| 4988 | 5008 | this.props.onTreeDel(this.props.name, true, ''); |
| 4989 | 5009 | } |
| 4990 | 5010 | }); |
| 4991 | - },0); | |
| 5011 | + }, 0); | |
| 4992 | 5012 | }; |
| 4993 | 5013 | /** 复制 */ |
| 4994 | 5014 | handleCopyRow = (index) => { |
| ... | ... | @@ -4998,7 +5018,7 @@ class CommonTableRc extends React.Component { |
| 4998 | 5018 | this.props.onCopyRow(this.props.name, undefined, undefined, index); |
| 4999 | 5019 | } |
| 5000 | 5020 | }); |
| 5001 | - },0) | |
| 5021 | + }, 0) | |
| 5002 | 5022 | }; |
| 5003 | 5023 | /** 复制全部 */ |
| 5004 | 5024 | handleCopyAllRow = () => { |
| ... | ... | @@ -5012,10 +5032,10 @@ class CommonTableRc extends React.Component { |
| 5012 | 5032 | }; |
| 5013 | 5033 | /** 删除行 */ |
| 5014 | 5034 | handleDelRow = (index, record) => { |
| 5015 | - if(this.props.name !== 'slaveFilter') { | |
| 5016 | - const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'SureDel') : '确认要删除吗?' ; | |
| 5017 | - const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?' ; | |
| 5018 | - const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?' ; | |
| 5035 | + if (this.props.name !== 'slaveFilter') { | |
| 5036 | + const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'SureDel') : '确认要删除吗?'; | |
| 5037 | + const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?'; | |
| 5038 | + const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?'; | |
| 5019 | 5039 | const _this = this; |
| 5020 | 5040 | confirm({ |
| 5021 | 5041 | title: sureDel, |
| ... | ... | @@ -5036,13 +5056,13 @@ class CommonTableRc extends React.Component { |
| 5036 | 5056 | /** 删除行 */ |
| 5037 | 5057 | handleDelOkRow = (index, record) => { |
| 5038 | 5058 | const tableSelectedRowKeys = []; |
| 5039 | - if(this.props?.formId === '12710101117043535363530') { | |
| 5059 | + if (this.props?.formId === '12710101117043535363530') { | |
| 5040 | 5060 | tableSelectedRowKeys.push(record[this.rowKey]); |
| 5041 | 5061 | } else { |
| 5042 | 5062 | tableSelectedRowKeys.push(record.sId); |
| 5043 | 5063 | } |
| 5044 | 5064 | /* 多表树形删除 */ |
| 5045 | - if(this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 5065 | + if (this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 5046 | 5066 | this.handleDelInfoRow(index, record); |
| 5047 | 5067 | return; |
| 5048 | 5068 | } |
| ... | ... | @@ -5074,7 +5094,7 @@ class CommonTableRc extends React.Component { |
| 5074 | 5094 | |
| 5075 | 5095 | /** 复制 */ |
| 5076 | 5096 | handleCopyMoreRow = (index) => { |
| 5077 | - this.setState({ bOperateMoreVisible : true}); | |
| 5097 | + this.setState({ bOperateMoreVisible: true }); | |
| 5078 | 5098 | }; |
| 5079 | 5099 | |
| 5080 | 5100 | /** 提取数据 */ |
| ... | ... | @@ -5098,24 +5118,24 @@ class CommonTableRc extends React.Component { |
| 5098 | 5118 | let btnPupopConfig = {}; |
| 5099 | 5119 | if (commonUtils.isNotEmptyArr(config) && commonUtils.isNotEmptyArr(config.gdsconfigformslave)) { |
| 5100 | 5120 | let controlConfig = config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup'))); |
| 5101 | - if(btnName && typeof btnName === 'string') { | |
| 5102 | - controlConfig = config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName === btnName); | |
| 5121 | + if (btnName && typeof btnName === 'string') { | |
| 5122 | + controlConfig = config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName === btnName); | |
| 5103 | 5123 | } |
| 5104 | 5124 | if (commonUtils.isNotEmptyArr(controlConfig)) { |
| 5105 | 5125 | if (controlConfig[0].bVisible && controlConfig[0].sDropDownType === 'popup') { |
| 5106 | 5126 | btnPupopConfig = controlConfig[0]; |
| 5107 | 5127 | const conditionValue = this.props.getSqlCondition(btnPupopConfig); |
| 5108 | - if(commonUtils.isNotEmptyObject(conditionValue)) { | |
| 5109 | - if(commonUtils.isNotEmptyObject(conditionValue.warning)) { | |
| 5128 | + if (commonUtils.isNotEmptyObject(conditionValue)) { | |
| 5129 | + if (commonUtils.isNotEmptyObject(conditionValue.warning)) { | |
| 5110 | 5130 | message.warn(conditionValue.warning); |
| 5111 | 5131 | return; |
| 5112 | 5132 | } |
| 5113 | 5133 | } |
| 5114 | 5134 | this.setState({ |
| 5115 | - commonPopupVisible:true, | |
| 5116 | - commonPopupTbName:name, | |
| 5117 | - commonPopupShowConfig:btnPupopConfig, | |
| 5118 | - commonPopupRecord:record, | |
| 5135 | + commonPopupVisible: true, | |
| 5136 | + commonPopupTbName: name, | |
| 5137 | + commonPopupShowConfig: btnPupopConfig, | |
| 5138 | + commonPopupRecord: record, | |
| 5119 | 5139 | }); |
| 5120 | 5140 | } |
| 5121 | 5141 | } |
| ... | ... | @@ -5223,7 +5243,7 @@ class CommonTableRc extends React.Component { |
| 5223 | 5243 | /* 查询控件名是否存在 */ |
| 5224 | 5244 | if (commonUtils.isNotEmptyArr(props.config) && commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr(controlName)) { |
| 5225 | 5245 | const controlConfig = props.config.gdsconfigformslave.filter(item => item.sControlName === controlName); |
| 5226 | - ret = commonUtils.isEmptyArr(controlConfig) ? ( propsIcon ? true : false ) : commonUtils.converStrToBoolean(controlConfig[0].bVisible); | |
| 5246 | + ret = commonUtils.isEmptyArr(controlConfig) ? (propsIcon ? true : false) : commonUtils.converStrToBoolean(controlConfig[0].bVisible); | |
| 5227 | 5247 | } |
| 5228 | 5248 | /* 返回值 */ |
| 5229 | 5249 | return ret; |
| ... | ... | @@ -5239,7 +5259,7 @@ class CommonTableRc extends React.Component { |
| 5239 | 5259 | if (commonUtils.isNotEmptyArr(props.config) && commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr(controlName)) { |
| 5240 | 5260 | const controlConfig = props.config.gdsconfigformslave.filter(item => item.sControlName === controlName); |
| 5241 | 5261 | ret = commonUtils.isNotEmptyArr(controlConfig) && commonUtils.converStrToBoolean(controlConfig[0].iTag === 3); |
| 5242 | - if(ret && controlName === 'BtnUpload' && Array.isArray(controlConfig)) { | |
| 5262 | + if (ret && controlName === 'BtnUpload' && Array.isArray(controlConfig)) { | |
| 5243 | 5263 | this.BtnUploadDivPropsAttr.current = controlConfig[0]; |
| 5244 | 5264 | } |
| 5245 | 5265 | } |
| ... | ... | @@ -5283,41 +5303,41 @@ class CommonTableRc extends React.Component { |
| 5283 | 5303 | <> |
| 5284 | 5304 | {res} |
| 5285 | 5305 | <Button |
| 5286 | - type="link" | |
| 5287 | - icon={<CaretUpOutlined style={{ fontSize: 16 }} />} | |
| 5288 | - size="large" | |
| 5289 | - style={{ | |
| 5290 | - position: "absolute", | |
| 5291 | - display: "flex", | |
| 5292 | - alignItems: "center", | |
| 5293 | - justifyContent: "center", | |
| 5294 | - top: 0, | |
| 5295 | - right: 0, | |
| 5296 | - height: 15 | |
| 5297 | - }} | |
| 5298 | - onClick={this.props.onMoveLine.bind(this, { | |
| 5299 | - index, | |
| 5300 | - direction: "up" | |
| 5301 | - })} | |
| 5302 | - /> | |
| 5303 | - <Button | |
| 5304 | - type="link" | |
| 5305 | - icon={<CaretDownOutlined style={{ fontSize: 16 }} />} | |
| 5306 | - size="large" | |
| 5307 | - style={{ | |
| 5308 | - position: "absolute", | |
| 5309 | - display: "flex", | |
| 5310 | - alignItems: "center", | |
| 5311 | - justifyContent: "center", | |
| 5312 | - bottom: 0, | |
| 5313 | - right: 0, | |
| 5314 | - height: 15 | |
| 5315 | - }} | |
| 5316 | - onClick={this.props.onMoveLine.bind(this, { | |
| 5317 | - index, | |
| 5318 | - direction: "down" | |
| 5319 | - })} | |
| 5320 | - /> | |
| 5306 | + type="link" | |
| 5307 | + icon={<CaretUpOutlined style={{ fontSize: 16 }} />} | |
| 5308 | + size="large" | |
| 5309 | + style={{ | |
| 5310 | + position: "absolute", | |
| 5311 | + display: "flex", | |
| 5312 | + alignItems: "center", | |
| 5313 | + justifyContent: "center", | |
| 5314 | + top: 0, | |
| 5315 | + right: 0, | |
| 5316 | + height: 15 | |
| 5317 | + }} | |
| 5318 | + onClick={this.props.onMoveLine.bind(this, { | |
| 5319 | + index, | |
| 5320 | + direction: "up" | |
| 5321 | + })} | |
| 5322 | + /> | |
| 5323 | + <Button | |
| 5324 | + type="link" | |
| 5325 | + icon={<CaretDownOutlined style={{ fontSize: 16 }} />} | |
| 5326 | + size="large" | |
| 5327 | + style={{ | |
| 5328 | + position: "absolute", | |
| 5329 | + display: "flex", | |
| 5330 | + alignItems: "center", | |
| 5331 | + justifyContent: "center", | |
| 5332 | + bottom: 0, | |
| 5333 | + right: 0, | |
| 5334 | + height: 15 | |
| 5335 | + }} | |
| 5336 | + onClick={this.props.onMoveLine.bind(this, { | |
| 5337 | + index, | |
| 5338 | + direction: "down" | |
| 5339 | + })} | |
| 5340 | + /> | |
| 5321 | 5341 | </>); |
| 5322 | 5342 | } else { |
| 5323 | 5343 | return res; |
| ... | ... | @@ -5338,7 +5358,7 @@ class CommonTableRc extends React.Component { |
| 5338 | 5358 | return ''; |
| 5339 | 5359 | } |
| 5340 | 5360 | const showConfigObj = this.getShowConfig(props, sName, isSlaveInfo); |
| 5341 | - const { dNetMoney, dNetPrice } = props.app.decimals; | |
| 5361 | + const { dNetMoney, dNetPrice } = props.app.decimals; | |
| 5342 | 5362 | let bShow = ''; |
| 5343 | 5363 | /* 如果是布尔类型 ,加checkbox */ |
| 5344 | 5364 | if (commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') { |
| ... | ... | @@ -5358,7 +5378,7 @@ class CommonTableRc extends React.Component { |
| 5358 | 5378 | const officeFileTypeList = ['PDF', 'DOCX', 'XLSX', 'MP4', 'WEBM', 'OGG']; |
| 5359 | 5379 | const imgTypeList = ['PNG', 'SVG', 'JPG', 'JPEG', 'GIF', 'BMP', 'TIFF', 'ICO']; |
| 5360 | 5380 | const officeFileType = picAddr[0].split('.').pop().toUpperCase(); |
| 5361 | - let fileIcon = <FilePdfOutlined/>; | |
| 5381 | + let fileIcon = <FilePdfOutlined />; | |
| 5362 | 5382 | if (officeFileType === 'DOCX') { |
| 5363 | 5383 | fileIcon = <FileWordOutlined />; |
| 5364 | 5384 | } else if (officeFileType === 'XLSX') { |
| ... | ... | @@ -5370,11 +5390,11 @@ class CommonTableRc extends React.Component { |
| 5370 | 5390 | imgBox = <span |
| 5371 | 5391 | style={{ cursor: 'pointer' }} |
| 5372 | 5392 | onClick={() => { |
| 5373 | - this.setState({ | |
| 5374 | - officePreviewVisible: true, | |
| 5375 | - officeFileUrl: picAddr[0] | |
| 5376 | - }) | |
| 5377 | - }}>{fileIcon}</span> | |
| 5393 | + this.setState({ | |
| 5394 | + officePreviewVisible: true, | |
| 5395 | + officeFileUrl: picAddr[0] | |
| 5396 | + }) | |
| 5397 | + }}>{fileIcon}</span> | |
| 5378 | 5398 | } else if (imgTypeList.includes(officeFileType)) { |
| 5379 | 5399 | imgBox = <span style={{ cursor: 'pointer' }}> <img src={dataUrl} alt="img" onFocus={() => 0} onClick={e => this.handlePreviewImage(e, picAddr)} style={{ width: '30px', height: '20px' }} /></span>; |
| 5380 | 5400 | } else { |
| ... | ... | @@ -5383,13 +5403,13 @@ class CommonTableRc extends React.Component { |
| 5383 | 5403 | } |
| 5384 | 5404 | } |
| 5385 | 5405 | /* 变量设置 显示字段名 */ |
| 5386 | - let specialTitle =''; | |
| 5406 | + let specialTitle = ''; | |
| 5387 | 5407 | let bSpecialTitle = false; |
| 5388 | - if(sName!=='' && sName.includes('sValue')){ | |
| 5389 | - specialTitle =`R${idx}_${sName}`; | |
| 5390 | - }else if(location.pathname?.includes('production') && (sName === 'sStateName' || sName==='sProcessState')) { | |
| 5391 | - if(commonUtils.isNotEmptyObject(record?.sState) || commonUtils.isNotEmptyObject(record?.sStateName)) { | |
| 5392 | - specialTitle = commonUtils.isNotEmptyObject(record.sWorkOrderChangeMemo)? record.sWorkOrderChangeMemo : ''; | |
| 5408 | + if (sName !== '' && sName.includes('sValue')) { | |
| 5409 | + specialTitle = `R${idx}_${sName}`; | |
| 5410 | + } else if (location.pathname?.includes('production') && (sName === 'sStateName' || sName === 'sProcessState')) { | |
| 5411 | + if (commonUtils.isNotEmptyObject(record?.sState) || commonUtils.isNotEmptyObject(record?.sStateName)) { | |
| 5412 | + specialTitle = commonUtils.isNotEmptyObject(record.sWorkOrderChangeMemo) ? record.sWorkOrderChangeMemo : ''; | |
| 5393 | 5413 | bSpecialTitle = true; |
| 5394 | 5414 | } |
| 5395 | 5415 | } |
| ... | ... | @@ -5449,27 +5469,27 @@ class CommonTableRc extends React.Component { |
| 5449 | 5469 | /* 取小数点位数 */ |
| 5450 | 5470 | let point = 0; |
| 5451 | 5471 | let strIndex = sDateFormat.indexOf('.'); |
| 5452 | - if(strIndex > -1 && sDateFormat.length > 1) { | |
| 5472 | + if (strIndex > -1 && sDateFormat.length > 1) { | |
| 5453 | 5473 | point = sDateFormat.substring(strIndex + 1, sDateFormat.length).length; |
| 5454 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5474 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5455 | 5475 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 5456 | - if(!isNaN(dConfigResult)) { | |
| 5476 | + if (!isNaN(dConfigResult)) { | |
| 5457 | 5477 | sValue = dConfigResult; |
| 5458 | 5478 | } |
| 5459 | 5479 | } |
| 5460 | 5480 | } |
| 5461 | 5481 | } else { |
| 5462 | 5482 | if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('price')) { /* 列表单价格式化显示 */ |
| 5463 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5483 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5464 | 5484 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice).toFixed(dNetPrice); |
| 5465 | - if(!isNaN(dResult)) { | |
| 5485 | + if (!isNaN(dResult)) { | |
| 5466 | 5486 | sValue = dResult; |
| 5467 | 5487 | } |
| 5468 | 5488 | } |
| 5469 | 5489 | } else if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ |
| 5470 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5490 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5471 | 5491 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney).toFixed(dNetMoney); |
| 5472 | - if(!isNaN(dResult)) { | |
| 5492 | + if (!isNaN(dResult)) { | |
| 5473 | 5493 | sValue = dResult; |
| 5474 | 5494 | } |
| 5475 | 5495 | } |
| ... | ... | @@ -5478,9 +5498,9 @@ class CommonTableRc extends React.Component { |
| 5478 | 5498 | } |
| 5479 | 5499 | |
| 5480 | 5500 | /* 如果列表行包含sDivRow并且sDivRow有值 则代表该行行不渲染数据 只做分割作用 */ |
| 5481 | - if(commonUtils.isNotEmptyObject(record.sDivRow) && record.bInsert) { | |
| 5501 | + if (commonUtils.isNotEmptyObject(record.sDivRow) && record.bInsert) { | |
| 5482 | 5502 | bShow = ''; |
| 5483 | - if(sName !=='sDivRow') { | |
| 5503 | + if (sName !== 'sDivRow') { | |
| 5484 | 5504 | sValue = ''; |
| 5485 | 5505 | } |
| 5486 | 5506 | } |
| ... | ... | @@ -5506,32 +5526,32 @@ class CommonTableRc extends React.Component { |
| 5506 | 5526 | } |
| 5507 | 5527 | } |
| 5508 | 5528 | |
| 5509 | - if (cellColor && sName !=='sState') { | |
| 5529 | + if (cellColor && sName !== 'sState') { | |
| 5510 | 5530 | res = (<div |
| 5511 | 5531 | className='listDiv' |
| 5512 | 5532 | style={{ |
| 5513 | - position: 'absolute', width:'100%', left: 0, top:0, bottom:0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', textAlign:`${displayAlign}`, backgroundColor: `${backgroundColor}`, color: `${cellColor}` | |
| 5533 | + position: 'absolute', width: '100%', left: 0, top: 0, bottom: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', textAlign: `${displayAlign}`, backgroundColor: `${backgroundColor}`, color: `${cellColor}` | |
| 5514 | 5534 | }} |
| 5515 | 5535 | > |
| 5516 | 5536 | {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') || (imgBox !== '') ? '' : |
| 5517 | 5537 | <div |
| 5518 | 5538 | className={linkStyle} |
| 5519 | 5539 | title={sValue} |
| 5520 | - style={{ padding: '4px', paddingTop:'6px', backgroundColor: `${backgroundColor}`, color: `${cellColor}`, width: '100%', height: '100%' }} | |
| 5540 | + style={{ padding: '4px', paddingTop: '6px', backgroundColor: `${backgroundColor}`, color: `${cellColor}`, width: '100%', height: '100%' }} | |
| 5521 | 5541 | onKeyDown={e => this.onKeyDownDiv(e, sName)} |
| 5522 | 5542 | onCut={e => e.preventDefault()} |
| 5523 | 5543 | onPaste={e => e.preventDefault()} |
| 5524 | 5544 | suppressContentEditableWarning |
| 5525 | 5545 | contentEditable="true" |
| 5526 | 5546 | onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, isSlaveInfo ? 'slaveInfo' : this.props.name, showConfig.sName, record, index, showConfig) : null} |
| 5527 | - > { sValue}</div>} | |
| 5547 | + > {sValue}</div>} | |
| 5528 | 5548 | {bShow}{imgBox} |
| 5529 | 5549 | </div>); |
| 5530 | 5550 | } else { |
| 5531 | 5551 | res = (<div |
| 5532 | 5552 | className={`${styles.tdCell} listDiv`} |
| 5533 | 5553 | style={{ |
| 5534 | - position: 'relative', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', color: `${cellColor}`, backgroundColor: `${backgroundColor}`, textAlign:`${displayAlign}`, | |
| 5554 | + position: 'relative', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', color: `${cellColor}`, backgroundColor: `${backgroundColor}`, textAlign: `${displayAlign}`, | |
| 5535 | 5555 | }} |
| 5536 | 5556 | data-name={showConfig.sName} |
| 5537 | 5557 | data-control-name={showConfig.sControlName} |
| ... | ... | @@ -5546,25 +5566,25 @@ class CommonTableRc extends React.Component { |
| 5546 | 5566 | > |
| 5547 | 5567 | <span |
| 5548 | 5568 | className={linkStyle} |
| 5549 | - style={{border: 'none', outline: 'none'}} | |
| 5569 | + style={{ border: 'none', outline: 'none' }} | |
| 5550 | 5570 | onKeyDown={e => this.onKeyDownDiv(e, sName)} |
| 5551 | 5571 | onCut={e => e.preventDefault()} |
| 5552 | 5572 | onPaste={e => e.preventDefault()} |
| 5553 | 5573 | suppressContentEditableWarning |
| 5554 | 5574 | contentEditable="true" |
| 5555 | 5575 | onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, isSlaveInfo ? 'slaveInfo' : this.props.name, showConfig.sName, record, index, showConfig) : null} |
| 5556 | - > {sValue}</span> | |
| 5576 | + > {sValue}</span> | |
| 5557 | 5577 | </Tooltip> |
| 5558 | 5578 | } |
| 5559 | - {bShow}{imgBox}{this.handleGetFastSearchBtn({record, sName, isSlaveInfo})} | |
| 5579 | + {bShow}{imgBox}{this.handleGetFastSearchBtn({ record, sName, isSlaveInfo })} | |
| 5560 | 5580 | </div>); |
| 5561 | 5581 | } |
| 5562 | 5582 | const cell = this.mergeTableCell(res, idx, sName, isSlaveInfo); |
| 5563 | 5583 | return cell; |
| 5564 | - } else if ( commonUtils.isNotEmptyObject(showConfigObj) && !showConfigObj.bReadonly && (props.enabled || showConfigObj.iTag === 3 ) | |
| 5584 | + } else if (commonUtils.isNotEmptyObject(showConfigObj) && !showConfigObj.bReadonly && (props.enabled || showConfigObj.iTag === 3) | |
| 5565 | 5585 | && commonUtils.isEmptyObject(record.sDivRowNew) && (commonUtils.isNotEmptyArr(props.selectedRowKeys) |
| 5566 | 5586 | && props.selectedRowKeys.toString().includes(record.sId) || props.name === 'sParam' |
| 5567 | - || ( props.name ==='slaveInfo' && commonUtils.isNotEmptyArr(props.selectedRowKeys) && props.selectedRowKeys.toString().includes(record.sSlaveId) && showConfigObj.iTag === 3 )) | |
| 5587 | + || (props.name === 'slaveInfo' && commonUtils.isNotEmptyArr(props.selectedRowKeys) && props.selectedRowKeys.toString().includes(record.sSlaveId) && showConfigObj.iTag === 3)) | |
| 5568 | 5588 | || (this.getShowTypeProps(props, text, record, sName)?.enabled && record.sId === this.state.currentHoverSid) |
| 5569 | 5589 | || (false && location.pathname.includes('productionScheduleTree') && this.getShowTypeProps(props, text, record, sName)?.enabled && record.sId === props.rowHoverSid) |
| 5570 | 5590 | || (props.rootType === 'list' && props.selectedRowKeys.toString().includes(record.sSlaveId))) { |
| ... | ... | @@ -5594,7 +5614,7 @@ class CommonTableRc extends React.Component { |
| 5594 | 5614 | let backgroundColor = ''; |
| 5595 | 5615 | if (commonUtils.isNotEmptyArr(showConfig)) { |
| 5596 | 5616 | const cellStyle = this.getCellColorConfig(text, record, sName); |
| 5597 | - if (commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotal) || commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotalB) ) { | |
| 5617 | + if (commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotal) || commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotalB)) { | |
| 5598 | 5618 | cellColor = cellStyle.styleColorArrTotal; |
| 5599 | 5619 | backgroundColor = cellStyle.styleColorArrTotalB; |
| 5600 | 5620 | } |
| ... | ... | @@ -5619,27 +5639,27 @@ class CommonTableRc extends React.Component { |
| 5619 | 5639 | /* 取小数点位数 */ |
| 5620 | 5640 | let point = 0; |
| 5621 | 5641 | let strIndex = sDateFormat.indexOf('.'); |
| 5622 | - if(strIndex > -1 && sDateFormat.length > 1) { | |
| 5642 | + if (strIndex > -1 && sDateFormat.length > 1) { | |
| 5623 | 5643 | point = sDateFormat.substring(strIndex + 1, sDateFormat.length).length; |
| 5624 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5644 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5625 | 5645 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 5626 | - if(!isNaN(dConfigResult)) { | |
| 5646 | + if (!isNaN(dConfigResult)) { | |
| 5627 | 5647 | sValue = dConfigResult; |
| 5628 | 5648 | } |
| 5629 | 5649 | } |
| 5630 | 5650 | } |
| 5631 | 5651 | } else { |
| 5632 | 5652 | if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('price')) { /* 列表单价格式化显示 */ |
| 5633 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5653 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5634 | 5654 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice).toFixed(dNetPrice); |
| 5635 | - if(!isNaN(dResult)) { | |
| 5655 | + if (!isNaN(dResult)) { | |
| 5636 | 5656 | sValue = dResult; |
| 5637 | 5657 | } |
| 5638 | 5658 | } |
| 5639 | 5659 | } else if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ |
| 5640 | - if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5660 | + if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5641 | 5661 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney).toFixed(dNetMoney); |
| 5642 | - if(!isNaN(dResult)) { | |
| 5662 | + if (!isNaN(dResult)) { | |
| 5643 | 5663 | sValue = dResult; |
| 5644 | 5664 | } |
| 5645 | 5665 | } |
| ... | ... | @@ -5656,7 +5676,7 @@ class CommonTableRc extends React.Component { |
| 5656 | 5676 | if (typeof showConfig.showDropDown === 'object') { |
| 5657 | 5677 | showDropDown = showConfig.showDropDown; |
| 5658 | 5678 | } else { |
| 5659 | - if(commonUtils.isJSON(showConfig.showDropDown)) { | |
| 5679 | + if (commonUtils.isJSON(showConfig.showDropDown)) { | |
| 5660 | 5680 | showDropDown = commonUtils.objectToArr(commonUtils.convertStrToObj(showConfig.showDropDown)); |
| 5661 | 5681 | } |
| 5662 | 5682 | } |
| ... | ... | @@ -5669,11 +5689,11 @@ class CommonTableRc extends React.Component { |
| 5669 | 5689 | let clickEvent = ''; |
| 5670 | 5690 | /* 选择合版产品弹窗 */ |
| 5671 | 5691 | const sModelsType = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? props.app.currentPane.sModelsType : ''; |
| 5672 | - const combinedInfo = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'CombinedInfo') : '合版信息' ; | |
| 5692 | + const combinedInfo = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'CombinedInfo') : '合版信息'; | |
| 5673 | 5693 | |
| 5674 | - const pleaseSelect = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'pleaseSelect') : '请选择' ; | |
| 5694 | + const pleaseSelect = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'pleaseSelect') : '请选择'; | |
| 5675 | 5695 | |
| 5676 | - if (commonUtils.isNotEmptyObject(sName) && ( sName === 'sCombinedMemo' || sName ==='sCombineProductNameNew' || sName === 'sColorSerialMemo' || sName === 'sPositiveColor' || sName === 'sOppositeColor' || sName === 'sParams' || sName === 'sParamsNew'|| sName === 'sQuoParams' || (commonUtils.isNotEmptyObject(sModelsType) && !sModelsType.includes('Set') && sName === 'sCombinePartsNameNew'))) { | |
| 5696 | + if (commonUtils.isNotEmptyObject(sName) && (sName === 'sCombinedMemo' || sName === 'sCombineProductNameNew' || sName === 'sColorSerialMemo' || sName === 'sPositiveColor' || sName === 'sOppositeColor' || sName === 'sParams' || sName === 'sParamsNew' || sName === 'sQuoParams' || (commonUtils.isNotEmptyObject(sModelsType) && !sModelsType.includes('Set') && sName === 'sCombinePartsNameNew'))) { | |
| 5677 | 5697 | linkStyle = 'linksActiveIdStyle'; |
| 5678 | 5698 | clickEvent = 'onViewChoose'; |
| 5679 | 5699 | if (sName === 'sCombinedMemo') { |
| ... | ... | @@ -5716,7 +5736,7 @@ class CommonTableRc extends React.Component { |
| 5716 | 5736 | sMemo = commonUtils.isNotEmptyObject(sMemo) ? sMemo.substr(0, sMemo.length - 1) : ''; |
| 5717 | 5737 | sValue = sMemo; |
| 5718 | 5738 | } |
| 5719 | - } else if (sName === 'sParams' || sName === 'sQuoParams' || sName === 'sParamsNew' ) { | |
| 5739 | + } else if (sName === 'sParams' || sName === 'sQuoParams' || sName === 'sParamsNew') { | |
| 5720 | 5740 | if (props.onGetParamsValue) { |
| 5721 | 5741 | // 页面自行处理sparams的sValue |
| 5722 | 5742 | sValue = props.onGetParamsValue({ sName, sValue, record }); |
| ... | ... | @@ -5737,7 +5757,7 @@ class CommonTableRc extends React.Component { |
| 5737 | 5757 | let sParamStr = ''; |
| 5738 | 5758 | if (commonUtils.isNotEmptyArr(JsonData)) { |
| 5739 | 5759 | JsonData.forEach((item) => { |
| 5740 | - if(item.bSelfCbx) { | |
| 5760 | + if (item.bSelfCbx) { | |
| 5741 | 5761 | const strValue = commonUtils.isNotEmptyObject(item.sParamValue) ? item.sParamValue : ''; |
| 5742 | 5762 | sParamStr += `${item.sParamName}:${strValue},`; |
| 5743 | 5763 | } |
| ... | ... | @@ -5750,13 +5770,13 @@ class CommonTableRc extends React.Component { |
| 5750 | 5770 | } |
| 5751 | 5771 | } |
| 5752 | 5772 | sValue = commonUtils.isEmpty(sValue) ? sName === 'sCombinedMemo' ? combinedInfo : pleaseSelect : sValue; |
| 5753 | - } else if ((!props.enabled) && sName.indexOf('Memo') > -1 && showConfigObj.iTag !== 3 ) { | |
| 5773 | + } else if ((!props.enabled) && sName.indexOf('Memo') > -1 && showConfigObj.iTag !== 3) { | |
| 5754 | 5774 | linkStyle = 'linksActiveIdStyle'; |
| 5755 | 5775 | clickEvent = 'onMemoShow'; |
| 5756 | 5776 | sValue = commonUtils.isEmpty(sValue) ? '' : sValue; |
| 5757 | 5777 | const regex = /<[^>]*>/g; |
| 5758 | 5778 | sValue = sValue.replace(regex, ''); |
| 5759 | - } else if ((!props.enabled) && showConfigObj.sControlName && showConfigObj.sControlName.toLowerCase().indexOf('memo') > -1 && showConfigObj.iTag !== 3 ) { | |
| 5779 | + } else if ((!props.enabled) && showConfigObj.sControlName && showConfigObj.sControlName.toLowerCase().indexOf('memo') > -1 && showConfigObj.iTag !== 3) { | |
| 5760 | 5780 | linkStyle = 'linksActiveIdStyle'; |
| 5761 | 5781 | clickEvent = 'onMemoShow'; |
| 5762 | 5782 | sValue = commonUtils.isEmpty(sValue) ? '' : sValue; |
| ... | ... | @@ -5767,43 +5787,43 @@ class CommonTableRc extends React.Component { |
| 5767 | 5787 | clickEvent = 'onOpenPopupModal'; |
| 5768 | 5788 | } |
| 5769 | 5789 | /* 如果列表行包含sDivRow并且sDivRow有值 则代表该行行不渲染数据 只做分割作用 */ |
| 5770 | - if(commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 5790 | + if (commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 5771 | 5791 | bShow = ''; |
| 5772 | 5792 | // linkStyle = 'linksActiveIdStyle'; |
| 5773 | - if(sValue) { | |
| 5793 | + if (sValue) { | |
| 5774 | 5794 | const splitArr = sValue ? sValue.toString().split('F') : []; |
| 5775 | - if(commonUtils.isNotEmptyArr(splitArr) && splitArr.length > 1) { | |
| 5795 | + if (commonUtils.isNotEmptyArr(splitArr) && splitArr.length > 1) { | |
| 5776 | 5796 | sValue = <span className="noInputInsert">{splitArr[0]} <span style={{ color: '#ff0000' }}> {splitArr[1]}</span> </span>; |
| 5777 | 5797 | } |
| 5778 | 5798 | } |
| 5779 | 5799 | } |
| 5780 | - let showQty=''; | |
| 5781 | - if(!this.props.enabled && location.pathname.includes('quotationPackTableTree') && this.props.name === 'control' && sName === 'dSinglePQty') { | |
| 5800 | + let showQty = ''; | |
| 5801 | + if (!this.props.enabled && location.pathname.includes('quotationPackTableTree') && this.props.name === 'control' && sName === 'dSinglePQty') { | |
| 5782 | 5802 | showQty = <span onClick={this.handleViewClick.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><EyeOutlined /></span> |
| 5783 | - } else if(sName === 'sSaveProName' || sName === 'sDeleteProName' || sName === 'sSaveProNameBefore' || sName === 'sProcName') { | |
| 5803 | + } else if (sName === 'sSaveProName' || sName === 'sDeleteProName' || sName === 'sSaveProNameBefore' || sName === 'sProcName') { | |
| 5784 | 5804 | /* 增删改存业务处理 加查看眼睛 */ |
| 5785 | - sValue =<span> {sValue}<span onClick={this.handleOpenWin.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><EyeOutlined /></span> </span> | |
| 5786 | - }else if(sName === 'dNeedAuxiliaryQty' && showConfig.sControlName && showConfig.sControlName !=='slaveInfo' ) { /* 净需求 */ | |
| 5805 | + sValue = <span> {sValue}<span onClick={this.handleOpenWin.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><EyeOutlined /></span> </span> | |
| 5806 | + } else if (sName === 'dNeedAuxiliaryQty' && showConfig.sControlName && showConfig.sControlName !== 'slaveInfo') { /* 净需求 */ | |
| 5787 | 5807 | /* 增删改存业务处理 加查看眼睛 */ |
| 5788 | - sValue =<span> {sValue}<span onClick={this.handleRightArrow.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><RightOutlined /></span> </span> | |
| 5808 | + sValue = <span> {sValue}<span onClick={this.handleRightArrow.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><RightOutlined /></span> </span> | |
| 5789 | 5809 | } |
| 5790 | 5810 | /* 只读字段置灰 */ |
| 5791 | 5811 | const isColorInclude = this.rowColorData.current?.find(i => i && i?.key === record?.[this.rowKey]); |
| 5792 | 5812 | let bReadonlyField = false; |
| 5793 | - if((showConfig.bReadonly || showConfig.iTag ===1) && commonUtils.isEmptyStr(backgroundColor) && !isColorInclude) { | |
| 5813 | + if ((showConfig.bReadonly || showConfig.iTag === 1) && commonUtils.isEmptyStr(backgroundColor) && !isColorInclude) { | |
| 5794 | 5814 | backgroundColor = '#f1f2f8'; |
| 5795 | 5815 | bReadonlyField = true; |
| 5796 | 5816 | } |
| 5797 | - if (backgroundColor && !this.props.slaveInfo) { | |
| 5817 | + if (backgroundColor && !this.props.slaveInfo) { | |
| 5798 | 5818 | this.hasSpanBgColor = true; |
| 5799 | 5819 | } |
| 5800 | 5820 | |
| 5801 | 5821 | res = (<span className={`noInput readonlySpanStyle ${bReadonlyField ? "readonlyField" : ""}`} style={{ color: `${cellColor}`, backgroundColor: `${backgroundColor}` }} > {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') || (imgBox !== '') ? '' : |
| 5802 | 5822 | <Tooltip |
| 5803 | - placement={ bSpecialTitle ? 'right' : 'bottomLeft'} | |
| 5804 | - overlayClassName={ bSpecialTitle ? 'commonSpecialTitle' : 'commonTitle'} | |
| 5823 | + placement={bSpecialTitle ? 'right' : 'bottomLeft'} | |
| 5824 | + overlayClassName={bSpecialTitle ? 'commonSpecialTitle' : 'commonTitle'} | |
| 5805 | 5825 | mouseEnterDelay={0.8} |
| 5806 | - title={<span style={{ fontSize: 16 }}>{commonUtils.isNotEmptyObject(specialTitle) ? specialTitle :sValue}</span>} | |
| 5826 | + title={<span style={{ fontSize: 16 }}>{commonUtils.isNotEmptyObject(specialTitle) ? specialTitle : sValue}</span>} | |
| 5807 | 5827 | > |
| 5808 | 5828 | <span |
| 5809 | 5829 | className={linkStyle} |
| ... | ... | @@ -5814,14 +5834,24 @@ class CommonTableRc extends React.Component { |
| 5814 | 5834 | commonUtils.isNotEmptyObject(linkStyle) |
| 5815 | 5835 | ? clickEvent === "onViewChoose" |
| 5816 | 5836 | ? this.handleViewChoose.bind( |
| 5837 | + this, | |
| 5838 | + this.props.name, | |
| 5839 | + showConfig.sName, | |
| 5840 | + record, | |
| 5841 | + index | |
| 5842 | + ) | |
| 5843 | + : clickEvent === "onMemoShow" | |
| 5844 | + ? this.handleMemoShow.bind( | |
| 5817 | 5845 | this, |
| 5818 | 5846 | this.props.name, |
| 5819 | 5847 | showConfig.sName, |
| 5820 | 5848 | record, |
| 5821 | - index | |
| 5849 | + index, | |
| 5850 | + showConfig | |
| 5822 | 5851 | ) |
| 5823 | - : clickEvent === "onMemoShow" | |
| 5824 | - ? this.handleMemoShow.bind( | |
| 5852 | + : clickEvent === "onOpenPopupModal" | |
| 5853 | + ? this.handleFieldPopupModal.bind(this, showConfig, sName, record) | |
| 5854 | + : this.handleViewClick.bind( | |
| 5825 | 5855 | this, |
| 5826 | 5856 | this.props.name, |
| 5827 | 5857 | showConfig.sName, |
| ... | ... | @@ -5829,19 +5859,9 @@ class CommonTableRc extends React.Component { |
| 5829 | 5859 | index, |
| 5830 | 5860 | showConfig |
| 5831 | 5861 | ) |
| 5832 | - : clickEvent === "onOpenPopupModal" | |
| 5833 | - ? this.handleFieldPopupModal.bind(this, showConfig, sName, record) | |
| 5834 | - : this.handleViewClick.bind( | |
| 5835 | - this, | |
| 5836 | - this.props.name, | |
| 5837 | - showConfig.sName, | |
| 5838 | - record, | |
| 5839 | - index, | |
| 5840 | - showConfig | |
| 5841 | - ) | |
| 5842 | 5862 | : null |
| 5843 | 5863 | } |
| 5844 | - > { sValue}</span> | |
| 5864 | + > {sValue}</span> | |
| 5845 | 5865 | </Tooltip> |
| 5846 | 5866 | }{bShow}{imgBox}{showQty}</span> |
| 5847 | 5867 | ); |
| ... | ... | @@ -6074,13 +6094,13 @@ class CommonTableRc extends React.Component { |
| 6074 | 6094 | const productionRoute = (commonUtils.isNotEmptyObject(props.app.currentPane) && commonUtils.isNotEmptyObject(props.app.currentPane.route) && props.app.currentPane.route.includes('productionSchedule')); |
| 6075 | 6095 | if (productionRoute) { /* 生产排程对选中行进行汇总 */ |
| 6076 | 6096 | this.handleSumOtherColumn(props.config, props.data); |
| 6077 | - } else if(rootType === 'list') { | |
| 6078 | - if(commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyArr(props.totalData)) { | |
| 6079 | - const addState ={}; | |
| 6097 | + } else if (rootType === 'list') { | |
| 6098 | + if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyArr(props.totalData)) { | |
| 6099 | + const addState = {}; | |
| 6080 | 6100 | addState.totalData = props.totalData; |
| 6081 | 6101 | this.setState({ ...addState }) |
| 6082 | 6102 | } |
| 6083 | - } else if(name ==='slaveChild'){ | |
| 6103 | + } else if (name === 'slaveChild') { | |
| 6084 | 6104 | this.handleSumChildColumn(props.config, props.data); |
| 6085 | 6105 | } else { |
| 6086 | 6106 | this.handleSumAllColumn(props.config, props.data); |
| ... | ... | @@ -6108,7 +6128,7 @@ class CommonTableRc extends React.Component { |
| 6108 | 6128 | if (stateValue.tableColumn[index].children && stateValue.tableColumn[index].children.length) { |
| 6109 | 6129 | const childrenSortArr = []; |
| 6110 | 6130 | const childrenDataIndexArr = []; |
| 6111 | - item.children = item.children.map(child => { return {...child, ...{ sortIndex: sortArr.indexOf(child.dataIndex) }}}).sort(compare('sortIndex')); | |
| 6131 | + item.children = item.children.map(child => { return { ...child, ...{ sortIndex: sortArr.indexOf(child.dataIndex) } } }).sort(compare('sortIndex')); | |
| 6112 | 6132 | item.children.forEach((child, childIndex) => { |
| 6113 | 6133 | const currentSort = sortArr.indexOf(child.dataIndex); |
| 6114 | 6134 | if (childIndex === 0) { |
| ... | ... | @@ -6144,7 +6164,7 @@ class CommonTableRc extends React.Component { |
| 6144 | 6164 | } |
| 6145 | 6165 | }); |
| 6146 | 6166 | stateValue.tableColumn = stateValue.tableColumn.filter(item => !item.delete); // 删除需要分割的双层表头 |
| 6147 | - stateValue.tableColumn = [ ...stateValue.tableColumn, ...addTableColumn ]; // 将分割后的双层表头加回去 | |
| 6167 | + stateValue.tableColumn = [...stateValue.tableColumn, ...addTableColumn]; // 将分割后的双层表头加回去 | |
| 6148 | 6168 | stateValue.tableColumn = stateValue.tableColumn.sort(compare('sortIndex')); |
| 6149 | 6169 | // 合并一级表头相同的相邻的column |
| 6150 | 6170 | stateValue.tableColumn = stateValue.tableColumn.reduce((prev, cur) => { |
| ... | ... | @@ -6197,7 +6217,7 @@ class CommonTableRc extends React.Component { |
| 6197 | 6217 | const footerHeight = commonUtils.isNotEmptyArr(this.state.totalData1) ? 58 : 29; |
| 6198 | 6218 | if (this.props.tableProps.AutoTableHeight) { |
| 6199 | 6219 | this.scrollY = this.props.tableProps.AutoTableHeight; |
| 6200 | - this.tableHeight = this.props.tableProps.AutoTableHeight == '100%' ? '100%' : this.props.tableProps.AutoTableHeight + tableHeaderHeight + footerHeight; | |
| 6220 | + this.tableHeight = this.props.tableProps.AutoTableHeight == '100%' ? '100%' : this.props.tableProps.AutoTableHeight + tableHeaderHeight + footerHeight; | |
| 6201 | 6221 | return; |
| 6202 | 6222 | } |
| 6203 | 6223 | |
| ... | ... | @@ -6221,19 +6241,19 @@ class CommonTableRc extends React.Component { |
| 6221 | 6241 | const tabHeight = 89; |
| 6222 | 6242 | const paginationHeight = this.props.tableProps.pagination ? 60 : 0; |
| 6223 | 6243 | let extraHeight = 0; /* 额外的区域 */ |
| 6224 | - if(commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes('commonListTab')) { /* 带Tab页签的列表 */ | |
| 6244 | + if (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes('commonListTab')) { /* 带Tab页签的列表 */ | |
| 6225 | 6245 | /* 有从表高度100,没有高度20 */ |
| 6226 | 6246 | const hasSlave = document.getElementsByClassName('hasSlave'); |
| 6227 | - if(commonUtils.isNotEmptyArr(hasSlave)) { | |
| 6228 | - extraHeight = 220; | |
| 6229 | - }else { | |
| 6230 | - extraHeight = 20; | |
| 6247 | + if (commonUtils.isNotEmptyArr(hasSlave)) { | |
| 6248 | + extraHeight = 220; | |
| 6249 | + } else { | |
| 6250 | + extraHeight = 20; | |
| 6231 | 6251 | } |
| 6232 | 6252 | } |
| 6233 | 6253 | |
| 6234 | 6254 | if (this.props?.masterConfig?.sTableColorTs) { |
| 6235 | 6255 | extraHeight += this.colorInfo?.getBoundingClientRect()?.height || 80; |
| 6236 | - if(location.pathname?.includes('productionScheduleTree')) { | |
| 6256 | + if (location.pathname?.includes('productionScheduleTree')) { | |
| 6237 | 6257 | extraHeight -= 34; |
| 6238 | 6258 | } |
| 6239 | 6259 | } else { |
| ... | ... | @@ -6563,7 +6583,7 @@ class CommonTableRc extends React.Component { |
| 6563 | 6583 | message.warning('请确认复制的内容是文件类型!'); |
| 6564 | 6584 | } |
| 6565 | 6585 | }; |
| 6566 | - handleGetFastSearchBtn = ({record, sName, isSlaveInfo}) => { | |
| 6586 | + handleGetFastSearchBtn = ({ record, sName, isSlaveInfo }) => { | |
| 6567 | 6587 | if (isSlaveInfo || !sName.startsWith('s') || this.props.name !== 'slave') { |
| 6568 | 6588 | return ''; |
| 6569 | 6589 | } |
| ... | ... | @@ -6705,9 +6725,9 @@ class CommonTableRc extends React.Component { |
| 6705 | 6725 | } |
| 6706 | 6726 | } |
| 6707 | 6727 | /* 拖拽改变对应层级 */ |
| 6708 | - moveRow = (dragIndex, hoverIndex,dragKey,hoverKey) => { | |
| 6709 | - if(this.props.onMoveRow) { | |
| 6710 | - this.props.onMoveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 6728 | + moveRow = (dragIndex, hoverIndex, dragKey, hoverKey) => { | |
| 6729 | + if (this.props.onMoveRow) { | |
| 6730 | + this.props.onMoveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 6711 | 6731 | } |
| 6712 | 6732 | }; |
| 6713 | 6733 | |
| ... | ... | @@ -6762,7 +6782,7 @@ class CommonTableRc extends React.Component { |
| 6762 | 6782 | if (commonUtils.isNotEmptyObject(previewImage)) { |
| 6763 | 6783 | if (commonUtils.isNotEmptyArr(this.props.data)) { |
| 6764 | 6784 | if (this.props.data[0].sPicturePath) { |
| 6765 | - for(const item of this.props.data) { | |
| 6785 | + for (const item of this.props.data) { | |
| 6766 | 6786 | const dataUrl = `${commonConfig.file_host}file/download?savePathStr=${item.sPicturePath}&sModelsId=100&token=${token}`; /* 缩略图 */ |
| 6767 | 6787 | data.push(dataUrl); |
| 6768 | 6788 | } |
| ... | ... | @@ -6779,7 +6799,7 @@ class CommonTableRc extends React.Component { |
| 6779 | 6799 | onChange: this.handleUploadChange, |
| 6780 | 6800 | accept: '*/*', |
| 6781 | 6801 | showUploadList: false, |
| 6782 | - multiple:true, | |
| 6802 | + multiple: true, | |
| 6783 | 6803 | beforeUpload: this.handleBeforeUpload, |
| 6784 | 6804 | }; |
| 6785 | 6805 | /* 获取look的props */ |
| ... | ... | @@ -6825,15 +6845,15 @@ class CommonTableRc extends React.Component { |
| 6825 | 6845 | const iIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup')) && item.bVisible && item.sDropDownType === 'popup'); |
| 6826 | 6846 | if (iIndex > -1) { |
| 6827 | 6847 | commonPopupConfig = config.gdsconfigformslave[iIndex]; |
| 6828 | - if(commonPopupShowConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo' || commonPopupShowConfig?.sControlName === 'BtnChooseProcess') { | |
| 6848 | + if (commonPopupShowConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo' || commonPopupShowConfig?.sControlName === 'BtnChooseProcess') { | |
| 6829 | 6849 | commonPopupConfig = commonPopupShowConfig; |
| 6830 | - if(commonPopupShowConfig?.sControlName === 'BtnChooseProcess') { | |
| 6850 | + if (commonPopupShowConfig?.sControlName === 'BtnChooseProcess') { | |
| 6831 | 6851 | bCommonPopupProcess = true; |
| 6832 | 6852 | } |
| 6833 | 6853 | } |
| 6834 | 6854 | commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupConfig) && commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName) ? commonPopupConfig.sActiveName : commonPopupTitle; |
| 6835 | - commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupRecord) ? ( commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sSrcFormName) ? commonPopupTitle : commonPopupRecord.sSrcFormName : commonPopupTitle ) : commonPopupTitle; | |
| 6836 | - const sFormId = commonUtils.isNotEmptyObject(commonPopupRecord) ? ( commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sFormId) ? commonPopupRecord.sSrcFormId : commonPopupRecord.sFormId : commonPopupConfig.sActiveId ) : commonPopupConfig.sActiveId; | |
| 6855 | + commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupRecord) ? (commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sSrcFormName) ? commonPopupTitle : commonPopupRecord.sSrcFormName : commonPopupTitle) : commonPopupTitle; | |
| 6856 | + const sFormId = commonUtils.isNotEmptyObject(commonPopupRecord) ? (commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sFormId) ? commonPopupRecord.sSrcFormId : commonPopupRecord.sFormId : commonPopupConfig.sActiveId) : commonPopupConfig.sActiveId; | |
| 6837 | 6857 | |
| 6838 | 6858 | commonPopupProps = { |
| 6839 | 6859 | app: { |
| ... | ... | @@ -6843,13 +6863,13 @@ class CommonTableRc extends React.Component { |
| 6843 | 6863 | bEdit: (commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.route) && app.currentPane.route.includes('commonBillDeliver')), |
| 6844 | 6864 | config: commonPopupConfig, |
| 6845 | 6865 | conditonValues: this.props.getSqlCondition(commonPopupConfig), |
| 6846 | - title:commonPopupTitle, | |
| 6866 | + title: commonPopupTitle, | |
| 6847 | 6867 | route: '/indexPage/commonList', |
| 6848 | 6868 | formRoute: '/indexPage/commonList', |
| 6849 | 6869 | formId: sFormId, |
| 6850 | 6870 | key: sModelsId + commonPopupConfig.sId, |
| 6851 | 6871 | sModelsType: bCommonPopupProcess ? 'search/commonProcess' : 'search/commonPopup', |
| 6852 | - select:this.handleSelectCommonPopup, | |
| 6872 | + select: this.handleSelectCommonPopup, | |
| 6853 | 6873 | selectCancel: this.handleSelectCancel.bind(this, 'commonPopupVisible'), |
| 6854 | 6874 | }, |
| 6855 | 6875 | }, |
| ... | ... | @@ -6863,13 +6883,13 @@ class CommonTableRc extends React.Component { |
| 6863 | 6883 | } |
| 6864 | 6884 | |
| 6865 | 6885 | /* 多列弹出窗 */ |
| 6866 | - const commonPopupIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup') ) && !['BtnPopup1'].includes(item.sControlName) && !item.sControlName.startsWith('BtnPopupEdit') && item.bVisible && item.sDropDownType === 'popup'); | |
| 6886 | + const commonPopupIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup')) && !['BtnPopup1'].includes(item.sControlName) && !item.sControlName.startsWith('BtnPopupEdit') && item.bVisible && item.sDropDownType === 'popup'); | |
| 6867 | 6887 | if (commonPopupIndex > -1) { |
| 6868 | 6888 | bCommonPopup = true; |
| 6869 | 6889 | } |
| 6870 | 6890 | |
| 6871 | 6891 | /* 单列弹出窗 */ |
| 6872 | - const commonPopupIndex1 = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.includes('BtnPopup1') && item.bVisible && item.sDropDownType === 'popup'); | |
| 6892 | + const commonPopupIndex1 = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.includes('BtnPopup1') && item.bVisible && item.sDropDownType === 'popup'); | |
| 6873 | 6893 | if (commonPopupIndex1 > -1) { |
| 6874 | 6894 | bCommonPopup1 = true; |
| 6875 | 6895 | bCommonPopup = false; |
| ... | ... | @@ -6906,7 +6926,7 @@ class CommonTableRc extends React.Component { |
| 6906 | 6926 | } |
| 6907 | 6927 | |
| 6908 | 6928 | if (iIndex > -1) { |
| 6909 | - if(commonFieldPopupConfig.sDropDownType === 'popupSingle') { /* 如果下拉类型是单列弹出窗 则为单列 */ | |
| 6929 | + if (commonFieldPopupConfig.sDropDownType === 'popupSingle') { /* 如果下拉类型是单列弹出窗 则为单列 */ | |
| 6910 | 6930 | bFieldPopup = false; |
| 6911 | 6931 | } |
| 6912 | 6932 | commonFieldPopupTitle = commonUtils.isNotEmptyObject(commonFieldPopupConfig) && commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName) ? commonFieldPopupConfig.sActiveName : commonFieldPopupTitle; |
| ... | ... | @@ -6916,13 +6936,13 @@ class CommonTableRc extends React.Component { |
| 6916 | 6936 | currentPane: { |
| 6917 | 6937 | name: 'commonPopup', |
| 6918 | 6938 | config: commonFieldPopupConfig, |
| 6919 | - title:commonFieldPopupTitle, | |
| 6939 | + title: commonFieldPopupTitle, | |
| 6920 | 6940 | route: '/indexPage/commonList', |
| 6921 | 6941 | formRoute: '/indexPage/commonList', |
| 6922 | 6942 | formId: commonFieldPopupConfig.sActiveId, |
| 6923 | 6943 | key: sModelsId + commonFieldPopupConfig.sId, |
| 6924 | 6944 | sModelsType: 'search/commonPopup', |
| 6925 | - select:this.handleSelectCommonFieldPopup, | |
| 6945 | + select: this.handleSelectCommonFieldPopup, | |
| 6926 | 6946 | selectCancel: this.handleSelectCancel.bind(this, 'commonFieldPopupVisible'), |
| 6927 | 6947 | }, |
| 6928 | 6948 | }, |
| ... | ... | @@ -6958,25 +6978,25 @@ class CommonTableRc extends React.Component { |
| 6958 | 6978 | const { config, sModelsId, app, selectedRowKeys, enabled } = this.props; |
| 6959 | 6979 | if (commonUtils.isNotEmptyObject(config)) { |
| 6960 | 6980 | commonModalTitle = commonUtils.isNotEmptyObject(commonModalShowConfig) && commonUtils.isNotEmptyObject(commonModalShowConfig.sActiveName) ? commonModalShowConfig.sActiveName : commonModalTitle; |
| 6961 | - const sFormId = commonUtils.isNotEmptyObject(commonModalRecord) && commonUtils.isNotEmptyObject(commonModalShowConfig) ? ( commonModalShowConfig.sActiveId === '1' ? commonUtils.isEmpty(commonModalRecord.sFormId) ? commonModalRecord.sSrcFormId : commonModalRecord.sFormId : commonModalShowConfig.sActiveId ) : commonModalShowConfig?.sActiveId; | |
| 6981 | + const sFormId = commonUtils.isNotEmptyObject(commonModalRecord) && commonUtils.isNotEmptyObject(commonModalShowConfig) ? (commonModalShowConfig.sActiveId === '1' ? commonUtils.isEmpty(commonModalRecord.sFormId) ? commonModalRecord.sSrcFormId : commonModalRecord.sFormId : commonModalShowConfig.sActiveId) : commonModalShowConfig?.sActiveId; | |
| 6962 | 6982 | |
| 6963 | 6983 | commonModalProps = { |
| 6964 | 6984 | app: { |
| 6965 | 6985 | ...this.props.app, |
| 6966 | 6986 | currentPane: { |
| 6967 | 6987 | name: 'commonModal', |
| 6968 | - bEdit: commonModalShowConfig?.sName === 'dStockAuxiliaryQty'? enabled:false, | |
| 6988 | + bEdit: commonModalShowConfig?.sName === 'dStockAuxiliaryQty' ? enabled : false, | |
| 6969 | 6989 | config: commonModalShowConfig, |
| 6970 | - conditonValues: commonModalShowConfig ? this.props.getSqlCondition(commonModalShowConfig, this.props.name, commonModalRecord) :{}, | |
| 6971 | - title:commonModalTitle, | |
| 6990 | + conditonValues: commonModalShowConfig ? this.props.getSqlCondition(commonModalShowConfig, this.props.name, commonModalRecord) : {}, | |
| 6991 | + title: commonModalTitle, | |
| 6972 | 6992 | route: '/indexPage/commonList', |
| 6973 | 6993 | formRoute: '/indexPage/commonList', |
| 6974 | 6994 | formId: sFormId, |
| 6975 | 6995 | key: sModelsId + commonModalShowConfig?.sId, |
| 6976 | 6996 | sModelsType: 'search/commonPopup', |
| 6977 | - select:this.handleSelectCommonPopup, | |
| 6997 | + select: this.handleSelectCommonPopup, | |
| 6978 | 6998 | selectCancel: this.handleSelectCancel.bind(this, 'commonModalVisible'), |
| 6979 | - slaveDataSource :commonModalShowConfig?.sName === 'dStockAuxiliaryQty'? [commonModalRecord]: [], | |
| 6999 | + slaveDataSource: commonModalShowConfig?.sName === 'dStockAuxiliaryQty' ? [commonModalRecord] : [], | |
| 6980 | 7000 | }, |
| 6981 | 7001 | }, |
| 6982 | 7002 | dispatch: this.props.dispatch, |
| ... | ... | @@ -6985,7 +7005,7 @@ class CommonTableRc extends React.Component { |
| 6985 | 7005 | onOpenNewTab: this.onOpenNewTab, |
| 6986 | 7006 | outerMasterData: this.props.masterData, |
| 6987 | 7007 | realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */ |
| 6988 | - bEdit:commonModalShowConfig?.sName === 'dAvailableAuxiliaryQty'? enabled:false | |
| 7008 | + bEdit: commonModalShowConfig?.sName === 'dAvailableAuxiliaryQty' ? enabled : false | |
| 6989 | 7009 | }; |
| 6990 | 7010 | // if(commonModalShowConfig?.sName === 'dSumCompleteAvailableStockQty' ){ |
| 6991 | 7011 | // commonModalProps.data = commonModalData; |
| ... | ... | @@ -7073,7 +7093,7 @@ class CommonTableRc extends React.Component { |
| 7073 | 7093 | layoutScrollY = this.props.fixedHeight; |
| 7074 | 7094 | } |
| 7075 | 7095 | let bShowBtnUpload = true; |
| 7076 | - if(commonUtils.isNotEmptyObject(this.props.masterData) && commonUtils.isNotEmptyObject(this.props.masterData.sZczlxShowName)) { | |
| 7096 | + if (commonUtils.isNotEmptyObject(this.props.masterData) && commonUtils.isNotEmptyObject(this.props.masterData.sZczlxShowName)) { | |
| 7077 | 7097 | bShowBtnUpload = this.props.masterData.sZczlxShowName !== '删除' && this.props.masterData.sZczlxShowName !== '恢复'; |
| 7078 | 7098 | } |
| 7079 | 7099 | |
| ... | ... | @@ -7085,11 +7105,11 @@ class CommonTableRc extends React.Component { |
| 7085 | 7105 | <div className={styles.extraAction} onselectstart="return false"> |
| 7086 | 7106 | { |
| 7087 | 7107 | this.props.name === 'picFile' || (commonUtils.isNotEmptyObject(this.props.name) && this.props.name.indexOf('file') > -1) || |
| 7088 | - (this.props.name.startsWith('slave') && this.findIsUpdByControlName(this.props, 'BtnUpload') && bShowBtnUpload ) ? | |
| 7108 | + (this.props.name.startsWith('slave') && this.findIsUpdByControlName(this.props, 'BtnUpload') && bShowBtnUpload) ? | |
| 7089 | 7109 | <Upload {...divProps} {...this.BtnUploadDivProps()}> |
| 7090 | 7110 | <Button {...uploadProps} |
| 7091 | 7111 | style={{ 'caret-color': 'transparent' }} |
| 7092 | - contenteditable="true" ref={(ref) => {this.uploadRef = ref;}} | |
| 7112 | + contenteditable="true" ref={(ref) => { this.uploadRef = ref; }} | |
| 7093 | 7113 | onPaste={this.handleUploadByClipboard} |
| 7094 | 7114 | onMouseOver={() => { |
| 7095 | 7115 | this.uploadRef.setAttribute('contenteditable', "true"); |
| ... | ... | @@ -7104,16 +7124,16 @@ class CommonTableRc extends React.Component { |
| 7104 | 7124 | <UploadOutlined /> {BtnUpload} |
| 7105 | 7125 | </Button> |
| 7106 | 7126 | </Upload> |
| 7107 | - : null } | |
| 7127 | + : null} | |
| 7108 | 7128 | </div> |
| 7109 | 7129 | <div |
| 7110 | - className={`xlyCommonTable ${tableClassName} ${this.hasSpanBgColor ? 'tableNoPadding' : ''} ${this.props.enabled ? 'tableEnabled' : ''}` } | |
| 7130 | + className={`xlyCommonTable ${tableClassName} ${this.hasSpanBgColor ? 'tableNoPadding' : ''} ${this.props.enabled ? 'tableEnabled' : ''}`} | |
| 7111 | 7131 | style={{ height: isSmall ? 'calc(100% - 44px)' : '' }} ref={(ref) => { |
| 7112 | 7132 | this.mydiv = ref; |
| 7113 | 7133 | if (this.mydiv) { |
| 7114 | 7134 | this.computedTdWidth(); |
| 7115 | 7135 | if (false && commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes('commonListTab')) { |
| 7116 | - this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = this.tableHeight ? this.tableHeight + 'px': 80 + 'px'; | |
| 7136 | + this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = this.tableHeight ? this.tableHeight + 'px' : 80 + 'px'; | |
| 7117 | 7137 | } |
| 7118 | 7138 | if (layoutScrollY) { |
| 7119 | 7139 | this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = typeof layoutScrollY === 'number' ? layoutScrollY + 'px' : layoutScrollY; |
| ... | ... | @@ -7127,7 +7147,7 @@ class CommonTableRc extends React.Component { |
| 7127 | 7147 | <DndProvider backend={HTML5Backend} > |
| 7128 | 7148 | <Table |
| 7129 | 7149 | {...tableProps} |
| 7130 | - pagination={ !hasColorInfo && tableProps.pagination } | |
| 7150 | + pagination={!hasColorInfo && tableProps.pagination} | |
| 7131 | 7151 | addRow={addProps} |
| 7132 | 7152 | delProps={delProps} |
| 7133 | 7153 | tableLayout="fixed" |
| ... | ... | @@ -7141,11 +7161,11 @@ class CommonTableRc extends React.Component { |
| 7141 | 7161 | sticky={this.sticky} |
| 7142 | 7162 | showSorterTooltip={false} |
| 7143 | 7163 | /> |
| 7144 | - </DndProvider> : | |
| 7164 | + </DndProvider> : | |
| 7145 | 7165 | <div> |
| 7146 | 7166 | <Table |
| 7147 | 7167 | {...tableProps} |
| 7148 | - pagination={ !hasColorInfo && tableProps.pagination } | |
| 7168 | + pagination={!hasColorInfo && tableProps.pagination} | |
| 7149 | 7169 | addRow={addProps} |
| 7150 | 7170 | delProps={delProps} |
| 7151 | 7171 | tableLayout="fixed" |
| ... | ... | @@ -7153,7 +7173,7 @@ class CommonTableRc extends React.Component { |
| 7153 | 7173 | expandedRowRender: this.props.setExpandedRowRender === 'Y' ? expandedRow : null, |
| 7154 | 7174 | defaultExpandAllRows: this.props.defaultExpandAllRows || null, |
| 7155 | 7175 | }} |
| 7156 | - scroll={{ x: this.scrollX, y: !layoutScrollY ? this.scrollY : layoutScrollY}} | |
| 7176 | + scroll={{ x: this.scrollX, y: !layoutScrollY ? this.scrollY : layoutScrollY }} | |
| 7157 | 7177 | summary={this.genFooter} |
| 7158 | 7178 | size="small" |
| 7159 | 7179 | sticky={this.sticky} |
| ... | ... | @@ -7162,16 +7182,16 @@ class CommonTableRc extends React.Component { |
| 7162 | 7182 | </div> |
| 7163 | 7183 | } |
| 7164 | 7184 | |
| 7165 | - { hasColorInfo && | |
| 7185 | + {hasColorInfo && | |
| 7166 | 7186 | <Row style={{ paddingTop: 10, paddingBottom: 10 }} wrap={false} ref={e => this.colorInfo = e}> |
| 7167 | - <Col span={14}><ColorInfo { ...this.props } /></Col> | |
| 7187 | + <Col span={14}><ColorInfo {...this.props} /></Col> | |
| 7168 | 7188 | <Col span={10}> |
| 7169 | - { tableProps.pagination && <Pagination | |
| 7170 | - { ...tableProps.pagination } | |
| 7189 | + {tableProps.pagination && <Pagination | |
| 7190 | + {...tableProps.pagination} | |
| 7171 | 7191 | showLessItems |
| 7172 | 7192 | size='small' |
| 7173 | - onChange={(page, pageSize) => {this.onChange({ current: page, pageSize })}} | |
| 7174 | - /> } | |
| 7193 | + onChange={(page, pageSize) => { this.onChange({ current: page, pageSize }) }} | |
| 7194 | + />} | |
| 7175 | 7195 | </Col> |
| 7176 | 7196 | </Row> |
| 7177 | 7197 | } |
| ... | ... | @@ -7207,27 +7227,27 @@ class CommonTableRc extends React.Component { |
| 7207 | 7227 | </AntdDraggableDiv> |
| 7208 | 7228 | : '' |
| 7209 | 7229 | }{ |
| 7210 | - commonPopupVisible ? | |
| 7211 | - <AntdDraggableModal | |
| 7212 | - width={1300} | |
| 7213 | - zIndex={1000} | |
| 7214 | - title={commonPopupTitle} | |
| 7215 | - visible={commonPopupVisible} | |
| 7216 | - onCancel={this.handleSelectCancel.bind(this, 'commonPopupVisible')} | |
| 7217 | - footer={null} | |
| 7218 | - onSaveState={this.props.onSaveState} | |
| 7219 | - className={`${randomId}-CommonListSelectTree`} | |
| 7220 | - > | |
| 7221 | - {bCommonPopup ? | |
| 7222 | - <CommonListSelectTree {...commonPopupProps} /> | |
| 7223 | - : bCommonPopup1 ? | |
| 7224 | - <CommonListSelect {...commonPopupProps} /> | |
| 7225 | - : bCommonPopupTree ? | |
| 7226 | - <CommonListTreeSelect {...commonPopupProps} /> : '' | |
| 7227 | - } | |
| 7228 | - </AntdDraggableModal> | |
| 7229 | - : '' | |
| 7230 | - } | |
| 7230 | + commonPopupVisible ? | |
| 7231 | + <AntdDraggableModal | |
| 7232 | + width={1300} | |
| 7233 | + zIndex={1000} | |
| 7234 | + title={commonPopupTitle} | |
| 7235 | + visible={commonPopupVisible} | |
| 7236 | + onCancel={this.handleSelectCancel.bind(this, 'commonPopupVisible')} | |
| 7237 | + footer={null} | |
| 7238 | + onSaveState={this.props.onSaveState} | |
| 7239 | + className={`${randomId}-CommonListSelectTree`} | |
| 7240 | + > | |
| 7241 | + {bCommonPopup ? | |
| 7242 | + <CommonListSelectTree {...commonPopupProps} /> | |
| 7243 | + : bCommonPopup1 ? | |
| 7244 | + <CommonListSelect {...commonPopupProps} /> | |
| 7245 | + : bCommonPopupTree ? | |
| 7246 | + <CommonListTreeSelect {...commonPopupProps} /> : '' | |
| 7247 | + } | |
| 7248 | + </AntdDraggableModal> | |
| 7249 | + : '' | |
| 7250 | + } | |
| 7231 | 7251 | { |
| 7232 | 7252 | commonFieldPopupVisible ? |
| 7233 | 7253 | <AntdDraggableModal |
| ... | ... | @@ -7281,7 +7301,7 @@ class CommonTableRc extends React.Component { |
| 7281 | 7301 | onCancel={this.handleSelectCancel.bind(this, 'commonFileDownloadVisible')} |
| 7282 | 7302 | footer={[ |
| 7283 | 7303 | <Button key="selectedAll" type="primary" ghost onClick={ |
| 7284 | - ()=>{ | |
| 7304 | + () => { | |
| 7285 | 7305 | const newList = [...commonFileDownloadList]; |
| 7286 | 7306 | const checkState = newList.find(item => !item.checked); |
| 7287 | 7307 | newList.forEach(item => item.checked = checkState); |
| ... | ... | @@ -7347,27 +7367,27 @@ class CommonTableRc extends React.Component { |
| 7347 | 7367 | } |
| 7348 | 7368 | { |
| 7349 | 7369 | pdfFileVisible ? |
| 7350 | - <AntdDraggableModal | |
| 7351 | - title={pdfFileUrl.split('/').pop().split('_').pop()} | |
| 7352 | - visible={pdfFileVisible} | |
| 7353 | - width="100%" | |
| 7354 | - height="calc(100% - 50px)" | |
| 7355 | - style={{ top: 0 }} | |
| 7356 | - footer={null} | |
| 7357 | - onCancel={() => { | |
| 7358 | - this.setState({ | |
| 7359 | - pdfFileVisible: false | |
| 7360 | - }); | |
| 7361 | - }} | |
| 7362 | - > | |
| 7363 | - <div style={{ width: '100%', height: 'calc(100vh - 67px)', overflow: 'auto' }}> | |
| 7364 | - <PrintPdf | |
| 7365 | - style={{ height: '100%' }} | |
| 7366 | - bFitWidth={true} | |
| 7367 | - previewUrl={pdfFileUrl.includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(pdfFileUrl)}&sModelsId=100&token=${this.props.app.token}` : pdfFileUrl} | |
| 7368 | - /> | |
| 7369 | - </div> | |
| 7370 | - </AntdDraggableModal> : '' | |
| 7370 | + <AntdDraggableModal | |
| 7371 | + title={pdfFileUrl.split('/').pop().split('_').pop()} | |
| 7372 | + visible={pdfFileVisible} | |
| 7373 | + width="100%" | |
| 7374 | + height="calc(100% - 50px)" | |
| 7375 | + style={{ top: 0 }} | |
| 7376 | + footer={null} | |
| 7377 | + onCancel={() => { | |
| 7378 | + this.setState({ | |
| 7379 | + pdfFileVisible: false | |
| 7380 | + }); | |
| 7381 | + }} | |
| 7382 | + > | |
| 7383 | + <div style={{ width: '100%', height: 'calc(100vh - 67px)', overflow: 'auto' }}> | |
| 7384 | + <PrintPdf | |
| 7385 | + style={{ height: '100%' }} | |
| 7386 | + bFitWidth={true} | |
| 7387 | + previewUrl={pdfFileUrl.includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(pdfFileUrl)}&sModelsId=100&token=${this.props.app.token}` : pdfFileUrl} | |
| 7388 | + /> | |
| 7389 | + </div> | |
| 7390 | + </AntdDraggableModal> : '' | |
| 7371 | 7391 | } |
| 7372 | 7392 | { |
| 7373 | 7393 | bOperateMoreVisible ? |
| ... | ... | @@ -7389,15 +7409,15 @@ class CommonTableRc extends React.Component { |
| 7389 | 7409 | <SlaveMemo {...this.props} /> |
| 7390 | 7410 | {officePreviewVisible && <OfficePreview {...officePreviewProps} />} |
| 7391 | 7411 | {/* 简单对话框 */} |
| 7392 | - { this.state.simpleModalVisible && <Modal | |
| 7412 | + {this.state.simpleModalVisible && <Modal | |
| 7393 | 7413 | title='详细' |
| 7394 | 7414 | footer={null} |
| 7395 | 7415 | focusTriggerAfterClose={false} |
| 7396 | 7416 | visible={this.state.simpleModalVisible} |
| 7397 | - onCancel={()=>this.setState({ simpleModalVisible: false, simpleModalWord: '' })} | |
| 7417 | + onCancel={() => this.setState({ simpleModalVisible: false, simpleModalWord: '' })} | |
| 7398 | 7418 | > |
| 7399 | 7419 | <div ref={this.simpleModalRef} style={{ maxHeight: '50vh', overflowY: 'auto' }} /> |
| 7400 | - </Modal> } | |
| 7420 | + </Modal>} | |
| 7401 | 7421 | </FormItem> |
| 7402 | 7422 | ); |
| 7403 | 7423 | } |
| ... | ... | @@ -7447,8 +7467,8 @@ const CommonTable = (props) => { |
| 7447 | 7467 | data[indexNew].iOrder = iOrder1; |
| 7448 | 7468 | |
| 7449 | 7469 | const tempItem = data[index]; |
| 7450 | - data[index] = {...data[indexNew], handleType: data[indexNew].handleType || "update"}; | |
| 7451 | - data[indexNew] = {...tempItem, handleType: tempItem.handleType || "update"}; | |
| 7470 | + data[index] = { ...data[indexNew], handleType: data[indexNew].handleType || "update" }; | |
| 7471 | + data[indexNew] = { ...tempItem, handleType: tempItem.handleType || "update" }; | |
| 7452 | 7472 | |
| 7453 | 7473 | props.onSaveState({ |
| 7454 | 7474 | [`${props.name}Data`]: data |
| ... | ... | @@ -7495,10 +7515,10 @@ const handleSetIRowNum = (data, props) => { |
| 7495 | 7515 | if (commonUtils.isNotEmptyArr(eachData)) { |
| 7496 | 7516 | eachData.forEach((item, index) => { |
| 7497 | 7517 | /* 采购 */ |
| 7498 | - item.iRowNum = index +1; | |
| 7518 | + item.iRowNum = index + 1; | |
| 7499 | 7519 | const iIndex = data.findIndex(row => row.sId === item.sId); |
| 7500 | - if(iIndex > -1) { | |
| 7501 | - data[iIndex] ={...data[iIndex], iRowNum: index +1} | |
| 7520 | + if (iIndex > -1) { | |
| 7521 | + data[iIndex] = { ...data[iIndex], iRowNum: index + 1 } | |
| 7502 | 7522 | } |
| 7503 | 7523 | |
| 7504 | 7524 | }); |
| ... | ... | @@ -7506,7 +7526,7 @@ const handleSetIRowNum = (data, props) => { |
| 7506 | 7526 | } |
| 7507 | 7527 | } |
| 7508 | 7528 | } |
| 7509 | - if(location.pathname !== '/indexPage/commonClassify'){ | |
| 7529 | + if (location.pathname !== '/indexPage/commonClassify') { | |
| 7510 | 7530 | if (commonUtils.isNotEmptyArr(item.children)) { |
| 7511 | 7531 | handleSetIRowNum(item.children, props); |
| 7512 | 7532 | } | ... | ... |
src/components/Common/Typesetting/typesetting.js
| 1 | 1 | /* eslint-disable */ |
| 2 | 2 | import * as commonFunc from "@/components/Common/commonFunc"; |
| 3 | 3 | import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined, VerticalLeftOutlined, VerticalRightOutlined } from "@ant-design/icons"; |
| 4 | -import { message, Modal } from "antd-v4"; | |
| 4 | +import { message, Modal } from "antd"; | |
| 5 | 5 | import React, { useEffect, useRef, useState } from "react"; |
| 6 | 6 | import { ArrowRightOutlined } from "@ant-design/icons"; |
| 7 | 7 | import DynamicSVG from "../../Common/BoxDesignCompontent/svg"; |
| ... | ... | @@ -65,6 +65,8 @@ const Typesetting = props => { |
| 65 | 65 | const [newDHorizontalType, setNewDHorizontalType] = useState(0); |
| 66 | 66 | const [newDPortraitType, setNewDPortraitType] = useState(0); |
| 67 | 67 | const [oldVariables, setOldVariables] = useState(""); |
| 68 | + const [innerWidth, setInnerWidth] = useState(0); | |
| 69 | + const [innerHeight, setInnerHeight] = useState(0); | |
| 68 | 70 | // 横板 |
| 69 | 71 | let { dHorizontal, dPortrait, dHorizontalType, dPortraitType } = slaveRowData; |
| 70 | 72 | // 使用 useRef 获取 DOM 元素 |
| ... | ... | @@ -125,6 +127,7 @@ const Typesetting = props => { |
| 125 | 127 | let boxList = []; |
| 126 | 128 | if (sColumnNameConfig) { |
| 127 | 129 | const slaveNewData = slaveRowData.upAbleConfigsExtra || JSON.parse(slaveRowData.sColumnNameConfig); |
| 130 | + // 处理为双盒的部件 | |
| 128 | 131 | const tables = [ |
| 129 | 132 | { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, |
| 130 | 133 | { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, |
| ... | ... | @@ -143,22 +146,6 @@ const Typesetting = props => { |
| 143 | 146 | { name: "右贴边位", value: "dYTBW" }, |
| 144 | 147 | { name: "右(下)插位组件", value: "dYXCW" }, |
| 145 | 148 | ]; |
| 146 | - const doubleTitlieList1 = [ | |
| 147 | - { name: "左上插位组件", value: "dZSCW" }, | |
| 148 | - { name: "上插位组件", value: "dSCW" }, | |
| 149 | - { name: "右上插位组件", value: "dYSCW" }, | |
| 150 | - { name: "左偏移", value: "dZPY" }, | |
| 151 | - { name: "左插位组件", value: "dZCW" }, | |
| 152 | - { name: "左下插位组件", value: "dZXCW" }, | |
| 153 | - { name: "右偏移", value: "dYPY" }, | |
| 154 | - { name: "右插位组件", value: "dYCW" }, | |
| 155 | - { name: "右下插位组件", value: "dYXCW" }, | |
| 156 | - { name: "首盒长", value: "dSHC" }, | |
| 157 | - { name: "首盒宽", value: "dSHK" }, | |
| 158 | - { name: "次盒长", value: "dCHC" }, | |
| 159 | - { name: "次盒宽", value: "dCHK" }, | |
| 160 | - ]; | |
| 161 | - const srcList = Number(slaveRowData.sTypes) === 8 ? doubleTitlieList1 : titleList1; | |
| 162 | 149 | slaveNewData.forEach(x => { |
| 163 | 150 | let key = 0; |
| 164 | 151 | if (x.sAssignFormula) { |
| ... | ... | @@ -168,7 +155,7 @@ const Typesetting = props => { |
| 168 | 155 | } |
| 169 | 156 | boxList.push({ |
| 170 | 157 | value: key, |
| 171 | - sName: srcList.find(item => item.value === x.sName)?.name || "", | |
| 158 | + sName: titleList1.find(item => item.value === x.sName)?.name || "", | |
| 172 | 159 | isEditable: true, |
| 173 | 160 | isSelect: false, |
| 174 | 161 | selectValue: null, |
| ... | ... | @@ -176,8 +163,20 @@ const Typesetting = props => { |
| 176 | 163 | selectImage: null, |
| 177 | 164 | type: x.sTypes || null, |
| 178 | 165 | show: true, |
| 179 | - sCode: srcList.find(item => item.value === x.sName)?.value || "", | |
| 166 | + sCode: titleList1.find(item => item.value === x.sName)?.value || "", | |
| 180 | 167 | showName: x.showName, // 参数名称 |
| 168 | + sLength: x.iSLength, | |
| 169 | + sWidth: x.iSWidth, | |
| 170 | + sType: x.iSType, | |
| 171 | + sTypeName: Number(x.iSType) === 0 ? "矩形" : "梯形", | |
| 172 | + sOffset: x.sSOffset, | |
| 173 | + sQuantity: x.iSQuantity, | |
| 174 | + cLength: x.iCLength, | |
| 175 | + cWidth: x.iCWidth, | |
| 176 | + cType: x.iCType, | |
| 177 | + cTypeName: Number(x.iCType) === 0 ? "矩形" : "梯形", | |
| 178 | + cOffset: x.sCOffset, | |
| 179 | + cQuantity: x.iCQuantity, | |
| 181 | 180 | }); |
| 182 | 181 | }); |
| 183 | 182 | tables.forEach(x => { |
| ... | ... | @@ -209,9 +208,121 @@ const Typesetting = props => { |
| 209 | 208 | } |
| 210 | 209 | }); |
| 211 | 210 | let DisableMateriallIcon = L ? sPackDetailPath : null; |
| 211 | + function calculateCupUnfoldDimensions(D, d, h) { | |
| 212 | + | |
| 213 | + const R1 = D / 2; // 上口半径 | |
| 214 | + const R2 = d / 2; // 底部半径 | |
| 215 | + if (D === d) { | |
| 216 | + const paperCup = commonFunc.showLocalMessage(props, "paperCup", "L不能小于等于W!"); | |
| 217 | + message.error(paperCup); | |
| 218 | + return { | |
| 219 | + width: 0, | |
| 220 | + height: 0 | |
| 221 | + } | |
| 222 | + } | |
| 223 | + // 1. 计算母线长 l | |
| 224 | + const deltaR = R1 - R2; | |
| 225 | + const l = Math.sqrt(deltaR * deltaR + h * h); | |
| 226 | + | |
| 227 | + // 2. 计算外半径 R 和内半径 r | |
| 228 | + const R = (R1 * l) / deltaR; // 外半径 | |
| 229 | + const r = R - l; // 内半径 | |
| 230 | + | |
| 231 | + // 3. 计算圆心角 θ(弧度) | |
| 232 | + const theta_rad = (2 * Math.PI * R1) / R; | |
| 233 | + const halfTheta = theta_rad / 2; | |
| 234 | + | |
| 235 | + // 4. 计算弦长(水平宽度) | |
| 236 | + const chord = 2 * R * Math.sin(halfTheta); | |
| 237 | + | |
| 238 | + // 5. 展开图垂直高度 | |
| 239 | + const y_top = -R; // 外弧中点(最高点) | |
| 240 | + const y_inner_end = -r * Math.cos(halfTheta); | |
| 241 | + const verticalHeight = y_inner_end - y_top; | |
| 242 | + | |
| 243 | + // ✅ 新增:计算关键点坐标(以圆心为原点,y 向上为正) | |
| 244 | + // 注意:数学坐标系中,角度从 x 轴开始逆时针,但我们希望顶部在 y 轴负方向 | |
| 245 | + // 所以我们把角度偏移 -90°(即 -π/2),让 0° 指向正上方 | |
| 246 | + | |
| 247 | + const angleOffset = -Math.PI / 2; // 使 0° 指向顶部 | |
| 248 | + | |
| 249 | + const points = { | |
| 250 | + outerCenter: { | |
| 251 | + x: R * Math.cos(halfTheta + angleOffset), | |
| 252 | + y: R * Math.sin(halfTheta + angleOffset) | |
| 253 | + }, | |
| 254 | + outerLeft: { | |
| 255 | + x: R * Math.cos(-halfTheta + angleOffset), | |
| 256 | + y: R * Math.sin(-halfTheta + angleOffset) | |
| 257 | + }, | |
| 258 | + outerRight: { | |
| 259 | + x: R * Math.cos(halfTheta + angleOffset), | |
| 260 | + y: R * Math.sin(halfTheta + angleOffset) | |
| 261 | + }, | |
| 262 | + innerLeft: { | |
| 263 | + x: r * Math.cos(-halfTheta + angleOffset), | |
| 264 | + y: r * Math.sin(-halfTheta + angleOffset) | |
| 265 | + }, | |
| 266 | + innerRight: { | |
| 267 | + x: r * Math.cos(halfTheta + angleOffset), | |
| 268 | + y: r * Math.sin(halfTheta + angleOffset) | |
| 269 | + }, | |
| 270 | + // 也可以计算顶部中点(0° 方向) | |
| 271 | + topCenter: { | |
| 272 | + x: 0, | |
| 273 | + y: -R // 正上方 | |
| 274 | + }, | |
| 275 | + bottomLeft: { | |
| 276 | + x: -chord / 2, | |
| 277 | + y: -r * Math.cos(halfTheta) | |
| 278 | + }, | |
| 279 | + bottomRight: { | |
| 280 | + x: chord / 2, | |
| 281 | + y: -r * Math.cos(halfTheta) | |
| 282 | + } | |
| 283 | + }; | |
| 284 | + | |
| 285 | + // 如果你需要用于 SVG(y 向下为正),可以转换 | |
| 286 | + const pointsForSVG = Object.keys(points).reduce((acc, key) => { | |
| 287 | + acc[key] = { | |
| 288 | + x: points[key].x, | |
| 289 | + y: -points[key].y // 反转 y 轴 | |
| 290 | + }; | |
| 291 | + return acc; | |
| 292 | + }, {}); | |
| 293 | + | |
| 294 | + return { | |
| 295 | + width: chord, | |
| 296 | + height: verticalHeight, | |
| 297 | + R, r, l, | |
| 298 | + theta_deg: (theta_rad * 180) / Math.PI, | |
| 299 | + points, // 数学坐标系(y 向上) | |
| 300 | + pointsForSVG, // SVG 坐标系(y 向下) | |
| 301 | + chord, | |
| 302 | + verticalHeight | |
| 303 | + }; | |
| 304 | + } | |
| 212 | 305 | // 盒子展长展开公式计算 |
| 213 | - const innerWidth = slaveRowData.sTypes === "6" ? evaluateFormula(sWidthFormula, variabless) : evaluateFormula(sLengthFormula, variabless); | |
| 214 | - const innerHeight = slaveRowData.sTypes === "6" ? evaluateFormula(sLengthFormula, variabless) : evaluateFormula(sWidthFormula, variabless); | |
| 306 | + // 在 useEffect 内部 | |
| 307 | + useEffect(() => { | |
| 308 | + if (Number(slaveRowData.sTypes) === 9) { | |
| 309 | + if (L > 0 && W > 0 && H > 0) { | |
| 310 | + const { width, height } = calculateCupUnfoldDimensions(L, W, D); | |
| 311 | + // 确保新值与旧值不同时才更新 | |
| 312 | + if (width && height) { | |
| 313 | + setInnerWidth(Number(width.toFixed(2))); | |
| 314 | + setInnerHeight(Number(height.toFixed(2))); | |
| 315 | + } | |
| 316 | + } | |
| 317 | + } else { | |
| 318 | + // 计算其他类型的盒子尺寸 | |
| 319 | + let newWidth = slaveRowData.sTypes === "6" ? evaluateFormula(sWidthFormula, variabless) : evaluateFormula(sLengthFormula, variabless); | |
| 320 | + let newHeight = slaveRowData.sTypes === "6" ? evaluateFormula(sLengthFormula, variabless) : evaluateFormula(sWidthFormula, variabless); | |
| 321 | + setInnerWidth(newWidth); | |
| 322 | + setInnerHeight(newHeight); | |
| 323 | + } | |
| 324 | + }, [slaveRowData.sTypes, L, W, H, D, sLengthFormula, sWidthFormula, variabless]); | |
| 325 | + | |
| 215 | 326 | const { sSettingMethod, sSGroupOffset, iFAngle, iSAngle, sSecondorizontalOffset, sSecondLongitudinalOffset } = radioValue ? radioValue : {}; |
| 216 | 327 | const dFWidthOffset = evaluateFormula(radioValue?.sFWidthOffset, variabless); // 首盒纵向偏移 |
| 217 | 328 | const dFLengthOffset = evaluateFormula(radioValue?.sFLengthOffset, variabless); // 首盒横向偏移 |
| ... | ... | @@ -272,20 +383,11 @@ const Typesetting = props => { |
| 272 | 383 | // 计算剩余空间 每组都算上偏移量 那么剩余需要加上后面偏移的总量 |
| 273 | 384 | const remainingWidth = outerWidth - colsMaxLength + (boxLengthOffset + (reference ? 0 : dSLengthOffset)); |
| 274 | 385 | const remainingHeight = outerHeight - rowsMaxLength + (boxWidthOffset + (reference ? 0 : dSWidthOffset)); |
| 275 | - // const remainingWidth = | |
| 276 | - // outerWidth - | |
| 277 | - // (cols * (innerWidthCombined + boxLengthOffset + (reference ? 0 : dSLengthOffset)) - boxLengthOffset - (reference ? 0 : dSLengthOffset)); | |
| 278 | - // const remainingHeight = | |
| 279 | - // outerHeight - | |
| 280 | - // (rows * (innerHeightCombined + boxWidthOffset + (reference ? 0 : dSWidthOffset)) - boxWidthOffset - (reference ? 0 : dSWidthOffset)); | |
| 281 | 386 | //剩余量能不能放一下单独一个 |
| 282 | 387 | const commonHeightCheck = remainingHeight > jInnerHeight + dXBJJ; |
| 283 | 388 | const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ; |
| 284 | 389 | const isCustomized = bAdvancedSetting; |
| 285 | 390 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; |
| 286 | - console.log(dSLengthOffset, "次盒横向偏移量"); | |
| 287 | - console.log(dSWidthOffset, "次盒纵向偏移量"); | |
| 288 | - | |
| 289 | 391 | // 判断 |
| 290 | 392 | // const remaining = false; |
| 291 | 393 | const isOdd = num => { |
| ... | ... | @@ -312,6 +414,11 @@ const Typesetting = props => { |
| 312 | 414 | } |
| 313 | 415 | } |
| 314 | 416 | } |
| 417 | + const handleSaveState = (data) => { | |
| 418 | + setInnerWidth(Number(data.width.toFixed(2))) | |
| 419 | + setInnerHeight(Number(data.height.toFixed(2))) | |
| 420 | + | |
| 421 | + } | |
| 315 | 422 | const svgProps = { |
| 316 | 423 | ...props, |
| 317 | 424 | boxList, |
| ... | ... | @@ -341,7 +448,7 @@ const Typesetting = props => { |
| 341 | 448 | }} |
| 342 | 449 | > |
| 343 | 450 | <div style={{ transform: `rotateZ(${offsetZ}deg)` }}> |
| 344 | - {!sSvgPath ? <DynamicSVG {...svgProps} /> : <img src={sSvgPath} width={jInnerWidth} height={jInnerHeight} />} | |
| 451 | + {!sSvgPath ? <DynamicSVG {...svgProps} onSaveStates={handleSaveState} /> : <img src={sSvgPath} width={jInnerWidth} height={jInnerHeight} />} | |
| 345 | 452 | {/* <DynamicSVG {...svgProps} /> */} |
| 346 | 453 | </div> |
| 347 | 454 | </div> |
| ... | ... | @@ -381,7 +488,7 @@ const Typesetting = props => { |
| 381 | 488 | > |
| 382 | 489 | <div style={{ transform: `rotateZ(${iFAngle}deg)` }}> |
| 383 | 490 | {!sSvgPath ? ( |
| 384 | - <DynamicSVG {...svgProps} /> | |
| 491 | + <DynamicSVG {...svgProps} onSaveStates={handleSaveState} /> | |
| 385 | 492 | ) : ( |
| 386 | 493 | <img |
| 387 | 494 | src={sSvgPath} |
| ... | ... | @@ -401,21 +508,19 @@ const Typesetting = props => { |
| 401 | 508 | justifyContent: "center", |
| 402 | 509 | alignItems: "center", |
| 403 | 510 | position: "absolute", |
| 404 | - left: `${ | |
| 405 | - isVertical | |
| 406 | - ? dSLengthOffset | |
| 407 | - : iSAngle === 90 || iSAngle === 270 | |
| 511 | + left: `${isVertical | |
| 512 | + ? dSLengthOffset | |
| 513 | + : iSAngle === 90 || iSAngle === 270 | |
| 408 | 514 | ? innerHeight + dFLengthOffset + dSLengthOffset + dYBJJ |
| 409 | 515 | : innerWidth + dFLengthOffset + dSLengthOffset + dYBJJ |
| 410 | - }px`, | |
| 411 | - top: `${ | |
| 412 | - isVertical ? jInnerHeight + dFWidthOffset + dSWidthOffset + dXBJJ : iSAngle === 90 || iSAngle === 270 ? dSWidthOffset : dSWidthOffset | |
| 413 | - }px`, | |
| 516 | + }px`, | |
| 517 | + top: `${isVertical ? jInnerHeight + dFWidthOffset + dSWidthOffset + dXBJJ : iSAngle === 90 || iSAngle === 270 ? dSWidthOffset : dSWidthOffset | |
| 518 | + }px`, | |
| 414 | 519 | }} |
| 415 | 520 | > |
| 416 | 521 | <div style={{ transform: `rotateZ(${iSAngle}deg)` }}> |
| 417 | 522 | {!sSvgPath ? ( |
| 418 | - <DynamicSVG {...svgProps} /> | |
| 523 | + <DynamicSVG {...svgProps} onSaveStates={handleSaveState} /> | |
| 419 | 524 | ) : ( |
| 420 | 525 | <img |
| 421 | 526 | src={sSvgPath} |
| ... | ... | @@ -462,7 +567,7 @@ const Typesetting = props => { |
| 462 | 567 | {/* <img src={icon} width="100%" height="100%" /> */} |
| 463 | 568 | {/* {isSvg ? <DynamicSVG {...props} /> : <img src={icon} width="100%" height="100%" />} */} |
| 464 | 569 | <div style={{ transform: `rotateZ(${iFAngle}deg)` }}> |
| 465 | - {!sSvgPath ? <DynamicSVG {...svgProps} /> : <img src={sSvgPath} width={`${innerWidth}px`} height={`${innerHeight}px`} />} | |
| 570 | + {!sSvgPath ? <DynamicSVG {...svgProps} onSaveStates={handleSaveState} /> : <img src={sSvgPath} width={`${innerWidth}px`} height={`${innerHeight}px`} />} | |
| 466 | 571 | </div> |
| 467 | 572 | </div> |
| 468 | 573 | </div> |
| ... | ... | @@ -471,12 +576,12 @@ const Typesetting = props => { |
| 471 | 576 | const calculateLeftPosition = (col, reference, isVertical, leftPosition, dYBJJ, dSLengthOffset) => { |
| 472 | 577 | if (isVertical) { |
| 473 | 578 | if (reference) { |
| 474 | - return col === 0 ? leftPosition : leftPosition + dYBJJ * col; | |
| 579 | + return col === 0 ? leftPosition : leftPosition + (dYBJJ * col); | |
| 475 | 580 | } |
| 476 | 581 | return col === 0 ? leftPosition : leftPosition + (boxLengthOffset + dYBJJ) * col; |
| 477 | 582 | } else { |
| 478 | 583 | if (reference) { |
| 479 | - return col === 0 ? leftPosition : leftPosition + dYBJJ * col; | |
| 584 | + return col === 0 ? leftPosition : leftPosition + (dYBJJ * col); | |
| 480 | 585 | } |
| 481 | 586 | return col === 0 ? leftPosition : leftPosition + (boxLengthOffset + dYBJJ) * col + dSLengthOffset * col; |
| 482 | 587 | } |
| ... | ... | @@ -519,15 +624,15 @@ const Typesetting = props => { |
| 519 | 624 | if (cols === 0 || rows === 0) { |
| 520 | 625 | if (cols > 0) { |
| 521 | 626 | for (let col = 0; col < cols; col++) { |
| 522 | - const leftPosition = col * innerWidthCombined; | |
| 523 | - const topPosition = 0 * innerHeightCombined; | |
| 627 | + const leftPosition = col * (innerWidthCombined + boxLengthOffset); | |
| 628 | + const topPosition = 0 * (innerHeightCombined + boxWidthOffset); | |
| 524 | 629 | innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); |
| 525 | 630 | } |
| 526 | 631 | } |
| 527 | 632 | if (rows > 0) { |
| 528 | 633 | for (let row = 0; row < rows; row++) { |
| 529 | - const leftPosition = 0 * innerWidthCombined; | |
| 530 | - const topPosition = row * innerHeightCombined; | |
| 634 | + const leftPosition = 0 * (innerWidthCombined + boxLengthOffset); | |
| 635 | + const topPosition = row * (innerHeightCombined + boxWidthOffset); | |
| 531 | 636 | innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); |
| 532 | 637 | } |
| 533 | 638 | } |
| ... | ... | @@ -535,8 +640,8 @@ const Typesetting = props => { |
| 535 | 640 | let hasPushed = false; // 标志变量 |
| 536 | 641 | for (let col = 0; col < cols; col++) { |
| 537 | 642 | for (let row = 0; row < rows; row++) { |
| 538 | - const leftPosition = col * innerWidthCombined; | |
| 539 | - const topPosition = row * innerHeightCombined; | |
| 643 | + const leftPosition = col * (innerWidthCombined + boxLengthOffset); | |
| 644 | + const topPosition = row * (innerHeightCombined + boxWidthOffset + dXBJJ); | |
| 540 | 645 | innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); |
| 541 | 646 | } |
| 542 | 647 | // 如果可以放下首盒\ |
| ... | ... | @@ -546,11 +651,11 @@ const Typesetting = props => { |
| 546 | 651 | if (reference) { |
| 547 | 652 | // 是否首盒 |
| 548 | 653 | // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距 |
| 549 | - leftPosition = col * innerWidthCombined + dFLengthOffset; | |
| 550 | - topPosition = rows * innerHeightCombined + dFWidthOffset; | |
| 654 | + leftPosition = col * (innerWidthCombined + boxLengthOffset) + dFLengthOffset; | |
| 655 | + topPosition = rows * (innerHeightCombined + boxWidthOffset) + dFWidthOffset; | |
| 551 | 656 | } else { |
| 552 | - leftPosition = col * innerWidthCombined; | |
| 553 | - topPosition = rows * innerHeightCombined; | |
| 657 | + leftPosition = col * (innerWidthCombined + boxLengthOffset); | |
| 658 | + topPosition = rows * (innerHeightCombined + boxWidthOffset); | |
| 554 | 659 | } |
| 555 | 660 | innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition + dXBJJ, iFAngle, DisableMateriallIcon)); |
| 556 | 661 | } |
| ... | ... | @@ -561,11 +666,10 @@ const Typesetting = props => { |
| 561 | 666 | let topPosition = 0; |
| 562 | 667 | let leftPosition = 0; |
| 563 | 668 | if (reference) { |
| 564 | - topPosition = index * (innerHeightCombined + boxWidthOffset); | |
| 669 | + topPosition = index * (innerHeightCombined + boxWidthOffset) + dFWidthOffset; | |
| 565 | 670 | leftPosition = cols * (innerWidthCombined + boxLengthOffset); |
| 566 | 671 | } else { |
| 567 | - topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset); | |
| 568 | - | |
| 672 | + topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset) + dFWidthOffset; | |
| 569 | 673 | leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset + dYBJJ); |
| 570 | 674 | } |
| 571 | 675 | innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); |
| ... | ... | @@ -578,6 +682,7 @@ const Typesetting = props => { |
| 578 | 682 | onSaveDPartsLength(innerWidth, innerHeight, slaveData); |
| 579 | 683 | } |
| 580 | 684 | const propsData = innerDivs[innerDivs.length - 1]; |
| 685 | + const propsDataFirst = innerDivs[0]; | |
| 581 | 686 | let openEdition = 0; |
| 582 | 687 | if (propsData && L) { |
| 583 | 688 | const { dWlcd, sBillNo } = slaveRowData; |
| ... | ... | @@ -590,19 +695,20 @@ const Typesetting = props => { |
| 590 | 695 | const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); |
| 591 | 696 | // 判断列是否是单独的 |
| 592 | 697 | |
| 593 | - const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长 | |
| 594 | - const newMaterialWidth = parseFloat( | |
| 595 | - propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0) | |
| 596 | - ).toFixed(2); | |
| 597 | - | |
| 698 | + let newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长 | |
| 699 | + const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0)).toFixed(2); | |
| 700 | + // 如果只有一列的时候去除右边刀位 | |
| 701 | + if (cols === 1) { | |
| 702 | + newMaterialLength = newMaterialLength - dYBJJ | |
| 703 | + } | |
| 598 | 704 | // 计算开数 |
| 599 | 705 | let dSinglePQty = isVertical |
| 600 | 706 | ? remaining |
| 601 | 707 | ? cols + cols * (rows * 2) |
| 602 | 708 | : cols * (rows * 2) |
| 603 | 709 | : remaining |
| 604 | - ? rows + rows * (cols * 2) | |
| 605 | - : rows * (cols * 2); | |
| 710 | + ? rows + rows * (cols * 2) | |
| 711 | + : rows * (cols * 2); | |
| 606 | 712 | |
| 607 | 713 | let dHorizontalType = isVertical ? cols : remaining ? cols * 2 + 1 : cols * 2; |
| 608 | 714 | let dPortraitType = isVertical ? (remaining ? rows * 2 + 1 : rows * 2) : remaining ? rows : rows; |
| ... | ... | @@ -717,6 +823,8 @@ const Typesetting = props => { |
| 717 | 823 | |
| 718 | 824 | const confirmParam = commonFunc.showLocalMessage(props, "confirmParam", "排版尺寸大于上机尺寸,请确认参数!"); |
| 719 | 825 | const isJuantong = selectedNode.sTypeKey === "juantong"; |
| 826 | + const OpenVersion = commonFunc.showLocalMessage(props, "OpenVersion", "开版利用率"); | |
| 827 | + const DoorWidthDirection = commonFunc.showLocalMessage(props, "DoorWidthDirections", "门幅方向"); | |
| 720 | 828 | if (isCustomized && !isShow) { |
| 721 | 829 | if (isMobile) return; |
| 722 | 830 | message.error(confirmParam); |
| ... | ... | @@ -744,6 +852,7 @@ const Typesetting = props => { |
| 744 | 852 | const handleCancel = () => { |
| 745 | 853 | setIsModalOpen(false); |
| 746 | 854 | }; |
| 855 | + | |
| 747 | 856 | return ( |
| 748 | 857 | <> |
| 749 | 858 | {isShow ? ( |
| ... | ... | @@ -860,7 +969,7 @@ const Typesetting = props => { |
| 860 | 969 | textOrientation: "upright", |
| 861 | 970 | }} |
| 862 | 971 | > |
| 863 | - {"门幅方向"} | |
| 972 | + {DoorWidthDirection} | |
| 864 | 973 | </span> |
| 865 | 974 | ) : ( |
| 866 | 975 | "" |
| ... | ... | @@ -953,7 +1062,7 @@ const Typesetting = props => { |
| 953 | 1062 | <span style={{ color: "red" }}>{maxWidth}</span> |
| 954 | 1063 | {openEdition ? ( |
| 955 | 1064 | <span> |
| 956 | - <span>开版利用率:</span> | |
| 1065 | + <span>{OpenVersion}:</span> | |
| 957 | 1066 | <span style={{ color: "red" }}>{openEdition} %</span> |
| 958 | 1067 | </span> |
| 959 | 1068 | ) : null} |
| ... | ... | @@ -1232,7 +1341,7 @@ const Typesetting = props => { |
| 1232 | 1341 | textOrientation: "upright", |
| 1233 | 1342 | }} |
| 1234 | 1343 | > |
| 1235 | - {"门幅方向"} | |
| 1344 | + {DoorWidthDirection} | |
| 1236 | 1345 | </span> |
| 1237 | 1346 | ) : ( |
| 1238 | 1347 | "" |
| ... | ... | @@ -1329,7 +1438,7 @@ const Typesetting = props => { |
| 1329 | 1438 | <span style={{ color: "red" }}>{maxWidth}</span> |
| 1330 | 1439 | {openEdition ? ( |
| 1331 | 1440 | <span> |
| 1332 | - <span>开版利用率:</span> | |
| 1441 | + <span>{OpenVersion}:</span> | |
| 1333 | 1442 | <span style={{ color: "red" }}>{openEdition} %</span> |
| 1334 | 1443 | </span> |
| 1335 | 1444 | ) : null} |
| ... | ... | @@ -1463,6 +1572,8 @@ const Typesetting = props => { |
| 1463 | 1572 | </div> |
| 1464 | 1573 | </div> |
| 1465 | 1574 | </Modal> |
| 1575 | + | |
| 1576 | + | |
| 1466 | 1577 | </> |
| 1467 | 1578 | ); |
| 1468 | 1579 | }; | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -2452,6 +2452,7 @@ const BoxComponent = props => { |
| 2452 | 2452 | |
| 2453 | 2453 | let boxList = []; |
| 2454 | 2454 | const { sStripType = 0 } = selectedNode; |
| 2455 | + | |
| 2455 | 2456 | if ( |
| 2456 | 2457 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || |
| 2457 | 2458 | (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) || |
| ... | ... | @@ -2598,12 +2599,16 @@ const BoxComponent = props => { |
| 2598 | 2599 | } |
| 2599 | 2600 | const getImageUrl = (sName) => { |
| 2600 | 2601 | const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`; |
| 2601 | - return imageUrlNew | |
| 2602 | - } | |
| 2603 | - let imagesData = [ | |
| 2604 | - { src: getImageUrl(removeExtension(slaveRowData.sPackDetailPathUpLoad)), alt: "展开图" }, | |
| 2605 | - { src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" }, | |
| 2606 | - ]; | |
| 2602 | + return imageUrlNew; | |
| 2603 | + }; | |
| 2604 | + | |
| 2605 | + let imagesData = useMemo(() => { | |
| 2606 | + if (!slaveRowData) return []; | |
| 2607 | + return [ | |
| 2608 | + { src: getImageUrl(removeExtension(slaveRowData.sPackDetailPathUpLoad)), alt: "展开图" }, | |
| 2609 | + { src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" }, | |
| 2610 | + ]; | |
| 2611 | + }, [slaveRowData?.sPackDetailPathUpLoad, slaveRowData?.sPackPath]); | |
| 2607 | 2612 | if (!slaveRowData.sPackDetailPathUpLoad) { |
| 2608 | 2613 | imagesData = [{ src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" }]; |
| 2609 | 2614 | } else if (!slaveRowData.sPackPath) { |
| ... | ... | @@ -2713,6 +2718,7 @@ const BoxComponent = props => { |
| 2713 | 2718 | transform: " translate(-50%, -50%)", |
| 2714 | 2719 | width: "100%", |
| 2715 | 2720 | height: "200px", |
| 2721 | + margin:0 | |
| 2716 | 2722 | }} |
| 2717 | 2723 | > |
| 2718 | 2724 | <DynamicSVG {...svgProps} /> | ... | ... |