page-case-count.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 引入mui的css样式 -->
  9. <link href="../css/mui.css" rel="stylesheet" />
  10. <!-- 引入app样式 -->
  11. <link rel="stylesheet" type="text/css" href="../css/app.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/app.new.css">
  13. <!-- 引入字体 -->
  14. <link rel="stylesheet" type="text/css" href="../fonts/TTTGB-Medium.css" />
  15. <link rel="stylesheet" type="text/css" href="../fonts/font-time.css" />
  16. <link rel="stylesheet" type="text/css" href="../fonts/font-jt.css">
  17. <!-- 本页独有样式 -->
  18. <style type="text/css">
  19. /* 通用样式 */
  20. html,
  21. body {
  22. height: 100%;
  23. background-color: rgba(0, 0, 0, 0.5);
  24. }
  25. /* 整体容器样式 */
  26. .divContentPanel {
  27. position: absolute;
  28. /* background-color: antiquewhite; */
  29. display: flex;
  30. flex-direction: column;
  31. height: calc(100% - 100px);
  32. width: 90%;
  33. margin-top: 50px;
  34. margin-left: calc(calc(10%)/2);
  35. }
  36. /* 主要内容容器样式 */
  37. .divContent {
  38. flex: 1;
  39. background-color: rgba(24, 35, 73, 1.0);
  40. border-radius: 10px;
  41. overflow-y: auto;
  42. }
  43. /* 强制修改mui-btn样式 */
  44. .mui-btn {
  45. margin-top: 10px;
  46. margin-bottom: 10px;
  47. margin-left: 20px;
  48. margin-right: 20px;
  49. }
  50. /* 强制mui的行样式 */
  51. .mui-row {
  52. margin-bottom: 5px;
  53. }
  54. /* 标题行样式 */
  55. .cr-row-title {
  56. height: 40px;
  57. line-height: 40px;
  58. background-color: rgb(27, 38, 80);
  59. border-radius: 10px 10px 0px 0px;
  60. text-align: center;
  61. color: rgb(255, 255, 255);
  62. font-size: 16px;
  63. font-family: 'TTTGB-Medium' !important;
  64. }
  65. /* 图表行样式 */
  66. .cr-row-charts {
  67. margin-top: 5px !important;
  68. height: 260px;
  69. line-height: 260px;
  70. background-color: rgba(42, 61, 133, 0.0);
  71. }
  72. /* 统计列表行容器样式 */
  73. .cr-row-list {
  74. height: 50px;
  75. line-height: 50px;
  76. background-color: rgb(255, 255, 255);
  77. display: flex;
  78. flex-direction: row;
  79. }
  80. /* 统计行-左侧样式 */
  81. .cr-row-list-left {
  82. width: 120px;
  83. display: flex;
  84. align-items: center;
  85. }
  86. /* 统计行左侧-标题样式 */
  87. .cr-row-list-left>div {
  88. flex: 1;
  89. background-color: rgb(121, 182, 251);
  90. height: 70%;
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. border-radius: 0px 25px 25px 0px;
  95. font-size: 14px;
  96. color: rgb(255, 255, 255);
  97. }
  98. /* 统计行-右侧样式 */
  99. .cr-row-list-right {
  100. flex: 1;
  101. display: flex;
  102. flex-direction: column;
  103. height: 100%;
  104. }
  105. /* 统计行-子行样式 */
  106. .cr-row-list-subrow {
  107. flex: 1;
  108. display: flex;
  109. flex-direction: row;
  110. }
  111. /* 统计行-子行div样式 */
  112. .cr-row-list-subrow div {
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. flex: 1;
  117. font-size: 13px;
  118. height: 100%;
  119. line-height: 100%;
  120. color: rgb(255, 255, 255);
  121. }
  122. /* 统计行-子行-标题行样式 */
  123. .cr-row-list-subrow-title {}
  124. /* 统计行-子行-值行样式 */
  125. .cr-row-list-subrow-value div {
  126. font-family: 'UnidreamLED' !important;
  127. font-size: 16px !important;
  128. color: rgb(135, 219, 153);
  129. }
  130. /* 统计行-子行-值行-第一个div样式 */
  131. .cr-row-list-subrow-value>div:nth-child(1) {
  132. color: rgb(206, 65, 152);
  133. }
  134. .cr-row-list-subrow-value>div:nth-child(2) {
  135. color: rgb(255, 0, 0);
  136. }
  137. .cr-row-list-subrow-value>div:nth-child(5) {
  138. color: rgb(0, 255, 0);
  139. }
  140. /* 统计图样式 */
  141. .divCountBar {
  142. width: 100%;
  143. height: 100%;
  144. background-color: rgba(42, 61, 133, 1.0);
  145. }
  146. /* 按钮样式 */
  147. .mui-btn-primary {
  148. background-color: rgba(42, 61, 133, 1.0);
  149. border: solid 0px rgb(255, 255, 255);
  150. }
  151. </style>
  152. </head>
  153. <body>
  154. <div class="divContentPanel">
  155. <div class="divContent">
  156. <!-- 统计标题栏 -->
  157. <div class="mui-row cr-row-title">案件信息统计</div>
  158. <!-- 统计图表容器 -->
  159. <div class="mui-row cr-row-charts"></div>
  160. <!-- 统计列表容器 -->
  161. <div id="divCountList"></div>
  162. </div>
  163. <button type="button" class="mui-btn mui-btn-primary" onclick="EventClick_Close()">确定</button>
  164. </div>
  165. </body>
  166. </html>
  167. <!-- 引入mui脚本 -->
  168. <script src="../js/mui.js" type="text/javascript" charset="utf-8"></script>
  169. <!-- 引入jquery脚本 -->
  170. <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
  171. <!-- 引入存储脚本 -->
  172. <script src="../js/save.js" type="text/javascript" charset="utf-8"></script>
  173. <!-- 引入网络脚本 -->
  174. <script src="../js/ajax.js" type="text/javascript" charset="utf-8"></script>
  175. <!-- 引入通用脚本 -->
  176. <script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
  177. <!-- 引入图表脚本 -->
  178. <script src="../js/ECharts/echarts.js" type="text/javascript" charset="utf-8"></script>
  179. <!-- 引入自定义图表脚本 -->
  180. <script src="../js/CRECharts.js" type="text/javascript" charset="utf-8"></script>
  181. <!-- 引入webview脚本 -->
  182. <script src="../js/webview.js" type="text/javascript" charset="utf-8"></script>
  183. <!-- 本页独有脚本 -->
  184. <script type="text/javascript">
  185. /* mui初始化 */
  186. mui.init();
  187. /* 本地存储的用户 */
  188. var joinUser = undefined;
  189. /* 统计数据 */
  190. var countData = [];
  191. /* 初始化完成 */
  192. plusInit(function() {
  193. /* 获取存储的用户信息 */
  194. getSaveUserInfo({
  195. success: function(userInfo) {
  196. joinUser = userInfo;
  197. asyncCountData(function() {
  198. addCountBar();
  199. });
  200. },
  201. error: function(err) {
  202. muiAlertError(err);
  203. },
  204. });
  205. });
  206. /**
  207. * 同步远程统计数据
  208. * @param {function} callback 同步完成回调
  209. */
  210. function asyncCountData(callback) {
  211. sendAjax({
  212. type: 'post',
  213. waitMessage: '正在同步统计数据...',
  214. url: 'appQueryXzqCaseCount',
  215. data: {
  216. userId: joinUser.userID,
  217. type: 'all',
  218. },
  219. success: function(resData) {
  220. countData = [];
  221. for (var i = 0; i < resData.length; i++) {
  222. countData.push(resData[i]);
  223. }
  224. if (callback != undefined) callback();
  225. },
  226. error: function(err) {
  227. muiAlertError(err);
  228. }
  229. })
  230. }
  231. /**
  232. * 添加统计词条,此处为了通过回调+动画实现
  233. */
  234. function addCountList() {
  235. addCountItemToList(0);
  236. }
  237. /**
  238. * 添加一项到列表中
  239. * @param {int} index 当前添加的索引
  240. */
  241. function addCountItemToList(index) {
  242. if (index == countData.length) {
  243. return;
  244. }
  245. var data = countData[index];
  246. var divList = document.createElement('div');
  247. if (index % 2 == 0) {
  248. divList.className = 'mui-row cr-row-list jt-row-even-number';
  249. } else {
  250. divList.className = 'mui-row cr-row-list jt-row-odd-number';
  251. }
  252. var listHtml = "";
  253. listHtml += "<div class='cr-row-list-left'>";
  254. listHtml += "<div>" + data.xzqName + "</div>";
  255. listHtml += "</div>";
  256. listHtml += "<div class='cr-row-list-right'>";
  257. listHtml += "<div class='cr-row-list-subrow cr-row-list-subrow-title'>";
  258. listHtml += "<div>总案件</div>";
  259. listHtml += "<div>处理中</div>";
  260. listHtml += "<div>复飞中</div>";
  261. listHtml += "<div>审核中</div>";
  262. listHtml += "<div>已结案</div>";
  263. listHtml += "</div>";
  264. listHtml += "<div class='cr-row-list-subrow cr-row-list-subrow-value'>";
  265. listHtml += "<div>" + (parseFloat(data.case_all) - parseFloat(data.wait_assign)) + "</div>";
  266. listHtml += "<div>" + data.wait_check + "</div>";
  267. listHtml += "<div>" + data.wait_flight + "</div>";
  268. listHtml += "<div>" + data.wait_verify + "</div>";
  269. listHtml += "<div>" + data.case_close + "</div>";
  270. listHtml += "</div>";
  271. listHtml += "</div>";
  272. divList.innerHTML = listHtml;
  273. $(divList).hide();
  274. $('#divCountList').append(divList);
  275. $(divList).slideDown(300, function() {
  276. addCountItemToList(index + 1);
  277. });;
  278. }
  279. /* 柱状图统计控件全局变量 */
  280. var objBarCaseCount = undefined;
  281. /**
  282. * 显示案件柱状图
  283. */
  284. function addCountBar() {
  285. /* 创建图表div */
  286. var divCharts = document.createElement('div');
  287. divCharts.className = 'divCountBar';
  288. divCharts.id = 'divCountTrendBar';
  289. $('.cr-row-charts').append(divCharts);
  290. $(divCharts).hide();
  291. $(divCharts).slideDown(300, function() {
  292. showCountBar(countData);
  293. });
  294. }
  295. /**
  296. * @param {Object} jsonData 统计数据
  297. */
  298. function showCountBar(jsonData) {
  299. /* 获取页面大小 */
  300. var pageSize = getPageSize();
  301. var dataZoomX = undefined;
  302. if (pageSize.width <= PageSize.smartSize) dataZoomX = true;
  303. var labels = [];
  304. var datas = [{
  305. name: '已派发',
  306. data: [],
  307. color: 'rgb(38,31,135)',
  308. }, {
  309. name: '处理中',
  310. data: [],
  311. color: 'rgb(241,25,39)',
  312. }, {
  313. name: '复飞中',
  314. data: [],
  315. color: 'rgb(247,184,31)',
  316. }, {
  317. name: '审核中',
  318. data: [],
  319. color: 'rgb(155,78,206)',
  320. }, {
  321. name: '已结案',
  322. data: [],
  323. color: 'rgb(30,125,22)',
  324. }];
  325. /* 循环数据和标签 */
  326. for (var i = 0; i < jsonData.length; i++) {
  327. var item = jsonData[i];
  328. var caseAll = getEChartsValue(item.case_all);
  329. if (caseAll >= 1) {
  330. labels.push(item.xzqName);
  331. var assign = getEChartsValue(parseFloat(item.case_all) - parseFloat(item.wait_assign));
  332. var waitCheck = getEChartsValue(item.wait_check);
  333. var waitFlight = getEChartsValue(item.wait_flight);
  334. var waitVerify = getEChartsValue(item.wait_verify);
  335. var close = getEChartsValue(item.case_close);
  336. datas[0].data.push(assign);
  337. datas[1].data.push(waitCheck);
  338. datas[2].data.push(waitFlight);
  339. datas[3].data.push(waitVerify);
  340. datas[4].data.push(close);
  341. }
  342. }
  343. /* 展示柱状图 */
  344. var bbsData = {
  345. title: '案件统计',
  346. labels: labels,
  347. datas: datas,
  348. xrotate: 45,
  349. gridBottom: 80,
  350. gridTop: 45,
  351. dataZoomX: dataZoomX,
  352. }
  353. if (objBarCaseCount != null && objBarCaseCount != "" && objBarCaseCount != undefined) objBarCaseCount.dispose();
  354. objBarCaseCount = new CrCharts({
  355. domId: 'divCountTrendBar',
  356. labelColor: 'rgb(255,255,255)',
  357. legendTextColor: 'rgb(255,255,255)',
  358. xAxisLineColor: 'rgba(255,255,255,1.0)',
  359. yAxisLineColor: 'rgb(133, 215, 253)',
  360. splitLineColor: 'rgba(255,255,255,0.3)',
  361. xAxisLabel: {
  362. color: "rgba(255,255,255,1.0)",
  363. fontSize: 12,
  364. fontFamily: 'TTTGB-Medium',
  365. interval: 0,
  366. },
  367. yAxisLabel: {
  368. color: "rgb(133, 215, 253)",
  369. fontSize: 12,
  370. fontFamily: 'TTTGB-Medium',
  371. interval: 0,
  372. },
  373. });
  374. objBarCaseCount.createVerticalBar(bbsData, 60, false, ['件', '件', '件', '件', '件']);
  375. /* 添加统计词条 */
  376. addCountList();
  377. }
  378. /**
  379. * 关闭窗口
  380. */
  381. function EventClick_Close() {
  382. mui.back();
  383. }
  384. </script>