bjtx.js 12 KB

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