<template>
	<view class="shipInfo">
		<head-view :title="title" url="/pages/shipWork/documentList"></head-view>
		<view class="container contentFixed">
			<view class="ul">
				<view class="li">
					<p>船名：</p><text>{{shipInfo.vslCnname}}</text>
				</view>
				<view class="li">
					<p>总重：</p><text>{{shipInfo.vslGton}}</text>
				</view>
				<view class="li">
					<p>净重：</p>
					<text>{{shipInfo.vslNetton}}</text>
				</view>
				<view class="li">
					<p>长度：</p>
					<text>{{shipInfo.vslLoa}}</text>
				</view>
				<view class="li">
					<p>宽度：</p>
					<text>{{shipInfo.vslBreadth}}</text>
				</view>
				<view class="li">
					<p>空载吃水：</p>
					<text>{{shipInfo.vslDraftunload}}</text>
				</view>
				<view class="li">
					<p>重载吃水：</p>
					<text>{{shipInfo.vslDraftload}}</text>
				</view>
				<view class="li">
					<p>舱口高度：</p>
					<text>{{shipInfo.spmCabinht}}</text>
				</view>
				<view class="li">
					<p>最低作业潮水：</p>
					<text>{{shipInfo.spmMintide}}</text>
				</view>
				<view class="li">
					<p>驾驶台位置：</p>
					<text>{{shipInfo.spmCab}}</text>
				</view>
				<view class="li">
					<p>跳板中左：</p>
					<text>{{shipInfo.spmBoardCentrele}}</text>
				</view>
				<view class="li">
					<p>跳板前左：</p>
					<text>{{shipInfo.spmBoardFrontle}}</text>
				</view>
				<view class="li">
					<p>跳板后左：</p>
					<text>{{shipInfo.spmBoardLaterle}}</text>
				</view>
				<view class="li">
					<p>跳板中右：</p>
					<text>{{shipInfo.spmBoardCentrerg}}</text>
				</view>
				<view class="li">
					<p>跳板后右 ：</p>
					<text>{{shipInfo.spmBoardLaterrg}}</text>
				</view>
				<view class="li">
					<p>跳板前右：</p>
					<text>{{shipInfo.spmBoardFrontrg}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import sqlite from "../../common/sqlite.js"
	export default {
		data() {
			return {
				title: "船名 - 船舶资料",
				shipInfo: {},
				vtpId: "",
			}
		},
		mounted() {
			let title = uni.getStorageSync('shipWorkTitle')
			this.title = `${title} / 船舶资料 `
			this.vtpId = uni.getStorageSync('vtpId')
			this.executeSql1('shipInfoTable')
		},
		methods: {
			// 查
			executeSql1(tableName) {
				let sql = `select * from ${tableName} WHERE vtpId = '${this.vtpId}'`
				sqlite.executeSqlCeshi(sql).then((value) => {
					// 在resolve时执行的回调函数
					this.shipInfo = value[0]
				}).catch((error) => {
					// 在reject时执行的回调函数
					console.error(error);
				});
			},
		}
	}
</script>

<style lang="less" scoped>
	.shipInfo {
		.container {
			padding: 16px;

			.ul {
				display: flex;
				flex-wrap: wrap;
				padding: 24px 16px;
				background-color: #fff;

				.li {
					width: 32%;
					margin-bottom: 12px;
					display: flex;
					font-size: 14px;
					height: 20px;
					line-height: 20px;
					font-size: 16px;

					p {
						color: #999;
					}

					text {
						color: #23262E;
					}
				}
			}
		}
	}
</style>