footerRight.vue 2.5 KB
<template>
	<div class="dv-content-body-bottom-list-right">
		<div class="dv-content-body-bottom-list-right-title">库存任务信息</div>
		<div class="dv-content-body-bottom-list-right-table">
			<dv-scroll-board :config="pickup" style="width: 100%;" />
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			getList: null,
			sysData: {},
			pickup: {},
		}
	},
	methods: {
		getData(data) {
			if (!data || !Array.isArray(data)) {
				this.pickup = {
					header: ['任务号', '任务类型', '任务状态', '任务起点', '任务终点', '开始时间'],
					data: [],
					align: ['center', 'left', 'center', 'center', 'center', 'center', 'center'],
					columnWidth: [90, 120, 110, 100, 100, 100],
					headerHeight: 30,
					rowNum: 4,
				}
				return
			}
			// 重用数组,避免频繁创建新数组
			if (!this.pickup.data) {
				this.pickup.data = []
			} else {
				this.pickup.data.length = 0 // 清空数组
			}
			// 确保pickup对象结构完整
			if (!this.pickup.header) {
				this.pickup = {
					header: ['任务号', '任务类型', '任务状态', '任务起点', '任务终点', '开始时间'],
					data: this.pickup.data,
					align: ['center', 'left', 'center', 'center', 'center', 'center', 'center'],
					columnWidth: [90, 120, 110, 100, 100, 100],
					headerHeight: 30,
					rowNum: 4,
				}
			}
			data.forEach((item) => {
				var eleIsstackdata = `<span style="display: block;width:40px;height:15px;border:1px solid #00c860;text-align:center;line-height:15px;margin-top:7px;color:#00c860">执行中</span>`
				if (item.taskStatus == '待执行') {
					eleIsstackdata = `<span style="display: block;width:40px;height:15px;text-align:center;line-height:15px;margin-top:7px;">待执行</span>`
				}
				const startTimes = this.$moment(item.created).format(' HH:mm')
				this.pickup.data.push([item.taskId, item.taskType, eleIsstackdata, item.from, item.to, startTimes])
			})
		},
	},
}
</script>

<style lang="less" scoped>
.dv-content-body-bottom-list-right {
	width: 49%;
	height: 95%;
	border: 1.5px solid hsl(208.57deg 51.22% 40.2%);
}

.dv-content-body-bottom-list-right-title {
	width: 97%;
	height: 23px;
	margin: auto;
	display: flex;
	font-size: 14px;
	color: #fff;
	flex-direction: column;
	justify-content: center;
}

.dv-content-body-bottom-list-right-table {
	width: 97%;
	height: 80%;
	margin: auto;
}
</style>
<style>
.dv-scroll-board .header .header-item {
	font-size: 1.8vh !important;
}

.dv-scroll-board .rows div.ceil {
	font-size: 11px !important;
}
</style>