<template>
	<a-drawer
		:title="'期货信息详情'"
		:width="600"
		:visible="visible"
		:destroy-on-close="true"
		:footer-style="{ textAlign: 'right' }"
		@close="onClose"
	>
		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
			<a-descriptions :column="1" size="middle" bordered class="mb-2">
				<a-descriptions-item label="代码">{{ formData.futuresCode }}</a-descriptions-item>
				<a-descriptions-item label="名称">{{ formData.futuresName }}</a-descriptions-item>
				<a-descriptions-item label="价格">{{ formData.futuresPrice }}</a-descriptions-item>
				<a-descriptions-item label="单位">{{ formData.futuresUnit }}</a-descriptions-item>
				<a-descriptions-item label="备注">{{ formData.remark }}</a-descriptions-item>
				<a-descriptions-item label="创建时间">{{ formData.createTime }}</a-descriptions-item>
				<a-descriptions-item label="更新时间">{{ formData.updateTime }}</a-descriptions-item>
			</a-descriptions>
		</a-form>
		<template #footer>
			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
		</template>
	</a-drawer>
</template>

<script setup name="depotWorkAlarmForm">
import tool from '@/utils/tool'
import {cloneDeep} from 'lodash-es'
import {required} from '@/utils/formRules'
import depotWorkAlarmApi from '@/api/biz/depotWorkAlarmApi'
import dictOptionsApi from "@/api/biz/dictOptionsApi";
import sysConfig from "@/config";
import fileApi from "@/api/dev/fileApi";
// 抽屉状态
const visible = ref(false)
const emit = defineEmits({successful: null})
const formRef = ref()
// 表单数据
const formData = ref({})
const submitLoading = ref(false)

// 打开抽屉
const onOpen = (record) => {
	visible.value = true
	if (record) {
		let recordData = cloneDeep(record)
		formData.value = Object.assign({}, recordData)
	}
}
// 关闭抽屉
const onClose = () => {
	formRef.value.resetFields()
	formData.value = {}
	visible.value = false
}
// 抛出函数
defineExpose({
	onOpen
})
</script>
