assistant-todo/src/app/task/four/layout.tsx

70 lines
2.7 KiB
TypeScript
Raw Normal View History

2024-04-17 22:38:47 -04:00
'use client'
2024-04-12 06:43:55 -04:00
import SideNav from '@/app/ui/dashboard/sidenav';
2024-04-17 22:38:47 -04:00
import TreeTable from "@/app/ui/task/project/TreeTable";
import '@/app/ui/task/four/index.modules.css'
import {useEffect} from "react";
export default function Layout({children}: { children: React.ReactNode }) {
// useEffect(() => {
// // @ts-ignore
// const divWidth = document.getElementById('myDiv').offsetWidth;
// // @ts-ignore
// document.getElementById('mySpan').style.fontSize = divWidth + 'px';
// }, []); // 这里的空数组表示只在组件挂载时执行一次
//
// return (
// <>
// <div id="myDiv" style={{width: '200px'}}>
// Content
// </div>
// <span id="mySpan">Content</span>
// </>
// )
useEffect(() => {
// @ts-ignore
const divWidth = document.getElementById('tenUp').offsetWidth;
// @ts-ignore
document.getElementById('upUp').style.fontSize = divWidth + 'px';
// @ts-ignore
document.getElementById('upDown').style.fontSize = divWidth + 'px';
// @ts-ignore
const divHeight = document.getElementById('left').offsetHeight;
// @ts-ignore
document.getElementById('tenLeft').style.fontSize = divHeight/6*4 + 'px';
}, []);
2024-04-12 06:43:55 -04:00
return (
2024-04-17 22:38:47 -04:00
<div>
<div className='firstRow' style={{display: 'flex'}}>
<div className='leftUp'>
2024-04-19 05:44:44 -04:00
<TreeTable search={{name:"priority",value:"3",operateType:"="}}/>
2024-04-17 22:38:47 -04:00
</div>
<div id='tenUp' className='up'>
<span id='upUp'></span>
</div>
2024-04-19 05:44:44 -04:00
<div className='rightUp' >
<TreeTable search={{name:"priority",value:"2",operateType:"="}}/>
2024-04-17 22:38:47 -04:00
</div>
</div>
<div id='left' className='left'>
<span id='tenLeft' style={{fontSize:'1vh'}}></span>
</div>
<div className='secondRow' style={{display: 'flex'}}>
<div className='leftDown'>
2024-04-19 05:44:44 -04:00
<TreeTable search={{name:"priority",value:"1",operateType:"="}}/>
2024-04-17 22:38:47 -04:00
</div>
<div className='up'>
<span id='upDown'></span>
</div>
{/*<div style={{float:'left',width:'48%',height: '48vh',background:"gray"}}>{children}</div>*/}
<div className='rightDown'>
2024-04-19 05:44:44 -04:00
<TreeTable search={{name:"priority",value:"0",operateType:"="}}/>
2024-04-17 22:38:47 -04:00
</div>
2024-04-12 06:43:55 -04:00
</div>
</div>
);
2024-04-17 22:38:47 -04:00
}