Browse Source

议题详情

feature
jiangyy 4 years ago
parent
commit
45bfab9f8b
  1. 135
      src/assets/scss/modules/visual/issue-info.scss
  2. 6
      src/assets/scss/modules/visual/processAnalyze.scss
  3. 7
      src/assets/scss/modules/visual/resibuzz.scss
  4. 229
      src/views/modules/visual/communityGovern/cpt/issue-info.vue
  5. 241
      src/views/modules/visual/communityGovern/processAnalyze.vue
  6. 11
      src/views/modules/visual/communityGovern/processLineOption.js
  7. 272
      src/views/modules/visual/communityGovern/resibuzz.vue
  8. 58
      src/views/modules/visual/communityGovern/typeAnalyze.vue
  9. 7
      src/views/modules/visual/components/screen-map/index.vue
  10. 34
      src/views/modules/visual/components/screen-nodata/index.vue
  11. 31
      src/views/modules/visual/measure/volunteer.vue

135
src/assets/scss/modules/visual/issue-info.scss

@ -0,0 +1,135 @@
@import '../../c/config';
@import '../../c/function';
@import './c/common';
.m-pop {
@include shield;
background-color: rgba(#000, 0.9);
overflow-y: auto;
.wrap {
position: relative;
margin: 120px auto;
width: 1020px;
.title {
padding: 10px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
display: flex;
align-items: center;
img {
display: block;
margin-right: 5px;
}
span {
display: block;
}
}
.btn-close {
position: absolute;
top: -10px;
right: -10px;
cursor: pointer;
}
.line {
margin: 20px auto;
width: 900px;
height: 1px;
border: 1px dashed #1257c9;
}
}
}
.m-content {
display: flex;
}
.m-info {
padding-left: 62px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 24px;
width: 50%;
.info-title {
margin-top: 30px;
font-size: 20px;
font-family: PingFang SC;
font-weight: bold;
color: #ffffff;
line-height: 30px;
}
.info-prop {
position: relative;
margin: 10px 0;
display: flex;
padding-left: 15px;
.info-pics {
display: flex;
margin: 20px 0;
img {
display: block;
width: 32%;
height: 90px;
margin-right: 9px;
object-fit: cover;
}
}
> span,
> div {
display: block;
max-width: 300px;
}
&::before {
content: '';
display: block;
position: absolute;
top: 9px;
left: 0;
width: 7px;
height: 7px;
background: #0c81fe;
border-radius: 3px;
margin-right: 10px;
}
}
}
.m-line {
width: 50%;
.stat {
margin: 20px 0 10px;
display: flex;
.stat-item {
width: 33%;
text-align: center;
div {
font-size: 17px;
font-family: Source Han Serif SC;
font-weight: 500;
color: rgba(#fff, 0.5);
line-height: 24px;
&.z-weak {
font-size: 12px;
font-family: Source Han Serif SC;
font-weight: 500;
color: rgba(#fff, 0.5);
line-height: 24px;
}
}
}
}
}

6
src/assets/scss/modules/visual/processAnalyze.scss

@ -293,3 +293,9 @@
} }
} }
} }
.table-status {
position: relative;
width: 600px;
margin: auto;
}

7
src/assets/scss/modules/visual/resibuzz.scss

@ -134,3 +134,10 @@
height: 90%; height: 90%;
} }
} }
.table-status {
position: relative;
width: 600px;
margin: auto;
margin-top: 200px;
}

229
src/views/modules/visual/communityGovern/cpt/issue-info.vue

