5cc88e7551b1564c8ed0f04bcd5247e9f17aacf8_0.file.index.html.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <?php
  2. /* Smarty version 3.1.30, created on 2018-05-07 00:09:23
  3. from "D:\phpStudy\WWW\workorder\application\views\templates\warning\index.html" */
  4. /* @var Smarty_Internal_Template $_smarty_tpl */
  5. if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  6. 'version' => '3.1.30',
  7. 'unifunc' => 'content_5aef28b35bfb71_08907405',
  8. 'has_nocache_code' => false,
  9. 'file_dependency' =>
  10. array (
  11. '5cc88e7551b1564c8ed0f04bcd5247e9f17aacf8' =>
  12. array (
  13. 0 => 'D:\\phpStudy\\WWW\\workorder\\application\\views\\templates\\warning\\index.html',
  14. 1 => 1525622960,
  15. 2 => 'file',
  16. ),
  17. ),
  18. 'includes' =>
  19. array (
  20. ),
  21. ),false)) {
  22. function content_5aef28b35bfb71_08907405 (Smarty_Internal_Template $_smarty_tpl) {
  23. if (!is_callable('smarty_modifier_date_format')) require_once 'D:\\phpStudy\\WWW\\workorder\\application\\libraries\\smarty\\plugins\\modifier.date_format.php';
  24. ?>
  25. <!DOCTYPE html>
  26. <html lang="zh-CN">
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  29. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  30. <meta name="robots" content="noindex,nofollow">
  31. <title><?php echo $_smarty_tpl->tpl_vars['sys_name']->value;?>
  32. </title>
  33. <base href="<?php echo base_url();?>
  34. "/>
  35. <link href="static/css/bootstrap.min.css" rel="stylesheet">
  36. <link href="static/css/bootstrap-table.min.css" rel="stylesheet">
  37. <link href="static/css/select2.min.css" rel="stylesheet">
  38. <link href="static/js/skins/all.css" rel="stylesheet">
  39. <link rel="stylesheet" href="static/css/style.css">
  40. <?php echo '<script'; ?>
  41. language="javascript" type="text/javascript"> var SITE_URL = "/";<?php echo '</script'; ?>
  42. >
  43. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  44. <!--[if lt IE 9]>
  45. <?php echo '<script'; ?>
  46. src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.js"><?php echo '</script'; ?>
  47. >
  48. <?php echo '<script'; ?>
  49. src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"><?php echo '</script'; ?>
  50. >
  51. <![endif]-->
  52. </head>
  53. <body style="background: #fff;">
  54. <div style="padding:10px;">
  55. <div class="panel panel-default grid">
  56. <div class="panel-body">
  57. <form class="form-inline" role="form" method="get">
  58. <input type="hidden" name="page_size" value="<?php echo $_smarty_tpl->tpl_vars['page_size']->value;?>
  59. ">
  60. <div class="pull-left">
  61. <div class="btn-group">
  62. <button type="button" class="merge" id="create_workorder" disabled>
  63. 批量生成工单
  64. </button>
  65. <span class="btn_line"></span>
  66. <button type="button" class="igrone_btn" id="igrone_select" disabled>
  67. 批量忽略
  68. </button>
  69. <span class="btn_line"></span>
  70. <button type="button" class="refresh" onclick="window.location.reload();">
  71. 刷新
  72. </button>
  73. </div>
  74. </div>
  75. <div class="pull-right">
  76. <div class="form-group">
  77. <select class="form-control" style="width: 120px;" name="branch_id" id="branch_id">
  78. <option value="">所有分支机构</option>
  79. <?php
  80. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['branch']->value, 'val', false, 'k');
  81. if ($_from !== null) {
  82. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  83. ?>
  84. <option value="<?php echo $_smarty_tpl->tpl_vars['val']->value['branch_id'];?>
  85. " <?php if ($_smarty_tpl->tpl_vars['branch_id']->value == $_smarty_tpl->tpl_vars['val']->value['branch_id']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value['branch_name'];?>
  86. </option>
  87. <?php
  88. }
  89. }
  90. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  91. ?>
  92. </select>
  93. </div>
  94. <div class="form-group">
  95. <select class="form-control" name="type">
  96. <option value="">所有类型</option>
  97. <?php
  98. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['warning_type']->value, 'val', false, 'k');
  99. if ($_from !== null) {
  100. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  101. ?>
  102. <option value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  103. " <?php if ($_smarty_tpl->tpl_vars['type']->value == $_smarty_tpl->tpl_vars['k']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
  104. </option>
  105. <?php
  106. }
  107. }
  108. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  109. ?>
  110. </select>
  111. </div>
  112. <div class="form-group">
  113. <select class="form-control" name="status">
  114. <option value="">所有状态</option>
  115. <?php
  116. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['warning_status']->value, 'val', false, 'k');
  117. if ($_from !== null) {
  118. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  119. ?>
  120. <option value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  121. " <?php if ($_smarty_tpl->tpl_vars['status']->value == $_smarty_tpl->tpl_vars['k']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
  122. </option>
  123. <?php
  124. }
  125. }
  126. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  127. ?>
  128. </select>
  129. </div>
  130. <div class="form-group">
  131. <input class="form-control keyword" name="warning_name" id="warning_name" placeholder="筛选" type="text" value="<?php echo $_smarty_tpl->tpl_vars['warning_name']->value;?>
  132. ">
  133. <button type="submit" class="search">
  134. <i class="glyphicon glyphicon-search"></i>
  135. </button>
  136. </div>
  137. </div>
  138. </form>
  139. </div>
  140. <table id="data_table" data-toggle="table" data-search="true" class="table<?php if ($_smarty_tpl->tpl_vars['count']->value) {?> table-hover<?php }?> table-bordered">
  141. <thead>
  142. <tr>
  143. <th class="text-center" style="width: 40px;"><input name="check_all" class="check_all" value="true" type="checkbox"></th>
  144. <!--<th></th>-->
  145. <th class="text-center">告警名称</th>
  146. <th class="text-center">类型</th>
  147. <th class="text-center">等级</th>
  148. <th class="text-center">所属分支</th>
  149. <th class="text-center col-sm-2">内容</th>
  150. <th class="text-center" style="width: 180px;">时间</th>
  151. <th class="text-center">状态</th>
  152. <th class="text-center" style="width: 230px">操作</th>
  153. </tr>
  154. </thead>
  155. <tbody>
  156. <?php
  157. $_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['warning_list']->value, 'val', false, 'k');
  158. if ($_from !== null) {
  159. foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['val']->value) {
  160. ?>
  161. <tr>
  162. <td class="text-center"><input name="ids[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['warning_id'];?>
  163. " data-branch_id="<?php echo $_smarty_tpl->tpl_vars['val']->value['branch']['branch_id'];?>
  164. " type="checkbox" <?php if (intval($_smarty_tpl->tpl_vars['val']->value['status']) >= 20) {?>disabled<?php }?>></td>
  165. <td data-searchable="true"><?php echo $_smarty_tpl->tpl_vars['val']->value['warning_name'];?>
  166. </td>
  167. <td class="text-center" data-searchable="true"><span class="level warning_type<?php echo $_smarty_tpl->tpl_vars['val']->value['type'];?>
  168. "><?php echo $_smarty_tpl->tpl_vars['warning_type']->value[$_smarty_tpl->tpl_vars['val']->value['type']];?>
  169. </span></td> <!--失陷事件、脆弱性、残余攻击-->
  170. <td class="text-center"><span class="level level<?php ob_start();
  171. echo $_smarty_tpl->tpl_vars['val']->value['level'];
  172. $_prefixVariable1=ob_get_clean();
  173. echo $_prefixVariable1;?>
  174. "><?php echo $_smarty_tpl->tpl_vars['warning_level']->value[$_smarty_tpl->tpl_vars['val']->value['level']];?>
  175. </span></td> <!--已失陷、高可疑、高危、中危、低危-->
  176. <td data-searchable="true"><?php if (array_key_exists($_smarty_tpl->tpl_vars['val']->value['branch']['branch_id'],$_smarty_tpl->tpl_vars['branch']->value)) {
  177. echo $_smarty_tpl->tpl_vars['branch']->value[$_smarty_tpl->tpl_vars['val']->value['branch']['branch_id']]['branch_name'];
  178. } else { ?>未配置分支<?php }?></td>
  179. <td class="text_over col-sm-2"><?php echo $_smarty_tpl->tpl_vars['val']->value['content'];?>
  180. </td>
  181. <td class="text-center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['create_time']->toDateTime(),'%Y-%m-%d %H:%M:%S');?>
  182. </td>
  183. <td class="text-center"><span class="w_status<?php echo $_smarty_tpl->tpl_vars['val']->value['status'];?>
  184. "><?php echo $_smarty_tpl->tpl_vars['warning_status']->value[$_smarty_tpl->tpl_vars['val']->value['status']];?>
  185. </span></td> <!--待审核下发、已忽略-->
  186. <td class="text-left">
  187. <!--a href="<?php echo $_smarty_tpl->tpl_vars['val']->value['url'];?>
  188. " target="_blank">
  189. 查看详情
  190. </a-->
  191. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['warning_id'];?>
  192. " class="view_info">
  193. 查看详情
  194. </a>
  195. <?php if ($_smarty_tpl->tpl_vars['val']->value['status'] == 10) {?>
  196. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['warning_id'];?>
  197. " class="create_work_order">
  198. 生成工单
  199. </a>
  200. <a href="javascript:;" data-id="<?php echo $_smarty_tpl->tpl_vars['val']->value['warning_id'];?>
  201. " class="igrone">
  202. 忽略
  203. </a>
  204. <?php }?>
  205. </td>
  206. </tr>
  207. <?php
  208. }
  209. }
  210. $_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl);
  211. ?>
  212. <?php if (!$_smarty_tpl->tpl_vars['count']->value) {?>
  213. <tr>
  214. <td colspan="9" class="empty_table"><img src="static/images/empty_table.png"><p>暂无符合条件的数据!</p></td>
  215. </tr>
  216. <?php }?>
  217. </tbody>
  218. </table>
  219. <div class="panel-footer clearfix">
  220. <div class="form-inline">
  221. <div class="pull-right">
  222. <div class="form-group count"><?php echo $_smarty_tpl->tpl_vars['warning_status']->value["10"];?>
  223. :<span class="status10"><?php echo $_smarty_tpl->tpl_vars['count10']->value;?>
  224. </span>&nbsp;&nbsp;
  225. <?php echo $_smarty_tpl->tpl_vars['warning_status']->value["20"];?>
  226. :<span class="status20"><?php echo $_smarty_tpl->tpl_vars['count20']->value;?>
  227. </span>&nbsp;&nbsp;
  228. <?php echo $_smarty_tpl->tpl_vars['warning_status']->value["30"];?>
  229. :<span class="status30"><?php echo $_smarty_tpl->tpl_vars['count30']->value;?>
  230. </span>&nbsp;&nbsp;
  231. <?php echo $_smarty_tpl->tpl_vars['warning_status']->value["40"];?>
  232. :<span class="status40"><?php echo $_smarty_tpl->tpl_vars['count40']->value;?>
  233. </span>&nbsp;&nbsp;总共<?php echo $_smarty_tpl->tpl_vars['count']->value;?>
  234. 条记录</div>
  235. <div class="form-group">
  236. <?php echo $_smarty_tpl->tpl_vars['page']->value;?>
  237. </div>
  238. <div class="form-group">
  239. <label for="page_size" class="form-control-static control-label">每页</label>
  240. <select class="form-control" id="page_size" name="page_size">
  241. <option value="10" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 10) {?>selected<?php }?>>10</option>
  242. <option value="20" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 20) {?>selected<?php }?>>20</option>
  243. <option value="50" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 50) {?>selected<?php }?>>50</option>
  244. <option value="100" <?php if ($_smarty_tpl->tpl_vars['page_size']->value == 100) {?>selected<?php }?>>100</option>
  245. </select>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. <?php echo '<script'; ?>
  253. type="text/javascript" charset="utf-8" src="static/js/jquery.js"><?php echo '</script'; ?>
  254. >
  255. <?php echo '<script'; ?>
  256. type="text/javascript" charset="utf-8" src="static/js/bootstrap.min.js"><?php echo '</script'; ?>
  257. >
  258. <?php echo '<script'; ?>
  259. type="text/javascript" charset="utf-8" src="static/js/bootstrap-table.min.js"><?php echo '</script'; ?>
  260. >
  261. <?php echo '<script'; ?>
  262. type="text/javascript" charset="utf-8" src="static/js/bootstrap-table-zh-CN.min.js"><?php echo '</script'; ?>
  263. >
  264. <?php echo '<script'; ?>
  265. type="text/javascript" charset="utf-8" src="static/js/select2.full.min.js"><?php echo '</script'; ?>
  266. >
  267. <?php echo '<script'; ?>
  268. type="text/javascript" charset="utf-8" src="static/js/icheck.min.js"><?php echo '</script'; ?>
  269. >
  270. <?php echo '<script'; ?>
  271. type="text/javascript" charset="utf-8" src="static/js/layer/layer.js"><?php echo '</script'; ?>
  272. >
  273. <?php echo '<script'; ?>
  274. language="javascript" type="text/javascript">
  275. var disabled_btn = "";
  276. $(".panel-body button:disabled").each(function () {
  277. disabled_btn +="#"+$(this).attr("id")+",";
  278. })
  279. disabled_btn = disabled_btn.substr(0,disabled_btn.length-1);
  280. $(function(){
  281. $("table").show();
  282. layer.config({
  283. extend: 'myskin/style.css', //加载新皮肤
  284. });
  285. $('input').iCheck({
  286. cursor : true,
  287. checkboxClass : 'icheckbox_square-blue'
  288. });
  289. $("#warning_name").on('input',function () {
  290. $('#data_table').bootstrapTable('resetSearch', $(this).val());
  291. $('input').iCheck({
  292. cursor : true,
  293. checkboxClass : 'icheckbox_square-blue'
  294. });
  295. });
  296. $("select").select2({minimumResultsForSearch: -1});
  297. $(".bootstrap-table").on('click',".view_info",function(){
  298. var id = $(this).data("id");
  299. if(id != "" && id != undefined) {
  300. layer.open({
  301. type: 2,
  302. title: "告警详情",
  303. offset: 'auto',
  304. shade: [0.3],
  305. area: ['700px','520px'],
  306. anim: 0,
  307. shadeClose:false,
  308. content: 'warning/view/'+id,
  309. });
  310. }else{
  311. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  312. }
  313. });
  314. $(".bootstrap-table").on('click','.igrone',function () {
  315. var warning_id = $(this).data("id");
  316. layer.confirm('确定要忽略这条告警信息吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  317. if(warning_id != "" && warning_id != undefined) {
  318. $.post(
  319. "warning/ignore/" + warning_id,
  320. function (data) {
  321. layer.msg(data.msg, {skin:'default',icon: data.icon,time: 3000}, function () {
  322. window.location.reload();
  323. })
  324. }
  325. )
  326. }else{
  327. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  328. }
  329. layer.close(index);
  330. })
  331. });
  332. $(".bootstrap-table").on('click','.create_work_order',function(){
  333. var warning_id = $(this).data("id");
  334. if(warning_id != "" && warning_id != undefined) {
  335. layer.open({
  336. type: 2,
  337. title: "生成工单",
  338. offset: 'auto',
  339. shade: [0.3],
  340. area: ['900px','80%'],
  341. anim: 0,
  342. shadeClose:false,
  343. content: 'workorder/create?ids='+warning_id,
  344. end: function(){
  345. window.location.reload();
  346. }
  347. });
  348. }else{
  349. layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
  350. }
  351. });
  352. $("#create_workorder").on('click',function () {
  353. var ids = "";
  354. var branch_id = $("input:checkbox:checked:first").data('branch_id');
  355. $("input:checkbox").each(function () {
  356. if($(this).not(":disabled").prop("checked")){
  357. ids += $(this).val()+",";
  358. if($(this).data('branch_id') != branch_id){
  359. branch_id = "";
  360. return false;
  361. }
  362. }
  363. });
  364. if(branch_id == "") {
  365. layer.alert("请选择在同一分支结构的工单进行批量操作!",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  366. }else if(ids == ""){
  367. layer.alert("请选择要创建工单的告警信息",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  368. }else{
  369. layer.open({
  370. type: 2,
  371. title: "生成工单",
  372. offset: 'auto',
  373. shade: [0.3],
  374. area: ['900px','75%'],
  375. anim: 0,
  376. shadeClose:false,
  377. content: 'workorder/create?ids='+ids,
  378. end: function(){
  379. window.location.reload();
  380. }
  381. });
  382. }
  383. });
  384. $("#igrone_select").on('click',function () {
  385. var ids = "";
  386. $("input:checkbox").each(function () {
  387. if($(this).not(":disabled").prop("checked")){
  388. ids += $(this).val()+",";
  389. }
  390. });
  391. if(ids == ""){
  392. layer.alert("请选择要忽略的告警信息",{skin: 'layer-ext-myskin',icon: 3, title:'提示'});
  393. }else{
  394. layer.confirm('确定要忽略这条告警信息吗?', {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
  395. $.post(
  396. "warning/ignoreselect/",{'warning_ids':ids},
  397. function (data) {
  398. layer.msg(data.msg, {icon: data.icon,time: 3000}, function () {
  399. window.location.reload();
  400. })
  401. }
  402. );
  403. layer.close(index);
  404. })
  405. }
  406. });
  407. $(".bootstrap-table").on('ifChecked','.check_all',function () {
  408. $("input:checkbox").not(':disabled').iCheck('check');
  409. }).on('ifUnchecked','.check_all',function () {
  410. $("input:checkbox").not(':disabled').iCheck('uncheck');
  411. });
  412. $(".bootstrap-table").on('ifChanged','input:checkbox',function(){
  413. var ids ="";
  414. $("input:checkbox").each(function () {
  415. if($(this).not(":disabled").prop("checked")){
  416. ids += $(this).val()+",";
  417. }
  418. });
  419. if(ids != "" && ids != undefined){
  420. $(disabled_btn).removeAttr("disabled");
  421. }else{
  422. $(disabled_btn).attr("disabled","disabled");
  423. }
  424. })
  425. $("#page_size").change(function () {
  426. var page_size = $(this).val();
  427. window.location.href = "warning/index?page_size="+page_size;
  428. });
  429. $(".form-inline select").on("change",function(e) {
  430. if($(this).attr("id") != "page_size") {
  431. $(".form-inline").submit();
  432. }
  433. })
  434. })
  435. <?php echo '</script'; ?>
  436. >
  437. </body>
  438. </html><?php }
  439. }