personal_data_statistics.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  1. var year = new Date().getFullYear();
  2. var x_m_array = new Array();
  3. var x_m_array_temp = new Array();
  4. var months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
  5. var monthsCH = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
  6. var array_year_score = new Array();
  7. var array_check_type = new Array();
  8. var user_id = 2524; // 用户假数据
  9. var score_statistics;
  10. var check_type;
  11. var cur_status;
  12. var hide = false;
  13. var array_points = new Array();
  14. var array_points2 = new Array();
  15. // 默认初始化日期一个月
  16. $(".div-start input").val(new Date().getFullYear() + "-" + (new Date().getMonth() > 10 ? new Date().getMonth() : "0" + new Date().getMonth()) + "-26");
  17. $(".div-end input").val(new Date().getFullYear() + "-" + (new Date().getMonth() + 1 > 10 ? new Date().getMonth() + 1 : "0" + (new Date().getMonth() + 1)) + "-25");
  18. var start_date = dateChange(moment($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
  19. var end_date = $(".div-end input").val() + " 23:00:00";
  20. /**
  21. * 预加载方法
  22. */
  23. $(function() {
  24. setVisit();
  25. var temp_time = $.zui.store.get('page_data_param_temp_time');
  26. if (temp_time) {
  27. var year = temp_time.split('/')[0];
  28. var month = temp_time.split('/')[1];
  29. var starty = year;
  30. var startm = parseInt(month) - 1;
  31. if (startm <= 0) {
  32. startm = 12;
  33. starty = parseInt(year) - 1;
  34. }
  35. $(".div-start input").val(starty + '-' + (startm >= 10 ? startm : ("0" + startm)) + '-26');
  36. $(".div-end input").val(year + '-' + month + '-25');
  37. $.zui.store.set('page_data_param_temp_time', null)
  38. }
  39. //*************************************数据表格******************************************
  40. function initAppealPage(start_date, end_date, user_id) {
  41. initQueryParams();
  42. queryAppeal(start_date, end_date, user_id);
  43. }
  44. function initQueryParams() {
  45. //获取页面参数
  46. var page_params = $.zui.store.get("page_params");
  47. if (page_params && page_params.status) {
  48. cur_status = page_params.status;
  49. }
  50. }
  51. function queryAppeal(start_date, end_date, user_id) {
  52. $("#station_name").html($("#select-dept").find("option:selected").text())
  53. $("#station_user_name").html("-")
  54. //请求数据
  55. var data_t = {
  56. "start_date": start_date,
  57. "end_date": end_date,
  58. "user_id": user_id
  59. }
  60. var url_t = "/statistics/employee/order/detail"
  61. post_common_service(url_t, data_t, function(res) {
  62. $("#c_dept_ranking").html("-");
  63. $("#c_com_ranking").html("-");
  64. $("#c_score_ranking").html("-");
  65. $("#l_dept_ranking").html("-");
  66. $("#l_com_ranking").html("-");
  67. $("#l_score_ranking").html("-");
  68. if (typeof(res.user) != undefined && res.user != null) {
  69. $("#station_user_name").html(res.user.position_name)
  70. }
  71. var isshow_c = false;
  72. var isshow_l = false;
  73. if (typeof(res.currentP) != undefined && res.currentP != null) {
  74. var p = res.currentP;
  75. $("#c_dept_ranking").html(p.fee_station_ranking == undefined ? "-" : p.fee_station_ranking);
  76. $("#c_com_ranking").html(p.company_ranking == undefined ? "-" : p.company_ranking);
  77. $("#c_score_ranking").html(p.check_all_score + p.check_all_m_score);
  78. $("#c_road_ranking").html(p.center_ranking == undefined ? "-" : p.center_ranking);
  79. isshow_c = true;
  80. }
  81. if (typeof(res.lastP) != undefined && res.lastP != null) {
  82. var p = res.lastP;
  83. $("#l_dept_ranking").html(p.fee_station_ranking == undefined ? "-" : p.fee_station_ranking);
  84. $("#l_com_ranking").html(p.company_ranking == undefined ? "-" : p.company_ranking);
  85. $("#l_score_ranking").html(p.check_all_score + p.check_all_m_score);
  86. $("#l_road_ranking").html(p.center_ranking == undefined ? "-" : p.center_ranking);
  87. isshow_l = true;
  88. }
  89. if (isshow_c && isshow_l) {
  90. var p_c = res.currentP;
  91. var p_l = res.lastP;
  92. if (p_c.fee_station_ranking != undefined && p_l.fee_station_ranking != undefined) {
  93. var dept_r = p_c.fee_station_ranking - p_l.fee_station_ranking;
  94. if (dept_r != 0) {
  95. $("#c_dept_ranking").html($("#c_dept_ranking").html() + "<i style='margin-left:10px;color:" + (dept_r > 0 ? "red" : "#0aef3d") + "' class='icon icon-long-arrow-" + (dept_r > 0 ? "down" : "up") + "'>" + Math.abs(dept_r) + "</i>");
  96. }
  97. var com_r = p_c.company_ranking - p_l.company_ranking;
  98. if (com_r != 0) {
  99. $("#c_com_ranking").html($("#c_com_ranking").html() + "<i style='margin-left:10px;color:" + (com_r > 0 ? "red" : "#0aef3d") + "' class='icon icon-long-arrow-" + (com_r > 0 ? "down" : "up") + "'>" + Math.abs(com_r) + "</i>");
  100. }
  101. var road_r = p_c.center_ranking - p_l.center_ranking;
  102. if (road_r != 0) {
  103. $("#c_road_ranking").html($("#c_road_ranking").html() + "<i style='margin-left:10px;color:" + (road_r > 0 ? "red" : "#0aef3d") + "' class='icon icon-long-arrow-" + (road_r > 0 ? "down" : "up") + "'>" + Math.abs(road_r) + "</i>");
  104. }
  105. }
  106. }
  107. }, function(error) {})
  108. $.ajax({
  109. type: "OPTIONS",
  110. url: base_ui_url,
  111. complete: function(x) {
  112. //计算当前周期
  113. var now_date_time = moment(new Date(x.getResponseHeader("Date")))
  114. var current_start_date = null;
  115. if (now_date_time.date() >= 26) {
  116. current_start_date = moment(now_date_time.format("YYYY-MM") + "-25 23:00:00Z").subtract(0, "month");
  117. } else {
  118. current_start_date = moment(now_date_time.format("YYYY-MM") + "-25 23:00:00Z").subtract(1, "month");
  119. }
  120. var end_date_time = moment(end_date + "Z");
  121. if (end_date_time.valueOf() > current_start_date.valueOf()) {
  122. if (hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) || roleContains('STATION')) {
  123. $(".score-select").val(1)
  124. }
  125. }
  126. var data = {
  127. "start_date": start_date,
  128. "end_date": end_date,
  129. "user_id": user_id,
  130. "queryType": 0,
  131. }
  132. if ($(".score-select").val() == "0") {
  133. data["score_flag"] = 0;
  134. }
  135. if ($(".score-select").val() == "1") {
  136. data["score_flag"] = 1;
  137. }
  138. if (hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) || hasRole(ROLE_JICHA) || roleContains('STATION')) {
  139. hide = true;
  140. }
  141. var cols = [
  142. { width: 50, text: '序号', flex: true, colClass: 'text-center', field: 'num' },
  143. { width: 100, text: '时间段', flex: true, colClass: 'text-center', field: 'check_task_time_name' },
  144. { width: 80, text: '扣分人', flex: true, colClass: 'text-center', field: 'checked_name' },
  145. { width: 40, text: '扣分数', flex: true, colClass: 'text-center', field: 'score', nullvalue: '0' },
  146. { width: 100, text: '考核类型', flex: true, colClass: 'text-center', sort: 'down', field: 'parent_name' },
  147. { width: 100, text: '考核项', flex: true, colClass: 'text-center', sort: 'down', field: 'name' },
  148. { width: 100, text: '扣分凭证', type: 'imagedd', flex: true, hide: hide, field: 'pics' },
  149. ];
  150. if (cur_status == 12 || cur_status == 13) {
  151. data.check_status_arr = [12, 13];
  152. }
  153. $('#personal_data_table').mytable({
  154. 'cols': cols,
  155. 'url': "/statistics/one/checkedItem/detail/info",
  156. 'param': data
  157. });
  158. }
  159. })
  160. }
  161. //*************************************画图******************************************
  162. // 加载图配置
  163. echart();
  164. $(".query button").click(function() {
  165. var user_id = $("#select-personal").val();
  166. var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
  167. var end_date = $(".div-end input").val() + " 23:00:00";
  168. var startStr = start_date.replace(/-/g, '/');
  169. var endStr = end_date.replace(/-/g, '/');
  170. var start = new Date(startStr);
  171. var end = new Date(endStr);
  172. if (start > end) {
  173. tip("开始时间不能比结束时间大");
  174. return;
  175. }
  176. if ($("#select-personal").text() == '') {
  177. tip("请选择收费站");
  178. return;
  179. }
  180. // 查询图一
  181. init_personal_score_statistics("statistics/one/person/year/info", user_id);
  182. // 查询图二
  183. init_personal_check_type("statistics/one/person/checkedItem/info", user_id, start_date, end_date);
  184. // 表格
  185. initAppealPage(start_date, end_date, user_id);
  186. // 加载图配置
  187. echart();
  188. });
  189. /**
  190. * 初始化图一
  191. * @param {*} url
  192. * @param {*} dept_id
  193. */
  194. function init_personal_score_statistics(url, user_id) {
  195. var end_date = $(".div-end input").val() + " 23:00:00";
  196. var date = moment(end_date);
  197. var y = date.get('y');
  198. var m = date.get('M') + 1;
  199. x_m_array = new Array();
  200. for (var i = 1; i <= 12; i++) {
  201. var month = parseInt(m) + i;
  202. var starty = parseInt(y) - 1
  203. if (month > 12) {
  204. month = month - 12;
  205. starty = y;
  206. }
  207. x_m_array.push(starty + "/" + (month >= 10 ? month : ("0" + month)));
  208. }
  209. var param = {
  210. "start_date": (y - 1) + "-" + new Date().getMonth() + "-25" + " 23:00:00",
  211. "end_date": y + "-" + (new Date().getMonth() + 1) + "-25" + " 23:00:00",
  212. "user_id": user_id
  213. }
  214. initRqueset(url, param, 1);
  215. }
  216. /**
  217. * 初始化图二
  218. * @param {*} url
  219. * @param {*} dept_id
  220. */
  221. function init_personal_check_type(url, user_id, start_date, end_date) {
  222. var param = {
  223. "start_date": start_date,
  224. "end_date": end_date,
  225. "user_id": user_id
  226. }
  227. initRqueset(url, param, 2);
  228. }
  229. /**
  230. * 请求
  231. * @param {*} url
  232. * @param {*} param
  233. * @param {*} type
  234. */
  235. function initRqueset(url, param, type) {
  236. post_common_service(url, param, function(data) {
  237. data_array(data, type);
  238. if (type == 1) {
  239. // 画图
  240. score_statistics.setOption(personal_score_statistics());
  241. } else if (type == 2) {
  242. // 画图
  243. check_type.setOption(personal_check_type());
  244. }
  245. }, function(error) {
  246. return "";
  247. });
  248. }
  249. function getsymbol(score) {
  250. var sy = 'emptyCircle';
  251. var col = 'green'
  252. if (score == 1000) {
  253. sy = "emptystar"
  254. col = 'red'
  255. } else
  256. if (score > 990) {
  257. sy = "emptystar"
  258. col = 'orange'
  259. } else {
  260. sy = "emptyTriangle"
  261. col = 'green'
  262. }
  263. // itemStyle: { // 数据级个性化折线样式
  264. // normal: {
  265. // color: 'yellowgreen'
  266. // },
  267. // }
  268. return { value: (score), symbol: sy, symbolSize: 5, itemStyle: { normal: { color: col } } };
  269. }
  270. /**
  271. * 数组数据
  272. * @param {*} data
  273. * @param {*} type
  274. */
  275. function data_array(data, type) {
  276. if (type == 1) {
  277. array_year_score.length = 0;
  278. if (data != '' && data.length != 0) {
  279. x_m_array_temp = new Array();
  280. for (var i = 0; i < x_m_array.length; i++) {
  281. var index = -1;
  282. for (var j = 0; j < data.length; j++) {
  283. if (x_m_array[i] == data[j].mth) {
  284. index = j;
  285. break;
  286. }
  287. }
  288. if (index < 0) {
  289. } else {
  290. x_m_array_temp.push(x_m_array[i]);
  291. var score = (1000 - (filter(data[index].all_check_score, data[index].checked_num, 1.0, 0)));
  292. var data_s = getsymbol(score)
  293. // console.log(data_s)
  294. array_year_score.push(data_s);
  295. }
  296. }
  297. } else {
  298. array_year_score.length = 0;
  299. x_m_array = new Array();
  300. x_m_array_temp = new Array();
  301. }
  302. // months.length = 0;
  303. // if (data.length != 0) {
  304. // if (data.length < 14) {
  305. // for (var i = 0; i < 14 - data.length; i++) {
  306. // array_year_score.push(0)
  307. // }
  308. // }
  309. // var month_arr = month_method_2();
  310. // for (var i = 0; i < data.length; i++) {
  311. // if (month_arr.indexOf(parseInt(data[i].mth))) {
  312. // // 指定位置插入值
  313. // array_year_score.splice(month_arr.indexOf(data[i].mth), 0,
  314. // (1000 - (filter(data[i].all_check_score, data[i].checked_num, 0))));
  315. // }
  316. // }
  317. // } else {
  318. // array_year_score.length = 0;
  319. // }
  320. } else if (type == 2) {
  321. array_points = new Array();
  322. array_points2 = new Array();
  323. var map = new HashMap();
  324. if (data.length != 0) {
  325. for (var i = 0; i < data.length; i++) {
  326. if (typeof(data[i].all_check_score) == "undefined" || data[i].all_check_score == null) continue;
  327. if (map.get(data[i].name) == null) {
  328. map.set(data[i].name, data[i].all_check_score);
  329. } else {
  330. map.set(data[i].name, map.get(data[i].name) + data[i].all_check_score);
  331. }
  332. array_points2.push({ "value": (data[i].all_check_score), "name": data[i].checked_name + ($("#select-personal").val() == data[i].user_id ? "" : "(组员)") + " " + data[i].name, "itemStyle": { "normal": { "color": getchildColor(data[i].name, i).hexStr() } } });
  333. }
  334. }
  335. map.forEach(function(value, key) {
  336. array_points.push({ "value": value, "name": key, "itemStyle": { "normal": { "color": getColor(key).hexStr() } } });
  337. });
  338. // array_points.push({ "value": (data.total0), "name": '满分', "itemStyle": { "normal": { "color": '#48CCCD' } } });
  339. // array_points.push({ "value": data.total15, "name": '0-15分', "itemStyle": { "normal": { "color": '#38ACEC' } } });
  340. // array_points.push({ "value": data.total50, "name": '15-50分', "itemStyle": { "normal": { "color": '#FFD801' } } });
  341. // array_points.push({ "value": data.totalOver50, "name": '50分以上', "itemStyle": { "normal": { "color": '#7F38EC' } } });
  342. // array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
  343. // array_check_type.length = 0;
  344. // if (data.length != 0) {
  345. // for (var i = 0; i < data.length; i++) {
  346. // array_check_type.push({ "value": data[i].all_check_score, "name": data[i].name });
  347. // }
  348. // } else {
  349. // array_check_type.length = 0;
  350. // }
  351. }
  352. }
  353. $("#select-personal").click(function() {
  354. if ($("#select-personal").text() == '') {
  355. tip("请选择收费站");
  356. return;
  357. }
  358. });
  359. var userid_t = $.zui.store.get("page_params").userid
  360. var dept_t = $.zui.store.get("page_params").deptid
  361. // 收费站下拉框
  362. var dept;
  363. if (roleContains("STATION")) {
  364. dept = getCurrentUser().organid;
  365. }
  366. if (dept_t) {
  367. dept = dept_t;
  368. }
  369. var roadManager;
  370. if (roleContains("ROAD_MANAGER")) {
  371. roadManager = getCurrentUser().organid;
  372. }
  373. var feeList = $.zui.store.get("cache_fee_station_list");
  374. if (roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
  375. setFeeSelectValueNoAll(feeList, "#select-dept", dept);
  376. setSecond();
  377. /**
  378. * 部门人员下拉框
  379. */
  380. function setSecond() {
  381. var select_road = $("#select-dept").val();
  382. var sec = document.getElementById('select-personal');
  383. var tempStr = ''
  384. var param = {
  385. "organid": select_road
  386. }
  387. post_common_service("user/getFsUserList", param, function(data) {
  388. if (data.length != 0) {
  389. var userId;
  390. if (hasRole("ROLE_STATION")) {
  391. userId = getCurrentUser().id;
  392. }
  393. if (userid_t) {
  394. userId = userid_t;
  395. }
  396. for (var i = 0; i < data.length; i++) {
  397. for (var j = 33; j <= 53; j++) {
  398. if (select_road == j) {
  399. if (data[i].id == userId) {
  400. tempStr += "<option value=" + data[i].id + " selected='selected'>" + data[i].truename + "</option>";
  401. } else {
  402. tempStr += "<option value=" + data[i].id + ">" + data[i].truename + "</option>";
  403. }
  404. }
  405. }
  406. sec.innerHTML = tempStr;
  407. }
  408. } else {
  409. sec.innerHTML = '';
  410. }
  411. // 请求数据
  412. getInit();
  413. }, function(error) {
  414. return "";
  415. });
  416. }
  417. function getInit() {
  418. var start_date = dateChange(moment($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
  419. var end_date = $(".div-end input").val() + " 23:00:00";
  420. var user_id = $("#select-personal").val();
  421. // 页面初始化
  422. echart();
  423. initAppealPage(start_date, end_date, user_id);
  424. init_personal_score_statistics("statistics/one/person/year/info", user_id);
  425. init_personal_check_type("statistics/one/person/checkedItem/info", user_id, start_date, end_date);
  426. }
  427. $("#select-dept").change(function() {
  428. setSecond();
  429. });
  430. $("#select-personal").change(function() {
  431. getInit();
  432. })
  433. /**
  434. * 除数为0处理
  435. * @param {*} num
  436. * @param {*} num1
  437. * @param {*} num2
  438. * @param {*} num4
  439. */
  440. function filter(num, num1, num2) {
  441. if (num1 == 0) {
  442. return num2;
  443. } else {
  444. return (num / num1).toFixed(2);
  445. }
  446. }
  447. function echart() {
  448. // 路径配置
  449. require.config({
  450. paths: {
  451. echarts: '/js/lib/echarts/build/dist'
  452. }
  453. });
  454. // 使用
  455. require(
  456. [
  457. 'echarts',
  458. 'echarts/theme/macarons',
  459. 'echarts/chart/line',
  460. 'echarts/chart/pie'
  461. ],
  462. function(ec, theme) {
  463. // 基于准备好的dom,初始化echarts图表
  464. score_statistics = ec.init(document.getElementById('personal-score-statistics'), theme);
  465. check_type = ec.init(document.getElementById('personal-check-type'), theme);
  466. }
  467. );
  468. }
  469. /**
  470. * 图一
  471. */
  472. function personal_score_statistics() {
  473. option = {
  474. color: ['#00ced1'],
  475. tooltip: {
  476. trigger: 'axis'
  477. },
  478. noDataLoadingOption: {
  479. text: '暂无数据',
  480. effect: 'bubble',
  481. effectOption: {
  482. effect: {
  483. n: 0 //气泡个数为0
  484. }
  485. },
  486. textStyle: {
  487. fontSize: 20,
  488. fontFamily: 'cursive',
  489. fontWeight: 'bold'
  490. }
  491. },
  492. grid: {
  493. width: "75%"
  494. },
  495. legend: {
  496. data: ['平均分']
  497. },
  498. toolbox: {
  499. show: true,
  500. },
  501. calculable: true,
  502. xAxis: [{
  503. type: 'category',
  504. boundaryGap: false,
  505. data: x_m_array_temp
  506. }],
  507. yAxis: [{
  508. type: 'value',
  509. min: 700,
  510. max: 1000,
  511. axisLabel: {
  512. formatter: '{value}'
  513. }
  514. }],
  515. series: [{
  516. name: '平均分',
  517. type: 'line',
  518. data: array_year_score,
  519. // markPoint: {
  520. // data: [
  521. // { type: 'max', name: '最大值' },
  522. // { type: 'min', name: '最小值' }
  523. // ]
  524. // },
  525. // markLine: {
  526. // data: [
  527. // { type: 'average', name: '平均值' }
  528. // ]
  529. // }
  530. },
  531. ]
  532. };
  533. return option;
  534. }
  535. /**
  536. * 图二
  537. */
  538. function personal_check_type() {
  539. // option = {
  540. // tooltip: {
  541. // trigger: 'item',
  542. // formatter: "个人服务检查问题占比 <br/>{b} : {c}分 ({d}%)"
  543. // },
  544. // noDataLoadingOption: {
  545. // text: '暂无数据',
  546. // effect: 'bubble',
  547. // effectOption: {
  548. // effect: {
  549. // n: 0 //气泡个数为0
  550. // }
  551. // },
  552. // textStyle: {
  553. // fontSize: 20,
  554. // fontFamily: 'cursive',
  555. // fontWeight: 'bold'
  556. // }
  557. // },
  558. // toolbox: {
  559. // show: true,
  560. // feature: {
  561. // magicType: {
  562. // type: ['pie', 'funnel'],
  563. // option: {
  564. // funnel: {
  565. // x: '25%',
  566. // width: '50%',
  567. // funnelAlign: 'left',
  568. // max: 1548
  569. // }
  570. // }
  571. // },
  572. // }
  573. // },
  574. // calculable: true,
  575. // series: [{
  576. // name: '访问来源',
  577. // type: 'pie',
  578. // radius: '55%',
  579. // center: ['50%', '50%'],
  580. // data: array_check_type,
  581. // itemStyle: {
  582. // normal: {
  583. // label: {
  584. // show: true,
  585. // formatter: '{b} :\n{c}分 ({d}%)'
  586. // },
  587. // labelLine: { show: true }
  588. // }
  589. // }
  590. // }]
  591. // };
  592. option = {
  593. tooltip: {
  594. trigger: 'item',
  595. formatter: "个人温馨服务检查问题类别占比 <br/>{b} : {c}分 ({d}%)"
  596. },
  597. noDataLoadingOption: {
  598. text: '暂无数据',
  599. effect: 'bubble',
  600. effectOption: {
  601. effect: {
  602. n: 0 //气泡个数为0
  603. }
  604. },
  605. textStyle: {
  606. fontSize: 20,
  607. fontFamily: 'cursive',
  608. fontWeight: 'bold'
  609. }
  610. },
  611. toolbox: {
  612. show: true,
  613. },
  614. calculable: false,
  615. series: [{
  616. name: '访问来源',
  617. type: 'pie',
  618. selectedMode: 'single',
  619. radius: [0, 80],
  620. // for funnel
  621. x: '20%',
  622. width: '40%',
  623. funnelAlign: 'right',
  624. max: 1548,
  625. itemStyle: {
  626. normal: {
  627. label: {
  628. show: true,
  629. formatter: '{b}:\n{c}分({d}%)',
  630. textStyle: {
  631. alias: 'center',
  632. fontSize: 10,
  633. color: '#888'
  634. }
  635. },
  636. labelLine: {
  637. show: true,
  638. length: 80,
  639. lineStyle: {
  640. color: '#888'
  641. }
  642. }
  643. }
  644. },
  645. data: array_points
  646. },
  647. {
  648. name: '访问来源',
  649. type: 'pie',
  650. radius: [100, 125],
  651. // for funnel
  652. x: '60%',
  653. width: '35%',
  654. funnelAlign: 'left',
  655. max: 1048,
  656. itemStyle: {
  657. normal: {
  658. label: {
  659. show: false,
  660. formatter: '{b}:{c}人({d}%)'
  661. },
  662. labelLine: {
  663. show: false
  664. }
  665. }
  666. },
  667. data: array_points2
  668. }
  669. ]
  670. };
  671. return option;
  672. }
  673. });
  674. function setVisit() {
  675. if (roleContains("STATION")) {
  676. $("#select-dept").attr("disabled", "disabled");
  677. }
  678. if (hasRole("ROLE_STATION")) {
  679. $("#select-personal").attr("disabled", "disabled");
  680. }
  681. }
  682. function getColor(name) {
  683. var color = new $.zui.Color('#52D017');
  684. switch (name) {
  685. case "环境卫生":
  686. { color = new $.zui.Color('#52D017'); break; }
  687. case "仪容仪表着装":
  688. { color = new $.zui.Color('#00FFFF'); break; }
  689. case "动作":
  690. { color = new $.zui.Color('#7F38EC'); break; }
  691. case "表情":
  692. { color = new $.zui.Color('#FFA500'); break; }
  693. case "文明用语":
  694. { color = new $.zui.Color('#0000A0'); break; }
  695. case "环境卫生":
  696. { color = new $.zui.Color('#52D017'); break; }
  697. case "工作纪律及行为举止":
  698. { color = new $.zui.Color('#48CCCD'); break; }
  699. case "便民服务":
  700. { color = new $.zui.Color('#FFFF00'); break; }
  701. case "安全管理":
  702. { color = new $.zui.Color('#00FF00'); break; }
  703. }
  704. return color;
  705. }
  706. function getchildColor(name, p) {
  707. var color1 = getColor(name);
  708. var color = new $.zui.Color(color1.r - p * 20, color1.g - p * 20, color1.b - p * 20);
  709. return color;
  710. }