@ -0,0 +1,229 @@
<template>
<div class="m-pop">
<div class="wrap">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>议题详情</span>
</div>
<div class="btn-close"
@click="handleClose">
<img src="@/assets/img/shuju/people/close.png" />
</div>
<div class="m-content">
<div class="m-info">
<div class="info-prop">
<span>议题标题</span>
<span>{{ info.issueTitle }}</span>
</div>
<div class="info-prop">
<span>议题建议</span>
<span>{{ info.issueSuggestion }}</span>
</div>
<div class="info-prop">
<span>话题内容</span>
<div>{{ info.topicInfo.topicContent }}</div>
<div v-if="info.topicInfo.topicImgs&&info.topicInfo.topicImgs.length>0"
class="info-pics">
<img :src="src"
:key="src"
v-for="src in info.topicInfo.topicImgs" />
</div>
</div>
<div class="info-prop">
<span>转议题时间</span>
<span>{{ info.shiftIssueTime}}</span>
</div>
<div class="info-prop">
<span>所属网格</span>
<span>{{ info.belongsGridName}}</span>
</div>
<div class="info-prop">
<span>话题发表人</span>
<span>{{ info.topicInfo.publishedUser}}</span>
</div>
<div class="info-prop">
<span>议题发起人</span>
<span>{{ info.issueInitiator}}</span>
</div>
<div class="info-prop">
<span>话题来源</span>
<span>{{ info.topicInfo.groupName}}</span>
</div>
<div class="info-prop">
<span>话题发表时间</span>
<span>{{ info.topicInfo.publishedTimeShow}}</span>
</div>
</div>
<div class="m-line">
<div class="stat">
<div class="stat-item">
<div>
{{ issueTrend.realityVoteCount }}/{{
issueTrend.shouldVoteCount
}}
</div>
<div class="z-weak">已表决/应表决</div>
</div>
<div class="stat-item">
<div>{{ issueTrend.supportAmount }}</div>
<div class="z-weak">支持</div>
</div>
<div class="stat-item">
<div>{{ issueTrend.oppositionAmount }}</div>
<div class="z-weak">反对</div>
</div>
</div>
<line-chart :list="issueChartData" />
</div>
</div>
</cpt-card>
</div>
</div>
</template>
<script>
import cptCard from "@/views/modules/visual/cpts/card";
import screenLoading from "@/views/modules/visual/cpts/loading";
import { requestPost } from "@/js/dai/request";
import lineChart from "@/views/modules/visual/cpts/line-chart";
import dateFormat from "dai-js/tools/dateFormat";
export default {
name: "demandInfo",
props: {
issueId: {
type: String,
default: "",
},
},
components: {
cptCard,
lineChart,
screenLoading,
},
data () {
return {
info: {
attitude: "",
belongsGridName: "",
issueIdea: "",
issueInitiator: "",
issueStatus: "",
issueSuggestion: "",
issueTitle: "",
joinVote: false,
projectId: "",
projectStatus: true,
publishIdeaFlag: false,
shiftIssueTime: "",
topicInfo: {
groupId: "",
groupName: "",
groupType: "",
publishedTime: "",
publishedUser: "",
topicContent: "",
topicId: "",
topicImgs: null,
},
},
issueTrend: {},
issueChartData: [],
};
},
computed: {},
watch: {
issueId () {
this.getApiData();
},
},
mounted () {
this.getApiData();
},
methods: {
handleClose () {
this.$emit("close");
},
async getApiData () {
await this.getInfo();
await this.getIssueTrend()
},
//
async getInfo () {
const url = "/resi/hall/issue/detail";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz";
let params = {
issueId: this.issueId,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.info = data
this.info.topicInfo.publishedTimeShow = dateFormat(new Date(this.info.topicInfo.publishedTime * 1000), "yyyy-MM-dd")
} else {
this.$message.error(msg);
}
},
//
async getIssueTrend () {
const url = "/resi/hall/issue/votingtrend";
const { data, code, msg } = await requestPost(url, {
issueId: this.issueId,
});
if (code === 0) {
this.issueTrend = data;
let chartData = [];
data.polyLine.forEach((item) => {
let date = dateFormat(new Date(item.voteDate * 1000), "yyyy-MM-dd");
console.log("date:" + date);
chartData.push(
{
date,
value: item.supportIncrement,
type: "支持",
},
{
date,
value: item.oppositionIncrement,
type: "反对",
}
);
});
this.issueChartData = chartData;
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/visual/issue-info.scss"
scoped
></style>

241
src/views/modules/visual/communityGovern/processAnalyze.vue

@ -41,7 +41,8 @@
<span class="c_today">{{monthIncr}}</span> <span class="c_today">{{monthIncr}}</span>
</div> </div>
</div> </div>
<div class="g-pie"> <div v-if="!pieNoData && !dataLoading"
class="g-pie">
<screen-echarts-frame class="echart-wr" <screen-echarts-frame class="echart-wr"
@myChartMethod="pieInitOk" @myChartMethod="pieInitOk"
ref="pieChart"></screen-echarts-frame> ref="pieChart"></screen-echarts-frame>
@ -60,12 +61,26 @@
</div> </div>
</div> </div>
<screen-nodata class="nodata"
v-if="pieNoData&& !dataLoading"></screen-nodata>
<div class="table-status"
v-if="dataLoading">
<screen-loading>加载中</screen-loading>
</div>
</div> </div>
<div class="l_bottom"> <div class="l_bottom">
<div class="bottom_label">近12月新增项目数</div> <div class="bottom_label">近12月新增项目数</div>
<screen-echarts-frame class="echart-line" <screen-echarts-frame v-if="!lineNoData&& !dataLoading"
class="echart-line"
@myChartMethod="lineInitOk" @myChartMethod="lineInitOk"
ref="lineChart"></screen-echarts-frame> ref="lineChart"></screen-echarts-frame>
<screen-nodata class="nodata"
v-if="lineNoData&& !dataLoading"></screen-nodata>
<div class="table-status"
v-if="dataLoading">
<screen-loading>加载中</screen-loading>
</div>
</div> </div>
</div> </div>
<div class="g-r"> <div class="g-r">
@ -105,6 +120,8 @@ import cptCard from "@/views/modules/visual/cpts/card";
import cptTb from "@/views/modules/visual/cpts/tb"; import cptTb from "@/views/modules/visual/cpts/tb";
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame";
import screenMap from "@/views/modules/visual/components/screen-map"; import screenMap from "@/views/modules/visual/components/screen-map";
import ScreenLoading from "@/views/modules/visual/components/screen-loading";
import ScreenNodata from "@/views/modules/visual/components/screen-nodata";
import { pieOption } from './processPieOption.js' import { pieOption } from './processPieOption.js'
import { lineOption } from './processLineOption.js' import { lineOption } from './processLineOption.js'
@ -115,9 +132,10 @@ export default {
name: "HomeMap", name: "HomeMap",
data () { data () {
return { return {
showNoData: false, dataLoading: true,
timer: null, pieNoData: false,
isfirstInit: true, lineNoData: false,
isfirstInit: true,//
projectTotal: 0, projectTotal: 0,
dateIncr: 0, dateIncr: 0,
@ -127,7 +145,9 @@ export default {
lineOption: {}, lineOption: {},
lineInitState: false, lineInitState: false,
lineColorArray: [], lineColorArray: [],
lineData: [820, 932, 901, 934, 1290, 1330, 1320], lineData: [],
lineXaxis: [],
lineSeriesData: [],
pieChartS: null, pieChartS: null,
pieChart: '', pieChart: '',
@ -136,9 +156,8 @@ export default {
pieTotal: 0, pieTotal: 0,
colorArray: [], colorArray: [],
pieData: [ pieData: [
{ value: 1048, name: '未结案', color: '#FAC126', selected: true }, // { value: 1048, name: '', color: '#FAC126', selected: true },
{ value: 735, name: '已结案', color: '#3DDA83' }, // { value: 735, name: '', color: '#3DDA83' },
], ],
legendArray: [ legendArray: [
@ -182,26 +201,7 @@ export default {
title: "南宁第二网格", title: "南宁第二网格",
} }
], ],
projectList2: [
{
agencyId: '',
projectId: '',
origin: '',
status: 'pending',
title: '山东路山东路',
latitude: 36.062227,
longitude: 120.379455,
},
{
agencyId: '',
projectId: '',
origin: '',
status: 'closed',
latitude: 36.082227,
longitude: 120.379455,
title: "山东路",
}
],
iconUrlArray: [], iconUrlArray: [],
iconTextStyle: {}, iconTextStyle: {},
@ -222,87 +222,88 @@ export default {
}, },
// mixins: [animate] // mixins: [animate]
beforeDestroy () { beforeDestroy () {
this.timer && clearInterval(this.timer)
}, },
async created () {
async mounted () { },
this.userId = this.uid;
async mounted () {
this.dataLoading = true
//
this.initData() this.initData()
await this.getAgencylist()//
//
await this.getProjectTotal()
await this.getLineChart()
await this.loadProjectlist()
this.dataLoading = false
// this.agencyInfo = this.$store.state.user this.assignData()
// this.agencyId = this.agencyInfo.agencyId
// await this.getWorkUserInfo()
await this.getAgencylist()//
await nextTick(500)
await this.getApiData();
}, },
methods: { methods: {
initData () {
var time = (new Date).getTime() - 24 * 60 * 60 * 1000;
var nowdate = new Date(time); //
var y = nowdate.getFullYear();
var m = nowdate.getMonth() + 1 < 10 ? "0" + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1;
var d = nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate();
this.dateIdShow = y + '-' + m + '-' + d;
},
async getApiData () { async getApiData () {
await this.getProjectTotal() await this.getProjectTotal()
await this.getLineChart()
await this.loadProjectlist() await this.loadProjectlist()
await this.getLine()
}, },
assignData () {
this.getPie()
this.getLine()
},
handleChangeDate (value) { handleChangeDate (value) {
this.dateIdShow = value this.dateIdShow = value
this.getApiData() this.getApiData()
}, },
// //
getAgencylist () { async getAgencylist () {
const url = '/gov/org/customeragency/agencygridtree' const url = "/gov/org/customeragency/agencygridtree";
let params = {}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data
this.agencyId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
// let params = {};
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) { const { data, code, msg } = await requestPost(url, params);
this.casOptions.push(data) if (code === 0) {
this.agencyIdArray.push(this.agencyId) this.agencyInfo = data
} this.agencyId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
}, //
(rspMsg, data) => { ++this.iscascaderShow
this.$message.error(rspMsg) this.casOptions = []
this.agencyIdArray.length = []
if (data) {
this.casOptions.push(data)
this.agencyIdArray.push(this.agencyId)
} }
)
} else {
this.$message.error(msg);
}
}, },
// //
async getProjectTotal () { async getProjectTotal () {
this.$refs.pieChart.showLoading() if (this.$refs.pieChart) {
this.$refs.pieChart.showLoading()
this.$refs.pieChart.clear()
}
const url = "/data/aggregator/project/projecttotal"; const url = "/data/aggregator/project/projecttotal";
// const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projecttotal"; // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projecttotal";
let params = { let params = {
@ -311,8 +312,9 @@ export default {
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
if (this.$refs.pieChart) {
this.$refs.pieChart.hideLoading() this.$refs.pieChart.hideLoading()
}
if (code === 0) { if (code === 0) {
this.projectTotal = data.projectTotal this.projectTotal = data.projectTotal
this.dateIncr = data.dateIncr this.dateIncr = data.dateIncr
@ -331,9 +333,6 @@ export default {
} }
] ]
this.getPie()
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
@ -409,14 +408,11 @@ export default {
}, },
loadMap () { loadMap () {
if (this.isfirstInit) { if (this.isfirstInit) {
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray //mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray
this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle, 3000) this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle, 3000)
} else { } else {
this.$refs.map.refreshMap(null, this.projectList) this.$refs.map.refreshMap(null, this.projectList)
} }
}, },
@ -426,10 +422,8 @@ export default {
}, },
pieInitOk (dom) { pieInitOk (dom) {
this.pieChartS = dom this.pieChartS = dom
this.pieInitState = true this.pieInitState = true
}, },
lineInitOk () { lineInitOk () {
@ -438,7 +432,7 @@ export default {
}, },
getLine () { getLine () {
if (this.lineInitState) { if (this.lineInitState) {
this.getLineChart() this.assignLineChart()
} else { } else {
setTimeout(() => { setTimeout(() => {
this.getLine() this.getLine()
@ -447,8 +441,10 @@ export default {
}, },
// 线 // 线
async getLineChart () { async getLineChart () {
this.$refs.lineChart.clear() if (this.$refs.lineChart) {
this.$refs.lineChart.showLoading() this.$refs.lineChart.clear()
this.$refs.lineChart.showLoading()
}
const _that = this const _that = this
// this.$refs.pieChart.showLoading() // this.$refs.pieChart.showLoading()
const url = "/data/aggregator/project/projectmonthincr"; const url = "/data/aggregator/project/projectmonthincr";
@ -459,31 +455,27 @@ export default {
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
this.$refs.lineChart.hideLoading()
if (code === 0) { if (code === 0) {
// pieChart // pieChart
this.lineOption = lineOption()
let xaxis = [] this.lineXaxis = []
let totalIndexData = [] this.lineSeriesData = []
if (data && data.length > 0) { if (data && data.length > 0) {
this.lineNoData = false
data.forEach(item => { data.forEach(item => {
xaxis.push(item.type) this.lineXaxis.push(item.type)
totalIndexData.push(item.value) this.lineSeriesData.push(item.value)
}); });
// this.lineData = data this.lineData = data
} else { } else {
this.lineNoData = true
} }
this.$refs.lineChart.setOption(this.lineOption, true)
this.$refs.lineChart.setOption({
xAxis: { data: xaxis },
series: [
{ data: totalIndexData },
]
}, true)
if (this.$refs.lineChart) {
this.$refs.lineChart.hideLoading()
}
} else { } else {
this.$message.error(msg); this.$message.error(msg);
@ -492,9 +484,21 @@ export default {
}, },
assignLineChart () {
this.lineOption = lineOption()
this.$refs.lineChart.setOption(this.lineOption, true)
this.$refs.lineChart.setOption({
xAxis: { data: this.lineXaxis },
series: [
{ data: this.lineSeriesData },
]
}, true)
},
getPie () { getPie () {
if (this.pieInitState) { if (this.pieInitState) {
this.getPieChart() this.assignPieChart()
} else { } else {
setTimeout(() => { setTimeout(() => {
this.getPie() this.getPie()
@ -502,12 +506,11 @@ export default {
} }
}, },
// //
async getPieChart () { async assignPieChart () {
this.$refs.pieChart.clear()
this.pieTotal = 0 this.pieTotal = 0
const _that = this const _that = this
// pieChart // pieChart
this.pieOption = pieOption(this.pieChartS) this.pieOption = pieOption(this.pieChartS)
@ -575,7 +578,15 @@ export default {
console.log(this.agencyIdArray) console.log(this.agencyIdArray)
}, },
//
initData () {
var time = (new Date).getTime() - 24 * 60 * 60 * 1000;
var nowdate = new Date(time); //
var y = nowdate.getFullYear();
var m = nowdate.getMonth() + 1 < 10 ? "0" + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1;
var d = nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate();
this.dateIdShow = y + '-' + m + '-' + d;
},
toUserInfo (uid) { toUserInfo (uid) {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
@ -596,6 +607,8 @@ export default {
cptTb, cptTb,
screenEchartsFrame, screenEchartsFrame,
screenMap, screenMap,
ScreenLoading,
ScreenNodata
}, },
watch: { watch: {

11
src/views/modules/visual/communityGovern/processLineOption.js

@ -2,7 +2,15 @@ import * as echarts from 'echarts'
export function lineOption () { export function lineOption () {
return { return {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
xAxis: { xAxis: {
type: 'category', type: 'category',
// boundaryGap: false, // boundaryGap: false,
@ -54,6 +62,7 @@ export function lineOption () {
{ {
name: '项目数', name: '项目数',
type: 'line', type: 'line',
smooth: true,
barWidth: 15, barWidth: 15,
areaStyle: {}, areaStyle: {},
itemStyle: { itemStyle: {

272
src/views/modules/visual/communityGovern/resibuzz.vue

@ -31,10 +31,16 @@
<div class="g-cpt-resi"> <div class="g-cpt-resi">
<div class="g-l"> <div class="g-l">
<screen-echarts-frame class="echart-wr" <screen-echarts-frame v-if="!pieNoData && !dataLoading"
class="echart-wr"
@myChartMethod="pieInitOk" @myChartMethod="pieInitOk"
ref="pieChart"></screen-echarts-frame> ref="pieChart"></screen-echarts-frame>
<screen-nodata class="nodata"
v-if="pieNoData && !dataLoading"></screen-nodata>
<div class="table-status"
v-if="dataLoading">
<screen-loading>加载中</screen-loading>
</div>
</div> </div>
<div class="g-r"> <div class="g-r">
<div class="m-tb"> <div class="m-tb">
@ -43,7 +49,8 @@
<cpt-tb :col-list="demand.colList" <cpt-tb :col-list="demand.colList"
:loading="demand.loading" :loading="demand.loading"
:header="demand.header" :header="demand.header"
:list="demand.list"></cpt-tb> :list="demand.list"
@operate="toIssueInfo"></cpt-tb>
</div> </div>
<div class="m-pagination"> <div class="m-pagination">
@ -59,6 +66,11 @@
</div> </div>
</div> </div>
<issue-info v-if="showIssue"
:issueId="issueId"
@close="showIssue = false" />
</cpt-card> </cpt-card>
</template> </template>
@ -68,17 +80,20 @@ import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import cptTb from "@/views/modules/visual/cpts/tb"; import cptTb from "@/views/modules/visual/cpts/tb";
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame";
import ScreenLoading from "@/views/modules/visual/components/screen-loading";
import ScreenNodata from "@/views/modules/visual/components/screen-nodata";
import { pieOption } from './resiPieOption.js' import { pieOption } from './resiPieOption.js'
import nextTick from 'dai-js/tools/nextTick' import nextTick from 'dai-js/tools/nextTick'
import issueInfo from "./cpt/issue-info";
export default { export default {
name: "HomeMap", name: "HomeMap",
data () { data () {
return { return {
showNoData: false, dataLoading: true,
timer: null, pieNoData: false,
pieChartS: null, pieChartS: null,
pieChart: '', pieChart: '',
pieOption: {}, pieOption: {},
@ -86,18 +101,18 @@ export default {
pieTotal: 0, pieTotal: 0,
colorArray: [], colorArray: [],
pieData: [ pieData: [
{ count: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true }, // { count: 1048, categoryName: '', color: '#1B51FF', selected: true },
{ count: 735, categoryName: '为民服务', color: '#00E5ED' }, // { count: 735, categoryName: '', color: '#00E5ED' },
{ count: 580, categoryName: '安全监管', color: '#7800FF' }, // { count: 580, categoryName: '', color: '#7800FF' },
{ count: 484, categoryName: '民政', color: '#16D783' }, // { count: 484, categoryName: '', color: '#16D783' },
{ count: 300, categoryName: '环境保护', color: '#FF7800' }, // { count: 300, categoryName: '', color: '#FF7800' },
{ count: 1048, categoryName: '建设管理', color: '#FFBA00' }, // { count: 1048, categoryName: '', color: '#FFBA00' },
{ count: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, // { count: 735, categoryName: '', color: '#FFD685' },
{ count: 1580, categoryName: '社会治安综合', color: '#2A00FF' }, // { count: 1580, categoryName: '', color: '#2A00FF' },
{ count: 484, categoryName: '公安交通管理', color: '#C600FF' }, // { count: 484, categoryName: '', color: '#C600FF' },
{ count: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, // { count: 300, categoryName: '', color: '#FF2A00' },
{ count: 484, categoryName: '民生', color: '#3DDA83' }, // { count: 484, categoryName: '', color: '#3DDA83' },
{ count: 300, categoryName: '街道安全', color: '#FAC126' } // { count: 300, categoryName: '', color: '#FAC126' }
], ],
//voting shift_project closedall //voting shift_project closedall
stateArray: [ stateArray: [
@ -122,6 +137,7 @@ export default {
status: 'all', status: 'all',
orgId: '', orgId: '',
orgTypeSel: '', orgTypeSel: '',
tableList: [],
demand: { demand: {
loading: true, loading: true,
colList: [ colList: [
@ -175,8 +191,9 @@ export default {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 0, total: 0,
}, },
showIssue: true,
issueId: 'cf48b7dc70ef4c319fd9c71890d9dbbb',
casOptions: [], casOptions: [],
agencyIdArray: [], agencyIdArray: [],
@ -195,86 +212,71 @@ export default {
}, },
// mixins: [animate] // mixins: [animate]
beforeDestroy () { beforeDestroy () {
this.timer && clearInterval(this.timer)
}, },
async mounted () { async mounted () {
this.userId = this.uid; this.dataLoading = true
await this.getAgencylist()// await this.getAgencylist()//
await nextTick(500) await this.getApiData()
this.getApiData();
this.dataLoading = false
this.getPie()
}, },
methods: { methods: {
async getApiData () { async getApiData () {
await this.getPieChart()
await this.getPie()
await this.getTable(); await this.getTable();
}, },
// //
getAgencylist () { async getAgencylist () {
const url = '/gov/org/customeragency/agencygridtree' const url = "/gov/org/customeragency/agencygridtree";
let params = {} let params = {};
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data
this.orgId = this.agencyInfo.agencyId
this.orgType = this.agencyInfo.level === 'grid' ? 'grid' : 'agency'
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
// const { data, code, msg } = await requestPost(url, params);
++this.iscascaderShow if (code === 0) {
this.casOptions = [] this.agencyInfo = data
this.agencyIdArray.length = [] this.orgId = this.agencyInfo.agencyId
this.orgType = this.agencyInfo.level === 'grid' ? 'grid' : 'agency'
if (data) {
this.casOptions.push(data)
this.agencyIdArray.push(this.agencyInfo.orgLevel)
}
}, if (!this.agencyInfo.latitude) {
(rspMsg, data) => { this.agencyInfo.latitude = 36.072227
this.$message.error(rspMsg) }
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
} }
)
}, //
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
pieInitOk (dom) { if (data) {
console.log('pie准备好了', dom) this.casOptions.push(data)
this.pieChartS = dom this.agencyIdArray.push(this.agencyInfo.orgLevel)
this.pieInitState = true }
},
getPie () {
if (this.pieInitState) {
this.getPieChart()
} else { } else {
setTimeout(() => { this.$message.error(msg);
this.getPie()
}, 500)
} }
}, },
// //
async getPieChart () { async getPieChart () {
this.$refs.pieChart.clear() if (this.$refs.pieChart) {
this.pieTotal = 0 this.$refs.pieChart.clear()
const _that = this this.$refs.pieChart.showLoading()
// this.$refs.pieChart.showLoading() }
const url = "/gov/issue/issue/resibuzz-leftpiechart"; const url = "/gov/issue/issue/resibuzz-leftpiechart";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart";
let params = { let params = {
@ -286,54 +288,40 @@ export default {
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
// pieChart
this.pieOption = pieOption(this.pieChartS)
if (data && data.length > 0) { if (data && data.length > 0) {
this.pieData = data this.pieData = data
} else { } else {
this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] this.pieData = []
}
let maxValue = this.pieData[0].count
let maxIndex = 0
this.pieData[0].selected = true
this.pieData.forEach((item, index) => {
item.name = item.categoryName
item.value = item.count
this.colorArray.push(item.color)
this.pieTotal = this.pieTotal + item.value
if (item.value > maxValue) {
maxValue = item.value
maxIndex = index
item.selected = true
} else if (index !== 0) {
item.selected = false
}
});
this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].itemStyle = {
color: function (params) {
return _that.colorArray[params.dataIndex]
}
} }
this.clickPie(maxIndex)
let fun = function (params) { if (this.$refs.pieChart) {
_that.clickPie(params.dataIndex) this.$refs.pieChart.hideLoading()
} }
this.$refs.pieChart.handleClick(fun)
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
},
pieInitOk (dom) {
console.log('pie准备好了', dom)
this.pieChartS = dom
this.pieInitState = true
}, },
getPie () {
if (this.pieInitState) {
this.assignPieChart()
} else {
setTimeout(() => {
this.getPie()
}, 500)
}
},
clickPie (seriesIndex) { clickPie (seriesIndex) {
this.pieData.forEach((element, index) => { this.pieData.forEach((element, index) => {
@ -368,28 +356,76 @@ export default {
} }
}); });
this.pieOption.series[1].data = this.pieData this.pieOption.series[1].data = this.pieData
// this.$refs.pieChart.hideLoading()
this.$refs.pieChart.setOption(this.pieOption) this.$refs.pieChart.setOption(this.pieOption)
}, },
assignPieChart () {
this.pieTotal = 0
if (this.pieData.length > 0) {
this.pieNoData = false
const _that = this
let maxIndex = 0
let maxValue = this.pieData[0].count
this.pieData[0].selected = true
this.pieData.forEach((item, index) => {
item.name = item.categoryName
item.value = item.count
this.colorArray.push(item.color)
this.pieTotal = this.pieTotal + item.value
if (item.value > maxValue) {
maxValue = item.value
maxIndex = index
item.selected = true
} else if (index !== 0) {
item.selected = false
}
});
// pieChart
this.pieOption = pieOption(this.pieChartS)
this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].itemStyle = {
color: function (params) {
return _that.colorArray[params.dataIndex]
}
}
this.clickPie(maxIndex)
let fun = function (params) {
_that.clickPie(params.dataIndex)
}
this.$refs.pieChart.handleClick(fun)
} else {
this.pieNoData = true
}
},
handleChangeState (index) { handleChangeState (index) {
this.getTable() this.getTable()
}, },
handleChangeAgency (value) { async handleChangeAgency (value) {
let orgArray = [] let orgArray = []
let key = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' let key = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
if (key) { if (key) {
orgArray = key.split('-') orgArray = key.split('-')
this.orgId = orgArray[0] this.orgId = orgArray[0]
this.orgType = orgArray[1] this.orgType = orgArray[1] === 'grid' ? 'grid' : 'agency'
} else { } else {
this.orgId = '' this.orgId = ''
this.orgType = '' this.orgType = ''
} }
this.getApiData() await this.getApiData()
this.assignPieChart()
}, },
@ -410,6 +446,7 @@ export default {
if (code === 0) { if (code === 0) {
this.demand.total = data.total; this.demand.total = data.total;
this.tableList = data.list
this.demand.list = data.list.map((item) => { this.demand.list = data.list.map((item) => {
return [ return [
{ type: "index" }, { type: "index" },
@ -434,8 +471,12 @@ export default {
this.demand.pageNo = val; this.demand.pageNo = val;
this.getTable(); this.getTable();
}, },
toUserInfo (uid) {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); async toIssueInfo (index) {
const { tableList } = this;
this.issueId = tableList[index].issueId
this.showIssue = true
}, },
}, },
props: { props: {
@ -452,6 +493,9 @@ export default {
cptCard, cptCard,
cptTb, cptTb,
screenEchartsFrame, screenEchartsFrame,
ScreenLoading,
ScreenNodata,
issueInfo
}, },
watch: { watch: {

58
src/views/modules/visual/communityGovern/typeAnalyze.vue

@ -194,40 +194,38 @@ export default {
}, },
// //
getAgencylist () { async getAgencylist () {
const url = '/gov/org/customeragency/agencygridtree' const url = "/gov/org/customeragency/agencygridtree";
let params = {}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data
this.agencyId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
// let params = {};
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) { const { data, code, msg } = await requestPost(url, params);
this.casOptions.push(data) if (code === 0) {
this.agencyIdArray.push(this.agencyId) this.agencyInfo = data
} this.agencyId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
}, //
(rspMsg, data) => { ++this.iscascaderShow
this.$message.error(rspMsg) this.casOptions = []
this.agencyIdArray.length = []
if (data) {
this.casOptions.push(data)
this.agencyIdArray.push(this.agencyId)
} }
)
} else {
this.$message.error(msg);
}
}, },

7
src/views/modules/visual/components/screen-map/index.vue

@ -49,10 +49,6 @@ let iconSource; // icon
let select;// let select;//
//url
let polygonColorArray = [ let polygonColorArray = [
'rgba(210, 2, 2, 0.24)', 'rgba(210, 2, 2, 0.24)',
'rgba(43, 231, 253, 0.25)', 'rgba(43, 231, 253, 0.25)',
@ -60,8 +56,7 @@ let polygonColorArray = [
]; ];
// //
var polygonStyleFunction = (function () { var polygonStyleFunction = (function () {
return function (feature) { return function (feature) {
return new Style({ return new Style({

34
src/views/modules/visual/components/screen-nodata/index.vue

@ -0,0 +1,34 @@
<template>
<div class="empty">
<div class="icon"></div>
</div>
</template>
<script>
export default {
data () {
return {}
},
methods: {}
}
</script>
<style scoped lang="scss" rel="stylesheet/scss">
.empty {
width: 100%;
height: calc(100% - 37px);
margin: 15px 0;
display: flex;
justify-content: center;
align-items: center;
.icon {
width: 100%;
height: 160px;
background: url("../../../../../assets/img/modules/visual/noData.png")
no-repeat;
background-size: contain;
background-position: 50% 50%;
}
}
</style>

31
src/views/modules/visual/measure/volunteer.vue

@ -71,6 +71,12 @@
</div> </div>
</div> </div>
<div class="card-map">
<screen-map class="map"
ref="map"
@clickFeature="clickProject"
:showIconLayer="true"></screen-map>
</div>
<div class="map-tips"> <div class="map-tips">
<div class="map-tips-item" <div class="map-tips-item"
@ -84,13 +90,6 @@
</div> </div>
<div class="card-map">
<screen-map class="map"
ref="map"
@clickFeature="clickProject"
:showIconLayer="true"></screen-map>
</div>
</cpt-card> </cpt-card>
</div> </div>
</template> </template>
@ -487,6 +486,7 @@ export default {
.card-wr:last-child { .card-wr:last-child {
margin-left: 20px; margin-left: 20px;
} }
padding: 25px 21px 15px 24px;
} }
.card-title { .card-title {
display: flex; display: flex;
@ -494,10 +494,10 @@ export default {
cursor: pointer; cursor: pointer;
.title-icon { .title-icon {
display: block; display: block;
width: 46px; width: 36px;
height: 34px; height: 29px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 6px; margin-right: 3px;
} }
.title-label { .title-label {
font-size: 16px; font-size: 16px;
@ -593,17 +593,20 @@ export default {
} }
.map-tips { .map-tips {
width: 100%; width: 700px;
display: flex; display: flex;
justify-content: start;
flex-wrap: wrap; flex-wrap: wrap;
padding-top: 10px; padding-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
.map-tips-item { .map-tips-item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 20px; margin-top: 10px;
margin-right: 40px; margin-right: 40px;
.map-tips-icon { .map-tips-icon {
width: 20px; width: 20px;
height: 10px; height: 10px;
@ -621,10 +624,12 @@ export default {
.card-wr-map { .card-wr-map {
height: calc(100vh - 110px); height: calc(100vh - 110px);
text-align: center;
.card-map { .card-map {
margin-top: 10px;
width: 100%; width: 100%;
height: calc(100vh - 255px); height: calc(100vh - 295px);
.map { .map {
width: 100%; width: 100%;

Loading…
Cancel
Save