驾驶舱

This commit is contained in:
2024-01-08 16:59:42 +08:00
parent d619db3d89
commit 10ad3acf9c
19 changed files with 776 additions and 165 deletions

View File

@@ -17,6 +17,9 @@ export default {
}
},
computed: {
israCheckType() {
return this.$store.state.websocket.israCheckType
},
israDayStatistic() {
return this.$store.state.websocket.israDayStatistic
},
@@ -34,7 +37,7 @@ export default {
israDayStatistic: {
handler(newVal, oldVal) {
if (this.chartTime === '日') {
this.tempData = israDayStatistic
this.tempData = this.israDayStatistic
this.updateChart()
}
}
@@ -42,7 +45,7 @@ export default {
israWeekStatistic: {
handler(newVal, oldVal) {
if (this.chartTime === '周') {
this.tempData = israWeekStatistic
this.tempData = this.israWeekStatistic
this.updateChart()
}
}
@@ -50,7 +53,7 @@ export default {
israMonthStatistic: {
handler(newVal, oldVal) {
if (this.chartTime === '月') {
this.tempData = israMonthStatistic
this.tempData = this.israMonthStatistic
this.updateChart()
}
}
@@ -58,7 +61,7 @@ export default {
israYearStatistic: {
handler(newVal, oldVal) {
if (this.chartTime === '年') {
this.tempData = israYearStatistic
this.tempData = this.israYearStatistic
this.updateChart()
}
}
@@ -80,56 +83,34 @@ export default {
this.chart.dispose()
}
this.chart = echarts.init(this.$el);
let legendData = []
let xData = []
let yData = []
let seriesData = []
for (let i = 0;i < this.israCheckType.length; i++) {
let obj = {}
obj.type = 'bar'
obj.stack = 'all'
obj.emphasis = {
focus:"series"
}
obj.name = this.israCheckType[i]
obj.barWidth = 12
obj.data = []
for (let j = 0;j < this.tempData.length; j++) {
for (let k = 0; k < this.tempData[j].data.length; k++) {
if (this.israCheckType[i] === this.tempData[j].data[k].checkType) {
obj.data.push(this.tempData[j].data[k].checkNum)
}
}
}
seriesData.push(obj)
}
this.tempData && this.tempData.length > 0 && this.tempData.map(item => {
xData.push(item.name)
})
var series = [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
stack: 'all',
name: 'a',
barWidth: 12,
},
{
data: [10, 46, 64, '-', 0, '-', 0],
type: 'bar',
stack: 'all',
name: 'b',
barWidth: 12,
},
{
data: [30, '-', 0, 20, 10, '-', 0],
type: 'bar',
stack: 'all',
barWidth: 12,
name: 'c'
},
{
data: [30, '-', 0, 20, 10, '-', 0],
type: 'bar',
stack: 'all',
barWidth: 12,
name: 'd'
},
{
data: [10, 20, 150, 0, '-', 50, 10],
type: 'bar',
stack: 'all',
name: 'e',
barWidth: 12,
label: {
show: true,
position: 'top'
}
}
];
var option = {
color: ['#2760FF','#5B9BFF','#FFD160','#8167F6', '#99D66C', '#FF8A40'],
grid: { top: 40, right: 12, bottom: 20, left: 48 },
color: ["#2760FF", "#8167F6", "#5B9BFF", "#99D66C", "#FFD160", "#FF8A40"],
grid: { top: 80, right: 12, bottom: 20, left: 48 },
legend: {
top: 10,
left: 80,
@@ -142,7 +123,7 @@ export default {
color: "#DFF1FE",
fontSize: 12,
},
data:['a','b','c','d','e'],
data:this.israCheckType,
},
xAxis: {
type: "category",
@@ -191,7 +172,7 @@ export default {
},
className: "defect-chart-tooltip"
},
series: series
series: seriesData
};
option && this.chart.setOption(option)
}

View File

@@ -119,19 +119,19 @@ export default {
}
switch (this.chartType) {
case '氧气含量':{
temp2 = temp1.O2_float || []
temp2 = temp1?.O2_float || []
break;
}
case '二氧化硫':{
temp2 = temp1.SO2_float || []
temp2 = temp1?.SO2_float || []
break;
}
case '一氧化氮':{
temp2 = temp1.NOX_float || []
temp2 = temp1?.NOX_float || []
break;
}
case '颗粒物':{
temp2 = temp1.dust_float || []
temp2 = temp1?.dust_float || []
break;
}
default:

View File

@@ -221,6 +221,7 @@ export default {
series: seriesData,
tooltip: {
trigger: 'axis',
className: "gas-tooltip"
},
}
option && this.chart.setOption(option)
@@ -269,3 +270,13 @@ export default {
height: 100%;
}
</style>
<style>
.gas-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.gas-tooltip * {
color: #fff !important;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<div class="scroll-board-container">
<dv-scroll-board :config="config" :style="{'width':width,'height':height}" />
<dv-scroll-board :config="config" :style="{'width':width,'height':height}" :ref='id'/>
</div>
</template>
<script>
@@ -18,6 +18,10 @@ export default {
height:{
type: String,
default: '380px'
},
id:{
type: String,
default: ''
}
},
data() {
@@ -25,14 +29,4 @@ export default {
}
}
}
</script>
<style lang='scss'>
.scroll-board-container {
.dv-scroll-board .rows .ceil, .dv-scroll-board .header .header-item {
border-right: 1px solid rgba(13, 23, 40, 1);
}
.dv-scroll-board .rows .ceil:last-child, .dv-scroll-board .header .header-item:last-child {
border-right: none;
}
}
</style>
</script>

View File

@@ -7,7 +7,7 @@
<template>
<div class="switcher" style="display: flex; align-items: center; gap: 12px">
<el-switch v-model="value"></el-switch>
<el-switch v-model="value" @change="handleClick"></el-switch>
<span style="color: #fff; font-size: 16px">{{ mode }}</span>
;
</div>
@@ -17,18 +17,31 @@
export default {
name: 'Switcher',
components: {},
props: {},
props: {
showTitle:{
type: Array,
required: true,
default: () => {
return []
}
}
},
data() {
return {
value: true,
value: false,
};
},
computed: {
mode() {
return this.value ? '历史详情' : '实时数据';
return this.value ? this.showTitle[0]: this.showTitle[1];
},
},
methods: {},
methods: {
handleClick(v) {
this.value = v;
this.$emit('emitFun', v);
}
},
};
</script>

View File

@@ -0,0 +1,317 @@
<template>
<div class="yield-rate-chart"></div>
</template>
<script>
import * as echarts from 'echarts';
import resize from './../mixins/resize'
import { formatDate } from '@/utils'
export default {
name: 'GasChart',
mixins: [resize],
components: {},
props: {
chartType: '', // 能源类型
chartTime: ''
},
data() {
return {
chart: null
};
},
computed: {
cutChartDay() {
return this.$store.state.websocket.cutChartDay
},
cutChartWeek() {
return this.$store.state.websocket.cutChartWeek
},
cutChartMonth() {
return this.$store.state.websocket.cutChartMonth
},
cutChartYear() {
return this.$store.state.websocket.cutChartYear
}
},
watch: {
cutChartDay: {
handler(newVal, oldVal) {
if (this.chartTime === '日') {
this.updateChart()
}
}
},
cutChartWeek: {
handler(newVal, oldVal) {
if (this.chartTime === '周') {
this.updateChart()
}
}
},
cutChartMonth: {
handler(newVal, oldVal) {
if (this.chartTime === '月') {
this.updateChart()
}
}
},
cutChartYear: {
handler(newVal, oldVal) {
if (this.chartTime === '年') {
this.updateChart()
}
}
},
chartTime: {
handler(newVal, oldVal) {
console.log("===================")
console.log(newVal)
this.updateChart()
}
},
chartType: {
handler(newVal, oldVal) {
this.updateChart()
}
}
},
mounted() {
this.$el.addEventListener('resize', () => {
console.log('resziing.....');
});
this.updateChart()
},
methods: {
updateChart() {
let chartData = []
let xData = []
let dayArr = []
let nightArr = []
let sumArr = []
let seriesData = []
switch(this.chartTime) {
case '日':
chartData = this.cutChartDay
break;
case '周':
chartData = this.cutChartWeek
break;
case '月':
chartData = this.cutChartMonth
break;
case '年':
chartData = this.cutChartYear
break;
default:
}
chartData && chartData.length > 0 && chartData.map(item => {
if (this.chartTime === '日') {
xData.push((item.dataTime).slice(11))
}else{
xData.push((item.dataTime).slice(0,10))
}
dayArr.push((item.day * 100).toFixed(2))
nightArr.push((item.night * 100).toFixed(2))
sumArr.push((item.sum * 100).toFixed(2))
})
if (this.chartType) {
seriesData = [{
color: '#ff9e00',
name: 'sum',
data: sumArr,
type: "line",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB5940' },
{ offset: 0.5, color: '#FFCB5920' },
{ offset: 1, color: '#FFCB5900' },
]),
},
lineStyle: {
width: 1
},
symbolSize: 1,
emphasis: {
focus: 'series'
}
},
{
color: '#08d8cd',
name: 'day',
data: dayArr,
type: "line",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#12FFF540" },
{ offset: 0.5, color: "#12FFF520" },
{ offset: 1, color: "#12FFF510" },
]),
},
lineStyle: {
width: 1
},
symbolSize: 1,
emphasis: {
focus: 'series'
}
},
{
color: '#0b58ff',
name: 'night',
data: nightArr,
type: "line",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#2760FF40" },
{ offset: 0.5, color: "#2760FF20" },
{ offset: 1, color: "#2760FF10" },
]),
},
lineStyle: {
width: 1
},
symbolSize: 1,
emphasis: {
focus: 'series'
}
}]
}else{
seriesData = [{
color: '#ff9e00',
name: 'sum',
data: sumArr,
type: "line",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB5940' },
{ offset: 0.5, color: '#FFCB5920' },
{ offset: 1, color: '#FFCB5900' },
]),
},
lineStyle: {
width: 1
},
symbolSize: 1,
emphasis: {
focus: 'series'
}
}]
}
// 绘图
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose() // 页面多次刷新会出现警告Dom已经初始化了一个实例这是销毁实例
}
this.chart = echarts.init(this.$el);
var option = {
grid: { top: 15, right: 12, bottom: 45, left: 60 },
xAxis: {
type: 'category',
data: xData,
axisLabel: {
color: "#fff",
fontSize: 10,
rotate: 25,
margin: 13,
},
axisTick: { show: false },
axisLine: {
lineStyle: {
width: 1,
color: '#213259',
},
},
},
yAxis: {
nameTextStyle: {
color: '#fff',
fontSize: 10,
align: 'right',
},
type: 'value',
axisLabel: {
color: "#fff",
fontSize: 12,
formatter: "{value} %",
},
axisLine: {
show: true,
lineStyle: {
color: '#213259',
},
},
splitLine: {
lineStyle: {
color: '#213259a0',
},
},
interval: 10,
min: 0,
max: 100,
},
series: seriesData,
tooltip: {
trigger: 'axis',
className: "yield-rate-tooltip"
},
}
option && this.chart.setOption(option)
},
getXdata() {
const today = new Date();
const currentYear = today.getFullYear();
const currentMonth = today.getMonth() + 1;
let days = 30;
if (this.chartTime === '周') {
return Array(7)
.fill(1)
.map((_, index) => {
const today = new Date();
const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
dtimestamp
).getDate()}`;}).reverse()
}else if (this.chartTime == "月") {
if (currentMonth in [1, 3, 5, 7, 8, 10, 12]) {
days = 31;
} else if (currentMonth == 2) {
days = this.isLeapYear(currentYear) ? 29 : 28;
}
return Array(days)
.fill(1)
.map((_, index) => {
return `${currentMonth}.${days - index}`;}).reverse()
} else {
return Array(12)
.fill(1)
.map((_, index) => {
return `${currentYear}.${12 - index}`;}).reverse()
}
},
isLeapYear(year) {
return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
}
},
};
</script>
<style scoped lang="scss">
.yield-rate-chart {
width: 100%;
height: 100%;
}
</style>
<style>
.yield-rate-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.yield-rate-tooltip * {
color: #fff !important;
}
</style>

View File

@@ -2,17 +2,21 @@
<div style="flex: 1;">
<Container name="各工序缺陷汇总" size="small" style="">
<div style="padding: 5px 10px;">
<ScrollBoard :config = "config" width='575px' height='380px'/>
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='defectScrollBoard'/>
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container.vue';
import ScrollBoard from '../components/ScrollBoard'
export default {
name: 'DefectSum',
components: { Container, ScrollBoard },
components: { Container },
computed: {
defectSum() {
return this.$store.state.websocket.defectSum
}
},
data() {
return {
config: {
@@ -23,21 +27,25 @@ export default {
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60],
align: ['center'],
data: [
[1, '产线1', '行1列3', '', ''],
[2, '产线2', '行2列3', '', ''],
[3, '产线3', '行3列3', '', ''],
[4, '产线4', '行4列3', '', ''],
[5, '产线5', '行5列3', '', ''],
[6, '产线6', '行6列3', '', ''],
[7, '产线7', '行7列3', '', ''],
[8, '产线8', '行8列3', '', ''],
[9, '产线9', '行9列3', '', ''],
[10, '产线10', '行10列3', '', '']
],
data: [],
rowNum: 10
}
}
},
watch:{
defectSum: {
handler(newVal, oldVal) {
let outArr = this.defectSum.map((item, index) => [
index+1,
item.productionLineName,
item.sectionName,
item.count,
item.inspectionTypeName
]);
this.config.data = outArr
this.$refs['defectScrollBoard'].updateRows(outArr)
}
}
}
}
</script>

View File

@@ -2,19 +2,24 @@
<div style="flex: 1;">
<Container name="设备报警" size="small" style="">
<div style="padding: 5px 10px;">
<ScrollBoard :config = "config" width='575px' height='380px'/>
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='eqScrollBoard'/>
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container.vue';
import ScrollBoard from '../components/ScrollBoard'
export default {
name: 'EqAlarm',
components: { Container, ScrollBoard },
components: { Container },
computed: {
sjgEquipment() {
return this.$store.state.websocket.sjgEquipment
}
},
data() {
return {
// config:{}
config: {
header: ['序号', '设备名称', '设备编码','设备状态','是否故障'],
// headerHeight: '17',
@@ -38,6 +43,23 @@ export default {
rowNum: 10
}
}
},
mounted(){
},
watch:{
sjgEquipment: {
handler(newVal, oldVal) {
let outArr = this.sjgEquipment.map((item, index) => [
index+1,
item.name,
item.code,
item.status,
item.error? '是': '否'
]);
this.config.data = outArr
this.$refs['eqScrollBoard'].updateRows(outArr)
}
}
}
}
</script>

View File

@@ -2,17 +2,21 @@
<div style="flex: 1;">
<Container name="工单监控" size="small" style="">
<div style="padding: 5px 10px;">
<ScrollBoard :config = "config" width='575px' height='380px'/>
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='worderScrollBoard'/>
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container.vue';
import ScrollBoard from '../components/ScrollBoard'
export default {
name: 'WorkOrderMonitoring',
components: { Container, ScrollBoard },
components: { Container },
computed: {
order() {
return this.$store.state.websocket.workOrder
}
},
data() {
return {
config: {
@@ -21,23 +25,41 @@ export default {
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60],
columnWidth: [60, 120, 80, 60, 80, 120, 120, 120],
align: ['center'],
data: [
[1, '设备1', '行1列3', '', '','','',''],
[2, '设备2', '行2列3', '', '','','',''],
[3, '设备3', '行3列3', '', '','','',''],
[4, '设备4', '行4列3', '', '','','',''],
[5, '设备5', '行5列3', '', '','','',''],
[6, '设备6', '行6列3', '', '','','',''],
[7, '设备7', '行7列3', '', '','','',''],
[8, '设备8', '行8列3', '', '','','',''],
[9, '设备9', '行9列3', '', '','','',''],
[10, '设备10', '行10列3', '', '','','','']
[1, '工单1', '行1列3', '', '','','',''],
[2, '工单2', '行2列3', '', '','','',''],
[3, '工单3', '行3列3', '', '','','',''],
[4, '工单4', '行4列3', '', '','','',''],
[5, '工单5', '行5列3', '', '','','',''],
[6, '工单6', '行6列3', '', '','','',''],
[7, '工单7', '行7列3', '', '','','',''],
[8, '工单8', '行8列3', '', '','','',''],
[9, '工单9', '行9列3', '', '','','',''],
[10, '工单10', '行10列3', '', '','','','']
],
rowNum: 10
}
}
},
watch:{
order: {
handler(newVal, oldVal) {
let outArr = this.order.map((item, index) => [
index+1,
item.name,
item.specifications,
item.lines,
item.status,
item.planFinishTime,
item.planQuantity,
item.planAssignQuantity
]);
this.config.data = outArr
this.$refs['worderScrollBoard'].updateRows(outArr)
}
}
}
}
</script>

View File

@@ -45,7 +45,7 @@
import Container from '../components/Container';
import ShadowRect from '../components/ShadowRect.vue';
import SplitLine from '../components/line';
import Switcher from '../components/Switcher';
// import Switcher from '../components/Switcher';
import EnergeTop from './EnergeTop';
import GasChart from '../components/GasChart.vue';
import SelectorBtnGroup from '../components/SelectorBtnGroup';
@@ -55,7 +55,6 @@ export default {
Container,
ShadowRect,
SplitLine,
Switcher,
EnergeTop,
GasChart,
SelectorBtnGroup,

View File

@@ -42,10 +42,10 @@
<script>
import Container from '../components/Container.vue';
import ShadowRect from '../components/ShadowRect.vue';
import Switcher from '../components/Switcher';
// import Switcher from '../components/Switcher';
export default {
name: 'FanSequence',
components: { Container, ShadowRect, Switcher },
components: { Container, ShadowRect },
computed: {
fanFrequencyInfo() {
return this.$store.state.websocket.fanFrequencyInfo

View File

@@ -23,7 +23,7 @@
">
氧气含量
</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.O2_float ? (exhaustGasInfo?.O2_float).toFixed(2): ''}}%</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.O2_float ? (Number(exhaustGasInfo.O2_float)).toFixed(2) : ''}}%</span>
</ShadowRect>
<ShadowRect>
<div
@@ -38,7 +38,7 @@
<p style="margin: 0; line-height: inherit">一氧化氮</p>
<p style="margin: 0; line-height: inherit">排放浓度</p>
</div>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.NOX_float ? (exhaustGasInfo?.NOX_float).toFixed(2):''}}mg/</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.NOX_float ? (Number(exhaustGasInfo.NOX_float)).toFixed(2) : ''}}mg/</span>
</ShadowRect>
<ShadowRect>
@@ -54,7 +54,7 @@
<p style="margin: 0; line-height: inherit">二氧化硫</p>
<p style="margin: 0; line-height: inherit">排放浓度</p>
</div>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.SO2_float ? (exhaustGasInfo?.SO2_float).toFixed(2): ''}}mg/</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.SO2_float ? (Number(exhaustGasInfo.SO2_float)).toFixed(2) : ''}}mg/</span>
</ShadowRect>
<ShadowRect>
@@ -69,7 +69,7 @@
">
颗粒物浓度
</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.dust_float ? (exhaustGasInfo?.dust_float).toFixed(2) : ''}}mg/</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.dust_float ? (Number(exhaustGasInfo.dust_float)).toFixed(2) : ''}}mg/</span>
</ShadowRect>
</div>
<KilnLine :horizontal="true" />
@@ -110,7 +110,7 @@
import Container from '../components/Container';
import ShadowRect from '../components/ShadowRect.vue';
import KilnLine from '../components/line';
import Switcher from '../components/Switcher';
// import Switcher from '../components/Switcher';
import SelectorBtnGroup from '../components/SelectorBtnGroup';
import FlueGas from '../components/FlueGas';
@@ -120,7 +120,6 @@ export default {
Container,
ShadowRect,
KilnLine,
Switcher,
SelectorBtnGroup,
FlueGas,
},

View File

@@ -22,13 +22,12 @@
import Container from '../components/Container';
import ShadowRect from '../components/ShadowRect.vue';
import KilnLine from '../components/line';
import Switcher from '../components/Switcher';
import SelectorBtnGroup from '../components/SelectorBtnGroup';
import KilnInfo from './KilnInfo.vue';
import GasHandle from './GasHandle.vue';
export default {
name: 'RightTwo',
components: { Container, Switcher, SelectorBtnGroup, KilnLine, ShadowRect, KilnInfo, GasHandle },
components: { Container, SelectorBtnGroup, KilnLine, ShadowRect, KilnInfo, GasHandle },
props: {},
data() {
return {};

View File

@@ -2,17 +2,21 @@
<div style="flex: 1;">
<Container name="订单完成情况" size="small" style="">
<div style="padding: 5px 10px;">
<ScrollBoard :config = "config" width='575px' height='230px'/>
<dv-scroll-board :config="config" style="width:575px;height:230px" ref='orderScrollBoard'/>
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container'
import ScrollBoard from '../components/ScrollBoard'
export default {
name: 'OrderStatus',
components: { Container, ScrollBoard },
components: { Container },
computed: {
order() {
return this.$store.state.websocket.order
}
},
data() {
return {
config: {
@@ -38,6 +42,20 @@ export default {
rowNum: 6
}
}
},
watch:{
order: {
handler(newVal, oldVal) {
let outArr = this.order.map((item) => [
item.startProduceTime,
item.name,
item.specifications,
item.completeRate
]);
this.config.data = outArr
this.$refs['orderScrollBoard'].updateRows(outArr)
}
}
}
}
</script>

View File

@@ -1,20 +1,53 @@
<template>
<div style="flex: 2;" class="aaa">
<Container name="本日生产良品率" size="small" style="">
<ScrollBoard :config = "config" width='575px' height='300px'/>
<div style="flex: 2;">
<Container name="本日生产良品率" size="small">
<div style="padding: 5px 10px;">
<dv-scroll-board :config="config" style="width:575px;height:230px" ref='yieldRateScrollBoard'/>
</div>
<KilnLine :horizontal="true" />
<div class="" style="flex: 2; padding: 8px">
<div
class="header-line"
style="margin: 8px 0 16px; display: flex; align-items: center">
<h2 class="" style="margin: 0; color: #0ee8fe; margin-right: 5px">
生产良品率
</h2>
<Switcher :showTitle='["班次详情","班次详情"]' @emitFun='changeType'/>
<div style="width: 169px;">
<span class="lgd lgd-total">总量</span>
<span class="lgd lgd-day" v-show='chartType'>白班</span>
<span class="lgd lgd-night" v-show='chartType'>夜班</span>
</div>
<div>
<SelectorBtnGroup :options="['日', '周', '月', '年']" @emitFun='toggleDate' :active='chartTime'/>
</div>
</div>
<div class="chart" style="height: 230px;">
<YieldRateChart :chartTime='chartTime' :chartType='chartType'/>
</div>
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container';
import Container from '../components/Container'
import ScrollBoard from '../components/ScrollBoard'
import KilnLine from '../components/line'
import Switcher from '../components/Switcher'
import SelectorBtnGroup from '../components/SelectorBtnGroup';
import YieldRateChart from '../components/YieldRateChart'
export default {
name: 'YieldRate',
components: { Container, ScrollBoard },
components: { Container, ScrollBoard, KilnLine, Switcher, SelectorBtnGroup, YieldRateChart },
computed: {
yieldRateTable() {
return this.$store.state.websocket.yieldRateTable
}
},
data() {
return {
config: {
header: ['序号', '设备名称', '设备编码','设备状态','是否故障'],
header: ['产线', '一等率', '二等率','成品率','废品率'],
// headerHeight: '17',
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
@@ -22,24 +55,71 @@ export default {
columnWidth: [60],
align: ['center'],
data: [
[1, '设备1', '行1列3', '', ''],
[2, '设备2', '行2列3', '', ''],
[3, '设备3', '行3列3', '', ''],
[4, '设备4', '行4列3', '', ''],
[5, '设备5', '行5列3', '', ''],
[6, '设备6', '行6列3', '', ''],
[7, '设备7', '行7列3', '', ''],
[8, '设备8', '行8列3', '', ''],
[9, '设备9', '行9列3', '', ''],
[10, '设备10', '行10列3', '', '']
[1, '产线1', '49%', '', ''],
[2, '产线2', '49%', '', ''],
[3, '产线3', '49%', '', ''],
[4, '产线4', '49%', '', ''],
[5, '产线5', '49%', '', '']
],
rowNum: 10
}
rowNum: 5
},
chartType:false,
chartTime: "日"
}
},
watch:{
yieldRateTable: {
handler(newVal, oldVal) {
let outArr = this.yieldRateTable.map((item) => [
item.lineName,
item.first,
item.second,
item.product,
item.waste
]);
this.config.data = outArr
this.$refs['yieldRateScrollBoard'].updateRows(outArr)
}
}
},
methods: {
changeType(val) {
this.chartType = val
},
// 切换时间
toggleDate(val) {
this.chartTime = val
}
}
}
</script>
<style lang='scss'>
<style lang='scss' scoped>
.lgd {
color: #fff;
&:not(:last-child) {
margin-right: 12px;
}
}
.lgd::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
margin-right: 4px;
border-radius: 2px;
}
.lgd.lgd-total::before {
background-color: #ff9e00;
}
.lgd.lgd-day::before {
background-color: #08d8cd;
}
.lgd.lgd-night::before {
background-color: #0b58ff;
}
</style>