32
-
{{'联建单位总数'}}
+
{{ '联建单位总数' }}
-
+
@@ -25,17 +21,9 @@
@@ -47,10 +35,10 @@ import * as echarts from 'echarts'
import 'echarts-gl'
import { loadLjhdList } from './../../data/index'
-
+import { getIcpartyactivity } from '../../api/hulianApi'
export default {
name: "screen-left3",
- data () {
+ data() {
return {
//饼图数据+颜色
optionData: [
@@ -90,37 +78,38 @@ export default {
],
headerList: ['所属网格', { title: '活动标题', width: '1000px' }, '单位名称', { title: '人员', width: '200px' }, '活动时间'],
- dataList: [],
dataListResult: [],
noData: false,
pageSize: 8
}
},
- mounted () {
- this.dataList = loadLjhdList()
+ mounted() {
+ this.getIcpartyactivity()
this.$nextTick(function () {
this.initChart();
- this.initList()
});
},
methods: {
- initList () {
- this.dataListResult = []
- this.dataList.forEach(element => {
- this.dataListResult.push([
- element.gridName,
- element.title,
- element.unitName,
- element.member,
- element.data,
- ])
- });
-
- console.log(this.dataListResult)
+ async getIcpartyactivity() {
+ let params = {
+ agencyId: '1175270520603930625',
+ pageSize: 50,
+ pageNo: 1
+ }
+ const { data, msg, code } = await getIcpartyactivity(params)
+ if (code == 0) {
+ this.dataListResult = data.list.map(item => [item.gridName, item.title, item.unitName, item.peopleCount, item.activityTime])
+ if(this.dataListResult.length === 0){
+ this.noData = true
+ }
+ } else {
+ console.log(msg);
+ }
},
- initChart () {
+
+ initChart() {
//构建3d饼状图
let myChart = echarts.init(document.getElementById('charts'));
// 传入数据生成 option ; getPie3D(数据,透明的空心占比(调节中间空心范围的0就是普通饼1就很镂空))
@@ -132,7 +121,7 @@ export default {
},
//配置构建 pieData 饼图数据 internalDiameterRatio:透明的空心占比
- getPie3D (pieData, internalDiameterRatio) {
+ getPie3D(pieData, internalDiameterRatio) {
let that = this;
let series = [];
let sumValue = 0;
@@ -281,7 +270,7 @@ export default {
},
//获取3d丙图的最高扇区的高度
- getHeight3D (series, height) {
+ getHeight3D(series, height) {
series.sort((a, b) => {
return (b.pieData.value - a.pieData.value);
})
@@ -289,7 +278,7 @@ export default {
},
// 生成扇形的曲面参数方程,用于 series-surface.parametricEquation
- getParametricEquation (startRatio, endRatio, isSelected, isHovered, k, h) {
+ getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h) {
// 计算
let midRatio = (startRatio + endRatio) / 2;
let startRadian = startRatio * Math.PI * 2;
@@ -349,7 +338,7 @@ export default {
},
//这是一个自定义计算的方法
- fomatFloat (num, n) {
+ fomatFloat(num, n) {
var f = parseFloat(num);
if (isNaN(f)) {
return false;
@@ -369,7 +358,7 @@ export default {
},
// 监听鼠标事件,实现饼图选中效果(单选),近似实现高亮(放大)效果。
- bindListen (myChart) {
+ bindListen(myChart) {
let that = this;
let selectedIndex = '';
let hoveredIndex = '';
@@ -481,5 +470,4 @@ export default {
}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/views/screenRight/lineOption.js b/src/views/screenRight/lineOption.js
index ed90a57..b03e77f 100644
--- a/src/views/screenRight/lineOption.js
+++ b/src/views/screenRight/lineOption.js
@@ -2,7 +2,7 @@ import * as echarts from 'echarts'
export function lineOption() {
return {
- color: ['#FFB10A', '#71F3FB'],
+ color: ['#71F3FB', '#FFB10A','#9232f0'],
title: {
// text: 'Gradient Stacked Area Chart'
},
@@ -16,12 +16,14 @@ export function lineOption() {
}
},
legend: {
- // data: ['党员建群', '党成员'],
- // color: ['#FFB10A', '#71F3FB'],
+ data: ['非常满意', '基本满意','不满意'],
+ color: ['#71F3FB', '#FFB10A','#9232f0'],
data: [
- { color: '#FFB10A', name: '党成员' },
- { color: '#71F3FB', name: '党员建群' }
+ { color: '#71F3FB', name: '非常满意' },
+ { color: '#FFB10A', name: '基本满意' },
+ { color: '#9232f0', name: '不满意' },
],
+
icon: 'rect',
itemWidth: 12, // 长方形宽度
itemHeight: 4, // 长方形高度
@@ -40,13 +42,7 @@ export function lineOption() {
{
type: 'category',
boundaryGap: false,
- data: [
- '敦化路街道',
- '南宁路街道',
- '洛阳路街道',
- '华阳路街道',
- '黄台路街道'
- ],
+ data: [],
offset: 5,
axisLine: {
lineStyle: {
@@ -68,7 +64,7 @@ export function lineOption() {
],
series: [
{
- name: '党成员',
+ name: '非常满意',
type: 'line',
smooth: true,
@@ -92,16 +88,16 @@ export function lineOption() {
emphasis: {
focus: 'series'
},
- data: [120, 282, 111, 234, 220]
+ data: []
},
{
- name: '党员建群',
+ name: '基本满意',
type: 'line',
smooth: false,
lineStyle: {
width: 3,
- color: '#ffb10a'
+ color: '#FFB10A'
},
showSymbol: false,
// areaStyle: {
@@ -120,7 +116,37 @@ export function lineOption() {
emphasis: {
focus: 'series'
},
- data: [50, 20, 40, 10, 60]
+ data: []
+ },
+ {
+ name: '不满意',
+ type: 'line',
+
+ smooth: false,
+ lineStyle: {
+ width: 3,
+ color: '#9232f0'
+ },
+ showSymbol: false,
+ // areaStyle: {
+ // opacity: 0.8,
+ // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ // {
+ // offset: 0,
+ // color: '#ffb10a'
+ // },
+ // {
+ // offset: 1,
+ // color: '#bf9e58'
+ // }
+ // ])
+ // },
+ emphasis: {
+ focus: 'series'
+ },
+ data: [
+ // 50, 20, 40, 10, 60
+ ]
}
]
}
diff --git a/src/views/screenRight/pieOption.js b/src/views/screenRight/pieOption.js
index c18699b..653a327 100644
--- a/src/views/screenRight/pieOption.js
+++ b/src/views/screenRight/pieOption.js
@@ -8,7 +8,7 @@ export function pieOption() {
left: 'center',
textStyle: {
width: '100%',
- fontSize: 30,
+ fontSize: 20,
fontStyle: 'italic',
color: '#00E0FB'
},
diff --git a/src/views/screenRight/right1.vue b/src/views/screenRight/right1.vue
index c53fe0e..c1d00b0 100644
--- a/src/views/screenRight/right1.vue
+++ b/src/views/screenRight/right1.vue
@@ -21,8 +21,46 @@