zdys.vue
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!--
* @Author: yangwei
* @Date: 2023-02-28 16:29:04
* @LastEditors: yangwei
* @LastEditTime: 2023-09-15 14:57:10
* @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)" v-if="!onlyShow">{{
zdy.zdymc
}}</el-checkbox>
<span v-else>{{zdy.zdymc}}</span>
</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 [];
},
},
onlyShow:{
type: Boolean,
default: true,
}
},
data() {
return {};
},
mounted() {},
methods: {
//幢单元全选
/**
* @description: 幢单元全选
* @param {*} val
* @param {*} r
* @author: renchao
*/
zdySelectAll(val,r) {
this.$refs[r][0].zdySelectAll(val)
},
/**
* @description: 逻辑幢全选点击后逻辑幢下的幢单元全选
* @param {*} val
* @return {*}
*/
selectAll(val){
this.realZdys.forEach(i=>{
this.zdySelectAll(val,i.bsm)
})
}
},
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>