Browse Source

党员画像

jly/task002
tianq 2 years ago
parent
commit
48e5df2e9e
  1. 302
      src/views/modules/communityParty/dyhx/chart.vue
  2. 271
      src/views/modules/communityParty/dyhx/party.vue

302
src/views/modules/communityParty/dyhx/chart.vue

@ -1,163 +1,163 @@
<template> <template>
<div class="screenEchartsFrame" <div class="screenEchartsFrame" ref="screenEchartsFrame"></div>
ref="screenEchartsFrame"></div>
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts';
export default { export default {
name: 'screen-echarts-frame', name: 'screen-echarts-frame',
data () { data() {
return { return {
myChart: '' myChart: ''
} };
}, },
props: { props: {
chartMethod: { chartMethod: {
type: Function type: Function
} }
}, },
mounted () { mounted() {
this.initChart() this.initChart();
window.onresize = () => { window.onresize = () => {
this.myChart.resize() this.myChart.resize();
} };
}, },
beforeDestroy () { beforeDestroy() {
// echarts // echarts
if (this.myChart) this.myChart.dispose() if (this.myChart) this.myChart.dispose();
}, },
watch: {}, watch: {},
methods: { methods: {
initChart () { initChart() {
this.$nextTick(() => { this.$nextTick(() => {
const dom = this.$refs.screenEchartsFrame const dom = this.$refs.screenEchartsFrame;
this.myChart = echarts.init(dom) this.myChart = echarts.init(dom);
// this.myChart.setOption(this.chartMethod()) // this.myChart.setOption(this.chartMethod())
this.$emit('myChartMethod', this.myChart) this.$emit('myChartMethod', this.myChart);
}) });
}, },
// option // option
setOption (option) { setOption(option) {
this.myChart.setOption(option) this.myChart.setOption(option);
let than = this let than = this;
this.myChart.on('click',function(param){ this.myChart.off();
than.$emit('handelClickMyPei',param) this.myChart.on('click', function(param) {
}) than.$emit('handelClickMyPei', param);
}, });
// option },
getOption () { // option
if (this.myChart) { getOption() {
return this.myChart.getOption() if (this.myChart) {
} else { return this.myChart.getOption();
return null } else {
} return null;
}, }
// },
resize () { //
if (this.myChart) { resize() {
this.myChart.resize() if (this.myChart) {
} this.myChart.resize();
}, }
clear () { },
if (this.myChart) { clear() {
this.myChart.clear() if (this.myChart) {
} this.myChart.clear();
}, }
showLoading () { },
if (this.myChart) { showLoading() {
this.$nextTick(() => { if (this.myChart) {
this.myChart.showLoading({ this.$nextTick(() => {
text: '', this.myChart.showLoading({
color: '#29cdff', text: '',
textColor: '#29cdff', color: '#29cdff',
maskColor: 'rgba(255, 255, 255, 0)', textColor: '#29cdff',
zlevel: 0 maskColor: 'rgba(255, 255, 255, 0)',
}) zlevel: 0
}) });
} });
}, }
hideLoading () { },
if (this.myChart) { hideLoading() {
this.myChart.hideLoading() if (this.myChart) {
} this.myChart.hideLoading();
}, }
// 使 },
tooltipAnimate (chart, length) { // 使
// tooltipAnimate(chart, length) {
this.timeTicket && clearInterval(this.timeTicket) //
const count = 0 this.timeTicket && clearInterval(this.timeTicket);
// const count = 0;
this._action(chart, count, length) //
chart && // this._action(chart, count, length);
chart.on('mouseover', params => { chart && //
this._cleanAction(chart, params) chart.on('mouseover', params => {
}) this._cleanAction(chart, params);
// });
chart && //
chart.on('mouseout', () => { chart &&
this._action(chart, count, length) chart.on('mouseout', () => {
}) this._action(chart, count, length);
}, });
// tooltipaction },
_action (chart, count, length) { // tooltipaction
this.timeTicket && clearInterval(this.timeTicket) _action(chart, count, length) {
this.timeTicket = setInterval(() => { this.timeTicket && clearInterval(this.timeTicket);
if (!chart) { this.timeTicket = setInterval(() => {
clearInterval(this.timeTicket) if (!chart) {
return clearInterval(this.timeTicket);
} return;
chart && }
chart.dispatchAction({ chart &&
type: 'downplay', chart.dispatchAction({
seriesIndex: 0 type: 'downplay',
}) seriesIndex: 0
chart && });
chart.dispatchAction({ chart &&
type: 'highlight', chart.dispatchAction({
seriesIndex: 0, type: 'highlight',
dataIndex: count % length seriesIndex: 0,
}) dataIndex: count % length
chart && });
chart.dispatchAction({ chart &&
type: 'showTip', chart.dispatchAction({
seriesIndex: 0, type: 'showTip',
dataIndex: count % length seriesIndex: 0,
}) dataIndex: count % length
count++ });
}, 1000 * 3) count++;
}, }, 1000 * 3);
_cleanAction (chart, params) { },
this.timeTicket && clearInterval(this.timeTicket) _cleanAction(chart, params) {
if (!chart) { this.timeTicket && clearInterval(this.timeTicket);
clearInterval(this.timeTicket) if (!chart) {
return clearInterval(this.timeTicket);
} return;
chart && }
chart.dispatchAction({ chart &&
type: 'downplay', chart.dispatchAction({
seriesIndex: 0 type: 'downplay',
}) seriesIndex: 0
chart && });
chart.dispatchAction({ chart &&
type: 'highlight', chart.dispatchAction({
seriesIndex: 0, type: 'highlight',
dataIndex: params.dataIndex seriesIndex: 0,
}) dataIndex: params.dataIndex
chart && });
chart.dispatchAction({ chart &&
type: 'showTip', chart.dispatchAction({
seriesIndex: 0, type: 'showTip',
dataIndex: params.dataIndex seriesIndex: 0,
}) dataIndex: params.dataIndex
} });
} }
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.screenEchartsFrame { .screenEchartsFrame {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
</style> </style>

271
src/views/modules/communityParty/dyhx/party.vue

@ -22,22 +22,22 @@
<div class="div_table"> <div class="div_table">
<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 class="flex"> <div class="flex">
<div class="width1"> <div class="width1">
<div class="box"> <div class="box">
<screen-echarts-frame <screen-echarts-frame2
@handelClickMyPei="handelClickMyPei" @handelClickMyPei="handelClickMyPei2"
:style="{ width: '100%', height: '100%' }" :style="{ width: '100%', height: '100%' }"
@myChartMethod="pieInitOk" @myChartMethod="pieInitOk2"
ref="pieChart" ref="pieChart2"
></screen-echarts-frame> ></screen-echarts-frame2>
</div> </div>
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="box"> <div class="box">
<div class="legend"> <div class="legend">
<div class="legend-row" :key="item.name" v-for="(item, index) in chartDataData" @click="handleClickItem(item)"> <div class="legend-row" :key="item.name" v-for="(item, index) in chartData2Data" @click="handleClickItem(item)">
<div class="kuai" :style="{ backgroundColor: color[index] }"></div> <div class="kuai" :style="{ backgroundColor: color[index] }"></div>
<div class="content"> <div class="content">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
@ -49,24 +49,22 @@
</div> </div>
</div> </div>
</div> </div>
<div class="census_searchcensus2"> <!-- <div class="census_searchcensus2">
<div class="census_searchcensus_box"></div> <div class="census_searchcensus_box"></div>
<el-button size="small" class="diy-button--output" @click="handleExport('age')">导出</el-button> <el-button size="small" class="diy-button--output" @click="handleExport('edu')">导出</el-button>
</div> </div> <el-table
<el-table
class="table" class="table"
:data="tableDataAge" :data="tableData"
border border
:height="maxTableHeight" :height="maxTableHeight"
v-loading="tableLoadingAge" v-loading="tableLoading"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }" :header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
style="width: 100%" style="width: 100%"
> >
<el-table-column label="序号" header-align="center" align="center" type="index" width="50"></el-table-column> <el-table-column label="序号" header-align="center" align="center" type="index" width="50"></el-table-column>
<el-table-column prop="name" header-align="center" align="center" label="姓名" :show-overflow-tooltip="true" min-width="120"></el-table-column> <el-table-column prop="name" header-align="center" align="center" label="姓名" :show-overflow-tooltip="true" min-width="120"></el-table-column>
<el-table-column prop="age" header-align="center" align="center" :show-overflow-tooltip="true" label="年龄" min-width="100"></el-table-column> <el-table-column prop="education" header-align="center" align="center" :show-overflow-tooltip="true" label="学历" min-width="130"></el-table-column>
<el-table-column prop="mobile" header-align="center" align="center" :show-overflow-tooltip="true" label="手机号码" min-width="130"></el-table-column> <el-table-column prop="mobile" header-align="center" align="center" :show-overflow-tooltip="true" label="手机号码" min-width="130"></el-table-column>
@ -75,35 +73,35 @@
<el-button type="text" class="div-table-button--detail" size="small" @click="handleDetail(scope.row)">查看</el-button> <el-button type="text" class="div-table-button--detail" size="small" @click="handleDetail(scope.row)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
@size-change="pageSizeChangeHandleAge" @size-change="pageSizeChangeHandleNew"
@current-change="pageCurrentChangeHandleAge" @current-change="pageCurrentChangeHandleNew"
:current-page.sync="agePageNo" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50, 100, 200]" :page-sizes="[10, 20, 50, 100, 200]"
:page-size="agePageSize" :page-size="pageSize"
layout="sizes, prev, pager, next, total,jumper" layout="sizes, prev, pager, next, total,jumper"
:total="ageTotal" :total="total"
></el-pagination> ></el-pagination>-->
</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 class="flex"> <div class="flex">
<div class="width1"> <div class="width1">
<div class="box"> <div class="box">
<screen-echarts-frame2 <screen-echarts-frame
@handelClickMyPei="handelClickMyPei2" @handelClickMyPei="handelClickMyPei"
:style="{ width: '100%', height: '100%' }" :style="{ width: '100%', height: '100%' }"
@myChartMethod="pieInitOk2" @myChartMethod="pieInitOk"
ref="pieChart2" ref="pieChart"
></screen-echarts-frame2> ></screen-echarts-frame>
</div> </div>
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="box"> <div class="box">
<div class="legend"> <div class="legend">
<div class="legend-row" :key="item.name" v-for="(item, index) in chartData2Data" @click="handleClickItem(item)"> <div class="legend-row" :key="item.name" v-for="(item, index) in chartDataData" @click="handleClickItem(item)">
<div class="kuai" :style="{ backgroundColor: color[index] }"></div> <div class="kuai" :style="{ backgroundColor: color[index] }"></div>
<div class="content"> <div class="content">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
@ -115,45 +113,46 @@
</div> </div>
</div> </div>
</div> </div>
<div class="census_searchcensus2">
<div class="census_searchcensus_box"></div>
<el-button size="small" class="diy-button--output" @click="handleExport('edu')">导出</el-button>
</div>
<el-table
class="table"
:data="tableData"
border
:height="maxTableHeight"
v-loading="tableLoading"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
style="width: 100%"
>
<el-table-column label="序号" header-align="center" align="center" type="index" width="50"></el-table-column>
<el-table-column prop="name" header-align="center" align="center" label="姓名" :show-overflow-tooltip="true" min-width="120"></el-table-column>
<el-table-column prop="education" header-align="center" align="center" :show-overflow-tooltip="true" label="学历" min-width="130"></el-table-column>
<el-table-column prop="mobile" header-align="center" align="center" :show-overflow-tooltip="true" label="手机号码" min-width="130"></el-table-column>
<el-table-column label="操作" fixed="right" width="120" header-align="center" align="center" class="operate">
<template slot-scope="scope">
<el-button type="text" class="div-table-button--detail" size="small" @click="handleDetail(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="pageSizeChangeHandleNew"
@current-change="pageCurrentChangeHandleNew"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total,jumper"
:total="total"
></el-pagination>
</el-col> </el-col>
</el-row> </el-row>
<div class="census_searchcensus2">
<div class="census_searchcensus_box"></div>
<el-button size="small" class="diy-button--output" @click="handleExport('age')">导出</el-button>
</div>
<el-table
class="table"
:data="tableDataAge"
border
:height="maxTableHeight"
v-loading="tableLoadingAge"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
style="width: 100%"
>
<el-table-column label="序号" header-align="center" align="center" type="index" width="50"></el-table-column>
<el-table-column prop="name" header-align="center" align="center" label="姓名" :show-overflow-tooltip="true" min-width="120"></el-table-column>
<el-table-column prop="mobile" header-align="center" align="center" :show-overflow-tooltip="true" label="手机号码" min-width="130"></el-table-column>
<el-table-column prop="idCard" header-align="center" align="center" :show-overflow-tooltip="true" label="证件号" min-width="130"></el-table-column>
<el-table-column prop="age" header-align="center" align="center" :show-overflow-tooltip="true" label="年龄" min-width="100"></el-table-column>
<el-table-column prop="education" header-align="center" align="center" :show-overflow-tooltip="true" label="学历" min-width="130"></el-table-column>
<el-table-column label="操作" fixed="right" width="120" header-align="center" align="center" class="operate">
<template slot-scope="scope">
<el-button type="text" class="div-table-button--detail" size="small" @click="handleDetail(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="pageSizeChangeHandleAge"
@current-change="pageCurrentChangeHandleAge"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total,jumper"
:total="total"
></el-pagination>
</div> </div>
<!-- <crate-form v-if="memberDialog" <!-- <crate-form v-if="memberDialog"
@ -226,7 +225,9 @@ export default {
pieData2: [], pieData2: [],
orgId: '', orgId: '',
orgType: '', orgType: '',
code: '', code: '',
codeType: '',
pieDatatotal: 0, pieDatatotal: 0,
pieDatatotal2: 0, pieDatatotal2: 0,
memberDialog: false, memberDialog: false,
@ -243,7 +244,7 @@ export default {
noInit: false, noInit: false,
noEduInit: false, noEduInit: false,
selectAgency: null, selectAgency: null,
ageTotalCount: 0, totalCount: 0,
eduTotalCount: 0, eduTotalCount: 0,
propTree: [], propTree: [],
value2: '', value2: '',
@ -251,14 +252,12 @@ export default {
visibleLoading: true, visibleLoading: true,
agencyId: '', agencyId: '',
orgType: '', orgType: '',
ageCode: '',
eduCode: '',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
agePageNo: 1,
agePageSize: 10,
total: 0, total: 0,
ageTotal: 0,
partyOrgs: [], partyOrgs: [],
@ -292,7 +291,7 @@ export default {
this.getAgeCount(); this.getAgeCount();
this.getEduCount(); this.getEduCount();
this.getAgeList(); this.getAgeList();
this.getEduList(); // this.getEduList();
}, },
async created() { async created() {
// this.getGridList('query'); // this.getGridList('query');
@ -303,20 +302,21 @@ export default {
if (typeof this.formData[n] == 'object') this.formData[n] = []; if (typeof this.formData[n] == 'object') this.formData[n] = [];
else this.formData[n] = ''; else this.formData[n] = '';
} }
this.memberDialog = false;
this.pageNo = 1;
this.code = '';
this.codeType = '';
this.orgId = '';
this.handleSearch(); this.handleSearch();
}, },
handleChangeAgency(val) { handleChangeAgency(val) {
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data; let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
console.log('obj', obj); console.log('obj', obj);
if (obj) { if (obj) {
// this.orgType = obj.level === 'grid' ? 'grid' : 'agency';
// this.orgType = obj.level
} else { } else {
this.orgType = ''; this.orgType = '';
} }
let tmp = this.formData.orgId; let tmp = this.formData.orgId;
if (tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) { if (tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) {
this.orgId = this.formData.orgId; this.orgId = this.formData.orgId;
} else { } else {
@ -334,39 +334,14 @@ export default {
}, },
handleSearch(val) { handleSearch(val) {
this.memberDialog = false; this.memberDialog = false;
this.eduCode = ''; this.code = '';
this.ageCode = ''; this.codeType = '';
this.getAgeCount(); this.getAgeCount();
this.getEduCount(); this.getEduCount();
this.getAgeList(); this.getAgeList();
this.getEduList(); // this.getEduList();
}, },
// async getGridList(type, agencyId) {
// const { user } = await this.$store.state;
// // addorupdate query
// await this.$http
// .get('/resi/partymember/icPartyOrg/getSearchTreelist', { params: { agencyId: agencyId || user.agencyId } })
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg);
// } else {
// this.optionsG = this.deepArrTOnull(res.data);
// }
// })
// .catch(() => {
// return this.$message.error('');
// });
// },
// pieInitOk(dom) {
// console.log('pie', dom);
// this.pieAgeChartS = dom;
// // this.pieInitState = true
// },
// pieInitOks(dom) {
// console.log('pies', dom);
// this.pieEduChartS = dom;
// // this.pieInitState = true
// },
// //
async initAgeCharts(chartData) { async initAgeCharts(chartData) {
@ -587,23 +562,24 @@ export default {
this.$refs.pieChart2.setOption(this.pieOption2); this.$refs.pieChart2.setOption(this.pieOption2);
}, },
handelClickMyPei(param) { handelClickMyPei(param) {
this.ageCode = param.data.code; this.code = param.data.code;
this.codeType = 'age';
this.getAgeList()(); this.getAgeList();
}, },
handelClickMyPei2(param) { handelClickMyPei2(param) {
console.log(param); this.code = param.data.code;
this.eduCode = param.data.code; this.codeType = 'education';
this.getEduList(); this.getAgeList();
}, },
handleClickItem(item) { handleClickItem(item) {
this.ageCode = item.code; this.code = item.code;
this.codeType = 'age';
this.getAgeList(); this.getAgeList();
}, },
handleClickItem2(item) { handleClickItem2(item) {
this.eduCode = item.code; this.code = item.code;
this.getEduList(); this.codeType = 'education';
this.getAgeList();
}, },
async getAgeCount() { async getAgeCount() {
@ -718,49 +694,27 @@ export default {
this.tableLoadingAge = true; this.tableLoadingAge = true;
this.visibleAgeLoading = true; this.visibleAgeLoading = true;
// const url = "/epmetuser/icresiuser/partymemberagelist"; // const url = "/epmetuser/icresiuser/partymemberagelist";
const url = '/resi/partymember/icPartyMember/partymemberagelist'; const url = '/resi/partymember/icPartyMember/partymember-portrait-list';
let params = { let params = {
orgId: this.orgId, orgId: this.orgId,
orgType: this.orgType, orgType: this.orgType,
code: this.ageCode, code: this.code,
pageNo: this.agePageNo, codeType: this.codeType,
pageSize: this.agePageSize pageNo: this.pageNo,
pageSize: this.pageSize
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
this.tableLoadingAge = false; this.tableLoadingAge = false;
if (code === 0) { if (code === 0) {
this.tableDataAge = data.list; this.tableDataAge = data.list;
this.ageTotal = data.total; this.total = data.total;
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
// if (_code == 0 || _code) this.noInit = true // if (_code == 0 || _code) this.noInit = true
this.visibleAgeLoading = false; this.visibleAgeLoading = false;
}, },
async getEduList() {
this.tableLoading = true;
this.visibleLoading = true;
// const url = "/epmetuser/icresiuser/partymembereducationlist";
const url = '/resi/partymember/icPartyMember/partymembereducationlist';
let params = {
orgId: this.orgId,
orgType: this.orgType,
code: this.eduCode,
pageNo: this.pageNo,
pageSize: this.pageSize
};
const { data, code, msg } = await requestPost(url, params);
this.tableLoading = false;
if (code === 0) {
this.tableData = data.list;
this.total = data.total;
} else {
this.$message.error(msg);
}
this.visibleLoading = false;
},
async getOrgTreeList() { async getOrgTreeList() {
function deleteChildren(arr) { function deleteChildren(arr) {
@ -832,39 +786,30 @@ export default {
}, 500); }, 500);
}, },
pageSizeChangeHandleAge(val) { pageSizeChangeHandleAge(val) {
this.agePageNo = 1;
this.agePageSize = val;
this.getAgeList(this.agencyId, this.orgType, this.ageCode);
},
pageCurrentChangeHandleAge(val) {
this.agePageNo = val;
this.getAgeList(this.agencyId, this.orgType, this.ageCode);
},
pageSizeChangeHandleNew(val) {
this.pageNo = 1; this.pageNo = 1;
this.pageSize = val; this.pageSize = val;
this.getEduList(this.agencyId, this.orgType, this.eduCode); this.getAgeList();
}, },
pageCurrentChangeHandleNew(val) { pageCurrentChangeHandleAge(val) {
this.pageNo = val; this.pageNo = val;
this.getEduList(this.agencyId, this.orgType, this.eduCode); this.getAgeList();
}, },
async handleExport(type) { async handleExport(type) {
const urls = { const url = '/resi/partymember/icPartyMember/partymember-portrait-export';
age: '/epmetuser/icresiuser/partymemberagelist/export',
edu: '/epmetuser/icresiuser/partymembereducationlist/export'
};
const _arr = this.selectAgency[this.selectAgency.length - 1].split('-');
let params = { let params = {
orgId: this.orgId, orgId: this.orgId,
orgType: this.orgType, orgType: this.orgType,
code: type == 'age' ? this.ageCode : this.eduCode code: this.code,
codeType: this.codeType
// pageNo: this.pageNo,
// pageSize: this.pageSize
}; };
// .post('epmetuser/icresiuser/exportExcel', params) // .post('epmetuser/icresiuser/exportExcel', params)
await this.$http({ await this.$http({
method: 'POST', method: 'POST',
url: urls[type], url: url,
responseType: 'blob', responseType: 'blob',
data: params data: params
}) })

Loading…
Cancel
Save