foodConten.vue 2.4 KB
<template>
	<div class="stacker-status-container">
		<!-- 顶部标题栏 -->
		<div class="status-header">
			<span class="div-span-title">堆垛机当前状态</span>
			<div class="status-legend">
				<div class="legend-item">
					<span class="legend-color color-run"></span>
					<span>运行</span>
				</div>
				<div class="legend-item">
					<span class="legend-color color-idle"></span>
					<span>待机</span>
				</div>
				<div class="legend-item">
					<span class="legend-color color-error"></span>
					<span>故障</span>
				</div>
			</div>
		</div>

		<!-- 主体内容区 -->
		<div id="status-chart"></div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			sysData: {},
			initDataList: [],
			dianLiangOne: window.dianLiangOne,
		}
	},
	methods: {
		// 生产情况
		getData() {
			// 初始化ECharts实例
			let myChart = this.$echarts.init(document.getElementById('status-chart'))
			// this.warehouseHealthOption.series[0].data = countArr
			// this.dianLiangOne.xAxis.data = nameArr

			myChart.clear()
			myChart.setOption(this.dianLiangOne)
			window.onresize = myChart.resize
		},
		ajaxSuccessDataBefore(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getData')
				this.initproductionInformationTable([])
				return false
			}
			return true
		},
	},
	mounted() {
		this.getData()
		//eslint-disable-next-line no-debugger
		debugger
	},
}
</script>

<style scoped>
/* 最外层容器:深色背景,和截图一致 */
.stacker-status-container {
	width: 32vw;
	height: 22vw;
	border: 1px solid #1e3a7a;
	border-radius: 0.3vw;
	/* padding: 1.5vw; */
	position: relative;
	overflow: hidden;
}

/* 顶部标题栏 */
.status-header {
	width: 100%;
	height: 3vw;
	display: flex;
	padding: 0.2vw 0 0 0.5vw;
}

/* 状态图例 */
.status-legend {
	display: flex;
	font-size: 1.8vw;
	color: #ffffff;
	margin: -1.6vw 0 0 5vw;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 0.5vw;
	font-size: 1.1vw;
}

.legend-color {
	width: 1vw;
	height: 1vw;
	border-radius: 0.2vw;
	margin-left: 1vw;
}
.color-run {
	background-color: #00e068;
}
.color-idle {
	background-color: #ffb800;
}
.color-error {
	background-color: #ff3333;
}
.color-offline {
	background-color: #888888;
}

/* 主体内容区:左右分栏 */
#status-chart {
	width: 100%;
	height: calc(100%);
	display: flex;
	align-items: center;
	/* gap: 3vw; */
}
</style>