tianq 3 years ago
parent
commit
bb73a699ef
  1. 215
      src/views/modules/census/census-houseList.vue
  2. 10
      src/views/modules/census/census-nineList.vue

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

@ -4,11 +4,10 @@
<div class="div_search">
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'80px'">
<div>
<el-form-item label="所属组织" prop="gridId">
<el-form-item label="所属组织" prop="orgId">
<el-cascader
class="customer_cascader"
ref="myCascader"
filterable
clearable
v-model="formData.orgId"
:options="orgOptions"
@ -181,7 +180,9 @@ export default {
user: {},
gridList: [], //list--
tableData: [],
formData: {},
formData: {
orgId: ''
},
pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20,
total: 1,
@ -202,6 +203,7 @@ export default {
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
emitPath: false,
checkStrictly: true
},
TableHeight: '',
@ -212,7 +214,9 @@ export default {
color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#F0D915', '#FEB349', '#FE6252', '#F44230', '#5DC7F0'],
chartData: [],
chartData2: [],
pieData: []
pieData: [],
pieData2: [],
orgId: ''
};
},
computed: {
@ -234,16 +238,18 @@ export default {
console.log(this.$store.state);
this.user = this.$store.state.user;
this.agencyId = this.user.agencyId;
this.orgId=this.agencyId;
this.getOrgTreeList();
this.getTableData();
this.getPie();
this.getPie2();
// this.getTableData();
this.getsubData();
this.getsubData2();
},
methods: {
handleSearch(val) {
console.log(this.formData);
this.pageNo = 1;
this.getTableData();
this.getsubData();
this.getsubData2();
},
async getTableData() {
this.tableLoading = true;
@ -280,20 +286,33 @@ export default {
},
async getsubData() {
this.$refs.pieChart.showLoading();
let url = '/gov/org/staffLoginLog/sub-count';
let url = '/gov/org/ichouse/getHousePurposeCount';
let param = {
orgId: this.formData.orgId,
level: this.formData.level,
startDate: this.formData.startDate,
endDate: this.formData.endDate
orgIdPath: this.orgId,
timeStart: this.formData.startDate,
timeEnd: this.formData.endDate
};
const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart.hideLoading();
if (code === 0) {
this.pieData = data.list;
console.log('this.pieData ', this.pieData);
this.getPie();
} else {
this.$message.error(msg);
}
},
async getsubData2() {
this.$refs.pieChart2.showLoading();
let url = '/gov/org/ichouse/getHouseStatusCount';
let param = {
orgIdPath: this.orgId,
timeStart: this.formData.startDate,
timeEnd: this.formData.endDate
};
const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart2.hideLoading();
if (code === 0) {
this.pieData2 = data.list;
this.getPie2();
} else {
this.$message.error(msg);
@ -303,9 +322,7 @@ export default {
this.pieInitState = true;
},
pieInitOk2() {
console.log('2333erwewrwe33333', this.pieInitState2);
this.pieInitState2 = true;
console.log('2333erwewrwe333335476754765', this.pieInitState2);
},
getPie() {
if (this.pieInitState) {
@ -318,7 +335,6 @@ export default {
},
getPie2() {
if (this.pieInitState2) {
console.log('233333333');
this.setPieData2();
} else {
setTimeout(() => {
@ -327,45 +343,51 @@ export default {
}
},
setPieData() {
// let data = [...this.pieData];
// console.log('data', data);
let chartData = {
name: ['反骨', '反骨2', '反骨3', '反骨4'],
data: [{ value: 62, name: '反骨' }, { value: 44, name: '反骨2' }, { value: 123, name: '反骨3' }, { value: 232, name: '反骨4' }]
};
this.chartData = chartData;
// 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.iniPieChart(chartData);
let data = [...this.pieData.list];
this.chartData.name = data.map(item => item.type);
this.chartData.data = data.map(item => {
return {
value: item.count,
name: item.type,
radio: item.count == 0 ? '0' : ((item.count / this.pieData.total) * 100).toFixed(2)
};
});
console.log('chartData', this.chartData);
this.iniPieChart(this.chartData);
},
setPieData2() {
console.log('dddddddddddd');
// let data = [...this.pieData];
// console.log('data', data);
let chartData = {
name: ['自住', '出租', '闲置', '未售出'],
data: [{ value: 62, name: '自住' }, { value: 243, name: '出租' }, { value: 243, name: '闲置' }, { value: 243, name: '未售出' }]
};
this.chartData2 = chartData;
// 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);
let data = [...this.pieData2.list];
this.chartData2.name = data.map(item => item.type);
this.chartData2.data = data.map(item => {
return {
value: item.count,
name: item.type,
radio: item.count == 0 ? '0' : ((item.count / this.pieData2.total) * 100).toFixed(2)
};
});
console.log('chartData', this.chartData2);
this.iniPieChart(this.chartData2);
},
//
async iniPieChart(chartData) {
this.$refs.pieChart.clear();
// pieChart
this.pieOption = {
tooltip: {
trigger: 'item',
formatter: '{b}<br/>总数 : {c}<br/> 占比 : {d}%',
backgroundColor: 'rgb(134,134,134)',
borderColor: 'rgb(134,134,134)',
textStyle: {
color: '#fff'
}
},
color: this.color,
title: {
text: '12345',
subtext: '房屋总数(分)',
text: this.pieData.total,
subtext: '总数',
x: 'center',
y: 'center',
textStyle: {
@ -382,7 +404,21 @@ export default {
series: [
{
type: 'pie',
radius: ['60%', '85%'],
radius: ['65%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
tooltip: {
show: true
},
data: chartData.data
},
{
type: 'pie',
radius: ['60%', '65%'],
center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
@ -407,19 +443,32 @@ export default {
}
}
},
{
type: 'pie',
radius: ['65%', '80%'],
avoidLabelOverlap: false,
radius: ['80%', '85%'],
center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
data: [{ value: 1, name: '' }],
itemStyle: {
color: '#f7f7f7'
},
label: {
show: false,
position: 'center'
show: false
},
labelLine: {
show: false
},
tooltip: {
show: true
show: false
},
data: chartData.data
animation: false,
cursor: 'auto',
emphasis: {
itemStyle: {
color: '#f7f7f7'
}
}
}
]
};
@ -430,10 +479,19 @@ export default {
// pieChart
this.pieOption2 = {
tooltip: {
trigger: 'item',
formatter: '{b}<br/>总数 : {c}<br/> 占比 : {d}%',
backgroundColor: 'rgb(134,134,134)',
borderColor: 'rgb(134,134,134)',
textStyle: {
color: '#fff'
}
},
color: this.color,
title: {
text: '12345',
subtext: '房屋总数(分)',
text: this.pieData.total,
subtext: '总数',
x: 'center',
y: 'center',
textStyle: {
@ -459,12 +517,39 @@ export default {
tooltip: {
show: true
},
z: 9999,
data: chartData.data
},
{
type: 'pie',
radius: ['60%', '85%'],
radius: ['60%', '65%'],
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: ['80%', '85%'],
center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
@ -577,9 +662,13 @@ export default {
},
handleChangeAgency(val) {
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
console.log(obj);
this.formData.orgId = obj.agencyId;
this.formData.level = obj.level;
let tmp = this.formData.orgId;
if (!tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) {
this.orgId = this.formData.orgId;
} else {
this.orgId = this.agencyId;
}
},
deepTree(arr) {
if (Array.isArray(arr)) {
@ -690,7 +779,7 @@ export default {
justify-content: space-between;
align-items: flex-end;
margin-bottom:0px;
margin-bottom: 0px;
margin-top: 0px;
.census_searchcensus_box {
align-items: flex-end;

10
src/views/modules/census/census-nineList.vue

@ -456,7 +456,15 @@ export default {
async handleExport() {
const url = '/gov/org/enterprise/export';
const { pageSize, pageNo, formData } = this;
const { pageSize, pageNo } = this;
let tmp = this.formData.orgId;
if (!tmp && typeof tmp != 'undefined' && tmp != 0) {
this.formData.orgId = '';
this.orgType = '';
}
axios({
url: window.SITE_CONFIG['apiURL'] + url,
method: 'post',

Loading…
Cancel
Save