footerRightYuanLiao.vue 4.32 KB
<template>
	<div class="dv-content-body-bottom-list-right">
		<dv-border-box-12 :dur="35" :color="[, '#ffffff']">
			<el-carousel indicator-position="none" :interval="10000">
				<el-carousel-item v-for="item in initDataList" :key="item.index">
					<div style="width: 100; height: 10%">
						<span class="div-span-title">{{ item.TunnelName }}</span>
					</div>
					<div style="width: 100%; height: 88%">
						<dv-scroll-board :config="item.tableList" style="width: 97%; margin-top: -0.2vw; margin-left: 0.4vw" />
					</div>
				</el-carousel-item>
			</el-carousel>
		</dv-border-box-12>
	</div>
</template>

<script>
export default {
	data() {
		return {
			// 轮播数组
			initDataList: [
				{ TunnelName: 'AGV报警', tableList: null },
				{ TunnelName: '堆垛机报警', tableList: null },
			],
			getList: null,
			tableroadwayList: null,
			sysInitTimeNum: 60,
			sysTimeNum: 60,
			sysData: {},
			sysDataThree: [],
			sysDataFour: [],
		}
	},
	methods: {
		// AGV报警信息获取数据
		getDataThree() {
			let opt = {
				//urlSuffix: 'http://172.16.43.155:6001/api/BulletinBoard/Mes/V1/ReadData2',
				urlSuffix: 'http://10.13.83.4:8080/jeecg-boot/api/v1/getAbnormal',
				logTitle: 'AGV报警',
				headers: false,
				isUrlALL: true,
				initCallBackFn: () => {
					this.ajaxSuccessDataBefore(null)
				},
			}

			let callBackFn = (res) => {
				if (!this.ajaxSuccessDataBeforeThree(res, opt.logTitle)) return
				this.sysDataThree = res.data.result

				this.getroadwayThree()
			}
			''.ajax(this, opt, callBackFn)
		},
		// '堆垛机报警信息'
		getDataFour() {
			let opt = {
				//urlSuffix: 'https://mock.apifox.cn/m1/3152972-0-default/api/Board/GetEquipmentInfo',
				urlSuffix: 'http://10.13.83.3:8066/api/Board/GetEquipmentInfo',
				logTitle: '堆垛机报警信息',
				headers: false,
				isUrlALL: true,
				initCallBackFn: () => {
					this.ajaxSuccessDataBefore(null)
				},
			}

			let callBackFn = (res) => {
				if (!this.ajaxSuccessDataBeforeFour(res, opt.logTitle)) return
				this.sysDataFour = res.data.result.EquipmentAlarms
				this.getDataTableFour()
			}
			''.ajax(this, opt, callBackFn)
		},

		// AGV报警信息获取数据
		getroadwayThree() {
			let rGVDataThree = []
			this.sysDataThree.forEach((item) => {
				let time = item.alarmTime.substring(0, 10)
				rGVDataThree.push([item.agvNum, item.alarmInfo, time])
			})

			this.initDataList[0].tableList = {
				data: rGVDataThree,
				align: ['left'],
				headerBGC: '#201e1e', //表头
				oddRowBGC: '#021c66',
				evenRowBGC: '#65,105,225',
				rowNum: 8,
				headerHeight: 25,
				carousel: 'page',
				waitTime: 8000,
			}
		},
		getDataTableFour() {
			let tempList = []
			this.sysDataFour.forEach((item) => {
				let timeData = new Date(item.DateTime).format('yyyy-MM-dd')
				tempList.push([item.Equipment, item.AlarmMsg, timeData])
			})
			this.initDataList[1].tableList = {
				//header: ['设备', '故障信息', '时间'],
				data: tempList,
				align: ['left'],
				headerBGC: '#201e1e', //表头
				oddRowBGC: '#021c66',
				evenRowBGC: '#65,105,225',
				rowNum: 5,
				columnWidth: [130, 180, 150],
				headerHeight: 25,
				carousel: 'page',
				waitTime: 8000,
			}
		},

		// AGV报警信息获取数据
		ajaxSuccessDataBeforeThree(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getDataThree')

				return false
			}
			return true
		},

		// 堆垛机报警信息
		ajaxSuccessDataBeforeFour(res, title) {
			if (res.data.result == null || res.data.result.length == 0) {
				''.Log(title + '无数据', 'getDataFour')

				return false
			}
			return true
		},

		intInterval: function() {
			''.intInterval(this, this.sysInitTimeNum, () => {
				this.getDataThree()
				this.getDataFour()
			})
		},
	},
	mounted() {
		//eslint-disable-next-line no-debugger
		debugger

		// AGV报警信息
		this.getDataThree()
		// 堆垛机报警信息
		this.getDataFour()
		//线上环境自动开启定时器 本地一定要测试定时器 会存在数据多次绑定问题4
		// 【发布的时候要取消注释】
		this.intInterval()
	},
}
</script>

<style lang="less" scoped>
.dv-content-body-bottom-list-right {
	width: 33vw;
	height: 95%;
	//background-color: #63a9ad;
}
.dv-scroll-board .header .header-item {
	font-size: 1vw !important;
}
.dv-scroll-board .rows div.ceil {
	font-size: 0.8vw !important;
}
</style>