You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.6 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import React, { useState } from 'react';
import { Select } from 'antd';
import styles from './ProductionPlanManagement.less';
import OilProductionPlan from './second_oil_components/OilProductionPlan';
import HairOilProductionPlan from './second_oil_components/HairOilProductionPlan';
import BackflowProductionPlan from './second_oil_components/BackflowProductionPlan';
import MixingProductionPlan from './second_oil_components/MixingProductionPlan';
const ProductionPlanManagement = () => {
// 顶部一行选择:第一个为“基本信息/理化性质”,其余占位
const [firstMenu, setFirstMenu] = useState('oilProductionPlan');
const [secondMenu, setSecondMenu] = useState(undefined);
const [thirdMenu, setThirdMenu] = useState(undefined);
const [fourthMenu, setFourthMenu] = useState(undefined);
const [fifthMenu, setFifthMenu] = useState(undefined);
const firstMenuLabelMap = {
oilProductionPlan: '收油生产计划',
hairOilProductionPlan: '发油生产计划',
backflowProductionPlan: '倒灌生产计划',
mixingProductionPlan: '搅拌生产计划',
};
const renderFirstMenuContent = () => {
switch (firstMenu) {
case 'oilProductionPlan':
return <OilProductionPlan />;
case 'hairOilProductionPlan':
return <HairOilProductionPlan />;
case 'backflowProductionPlan':
return <BackflowProductionPlan />;
case 'mixingProductionPlan':
return <MixingProductionPlan />;
default:
return null;
}
};
return (
<div className={styles.container}>
<div className={styles.topBar}>
<div
className={styles.currentLabel}
>
当前{firstMenuLabelMap[firstMenu] || '未选择'}
</div>
<div className={styles.selectsWrapper}>
<Select
className={styles.topSelect}
value={firstMenu}
onChange={setFirstMenu}
options={[
{ label: '收油生产计划', value: 'oilProductionPlan' },
{ label: '发油生产计划', value: 'hairOilProductionPlan' },
{ label: '倒灌生产计划', value: 'backflowProductionPlan' },
{ label: '搅拌生产计划', value: 'mixingProductionPlan' },
]}
/>
<Select
className={styles.topSelect}
value={secondMenu}
onChange={setSecondMenu}
placeholder="发油生产计划"
options={[]}
disabled
/>
<Select
className={styles.topSelect}
value={thirdMenu}
onChange={setThirdMenu}
placeholder="倒灌生产计划"
options={[]}
disabled
/>
<Select
className={styles.topSelect}
value={fourthMenu}
onChange={setFourthMenu}
placeholder="搅拌生产计划"
options={[]}
disabled
/>
</div>
</div>
{renderFirstMenuContent()}
</div>
);
};
export default ProductionPlanManagement;