<template>
	<view class="uni-flex uni-row">
		<view class="uni-flex uni-row">
			<text :class="statusStyle(status)">{{statusDesc(status)}}|
			</text>
			<text>
				{{statusDesc(status)}}
			</text>
			<text v-if="allowEdit" @click="openEdit()">|编辑</text>
		</view>
		<uni-popup ref="popup">
			<view style="background-color: white; height:200px;">
				<view class="uni-flex uni-row">
					<button>状态1</button>
					<button>状态2</button>
					<button>状态3</button>
				</view>

				<view class="uni-flex uni-row">
					<button>确定</button>
					<button>取消</button>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script setup>
	import {
		ref,
		computed
	} from "vue";
	import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
	import {
		getInventoryTypeStyle,
		getInventoryStatusDesc,
	} from '@/common/basic.js';

	const popup = ref(null)

	const props = defineProps({
		status: {
			type: Number,
		},
		dataContent: {
			type: Object,
			default () {
				return {

				}
			}
		},
		allowEdit: {
			type: Boolean,
			default () {
				return true
			}
		}
	});

	const openEdit = function() {
		popup.value.open('bottom')
	};

	const closeDetail = function() {
		popup.value.close()
	};

	const statusDesc = function(val) {
		return getInventoryStatusDesc(val);
	};

	const statusStyle = function(val) {
		return getInventoryTypeStyle(val);

	};
</script>


<!-- <script>
	import {
		getInventoryTypeStyle,
		getInventoryStatusDesc,
	} from '@/common/basic.js';

	export default {
		data() {
			return {
				array: [{
						key: '1',
						value: '待检',
						checked: false
					},
					{
						key: '1',
						value: '合格',
						checked: false
					},
					{
						key: '1',
						value: '不合格',
						checked: false
					},
					{
						key: '1',
						value: '隔离',
						checked: false
					},
					{
						key: '1',
						value: '报废',
						checked: false
					}, ,
					{
						key: '1',
						value: '冻结',
						checked: false
					}

				],
				index: 0,
			}
		},
		props: {
			status: 0,
			allowEdit: {
				type: Boolean,
				default: false
			},
		},
		methods: {
			openEdit() {
				this.$refs["popup"].open('bottom');
			},
			bindPickerChange: function(e) {
				this.index = e.detail.value
			},
			statusStyle: function(val) {
				return getInventoryTypeStyle(val);
			},
			statusColor: function(val) {
				return getInventoryStatusDesc(val);
			},
		}
	}
</script> -->

<style>
</style>
