Browse Source

地图加上loading图标

shibei_master
jiangyy 4 years ago
parent
commit
36c5928aad
  1. 26
      src/views/modules/visual/basicinfo/basicInfoCommunity.vue
  2. 20
      src/views/modules/visual/basicinfo/basicInfoMain.vue

26
src/views/modules/visual/basicinfo/basicInfoCommunity.vue

@ -22,7 +22,11 @@
</div> </div>
<div class="div_room_bar"> <div class="div_room_bar">
<el-scrollbar style="height:100%"> <el-scrollbar style="height:100%">
<div v-if="roomLoaded" <div class="info_loading"
v-if="roomLoaded">
<screen-loading>加载中</screen-loading>
</div>
<div v-if="!roomLoaded"
class="div_room"> class="div_room">
<div v-for="(item,index) in roomArray" <div v-for="(item,index) in roomArray"
@ -80,6 +84,7 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading import { Loading } from 'element-ui'; //Loading
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import ScreenLoading from "@/views/modules/visual/cpts/loading";
let loading;// let loading;//
@ -94,7 +99,7 @@ export default {
selBuildingId: '', selBuildingId: '',
selBuildingName: '', selBuildingName: '',
roomLoaded: false, roomLoaded: true,
roomArray: [], roomArray: [],
selHouseId: '', selHouseId: '',
selHouseName: '', selHouseName: '',
@ -121,7 +126,7 @@ export default {
methods: { methods: {
//id //id
async initData (neighborHoodId, neighborHoodName) { async initData (neighborHoodId, neighborHoodName) {
this.roomLoaded = false
this.neighborHoodId = neighborHoodId this.neighborHoodId = neighborHoodId
this.neighborHoodName = neighborHoodName this.neighborHoodName = neighborHoodName
// //
@ -129,7 +134,6 @@ export default {
if (this.selBuildingId) { if (this.selBuildingId) {
await this.loadRoom() await this.loadRoom()
this.roomLoaded = true
} }
@ -140,9 +144,9 @@ export default {
this.selBuildingId = this.buildingArray[index].buildingId this.selBuildingId = this.buildingArray[index].buildingId
this.selBuildingName = this.buildingArray[index].buildingName this.selBuildingName = this.buildingArray[index].buildingName
this.roomLoaded = false
await this.loadRoom() await this.loadRoom()
this.roomLoaded = true
this.$emit('refreshInfoList', this.selBuildingId, 'building') this.$emit('refreshInfoList', this.selBuildingId, 'building')
}, },
@ -226,6 +230,7 @@ export default {
// //
async loadRoom () { async loadRoom () {
this.roomLoaded = true
const url = "/gov/org/ichouse/houselist" const url = "/gov/org/ichouse/houselist"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/ichouse/houselist" // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/ichouse/houselist"
let params = { let params = {
@ -233,7 +238,7 @@ export default {
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
this.roomLoaded = false
if (code === 0) { if (code === 0) {
if (data.length > 0) { if (data.length > 0) {
@ -268,6 +273,8 @@ export default {
this.roomArray = [...data] this.roomArray = [...data]
}); });
} else {
this.roomArray = []
} }
@ -348,7 +355,7 @@ export default {
...mapGetters(["clientHeight"]) ...mapGetters(["clientHeight"])
}, },
components: {}, components: { ScreenLoading },
} }
</script> </script>
@ -360,6 +367,9 @@ export default {
></style> ></style>
<style lang=scss scoped> <style lang=scss scoped>
.info_loading {
margin-top: 50px;
}
.customer_select { .customer_select {
/* 未选中任何选项的时候 placeholder的样式 需要先选中父元素 增加权重 */ /* 未选中任何选项的时候 placeholder的样式 需要先选中父元素 增加权重 */
/deep/ input::-webkit-input-placeholder { /deep/ input::-webkit-input-placeholder {

20
src/views/modules/visual/basicinfo/basicInfoMain.vue

@ -61,7 +61,13 @@
<div class="tip_title">分类列表</div> <div class="tip_title">分类列表</div>
</div> </div>
<div class="info_list"> <div class="info_loading"
v-if="infoLoading">
<screen-loading>加载中</screen-loading>
</div>
<div v-if="!infoLoading"
class="info_list">
<div v-for="(item,index) in listDatashow" <div v-for="(item,index) in listDatashow"
:key="index" :key="index"
class="item"> class="item">
@ -114,6 +120,8 @@ import BasicInfoCommunity from "./basicInfoCommunity";
import PeopleSearch from "./peopleSearch"; import PeopleSearch from "./peopleSearch";
import People from "./people"; import People from "./people";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import ScreenLoading from "@/views/modules/visual/cpts/loading";
var centerPointGlobal = [120.38945519, 36.0722275] var centerPointGlobal = [120.38945519, 36.0722275]
let loading;// let loading;//
@ -226,6 +234,7 @@ const vueGis = {
searchName: "", searchName: "",
// //
infoLoading: true,
listData: [],// listData: [],//
listDatashow: [],// listDatashow: [],//
@ -270,6 +279,7 @@ const vueGis = {
//infolist //infolist
async loadList () { async loadList () {
this.infoLoading = true
const url = "/epmetuser/statsresiwarn/list" const url = "/epmetuser/statsresiwarn/list"
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/statsresiwarn/list" // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/statsresiwarn/list"
let params = { let params = {
@ -278,7 +288,7 @@ const vueGis = {
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
this.infoLoading = false
if (code === 0) { if (code === 0) {
this.listData = data this.listData = data
// this.listData = this.listData1 // this.listData = this.listData1
@ -844,7 +854,7 @@ const vueGis = {
...mapGetters(["clientHeight"]) ...mapGetters(["clientHeight"])
}, },
components: { BasicInfoCommunity, PeopleSearch, People, cptCard }, components: { BasicInfoCommunity, PeopleSearch, People, cptCard, ScreenLoading },
} }
export default vueGis; export default vueGis;
</script> </script>
@ -868,4 +878,8 @@ export default vueGis;
.el-scrollbar__wrap { .el-scrollbar__wrap {
overflow-x: hidden !important; overflow-x: hidden !important;
} }
.info_loading {
margin-top: 50px;
}
</style> </style>
Loading…
Cancel
Save