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