feat:表头颜色
This commit is contained in:
parent
5325ecd535
commit
a55e567899
|
@ -144,7 +144,7 @@ export const taskPriorityList: DictType[] = [
|
||||||
code: '1',
|
code: '1',
|
||||||
name: '不重要紧急',
|
name: '不重要紧急',
|
||||||
order: 2,
|
order: 2,
|
||||||
color: 'blue'
|
color: '#fafafa'
|
||||||
}, {
|
}, {
|
||||||
id: 0,
|
id: 0,
|
||||||
code: '0',
|
code: '0',
|
||||||
|
|
|
@ -57,7 +57,7 @@ export default function Layout({children}: { children: React.ReactNode }) {
|
||||||
<div>
|
<div>
|
||||||
<div className='firstRow' style={{display: 'flex'}}>
|
<div className='firstRow' style={{display: 'flex'}}>
|
||||||
<div className='leftUp'>
|
<div className='leftUp'>
|
||||||
<TreeTable search={leftUp}/>
|
<TreeTable search={leftUp} priority='3'/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id='tenUp' className='up'>
|
<div id='tenUp' className='up'>
|
||||||
|
@ -65,7 +65,7 @@ export default function Layout({children}: { children: React.ReactNode }) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='rightUp' >
|
<div className='rightUp' >
|
||||||
<TreeTable search={rightUp}/>
|
<TreeTable search={rightUp} priority='2'/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id='left' className='left'>
|
<div id='left' className='left'>
|
||||||
|
@ -73,14 +73,14 @@ export default function Layout({children}: { children: React.ReactNode }) {
|
||||||
</div>
|
</div>
|
||||||
<div className='secondRow' style={{display: 'flex'}}>
|
<div className='secondRow' style={{display: 'flex'}}>
|
||||||
<div className='leftDown'>
|
<div className='leftDown'>
|
||||||
<TreeTable search={leftDown}/>
|
<TreeTable search={leftDown} priority='1'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='up'>
|
<div className='up'>
|
||||||
<span id='upDown'>向上重要</span>
|
<span id='upDown'>向上重要</span>
|
||||||
</div>
|
</div>
|
||||||
{/*<div style={{float:'left',width:'48%',height: '48vh',background:"gray"}}>{children}</div>*/}
|
{/*<div style={{float:'left',width:'48%',height: '48vh',background:"gray"}}>{children}</div>*/}
|
||||||
<div className='rightDown'>
|
<div className='rightDown'>
|
||||||
<TreeTable search={rightDown}/>
|
<TreeTable search={rightDown} priority='0'/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import React, {useEffect, useState} from 'react';
|
import React, {useEffect, useState} from 'react';
|
||||||
import {Table} from 'antd';
|
import {ConfigProvider, Table} from 'antd';
|
||||||
import type {TableColumnsType, TableProps} from 'antd';
|
import type {TableColumnsType, TableProps} from 'antd';
|
||||||
import {getTaskTreeResult, taskPriorityList, taskStateList, taskTreeResult} from "@/app/lib/task/project/data";
|
import {getTaskTreeResult, taskPriorityList, taskStateList, taskTreeResult} from "@/app/lib/task/project/data";
|
||||||
import {DataType, ResponseVO, ResultPage} from "@/app/lib/definitions";
|
import {DataType, ResponseVO, ResultPage} from "@/app/lib/definitions";
|
||||||
|
@ -71,6 +71,7 @@ const rowSelection: TableRowSelection<DataType> = {
|
||||||
|
|
||||||
interface TableSearchType {
|
interface TableSearchType {
|
||||||
search?: any
|
search?: any
|
||||||
|
priority:string
|
||||||
}
|
}
|
||||||
|
|
||||||
const TreeTable: React.FC<TableSearchType> = (props) => {
|
const TreeTable: React.FC<TableSearchType> = (props) => {
|
||||||
|
@ -112,22 +113,34 @@ const TreeTable: React.FC<TableSearchType> = (props) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
console.log('taskPriorityList.find((item)=>item.code===props.priority)?.color',props.priority,taskPriorityList.find((item)=>item.code===props.search.priority)?.color)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
refreshDate();
|
refreshDate();
|
||||||
}, [props.search]);
|
}, [props.search]);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<ConfigProvider
|
||||||
|
theme={{
|
||||||
|
components: {
|
||||||
|
Table: {
|
||||||
|
headerBg:taskPriorityList.find((item)=>item.code===props.priority)?.color
|
||||||
|
/* 这里是你的组件 token */
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
// rowSelection={{ ...rowSelection, checkStrictly}}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{ pageSize: 5 }}
|
||||||
|
scroll={{ y: 280 }}
|
||||||
|
/>
|
||||||
|
</ConfigProvider>
|
||||||
{/*<Space align="center" style={{ marginBottom: 16 }}>*/}
|
{/*<Space align="center" style={{ marginBottom: 16 }}>*/}
|
||||||
{/* CheckStrictly: <Switch checked={checkStrictly} onChange={setCheckStrictly} />*/}
|
{/* CheckStrictly: <Switch checked={checkStrictly} onChange={setCheckStrictly} />*/}
|
||||||
{/*</Space>*/}
|
{/*</Space>*/}
|
||||||
{/*<ColorPicker defaultValue="#1677ff" showText/>*/}
|
{/*<ColorPicker defaultValue="#1677ff" showText/>*/}
|
||||||
<Table
|
|
||||||
columns={columns}
|
|
||||||
// rowSelection={{ ...rowSelection, checkStrictly}}
|
|
||||||
dataSource={data}
|
|
||||||
pagination={{ pageSize: 5 }}
|
|
||||||
scroll={{ y: 280 }}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue