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

Loading…
Cancel
Save