Browse Source

ss

shibei_master
dai 3 years ago
parent
commit
c1eda1c8c4
  1. 121
      src/views/modules/warning/components/screen-table/index.vue
  2. 179
      src/views/modules/warning/components/screen-table/people-list.vue
  3. 11
      src/views/modules/warning/index.vue

121
src/views/modules/warning/components/screen-table/index.vue

@ -24,38 +24,10 @@
:key="indexs" :key="indexs"
:style="tableContentStyle[indexs]" :style="tableContentStyle[indexs]"
> >
<div v-if="Array.isArray(item)"> <div v-if="item.type && item.type == 'btn'">
<span <a @click="handleClickBtn(item)">{{ item.name }}</a>
v-show="rIndex < 3"
:key="resi.userId"
v-for="(resi, rIndex) in item"
>
{{ rIndex != 0 ? "、" : "" }}
<a @click="handlePeopleItem(resi.userId, value[1])">{{
resi.residentName
}}</a>
</span>
</div> </div>
<span v-else>{{ item }}</span> <span v-else>{{ item }}</span>
<span
v-if="indexs + 1 == value.length && item.length > 3"
class="more"
@click.stop="onClickMorePop(index)"
ref="morePop"
>
更多>
<div class="more-pop" v-if="visiblePopList[index]">
<span
:key="index + rIndex + resi.userId"
v-for="(resi, rIndex) in item"
>
{{ rIndex != 0 ? "、" : "" }}
<a @click="handlePeopleItem(resi.userId, value[1])">{{
resi.residentName
}}</a>
</span>
</div>
</span>
</div> </div>
</div> </div>
<screen-loading v-if="visibleLoading">加载中</screen-loading> <screen-loading v-if="visibleLoading">加载中</screen-loading>
@ -66,11 +38,11 @@
</div> </div>
</div> </div>
<people-more <people-list
v-if="showedPeopleMoreInfo && currentPepeleId" v-if="showedPeopleList && buildingId"
:userId="currentPepeleId" :buildingId="buildingId"
:gridName="currentPepeleGridName" :configId="configId"
@close="showedPeopleMoreInfo = false" @close="showedPeopleList = false"
/> />
</div> </div>
</template> </template>
@ -78,13 +50,13 @@
<script> <script>
import ScreenLoading from "../screen-loading/index"; import ScreenLoading from "../screen-loading/index";
import Vue from "vue"; import Vue from "vue";
import peopleMore from "@/views/modules/shequ/cpts/people-more"; import peopleList from "./people-list";
export default { export default {
name: "warning-table", name: "warning-table",
components: { components: {
ScreenLoading, ScreenLoading,
peopleMore, peopleList,
}, },
props: { props: {
headerList: { headerList: {
@ -96,7 +68,8 @@ export default {
{ title: "所属网格" }, { title: "所属网格" },
{ title: "所属小区" }, { title: "所属小区" },
{ title: "楼号" }, { title: "楼号" },
{ title: "姓名" }, { title: "预警人数" },
{ title: "操作" },
]; ];
}, },
}, },
@ -156,80 +129,30 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
// //
// ava: {
// type: Number,
// default: 8
// },
// // --10%
// headerHeightAva: {
// type: String,
// default: '10%'
// },
// //
// tableContentAva: {
// type: Number,
// default: 5
// },
}, },
data() { data() {
return { return {
// //
showedPeopleMoreInfo: false, showedPeopleList: false,
buildingId: "",
currentPepeleId: "", configId: "",
currentPepeleGridName: "",
visiblePopList: [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
],
}; };
}, },
watch: { watch: {},
tableData(arr) {
if (Array.isArray(arr)) {
this.visiblePopList = new Array(arr.length).fill(false);
}
},
},
mounted() { mounted() {},
window.addEventListener("click", (e) => {
this.visiblePopList = new Array(this.visiblePopList.length).fill(false);
});
},
created() {}, created() {},
methods: { methods: {
toUserInfo(uid) { handleClickBtn(item) {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); this.showedPeopleList = true;
}, this.buildingId = item.buildingId;
this.configId = item.configId;
handlePeopleItem(uid, gridName) {
this.currentPepeleId = uid;
this.currentPepeleGridName = gridName;
this.showedPeopleMoreInfo = true;
}, },
onClickMorePop(index) { toUserInfo(uid) {
this.visiblePopList.forEach((item, indexs) => { this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
if (index == indexs) {
Vue.set(this.visiblePopList, index, true);
} else {
Vue.set(this.visiblePopList, indexs, false);
}
});
}, },
}, },
}; };

