teams.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. (function ($app) {
  2. 'use strict';
  3. $app.module('gtPartyApp').controller('teamsCtrl', function ($scope, $state, $alert, AuthUser, $http, $loading) {
  4. if (AuthUser.getUser().Id == null || AuthUser.getUser().Id == '') {
  5. window.location.href = "/app/main/index.html#!/login";
  6. return false;
  7. }
  8. //初始化查询参数
  9. $scope.selectparams = {
  10. selectdzzdm: '',
  11. selectdzzmc: '',
  12. parentcode: AuthUser.getUser().DPCode,
  13. parentname: AuthUser.getUser().ParentDpName,
  14. szdzzdm: AuthUser.getUser().DPCode,
  15. szdzzmc: AuthUser.getUser().DPName,
  16. dzzmc: '',
  17. dzzdm: '',
  18. zzlb: null,
  19. jczzfl: null,
  20. jldzzrq_begin: '',
  21. jldzzrq_end: '',
  22. isContainParent: 1,
  23. curl: './bigdata/showDjdsj/css/party-tree.css',
  24. treeheight: '85vh',
  25. userid: AuthUser.getUser().Id,
  26. navs: [
  27. {id: '', text: '全部'},
  28. {id: 1, text: '在岗'}
  29. ],
  30. navSelected: '',
  31. colors: ['#F8B551', '#918879', '#EFF0C7', '#91C7AE', '#DCDCDC', '#F0FFFF', '#005983']
  32. };
  33. $scope.navClick = function (id) {
  34. $scope.selectparams.navSelected = id;
  35. $scope.GetPageData();
  36. };
  37. //树选择机构变化
  38. $scope.$watch('selectparams.selectdzzdm', function (newVal) {
  39. if (newVal != '' && newVal != null) {
  40. $scope.GetPageData();
  41. }
  42. });
  43. //图表取数begin
  44. {
  45. //党员性别
  46. $scope.dyxb_dataList = [];
  47. $scope.dyxb_pieOption = {
  48. legend: {
  49. type: 'scroll',
  50. orient: 'vertical',
  51. right: 0,
  52. bottom: 5,
  53. data: $scope.xueli_legend_data,
  54. top: '10%',
  55. icon: "circle",
  56. textStyle: {
  57. color: '#fff'
  58. },
  59. formatter: function (name) {
  60. var target = 0;
  61. angular.forEach($scope.dyxb_dataList, function (item, index) {
  62. if (item.name == name) {
  63. target = item.value;
  64. }
  65. });
  66. return name + ':' + target;
  67. }
  68. },
  69. series: [
  70. {
  71. name: '党员性别',
  72. type: 'pie',
  73. radius: ['50%', '80%'],
  74. avoidLabelOverlap: false,
  75. label: {
  76. normal: {
  77. show: false,
  78. position: 'center'
  79. },
  80. emphasis: {
  81. show: true,
  82. textStyle: {
  83. fontSize: '20',
  84. fontWeight: 'bold'
  85. }
  86. }
  87. },
  88. labelLine: {
  89. normal: {
  90. show: false
  91. }
  92. },
  93. data: $scope.dyxb_dataList,
  94. center: ['30%', '50%']
  95. }
  96. ],
  97. tooltip: {
  98. trigger: 'item',
  99. formatter:function (data) {
  100. return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
  101. }
  102. }
  103. };
  104. $scope.load_dyxb = function () {
  105. $scope.dyxb_dataList.length = 0;
  106. $http
  107. ({
  108. method: 'get',
  109. url: '../../api/bigdata/getDyxbCount',
  110. params: {
  111. dzzdm: $scope.selectparams.selectdzzdm,
  112. isOnduty: $scope.selectparams.navSelected
  113. }
  114. }).then(function (result) {
  115. if (result.data != null && result.data.length > 0) {
  116. var colors = ['#F8B551', '#918879'];
  117. angular.forEach(result.data, function (val, index) {
  118. $scope.dyxb_dataList.push($scope.getPieData(val.NUM, val.SEXNAME, colors[index]));
  119. });
  120. }
  121. });
  122. };
  123. //年龄分布
  124. $scope.dynl_dataList = [];
  125. $scope.dynl_pieOption = {
  126. legend: {
  127. type: 'scroll',
  128. orient: 'vertical',
  129. right: 0,
  130. bottom: 5,
  131. data: $scope.dynl_dataList,
  132. top: '10%',
  133. icon: "circle",
  134. textStyle: {
  135. color: '#fff'
  136. },
  137. formatter: function (name) {
  138. var target = 0;
  139. angular.forEach($scope.dynl_dataList, function (item, index) {
  140. if (item.name == name) {
  141. target = item.value;
  142. }
  143. });
  144. return name + ':' + target;
  145. }
  146. },
  147. series: [
  148. {
  149. name: '年龄分布',
  150. type: 'pie',
  151. radius: ['50%', '80%'],
  152. avoidLabelOverlap: false,
  153. label: {
  154. normal: {
  155. show: false,
  156. position: 'center'
  157. },
  158. emphasis: {
  159. show: true,
  160. textStyle: {
  161. fontSize: '20',
  162. fontWeight: 'bold'
  163. }
  164. }
  165. },
  166. labelLine: {
  167. normal: {
  168. show: false
  169. }
  170. },
  171. data: $scope.dynl_dataList,
  172. center: ['30%', '50%']
  173. }
  174. ],
  175. tooltip: {
  176. trigger: 'item',
  177. formatter:function (data) {
  178. return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
  179. }
  180. }
  181. };
  182. $scope.load_dynl = function () {
  183. $scope.dynl_dataList.length = 0;
  184. $http
  185. ({
  186. method: 'get',
  187. url: '../../api/bigdata/getDynlCount',
  188. params: {
  189. dzzdm: $scope.selectparams.selectdzzdm,
  190. isOnduty: $scope.selectparams.navSelected
  191. }
  192. }).then(function (result) {
  193. if (result.data != null && result.data.length > 0) {
  194. angular.forEach(result.data, function (val, index) {
  195. $scope.dynl_dataList.push($scope.getPieData(val.NUM, val.AGENAME, $scope.selectparams.colors[index]));
  196. });
  197. }
  198. });
  199. };
  200. //党员党龄
  201. $scope.dydl_dataList = [];
  202. $scope.dydl_pieOption = {
  203. legend: {
  204. type: 'scroll',
  205. orient: 'vertical',
  206. right: 0,
  207. bottom: 5,
  208. data: $scope.dydl_dataList,
  209. top: '10%',
  210. icon: "circle",
  211. textStyle: {
  212. color: '#fff'
  213. },
  214. formatter: function (name) {
  215. var target = 0;
  216. angular.forEach($scope.dydl_dataList, function (item, index) {
  217. if (item.name == name) {
  218. target = item.value;
  219. }
  220. });
  221. return name + ':' + target;
  222. }
  223. },
  224. series: [
  225. {
  226. name: '党员党龄',
  227. type: 'pie',
  228. radius: ['50%', '80%'],
  229. avoidLabelOverlap: false,
  230. label: {
  231. normal: {
  232. show: false,
  233. position: 'center'
  234. },
  235. emphasis: {
  236. show: true,
  237. textStyle: {
  238. fontSize: '20',
  239. fontWeight: 'bold'
  240. }
  241. }
  242. },
  243. labelLine: {
  244. normal: {
  245. show: false
  246. }
  247. },
  248. data: $scope.dydl_dataList,
  249. center: ['20%', '50%']
  250. }
  251. ],
  252. tooltip: {
  253. trigger: 'item',
  254. formatter:function (data) {
  255. return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
  256. }
  257. }
  258. };
  259. $scope.load_dydl = function () {
  260. $scope.dydl_dataList.length = 0;
  261. $http
  262. ({
  263. method: 'get',
  264. url: '../../api/bigdata/getDydlCount',
  265. params: {
  266. dzzdm: $scope.selectparams.selectdzzdm,
  267. isOnduty: $scope.selectparams.navSelected
  268. }
  269. }).then(function (result) {
  270. if (result.data != null && result.data.length > 0) {
  271. angular.forEach(result.data, function (val, index) {
  272. $scope.dydl_dataList.push($scope.getPieData(val.NUM, val.AGENAME, $scope.selectparams.colors[index]));
  273. });
  274. }
  275. });
  276. };
  277. //党员信息
  278. $scope.dyxx = {};
  279. $scope.load_dyxx = function () {
  280. $http
  281. ({
  282. method: 'get',
  283. url: '../../api/bigdata/getDyCount',
  284. params: {
  285. dzzdm: $scope.selectparams.selectdzzdm,
  286. isOnduty: $scope.selectparams.navSelected
  287. }
  288. }).then(function (result) {
  289. if (result.data != null) {
  290. $scope.dyxx = result.data;
  291. }
  292. });
  293. };
  294. //发展党员情况
  295. $scope.fzdyqk_dataList = [];
  296. $scope.fzdyqk_nameList = ["预备党员", "入党申请人数", "入党积极分子", "发展对象"];
  297. $scope.fzdyqk_barOption = {
  298. tooltip: {
  299. trigger: 'axis',
  300. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  301. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  302. },
  303. formatter: "{a} <br/>{b} : {c}"
  304. },
  305. xAxis: {
  306. type: 'value',
  307. name: '数量',
  308. axisLabel: {
  309. formatter: '{value}',
  310. color: '#fff'
  311. },
  312. axisTick:{ //y轴刻度线
  313. show:false
  314. },
  315. splitLine: { //网格线
  316. show: false
  317. }
  318. },
  319. yAxis: {
  320. type: 'category',
  321. inverse: true,
  322. axisLabel: {
  323. color: '#fff'
  324. },
  325. data: $scope.fzdyqk_nameList
  326. },
  327. series: [
  328. {
  329. name: '发展党员情况',
  330. data: $scope.fzdyqk_dataList,
  331. type: "bar",
  332. barWidth: 20,
  333. itemStyle: {
  334. normal: {
  335. color: function (params) {
  336. var colorList = ['#F8B551', '#918879', '#EFF0C7', '#91C7AE'];
  337. return colorList[params.dataIndex];
  338. }
  339. }
  340. }
  341. }
  342. ],
  343. grid: {
  344. top: 20,
  345. bottom: 10,
  346. containLabel: true
  347. }
  348. };
  349. //学历比例
  350. $scope.xueli_data = [];
  351. $scope.xueli_legend_data = [];
  352. $scope.pieOption_xueli = {
  353. legend: {
  354. type: 'scroll',
  355. orient: 'vertical',
  356. right: 0,
  357. bottom: 5,
  358. data: $scope.xueli_legend_data,
  359. top: '10%',
  360. icon: "circle",
  361. textStyle: {
  362. color: '#fff'
  363. },
  364. formatter: function (name) {
  365. var target = 0;
  366. angular.forEach($scope.xueli_data, function (item, index) {
  367. if (item.name == name) {
  368. target = item.value;
  369. }
  370. });
  371. return name + ':' + target;
  372. }
  373. },
  374. series: [
  375. {
  376. name: '学历水平',
  377. type: 'pie',
  378. radius: ['50%', '80%'],
  379. avoidLabelOverlap: false,
  380. label: {
  381. normal: {
  382. show: false,
  383. position: 'center'
  384. },
  385. emphasis: {
  386. show: true,
  387. textStyle: {
  388. fontSize: '20',
  389. fontWeight: 'bold'
  390. }
  391. }
  392. },
  393. labelLine: {
  394. normal: {
  395. show: false
  396. }
  397. },
  398. data: $scope.xueli_data,
  399. center: ['30%', '50%']
  400. }
  401. ],
  402. tooltip: {
  403. trigger: 'item',
  404. formatter:function (data) {
  405. return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
  406. }
  407. }
  408. };
  409. $scope.load_dyxl = function () {
  410. $scope.xueli_legend_data.length = 0;
  411. $scope.xueli_data.length = 0;
  412. $http
  413. ({
  414. method: 'get',
  415. url: '../../api/bigdata/getUserEducationList',
  416. params: {
  417. dzzdm: $scope.selectparams.selectdzzdm,
  418. isOnduty: $scope.selectparams.navSelected
  419. }
  420. }).then(function (result) {
  421. if (result.data.item != null) {
  422. angular.forEach(result.data.item, function (val, index) {
  423. $scope.xueli_legend_data.push(val.EDUCATIONNAME);
  424. $scope.xueli_data.push($scope.getPieData(val.NUM, val.EDUCATIONNAME, $scope.selectparams.colors[index]));
  425. });
  426. }
  427. });
  428. };
  429. //正式和预备党员统计图
  430. $scope.dyzsrate_dataList = [];
  431. $scope.dyzsrate_pieOption = {
  432. legend: {
  433. type: 'scroll',
  434. orient: 'vertical',
  435. right: 0,
  436. bottom: 5,
  437. data: ["正式党员","预备党员"],
  438. top: '10%',
  439. icon: "circle",
  440. textStyle: {
  441. color: '#fff'
  442. },
  443. formatter: function (name) {
  444. var target = 0;
  445. angular.forEach($scope.dyzsrate_dataList, function (item, index) {
  446. if (item.name == name) {
  447. target = item.value;
  448. }
  449. });
  450. return name + ':' + target;
  451. }
  452. },
  453. series: [
  454. {
  455. name: '正式党员和预备党员比例',
  456. type: 'pie',
  457. radius: ['50%', '80%'],
  458. avoidLabelOverlap: false,
  459. label: {
  460. normal: {
  461. show: false,
  462. position: 'center'
  463. },
  464. emphasis: {
  465. show: true,
  466. textStyle: {
  467. fontSize: '20',
  468. fontWeight: 'bold'
  469. }
  470. }
  471. },
  472. labelLine: {
  473. normal: {
  474. show: false
  475. }
  476. },
  477. data: $scope.dyzsrate_dataList,
  478. center: ['30%', '50%']
  479. }
  480. ],
  481. tooltip: {
  482. trigger: 'item',
  483. formatter:function (data) {
  484. return data.seriesName + "<br/>"+ data.name+ " : " + data.value + " ("+data.percent.toFixed(0)+"%)";
  485. }
  486. }
  487. };
  488. $scope.load_fzdyqk = function () {
  489. $http
  490. ({
  491. method: 'get', url: '../../api/partyExpand/getJoinUserTotalList', params: {
  492. pageindex: 1,
  493. pagesize: 10,
  494. dzzdm: $scope.selectparams.selectdzzdm,
  495. isOnduty: $scope.selectparams.navSelected
  496. }
  497. }).then(function (result) {
  498. if (result.data.item.list.length > 0) {
  499. var data = result.data.item.list[0];
  500. $scope.fzdyqk_dataList.push(data.YBDY);
  501. $scope.fzdyqk_dataList.push(data.SQRD);
  502. $scope.fzdyqk_dataList.push(data.JJFZ);
  503. $scope.fzdyqk_dataList.push(data.FZDX);
  504. $scope.dyzsrate_dataList.push($scope.getPieData(data.ZSDY, "正式党员", $scope.selectparams.colors[0]));
  505. $scope.dyzsrate_dataList.push($scope.getPieData(data.YBDY, "预备党员", $scope.selectparams.colors[1]));
  506. }
  507. }, function (resp) {
  508. });
  509. };
  510. //组织饼图数据
  511. $scope.getPieData = function (val, name, color) {
  512. return {value: val, name: name, itemStyle: {color: color}};
  513. };
  514. }
  515. //图表取数end
  516. //数据读取
  517. $scope.GetPageData = function () {
  518. $scope.load_dyxb();
  519. $scope.load_dydl();
  520. $scope.load_dyxx();
  521. $scope.load_fzdyqk();
  522. $scope.load_dyxl();
  523. $scope.load_dynl();
  524. };
  525. });
  526. })(angular);