<template>
  <!-- <MOSTY.PageTree :pageTitle="'相关方列表'" :searchType="'01'" @getDeptId="getdeptId"> -->
  <MOSTY.PageTree :pageTitle="'相关方列表'" :searchType="'01'" :carInfo="true" @getDeptId="getdeptId">
    <template #titleright>
      <div class="toggle" :class="{ active: isOpen }" @click="isOpen = !isOpen">
        <span>统计</span>
        <el-icon>
          <DArrowLeft />
        </el-icon>
      </div>
    </template>
    <template #table>
      <XgfTable :obj='listQuery' :isShowTotal="isOpen" :tableHeight='isOpen ? "15vh" : "60vh"'
        @changePage="changeDetail" />
    </template>
  </MOSTY.PageTree>
</template>

<script setup>
import * as MOSTY from "@/components/MyComponents/index";
import { ref, reactive } from "vue";
import XgfTable from './XgfTable.vue'
const emits = defineEmits(['changePage']);
const isOpen = ref(false);

const listQuery = reactive({
  type: '0',
  saveBtnShow: true,
});
//获取部门数据
const getdeptId = (val) => {
  listQuery.orgid = val.id;
  listQuery.orgname = val.orgname;
};
// 透传事件
const changeDetail = (type, arr) => {
  emits("changePage", type, arr);
}
</script>

<style lang="scss" scoped>
.usermanage {
  // height: 84vh;
  display: flex;

  .title {
    height: 39px;
    line-height: 39px;
    font-size: 18px;
    color: #0f3916;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }



  .right {
    padding: 0 10px;
    margin-left: 14px;
    background: #fff;

    .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>
