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

</template>

<script setup>
import { ref, reactive } from "vue";
import XgfryTable from './XgfryTable.vue'
import * as MOSTY from "@/components/MyComponents/index";
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>
.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>