footerCenterYuanLiao.vue 4.16 KB
<template>
	<div class="dv-content-body-bottom-list-center">
		<dv-border-box-12 :dur="35">
			<div class="div-center-d">
				<div class="stuts-style" style="padding-top: 2px">
					<span style="padding: 0" class="div-span-title">AGV实时状态</span>
					<div>
						<div class="yuxing">
							<div class="yuxing-style"></div>
						</div>
						<span>运行</span>
					</div>
					<div>
						<div class="daiji">
							<div class="daiji-style"></div>
						</div>
						<span>等包</span>
					</div>
					<div>
						<div class="guzhang">
							<div class="guzhang-style"></div>
						</div>
						<span>故障</span>
					</div>
				</div>

				<el-carousel indicator-position="none" :interval="10000">
					<el-carousel-item v-for="item in initDataList" :key="item.index">
						<div style="width: 200px;height:10px ;font-size: 1vw; color: paleturquoise;font-weight: 500;margin-left: 3.2vw;">{{ item.xiangdao }}</div>
						<div class="dv-content-body-center-list-center-image">
							<div class="dv-content-body-center-list-center-image-details" v-for="item2 in item.list" :key="item2.index">
								<img v-show="item2.status == 1" src="@/assets/img/greenNEW.png" alt="" />
								<img v-show="item2.status == 2" src="@/assets/img/orangeNew.png" alt="" />
								<img v-show="item2.status == 3" src="@/assets/img/rednew.gif" alt="" />
								<div style="width: 100%; height: 0px; text-align: center; font-size: 10px">{{ item2.RobotNo }}</div>
							</div>
						</div>
					</el-carousel-item>
				</el-carousel>
			</div>
		</dv-border-box-12>
	</div>
</template>

<script>
export default {
	data() {
		return {
			sysData: {},
			initDataList: [{ xiangdao: 'AGV', list: null }],
			sysInitTimeNum: 60,
			sysTimeNum: 60,
		}
	},
	methods: {
		// AGV
		getDataOne() {
			let opt = {
				//urlSuffix: 'http://172.16.43.155:6001/api/BulletinBoard/Mes/V1/ReadData3',
				urlSuffix: 'http://10.13.83.4:8080/jeecg-boot/api/v1/getAbnormal',
				logTitle: '一号线',
				isUrlALL: true,
				initCallBackFn: () => {
					this.ajaxSuccessDataBefore(null)
				},
			}

			let callBackFn = (res) => {
				if (!this.ajaxSuccessDataBeforeOne(res, opt.logTitle)) return
				this.getroadwayOne()
			}
			''.ajax(this, opt, callBackFn)
		},

		getroadwayOne() {
			this.initDataList[0].list = this.sysData
		},
		// AGV
		ajaxSuccessDataBeforeOne(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getDataOne')

				return false
			}
			return true
		},

		intInterval: function() {
			''.intInterval(this, this.sysInitTimeNum, () => {
				this.getDataOne()
			})
		},
	},
	mounted() {
		//eslint-disable-next-line no-debugger
		debugger
		this.getDataOne()
		//线上环境自动开启定时器 本地一定要测试定时器 会存在数据多次绑定问题4
		// 【发布的时候要取消注释】
		this.intInterval()
	},
}
</script>

<style lang="less" scoped>
.dv-content-body-center-list {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 35%;
}
.dv-content-body-bottom-list-center {
	width: 33vw;
	height: 95%;
	/* background-color: #a5c8ca; */
	.stuts-style {
		display: flex;
		height: 20%;
		font-weight: 800;
		font-size: 1vw;
		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-center-image {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		height: 20vh;
		.dv-content-body-center-list-center-image-details {
			width: 31%;
			height: 29%;
			color: #fff;
			margin-left: 2px;
			img {
				width: 40px;
				height: 22px;
				margin-left: 28%;
			}
		}
	}
}
</style>