BatchWarningProcessing.cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. 
  2. @{
  3. ViewBag.Title = "预警处理";
  4. Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
  5. }
  6. <style type="text/css">
  7. h2 {
  8. margin-top: 20px;
  9. font-size: 15px;
  10. font-weight: bold;
  11. }
  12. #mark {
  13. margin-top: 80px;
  14. }
  15. #select {
  16. margin-left: 20%;
  17. }
  18. h3 {
  19. font-size: 14px;
  20. }
  21. </style>
  22. <div id="tt" data-options="fit:true,border:false">
  23. <div style="width:100%;height:220px;">
  24. <div id="Channeltb">
  25. <input id="userAccount" class="easyui-searchbox" data-options="prompt:'支持渠道,项目,预警类型,负责人,服务器类型',searcher:Enter_Submit" style="width:450px" />
  26. <button type="button" id="btn-more" class="layui-btn layui-btn-normal layui-btn-sm">更多条件</button>
  27. </div>
  28. <div data-options="region:'center', title:'预警管理'" style="width:100%;height:200px;">
  29. <table id="treegrid" data-options="fit:true">
  30. <!-- 预警管理表格内容 -->
  31. </table>
  32. </div>
  33. </div>
  34. <form id="ff" action="" lay-filter="ff" class="layui-form" style="margin-top:20px;">
  35. <!--当前编辑的ID值-->
  36. <input type="hidden" id="YJID" name="YJID" />
  37. <div class="layui-form-item">
  38. <div class="layui-inline">
  39. <label class="layui-form-label">处理时间</label>
  40. <div class="layui-input-inline">
  41. @{
  42. DateTime currentDateTime = DateTime.Now;
  43. string defaultDateTimeValue = currentDateTime.ToString("yyyy-MM-ddTHH:mm:ss");
  44. }
  45. <input type="datetime-local" id="CLSJ" name="CLSJ" value="@defaultDateTimeValue" lay-verify="CLSJ" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input" style="height:38px;border-radius:4px" />
  46. </div>
  47. </div>
  48. <div class="layui-inline">
  49. <label class="layui-form-label">处理人</label>
  50. <div class="layui-input-inline">
  51. <input type="text" id="CLR" name="CLR" disabled value="@ViewBag.UserName" lay-verify="CLR" autocomplete="off" class="layui-input" style="height:38px;border-radius:4px" />
  52. </div>
  53. </div>
  54. <div class="layui-inline">
  55. <label class="layui-form-label">处理状态</label>
  56. <div class="layui-input-inline">
  57. <input type="text" id="CLZT" name="CLZT" lay-verify="CLZT" autocomplete="off" class="layui-input" style="height:38px;border-radius:4px" />
  58. </div>
  59. </div>
  60. </div>
  61. <div class="layui-form-item layui-form-text">
  62. <label class="layui-form-label">处理说明</label>
  63. <div class="layui-input-block">
  64. <textarea id="CLSM" name="CLSM" lay-verify="CLSM" class="layui-textarea" placeholder="请输入处理说明" style="width: 818px; min-height: 100px; margin-left: -10px"></textarea>
  65. </div>
  66. </div>
  67. </form>
  68. </div>
  69. @*更多条件*@
  70. <form id="inteform" method="post" class="layui-form" style="margin-top:20px;display:none;">
  71. <div class="layui-form-item">
  72. <div class="layui-inline">
  73. <label class="layui-form-label">渠道</label>
  74. <div class="layui-input-inline">
  75. <input id="QDID" name="QDID" panelheight="200px" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择渠道',limitToList:true,tipPosition:'top'" style="height:38px;border-radius:4px;width:200px" />
  76. </div>
  77. </div>
  78. <div class="layui-inline">
  79. <label class="layui-form-label">项目</label>
  80. <div class="layui-input-inline">
  81. <input id="XMID" name="XMID" panelheight="200px" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择项目',limitToList:true,tipPosition:'top'" style="height: 38px; border-radius: 4px; width: 200px " />
  82. </div>
  83. </div>
  84. </div>
  85. <div class="layui-form-item">
  86. <div class="layui-inline">
  87. <label class="layui-form-label">预警类型</label>
  88. <div class="layui-input-inline">
  89. <input id="YJLXID" name="YJLXID" panelheight="200px" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择渠道',limitToList:true,tipPosition:'top'" style="height:38px;border-radius:4px;width:200px" />
  90. </div>
  91. </div>
  92. <div class="layui-inline">
  93. <label class="layui-form-label">处理状态</label>
  94. <div class="layui-input-inline">
  95. <input id="ZT" name="ZT" panelheight="200px" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择项目',limitToList:true,tipPosition:'top'" style="height: 38px; border-radius: 4px; width: 200px " />
  96. </div>
  97. </div>
  98. </div>
  99. </form>
  100. <script type="text/javascript">
  101. window.proId = getQueryString("ProId");
  102. //更多条件
  103. $("#btn-more").bind("click", function () {
  104. var that = this;
  105. //多窗口模式,层叠置顶
  106. index = layer.open({
  107. type: 1
  108. , id: "one"
  109. , title: '条件'
  110. , area: ['800px', '250px']
  111. , shade: 0
  112. , anim: 1
  113. , shadeClose: true
  114. , maxmin: true
  115. , shade: 0.3
  116. , offset: '50px'
  117. , content: $("#inteform")
  118. , btn: ['确认', '关闭']
  119. , yes: function () {
  120. InitTable();
  121. layer.close(index);
  122. }
  123. , btn2: function () {
  124. layer.close(index);
  125. }
  126. , zIndex: 1 //重点1
  127. });
  128. })
  129. //渠道
  130. $("#QDID").combobox({
  131. url: '/Problem/GetChannelByAuth',
  132. valueField: 'ID',
  133. textField: '名称',
  134. limitToList: true,
  135. })
  136. //项目
  137. $("#XMID").combobox({
  138. url: '/Problem/GetProjectByInfo',
  139. valueField: 'ID',
  140. textField: '名称',
  141. limitToList: true,
  142. })
  143. //预警类型
  144. $("#YJLXID").combobox({
  145. url: '/ProManager/GetEarlyWarningType',
  146. valueField: 'ID',
  147. textField: '显示名',
  148. limitToList: true
  149. })
  150. //状态
  151. $("#ZT").combobox({
  152. data: [{
  153. "ID": "3",
  154. "显示名": "处理中"
  155. },
  156. {
  157. "ID": "1",
  158. "显示名": "未处理"
  159. },
  160. {
  161. "ID": "2",
  162. "显示名": "开始处理"
  163. }],
  164. valueField: 'ID',
  165. textField: '显示名',
  166. limitToList: true,
  167. value:"1"
  168. })
  169. //回车提交查询
  170. function Enter_Submit() {
  171. InitTable();
  172. }
  173. window.InitTable = function () {
  174. var params = ZLPMS.FormToObject('inteform');
  175. if (window.proId != null) {
  176. params.XMID = window.proId;
  177. //处理界面显示
  178. $("#Channeltb").remove();
  179. } else {
  180. params.CONTENT = $("#userAccount").val();
  181. }
  182. //初始化树形表格
  183. $("#treegrid").datagrid({
  184. url: '/CloudMonitor/GetServerAlertBySearch',
  185. idField: 'ID',
  186. queryParams: params,
  187. //data: data,
  188. method: 'POST',
  189. fit: true,
  190. pageSize: 0,
  191. toolbar: window.proId != null ? "" : "#Channeltb",
  192. rownumbers: true,
  193. //底部显示分页工具栏
  194. pagination: false,
  195. //列名称
  196. columns: [[
  197. { field: 'ck', checkbox: true, width: 50 },
  198. { field: '项目名称', title: '项目', width: 100 },
  199. { field: '渠道名称', title: '渠道', width: 100 },
  200. { field: '预警类型显示', title: '预警类型', width: 120, align: 'center' },
  201. { field: '异常说明', title: '异常说明', width: 350, align: 'center' },
  202. {
  203. field: '创建时间', title: '初次预警时间', width: 150, align: 'center', formatter: ZLPMS.formatterData
  204. },
  205. { field: '最后上报时间', title: '最后上报时间', width: 150, align: 'center', formatter: ZLPMS.formatterData },
  206. {
  207. field: '预警次数', title: '预警次数', width: 100, align: 'center'
  208. },
  209. {
  210. field: '服务器IP', title: 'IP', width: 100, align: 'center'
  211. },
  212. { field: '服务器类型显示', title: '服务器类型', width: 100, align: 'center' },
  213. { field: '负责人', title: '负责人', width: 100, align: 'center' },
  214. { field: '预警状态显示', title: '状态', width: 100, align: 'center' },
  215. { field: '处理时间', title: '处理时间', width: 150, align: 'center', formatter: ZLPMS.formatterData }
  216. ]],
  217. singleSelect: false,
  218. onClickRow: function (index, row) {
  219. },
  220. onSelectAll: function (rows) {
  221. }
  222. });
  223. }
  224. $(function () {
  225. window.InitPage = function (row, info = null) {
  226. let data = ZLPMS.GetAPi(`/ProManager/GetWarningProcessingStatu`);
  227. data = data.filter(o => o.ID >= 2);
  228. //处理状态数据绑定
  229. $("#CLZT").combobox({
  230. data: data,
  231. valueField: 'ID',
  232. textField: '显示名',
  233. onChange: function (newValue, oldValue) {
  234. $("#CLZT").combobox({ value: newValue });
  235. }
  236. });
  237. InitTable();
  238. }
  239. window.GetData = function () {
  240. var rows = $('#treegrid').datagrid('getSelections');
  241. if (rows != null) {
  242. return {
  243. "预警ID": $.map(rows, item => item.ID).join(","),
  244. "处理人": $("#CLR").val(),
  245. "处理说明": $("#CLSM").val(),
  246. "处理状态": $("#CLZT").val(),
  247. "创建时间": $("#CLSJ").val()
  248. };
  249. }
  250. else {
  251. top.ZLPMS.Msg("请选择待处理的数据", 0);
  252. return false;
  253. }
  254. }
  255. })
  256. </script>