headCenter.vue 4.6 KB
<template>
	<div style="width: 100%;height: 100%;display: flex;">
		<div style="width: 20%;height: 100%;">
			<div style="width: 100%; height: 100%; position: relative; left: 0vw; top: 0vw;">
				<div class="location">
					<div class="item" style="margin-bottom: 15px;">
						<div class="name">焊机</div>
						<div class="value">38台</div>
					</div>
					<div class="item" style="margin-bottom: 15px;">
						<div class="name">带锯床</div>
						<div class="value">1台</div>
					</div>
					<div class="item">
						<div class="name">切坡一体机</div>
						<div class="value">1台</div>
					</div>
				</div>
			</div>
		</div>
		<div style="width: 60%;height: 100%;border: 2px solid #3879c9;">
			<div class="title-text">在线设备</div>
			<div class="container">
				<!-- 每列数据 -->
				<div v-for="(item, index) in dataList" :key="index" class="column-wrapper">
					<div class="data-column">
						<!-- 上半部分:实际电流 -->
						<div class="data-item">
							<div class="value2">{{ item.current }}</div>
							<div class="label">实际电流</div>
						</div>
						<!-- 虚线分隔 -->
						<div class="divider"></div>
						<!-- 下半部分:实际电压 -->
						<div class="data-item">
							<div class="value2">{{ item.voltage }}</div>
							<div class="label">实际电压</div>
						</div>
					</div>
					<!-- 列标题 -->
					<div class="column-title">{{ item.title }}</div>
				</div>
			</div>
		</div>
		<div style="width: 20%;height: 100%;">
			<div style="width: 100%; height: 100%; position: relative; left: 0vw; top: 0vw;">
				<div class="location">
					<div class="item" style="margin-bottom: 15px;background-color: #33af3362;">
						<div class="name" style="color: #00d200;">在线</div>
						<div class="value" style="color: #00d200;">35台</div>
					</div>
					<div class="item" style="background-color: #ff00005e;">
						<div class="name" style="color: #ff0000;">故障</div>
						<div class="value" style="color: #ff0000;">0台</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>

export default {
	data() {
		return {
			sysinfo: [],
			form: {
			},
			dataList: [
				{ current: '22A', voltage: '220V', title: '1号焊机' },
				{ current: '22A', voltage: '220V', title: '2号焊机' },
				{ current: '22A', voltage: '220V', title: '5号焊机' },
				{ current: '22A', voltage: '220V', title: '8号焊机' },
				{ current: '22A', voltage: '220V', title: '带锯床' },
				{ current: '22A', voltage: '220V', title: '切坡一体机' }
			]
		}
	},
	methods: {
		sed(data) {
			this.form = data;
		},
	},
	mounted() {
		debugger

	},
}
</script>

<style lang="scss" scoped>
.title-text {
	width: 100%;
	height: 3vh;
	font-size: 2vh;
	font-weight: 600;
	color: #fff;
	text-align: left;
	padding-left: 1vw;
}

.location {
	height: 100%;
	display: flex;
	// border: 2px solid #3879c9;
	flex-direction: column;
	justify-content: space-between;
	// align-items: center;
	margin: 0vh 7px 0px 7px;
}

.location2 {
	height: 100%;
	display: flex;
	// border: 2px solid #3879c9;
	justify-content: space-between;
	// align-items: center;
	margin: 0px 0 10px 7px;
}

.box {
	flex: 1;
	/* 左右各占50%宽度 */
	height: 100%;
	display: flex;
	// flex-direction: column;
	/* 内部item上下排列 */
	justify-content: space-around;
	/* item均匀分布 */
	// align-items: center;
	/* item水平居中 */
}

.item {
	width: 90%;
	height: 44%;
	border-radius: 5px;
	border: 1px solid #67c8fb;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	/* 名称左、数值右 */
	align-items: center;
	/* 内容垂直居中 */
	padding: 0 10px;

	/* 内容不贴边框 */
	background-color: #062448;
}

/* 名称/数值样式区分 */
.name {
	color: #fff;
	font-size: 18px;
}

.value {
	color: #67c8fb;
	font-size: 24px;
	font-weight: bold;
}

.container {
	display: flex;
	flex-wrap: wrap;
	gap: 2.4vh;
	/* 列之间的间距 */
	padding: 1vh;
	// background-color: #0a1428;
	color: #fff;
}

.column-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	// 控制整体列宽
	min-width: 8.4vw;
	height: 100%;
}

.data-column {
	width: 100%;
	border: 2px solid #00bfff;
	border-radius: 8px;
	padding: 2.7vh;
	box-sizing: border-box;
	text-align: center;
}

.data-item {
	// margin-bottom: 16px;
	text-align: center;
}

.value2 {
	font-size: 3vh;
	font-weight: bold;
	color: #00bfff;
	margin-bottom: 0.4vh;
}

.label {
	font-size: 12px;
	color: #ccc;
}

.divider {
	width: 100%;
	height: 1px;
	border-top: 1px dashed #00bfff;
	margin: 10px 0;
	// color: #e30b0ba5;
}

.column-title {
	font-size: 14px;
	color: #ccc;
	margin-top: 10px;
	text-align: center;
}
</style>