| | |
| | | <template> |
| | | <view class="container"> |
| | | <u-navbar height="48" :autoBack="false" safeAreaInsetTop placeholder @leftClick="navToSelectSite()" |
| | | :bgColor="background.top"> |
| | | <view slot="left" class="top flex"> |
| | | <view class="top-text f-30 fw c-ff"> |
| | | {{ '选择社区' }} |
| | | </view> |
| | | <u-icon name="arrow-right" color="#fff"></u-icon> |
| | | </view> |
| | | </u-navbar> |
| | | <view class="section"> |
| | | <caption-row title="社区概况" bgColor="#003399"></caption-row> |
| | | <view class="cell flex j-c-s-b flex-wrap "> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | siteInfo: uni.getStorageSync("siteInfo"), |
| | | reportData: {}, |
| | | houseData: {}, |
| | | chartData: {}, |
| | | background: { |
| | | top: "#017BFC", |
| | | banner: "linear-gradient(180deg, #017BFC 0%, rgba(1, 123, 252, 0) 100%)" |
| | | }, |
| | | opts: { |
| | | fontSize: 10, |
| | | color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", |
| | |
| | | // ], |
| | | padding: [5, 5, 5, 5], |
| | | enableScroll: false, |
| | | // rotate: false, |
| | | // rotateLock: false, |
| | | // dataLabel: true, |
| | | extra: { |
| | | pie: { |
| | | centerColor: "#fff", |
| | |
| | | borderWidth: 3, |
| | | borderColor: "#FFFFFF" |
| | | } |
| | | // ring: { |
| | | // ringWidth: 60, |
| | | // activeOpacity: 0.5, |
| | | // activeRadius: 10, |
| | | // offsetAngle: 0, |
| | | // labelWidth: 15, |
| | | // border: false, |
| | | // borderWidth: 3, |
| | | // borderColor: "#FFFFFF" |
| | | // } |
| | | } |
| | | }, |
| | | gridData: {}, |
| | | houseLabelData: [], |
| | | sexData: [], |
| | | tabList: [], |
| | | tabbarIndex: 1 |
| | | tabbarIndex: 1, |
| | | chilrenList: [] |
| | | } |
| | | }, |
| | | |
| | | // onTabItemTap(e) { |
| | | // // tab 点击时执行,此处直接接收单击事件 |
| | | // console.log(e) |
| | | // this.refreshData(); |
| | | // }, |
| | | onShow() { |
| | | this.chilrenList = uni.getStorageSync("chilrenList") ? uni.getStorageSync("chilrenList") : [] |
| | | if (this.chilrenList && this.chilrenList.length == 0) { |
| | | this.chilrenList.push(this.siteInfo.id) |
| | | uni.setStorageSync("chilrenList", this.chilrenList) |
| | | } |
| | | let { |
| | | roleName |
| | | } = uni.getStorageSync("activeRole"); |
| | | |
| | | |
| | | |
| | | if (roleName == "网格员") { |
| | | this.tabList = getTabbarList(3); |
| | |
| | | // this.tabbarIndex = 1; |
| | | this.tabbarIndex = 2; |
| | | } |
| | | |
| | | if (roleName == "系统管理员") { |
| | | this.tabList = getTabbarList(4); |
| | | // this.tabbarIndex = 1; |
| | | this.tabbarIndex = 2; |
| | | } |
| | | |
| | | this.refreshData(); |
| | | }, |
| | | |
| | |
| | | }, 300) |
| | | }, |
| | | |
| | | |
| | | |
| | | methods: { |
| | | navToSelectSite() { |
| | | uni.navigateTo({ |
| | | url: '/pages/home/selectSiteTwo' |
| | | }) |
| | | }, |
| | | changeTabbar(e) { |
| | | console.log("==>", e) |
| | | // this.refreshData(); |
| | |
| | | this.getHouseLabelData(); |
| | | this.getReportData(); |
| | | this.getGridData(); |
| | | // this.getGridListData(); |
| | | }, |
| | | getRoleType() { |
| | | let roleName = uni.getStorageSync("activeRole").roleName; |
| | |
| | | } else { |
| | | return num |
| | | } |
| | | |
| | | }, |
| | | |
| | | |
| | | getHouseHoldData() { |
| | | statisticsModal.getHouseholdStatistics({ |
| | | code: this.siteInfo.id, |
| | | code: this.chilrenList.join(","), |
| | | roleType: this.getRoleType() |
| | | }).then(res => { |
| | | // this.houseHoldData = res.data; |
| | |
| | | }, |
| | | |
| | | getHouseLabelData() { |
| | | statisticsModal.getHouseLabelStatistic().then(res => { |
| | | statisticsModal.getHouseLabelStatistic({ |
| | | code: this.chilrenList.join(","), |
| | | roleType: this.getRoleType() |
| | | }).then(res => { |
| | | let data = res.data; |
| | | this.houseLabelData = data; |
| | | this.setHouseLabelData(data) |
| | |
| | | //获取社区概况数据 |
| | | getHouseData() { |
| | | statisticsModal.getHouseStatistics({ |
| | | code: this.siteInfo.id, |
| | | code: this.chilrenList.join(","), |
| | | roleType: this.getRoleType() |
| | | }).then(res => { |
| | | this.houseData = res.data; |
| | |
| | | //获取社区事件数据 |
| | | getReportData() { |
| | | statisticsModal.getReportStatistics({ |
| | | code: this.siteInfo.id, |
| | | code: this.chilrenList.join(","), |
| | | roleType: this.getRoleType() |
| | | }).then(res => { |
| | | console.log(res); |
| | |
| | | //获取网格物业人员 |
| | | getGridData() { |
| | | statisticsModal.getGridStatistics({ |
| | | code: this.siteInfo.id, |
| | | code: this.chilrenList.join(","), |
| | | roleType: this.getRoleType() |
| | | }).then(res => { |
| | | console.log(res); |
| | | this.gridData = res.data; |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |