stand2026_10_06

This commit is contained in:
marco committed 2026-10-06 15:34:27 +02:00
1 parent 41f80ce947
commit 266f8c3b4f
199 files changed
+17061 -87

No files matched your search

@@ -0,0 +1,76 @@
"use client";
import { Anlage } from "@/types/rk";
import Modal from "@/components/ui/Modal";
import { GroupResponse } from "@/types/anlagen/groups";
import { useEffect, useState } from "react";
import { useGroups } from "@/hooks/rk2/useGroups";
import { UnitResponse } from "@/types/anlagen/units";
import { useUnit } from "@/hooks/rk2/useUnit";
import { ComponentResponse } from "@/types/anlagen/components";
interface Params {
anlage?: Anlage,
groups: GroupResponse[],
units: UnitResponse[]
}
export const AusgabeUnitInfo = ({ anlage, groups, units }: Params) => {
const {getPathToRoot} = useGroups({groups})
const getUnitInfo = (unit:UnitResponse) =>{
let groupId = unit.groupId;
let uGroupPath = getPathToRoot(groupId);
let unitName = [unit.prefix,unit.bmk,unit.name]
if(unit.postfix) unitName.push(unit.postfix)
let typ = unit.type;
//--- Components
let txt = "";
txt = uGroupPath.map((g)=>g.name).join('\t')+'\t';
txt += "\t" + unitName.join('_')+'\t';
//txt += "\tTyp:" + typ+'\n';
//txt += "\t\tKomponenten:"+'\n'
unit.components.forEach((comp)=>{
let cName:string[] = []
comp.prefix && cName.push(comp.prefix);
comp.name && cName.push(comp.name + (comp.index ? comp.index.toString():""));
//comp.index && cName.push();
comp.postfix && cName.push(comp.postfix);
//,comp.name,comp.index,comp.postfix
txt += '\t' + cName.join('_')+''
})
return txt;
}
const getComponentData = (comp:ComponentResponse) =>{
const name = [comp.prefix, comp.name,comp.index, comp.postfix]
}
const getText = ()=>{
let txt = ""
units.forEach((u)=> txt += getUnitInfo(u)+`\n`)
return txt;
}
return (
<div>
<textarea className="w-full h-100" value={getText()} />
</div >
)
}