<template>
	<download-excel class="export-excel-wrapper" :data="json_data" :fields="json_fields" footer='页脚' header='导出数据'
		name="设备管理数据表.xls">
		<!-- 上面可以自定义自己的样式，还可以引用其他组件button -->
		<button type="primary" size="small">导出EXCEL</button>
	</download-excel>
</template>

<script>
	export default {
		data() {
			return {
				json_fields: {
					"单位编号": "company", //常规字段
					"状态": "device_state",
					"设备编号": "owner_code", 
					"设备名称": "owner_name",
					"单元地址": "unitinfo",
					"创建时间": "install_time",
				},
				json_data: [{
						name: "Tony Peña",
						city: "New York",
						country: "United States",
						birthdate: "1978-03-15",
						phone: {
							mobile: "1-541-754-3010",
							landline: "(541) 754-3010"
						}
					},
					{
						name: "Thessaloniki",
						city: "Athens",
						country: "Greece",
						birthdate: "1987-11-23",
						phone: {
							mobile: "+1 855 275 5071",
							landline: "(2741) 2621-244"
						}
					}
				],
				json_meta: [
					[{
						" key ": " charset ",
						" value ": " utf- 8 "
					}]
				]
			};
		}

	}
</script>
