threshold.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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 treemap = {
  48. moduleName:'参数管理',
  49. moduleType:'pages/basedata/index.html',
  50. moduleUrl:'pages/basedata/index.html',
  51. childenList:[
  52. {
  53. moduleName:'基础参数管理',
  54. moduleType:'',
  55. moduleUrl:'/pages/basedata/jichu.html',
  56. },{
  57. moduleName:'阀值参数管理',
  58. moduleType:'',
  59. moduleUrl:'/pages/basedata/threshold.html',
  60. },
  61. // {
  62. // moduleName:'考核类参数管理',
  63. // moduleType:'',
  64. // moduleUrl:'/pages/basedata/checkRule.html',
  65. // },
  66. // {
  67. // moduleName:'规则生成',
  68. // moduleType:'',
  69. // moduleUrl:'/pages/basedata/checkRule.html',
  70. // },
  71. // {
  72. // moduleName:'巡查点管理',
  73. // moduleType:'',
  74. // moduleUrl:'/pages/basedata/checkpoint.html',
  75. // }
  76. ]
  77. }
  78. renderHeader(treemap);
  79. })
  80. </script>
  81. <div class="con-wrap" style="min-height: 400px;">
  82. <!-- <div class="tree-breadcrumb">
  83. <span class="nav-prov">首页</span>&gt;
  84. <span class="nav-prov"><a id="cansgl" href="/pages/basedata/index.html">参数管理</a></span>&gt;
  85. <span class="nav-prov"><a href="javascript:;" id="nav-item-a"></a></span>
  86. </div> -->
  87. <div id="con-map" class="main3" style="margin-top: 0px;overflow:hidden">
  88. <div class="bif-nav">
  89. <ul id="bif-nav-ul" >
  90. </ul>
  91. </div>
  92. <div class="bif-container">
  93. <div class="bif-con panel-noscroll" style="margin-left:0;width:1200px">
  94. <div id="bd-toolbar" style="margin-top: 0;padding: 10px 5px">
  95. 类型:
  96. <select id="bd-type" class="easyui-combobox search-typeOther" editable="false" name="type" style="width:150px;" panelHeight="100">
  97. <option value="0">虫害</option>
  98. <option value="1">结露</option>
  99. <option value="2">温度</option>
  100. <option value="3">验收</option>
  101. </select>&emsp;
  102. 名称:<input class="easyui-textbox easyui-validatebox search-nameOther bd-w-name" name="name" data-options="validType:'length[0,20]'">&emsp;
  103. <a href="javascript:;" class="easyui-linkbutton bd-add-s bd-search">搜索</a>
  104. <a href="#" class="easyui-linkbutton bd-add-s clear-btn2" plain="true">清空</a>
  105. </div>
  106. <div id="base-table">
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="bd-w easyui-window" style="padding-left: 10px" data-options="closed:true">
  113. <form class="bd-w-form" style="margin-top: 12px;">
  114. <input type="hidden" name="id" >
  115. <span class="deviceIn-device-w-t deviceIn-span-first">
  116. <span class="deviceIn-pitem-lit">名称:</span>
  117. <span class="deviceIn-pitem-lic"><input class="easyui-textbox name" editable=false name="name"></span>
  118. </span>
  119. <span class="deviceIn-device-w-t">
  120. <span class="deviceIn-pitem-lit">阀值:</span>
  121. <span class="deviceIn-pitem-lic"><input class="easyui-textbox easyui-validatebox value" data-options="validType:'number',required:true" name="value"></span>
  122. </span>
  123. <span class="deviceIn-device-w-t deviceIn-span-first">
  124. <span class="deviceIn-pitem-lit">备注:</span>
  125. <span class="deviceIn-pitem-lic"><input class="easyui-textbox remark" name="remarks"></span>
  126. </span>
  127. <br/>
  128. <a href="#" class="easyui-linkbutton bd-add-s btn-add-new" plain="true" style="margin-top: 20px;">确定</a>
  129. <a href="javascript:;" class="easyui-linkbutton bd-add-s " onclick="$('.bd-w').window('close');" plain="true" style="margin-top: 20px;">取消</a>
  130. </form>
  131. </div>
  132. <!--#include file="/inc/footer.html"-->
  133. </body>
  134. </html>
  135. <script type="text/javascript">
  136. $(function() {
  137. // var value=["虫害","结露","温度","验收"];
  138. baseData.initNav();
  139. loadData();
  140. search();
  141. $('.clear-btn2').on('click',function(e){
  142. e.preventDefault();
  143. $('.search-typeOther').combobox('clear');
  144. $('.search-nameOther').textbox('clear');
  145. });
  146. });
  147. function loadData(type,name){
  148. var url=config.baseUrl + config.threshold.listPage+"?1=1";
  149. if(type){
  150. url=url+"&type="+type;
  151. }
  152. if(name){
  153. url=url+"&name="+name;
  154. }
  155. $('#base-table').datagrid({
  156. url: url,
  157. method: 'post',
  158. rownumbers: true,
  159. pagination: true,
  160. fitColumns: true,
  161. singleSelect: true,
  162. selectOnCheck: false,
  163. checkOnSelect: false,
  164. toolbar: '#bd-toolbar',
  165. fit: true,
  166. columns: [[
  167. {
  168. field:'type',
  169. title:'类型',
  170. width:'20%',
  171. align: 'center',
  172. formatter: function(value, row, index) {
  173. switch(row.type){
  174. case "0":
  175. return "虫害";
  176. case "1":
  177. return "结露";
  178. case "2":
  179. return "温度";
  180. case "3":
  181. return "验收";
  182. }
  183. }
  184. },
  185. {field:'name', title:'名称', width:'20%',
  186. formatter: function(value,row,index){
  187. if(value=='' || value=='undefined' || value==null || value=='null'){
  188. }else{
  189. return '<span title='+value+'>'+value+'</span>';
  190. }
  191. }},
  192. {field:'value', title:'阀值', width:'20%',
  193. formatter: function(value,row,index){
  194. if(value=='' || value=='undefined' || value==null || value=='null'){
  195. }else{
  196. return '<span title='+value+'>'+value+'</span>';
  197. }
  198. }},
  199. {field:'remarks', title:'备注', width:'20%',
  200. formatter: function(value,row,index){
  201. if(value=='' || value=='undefined' || value==null || value=='null'){
  202. }else{
  203. return '<span title='+value+'>'+value+'</span>';
  204. }
  205. }},
  206. {
  207. field:'id',
  208. title:'操作',
  209. width:'15%',
  210. align: 'center',
  211. formatter: function(value, row, index) {
  212. return '<a class="record_record_update t-update" data-id=' + row.id + '>更新</a>';
  213. }
  214. }
  215. ]],
  216. loadFilter: function(e) {
  217. return {
  218. total: e.data.count,
  219. rows: e.data.list
  220. };
  221. },
  222. onLoadSuccess: function() {
  223. // base.delInfo('.iso-noticeMag-del', config.noticeMag.toDelete, '#noticeMag-info');
  224. update();
  225. }
  226. });
  227. }
  228. function update(){
  229. $(".record_record_update").off("click").on("click",function(){
  230. // e.preventDefault();
  231. //渲染window窗口
  232. base.renderwindow('.bd-w', {
  233. width: 750,
  234. height: 300,
  235. top: 50,
  236. title: '修改阀值'
  237. });
  238. // e.preventDefault();
  239. // base.renderwindow('.bd-w',
  240. // {
  241. // title: '修改阀值',
  242. // width: 450,
  243. // height: 250,
  244. // });
  245. var id=$(this).data('id');
  246. $('.bd-w').window('open');
  247. //将id的值绑定到确认按钮上
  248. base.ajaxFunc('get', config.threshold.getById, {id: id}, function(e) {
  249. var row = e.obj;
  250. $('.bd-w-form').form("clear").form('load',row);
  251. //当鼠标移动到文本框时显示该文本框的信息内容
  252. $(".bd-w-form input,textarea").each(function(i) {
  253. var str=$(this).val();
  254. $(this).attr("title", $(this).val());
  255. });
  256. doupdate();
  257. });
  258. });
  259. }
  260. function doupdate(){
  261. $(".btn-add-new").off().on("click",function(){
  262. var data = $('.bd-w-form').serializeArray();
  263. var valresult=$(".bd-w-form").form('validate');
  264. if(!valresult){
  265. $.messager.alert('提示', base.tooltip, 'info');
  266. return;
  267. }
  268. base.ajaxFunc('post', config.threshold.toUpdate, data, function(e) {
  269. base.requestTip(e, '.bd-w', '#base-table', 0);
  270. });
  271. });
  272. }
  273. function search(){
  274. $(".bd-search").off("click").on("click",function(){
  275. if(!$('.search-nameOther').textbox('isValid')) return;
  276. var type = $('.search-typeOther').combobox('getValue');
  277. var name = $('.search-nameOther').textbox('getValue');
  278. loadData(type,name);
  279. });
  280. }
  281. </script>