threshold.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <!--#include file="/inc/header.html"-->
  2. <style>
  3. .author-nav-tree {
  4. display: inline-block;
  5. width: 200px;
  6. min-height: 400px;
  7. border: 1px solid lightgrey;
  8. float: left;
  9. overflow-x: hidden;
  10. overflow-y: auto;
  11. margin-top: 10px;
  12. }
  13. #con-map {
  14. min-height: 400px;
  15. display: inline-block;
  16. margin-top: 10px;
  17. }
  18. .bif-con {
  19. width: 1200px;
  20. height:500px;
  21. margin-top: 0px;
  22. margin-left: 0px;
  23. float: left;
  24. }
  25. .bif-nav-item {
  26. width: 150px;
  27. text-align: center;
  28. }
  29. </style>
  30. <script type="text/javascript">
  31. window.renderHeader=function(e)
  32. {
  33. var template="{{#childenList}}<li class=\"bif-nav-item\" title=\"{{moduleUrl}}\" data-fun=\"{{moduleUrl}}\" data-href=\"{{moduleUrl}}\">{{moduleName}}</li>{{/childenList}}";
  34. var views = Mustache.render(template, e);
  35. $("#bif-nav-ul").html(views);
  36. // $(".tree-breadcrumb #nav-item-a").html($("#bif-nav-ul li:first-child").html());
  37. // $("#bif-nav-ul li:first-child").addClass("active");
  38. $("#bif-nav-ul li").each(function(){
  39. var txt=$(this).text();
  40. if(txt=='阀值参数管理'){
  41. $(this).addClass("active");
  42. $(".tree-breadcrumb #nav-item-a").html("阀值参数管理");
  43. }
  44. })
  45. };
  46. $(function(){
  47. var modules=JSON.parse(window.sessionStorage.getItem("modules"));
  48. if(window.treemap){
  49. renderHeader(window.treemap[13]);//参数管理 7
  50. }else if(modules){
  51. renderHeader(modules.treemap[13]);
  52. }
  53. })
  54. </script>
  55. <div class="con-wrap" style="min-height: 400px;">
  56. <div class="tree-breadcrumb">
  57. <span class="nav-prov">首页</span>&gt;
  58. <span class="nav-prov"><a id="cansgl" href="/pages/basedata/index.html">参数管理</a></span>&gt;
  59. <span class="nav-prov"><a href="javascript:;" id="nav-item-a"></a></span>
  60. </div>
  61. <div id="con-map" class="main3" style="margin-top: 0px;overflow:hidden">
  62. <div class="bif-nav">
  63. <ul id="bif-nav-ul" >
  64. </ul>
  65. </div>
  66. <div class="bif-container">
  67. <div class="bif-con panel-noscroll" style="width:1200px">
  68. <div id="bd-toolbar" style="margin-top: 0;padding: 10px 5px">
  69. 类型:
  70. <select id="bd-type" class="easyui-combobox search-typeOther" editable="false" name="type" style="width:150px;" panelHeight="100">
  71. <option value="0">虫害</option>
  72. <option value="1">结露</option>
  73. <option value="2">温度</option>
  74. <option value="3">验收</option>
  75. </select>&emsp;
  76. 名称:<input class="easyui-textbox easyui-validatebox search-nameOther bd-w-name" name="name" data-options="validType:'length[0,20]'">&emsp;
  77. <a href="javascript:;" class="easyui-linkbutton bd-add-s bd-search">搜索</a>
  78. <a href="#" class="easyui-linkbutton bd-add-s clear-btn2" plain="true">清空</a>
  79. </div>
  80. <div id="base-table">
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="bd-w easyui-window" style="padding-left: 10px" data-options="closed:true">
  87. <form class="bd-w-form" style="margin-top: 12px;">
  88. <input type="hidden" name="id" >
  89. <span class="deviceIn-device-w-t deviceIn-span-first">
  90. <span class="deviceIn-pitem-lit">名称:</span>
  91. <span class="deviceIn-pitem-lic"><input class="easyui-textbox name" editable=false name="name"></span>
  92. </span>
  93. <span class="deviceIn-device-w-t">
  94. <span class="deviceIn-pitem-lit">阀值:</span>
  95. <span class="deviceIn-pitem-lic"><input class="easyui-textbox easyui-validatebox value" data-options="validType:'number',required:true" name="value"></span>
  96. </span>
  97. <span class="deviceIn-device-w-t deviceIn-span-first">
  98. <span class="deviceIn-pitem-lit">备注:</span>
  99. <span class="deviceIn-pitem-lic"><input class="easyui-textbox remark" name="remarks"></span>
  100. </span>
  101. <br/>
  102. <a href="#" class="easyui-linkbutton bd-add-s btn-add-new" plain="true" style="margin-top: 20px;">确定</a>
  103. <a href="javascript:;" class="easyui-linkbutton bd-add-s " onclick="$('.bd-w').window('close');" plain="true" style="margin-top: 20px;">取消</a>
  104. </form>
  105. </div>
  106. <!--#include file="/inc/footer.html"-->
  107. </body>
  108. </html>
  109. <script type="text/javascript">
  110. $(function() {
  111. // var value=["虫害","结露","温度","验收"];
  112. baseData.initNav();
  113. loadData();
  114. search();
  115. $('.clear-btn2').on('click',function(e){
  116. e.preventDefault();
  117. $('.search-typeOther').combobox('clear');
  118. $('.search-nameOther').textbox('clear');
  119. });
  120. });
  121. function loadData(type,name){
  122. var url=config.baseUrl + config.threshold.listPage+"?1=1";
  123. if(type){
  124. url=url+"&type="+type;
  125. }
  126. if(name){
  127. url=url+"&name="+name;
  128. }
  129. $('#base-table').datagrid({
  130. url: url,
  131. method: 'post',
  132. rownumbers: true,
  133. pagination: true,
  134. fitColumns: true,
  135. singleSelect: true,
  136. selectOnCheck: false,
  137. checkOnSelect: false,
  138. toolbar: '#bd-toolbar',
  139. fit: true,
  140. columns: [[
  141. {
  142. field:'type',
  143. title:'类型',
  144. width:'20%',
  145. align: 'center',
  146. formatter: function(value, row, index) {
  147. switch(row.type){
  148. case "0":
  149. return "虫害";
  150. case "1":
  151. return "结露";
  152. case "2":
  153. return "温度";
  154. case "3":
  155. return "验收";
  156. }
  157. }
  158. },
  159. {field:'name', title:'名称', width:'20%',
  160. formatter: function(value,row,index){
  161. if(value=='' || value=='undefined' || value==null || value=='null'){
  162. }else{
  163. return '<span title='+value+'>'+value+'</span>';
  164. }
  165. }},
  166. {field:'value', title:'阀值', width:'20%',
  167. formatter: function(value,row,index){
  168. if(value=='' || value=='undefined' || value==null || value=='null'){
  169. }else{
  170. return '<span title='+value+'>'+value+'</span>';
  171. }
  172. }},
  173. {field:'remarks', title:'备注', width:'20%',
  174. formatter: function(value,row,index){
  175. if(value=='' || value=='undefined' || value==null || value=='null'){
  176. }else{
  177. return '<span title='+value+'>'+value+'</span>';
  178. }
  179. }},
  180. {
  181. field:'id',
  182. title:'操作',
  183. width:'15%',
  184. align: 'center',
  185. formatter: function(value, row, index) {
  186. return '<a class="record_record_update t-update" data-id=' + row.id + '>更新</a>';
  187. }
  188. }
  189. ]],
  190. loadFilter: function(e) {
  191. return {
  192. total: e.data.count,
  193. rows: e.data.list
  194. };
  195. },
  196. onLoadSuccess: function() {
  197. // base.delInfo('.iso-noticeMag-del', config.noticeMag.toDelete, '#noticeMag-info');
  198. update();
  199. }
  200. });
  201. }
  202. function update(){
  203. $(".record_record_update").off("click").on("click",function(){
  204. base.renderwindow('.bd-w',
  205. {
  206. title: '修改阀值',
  207. width: 450,
  208. height: 250,
  209. });
  210. var id=$(this).data('id');
  211. $('.bd-w').window('open').window('center');
  212. //将id的值绑定到确认按钮上
  213. base.ajaxFunc('get', config.threshold.getById, {id: id}, function(e) {
  214. var row = e.obj;
  215. $('.bd-w-form').form("clear").form('load',row);
  216. //当鼠标移动到文本框时显示该文本框的信息内容
  217. $(".bd-w-form input,textarea").each(function(i) {
  218. var str=$(this).val();
  219. $(this).attr("title", $(this).val());
  220. });
  221. doupdate();
  222. });
  223. });
  224. }
  225. function doupdate(){
  226. $(".btn-add-new").off().on("click",function(){
  227. var data = $('.bd-w-form').serializeArray();
  228. var valresult=$(".bd-w-form").form('validate');
  229. if(!valresult){
  230. $.messager.alert('提示', base.tooltip, 'info');
  231. return;
  232. }
  233. base.ajaxFunc('post', config.threshold.toUpdate, data, function(e) {
  234. base.requestTip(e, '.bd-w', '#base-table', 0);
  235. });
  236. });
  237. }
  238. function search(){
  239. $(".bd-search").off("click").on("click",function(){
  240. if(!$('.search-nameOther').textbox('isValid')) return;
  241. var type = $('.search-typeOther').combobox('getValue');
  242. var name = $('.search-nameOther').textbox('getValue');
  243. loadData(type,name);
  244. });
  245. }
  246. </script>