物业之前,新工作台
This commit is contained in:
@@ -13,14 +13,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="communityBody">
|
||||
<div
|
||||
class="coummunity_card"
|
||||
:class="{
|
||||
activeCommunity: item.choiceStatus === 0
|
||||
}"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
>
|
||||
<div class="coummunity_card" v-for="(item, index) in list" :key="index">
|
||||
<el-image :src="item.villageImageUrl ? item.villageImageUrl.split(',')[0] : ''">
|
||||
<template #error>
|
||||
<div class="image-viewer-slot image-slot">
|
||||
@@ -33,14 +26,7 @@
|
||||
<div class="counmmunityaddress">{{ item.address }}</div>
|
||||
</div>
|
||||
<div class="actions flex">
|
||||
<div
|
||||
@click="handleclick(item)"
|
||||
:style="{
|
||||
color: item.choiceStatus === 0 ? 'green' : ''
|
||||
}"
|
||||
>
|
||||
{{ item.choiceStatus === 0 ? '进入' : '管理' }}
|
||||
</div>
|
||||
<div @click="handleclick(item)">管理</div>
|
||||
<div @click="handleEdit(item)">编辑</div>
|
||||
<div @click="handleDelete(item)">删除</div>
|
||||
</div>
|
||||
@@ -62,7 +48,8 @@ import Navbar from '@/layout/components/Navbar.vue';
|
||||
import { deleteVillageByIdAPI, switchVillageAPI, getCommunitylistAPI } from '@/api/system/community/index';
|
||||
import type { communitylist_rows_type } from '@/api/system/community/type';
|
||||
import { Picture } from '@element-plus/icons-vue';
|
||||
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
const houseStore = useHouseStore();
|
||||
const router = useRouter();
|
||||
const list = ref<communitylist_rows_type[]>([]);
|
||||
const currentViliageInfo = ref<communitylist_rows_type>();
|
||||
@@ -70,7 +57,6 @@ const currentViliageInfo = ref<communitylist_rows_type>();
|
||||
function getlist() {
|
||||
getCommunitylistAPI().then((res) => {
|
||||
list.value = res.rows;
|
||||
currentViliageInfo.value = res.rows.find((item) => item.choiceStatus === 0);
|
||||
res.rows.forEach((item) => {
|
||||
if (item.villageImageUrl) {
|
||||
console.log(item.villageImageUrl.split(','));
|
||||
@@ -106,19 +92,13 @@ function handleEdit(item: communitylist_rows_type) {
|
||||
|
||||
/** 管理小区 */
|
||||
function handleclick(item: communitylist_rows_type) {
|
||||
if (item.choiceStatus === 0) {
|
||||
switchVillageAPI(item.villageId).then(() => {
|
||||
localStorage.setItem('villageid', String(item.villageId));
|
||||
houseStore.getviliageinfo(item.villageId);
|
||||
router.push({
|
||||
path: '/index'
|
||||
});
|
||||
} else {
|
||||
switchVillageAPI(item.villageId).then((res) => {
|
||||
console.log('切换成小区---------------------');
|
||||
ElMessage.success('切换小区成功');
|
||||
router.push({
|
||||
path: '/index'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@@ -260,23 +240,4 @@ function handleclick(item: communitylist_rows_type) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.activeCommunity {
|
||||
position: relative;
|
||||
&::after {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: -30px;
|
||||
transform: rotateZ(45deg);
|
||||
content: '当前小区';
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user