index.tsx 2.5 KB
import React from 'react'
import './style.less'
import NavBar from "@/components/nav-bar"
import {baseColorPrimary} from "@/utils/common";
import {hexToRgba} from "@/utils/utils";
import { useNavigate } from "react-router-dom";


const ProductionManagement: React.FC = () => {
    const navigate = useNavigate();

    const list = [
        {
            id: '1',
            name: '车顶生产线A'
        },
        {
            id: '2',
            name: '车顶生产线B'
        },
        {
            id: '3',
            name: '车顶生产线C'
        },
        {
            id: '4',
            name: '车顶生产线D'
        },
        {
            id: '5',
            name: '车顶生产线E'
        },
        {
            id: '6',
            name: '车顶生产线F'
        },
        {
            id: '7',
            name: '车顶生产线G'
        },
        {
            id: '8',
            name: '车顶生产线H'
        },
        {
            id: '9',
            name: '车顶生产线I'
        },
        {
            id: '10',
            name: '车顶生产线J'
        },
        {
            id: '11',
            name: '车顶生产线K'
        },
        {
            id: '12',
            name: '车顶生车顶生车顶生产线L'
        },
        {
            id: '13',
            name: '车顶生产线M'
        },
        {
            id: '14',
            name: '车顶生产线N'
        }
    ];

    const toProductionList = (item: any) => {
        console.log('toProductionList-item', item)
        navigate(`/production/list?id=${item?.id}&name=${item?.name}`);
    }


    return (
        <div className={'sxjx-content-main sxjx-layout-main-unfoot'}>
            <div className={'production-management'}>
                <NavBar title={'生产线管理'}/>
                <div className={'production-management_list'}>
                    {
                        list?.map((item: any) => {
                            return  <div
                                key={item?.id}
                                className={'production-management_list-item'}
                                style={{backgroundColor: hexToRgba(baseColorPrimary, 0.6)}}
                                onClick={() => toProductionList(item)}
                            >
                                {item?.name}
                            </div>
                        })
                    }
                </div>
            </div>
        </div>
    )
}

export default ProductionManagement;