179
src/views/modules/warning/components/screen-table/people-list.vue

@ -0,0 +1,179 @@
<template>
<div class="m-pop">
<div class="wrap">
<div class="btn-close" @click="handleClose">
<img src="@/assets/img/shuju/people/close.png" />
</div>
<div class="wrap2">
<div class="title">
<span>更多信息</span>
</div>
<div class="content">
<div class="tb">
<el-table
:data="list"
border
style="width: 100%"
class="resi-table"
:max-height="maxTableHeight"
>
<el-table-column
label="序号"
type="index"
align="center"
width="50"
/>
<el-table-column prop="residentName" label="姓名">
</el-table-column>
<el-table-column prop="unitName" label="单元"> </el-table-column>
<el-table-column prop="doorName" label="门牌号" width="80">
</el-table-column>
<el-table-column prop="mobile" label="手机"> </el-table-column>
<el-table-column prop="idCard" label="身份证"> </el-table-column>
<el-table-column
fixed="right"
label="操作"
align="center"
width="60"
>
<template slot-scope="scope">
<el-button
@click="handlePeopleItem(scope.userId)"
type="text"
size="small"
>查看更多</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<el-pagination
:current-page="pageNo"
:page-size="pageSize"
background
layout="prev, pager, next"
@size-change="pageSizeChangeHandleNew"
@current-change="pageCurrentChangeHandleNew"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</div>
<people-more
v-if="showedPeopleInfo && currentPepeleId"
:userId="currentPepeleId"
:gridName="gridName"
@close="showedPeopleMoreInfo = false"
/>
</div>
</template>
<script>
import cptCard from "@/views/modules/visual/cpts/card";
import { requestPost } from "@/js/dai/request";
import peopleMore from "@/views/modules/shequ/cpts/people-more";
import { mapGetters } from "vuex";
export default {
name: "people-list",
props: {
configId: {
type: String,
default: "",
},
buildingId: {
type: String,
default: "",
},
},
components: {
cptCard,
},
data() {
return {
showedPeopleInfo: false,
currentPepeleId: "",
currentPepeleGridName: "",
loading: false,
pageNo: 0,
pageSize: 10,
total: 0,
list: [],
};
},
computed: {
maxTableHeight() {
return this.clientHeight - 450;
return 420;
},
...mapGetters(["clientHeight"]),
},
watch: {
userId() {
this.getApiData();
},
},
mounted() {
this.getApiData();
},
methods: {
pageSizeChangeHandleNew(val) {
this.pageNo = 1;
this.pageSize = val;
},
pageCurrentChangeHandleNew(val) {
this.pageNo = val;
this.getList();
},
handlePeopleItem(uid) {
this.currentPepeleId = uid;
this.showedPeopleInfo = true;
},
handleClose() {
this.$emit("close");
},
async getApiData() {
this.getList();
},
async getList() {
const url = "/epmetuser/statsresiwarn/alluserwarnlist";
let params = {
buildingId: this.buildingId,
configId: this.configId,
pageNo: this.pageNo,
pageSize: this.pageSize,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
const { list, total } = data;
this.list = list;
this.total = total;
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style lang="scss" src="@/assets/scss/people-info.scss" scoped></style>

11
src/views/modules/warning/index.vue

@ -98,7 +98,8 @@ export default {
{ title: "所属网格" }, { title: "所属网格" },
{ title: "所属小区" }, { title: "所属小区" },
{ title: "楼号" }, { title: "楼号" },
{ title: "姓名" }, { title: "预警人数" },
{ title: "操作" },
], ],
tableData: [ tableData: [
// [1,'','','2',''], // [1,'','','2',''],
@ -142,7 +143,13 @@ export default {
item.gridName, item.gridName,
item.neighborhoodName, item.neighborhoodName,
item.buildingName, item.buildingName,
item.userList || "暂无", item.count,
{
type: "btn",
name: "查看人员详情",
buildingId: item.buildingId,
configId: item.configId,
},
]); ]);
}); });
this.tableData = tableData; this.tableData = tableData;

Loading…
Cancel
Save