You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xy-frontend/src/views/reportData/index.vue

110 lines
2.8 KiB
Vue

<template>
<div class="reportDataBox">
<!-- <div class="reoprtContain"></div> -->
1 year ago
<el-tabs type="border-card" @tab-click="handleTabClick">
<el-tab-pane label="照片统计">
1 year ago
<span slot="label">
照片统计
<el-button
@click.stop="handlePicSearch"
v-if="picSearchFlag"
type="primary"
icon="el-icon-search"
></el-button>
</span>
1 year ago
<photostatis ref="photoStatisRef"></photostatis>
</el-tab-pane>
1 year ago
<el-tab-pane label="设备状态列表">
<span slot="label">
设备状态列表
<el-button
v-if="statusFlag"
type="primary"
icon="el-icon-search"
></el-button>
</span>
<equipmentStatus ref="equipmentStatusRef"></equipmentStatus
1 year ago
></el-tab-pane>
<!-- <el-tab-pane label="角色管理">角色管理</el-tab-pane>
<el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane> -->
</el-tabs>
</div>
</template>
<script>
import {} from "@/utils/api/index";
import photostatis from "./photostatis/index";
1 year ago
import equipmentStatus from "./equipmentStatus/index";
export default {
name: "reportData",
components: {
photostatis,
1 year ago
equipmentStatus,
},
data() {
1 year ago
return {
picSearchFlag: true,
statusFlag: false,
};
},
created() {},
mounted() {},
watch: {},
1 year ago
methods: {
handleTabClick(tab, event) {
// 当标签页被点击时触发
const tabName = tab.label;
1 year ago
console.log(tab);
1 year ago
if (tabName === "照片统计") {
1 year ago
this.picSearchFlag = true;
this.statusFlag = false;
1 year ago
// 调用照片统计组件的方法
if (this.$refs.photoStatisRef) {
this.$refs.photoStatisRef.onSubmit(); // 假设someMethod是你要调用的方法
}
} else if (tabName === "设备状态列表") {
1 year ago
this.picSearchFlag = false;
this.statusFlag = true;
1 year ago
// 调用设备状态列表组件的方法
if (this.$refs.equipmentStatusRef) {
this.$refs.equipmentStatusRef.onSubmit(); // 假设someOtherMethod是你要调用的方法
}
}
// 可以继续添加其他标签页的逻辑
},
1 year ago
handlePicSearch() {
console.log("aaaaaaaaaaaa");
this.$refs.photoStatisRef.showSearch();
},
1 year ago
},
};
</script>
<style lang="less">
.reportDataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
1 year ago
.el-tabs--border-card > .el-tabs__content {
padding: 8px;
}
.el-tabs {
height: 100%;
1 year ago
.el-tabs__header {
.el-button--default,
.el-button--primary {
width: auto;
margin-left: 12px;
}
}
.el-tabs__content {
1 year ago
height: calc(100% - 65px);
//overflow: auto;
.el-tab-pane {
height: 100%;
}
}
}
}
</style>