|
|
|
|
<template>
|
|
|
|
|
<div class="div_main">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="div_search">
|
|
|
|
|
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'80px'">
|
|
|
|
|
<div>
|
|
|
|
|
<el-form-item label="所属组织" prop="orgId">
|
|
|
|
|
<el-cascader
|
|
|
|
|
class="customer_cascader"
|
|
|
|
|
ref="myCascader"
|
|
|
|
|
clearable
|
|
|
|
|
v-model="formData.orgId"
|
|
|
|
|
:options="orgOptions"
|
|
|
|
|
:props="orgOptionProps"
|
|
|
|
|
:show-all-levels="false"
|
|
|
|
|
@change="handleChangeAgency"
|
|
|
|
|
></el-cascader>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-button class="btnSearch" size="small" @click="handleSearch">查询</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="div_table">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div class="div_table_title">居民年龄统计</div>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div :style="'height:220px;margin-top:20px'">
|
|
|
|
|
<screen-echarts-frame
|
|
|
|
|
@handelClickMyPei="handelClickMyPei"
|
|
|
|
|
:style="{ width: '100%', height: '100%' }"
|
|
|
|
|
@myChartMethod="pieInitOk"
|
|
|
|
|
ref="pieChart"
|
|
|
|
|
></screen-echarts-frame>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div :style="'height:220px;margin-top:20px;display:flex;align-items: center;'">
|
|
|
|
|
<div class="legend">
|
|
|
|
|
<div class="legend-row" :key="item.name" v-for="(item, index) in chartData.data" @click="handleClickItem(item)">
|
|
|
|
|
<div class="kuai" :style="{ backgroundColor: color[index] }"></div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="name">{{ item.name }}</div>
|
|
|
|
|
<div class="num">{{ item.value }}</div>
|
|
|
|
|
<div class="unit" :style="{ color: color[index] }">{{ item.value / 100 }}%</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div class="div_table_title">居民学历统计</div>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div :style="'height:220px;margin-top:20px'">
|
|
|
|
|
<screen-echarts-frame2
|
|
|
|
|
@handelClickMyPei="handelClickMyPei2"
|
|
|
|
|
:style="{ width: '100%', height: '100%' }"
|
|
|
|
|
@myChartMethod="pieInitOk2"
|
|
|
|
|
ref="pieChart2"
|
|
|
|
|
></screen-echarts-frame2>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div :style="'height:220px;margin-top:20px;display:flex;align-items: center;'">
|
|
|
|
|
<div class="legend">
|
|
|
|
|
<div class="legend-row" :key="item.name" v-for="(item, index) in chartData2.data" @click="handleClickItem2(item)">
|
|
|
|
|
<div class="kuai" :style="{ backgroundColor: color[index] }"></div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="name">{{ item.name }}</div>
|
|
|
|
|
<div class="num">{{ item.value }}</div>
|
|
|
|
|
<div class="unit" :style="{ color: color[index] }">{{ item.value / 100 }}%</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<div class="census_searchcensus2">
|
|
|
|
|
<div class="census_searchcensus_box"></div>
|
|
|
|
|
<el-button size="small" class="diy-button--output" @click="handleExport(1)">导出</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
v-loading="tableLoading"
|
|
|
|
|
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
|
|
|
|
|
class="table"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
:height="maxTableHeight"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" />
|
|
|
|
|
<el-table-column prop="name" label="姓名" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="mobile" label="手机号" align="center" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
<el-table-column prop="idCard" align="center" label="证件号" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
<el-table-column prop="genderName" align="center" label="性别" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
<el-table-column prop="age" align="center" label="年龄" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
<el-table-column prop="educationName" align="center" label="学历" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
<el-table-column prop="count" align="center" width="110" label="操作" :show-overflow-tooltip="true">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="small" type="text" @click="show(scope.row)">查看</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
:current-page.sync="pageNo"
|
|
|
|
|
:page-sizes="[10, 20, 50, 100, 200]"
|
|
|
|
|
:page-size="parseInt(pageSize)"
|
|
|
|
|
layout="sizes, prev, pager, next, total"
|
|
|
|
|
:total="total"
|
|
|
|
|
></el-pagination>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- :pageType="pageType" -->
|
|
|
|
|
<!-- :disabled="disabled" -->
|
|
|
|
|
<addForm v-if="dialogVisible" :dialogVisible="dialogVisible" :userId="detailId" :pageType="pageType" :gridName="detailData" @handleClose="handleClose" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import screenEchartsFrame from './chart';
|
|
|
|
|
import screenEchartsFrame2 from './chart';
|
|
|
|
|
import { requestPost } from '@/js/dai/request';
|
|
|
|
|
import nextTick from 'dai-js/tools/nextTick';
|
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
import addForm from './addFormResident.vue';
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: { screenEchartsFrame, screenEchartsFrame2, addForm },
|
|
|
|
|
data() {
|
|
|
|
|
let endDisabledDate = time => {
|
|
|
|
|
//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键
|
|
|
|
|
let nowData = Date.now();
|
|
|
|
|
if (this.formData.startTime) {
|
|
|
|
|
let startTime = new Date(this.formData.startTime);
|
|
|
|
|
return time.getTime() > nowData || time.getTime() < startTime || time.getTime() === startTime;
|
|
|
|
|
} else {
|
|
|
|
|
return time.getTime() > nowData;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
let startDisabledDate = time => {
|
|
|
|
|
//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键
|
|
|
|
|
let nowData = Date.now();
|
|
|
|
|
return time.getTime() > nowData;
|
|
|
|
|
};
|
|
|
|
|
return {
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
detailId: '',
|
|
|
|
|
detailData: {},
|
|
|
|
|
pageType: '',
|
|
|
|
|
disabled: false,
|
|
|
|
|
tableLoading: false,
|
|
|
|
|
user: {},
|
|
|
|
|
gridList: [], //所属网格list--场所区域
|
|
|
|
|
tableData: [],
|
|
|
|
|
formData: {
|
|
|
|
|
orgId: ''
|
|
|
|
|
},
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: window.localStorage.getItem('pageSize') || 20,
|
|
|
|
|
total: 1,
|
|
|
|
|
endPickerOptions: {
|
|
|
|
|
//时间
|
|
|
|
|
disabledDate: endDisabledDate
|
|
|
|
|
},
|
|
|
|
|
startPickerOptions: {
|
|
|
|
|
//时间
|
|
|
|
|
disabledDate: startDisabledDate
|
|
|
|
|
},
|
|
|
|
|
agencyId: '', //组织
|
|
|
|
|
agencyIdArray: [], //组织
|
|
|
|
|
orgOptions: [], //组织
|
|
|
|
|
orgOptionProps: {
|
|
|
|
|
//组织
|
|
|
|
|
multiple: false,
|
|
|
|
|
value: 'agencyId',
|
|
|
|
|
label: 'agencyName',
|
|
|
|
|
children: 'subAgencyList',
|
|
|
|
|
emitPath: false,
|
|
|
|
|
checkStrictly: true
|
|
|
|
|
},
|
|
|
|
|
TableHeight: '',
|
|
|
|
|
pieInitState: false,
|
|
|
|
|
pieInitState2: false,
|
|
|
|
|
pieOption: [],
|
|
|
|
|
pieOption2: [],
|
|
|
|
|
color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#F0D915', '#FEB349', '#FE6252', '#F44230', '#5DC7F0'],
|
|
|
|
|
chartData: [],
|
|
|
|
|
chartData2: [],
|
|
|
|
|
pieData: [],
|
|
|
|
|
pieData2: [],
|
|
|
|
|
orgId: '',
|
|
|
|
|
orgType: '',
|
|
|
|
|
code: '',
|
|
|
|
|
pieDatatotal: 0,
|
|
|
|
|
pieDatatotal2: 0,
|
|
|
|
|
codeType: 'education'
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
maxTableHeight() {
|
|
|
|
|
this.TableHeight = this.$store.state.inIframe ? this.clientHeight - 635 + this.iframeHeigh : this.clientHeight - 635;
|
|
|
|
|
return this.TableHeight;
|
|
|
|
|
},
|
|
|
|
|
...mapGetters(['clientHeight', 'iframeHeight'])
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
'formData.endTime': function(val) {
|
|
|
|
|
if (val && val != '') {
|
|
|
|
|
let arrayTemp = val.split(' ');
|
|
|
|
|
this.formData.endTime = arrayTemp[0] + ' 23:59:59';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
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.getsubData();
|
|
|
|
|
this.getsubData2();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
show(row) {
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
this.pageType = 'view';
|
|
|
|
|
this.detailId = row.icResiUserId;
|
|
|
|
|
this.detailData = row.gridName;
|
|
|
|
|
},
|
|
|
|
|
handleClose() {
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
this.pageType = 'list';
|
|
|
|
|
this.detailId = '';
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
async getTableData() {
|
|
|
|
|
this.tableLoading = true;
|
|
|
|
|
// const url = '/gov/org/staffLoginLog/community-count';
|
|
|
|
|
const url = '/epmetuser/icresiuser/portrayal-list';
|
|
|
|
|
|
|
|
|
|
const { pageSize, pageNo, formData } = this;
|
|
|
|
|
const { data, code, msg } = await requestPost(url, {
|
|
|
|
|
pageSize,
|
|
|
|
|
pageNo,
|
|
|
|
|
orgId: this.orgId,
|
|
|
|
|
orgType: this.orgType,
|
|
|
|
|
code: this.code,
|
|
|
|
|
codeType: this.codeType
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.tableLoading = false;
|
|
|
|
|
if (code === 0) {
|
|
|
|
|
this.total = data.total || 0;
|
|
|
|
|
this.tableData = data.list
|
|
|
|
|
? data.list.map(item => {
|
|
|
|
|
return item;
|
|
|
|
|
})
|
|
|
|
|
: [];
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSizeChange(val) {
|
|
|
|
|
this.pageSize = val;
|
|
|
|
|
window.localStorage.setItem('pageSize', val);
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.pageNo = val;
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
async getsubData() {
|
|
|
|
|
this.$refs.pieChart.showLoading();
|
|
|
|
|
let url = '/epmetuser/icresiuser/age-distribute';
|
|
|
|
|
let param = {
|
|
|
|
|
orgId: this.orgId,
|
|
|
|
|
orgType: this.orgType
|
|
|
|
|
};
|
|
|
|
|
const { data, code, msg } = await requestPost(url, param);
|
|
|
|
|
this.$refs.pieChart.hideLoading();
|
|
|
|
|
if (code === 0) {
|
|
|
|
|
this.pieData = data;
|
|
|
|
|
this.getPie();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getsubData2() {
|
|
|
|
|
this.$refs.pieChart2.showLoading();
|
|
|
|
|
let url = '/epmetuser/icresiuser/education-distribute';
|
|
|
|
|
let param = {
|
|
|
|
|
orgId: this.orgId,
|
|
|
|
|
orgType: this.orgType
|
|
|
|
|
};
|
|
|
|
|
const { data, code, msg } = await requestPost(url, param);
|
|
|
|
|
this.$refs.pieChart2.hideLoading();
|
|
|
|
|
if (code === 0) {
|
|
|
|
|
this.pieData2 = data;
|
|
|
|
|
|
|
|
|
|
console.log('this.pieData2', this.pieData2);
|
|
|
|
|
this.getPie2();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
pieInitOk() {
|
|
|
|
|
this.pieInitState = true;
|
|
|
|
|
},
|
|
|
|
|
pieInitOk2() {
|
|
|
|
|
this.pieInitState2 = true;
|
|
|
|
|
},
|
|
|
|
|
getPie() {
|
|
|
|
|
if (this.pieInitState) {
|
|
|
|
|
this.setPieData();
|
|
|
|
|
} else {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.getPie();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getPie2() {
|
|
|
|
|
if (this.pieInitState2) {
|
|
|
|
|
this.setPieData2();
|
|
|
|
|
} else {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.getPie2();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setPieData() {
|
|
|
|
|
let data = [...this.pieData];
|
|
|
|
|
this.pieDatatotal = data
|
|
|
|
|
.map(item => item.totalResi)
|
|
|
|
|
.reduce(function(prev, cur, index, arr) {
|
|
|
|
|
console.log(prev, cur, index);
|
|
|
|
|
return prev + cur;
|
|
|
|
|
});
|
|
|
|
|
this.chartData.name = data.map(item => item.codeName);
|
|
|
|
|
this.chartData.data = data.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
value: item.totalResi,
|
|
|
|
|
name: item.codeName,
|
|
|
|
|
code: item.code,
|
|
|
|
|
radio: item.totalResi == 0 ? '0' : ((item.totalResi / this.pieDatatotal) * 100).toFixed(2)
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
console.log('chartData', this.chartData);
|
|
|
|
|
this.iniPieChart(this.chartData);
|
|
|
|
|
},
|
|
|
|
|
setPieData2() {
|
|
|
|
|
let data = [...this.pieData2];
|
|
|
|
|
|
|
|
|
|
this.pieDatatotal2 = data
|
|
|
|
|
.map(item => item.totalResi)
|
|
|
|
|
.reduce(function(prev, cur, index, arr) {
|
|
|
|
|
console.log(prev, cur, index);
|
|
|
|
|
return prev + cur;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.chartData2.name = data.map(item => item.codeName);
|
|
|
|
|
this.chartData2.data = data.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
value: item.totalResi,
|
|
|
|
|
name: item.codeName,
|
|
|
|
|
code: item.code,
|
|
|
|
|
radio: item.totalResi == 0 ? '0' : ((item.totalResi / this.pieDatatotal2) * 100).toFixed(2)
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log('chartData', this.chartData2);
|
|
|
|
|
this.iniPieChart2(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: this.pieDatatotal,
|
|
|
|
|
subtext: '总数',
|
|
|
|
|
x: 'center',
|
|
|
|
|
y: 'center',
|
|
|
|
|
textStyle: {
|
|
|
|
|
fontSize: 26,
|
|
|
|
|
color: '#333333',
|
|
|
|
|
fontWeight: 'bold'
|
|
|
|
|
},
|
|
|
|
|
subtextStyle: {
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: '#333333'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'pie',
|
|
|
|
|
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,
|
|
|
|
|
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,
|
|
|
|
|
data: [{ value: 1, name: '' }],
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#f7f7f7'
|
|
|
|
|
},
|
|
|
|
|
label: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
labelLine: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
animation: false,
|
|
|
|
|
cursor: 'auto',
|
|
|
|
|
emphasis: {
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#f7f7f7'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
this.$refs.pieChart.setOption(this.pieOption);
|
|
|
|
|
},
|
|
|
|
|
async iniPieChart2(chartData) {
|
|
|
|
|
this.$refs.pieChart2.clear();
|
|
|
|
|
// 获取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: this.pieDatatotal2,
|
|
|
|
|
subtext: '总数',
|
|
|
|
|
x: 'center',
|
|
|
|
|
y: 'center',
|
|
|
|
|
textStyle: {
|
|
|
|
|
fontSize: 26,
|
|
|
|
|
color: '#333333',
|
|
|
|
|
fontWeight: 'bold'
|
|
|
|
|
},
|
|
|
|
|
subtextStyle: {
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: '#333333'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'pie',
|
|
|
|
|
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,
|
|
|
|
|
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,
|
|
|
|
|
data: [{ value: 1, name: '' }],
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#f7f7f7'
|
|
|
|
|
},
|
|
|
|
|
label: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
labelLine: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
animation: false,
|
|
|
|
|
cursor: 'auto',
|
|
|
|
|
emphasis: {
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#f7f7f7'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
this.$refs.pieChart2.setOption(this.pieOption2);
|
|
|
|
|
},
|
|
|
|
|
handelClickMyPei(param) {
|
|
|
|
|
this.code = param.data.code;
|
|
|
|
|
this.codeType = 'education';
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handelClickMyPei2(param) {
|
|
|
|
|
this.code = param.data.code;
|
|
|
|
|
this.codeType = 'age';
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
handleClickItem(item) {
|
|
|
|
|
this.code = item.code;
|
|
|
|
|
this.codeType = 'education';
|
|
|
|
|
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
handleClickItem2(item) {
|
|
|
|
|
this.code = item.code;
|
|
|
|
|
this.codeType = 'age';
|
|
|
|
|
this.getTableData();
|
|
|
|
|
},
|
|
|
|
|
async handleExport() {
|
|
|
|
|
const url = '/epmetuser/icresiuser/portrayal-listexport';
|
|
|
|
|
const { pageSize, pageNo, formData } = this;
|
|
|
|
|
let tmp = this.formData.orgId;
|
|
|
|
|
if (!(tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null)) {
|
|
|
|
|
this.formData.orgId = '';
|
|
|
|
|
this.orgType = '';
|
|
|
|
|
this.code = '';
|
|
|
|
|
this.codeType = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios({
|
|
|
|
|
url: window.SITE_CONFIG['apiURL'] + url,
|
|
|
|
|
method: 'post',
|
|
|
|
|
data: {
|
|
|
|
|
pageSize,
|
|
|
|
|
pageNo,
|
|
|
|
|
orgId: this.orgId,
|
|
|
|
|
orgType: this.orgType,
|
|
|
|
|
code: this.code,
|
|
|
|
|
codeType: this.codeType
|
|
|
|
|
},
|
|
|
|
|
responseType: 'blob'
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
let fileName = window.decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]);
|
|
|
|
|
console.log('filename', fileName);
|
|
|
|
|
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
|
|
|
|
|
var url = window.URL.createObjectURL(blob);
|
|
|
|
|
var aLink = document.createElement('a');
|
|
|
|
|
aLink.style.display = 'none';
|
|
|
|
|
aLink.href = url;
|
|
|
|
|
aLink.setAttribute('download', fileName);
|
|
|
|
|
document.body.appendChild(aLink);
|
|
|
|
|
aLink.click();
|
|
|
|
|
document.body.removeChild(aLink); //下载完成移除元素
|
|
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
console.log('获取导出情失败', err);
|
|
|
|
|
return this.$message.error('网络错误');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getOrgTreeList() {
|
|
|
|
|
const { user } = this.$store.state;
|
|
|
|
|
this.$http
|
|
|
|
|
.post('/gov/org/customeragency/agencygridtree', {})
|
|
|
|
|
.then(({ data: res }) => {
|
|
|
|
|
if (res.code !== 0) {
|
|
|
|
|
return this.$message.error(res.msg);
|
|
|
|
|
} else {
|
|
|
|
|
console.log('获取组织树成功', res.data);
|
|
|
|
|
// let { agencyList, subAgencyList } = res.data;
|
|
|
|
|
// const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }];
|
|
|
|
|
// this.orgOptions = this.deepTree(_arr);
|
|
|
|
|
this.orgOptions = [];
|
|
|
|
|
this.orgOptions.push(res.data);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
return this.$message.error('网络错误');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleSearch(val) {
|
|
|
|
|
this.pageNo = 1;
|
|
|
|
|
this.code = '';
|
|
|
|
|
this.codeType = '';
|
|
|
|
|
this.getTableData();
|
|
|
|
|
this.getsubData();
|
|
|
|
|
this.getsubData2();
|
|
|
|
|
},
|
|
|
|
|
handleChangeAgency(val) {
|
|
|
|
|
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
|
|
|
|
|
if (obj) {
|
|
|
|
|
this.orgType = obj.level === 'grid' ? 'grid' : 'agency';
|
|
|
|
|
} else {
|
|
|
|
|
this.orgType = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let tmp = this.formData.orgId;
|
|
|
|
|
|
|
|
|
|
if (tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) {
|
|
|
|
|
this.orgId = this.formData.orgId;
|
|
|
|
|
} else {
|
|
|
|
|
this.orgId = '';
|
|
|
|
|
}
|
|
|
|
|
console.log('this.orgId', this.orgId);
|
|
|
|
|
},
|
|
|
|
|
deepTree(arr) {
|
|
|
|
|
if (Array.isArray(arr)) {
|
|
|
|
|
return arr.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
subAgencyList: (item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList)) || null
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import '@/assets/scss/buttonstyle.scss';
|
|
|
|
|
@import '@/assets/scss/modules/management/list-main.scss';
|
|
|
|
|
@import '@/assets/scss/modules/shequzhili/event-info.scss';
|
|
|
|
|
.legend {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-flow: row wrap;
|
|
|
|
|
.legend-row {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
min-width: 100px;
|
|
|
|
|
display: flex;
|
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
margin-right: 25px;
|
|
|
|
|
.kuai {
|
|
|
|
|
width: 12px;
|
|
|
|
|
height: 12px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
.content {
|
|
|
|
|
.name {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #999;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
.num {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
.unit {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-left: 7px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.legend2 {
|
|
|
|
|
// display: flex;
|
|
|
|
|
// flex-flow: row wrap;
|
|
|
|
|
|
|
|
|
|
.legend-row {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
.kuai {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
img {
|
|
|
|
|
width: 40px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.content {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.name {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #999;
|
|
|
|
|
width: 60px;
|
|
|
|
|
}
|
|
|
|
|
.num {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
.unit {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-left: 7px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.btnSearch {
|
|
|
|
|
width: 100px;
|
|
|
|
|
height: 36px;
|
|
|
|
|
background: #2195fe;
|
|
|
|
|
box-shadow: 0px 2px 6px 0px rgba(28, 107, 253, 0.31);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.div_search {
|
|
|
|
|
.item_width_2 {
|
|
|
|
|
width: 200px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// /这里是不一样的,居左,从下对齐
|
|
|
|
|
.census_searchcensus2 {
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
margin-bottom: 0px;
|
|
|
|
|
margin-top: 0px;
|
|
|
|
|
.census_searchcensus_box {
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
display: flex;
|
|
|
|
|
img {
|
|
|
|
|
width: 64px;
|
|
|
|
|
height: 64px;
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
}
|
|
|
|
|
h2 {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
|
|
|
|
text-align: left;
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
margin: 0px;
|
|
|
|
|
}
|
|
|
|
|
h3 {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
|
|
|
|
text-align: left;
|
|
|
|
|
|
|
|
|
|
margin: 0px;
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.div_table_title {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
.diy-button--output {
|
|
|
|
|
width: 100px;
|
|
|
|
|
height: 38px;
|
|
|
|
|
|
|
|
|
|
background: #feb349;
|
|
|
|
|
box-shadow: 0px 2px 6px 0px rgba(198, 122, 16, 0.31);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
</style>
|