task-home.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="../css/mui.css" rel="stylesheet" />
  8. <link href="../css/app.css" rel="stylesheet" />
  9. <style>
  10. /* 顶部案件统计信息背景样式 */
  11. .wc-top-back{
  12. position: relative;
  13. width: calc(100% - 10px);
  14. height: 300px;
  15. background-color: '#000000';
  16. margin: 5px;
  17. border: solid 1px #d8d8d8;
  18. border-radius: 5px;
  19. }
  20. /* 顶部统计柱状图样式 */
  21. .wc-top-chart{
  22. width: 100%;
  23. height: calc(100% - 40px);
  24. }
  25. /* 顶部下侧统计信息背景样式 */
  26. .wc-top-info-back{
  27. width: 100%;
  28. height: 40px;
  29. border-top: solid 1px #d8d8d8;
  30. }
  31. /* 顶部下侧统计信息子项样式 */
  32. .wc-top-info-sub{
  33. width: 50%;
  34. float: left;
  35. height: 40px;
  36. line-height: 40px;
  37. text-align: center;
  38. font-size: 14px;
  39. font-weight: bold;
  40. }
  41. /* 富字体样式 */
  42. font{
  43. color: blue;
  44. }
  45. /* 九宫格图片外部背景样式 */
  46. .wc-li-img-back{
  47. width: 40px;
  48. height: 40px;
  49. line-height: 40px;
  50. text-align: center;
  51. padding: 0px;
  52. border-radius: 5px;
  53. background: -moz-linear-gradient(top,#0f7dee,#03c1fb);
  54. background: -webkit-linear-gradient(top,#0f7dee,#03c1fb);
  55. }
  56. /* 九宫格子项内部图片样式 */
  57. .wc-li-img-back span{
  58. width: 30px;
  59. height: 30px;
  60. font-size: 10px;
  61. color: #FFFFFF;
  62. }
  63. /* 菜单容器样式 */
  64. .wc-menu-content{
  65. position: absolute;
  66. width: 100%;
  67. bottom: 0px;
  68. top:305px;
  69. }
  70. </style>
  71. </head>
  72. <body>
  73. <div class="mui-content">
  74. <div class="wc-top-back">
  75. <div id="barChart" class="wc-top-chart"></div>
  76. <div class="wc-top-info-back">
  77. <div class="wc-top-info-sub">派发处理率<font><label id="lblCheck">0.00%</label></font>
  78. </div>
  79. <div class="wc-top-info-sub">审核结案率<font><label id="lblClose">0.00%</label></font>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="wc-menu-content">
  84. <div class="mui-scroll-wrapper">
  85. <ul class="mui-table-view mui-grid-view mui-grid-9" id="menuGrid">
  86. </ul>
  87. </div>
  88. </div>
  89. </div>
  90. <script src="../js/mui.js"></script>
  91. <script src="../js/echarts-all.js"></script>
  92. <script src="../js/case.js"></script>
  93. <script src="../js/common.js"></script>
  94. <!--引入存储读取通用脚本-->
  95. <script src="../js/save.js"></script>
  96. <!--引入图表通用脚本-->
  97. <script src="../js/echarts-common.js"></script>
  98. <script type="text/javascript">
  99. /* DOM定义 */
  100. var ul = document.getElementById("menuGrid");
  101. var domLblCheck = document.getElementById("lblCheck");
  102. var domLblClose = document.getElementById("lblClose");
  103. /* 变量定义 */
  104. var subPages = [];
  105. var subPageStyles = [];
  106. var userInfo = null;
  107. /* mui初始化 */
  108. mui.init();
  109. /* 设置菜单滚动条 */
  110. mui('.mui-scroll-wrapper').scroll({
  111. scrollY: true,
  112. indicators: false,
  113. });
  114. /* 九宫格点击事件 */
  115. mui('.mui-grid-9').on('tap', 'a', function(e) {
  116. var tag = this.getAttribute('href');
  117. var subPageWindowID = subPages[tag]; //子页面的ID标识
  118. var subPageURL = subPages[tag]; //子页面的URL
  119. var subPageStyle = subPages[tag]; //子页面导航栏的样式
  120. // mui.openWindow({
  121. // id: subPageWindowID,
  122. // url: subPageURL,
  123. // styles: subPageStyle,
  124. // show: {
  125. // aniShow: 'slide-in-right',
  126. // duration: 300
  127. // },
  128. // waiting: {
  129. // autoShow: false,
  130. // }
  131. // });
  132. mui.openWindow(subPageWindowID);
  133. });
  134. /*设置顶部导航栏*/
  135. mui.plusReady(function() {
  136. /* 子页面初始化 */
  137. AppendSubpageConfig('task-waitcheck.html');
  138. AppendSubpageConfig('task-waitrepeat.html');
  139. AppendSubpageConfig('task-waitverify.html');
  140. AppendSubpageConfig('task-close.html');
  141. AppendSubpageConfig('task-waitassign.html');
  142. AppendSubpageConfig('task-undoassign.html');
  143. /* 获取当前页面 */
  144. var self = plus.webview.currentWebview();
  145. alert(self);
  146. //设置导航栏
  147. plusSetNavbar("主页", false);
  148. /* 获取存储的用户登录信息 */
  149. getSaveUserInfo({
  150. success:function(userInfo){
  151. //获取用户类型
  152. var strUserType = userInfo.userType;
  153. //创建菜单前清除原有菜单内容
  154. ul.innerHTML = "";
  155. //创建默认菜单
  156. CreateDefaultMenu();
  157. //创建动态菜单
  158. CreateDynamicMenu(strUserType);
  159. /* 展示统计图表 */
  160. var barChart = echarts.init(document.getElementById('barChart'));
  161. echartsCreateCount(userInfo, function(option,checkRate,closeRate) {
  162. barChart.setOption(option);
  163. domLblCheck.innerHTML = checkRate;
  164. domLblClose.innerHTML = closeRate;
  165. });
  166. },
  167. error:function(err){
  168. muiAlertError(err);
  169. }
  170. });
  171. });
  172. /**
  173. * @param {Object} title 菜单标题
  174. * @param {Object} icoName 图标的类名称
  175. * @param {Object} tag 页面标识
  176. */
  177. function CreateMenu(title, icoName, tag) {
  178. var li = document.createElement('li');
  179. li.className = 'mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3';
  180. var strHtml = "<a href='" + tag + "'>";
  181. strHtml += "<div class='wc-li-img-back mui-icon'>";
  182. strHtml += "<span class='mui-icon app-icon " + icoName + "' style='font-size:30px'></span>"
  183. strHtml += "</div>"
  184. strHtml += "<div class='mui-media-body'>" + title + "</div>"
  185. strHtml += "</a>";
  186. li.innerHTML = strHtml;
  187. ul.appendChild(li);
  188. }
  189. /**
  190. * 创建通用菜单
  191. */
  192. function CreateDefaultMenu() {
  193. CreateMenu('待处理', 'app-cion-menu-waitcheck', 0);
  194. CreateMenu('待复飞', 'app-cion-menu-waitrepeat', 1);
  195. CreateMenu('审核中', 'app-cion-menu-waitverify', 2);
  196. CreateMenu('已结案', 'app-cion-menu-close', 3);
  197. }
  198. /**
  199. * 创建动态菜单
  200. * @param {Object} strUserType
  201. */
  202. function CreateDynamicMenu(strUserType) {
  203. if (strUserType == userType.memberCL) {
  204. } else if (strUserType == userType.memberSH) {
  205. CreateMenu('案件派发', 'app-cion-menu-assign', 4);
  206. CreateMenu('案件撤派', 'app-cion-menu-undoassign', 5);
  207. } else if (strUserType == userType.memberLD) {
  208. CreateMenu('案件督办', 'app-cion-menu-supervise', '');
  209. } else {
  210. }
  211. }
  212. /**
  213. * 添加子页面的配置项
  214. * @param {Object} pageHtmlName 页面HTML文件名称
  215. */
  216. function AppendSubpageConfig(pageHtmlName) {
  217. subPages.push(pageHtmlName);
  218. subPageStyles.push({
  219. "titleNView": {
  220. backgroundColor: colorBackground,
  221. titleColor: colorTitle
  222. },
  223. top: '0px',
  224. bottom: '51px'
  225. });
  226. /* 全部预先加载页面 试验阶段 */
  227. var subPage = plus.webview.create(pageHtmlName,pageHtmlName,{
  228. "titleNView": {
  229. backgroundColor: colorBackground,
  230. titleColor: colorTitle
  231. },
  232. top: '0px',
  233. bottom: '51px'
  234. });
  235. subPage.addEventListener('show',function(obj){
  236. printToConsole(obj.target + '显示');
  237. })
  238. subPage.hide();
  239. }
  240. </script>
  241. </body>
  242. </html>