<template>
	<!-- 市级储备表 -->
	<div class="statisticsTableCity">
		<div class="tableBox">
			<a-table size="small" bordered :dataSource="tableData" :columns="tableColumns" :pagination="false">
				<template #bodyCell="{ column, record, index }">
					<template v-if="column.key === 'INDEX'">{{ index + 1 }}</template>
					<template v-else>{{ record[column.key] }}</template>
				</template>
			</a-table>
		</div>
	</div>
</template>
<script setup name="statisticsTableCity">
	import api from '@/api/RLGI/system.js'
	import getTableChildren from './getTableChild'
	const tableData = ref([])
	const tableColumns = [
		{ title: '序号', width: 30, key: 'INDEX', align: 'center' },
		{ title: '承储企业', align: 'center', width: 250, key: 'orgName' },
		{ title: '省级储备', align: 'center', children: getTableChildren('_省级储备', 'sj') }
	]
	onMounted(() => {
		getTableData()
	})
	function getTableData() {
		api.getCrkKcswDatas({ lsxz: 6877 }).then((res) => {
			tableData.value = res
		})
	}
</script>
<style lang="less" scoped>
	.tableBox {
		padding: 20px 30px;
		background: #fff;
		height: calc(100vh - 201px);
	}
	::v-deep(.ant-table) {
		.ant-table-body {
			height: calc(100vh - 301px);
		}
	}
</style>
