Browse Source

首页最终版

feature
mk 2 years ago
parent
commit
765dd86d95
  1. 69
      src/assets/scss/modules/index.scss
  2. 288
      src/views/modules/home/index.vue

69
src/assets/scss/modules/index.scss

@ -251,9 +251,9 @@
} }
} }
.cnt-right { .cnt-right {
margin-left: auto; // margin-left: auto;
width: calc(100% - 240px - 40px); width: 100%;
height: 402px; height: 287px;
overflow-y: auto; overflow-y: auto;
.list { .list {
@ -297,7 +297,7 @@
.item-progress { .item-progress {
margin-right: 15px; margin-right: 15px;
width: 60%; width: 100%;
height: 24px; height: 24px;
background: #e6f0ff; background: #e6f0ff;
border-radius: 1px; border-radius: 1px;
@ -334,31 +334,56 @@
} }
.item { .item {
padding: 16px 0 12px; padding: 16px 0 7px;
border-bottom: 1px dashed #f0f5fa; border-bottom: 1px dashed #f0f5fa;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
} }
.item-title { display: flex;
@include toe; align-items: center;
height: 22px; .item_right{
font-size: 14px; flex: 1;
font-family: PingFangSC-Regular, PingFang SC; .item-title {
font-weight: 400; @include toe;
color: rgba(0, 0, 0, 0.85); height: 22px;
line-height: 22px; font-size: 14px;
&:hover { font-family: PingFangSC-Regular, PingFang SC;
color: $c1; font-weight: 400;
cursor: pointer; color: rgba(0, 0, 0, 0.85);
line-height: 22px;
&:hover {
color: $c1;
cursor: pointer;
}
}
.item-date {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
line-height: 17px;
} }
} }
.item-date { .item_left{
font-size: 12px; width: 40px;
font-family: PingFangSC-Regular, PingFang SC; margin-right:15px;
font-weight: 400; .i-tag{
color: rgba(0, 0, 0, 0.45); display: block;
line-height: 17px; margin-right: 15px;
width: 40px;
height: 22px;
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.15);
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.88);
line-height: 20px;
font-style: normal;
text-align: center;
}
} }
} }
} }
} }

288
src/views/modules/home/index.vue

