Browse Source

冲突合并

shibei_master
jiangyy 4 years ago
parent
commit
2f90a72835
  1. 349
      src/views/modules/visual/communityGovern/resibuzz.vue

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

@ -230,209 +230,208 @@ export default {
}
},
methods: {
pieInitOk (dom) {
console.log('pie准备好了', dom)
this.pieChartS = dom
this.pieInitState = true
},
getPie () {
if (this.pieInitState) {
this.getPieChart()
pieInitOk (dom) {
console.log('pie准备好了', dom)
this.pieChartS = dom
this.pieInitState = true
},
getPie () {
if (this.pieInitState) {
this.getPieChart()
} else {
setTimeout(() => {
this.getPie()
}, 500)
}
},
//
async getPieChart () {
this.$refs.pieChart.clear()
this.pieTotal = 0
const _that = this
// this.$refs.pieChart.showLoading()
// const url ="/gov/issue/issue/resibuzz-leftpiechart";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart";
let params = {
orgId: this.orgId,
};
const { data, code, msg } = await requestPost(url, params);
// pieChart
this.pieOption = pieOption(this.pieChartS)
if (code === 0) {
// pieChart
this.pieOption = pieOption()
if (data && data.length > 0) {
// this.pieData = data
} else {
setTimeout(() => {
this.getPie()
}, 500)
this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }]
}
},
//
async getPieChart () {
this.$refs.pieChart.clear()
this.pieTotal = 0
const _that = this
// this.$refs.pieChart.showLoading()
// const url ="/gov/issue/issue/resibuzz-leftpiechart";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart";
let params = {
orgId: this.orgId,
};
const { data, code, msg } = await requestPost(url, params);
// pieChart
this.pieOption = pieOption(this.pieChartS)
this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].data = this.pieData
if (code === 0) {
// pieChart
this.pieOption = pieOption()
if (data && data.length > 0) {
// this.pieData = data
this.pieData.forEach(item => {
item.name = item.categoryName
item.value = item.count
this.colorArray.push(item.color)
this.pieTotal = this.pieTotal + item.value
} else {
this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }]
});
this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].itemStyle = {
color: function (params) {
return _that.colorArray[params.dataIndex]
}
}
this.clickPie(0)
this.pieData.forEach(item => {
item.name = item.categoryName
item.value = item.count
this.colorArray.push(item.color)
this.pieTotal = this.pieTotal + item.value
let fun = function (params) {
_that.clickPie(params.dataIndex)
}
this.$refs.pieChart.handleClick(fun)
} else {
this.$message.error(msg);
}
});
},
this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].itemStyle = {
color: function (params) {
return _that.colorArray[params.dataIndex]
clickPie (seriesIndex) {
this.pieData.forEach((element, index) => {
if (index === seriesIndex) {
element.label = {
show: true,
};
element.labelLine = {
show: true,
lineStyle: {
opacity: 1,
}
}
this.clickPie(0)
let fun = function (params) {
_that.clickPie(params.dataIndex)
}
this.$refs.pieChart.handleClick(fun)
};
console.log('zhilma')
// element.labelLayout = (params) => {
// const isLeft = params.labelRect.x < this.pieChartS.getWidth() / 2;
// const points = params.labelLinePoints;
// console.log('isLeft', isLeft, points)
// // Update the end point.
// points[2][0] = isLeft
// ? params.labelRect.x
// : params.labelRect.x + params.labelRect.width;
// return {
// labelLinePoints: points
// };
// }
} else {
this.$message.error(msg);
}
element.label = {
show: false,
};
element.labelLine = {
show: false,
lineStyle: {
opacity: 0,
color: 'rgba(255,255,255,0)'
}
};
},
}
});
this.pieOption.series[1].data = this.pieData
// this.$refs.pieChart.hideLoading()
this.$refs.pieChart.setOption(this.pieOption)
clickPie (seriesIndex) {
this.pieData.forEach((element, index) => {
if (index === seriesIndex) {
element.label = {
show: true,
};
element.labelLine = {
show: true,
lineStyle: {
opacity: 1,
}
};
console.log('zhilma')
// element.labelLayout = (params) => {
// const isLeft = params.labelRect.x < this.pieChartS.getWidth() / 2;
// const points = params.labelLinePoints;
// console.log('isLeft', isLeft, points)
// // Update the end point.
// points[2][0] = isLeft
// ? params.labelRect.x
// : params.labelRect.x + params.labelRect.width;
// return {
// labelLinePoints: points
// };
// }
} else {
element.label = {
show: false,
};
element.labelLine = {
show: false,
lineStyle: {
opacity: 0,
color: 'rgba(255,255,255,0)'
}
};
},
}
});
this.pieOption.series[1].data = this.pieData
// this.$refs.pieChart.hideLoading()
this.$refs.pieChart.setOption(this.pieOption)
handleChangeState (index) {
this.getTable()
},
},
handleChangeAgency (value) {
console.log(value)
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
console.log(this.agencyIdArray)
},
handleChangeState (index) {
this.getTable()
},
//
async getTable () {
// const url = "/gov/issue/issue/resibuzz";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz";
let params = {
status: this.status,
orgId: this.orgId,
pageNo: this.demand.pageNo,
pageSize: this.demand.pageSize,
};
handleChangeAgency (value) {
console.log(value)
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
console.log(this.agencyIdArray)
},
const { data, code, msg } = await requestPost(url, params);
this.demand.loading = false;
//
async getTable () {
// const url = "/gov/issue/issue/resibuzz";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz";
let params = {
status: this.status,
orgId: this.orgId,
pageNo: this.demand.pageNo,
pageSize: this.demand.pageSize,
};
const { data, code, msg } = await requestPost(url, params);
this.demand.loading = false;
if (code === 0) {
this.demand.total = data.total;
this.demand.list = data.list.map((item) => {
return [
{ type: "index" },
item.issueTitle,
item.suggestion,
item.categoryName,
item.status,
item.createdTime,
item.issueOriginator,
item.voteAccount,
item.supportCount,
item.oppositionCount,
{ type: "operate", list: ["查看"] },
];
});
} else {
this.$message.error(msg);
}
},
if (code === 0) {
this.demand.total = data.total;
this.demand.list = data.list.map((item) => {
return [
{ type: "index" },
item.issueTitle,
item.suggestion,
item.categoryName,
item.status,
item.createdTime,
item.issueOriginator,
item.voteAccount,
item.supportCount,
item.oppositionCount,
{ type: "operate", list: ["查看"] },
];
});
} else {
this.$message.error(msg);
}
},
handlePageNoChange_demand (val) {
this.demand.pageNo = val;
this.getTable();
},
toUserInfo (uid) {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
},
handlePageNoChange_demand (val) {
this.demand.pageNo = val;
this.getTable();
},
props: {
uid: {
type: String,
default: "",
// default: "8ada68cb6f1e4b9a8333348a39ef3aee",
},
toUserInfo (uid) {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
},
},
props: {
uid: {
type: String,
default: "",
// default: "8ada68cb6f1e4b9a8333348a39ef3aee",
},
},
computed: {},
computed: {},
components: {
cptCard,
cptTb,
screenEchartsFrame,
},
components: {
cptCard,
cptTb,
screenEchartsFrame,
},
watch: {
uid (id) {
this.userId = id;
},
userId () {
this.getApiData();
window.scrollTo(0, 0);
},
watch: {
uid (id) {
this.userId = id;
},
userId () {
this.getApiData();
window.scrollTo(0, 0);
},
};
},
};
</script>
<style

Loading…
Cancel
Save