bjtx.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. 'use strict';
  2. var app = angular.module('app', [
  3. 'angularUtils.directives.dirPagination'
  4. ]);
  5. app.controller("listCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
  6. var self = this;
  7. var s4 = new SM4Util();
  8. self.userId = $.cookie("GlWorkPlatform-userid");
  9. self.userName = $.cookie("GlWorkPlatform-chineseName");
  10. self.get_AccessToken = !localStorage.getItem("GlWorkPlatform-AccessToken") ? sp.getUrlName("token") : localStorage.getItem("GlWorkPlatform-AccessToken");
  11. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  12. self.type = sp.getUrlName("type");
  13. var postCfg = {
  14. headers: {
  15. 'Content-Type': 'application/json',
  16. 'Authorization': "Bearer " + self.get_AccessToken
  17. }
  18. }
  19. self.getData1 = function () {
  20. self.list1 = [];
  21. var data = {
  22. tablename: "XQPROJECT_DATEWEI_VIEW",
  23. colums: "*",
  24. order: "cmonth",
  25. sqlorwhere: "",
  26. sqlinwhere: "",
  27. sqllikewhere: ""
  28. };
  29. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", data, postCfg)
  30. .success(function (obj) {
  31. // var res = strToJson(s4.decryptData_CBC(obj.data));
  32. var res = obj;
  33. self.list1 = res.data;
  34. console.log(self.list1)
  35. var title = [], data = [];
  36. self.list1.forEach(function (item) {
  37. title.push(item.CMONTH);
  38. data.push(item.ICOUNT);
  39. })
  40. var chart = new Highcharts.Chart({
  41. chart: {
  42. renderTo: "line1",
  43. type: 'line',
  44. backgroundColor: {
  45. linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
  46. stops: [
  47. [0, '#fff'],
  48. [0.4, '#fff'],
  49. [1, '#E3F2FF']
  50. ]
  51. },
  52. },
  53. title: {
  54. text: '',
  55. },
  56. tooltip: {
  57. dateTimeLabelFormats: {
  58. millisecond: '%H:%M:%S.%L',
  59. second: '%H:%M:%S',
  60. minute: '%H:%M',
  61. hour: '%H:%M',
  62. day: '%Y-%m-%d',
  63. week: '%m-%d',
  64. month: '%Y-%m',
  65. year: '%Y'
  66. }
  67. },
  68. xAxis: {
  69. categories: title,
  70. },
  71. yAxis: {
  72. title: {
  73. text: ''
  74. },
  75. allowDecimals: false,
  76. lineWidth: 1,
  77. gridLineWidth: 1
  78. },
  79. legend: {
  80. enabled: false
  81. },
  82. plotOptions: {
  83. series: {
  84. turboThreshold: 0,
  85. cursor: 'pointer',
  86. dataLabels: {
  87. enabled: true,
  88. }
  89. }
  90. },
  91. series: [{
  92. name: "次数",
  93. data: data
  94. }],
  95. credits: {
  96. enabled: false//隐藏右下角网址
  97. },
  98. exporting: {
  99. enabled: false//隐藏右上角打印
  100. }
  101. })
  102. chart.setSize(null, 300)
  103. })
  104. }
  105. self.getData1()
  106. self.getData2 = function () {
  107. self.list2 = [];
  108. var data = {
  109. tablename: "XQPROJECT_DATEQUE_VIEW",
  110. colums: "*",
  111. order: "cmonth",
  112. sqlorwhere: "",
  113. sqlinwhere: "",
  114. sqllikewhere: ""
  115. };
  116. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", data, postCfg)
  117. .success(function (obj) {
  118. // var res = strToJson(s4.decryptData_CBC(obj.data));
  119. var res = obj;
  120. self.list2 = res.data;
  121. var title = [], data = [];
  122. self.list2.forEach(function (item) {
  123. title.push(item.CMONTH);
  124. data.push(item.ICOUNT);
  125. })
  126. var chart = new Highcharts.Chart({
  127. chart: {
  128. renderTo: "line2",
  129. type: 'line',
  130. backgroundColor: {
  131. linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
  132. stops: [
  133. [0, '#fff'],
  134. [0.4, '#fff'],
  135. [1, '#E3F2FF']
  136. ]
  137. },
  138. },
  139. title: {
  140. text: '',
  141. },
  142. tooltip: {
  143. dateTimeLabelFormats: {
  144. millisecond: '%H:%M:%S.%L',
  145. second: '%H:%M:%S',
  146. minute: '%H:%M',
  147. hour: '%H:%M',
  148. day: '%Y-%m-%d',
  149. week: '%m-%d',
  150. month: '%Y-%m',
  151. year: '%Y'
  152. }
  153. },
  154. xAxis: {
  155. categories: title,
  156. },
  157. yAxis: {
  158. title: {
  159. text: ''
  160. },
  161. allowDecimals: false,
  162. lineWidth: 1,
  163. gridLineWidth: 1
  164. },
  165. legend: {
  166. enabled: false
  167. },
  168. plotOptions: {
  169. series: {
  170. turboThreshold: 0,
  171. cursor: 'pointer',
  172. dataLabels: {
  173. enabled: true,
  174. }
  175. }
  176. },
  177. series: [{
  178. name: "次数",
  179. data: data
  180. }],
  181. credits: {
  182. enabled: false//隐藏右下角网址
  183. },
  184. exporting: {
  185. enabled: false//隐藏右上角打印
  186. }
  187. })
  188. chart.setSize(null, 300)
  189. })
  190. }
  191. self.getData2()
  192. self.getData3 = function () {
  193. self.list3 = [];
  194. var data = {
  195. tablename: "XQPROJECT_DATECHA_VIEW",
  196. colums: "*",
  197. order: "cmonth",
  198. sqlorwhere: "",
  199. sqlinwhere: "",
  200. sqllikewhere: ""
  201. };
  202. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", data, postCfg)
  203. .success(function (obj) {
  204. //var res = strToJson(s4.decryptData_CBC(obj.data));
  205. var res = obj;
  206. self.list3 = res.data;
  207. var title = [], data = [];
  208. self.list3.forEach(function (item) {
  209. title.push(item.CMONTH);
  210. data.push(item.ICOUNT);
  211. })
  212. var chart = new Highcharts.Chart({
  213. chart: {
  214. renderTo: "line3",
  215. type: 'line',
  216. backgroundColor: {
  217. linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
  218. stops: [
  219. [0, '#fff'],
  220. [0.4, '#fff'],
  221. [1, '#E3F2FF']
  222. ]
  223. },
  224. },
  225. title: {
  226. text: '',
  227. },
  228. tooltip: {
  229. dateTimeLabelFormats: {
  230. millisecond: '%H:%M:%S.%L',
  231. second: '%H:%M:%S',
  232. minute: '%H:%M',
  233. hour: '%H:%M',
  234. day: '%Y-%m-%d',
  235. week: '%m-%d',
  236. month: '%Y-%m',
  237. year: '%Y'
  238. }
  239. },
  240. xAxis: {
  241. categories: title,
  242. },
  243. yAxis: {
  244. title: {
  245. text: ''
  246. },
  247. allowDecimals: false,
  248. lineWidth: 1,
  249. gridLineWidth: 1
  250. },
  251. legend: {
  252. enabled: false
  253. },
  254. plotOptions: {
  255. series: {
  256. turboThreshold: 0,
  257. cursor: 'pointer',
  258. dataLabels: {
  259. enabled: true,
  260. }
  261. }
  262. },
  263. series: [{
  264. name: "次数",
  265. data: data
  266. }],
  267. credits: {
  268. enabled: false//隐藏右下角网址
  269. },
  270. exporting: {
  271. enabled: false//隐藏右上角打印
  272. }
  273. })
  274. chart.setSize(null, 300)
  275. })
  276. }
  277. self.getData3()
  278. self.getData4 = function () {
  279. self.list4 = [];
  280. var data = {
  281. tablename: "XQPROJECT_DATEZHI_VIEW",
  282. colums: "*",
  283. order: "cmonth",
  284. sqlorwhere: "",
  285. sqlinwhere: "",
  286. sqllikewhere: ""
  287. };
  288. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", data, postCfg)
  289. .success(function (obj) {
  290. // var res = strToJson(s4.decryptData_CBC(obj.data));
  291. var res = obj;
  292. self.list4 = res.data;
  293. var title = [], data = [];
  294. self.list4.forEach(function (item) {
  295. title.push(item.CMONTH);
  296. data.push(item.ICOUNT);
  297. })
  298. var chart = new Highcharts.Chart({
  299. chart: {
  300. renderTo: "line4",
  301. type: 'line',
  302. backgroundColor: {
  303. linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
  304. stops: [
  305. [0, '#fff'],
  306. [0.4, '#fff'],
  307. [1, '#E3F2FF']
  308. ]
  309. },
  310. },
  311. title: {
  312. text: '',
  313. },
  314. tooltip: {
  315. dateTimeLabelFormats: {
  316. millisecond: '%H:%M:%S.%L',
  317. second: '%H:%M:%S',
  318. minute: '%H:%M',
  319. hour: '%H:%M',
  320. day: '%Y-%m-%d',
  321. week: '%m-%d',
  322. month: '%Y-%m',
  323. year: '%Y'
  324. }
  325. },
  326. xAxis: {
  327. categories: title,
  328. },
  329. yAxis: {
  330. title: {
  331. text: ''
  332. },
  333. allowDecimals: false,
  334. lineWidth: 1,
  335. gridLineWidth: 1
  336. },
  337. legend: {
  338. enabled: false
  339. },
  340. plotOptions: {
  341. series: {
  342. turboThreshold: 0,
  343. cursor: 'pointer',
  344. dataLabels: {
  345. enabled: true,
  346. }
  347. }
  348. },
  349. series: [{
  350. name: "次数",
  351. data: data
  352. }],
  353. credits: {
  354. enabled: false//隐藏右下角网址
  355. },
  356. exporting: {
  357. enabled: false//隐藏右上角打印
  358. }
  359. })
  360. chart.setSize(null, 300)
  361. })
  362. }
  363. self.getData4()
  364. }])