@ -59,66 +59,40 @@
</div> </div>
<div class="m-box m-pan"> <div class="m-box m-pan">
<div class="wrap"> <div class="header">
<div class="header">
<img <img
src="@/assets/images/index/title-icon-sqzl.png" src="@/assets/images/index/title-icon-sqzl.png"
/> />
<span>社区总览</span> <span>社区总览</span>
</div> </div>
<p>{{ pandectData.deptName }}<span v-if="pandectData.gridCount">划分为{{ pandectData.underCount }}{{
pandectData.underName
}}</span>现有房屋{{ pandectData.homeCount }}自住房屋{{ pandectData.selfStay }}
出租房屋{{ pandectData.rentOut }}
闲置房屋{{ pandectData.vacantHouse }}现有居民{{
pandectData.resiCount
}}{{
pandectData.totalResidents
}}其中常住人口{{
pandectData.permanentResiCount
}}流动人口{{
pandectData.floatingResiCount
}}各类群体分布如下
</p>
<div>
<el-button-group class="btn_group">
<el-button type="primary" :plain="btnSelectA"
@click="handleClickResiCategory">居民分类统计</el-button>
<el-button type="primary" :plain="btnSelectB"
@click="handleClickIntelligentPrediction">智能预测</el-button>
</el-button-group>
</div>
<div class="cnt"> <div class="cnt">
<div class="cnt-left">
<div class="subtitle">
<img
src="@/assets/images/index/i-sqjj.png"
/>
<span>社区简介</span>
</div>
<p>
{{ pandectData.deptName }}<span
v-if="pandectData.gridCount"
>划分为{{ pandectData.underCount }}{{
pandectData.underName
}}</span
>现有居民{{ pandectData.homeCount }}{{
pandectData.resiCount
}}其中常住人口{{
pandectData.permanentResiCount
}}流动人口{{
pandectData.floatingResiCount
}}各类群体分布如下
</p>
<div class="subtitle">
<img
src="@/assets/images/index/i-fxjg.png"
/>
<span>分析结果</span>
</div>
<p
class="hint"
v-if="resiCategory.list.length > 0"
>
根据数据分析结果建议重点关注
<b
>{{ resiCategory.list[0].name }}{{
resiCategory.list[1].name
}}{{ resiCategory.list[2].name }}</b
>
三类群体开展相关的社区服务和活动
</p>
</div>
<div class="cnt-right"> <div class="cnt-right">
<div class="list"> <div class="list">
<div <div class="item" @click="handleClickCategory(item)" :key="item.code" v-for="(
class="item" item, index
@click="handleClickCategory(item)" ) in resiCategory.list">
:key="item.code"
v-for="(
item, index
) in resiCategory.list"
>
<div> <div>
{{ {{
("0" + (index + 1)).substr(-2) ("0" + (index + 1)).substr(-2)
@ -132,11 +106,9 @@
{{ item.count }} {{ item.count }}
</div> </div>
<div class="item-progress"> <div class="item-progress">
<b <b :style="{
:style="{ width: item.per + '%',
width: item.per + '%', }"></b>
}"
></b>
</div> </div>
<div class="item-per"> <div class="item-per">
{{ item.per }} % {{ item.per }} %
@ -145,7 +117,14 @@
</div> </div>
</div> </div>
</div> </div>
</div> <p class="hint" v-if="resiCategory.list.length > 0">
根据数据分析结果建议重点关注
<b>{{ resiCategory.list[0].name }}{{
resiCategory.list[1].name
}}{{ resiCategory.list[2].name }}</b
>
三类群体开展相关的社区服务和活动
</p>
</div> </div>
</div> </div>
@ -160,19 +139,21 @@
</div> </div>
<div class="more" @click="toNoticePage">更多></div> <div class="more" @click="toNoticePage">更多></div>
<div class="cnt" v-if="noticeData.length > 0"> <div class="cnt" v-if="noticeData.length > 0">
<div <div @click="handleClickNotice(item)" class="item" :key="'notice' + item.targetId + index"
@click="handleClickNotice(item)" v-for="(item, index) in noticeData">
class="item" <div class="item_left">
:key="'notice' + item.targetId + index" <i class="i-tag" v-if="item.readFlag == 1">已读</i>
v-for="(item, index) in noticeData" <i class="i-tag" v-else>未读</i>
> </div>
<div class="item-date"> <div class="item_right">
{{ item.createdTime }} <div class="item-date">
</div> {{ item.createdTime }}
<div class="item-title"> </div>
{{ item.content }} <div class="item-title">
{{ item.content }}
</div>
</div>
</div> </div>
</div>
</div> </div>
<div class="cnt" v-else> <div class="cnt" v-else>
@ -191,87 +172,12 @@
<img <img
src="@/assets/images/index/title-icon-zntb.png" src="@/assets/images/index/title-icon-zntb.png"
/> />
<span>智能填报</span> <span>不满意事项月度趋势分析</span>
</div> </div>
</div> </div>
<div class="more">更多></div> <div class="more">更多></div>
<div class="cnt"> <div class="cnt">
<div class="item"> <div id="my_chart" style="width: 100%;height: 200px; position: relative;top:-10px"></div>
<img
class="item-tag"
src="@/assets/images/index/i-zntb.png"
/>
<div class="item-name">
80-90周岁高龄老人生活补助申请表
</div>
<div class="item-btns">
<div class="item-btn">
<img src="@/assets/images/index/i-tx.png" />
<span>填写</span>
</div>
<div class="item-btn">
<img src="@/assets/images/index/i-xz.png" />
<span>下载</span>
</div>
</div>
</div>
<div class="item">
<img
class="item-tag"
src="@/assets/images/index/i-zntb.png"
/>
<div class="item-name">
80-90周岁高龄老人生活补助申请表
</div>
<div class="item-btns">
<div class="item-btn">
<img src="@/assets/images/index/i-tx.png" />
<span>填写</span>
</div>
<div class="item-btn">
<img src="@/assets/images/index/i-xz.png" />
<span>下载</span>
</div>
</div>
</div>
<div class="item">
<img
class="item-tag"
src="@/assets/images/index/i-zntb.png"
/>
<div class="item-name">
80-90周岁高龄老人生活补助申请表
</div>
<div class="item-btns">
<div class="item-btn">
<img src="@/assets/images/index/i-tx.png" />
<span>填写</span>
</div>
<div class="item-btn">
<img src="@/assets/images/index/i-xz.png" />
<span>下载</span>
</div>
</div>
</div>
<div class="item">
<img
class="item-tag"
src="@/assets/images/index/i-zntb.png"
/>
<div class="item-name">
80-90周岁高龄老人生活补助申请表
</div>
<div class="item-btns">
<div class="item-btn">
<img src="@/assets/images/index/i-tx.png" />
<span>填写</span>
</div>
<div class="item-btn">
<img src="@/assets/images/index/i-xz.png" />
<span>下载</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -285,6 +191,7 @@ import resiCategoryMap from "@/views/business/resi-category-map.js";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import fastcall from "@/views/modules/cpts/fastcall"; import fastcall from "@/views/modules/cpts/fastcall";
import * as echarts from 'echarts';
export default { export default {
components: { fastcall }, components: { fastcall },
@ -325,7 +232,59 @@ export default {
}, },
noticeData: [], noticeData: [],
};
btnSelectA: false,
btnSelectB: true,
option : {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['12345不满意数', '省满意调查不满意数', '社区自评不满意数']
},
grid: {
left: '3%',
right: '4%',
bottom: '8%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月']
},
yAxis: {
type: 'value'
},
series: [
{
name: '12345不满意数',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '省满意调查不满意数',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '社区自评不满意数',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
}
]
},
myChart:{}
}
}, },
computed: { computed: {
maxTableHeight() { maxTableHeight() {
@ -352,12 +311,33 @@ export default {
}, },
mounted() { mounted() {
this.getApiData(); this.getApiData();
this.$nextTick(()=>{
this.initChart()
})
console.log( console.log(
"dynamicMenuRoutes----------------------------", "dynamicMenuRoutes----------------------------",
this.$store.state.sidebarMenuList this.$store.state.sidebarMenuList
); );
}, },
methods: { methods: {
initChart(){
this.myChart = echarts.init(document.getElementById('my_chart'));
this.myChart.setOption(this.option)
window.addEventListener('resize', this.handleWindowResize);
},
handleWindowResize() {
if (this.myChart) {
this.myChart.resize();
}
},
handleClickResiCategory() {
this.btnSelectA = false
this.btnSelectB = true
},
handleClickIntelligentPrediction() {
this.btnSelectA = true
this.btnSelectB = false
},
searchDataTab(str){ searchDataTab(str){
this.searchData.type = str; this.searchData.type = str;
}, },
@ -370,9 +350,19 @@ export default {
}); });
}, },
async readClearOne(item){
console.log("item",item)
const url = `/message/intelligentMessage/msg/clearOne/?msgId=${item.id}`
const {data,code,msg} = await requestPost(url)
if(code == 0){
this.getNoticeData()
}else if(code >= 8000){
this.$message.error(msg)
}
},
handleClickNotice(item) { handleClickNotice(item) {
const { msgType, targetId } = item; const { msgType, targetId } = item;
this.readClearOne(item)
if (msgType == "community_house") { if (msgType == "community_house") {
this.$refs.fastcall.showHouseInfo(targetId); this.$refs.fastcall.showHouseInfo(targetId);
} else if (msgType == "resident_base_info") { } else if (msgType == "resident_base_info") {

Loading…
Cancel
Save