add SpecPL

This commit is contained in:
lb 2023-09-10 19:23:34 +08:00
parent e9153c3b41
commit 3e7205e5b4
5 changed files with 47 additions and 156 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

View File

@ -1,126 +1,45 @@
import cls from './index.module.css';
import BottomBarItem from '../BottomBarItem';
import { Switch, Radio } from 'antd';
import ReactECharts from 'echarts-for-react';
import * as echarts from 'echarts';
import { randomInt } from '../../../utils';
import { useState } from 'react'; import { useState } from 'react';
import cls from './index.module.less';
import { ScrollBoard } from '@jiaminghi/data-view-react';
import BottomBarItem from '../BottomBarItem';
function FaultType(props) { const TodayTableData = (props) => {
const options = { const [config, setConfig] = useState({
colors: [ // headerBGC: 'rgba(4, 44, 76, 0.3)',
'#2760FF', // headerBGC: 'rgba(4, 44, 76, .8)',
'#5B9BFF', headerBGC: '#044A8425',
'#FFD160', header: [
'#8167F6', '<span style="color:#fff">产线名<span/>',
'#99D66C', '<span style="color:#fff">原板宽度<span/>',
'#FF8A40', '<span style="color:#fff">净板宽度<span/>',
'#12FFF5', '<span style="color:#fff">玻璃厚度<span/>',
], ],
grid: { // oddRowBGC: '#042444',
left: 0, oddRowBGC: '#044A8425',
top: 0, // evenRowBGC: '#042c4c',
bottom: 0, evenRowBGC: '#0B549945',
right: 0, columnWidth: [90],
}, headerHeight: 40,
legend: { hoverPause: false,
icon: 'circle',
top: 32,
right: 0,
bottom: 32,
width: 296,
height: 130,
itemGap: 30,
formatter: function (name) {
return `${name} {sub|${
options.series[0].data.find((o) => o.name == name).value
}}`;
},
textStyle: {
color: '#DFF1FE',
fontSize: 16,
rich: {
sub: {
color: '#fff9',
fontSize: 16,
},
},
},
},
series: [
{
type: 'pie',
center: ['26%', '54%'],
radius: ['55%', '75%'],
avoidLabelOverlap: false,
label: {
show: true,
formatter: '{d}%',
fontSize: 14,
color: 'inherit',
},
labelLine: {
length: 0,
},
// emphasis: {
// label: {
// show: true,
// fontSize: 40,
// fontWeight: 'bold',
// },
// },
// labelLine: {
// show: false,
// },
data: [ data: [
{ value: 1048, name: '缺陷1' }, ['产线1', '1000mm', '1000mm', '3.2mm'],
{ value: 735, name: '缺陷2' }, ['产线2', '100mm', '100mm', '2.2mm'],
{ value: 580, name: '缺陷3' }, ['产线3', '100mm', '100mm', '2.0mm'],
{ value: 484, name: '缺陷4' }, ['产线4', '100mm', '100mm', '2.1mm'],
{ value: 300, name: '缺陷5' }, ['产线5', '100mm', '100mm', '2.2mm'],
{ value: 300, name: '缺陷6' },
{ value: 300, name: '缺陷8' },
], ],
}, });
],
};
const [lines, setLines] = useState([
{ id: 1, label: '产线1', value: 'l1' },
{ id: 2, label: '产线2', value: 'l2' },
{ id: 3, label: '产线3', value: 'l3' },
{ id: 4, label: '产线4', value: 'l4' },
{ id: 5, label: '产线5', value: 'l5' },
]);
return ( return (
<BottomBarItem <BottomBarItem icon="signal" title="当前产线生产规格" className={cls.spec}>
icon="puzzle" <div className={cls.todayTableData}>
title="产线当日缺陷分类" <ScrollBoard
className={cls.faultType} config={config}
> className={cls.tableClass}
<div className={cls.headWidget}> style={{ height: '100%' }}
{/* 日周月年 */} />
<Radio.Group
defaultValue="l1"
buttonStyle="solid"
className={cls.radioGroup}
>
{lines.map((l, index) => (
<Radio.Button
key={l.label}
value={l.value}
className={`radio-group__item ${cls['radio-group__item']}`}
>
{l.label}
</Radio.Button>
))}
</Radio.Group>
</div>
<div className={cls.chart}>
<ReactECharts option={options} style={{ height: '100%' }} />
</div> </div>
</BottomBarItem> </BottomBarItem>
); );
} };
export default FaultType; export default TodayTableData;

View File

@ -1,39 +0,0 @@
.chart {
height: 100%;
}
.faultType {
position: relative;
height: 100%;
}
.headWidget {
position: absolute;
top: 28px;
right: 24px;
height: 32px;
width: 340px;
text-align: right;
}
.radioGroup * {
border: none !important;
border-radius: 0 !important;
}
.radioGroup *:focus-within {
box-shadow: none !important;
}
.radioGroup *::before {
width: 0 !important;
}
.radioGroup_button_wrapper {
color: #fff !important;
background: #03233c !important;
}
.radio-group__item {
padding: 0 8px;
}

View File

@ -0,0 +1,7 @@
.spec {
height: 100%;
}
.todayTableData {
height: 100%;
}

View File

@ -9,6 +9,7 @@ import IconSmoke from '../assets/Icon/icon-taiji.png';
import IconChart from '../assets/Icon/icon-chart.png'; import IconChart from '../assets/Icon/icon-chart.png';
import IconPuzzle from '../assets/Icon/icon-puzzle.png'; import IconPuzzle from '../assets/Icon/icon-puzzle.png';
import IconPause from '../assets/Icon/icon-pause.png'; import IconPause from '../assets/Icon/icon-pause.png';
import IconSignal from '../assets/Icon/icon-signal.png';
const Container = (props) => { const Container = (props) => {
let icon = useRef(null); let icon = useRef(null);
@ -35,6 +36,9 @@ const Container = (props) => {
case 'pause': case 'pause':
icon.current = IconPause; icon.current = IconPause;
break; break;
case 'signal':
icon.current = IconSignal;
break;
} }
return ( return (