<template>
	<view class="">
		<view class="uni-flex uni-column">
			<view class="item" v-for="(item,index) in dataList">
				<text class="item_title">{{item.title}} : </text>
				<text v-if="(item.type=='')||(item.type==undefined)" class="text_wrap">{{item.content}} </text>
				<text v-else-if="item.type=='dateTime'" class="text_wrap">{{formatDate(item.content)}} </text>
				<text v-else-if="item.type=='boolean'" class="text_wrap">{{boolean(item.content)}} </text>
				<text v-else-if="item.type=='transferMode'" class="text_wrap">{{getTransferModeName(item.content)}} </text>
				<text v-else-if="item.type=='locationType'" class="text_wrap">{{getLocationTypeNameList(getDirectoryItemArray(item.content))}} </text>
				<text v-else-if="item.type=='uom'" class="text_wrap">{{getUnitInfo(item.content)}} </text>
				<text v-else-if="item.type=='inspectType'" class="text_wrap">{{getInspectType(item.content)}} </text>
				<text v-else-if="item.type=='sampleMethod'" class="text_wrap">{{getSampleMethod(item.content)}} </text>
				<text v-else-if="item.type=='requestState'" class="text_wrap">{{getRequestStateInfo(item.content)}} </text>
			    <text v-else-if="item.type=='inventoryStatus'" class="text_wrap">{{getInventoryStatusName(item.content)}} </text>
				 <text v-else-if="item.type=='locationCode'" class="text_wrap">{{getLocationTypeName(item.content)}} </text>
			
			</view>

		</view>
	</view>
</template>

<script>
	import {
		dateFormat
	} from '@/common/basic.js';
	
	import {
		getTransferModeName,
		getLocationTypeNameList,
		getDirectoryItemArray,
		getUnitInfo,
		getInspectType,
		getSampleMethod,
		getRequestStateInfo,
		getInventoryStatusName,
		getLocationTypeName
		
	} from '@/common/directory.js';
	export default {
		components: {},
		data() {
			return {

			}
		},

		mounted() {},
		watch: {
			// dataContent: {
			// 	handler(newName, oldName) {
			// 	},
			// 	immediate: true,
			// 	deep: true
			// }
		},
		props: {
			dataList: {
				type: Array,
				default: []
			}
		},

		methods: {
			avaliable(value) {
				return value == "TRUE" ? "可用" : "不可用"
			},
			boolean(value) {
				return value == "TRUE" ? "是" : "否"
			},
			formatDate(val) {
				return dateFormat(val)
			},
			getTransferModeName(value){
				return getTransferModeName(value)
			},
			getLocationTypeNameList(value){
				return getLocationTypeNameList(value)
			},
			getDirectoryItemArray(value){
				return getDirectoryItemArray(value)
			},
			getUnitInfo(value){
				return getUnitInfo(value).label
			},
			getInspectType(value){
				return getInspectType(value)
			},
			getSampleMethod(value){
				return getSampleMethod(value)
			},
			getRequestStateInfo(value){
				return getRequestStateInfo(value).label
			},
			getInventoryStatusName(value){
				return getInventoryStatusName(value)
			},
			getLocationTypeName(value){
				return getLocationTypeName(value)
			}
		}
	}
</script>

<style>

</style>
