123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547 |
- (function ($app) {
- 'use strict';
- $app.module('gtPartyApp').controller('teamsCtrl', function ($scope, $state, $alert, AuthUser, $http, $loading) {
- if (AuthUser.getUser().Id == null || AuthUser.getUser().Id == '') {
- window.location.href = "/app/main/index.html#!/login";
- return false;
- }
- //初始化查询参数
- $scope.selectparams = {
- selectdzzdm: '',
- selectdzzmc: '',
- parentcode: AuthUser.getUser().DPCode,
- parentname: AuthUser.getUser().ParentDpName,
- szdzzdm: AuthUser.getUser().DPCode,
- szdzzmc: AuthUser.getUser().DPName,
- dzzmc: '',
- dzzdm: '',
- zzlb: null,
- jczzfl: null,
- jldzzrq_begin: '',
- jldzzrq_end: '',
- isContainParent: 1,
- curl: './bigdata/showDjdsj/css/party-tree.css',
- treeheight: '85vh',
- userid: AuthUser.getUser().Id,
- navs: [
- {id: '', text: '全部'},
- {id: 1, text: '在岗'}
- ],
- navSelected: '',
- colors: ['#F8B551', '#918879', '#EFF0C7', '#91C7AE', '#DCDCDC', '#F0FFFF', '#005983']
- };
- $scope.navClick = function (id) {
- $scope.selectparams.navSelected = id;
- $scope.GetPageData();
- };
- //树选择机构变化
- $scope.$watch('selectparams.selectdzzdm', function (newVal) {
- if (newVal != '' && newVal != null) {
- $scope.GetPageData();
- }
- });
- //图表取数begin
- {
- //党员性别
- $scope.dyxb_dataList = [];
- $scope.dyxb_pieOption = {
- legend: {
- type: 'scroll',
- orient: 'vertical',
- right: 0,
- bottom: 5,
- data: $scope.xueli_legend_data,
- top: '10%',
- icon: "circle",
- textStyle: {
- color: '#fff'
- },
- formatter: function (name) {
- var target = 0;
- angular.forEach($scope.dyxb_dataList, function (item, index) {
- if (item.name == name) {
- target = item.value;
- }
- });
- return name + ':' + target;
- }
- },
- series: [
- {
- name: '党员性别',
- type: 'pie',
- radius: ['50%', '80%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: false,
- position: 'center'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: $scope.dyxb_dataList,
- center: ['30%', '50%']
- }
- ],
- tooltip: {
- trigger: 'item',
- formatter:function (data) {
- return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
- }
- }
- };
- $scope.load_dyxb = function () {
- $scope.dyxb_dataList.length = 0;
- $http
- ({
- method: 'get',
- url: '../../api/bigdata/getDyxbCount',
- params: {
- dzzdm: $scope.selectparams.selectdzzdm,
- isOnduty: $scope.selectparams.navSelected
- }
- }).then(function (result) {
- if (result.data != null && result.data.length > 0) {
- var colors = ['#F8B551', '#918879'];
- angular.forEach(result.data, function (val, index) {
- $scope.dyxb_dataList.push($scope.getPieData(val.NUM, val.SEXNAME, colors[index]));
- });
- }
- });
- };
- //年龄分布
- $scope.dynl_dataList = [];
- $scope.dynl_pieOption = {
- legend: {
- type: 'scroll',
- orient: 'vertical',
- right: 0,
- bottom: 5,
- data: $scope.dynl_dataList,
- top: '10%',
- icon: "circle",
- textStyle: {
- color: '#fff'
- },
- formatter: function (name) {
- var target = 0;
- angular.forEach($scope.dynl_dataList, function (item, index) {
- if (item.name == name) {
- target = item.value;
- }
- });
- return name + ':' + target;
- }
- },
- series: [
- {
- name: '年龄分布',
- type: 'pie',
- radius: ['50%', '80%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: false,
- position: 'center'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: $scope.dynl_dataList,
- center: ['30%', '50%']
- }
- ],
- tooltip: {
- trigger: 'item',
- formatter:function (data) {
- return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
- }
- }
- };
- $scope.load_dynl = function () {
- $scope.dynl_dataList.length = 0;
- $http
- ({
- method: 'get',
- url: '../../api/bigdata/getDynlCount',
- params: {
- dzzdm: $scope.selectparams.selectdzzdm,
- isOnduty: $scope.selectparams.navSelected
- }
- }).then(function (result) {
- if (result.data != null && result.data.length > 0) {
- angular.forEach(result.data, function (val, index) {
- $scope.dynl_dataList.push($scope.getPieData(val.NUM, val.AGENAME, $scope.selectparams.colors[index]));
- });
- }
- });
- };
- //党员党龄
- $scope.dydl_dataList = [];
- $scope.dydl_pieOption = {
- legend: {
- type: 'scroll',
- orient: 'vertical',
- right: 0,
- bottom: 5,
- data: $scope.dydl_dataList,
- top: '10%',
- icon: "circle",
- textStyle: {
- color: '#fff'
- },
- formatter: function (name) {
- var target = 0;
- angular.forEach($scope.dydl_dataList, function (item, index) {
- if (item.name == name) {
- target = item.value;
- }
- });
- return name + ':' + target;
- }
- },
- series: [
- {
- name: '党员党龄',
- type: 'pie',
- radius: ['50%', '80%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: false,
- position: 'center'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: $scope.dydl_dataList,
- center: ['20%', '50%']
- }
- ],
- tooltip: {
- trigger: 'item',
- formatter:function (data) {
- return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
- }
- }
- };
- $scope.load_dydl = function () {
- $scope.dydl_dataList.length = 0;
- $http
- ({
- method: 'get',
- url: '../../api/bigdata/getDydlCount',
- params: {
- dzzdm: $scope.selectparams.selectdzzdm,
- isOnduty: $scope.selectparams.navSelected
- }
- }).then(function (result) {
- if (result.data != null && result.data.length > 0) {
- angular.forEach(result.data, function (val, index) {
- $scope.dydl_dataList.push($scope.getPieData(val.NUM, val.AGENAME, $scope.selectparams.colors[index]));
- });
- }
- });
- };
- //党员信息
- $scope.dyxx = {};
- $scope.load_dyxx = function () {
- $http
- ({
- method: 'get',
- url: '../../api/bigdata/getDyCount',
- params: {
- dzzdm: $scope.selectparams.selectdzzdm,
- isOnduty: $scope.selectparams.navSelected
- }
- }).then(function (result) {
- if (result.data != null) {
- $scope.dyxx = result.data;
- }
- });
- };
- //发展党员情况
- $scope.fzdyqk_dataList = [];
- $scope.fzdyqk_nameList = ["预备党员", "入党申请人数", "入党积极分子", "发展对象"];
- $scope.fzdyqk_barOption = {
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: "{a} <br/>{b} : {c}"
- },
- xAxis: {
- type: 'value',
- name: '数量',
- axisLabel: {
- formatter: '{value}',
- color: '#fff'
- },
- axisTick:{ //y轴刻度线
- show:false
- },
- splitLine: { //网格线
- show: false
- }
- },
- yAxis: {
- type: 'category',
- inverse: true,
- axisLabel: {
- color: '#fff'
- },
- data: $scope.fzdyqk_nameList
- },
- series: [
- {
- name: '发展党员情况',
- data: $scope.fzdyqk_dataList,
- type: "bar",
- barWidth: 20,
- itemStyle: {
- normal: {
- color: function (params) {
- var colorList = ['#F8B551', '#918879', '#EFF0C7', '#91C7AE'];
- return colorList[params.dataIndex];
- }
- }
- }
- }
- ],
- grid: {
- top: 20,
- bottom: 10,
- containLabel: true
- }
- };
- //学历比例
- $scope.xueli_data = [];
- $scope.xueli_legend_data = [];
- $scope.pieOption_xueli = {
- legend: {
- type: 'scroll',
- orient: 'vertical',
- right: 0,
- bottom: 5,
- data: $scope.xueli_legend_data,
- top: '10%',
- icon: "circle",
- textStyle: {
- color: '#fff'
- },
- formatter: function (name) {
- var target = 0;
- angular.forEach($scope.xueli_data, function (item, index) {
- if (item.name == name) {
- target = item.value;
- }
- });
- return name + ':' + target;
- }
- },
- series: [
- {
- name: '学历水平',
- type: 'pie',
- radius: ['50%', '80%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: false,
- position: 'center'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: $scope.xueli_data,
- center: ['30%', '50%']
- }
- ],
- tooltip: {
- trigger: 'item',
- formatter:function (data) {
- return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
- }
- }
- };
- $scope.load_dyxl = function () {
- $scope.xueli_legend_data.length = 0;
- $scope.xueli_data.length = 0;
- $http
- ({
- method: 'get',
- url: '../../api/bigdata/getUserEducationList',
- params: {
- dzzdm: $scope.selectparams.selectdzzdm,
- isOnduty: $scope.selectparams.navSelected
- }
- }).then(function (result) {
- if (result.data.item != null) {
- angular.forEach(result.data.item, function (val, index) {
- $scope.xueli_legend_data.push(val.EDUCATIONNAME);
- $scope.xueli_data.push($scope.getPieData(val.NUM, val.EDUCATIONNAME, $scope.selectparams.colors[index]));
- });
- }
- });
- };
- //正式和预备党员统计图
- $scope.dyzsrate_dataList = [];
- $scope.dyzsrate_pieOption = {
- legend: {
- type: 'scroll',
- orient: 'vertical',
- right: 0,
- bottom: 5,
- data: ["正式党员","预备党员"],
- top: '10%',
- icon: "circle",
- textStyle: {
- color: '#fff'
- },
- formatter: function (name) {
- var target = 0;
- angular.forEach($scope.dyzsrate_dataList, function (item, index) {
- if (item.name == name) {
- target = item.value;
- }
- });
- return name + ':' + target;
- }
- },
- series: [
- {
- name: '正式党员和预备党员比例',
- type: 'pie',
- radius: ['50%', '80%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: false,
- position: 'center'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: $scope.dyzsrate_dataList,
- center: ['30%', '50%']
- }
- ],
- tooltip: {
- trigger: 'item',
- formatter:function (data) {
- return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
- }
- }
- };
- $scope.load_fzdyqk = function () {
- $http
- ({
- method: 'get', url: '../../api/partyExpand/getJoinUserTotalList', params: {
- pageindex: 1,
- pagesize: 10,
- dzzdm: $scope.selectparams.selectdzzdm,
- isOnduty: $scope.selectparams.navSelected
- }
- }).then(function (result) {
- if (result.data.item.list.length > 0) {
- var data = result.data.item.list[0];
- $scope.fzdyqk_dataList.push(data.YBDY);
- $scope.fzdyqk_dataList.push(data.SQRD);
- $scope.fzdyqk_dataList.push(data.JJFZ);
- $scope.fzdyqk_dataList.push(data.FZDX);
- $scope.dyzsrate_dataList.push($scope.getPieData(data.ZSDY, "正式党员", $scope.selectparams.colors[0]));
- $scope.dyzsrate_dataList.push($scope.getPieData(data.YBDY, "预备党员", $scope.selectparams.colors[1]));
- }
- }, function (resp) {
- });
- };
- //组织饼图数据
- $scope.getPieData = function (val, name, color) {
- return {value: val, name: name, itemStyle: {color: color}};
- };
- }
- //图表取数end
- //数据读取
- $scope.GetPageData = function () {
- $scope.load_dyxb();
- $scope.load_dydl();
- $scope.load_dyxx();
- $scope.load_fzdyqk();
- $scope.load_dyxl();
- $scope.load_dynl();
- };
- });
- })(angular);
|