<template>
  <MOSTY.PageTree :pageTitle="'消防设备设施列表'" :searchType="'01'" @getDeptId="getdeptId">
    <template #titleright>
      <div class="head">
        <div class="toggle" :class="{ active: isOpen }" @click="isOpen = !isOpen">
          <span>统计</span>
          <el-icon>
            <DArrowLeft />
          </el-icon>
        </div>
      </div>
    </template>
    <template #table>
      <Security :equipmentType="equipmentType" :obj='listQuery' :type='"aqsbss"' :tableHeight='"45vh"' :isOpen="isOpen">
      </Security>
    </template>
  </MOSTY.PageTree>
</template>

<script setup>
import * as MOSTY from "@/components/MyComponents/index";
import { reactive, ref, defineAsyncComponent } from "vue";
import { useStore } from "vuex"
import Security from '@/components/MyComponents/TabList/Security.vue'

const store = useStore()
const emit = defineEmits("changePage");
const isOpen = ref(false)
const listQuery = reactive({
  type: '0',
  saveBtnShow: true
});
// 消防器材 0 安防器材 1
const equipmentType = ref(0)
//获取部门数据
const getdeptId = (val) => {
  listQuery.orgid = val.id;
  store.state.user.currentDeptName = val.orgname
};
const treeHeight = ref(""); // 树高度
// 树高度计算
const treeHeightFn = () => {
  treeHeight.value = window.innerHeight - 187 + "px";
};
</script>

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

  .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);
      }
    }
  }
}
</style>
