bodyCenterRight.vue 2.28 KB
<template>
	<div class="dv-content-body-center-list-right">
		<dv-border-box-12>
			<div class="div-center-d">
				<div class="stuts-style" style="padding-top: 0.5vw">
					<span style="padding: 0" class="div-span-title">机床运行效率</span>
				</div>

				<div class="dv-content-body-center-list-barChart" id="warehouseHealth"></div>
			</div>
		</dv-border-box-12>
	</div>
</template>

<script>
export default {
	data() {
		return {
			sysData: {
				getwarehouseHealth: null,
			},

			getwarehouseHealth: null,
			warehouseHealthOption: window.warehouseHealthOption,
		}
	},
	methods: {
		// 中间柱状图
		bingDataSource(data) {
			const newList = data.map((item) => {
				return {
					...item,
					oee: item.oee.replace('%', ''),
					utilization: item.utilization.replace('%', ''),
				}
			})
			let oee = newList.map((item) => item.oee)
			let utilization = newList.map((item) => item.utilization)
			let nameArr = newList.map((item) => item.equipmentName)
			let myChart = this.$echarts.init(document.getElementById('warehouseHealth'))
			this.warehouseHealthOption.series[0].data = oee
			this.warehouseHealthOption.series[1].data = utilization
			this.warehouseHealthOption.xAxis.data = nameArr

			myChart.clear()
			myChart.setOption(this.warehouseHealthOption)
			window.onresize = myChart.resize
		},
	},
}
</script>
<style lang="less" scoped>
.dv-content-body-center-list-right {
	width: 33vw;
	height: 95%;
	box-sizing: border-box;
	.stuts-style {
		display: flex;
		height: 20%;
		font-weight: 800;
		font-size: 1.3vw;
		color: aliceblue;
		text-indent: 1vw;
		box-sizing: border-box;
		div {
			display: flex;
			margin-left: 1vw;
			.yuxing {
				position: relative;
			}
			.yuxing-style {
				position: absolute;
				left: -1.7vw;
				top: 0.6vw;
				width: 0.5vw;
				height: 0.5vw;
				background-color: #04efcd;
			}
			.daiji {
				position: relative;
			}
			.daiji-style {
				position: absolute;
				left: -1.7vw;
				top: 0.6vw;
				width: 0.5vw;
				height: 0.5vw;
				background-color: #fdb300;
			}
			.guzhang {
				position: relative;
			}
			.guzhang-style {
				position: absolute;
				left: -1.7vw;
				top: 0.6vw;
				width: 0.5vw;
				height: 0.5vw;
				background-color: #f43d33;
			}
		}
	}
	.dv-content-body-center-list-barChart {
		width: 100%;
		height: 23.5vh;
	}
}
</style>