| | |
| | | return {
|
| | | position: 'absolute',
|
| | | left: `${glassDetail.x * scale}px`,
|
| | | bottom: `${glassDetail.y * scale}px`,
|
| | | top: `${glassDetail.y * scale}px`,
|
| | | width: `${glassDetail.width * scale}px`,
|
| | | height: `${glassDetail.height * scale}px`,
|
| | | backgroundColor: glassDetail.isRemain ? '#f0f0f0' : '#a0d8ef',
|
| | |
| | | const updateLayout = () => {
|
| | | if (!layoutPanel.value) return;
|
| | | //layouts.value = props.layoutData.layouts;
|
| | | if (!props.layoutData) {
|
| | | console.warn('layoutData 为空');
|
| | | return;
|
| | | }
|
| | |
|
| | | console.log('RectRenderer 接收到的 layoutData:', props.layoutData);
|
| | | processId.value=props.layoutData.projectNo;
|
| | | let originalFilm = ref([])
|
| | | //layouts.value =
|
| | | props.layoutData.layouts.forEach(items=>{
|
| | | const existingItem = originalFilm.value.find(item => item.mergeId === items.mergeId);
|
| | | if (existingItem) {
|
| | | // 存在:数量加1(假设字段为 count)
|
| | | existingItem.quantity += 1;
|
| | | } else {
|
| | | originalFilm.value.push(items);
|
| | | }
|
| | | })
|
| | | layouts.value=originalFilm.value
|
| | | layoutDetails.value.push(props.layoutData)
|
| | | materialDetails.value=props.materialDetails
|
| | | console.log(layouts.value)
|
| | | // 处理 layouts 数据
|
| | | if (props.layoutData.layouts && Array.isArray(props.layoutData.layouts)) {
|
| | | let originalFilm = [];
|
| | |
|
| | | props.layoutData.layouts.forEach(items => {
|
| | | const existingItem = originalFilm.find(item => item.mergeId === items.mergeId);
|
| | | if (existingItem) {
|
| | | existingItem.quantity += 1;
|
| | | } else {
|
| | | originalFilm.push(items);
|
| | | }
|
| | | });
|
| | |
|
| | | layouts.value = originalFilm;
|
| | | layoutDetails.value.push(props.layoutData);
|
| | | materialDetails.value = props.materialDetails;
|
| | | console.log('处理后的 layouts:', layouts.value);
|
| | | } else {
|
| | | console.warn('layouts 数据格式不正确或为空');
|
| | | }
|
| | | adjustPrintLayout();
|
| | | // 强制重新渲染
|
| | | layoutPanel.value.offsetHeight; // 触发布局更新
|