完成小区相关的接口对接
This commit is contained in:
@@ -8,14 +8,14 @@
|
||||
</div>
|
||||
<ul>
|
||||
<li
|
||||
v-for="(item, index) in buildingList"
|
||||
v-for="(item, index) in currentBuildingInfoList"
|
||||
:class="{
|
||||
active: index === activeId
|
||||
active: item.id === currentBuildingInfo.id
|
||||
}"
|
||||
:key="index"
|
||||
@click="checkBuilding(index)"
|
||||
@click="switchBuilding(item.id)"
|
||||
>
|
||||
<div class="buildingname">{{ item.name }}</div>
|
||||
<div class="buildingname">{{ item.villageName ?? '未知' }}</div>
|
||||
<div class="buildactions flex align-center justify-around">
|
||||
<el-icon class="pointer hover-color-blue"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red"><Delete /></el-icon>
|
||||
@@ -27,26 +27,11 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
const houseStore = useHouseStore();
|
||||
const { switchBuilding } = houseStore; // 方法
|
||||
const { currentBuildingInfoList, currentBuildingInfo } = storeToRefs(houseStore); // 数据
|
||||
const router = useRouter();
|
||||
const activeId = ref(0);
|
||||
const buildingList = ref([
|
||||
{
|
||||
id: 1,
|
||||
name: 'a栋'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'b栋'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'c栋'
|
||||
}
|
||||
]);
|
||||
const checkBuilding = (index: number) => {
|
||||
activeId.value = index;
|
||||
};
|
||||
|
||||
const handleAddBuilding = () => {
|
||||
router.push({
|
||||
|
||||
Reference in New Issue
Block a user