|
@@ -1,36 +1,149 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <das-board>
|
|
|
- <template v-slot:plan>
|
|
|
- <span>{{plan?plan:"yyyy-mm-dd"}}</span>
|
|
|
- </template>
|
|
|
- <template v-slot:finish>
|
|
|
- <span>{{finish?finish:"yyyy-mm-dd"}}</span>
|
|
|
- </template>
|
|
|
- <template v-slot:onLine>
|
|
|
- <span>{{onLine?onLine:"yyyy-mm-dd"}}</span>
|
|
|
- </template>
|
|
|
- <template v-slot:explain>
|
|
|
- <span>{{explain?explain:"yyyy-mm-dd"}}</span>
|
|
|
- </template>
|
|
|
- </das-board>
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <el-row style="margin-top: 30px;">
|
|
|
+ <span>请选择要导出的模板:</span>
|
|
|
+ <el-select v-model="value" placeholder="请选择">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button @click="handleClickDownload" type="primary" style="margin-left: 15px;">导出Excel</el-button>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import dasBoard from "@/views/dasboard/index";
|
|
|
+import jsontoExcel from "@/utils/JOSNToExcel"
|
|
|
+import { State, Family } from "@/data/mapTable"
|
|
|
+import { getSpaceName, getGraphyId, getEquipmentFamily, countEquip } from "@/api/scan/request"
|
|
|
+import { mapGetters, mapActions } from "vuex"
|
|
|
+
|
|
|
export default {
|
|
|
- components: {
|
|
|
- dasBoard
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- plan: "2019-10-30",
|
|
|
- finish: "2019-10-30",
|
|
|
- onLine: "2019-10-30",
|
|
|
- explain: "照岗位和资产数据统计报告"
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ json: '',
|
|
|
+ value: '',
|
|
|
+ options: [{
|
|
|
+ value: 'header1',
|
|
|
+ label: '已建立关联的设备资产'
|
|
|
+ }, {
|
|
|
+ value: 'header2',
|
|
|
+ label: '未关联资产的设备'
|
|
|
+ }, {
|
|
|
+ value: 'header3',
|
|
|
+ label: '未关联设备的资产'
|
|
|
+ }],
|
|
|
+ header1: [{
|
|
|
+ fieldName: "Building.BuildLocalName",
|
|
|
+ headerName: "建筑"
|
|
|
+ }, {
|
|
|
+ fieldName: "Floor.FloorLocalName",
|
|
|
+ headerName: "楼层"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipCategory.EquipName",
|
|
|
+ headerName: "设备类"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipLocalName",
|
|
|
+ headerName: "设备本地名称"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipLocalID",
|
|
|
+ headerName: "设备本地编码"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipID",
|
|
|
+ headerName: "设备id"
|
|
|
+ }, {
|
|
|
+ fieldName: "BIMID",
|
|
|
+ headerName: "设备BIMID"
|
|
|
+ }, {
|
|
|
+ fieldName: "Property.Family",
|
|
|
+ headerName: "资产设备族"
|
|
|
+ }, {
|
|
|
+ fieldName: "Property.EquipLocalName",
|
|
|
+ headerName: "资产本地名称"
|
|
|
+ }, {
|
|
|
+ fieldName: "Property.EquipLocalID",
|
|
|
+ headerName: "资产本地编码"
|
|
|
+ }, {
|
|
|
+ fieldName: "Property.EquipID",
|
|
|
+ headerName: "资产id"
|
|
|
+ }, {
|
|
|
+ fieldName: "Property.CreateTime",
|
|
|
+ headerName: "资产创建时间"
|
|
|
+ }, {
|
|
|
+ fieldName: "Property.CodeType",
|
|
|
+ headerName: "资产现场验证状态"
|
|
|
+ }],
|
|
|
+ header2: [{
|
|
|
+ fieldName: "Building.BuildLocalName",
|
|
|
+ headerName: "建筑"
|
|
|
+ }, {
|
|
|
+ fieldName: "Floor.FloorLocalName",
|
|
|
+ headerName: "楼层"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipCategory.EquipName",
|
|
|
+ headerName: "设备类"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipLocalName",
|
|
|
+ headerName: "设备本地名称"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipLocalID",
|
|
|
+ headerName: "设备本地编码"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipID",
|
|
|
+ headerName: "设备id"
|
|
|
+ }, {
|
|
|
+ fieldName: "BIMID",
|
|
|
+ headerName: "设备BIMID"
|
|
|
+ }],
|
|
|
+ header3: [{
|
|
|
+ fieldName: "Building.BuildLocalName",
|
|
|
+ headerName: "建筑"
|
|
|
+ }, {
|
|
|
+ fieldName: "Floor.FloorLocalName",
|
|
|
+ headerName: "楼层"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipFamilyList.0.FamilyName",
|
|
|
+ headerName: "资产设备族"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipLocalName",
|
|
|
+ headerName: "资产本地名称"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipLocalID",
|
|
|
+ headerName: "资产本地编码"
|
|
|
+ }, {
|
|
|
+ fieldName: "EquipID",
|
|
|
+ headerName: "资产id"
|
|
|
+ }, {
|
|
|
+ fieldName: "CreateTime",
|
|
|
+ headerName: "资产创建时间"
|
|
|
+ }, {
|
|
|
+ fieldName: "CodeType",
|
|
|
+ headerName: "资产现场验证状态"
|
|
|
}
|
|
|
- },
|
|
|
- mounted() {}
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ handleClickDownload () {
|
|
|
+ if (this.value == 'header1') {
|
|
|
+ let json = JSON.parse(this.json).Content.map((item) => {
|
|
|
+ item.Property.CodeType = State[item.Property.CodeType]
|
|
|
+ item.Property.Family = Family[item.Property.Family]
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ jsontoExcel.downloadExl(this.header1, json, '已建立关联的资产设备')
|
|
|
+ } else if (this.value == 'header2') {
|
|
|
+ let json = JSON.parse(this.json).Content
|
|
|
+ jsontoExcel.downloadExl(this.header2, json, '未关联资产的设备')
|
|
|
+ } else if (this.value == 'header3') {
|
|
|
+ let json = JSON.parse(this.json).Content.map((item) => {
|
|
|
+ item.CodeType = State[item.CodeType]
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ jsontoExcel.downloadExl(this.header3, json, '未关联设备的资产')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-</script>
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+</style>
|