zdys.vue 1.38 KB
<!--
 * @Author: yangwei
 * @Date: 2023-02-28 16:29:04
 * @LastEditors: yangwei
 * @LastEditTime: 2023-03-02 14:45:19
 * @FilePath: \bdcdj-web\src\views\lpb\lpbContent\zdys.vue
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
-->
<template>
  <div class="zdys-wrap">
    <div v-for="zdy in realZdys" :key="zdy.bsm">
      <!-- 幢单元名称 -->
      <p class="lpb-xmmc">
        <el-checkbox @change="zdySelectAll($event,zdy.bsm)">{{
          zdy.zdymc
        }}</el-checkbox>
      </p>
      <!-- 每个幢单元下的层户 -->
      <ch-cpn :ref="zdy.bsm" :ch="zdy.cs" />
    </div>
  </div>
</template>

<script>
import chCpn from "./ch.vue";
export default {
  name: "BdcdjWebZdys",
  components: { chCpn },
  props: {
    zdys: {
      type: Array,
      default: function () {
        return [];
      },
    },
  },
  data() {
    return {};
  },

  mounted() {},

  methods: {
    //幢单元全选
    zdySelectAll(val,r) {
      this.$refs[r][0].zdySelectAll(val)
    },
  },
  computed: {
    realZdys() {
      return this.zdys.sort((a, b) => {
        return a.zdysxh > b.zdysxh ? 1 : -1;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.zdys-wrap {
  display: flex;
  flex-direction: row;
  > div {
    margin-right: 20px;
    display: flex;
    flex-direction: column-reverse;
    .lpb-xmmc {
      border-top: 0;
    }
  }
}
</style>