| | |
| | | </div>
|
| | | </div>
|
| | |
|
| | | <!-- <button @click="submitLayouts" style="position: fixed; top: 90px; right: 20px; padding: 10px; background: #409eff; color: white; border: none; border-radius: 5px; cursor: pointer;">-->
|
| | | <!-- 保存调整-->
|
| | | <!-- </button>-->
|
| | | <button @click="submitLayouts" style="position: fixed; top: 90px; right: 20px; padding: 10px; background: #409eff; color: white; border: none; border-radius: 5px; cursor: pointer;">
|
| | | 保存调整
|
| | | </button>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | |
| | | const submitLayouts = async () => {
|
| | | layouts.value.forEach(layout => {
|
| | | layout.glassDetails.forEach(glassDetail => {
|
| | | glassDetail.x = Math.round(glassDetail.x);
|
| | | glassDetail.y = Math.round(glassDetail.y);
|
| | | glassDetail.width = Math.round(glassDetail.width);
|
| | | glassDetail.height = Math.round(glassDetail.height);
|
| | | glassDetail.x = parseFloat(glassDetail.x.toFixed(2));
|
| | | glassDetail.y = parseFloat(glassDetail.y.toFixed(2));
|
| | | glassDetail.width = parseFloat(glassDetail.width.toFixed(2));
|
| | | glassDetail.height = parseFloat(glassDetail.height.toFixed(2));
|
| | | });
|
| | | });
|
| | | const savedProjectNo = localStorage.getItem('projectNo');
|
| | |
| | | glassDetail.glassPoint.forEach(point => {
|
| | | point.X += offsetX;
|
| | | point.Y += offsetY;
|
| | | // 添加精度控制
|
| | | point.X = parseFloat(point.X.toFixed(2));
|
| | | point.Y = parseFloat(point.Y.toFixed(2));
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | (props.gh - 100) / layout.height
|
| | | );
|
| | |
|
| | | glassDetail.x = Math.round(glassDetail.x);
|
| | | glassDetail.y = Math.round(glassDetail.y);
|
| | | glassDetail.x = parseFloat(glassDetail.x.toFixed(2));
|
| | | glassDetail.y = parseFloat(glassDetail.y.toFixed(2));
|
| | | adjustAlignmentPosition(layoutIndex, rectIndex);
|
| | | }
|
| | |
|
| | |
| | | else {
|
| | | // 无法合并,保存当前矩形,开始新的合并
|
| | | merged.push({
|
| | | x: Math.round(current.x),
|
| | | y: Math.round(current.y),
|
| | | width: Math.round(current.width),
|
| | | height: Math.round(current.height),
|
| | | x: current.x,
|
| | | y: current.y,
|
| | | width: current.width,
|
| | | height: current.height,
|
| | | isRemain: true
|
| | | });
|
| | | current = { ...next };
|
| | |
| | |
|
| | | // 添加最后一个矩形
|
| | | merged.push({
|
| | | x: Math.round(current.x),
|
| | | y: Math.round(current.y),
|
| | | width: Math.round(current.width),
|
| | | height: Math.round(current.height),
|
| | | x: current.x,
|
| | | y: current.y,
|
| | | width: current.width,
|
| | | height: current.height,
|
| | | isRemain: true
|
| | | });
|
| | |
|
| | |
| | | // 添加新的余料矩形
|
| | | uniqueArr.forEach((area) => {
|
| | | newGlassDetails.push({
|
| | | x: Math.round(area.x),
|
| | | y: Math.round(area.y),
|
| | | width: Math.round(area.width),
|
| | | height: Math.round(area.height),
|
| | | x: area.x,
|
| | | y: area.y,
|
| | | width: area.width,
|
| | | height: area.height,
|
| | | isRemain: true
|
| | | });
|
| | | });
|
| | |
| | | // 旋转90度后的坐标(顺时针)
|
| | | point.X = originalState.x + relY;
|
| | | point.Y = originalState.y + (originalState.width - relX);
|
| | | // 添加精度控制
|
| | | point.X = parseFloat(point.X.toFixed(2));
|
| | | point.Y = parseFloat(point.Y.toFixed(2));
|
| | | });
|
| | | }
|
| | | adjustGrayRectangles(layoutIndex);
|
| | |
| | | glassDetail.glassPoint.forEach(point => {
|
| | | point.X += offsetX;
|
| | | point.Y += offsetY;
|
| | | // 添加精度控制
|
| | | point.X = parseFloat(point.X.toFixed(2));
|
| | | point.Y = parseFloat(point.Y.toFixed(2));
|
| | | });
|
| | | }
|
| | | adjustGrayRectangles(layoutIndex);
|
| | |
| | | if (glassDetail.glassPoint && Array.isArray(glassDetail.glassPoint)) {
|
| | | glassDetail.glassPoint.forEach(point => {
|
| | | point.X = width - point.X;
|
| | | point.X = parseFloat(point.X.toFixed(2));
|
| | | point.Y = parseFloat(point.Y.toFixed(2));
|
| | | });
|
| | | }
|
| | | });
|
| | |
| | | if (glassDetail.glassPoint && Array.isArray(glassDetail.glassPoint)) {
|
| | | glassDetail.glassPoint.forEach(point => {
|
| | | point.Y = height - point.Y;
|
| | | // 添加精度控制
|
| | | point.X = parseFloat(point.X.toFixed(2));
|
| | | point.Y = parseFloat(point.Y.toFixed(2));
|
| | | });
|
| | | }
|
| | | });
|