@ -0,0 +1,178 @@ |
|||
import request from 'utils/requestBssb' |
|||
import config from 'utils/config' |
|||
|
|||
const baseURL = config.screenBaseUrl |
|||
|
|||
// 大屏-街道社区下拉
|
|||
export function getOptionList(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/sys/screen/dept/option/list', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-数据统计
|
|||
export function getItemdailystatis(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemstatis/itemdailystatis', |
|||
method: 'POST', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-类别分析
|
|||
export function getCategoryAnalysis(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/categoryAnalysis', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-汇总统计
|
|||
export function getEventStat(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/screen/getEventStat', |
|||
method: 'POST', |
|||
data: data |
|||
}) |
|||
} |
|||
// 大屏-事件&结案数统计柱状图
|
|||
export function getEventBar(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/screen/getEventBar', |
|||
method: 'POST', |
|||
data: data |
|||
}) |
|||
} |
|||
// 大屏-效能评价
|
|||
export function getEfficiencyEvaluation(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/screen/getEfficiencyEvaluation', |
|||
method: 'POST', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-满意度统计
|
|||
export function getEvaluationTotal(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/evaluationTotal', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-满意度趋势
|
|||
export function getEvaluationTrend(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/evaluationTrend', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
// 大屏-解决率统计
|
|||
export function getResolveTotal(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/resolveTotal', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-解决率趋势
|
|||
export function getResolveTrend(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/resolveTrend', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
// 大屏-响应率统计
|
|||
export function getXylTotal(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/responseSixHoursTotal', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-响应率趋势
|
|||
export function getXylTrend(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/responseSixHoursTrend', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
// 大屏-回复率统计
|
|||
export function getHflTotal(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/replyTotal', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 大屏-回复率趋势
|
|||
export function getHflTrend(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/replyTrend', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
// 难点事件
|
|||
|
|||
export function getItemPageList(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/itemScreen/responseSixHoursTotal', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 数据统计-列表
|
|||
export function getItemStatisListPage(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/item/getItemStatisListPage', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
|||
|
|||
// 详情
|
|||
export function getItemStatisListDetail(id) { |
|||
return request({ |
|||
baseURL, |
|||
url: `/events/item/getItemStatisListDetail/${id}`, |
|||
method: 'GET' |
|||
}) |
|||
} |
|||
|
|||
// 获取地图点位
|
|||
export function getItemListByAddress(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/events/item/getItemListByAddress', |
|||
method: 'GET', |
|||
params: data |
|||
}) |
|||
} |
@ -0,0 +1,23 @@ |
|||
import request from 'utils/requestHl' |
|||
import config from 'utils/config' |
|||
|
|||
const baseURL = config.hulianUrl |
|||
|
|||
// 党员风采列表 入参agencyId: "1175270520603930625"pageNo: 1pageSize: 10
|
|||
export function getDyfcList(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/resi/partymember/icpartymemberstyle/screen/showlist', |
|||
method: 'POST', |
|||
data: data |
|||
}) |
|||
} |
|||
export function getIcpartyactivity(data) { |
|||
return request({ |
|||
baseURL, |
|||
url: '/heart/icpartyactivity/screen/search', |
|||
method: 'POST', |
|||
data: data |
|||
}) |
|||
} |
|||
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 139 KiB |
After Width: | Height: | Size: 393 KiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 1.9 MiB |
@ -0,0 +1,161 @@ |
|||
<template> |
|||
<div class="screen-dropdown-menu" |
|||
:style="{height: dropdownMenuVisible ? dataList.length > 4 ? '260px' : `${dataList.length * 50 }px` : '0px', opacity: dropdownMenuVisible ? '1' : '0', '--top': top }"> |
|||
<div class="screen-dropdown-menu-border" |
|||
:style="{overflowY: dataList.length > 5 ? 'auto' : 'hidden'}"> |
|||
<div :class="['screen-dropdown-menu-item', item.select ? 'screen-dropdown-menu-item-active' : '']" |
|||
@click.stop="onChooseItem(item)" |
|||
v-for="item in dataList" |
|||
:key="item.value">{{item.label}}</div> |
|||
</div> |
|||
<!-- <div class="screen-dropdown-menu-arrow"></div> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'screen-dropdown-menu', |
|||
data () { |
|||
return { |
|||
dataList: [], |
|||
dropdownMenuVisible: true |
|||
} |
|||
}, |
|||
props: { |
|||
menuList: { |
|||
type: Array, |
|||
required: true, |
|||
default: () => [] |
|||
}, |
|||
defaultSelected: { |
|||
type: String | Number, |
|||
default: () => '' |
|||
}, |
|||
visible: { |
|||
type: Boolean, |
|||
default: () => false |
|||
}, |
|||
top: { |
|||
type: String, |
|||
default: '60px' |
|||
} |
|||
}, |
|||
watch: { |
|||
// 下拉菜单列表数据 |
|||
menuList: { |
|||
immediate: true, |
|||
handler: function (value) { |
|||
if (value.length > 0) { |
|||
value.forEach(item => { |
|||
item.select = false |
|||
}) |
|||
this.dataList = value |
|||
} |
|||
} |
|||
}, |
|||
// 默认选中item |
|||
defaultSelected: { |
|||
immediate: true, |
|||
handler: function (value) { |
|||
this.dataList.forEach(item => { |
|||
if (item.value === value) { |
|||
item.select = true |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
// 下拉菜单显示隐藏 |
|||
visible: { |
|||
immediate: true, |
|||
handler: function (value) { |
|||
this.dropdownMenuVisible = value |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
onChooseItem (item) { |
|||
this.dataList.forEach(data => { |
|||
if (data.value === item.value) { |
|||
data.select = true |
|||
} else { |
|||
data.select = false |
|||
} |
|||
}) |
|||
this.$emit('onChooseItem', item) |
|||
this.dropdownMenuVisible = false |
|||
this.$emit('update:visible', false) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.screen-dropdown-menu { |
|||
width: 100%; |
|||
|
|||
position: absolute; |
|||
// box-shadow: 0 2px 12px 0 #5c7bc7; |
|||
border: 1px solid #00a4b9; |
|||
|
|||
background: rgba(4, 39, 50, 0.8); |
|||
z-index: 100; |
|||
left: 0; |
|||
top: var(--top); |
|||
border-radius: 4px; |
|||
max-height: 260px; |
|||
transition: height 0.1s linear, opacity 0.1s linear; |
|||
&-border { |
|||
width: 100%; |
|||
height: 100%; |
|||
overflow-y: auto; |
|||
border-radius: 4px; |
|||
box-sizing: border-box; |
|||
// padding: 10px 0 0; |
|||
&::-webkit-scrollbar { |
|||
/*滚动条整体样式*/ |
|||
width: 6px; /*高宽分别对应横竖滚动条的尺寸*/ |
|||
height: 1px; |
|||
} |
|||
&::-webkit-scrollbar-thumb { |
|||
/*滚动条里面小方块*/ |
|||
background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%); |
|||
border-radius: 3px; |
|||
} |
|||
&::-webkit-scrollbar-track { |
|||
/*滚动条里面轨道*/ |
|||
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); |
|||
background: #428ba2; |
|||
border-radius: 3px; |
|||
} |
|||
} |
|||
&-item { |
|||
width: 100%; |
|||
height: 30px; |
|||
border-radius: 15px; |
|||
line-height: 50px; |
|||
text-align: left; |
|||
color: #fff; |
|||
font-size: 14px; |
|||
box-sizing: border-box; |
|||
padding: 0 12px; |
|||
&:hover { |
|||
color: #fff; |
|||
background: rgba(0, 205, 236); |
|||
} |
|||
} |
|||
.screen-dropdown-menu-item-active { |
|||
color: #fff; |
|||
background: rgba(0, 205, 236); |
|||
} |
|||
&-arrow { |
|||
position: absolute; |
|||
width: 0px; |
|||
height: 0px; |
|||
top: -12px; |
|||
left: 35px; |
|||
border: 6px solid transparent; |
|||
border-bottom: 6px solid #061a3b; |
|||
} |
|||
} |
|||
</style> |
|||
|
@ -0,0 +1,56 @@ |
|||
import axios from 'axios' |
|||
import config from './config' |
|||
import { Message } from 'element-ui' |
|||
// import { getCookie } from 'utils/cookie'
|
|||
|
|||
const request = axios.create({ |
|||
baseURL: config.screenBaseUrl, |
|||
timeout: 60 * 1000 |
|||
}) |
|||
|
|||
// 添加一个请求拦截器
|
|||
request.interceptors.request |
|||
.use |
|||
// (config) => {
|
|||
// if (getCookie('token')) {
|
|||
// config.headers.Authorization = `Bearer ${getCookie('token')}`
|
|||
// }
|
|||
// return config
|
|||
// },
|
|||
// (err) => {
|
|||
// return Promise.reject(err)
|
|||
// }
|
|||
() |
|||
|
|||
// 添加一个响应拦截器
|
|||
request.interceptors.response.use( |
|||
(response) => { |
|||
if ( |
|||
(response.data.code === 0 && response.data.msg === 'success') || |
|||
(response.data.code === 200 && response.data.msg === 'success') || |
|||
(response.data.status === 200 && response.data.message === 'success') |
|||
) { |
|||
return response.data |
|||
} else { |
|||
if (response.data.code === 401) { |
|||
Message({ |
|||
type: 'error', |
|||
message: response.data.msg |
|||
}) |
|||
setTimeout(() => { |
|||
window.localStorage.removeItem('token') |
|||
// router.push({ path: '/login' })
|
|||
}, 400) |
|||
return Promise.reject(new Error('error')) |
|||
} else { |
|||
return Promise.reject(response.data) |
|||
} |
|||
} |
|||
}, |
|||
(err) => { |
|||
window.localStorage.removeItem('token') |
|||
return Promise.reject(err) |
|||
} |
|||
) |
|||
|
|||
export default request |
@ -0,0 +1,56 @@ |
|||
import axios from 'axios' |
|||
import config from './config' |
|||
import { Message } from 'element-ui' |
|||
// import { getCookie } from 'utils/cookie'
|
|||
|
|||
const request = axios.create({ |
|||
baseURL: config.hulianUrl, |
|||
timeout: 60 * 1000 |
|||
}) |
|||
|
|||
// 添加一个请求拦截器
|
|||
request.interceptors.request |
|||
.use |
|||
// (config) => {
|
|||
// if (getCookie('token')) {
|
|||
// config.headers.Authorization = `Bearer ${getCookie('token')}`
|
|||
// }
|
|||
// return config
|
|||
// },
|
|||
// (err) => {
|
|||
// return Promise.reject(err)
|
|||
// }
|
|||
() |
|||
|
|||
// 添加一个响应拦截器
|
|||
request.interceptors.response.use( |
|||
(response) => { |
|||
if ( |
|||
(response.data.code === 0 && response.data.msg === 'success') || |
|||
(response.data.code === 200 && response.data.msg === 'success') || |
|||
(response.data.status === 200 && response.data.message === 'success') |
|||
) { |
|||
return response.data |
|||
} else { |
|||
if (response.data.code === 401) { |
|||
Message({ |
|||
type: 'error', |
|||
message: response.data.msg |
|||
}) |
|||
setTimeout(() => { |
|||
window.localStorage.removeItem('token') |
|||
// router.push({ path: '/login' })
|
|||
}, 400) |
|||
return Promise.reject(new Error('error')) |
|||
} else { |
|||
return Promise.reject(response.data) |
|||
} |
|||
} |
|||
}, |
|||
(err) => { |
|||
window.localStorage.removeItem('token') |
|||
return Promise.reject(err) |
|||
} |
|||
) |
|||
|
|||
export default request |
@ -1,220 +1,309 @@ |
|||
<template> |
|||
<div class="bg-content right2"> |
|||
<div class='b-dyxf'> |
|||
<screen-title :titleName="'党员先锋模范'"></screen-title> |
|||
<div class="dyxf-main"> |
|||
<div class="b-dyxf"> |
|||
<screen-title :titleName="'概览'"></screen-title> |
|||
<div class="dyxf-main" v-if="proportion"> |
|||
<div class="dyxf-pie"> |
|||
<screen-echarts-frame class="pie" |
|||
@myChartMethod="pieInitOk" |
|||
ref="pieChart"></screen-echarts-frame> |
|||
<div class="pie-title">{{'党员参与议题'}}</div> |
|||
<screen-echarts-frame class="pie" @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame> |
|||
<!-- <div class="pie-title">{{ '党员参与议题' }}</div> --> |
|||
</div> |
|||
<div class="dyxf-static"> |
|||
<div class='dyxf-static-row'> |
|||
<div class="dyxf-static-row"> |
|||
<div class="static-item"> |
|||
<div class="item-title">{{'党员发布话题'}}</div> |
|||
<div class="item-title">{{ "满意度" }}</div> |
|||
<div class="item-num"> |
|||
<div class="num-left">{{'53,788'}}</div> |
|||
<div class="num-right">{{'82.21%'}}</div> |
|||
|
|||
<div class="num-left">{{ evaluationTotal }}</div> |
|||
<div class="num-right">{{ evaluationProportion + '%' }}</div> |
|||
</div> |
|||
</div> |
|||
<div class="static-item item2"> |
|||
<div class="item-title">{{'党员发布议题'}}</div> |
|||
<div class="item-title">{{ "解决率" }}</div> |
|||
<div class="item-num"> |
|||
<div class="num-left">{{'22,024'}}</div> |
|||
<div class="num-right">{{'24.14%'}}</div> |
|||
|
|||
<div class="num-left">{{ resolveTotal }}</div> |
|||
<div class="num-right">{{ resolveProportion + '%' }}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class='dyxf-static-row row2'> |
|||
<div class="dyxf-static-row row2"> |
|||
<div class="static-item"> |
|||
<div class="item-title">{{'议题转诉求'}}</div> |
|||
<div class="item-title">{{ "按期响应率" }}</div> |
|||
<div class="item-num"> |
|||
<div class="num-left">{{'5,302'}}</div> |
|||
<div class="num-right">{{'66.74%'}}</div> |
|||
|
|||
<div class="num-left">{{ xylTotal }}</div> |
|||
<div class="num-right">{{ xylProportion + '%' }}</div> |
|||
</div> |
|||
</div> |
|||
<div class="static-item item2"> |
|||
<div class="item-title">{{'解决诉求'}}</div> |
|||
<div class="item-title">{{ "按期回复率" }}</div> |
|||
<div class="item-num"> |
|||
<div class="num-left">{{'5,136'}}</div> |
|||
<div class="num-right">{{'67.11%'}}</div> |
|||
|
|||
<div class="num-left">{{ hflTotal }}</div> |
|||
<div class="num-right">{{ hflProportion + '%' }}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div v-else> |
|||
<screen-loading style="width: 620px;height: 290px;" >加载中...</screen-loading> |
|||
</div> |
|||
</div> |
|||
<div class='b-dyqz'> |
|||
<screen-title :titleName="'党员联系群众'"></screen-title> |
|||
<div class="b-dyqz"> |
|||
<screen-title :titleName="'满意度'"> |
|||
<!-- <slot> |
|||
<screen-dropdown-menu top="45px" |
|||
:menuList="option" |
|||
:visible.sync="streetDropMenuVisible" |
|||
:defaultSelected="selectStreet.value" |
|||
@onChooseItem="onChooseStreet" style="border-radius: 30px;"> |
|||
</screen-dropdown-menu> |
|||
</slot> --> |
|||
</screen-title> |
|||
<div class="dyqz-main"> |
|||
|
|||
<screen-echarts-frame class="line" |
|||
@myChartMethod="lineInitOk" |
|||
ref="lineChart"></screen-echarts-frame> |
|||
|
|||
<screen-echarts-frame class="line" @myChartMethod="lineInitOk" ref="lineChart"></screen-echarts-frame> |
|||
</div> |
|||
</div> |
|||
<div class='b-xjph'> |
|||
<screen-title :titleName="'先进排行榜单'"></screen-title> |
|||
<div class="b-xjph"> |
|||
<screen-title :titleName="'效能评价'"></screen-title> |
|||
<div class="table"> |
|||
|
|||
<screen-custom-table :headerColor="'#BDE8FF'" |
|||
:headerHeight="'36px'" |
|||
:bodyTdColor="'#FFFFFF'" |
|||
:bodyTdFontSize="'18px'" |
|||
:tableHeight="104" |
|||
:showTableLine="true" |
|||
:dataList="dataListResult" |
|||
:isChangeColor=false |
|||
:rowColor="'rgba(11,68,135,0.16)'" |
|||
:noData="noData" |
|||
:pageSize="pageSize" |
|||
:headerList="headerList"> |
|||
<screen-custom-table :headerColor="'#BDE8FF'" :headerHeight="'36px'" :bodyTdColor="'#FFFFFF'" |
|||
:bodyTdFontSize="'18px'" :tableHeight="104" :showTableLine="true" :dataList="dataListResult" |
|||
:isChangeColor="false" :rowColor="'rgba(11,68,135,0.16)'" :noData="noData" :pageSize="pageSize" |
|||
:headerList="headerList"> |
|||
</screen-custom-table> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { pieOption } from './pieOption.js' |
|||
import { lineOption } from './lineOption.js' |
|||
import { mapGetters } from 'vuex' |
|||
import { loadXjphList } from './../../data/index' |
|||
import { pieOption } from "./pieOption.js"; |
|||
import { lineOption } from "./lineOption.js"; |
|||
import { mapGetters } from "vuex"; |
|||
import { |
|||
getEvaluationTrend, |
|||
getEfficiencyEvaluation, |
|||
getResolveTotal, |
|||
getEvaluationTotal, |
|||
getXylTotal, |
|||
getHflTotal |
|||
} from "../../../src/api/bssbApi"; |
|||
export default { |
|||
name: "screen-right2", |
|||
data () { |
|||
data() { |
|||
return { |
|||
showNoData: false, |
|||
timer: null, |
|||
pieChart: '', |
|||
pieOption: {}, |
|||
pieInitState: false, |
|||
lineChart: '', |
|||
lineChartFlag: false, |
|||
lineOption: {}, |
|||
lineInitState: false, |
|||
|
|||
headerList: [{ title: '排名', width: '400px' }, { title: '单位', width: '1000px' }, '党员数', '话题数', '议题数', '诉求数', { title: '结案率', color: '#00E099' }, { title: '满意率', color: '#FFB400' }], |
|||
dataList: [], |
|||
headerList: [ |
|||
{ title: "排名", width: "400px" }, |
|||
{ title: "街道", width: "1000px" }, |
|||
{ title: "结案率", color: "#00E099" }, |
|||
{ title: "响应率", color: "#00E099" }, |
|||
{ title: "满意率", color: "#FFB400" }, |
|||
], |
|||
dataListResult: [], |
|||
noData: false, |
|||
pageSize: 5 |
|||
pageSize: 5, |
|||
deptId_: "", |
|||
selectStreet: { |
|||
value: 1, |
|||
}, |
|||
option: [ |
|||
{ label: "满意率", value: 1 }, |
|||
{ label: "解决率", value: 2 }, |
|||
{ label: "按期响应率", value: 3 }, |
|||
{ label: "按期回复率", value: 4 }, |
|||
], |
|||
streetDropMenuVisible: true, |
|||
|
|||
resolveTotal: '', |
|||
resolveProportion: '', |
|||
|
|||
evaluationTotal: '', |
|||
evaluationProportion: '', |
|||
|
|||
xylTotal: '', |
|||
xylProportion: '', |
|||
|
|||
hflTotal: '', |
|||
hflProportion: '', |
|||
|
|||
proportion: '' |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters(['shibeiAId']) |
|||
...mapGetters(["shibeiAId"]), |
|||
}, |
|||
watch: { |
|||
shibeiAId: { |
|||
handler () { |
|||
if (this.shibeiAId !== '') { |
|||
|
|||
this.getData() |
|||
handler() { |
|||
if (this.shibeiAId !== "") { |
|||
this.getData(); |
|||
} |
|||
}, |
|||
immediate: true |
|||
} |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
mounted () { |
|||
this.dataList = loadXjphList() |
|||
this.$nextTick(function () { |
|||
|
|||
this.initList() |
|||
}); |
|||
|
|||
mounted() { |
|||
this.getData(); |
|||
}, |
|||
methods: { |
|||
initList () { |
|||
this.dataListResult = [] |
|||
this.dataList.forEach(element => { |
|||
this.dataListResult.push([ |
|||
element.no, |
|||
element.unit, |
|||
element.dys, |
|||
element.hts, |
|||
element.yts, |
|||
element.sqs, |
|||
element.jal, |
|||
element.myl, |
|||
]) |
|||
}); |
|||
|
|||
console.log(this.dataListResult) |
|||
}, |
|||
getData () { |
|||
this.getPie() |
|||
this.getLine() |
|||
getLineChart() { |
|||
const params = {}; |
|||
params.deptId = this.deptId_; |
|||
const currentDate = new Date(); |
|||
params.yearMonth = currentDate.getFullYear() |
|||
this.lineChartFlag = false; |
|||
getEvaluationTrend(params) |
|||
.then((res) => { |
|||
this.evaluationTrend = res.data; |
|||
this.$refs.lineChart.clear(); |
|||
this.lineOption = lineOption(); |
|||
this.lineOption.series[0].data = this.evaluationTrend.fcmyArr; |
|||
this.lineOption.series[1].data = this.evaluationTrend.jbmyArr; |
|||
this.lineOption.series[2].data = this.evaluationTrend.bmyArr; |
|||
this.lineOption.xAxis[0].data = this.evaluationTrend.xValue; |
|||
this.lineChartFlag = true; |
|||
this.$refs.lineChart.setOption(this.lineOption); |
|||
}) |
|||
.catch((err) => { |
|||
this.lineChartFlag = true; |
|||
console.log(err); |
|||
}); |
|||
}, |
|||
pieInitOk () { |
|||
this.pieInitState = true |
|||
}, |
|||
lineInitOk () { |
|||
this.lineInitState = true |
|||
}, |
|||
getPie () { |
|||
if (this.pieInitState) { |
|||
this.getPieChart() |
|||
onChooseStreet(streetItem) { |
|||
this.selectStreet = { |
|||
label: streetItem.label, |
|||
value: streetItem.value, |
|||
centerMark: streetItem.centerMark || streetItem.center || [], |
|||
}; |
|||
this.selectCommunity = { |
|||
label: "全部社区", |
|||
value: "", |
|||
center: [], |
|||
}; |
|||
if (this.selectStreet.value) { |
|||
this.set_shibeiAgencyName(this.selectStreet.label); |
|||
this.set_shibeiAgencyType("community"); |
|||
this.set_shibeiMapCenter(this.selectStreet.center); |
|||
this.set_shibeiAgencyId(this.selectStreet.value); |
|||
} else { |
|||
setTimeout(() => { |
|||
this.getPie() |
|||
}, 500) |
|||
} |
|||
}, |
|||
// 获取饼状图 |
|||
async getPieChart () { |
|||
getData() { |
|||
this.getEfficiencyEvaluation(); |
|||
this.fetchData(); |
|||
this.getLine(); |
|||
}, |
|||
// 获取效能评价列表 |
|||
getEfficiencyEvaluation() { |
|||
let params = { |
|||
deptId: this.shibeiAId || "1175270520603930625", |
|||
statType: "1", |
|||
startDate: "", |
|||
endDate: "", |
|||
type: "1", |
|||
peopleFlag: "", |
|||
}; |
|||
getEfficiencyEvaluation(params).then(res => { |
|||
if (res.code == 0) { |
|||
this.dataListResult = res.data.map((item, index) => [index + 1, item.deptName, item.closedRatio, item.responseRatio, item.satisfiedRatio]) |
|||
if (this.dataListResult.length === 0) { |
|||
this.noData = true |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
async fetchData() { |
|||
try { |
|||
const params = { |
|||
deptId: this.shibeiAId || '1175270520603930625', |
|||
startTime: '', |
|||
endTime: '', |
|||
peopleFlag: '', |
|||
}; |
|||
|
|||
this.$refs.pieChart.clear() |
|||
const resolveTotal = await getResolveTotal(params); |
|||
const evaluationTotal = await getEvaluationTotal(params); |
|||
const xylTotal = await getXylTotal(params); |
|||
const hflTotal = await getHflTotal(params); |
|||
|
|||
// 获取pieChart配置 |
|||
this.pieOption = pieOption() |
|||
const val1 = 80 |
|||
const val2 = 20 |
|||
this.pieOption.title.text = `84%` |
|||
this.resolveTotal = this.calculateSum(resolveTotal.data, ["基本解决", "解决"]); |
|||
const resolveTotalNum = this.calculateTotalNum(resolveTotal.data); |
|||
|
|||
this.pieOption.series[1].data[0].value = 80 |
|||
this.pieOption.series[1].data[1].value = 20 |
|||
this.resolveProportion = this.calculateProportion(this.resolveTotal, resolveTotalNum); |
|||
|
|||
this.evaluationTotal = this.calculateSum(evaluationTotal.data, ["非常满意", "基本满意"]); |
|||
const evaluationTotalNum = this.calculateTotalNum(evaluationTotal.data); |
|||
|
|||
// this.$refs.pieChart.hideLoading() |
|||
this.$refs.pieChart.setOption(this.pieOption) |
|||
}, |
|||
getLine () { |
|||
if (this.lineInitState) { |
|||
this.getLineChart() |
|||
} else { |
|||
setTimeout(() => { |
|||
this.getLine() |
|||
}, 500) |
|||
} |
|||
}, |
|||
// 获取饼状图 |
|||
async getLineChart () { |
|||
this.evaluationProportion = this.calculateProportion(this.evaluationTotal, evaluationTotalNum); |
|||
|
|||
this.$refs.lineChart.clear() |
|||
this.xylTotal = xylTotal.data.find(item => item.name === '按期响应').value; |
|||
const xylValue = xylTotal.data.find(item => item.name === '按期响应').total; |
|||
this.xylProportion = this.calculateProportion(this.xylTotal,xylValue ); |
|||
|
|||
// // 获取pieChart配置 |
|||
this.lineOption = lineOption() |
|||
// const val1 = 80 |
|||
// const val2 = 20 |
|||
// this.lineOption.title.text = `84%` |
|||
this.hflTotal = hflTotal.data.find(item => item.name === '按时回复').value; |
|||
const hflValue = hflTotal.data.find(item => item.name === '按时回复').total; |
|||
this.hflProportion = this.calculateProportion(this.hflTotal,hflValue ); |
|||
|
|||
// this.lineOption.series[1].data[0].value = 80 |
|||
// this.lineOption.series[1].data[1].value = 20 |
|||
const hflProportion = parseFloat(this.hflProportion) || 0; |
|||
const xylProportion = parseFloat(this.xylProportion) || 0; |
|||
const evaluationProportion = parseFloat(this.evaluationProportion) || 0; |
|||
const resolveProportion = parseFloat(this.resolveProportion) || 0; |
|||
this.proportion = (hflProportion + xylProportion + evaluationProportion + resolveProportion) / 4; |
|||
await this.getPieChart() |
|||
} catch (error) { |
|||
console.error('Error fetching data:', error); |
|||
} |
|||
}, |
|||
calculateSum(data, names) { |
|||
return data.reduce((sum, item) => { |
|||
if (names.includes(item.name)) { |
|||
return sum + parseInt(item.value, 10); |
|||
} |
|||
return sum; |
|||
}, 0); |
|||
}, |
|||
|
|||
calculateTotalNum(data) { |
|||
return data.reduce((sum, item) => sum + parseInt(item.value, 10), 0); |
|||
}, |
|||
|
|||
// // this.$refs.pieChart.hideLoading() |
|||
this.$refs.lineChart.setOption(this.lineOption) |
|||
calculateProportion(part, whole) { |
|||
return ((part / whole) * 100).toFixed(2); |
|||
}, |
|||
pieInitOk() { |
|||
this.pieInitState = true; |
|||
}, |
|||
lineInitOk() { |
|||
this.lineInitState = true; |
|||
}, |
|||
|
|||
// 获取饼状图 |
|||
async getPieChart() { |
|||
this.$refs.pieChart.clear(); |
|||
// 获取pieChart配置 |
|||
this.pieOption = pieOption(); |
|||
this.pieOption.title.text = this.proportion + '%' |
|||
this.pieOption.series[1].data[0].value = this.proportion; |
|||
this.pieOption.series[1].data[1].value = 100 - this.proportion ; |
|||
this.$refs.pieChart.setOption(this.pieOption); |
|||
}, |
|||
} |
|||
} |
|||
getLine() { |
|||
if (this.lineInitState) { |
|||
this.getLineChart(); |
|||
} else { |
|||
setTimeout(() => { |
|||
this.getLine(); |
|||
}, 500); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style src="style/right2.scss" lang="scss" scoped> |
|||
</style> |
|||
<style src="style/right2.scss" lang="scss" scoped></style> |