Browse Source

改组织接口

dev
tianq 3 years ago
parent
commit
e50849ab0e
  1. 2
      src/views/modules/census/census-accountActiveList.vue
  2. 2
      src/views/modules/census/census-accountList.vue
  3. 255
      src/views/modules/census/census-houseList.vue

2
src/views/modules/census/census-accountActiveList.vue

@ -215,7 +215,7 @@ export default {
getOrgTreeList() { getOrgTreeList() {
const { user } = this.$store.state; const { user } = this.$store.state;
this.$http this.$http
.post('gov/org/customeragency/agencylist', {}) .post('gov/org/customeragency/staffinagencylist', {})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);

2
src/views/modules/census/census-accountList.vue

@ -346,7 +346,7 @@ export default {
getOrgTreeList() { getOrgTreeList() {
const { user } = this.$store.state; const { user } = this.$store.state;
this.$http this.$http
.post('gov/org/customeragency/agencylist', {}) .post('gov/org/customeragency/staffinagencylist', {})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);

255
src/views/modules/census/census-houseList.vue

@ -47,25 +47,32 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<div class="div_table_title">房屋用途统计</div> <div class="div_table_title">房屋用途统计</div>
<div :style="'height:' + TableHeight + 'px;margin-top:20px'"> <el-row>
<el-col :span="12"><div :style="'height:' + TableHeight + 'px;margin-top:20px'">
<screen-echarts-frame <screen-echarts-frame
@handelClickMyPei="handelClickMyPei" @handelClickMyPei="handelClickMyPei"
:style="{ width: '100%', height: '100%' }" :style="{ width: '100%', height: '100%' }"
@myChartMethod="pieInitOk" @myChartMethod="pieInitOk"
ref="pieChart" ref="pieChart"
></screen-echarts-frame> ></screen-echarts-frame>
</div> </div></el-col>
<el-col :span="12"></el-col>
</el-row>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="div_table_title">房屋状态统计</div> <div class="div_table_title">房屋状态统计</div>
<div :style="'height:' + TableHeight + 'px;margin-top:20px'"> <el-row>
<el-col :span="12"><div :style="'height:' + TableHeight + 'px;margin-top:20px'">
<screen-echarts-frame2 <screen-echarts-frame2
@handelClickMyPei2="handelClickMyPei" @handelClickMyPei="handelClickMyPei2"
:style="{ width: '100%', height: '100%' }" :style="{ width: '100%', height: '100%' }"
@myChartMethod2="pieInitOk" @myChartMethod="pieInitOk2"
ref="pieChart2" ref="pieChart2"
></screen-echarts-frame2> ></screen-echarts-frame2>
</div> </div></el-col>
<el-col :span="12"></el-col>
</el-row>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-table <el-table
@ -159,7 +166,11 @@ export default {
children: 'subAgencyList', children: 'subAgencyList',
checkStrictly: true checkStrictly: true
}, },
TableHeight: '' TableHeight: '',
pieInitState:false,
pieInitState2:false,
pieOption:[],
pieOption2:[]
}; };
}, },
computed: { computed: {
@ -240,6 +251,7 @@ export default {
this.pieData = data.list; this.pieData = data.list;
console.log('this.pieData ', this.pieData); console.log('this.pieData ', this.pieData);
this.getPie(); this.getPie();
this.getPie2();
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
@ -247,6 +259,10 @@ export default {
pieInitOk() { pieInitOk() {
this.pieInitState = true; this.pieInitState = true;
}, },
pieInitOk2() {
console.log("2333erwewrwe33333")
this.pieInitState2 = true;
},
getPie() { getPie() {
if (this.pieInitState) { if (this.pieInitState) {
this.setPieData(); this.setPieData();
@ -256,6 +272,16 @@ export default {
}, 500); }, 500);
} }
}, },
getPie2() {
if (this.pieInitState2) {
console.log("233333333")
this.setPieData2();
} else {
setTimeout(() => {
this.getPie2();
}, 500);
}
},
setPieData() { setPieData() {
// let data = [...this.pieData]; // let data = [...this.pieData];
// console.log('data', data); // console.log('data', data);
@ -274,40 +300,137 @@ export default {
// }); // });
console.log('chartData', chartData); console.log('chartData', chartData);
this.iniPieChart(chartData); this.iniPieChart(chartData);
},
setPieData2() {
console.log("dddddddddddd")
// let data = [...this.pieData];
// console.log('data', data);
let chartData = {
name: ['1', '2', '3', '4'],
data: [
{ value: 23, id: '22', level: 'ddd', name: 'name' },
{ value: 23, id: '22', level: 'ddd', name: 'name' },
{ value: 23, id: '22', level: 'ddd', name: 'name' },
{ value: 23, id: '22', level: 'ddd', name: 'name' }
]
};
// chartData.name = data.map(item => item.agencyName);
// chartData.data = data.map(item => {
// return { value: item.count, id: item.agencyId, level: item.agencyLevel, name: item.agencyName };
// });
console.log('chartData', chartData);
this.iniPieChart2(chartData);
}, },
// //
async iniPieChart(chartData) { async iniPieChart(chartData) {
this.$refs.pieChart.clear(); this.$refs.pieChart.clear();
// pieChart // pieChart
this.pieOption = { this.pieOption = {
legend: { // legend: {
itemHeight: 14, // itemHeight: 14,
itemWidth: 14, // itemWidth: 14,
icon: 'rect', // icon: 'rect',
orient: 'vertical', // orient: 'vertical',
top: 'center', // top: 'center',
right: '5%', // right: '5%',
// textStyle: {
// align: 'left',
// color: '#',
// verticalAlign: 'middle',
// rich: {
// name: {
// width: 80,
// fontSize: 16
// },
// value: { width: 20, align: 'right', fontFamily: 'Medium', fontSize: 16 },
// rate: { width: 10, align: 'right', fontSize: 16 }
// }
// },
// // data: datas,
// formatter: name => {
// // if (datas.length) {
// // const item = datas.filter(item => item.name === name)[0];
// // return `{name|${name}}{value| ${item.value}} {rate| }`;
// // }
// }
// },
color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#FEB349', '#FE6252'],
title: {
text: '12345',
subtext: '房屋总数(分)',
x: 'center',
y: 'center',
textStyle: { textStyle: {
align: 'left', fontSize: 26,
color: '#', color: '#333333',
verticalAlign: 'middle', fontWeight: 'bold'
rich: {
name: {
width: 80,
fontSize: 16
},
value: { width: 20, align: 'right', fontFamily: 'Medium', fontSize: 16 },
rate: { width: 10, align: 'right', fontSize: 16 }
}
}, },
// data: datas, subtextStyle: {
formatter: name => { fontSize: 14,
// if (datas.length) { color: '#333333'
// const item = datas.filter(item => item.name === name)[0];
// return `{name|${name}}{value| ${item.value}} {rate| }`;
// }
} }
}, },
series: [
{
type: 'pie',
radius: ['60%', '85%'],
center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
data: [{ value: 1, name: '' }],
itemStyle: {
color: '#f7f7f7'
},
label: {
show: false
},
labelLine: {
show: false
},
tooltip: {
show: false
},
animation: false,
cursor: 'auto',
emphasis: {
itemStyle: {
color: '#f7f7f7'
}
}
},
{
type: 'pie',
radius: ['65%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
tooltip: {
show: true
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
this.$refs.pieChart.setOption(this.pieOption);
},
async iniPieChart2(chartData) {
console.log("dddddddddddd")
this.$refs.pieChart2.clear();
// pieChart
this.pieOption2 = {
color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#FEB349', '#FE6252'], color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#FEB349', '#FE6252'],
title: { title: {
text: '12345', text: '12345',
@ -325,54 +448,46 @@ export default {
} }
}, },
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [ series: [
{ {
radius: ['60%', '90%'],
center: ['50%', '50%'],
type: 'pie', type: 'pie',
radius: ['60%', '85%'],
center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
data: [{ value: 1, name: '' }],
itemStyle: {
color: '#f7f7f7'
},
label: { label: {
normal: { show: false
show: false
},
emphasis: {
show: false
}
}, },
labelLine: { labelLine: {
normal: { show: false
show: false
},
emphasis: {
show: false
}
}, },
animation: false,
tooltip: { tooltip: {
show: false show: false
}, },
itemStyle: { animation: false,
normal: { cursor: 'auto',
color: '#F7F7F7' emphasis: {
itemStyle: {
color: '#f7f7f7'
} }
}, }
data: [1]
}, },
{ {
type: 'pie', type: 'pie',
radius: ['70%', '80%'], radius: ['65%', '80%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,
position: 'center' position: 'center'
}, },
tooltip: {
show: true
},
data: [ data: [
{ value: 1048, name: 'Search Engine' }, { value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' }, { value: 735, name: 'Direct' },
@ -383,7 +498,7 @@ export default {
} }
] ]
}; };
this.$refs.pieChart.setOption(this.pieOption); this.$refs.pieChart2.setOption(this.pieOption2);
}, },
handelClickMyPei(param) { handelClickMyPei(param) {
if (param.data.level != 'community') { if (param.data.level != 'community') {
@ -401,6 +516,22 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
} }
}, },
handelClickMyPei2(param) {
if (param.data.level != 'community') {
if (param.data.level == 'district') {
this.orgType = 'street';
}
if (param.data.level == 'street') {
this.orgType = 'community';
}
this.orgId = param.data.id;
this.orgName = param.data.name;
this.pageNo = 1;
this.showNext();
this.dialogVisible = true;
}
},
async handleExport() { async handleExport() {
const url = '/gov/project/icEvent/export'; const url = '/gov/project/icEvent/export';
const { pageSize, pageNo, formData } = this; const { pageSize, pageNo, formData } = this;
@ -436,7 +567,7 @@ export default {
getOrgTreeList() { getOrgTreeList() {
const { user } = this.$store.state; const { user } = this.$store.state;
this.$http this.$http
.post('gov/org/customeragency/agencylist', {}) .post('gov/org/customeragency/staffinagencylist', {})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);

Loading…
Cancel
Save