<template>
  <MOSTY.PageTree :pageTitle="'特种设备列表'" :searchType="'01'" @getDeptId="getdeptId">
    <template #titleright>
      <div class="head">
        <div class="toggle" :class="{ active: isOpen }" @click="isOpen = !isOpen">
          <span>统计</span>
          <!-- {{ isOpen ? "收起" : "展开" }} -->
          <el-icon>
            <DArrowLeft />
          </el-icon>
        </div>
      </div>
    </template>
    <template #table>
      <Equipment :obj='listQuery' :type='"tzsb"' :isShowTotal="isOpen" :tableHeight='isOpen ? "15vh" : "60vh"' />
    </template>
  </MOSTY.PageTree>
</template>

<script setup>
import * as MOSTY from "@/components/MyComponents/index";
import { reactive, ref } from "vue";
import Equipment from '@/components/MyComponents/TabList/Equipment.vue'
const emit = defineEmits("changePage");
import { useStore } from "vuex"
const store = useStore()
const isOpen = ref(false);
const listQuery = reactive({
  type: '0',
  saveBtnShow: true,
});

//获取部门数据
const getdeptId = (val) => {
  listQuery.orgid = val.id;
  listQuery.orgname = val.orgname;
  store.state.user.currentDeptName = val.orgname
};
</script>

<style lang="scss" scoped>
.head {
  display: flex;
  justify-content: space-between;
  align-items: center;

  .toggle {
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #0f3916;

    .el-icon {
      transform: rotate(90deg);
      transition: all 0.25s ease;
    }

    &.active {
      .el-icon {
        transform: rotate(-90deg);
      }
    }
  }
}



::v-deep .el-pagination {
  justify-content: end !important;
}
</style>