<template>
	<view class="zd_container">
		<!-- <nav-bar title="人工呼叫套轴顺序"></nav-bar> -->
		<nav-bar :title="title"></nav-bar>
		<view class="zd_content">
			<view class="zd_wrapper grid-wraper">
				<view class="slide_new">
					<table>
						<thead>
							<tr>
								<th>序号</th>
								<th class="th_2">设备</th>
								<th>位置</th>
								<th>尺寸</th>
								<th>状态</th>
								<th>代数</th>
								<th>呼叫时间</th>
							</tr>
						</thead>
						<tbody>
							<tr v-for="(e, i) in dataList" :key="i">
								<td>{{Number(i) + 1}}</td>
								<td class="td_2">{{e.resource_name}}</td>
								<td>{{['上轴', '下轴'][Number(e.up_or_down) - 1]}}</td>
								<td>{{e.qzz_size}}</td>
								<td>{{getStatusText(e.status)}}</td>
								<td>{{e.qzz_generation}}</td>
								<td>{{e.start_time}}</td>
							</tr>
						</tbody>
					</table>
				</view>
			</view>
		</view>
		<up-top ref="UT" :scrollTop="top"></up-top>
	</view>
</template>

<script>
	import NavBar from '@/components/NavBar.vue'
	import UpTop from '@/components/upTop.vue'
	import {showManualView} from '@/utils/getData2.js'
	export default {
		components: {
			NavBar,
			UpTop
		},
		data() {
			return {
				title: '',
				top: 0,
				dataList: []
			};
		},
		onLoad (options) {
			this.title = options.title
		},
		onPageScroll(e) {
			this.$refs.UT.topData(e.scrollTop)
		},
		created () {
			this._showManualView()
		},
		methods: {
			getStatusText(status) {
				const statusMap = {
					'01': '准备套轴',
					'02': '正在配送',
					'03': '配送完成'
				}
				return statusMap[status] || '已完成'
			},
			async _showManualView () {
				let res = await showManualView()
				if (res) {
					this.dataList = [...res]
				}
			}
		}
	}
</script>

<style scoped>
.zd_content {
	padding-bottom: 30rpx;
}
</style>