123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <!--#include file="/inc/header.html"-->
- <style>
- .author-nav-tree {
- display: inline-block;
- width: 200px;
- min-height: 400px;
- border: 1px solid lightgrey;
- float: left;
- overflow-x: hidden;
- overflow-y: auto;
- margin-top: 10px;
- }
- #con-map {
- min-height: 400px;
- display: inline-block;
- margin-top: 10px;
- }
- .bif-con {
- width: 1200px;
- height:500px;
- margin-top: 0px;
- margin-left: 0px;
- float: left;
- }
- .bif-nav-item {
- /* width: 150px; */
- text-align: center;
- }
- </style>
- <script type="text/javascript">
- window.renderHeader=function(e)
- {
- var template="{{#childenList}}<li class=\"bif-nav-item\" title=\"{{moduleUrl}}\" data-fun=\"{{moduleUrl}}\" data-href=\"{{moduleUrl}}\">{{moduleName}}</li>{{/childenList}}";
- var views = Mustache.render(template, e);
- $("#bif-nav-ul").html(views);
- // $(".tree-breadcrumb #nav-item-a").html($("#bif-nav-ul li:first-child").html());
- // $("#bif-nav-ul li:first-child").addClass("active");
- $("#bif-nav-ul li").each(function(){
- var txt=$(this).text();
- if(txt=='阀值参数管理'){
- $(this).addClass("active");
- $(".tree-breadcrumb #nav-item-a").html("阀值参数管理");
- }
- })
- };
- $(function(){
- var treemap = {
- moduleName:'参数管理',
- moduleType:'pages/basedata/index.html',
- moduleUrl:'pages/basedata/index.html',
- childenList:[
- {
- moduleName:'基础参数管理',
- moduleType:'',
- moduleUrl:'/pages/basedata/jichu.html',
- },{
- moduleName:'阀值参数管理',
- moduleType:'',
- moduleUrl:'/pages/basedata/threshold.html',
- },
- // {
- // moduleName:'考核类参数管理',
- // moduleType:'',
- // moduleUrl:'/pages/basedata/checkRule.html',
- // },
- // {
- // moduleName:'规则生成',
- // moduleType:'',
- // moduleUrl:'/pages/basedata/checkRule.html',
- // },
- // {
- // moduleName:'巡查点管理',
- // moduleType:'',
- // moduleUrl:'/pages/basedata/checkpoint.html',
- // }
- ]
- }
- renderHeader(treemap);
- })
- </script>
- <div class="con-wrap" style="min-height: 400px;">
- <!-- <div class="tree-breadcrumb">
- <span class="nav-prov">首页</span>>
- <span class="nav-prov"><a id="cansgl" href="/pages/basedata/index.html">参数管理</a></span>>
- <span class="nav-prov"><a href="javascript:;" id="nav-item-a"></a></span>
- </div> -->
- <div id="con-map" class="main3" style="margin-top: 0px;overflow:hidden">
- <div class="bif-nav">
- <ul id="bif-nav-ul" >
- </ul>
- </div>
- <div class="bif-container">
- <div class="bif-con panel-noscroll" style="margin-left:0;width:1200px">
- <div id="bd-toolbar" style="margin-top: 0;padding: 10px 5px">
- 类型:
- <select id="bd-type" class="easyui-combobox search-typeOther" editable="false" name="type" style="width:150px;" panelHeight="100">
- <option value="0">虫害</option>
- <option value="1">结露</option>
- <option value="2">温度</option>
- <option value="3">验收</option>
- </select> 
- 名称:<input class="easyui-textbox easyui-validatebox search-nameOther bd-w-name" name="name" data-options="validType:'length[0,20]'"> 
- <a href="javascript:;" class="easyui-linkbutton bd-add-s bd-search">搜索</a>
- <a href="#" class="easyui-linkbutton bd-add-s clear-btn2" plain="true">清空</a>
- </div>
- <div id="base-table">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="bd-w easyui-window" style="padding-left: 10px" data-options="closed:true">
- <form class="bd-w-form" style="margin-top: 12px;">
- <input type="hidden" name="id" >
- <span class="deviceIn-device-w-t deviceIn-span-first">
- <span class="deviceIn-pitem-lit">名称:</span>
- <span class="deviceIn-pitem-lic"><input class="easyui-textbox name" editable=false name="name"></span>
- </span>
- <span class="deviceIn-device-w-t">
- <span class="deviceIn-pitem-lit">阀值:</span>
- <span class="deviceIn-pitem-lic"><input class="easyui-textbox easyui-validatebox value" data-options="validType:'number',required:true" name="value"></span>
- </span>
- <span class="deviceIn-device-w-t deviceIn-span-first">
- <span class="deviceIn-pitem-lit">备注:</span>
- <span class="deviceIn-pitem-lic"><input class="easyui-textbox remark" name="remarks"></span>
- </span>
- <br/>
- <a href="#" class="easyui-linkbutton bd-add-s btn-add-new" plain="true" style="margin-top: 20px;">确定</a>
- <a href="javascript:;" class="easyui-linkbutton bd-add-s " onclick="$('.bd-w').window('close');" plain="true" style="margin-top: 20px;">取消</a>
- </form>
- </div>
- <!--#include file="/inc/footer.html"-->
- </body>
- </html>
- <script type="text/javascript">
- $(function() {
- // var value=["虫害","结露","温度","验收"];
- baseData.initNav();
- loadData();
- search();
- $('.clear-btn2').on('click',function(e){
- e.preventDefault();
- $('.search-typeOther').combobox('clear');
- $('.search-nameOther').textbox('clear');
- });
- });
- function loadData(type,name){
- var url=config.baseUrl + config.threshold.listPage+"?1=1";
- if(type){
- url=url+"&type="+type;
- }
- if(name){
- url=url+"&name="+name;
- }
- $('#base-table').datagrid({
- url: url,
- method: 'post',
- rownumbers: true,
- pagination: true,
- fitColumns: true,
- singleSelect: true,
- selectOnCheck: false,
- checkOnSelect: false,
- toolbar: '#bd-toolbar',
- fit: true,
- columns: [[
- {
- field:'type',
- title:'类型',
- width:'20%',
- align: 'center',
- formatter: function(value, row, index) {
- switch(row.type){
- case "0":
- return "虫害";
- case "1":
- return "结露";
- case "2":
- return "温度";
- case "3":
- return "验收";
- }
- }
- },
- {field:'name', title:'名称', width:'20%',
- formatter: function(value,row,index){
- if(value=='' || value=='undefined' || value==null || value=='null'){
- }else{
- return '<span title='+value+'>'+value+'</span>';
- }
- }},
- {field:'value', title:'阀值', width:'20%',
- formatter: function(value,row,index){
- if(value=='' || value=='undefined' || value==null || value=='null'){
- }else{
- return '<span title='+value+'>'+value+'</span>';
- }
- }},
- {field:'remarks', title:'备注', width:'20%',
- formatter: function(value,row,index){
- if(value=='' || value=='undefined' || value==null || value=='null'){
- }else{
- return '<span title='+value+'>'+value+'</span>';
- }
- }},
- {
- field:'id',
- title:'操作',
- width:'15%',
- align: 'center',
- formatter: function(value, row, index) {
- return '<a class="record_record_update t-update" data-id=' + row.id + '>更新</a>';
- }
- }
- ]],
- loadFilter: function(e) {
- return {
- total: e.data.count,
- rows: e.data.list
- };
- },
- onLoadSuccess: function() {
- // base.delInfo('.iso-noticeMag-del', config.noticeMag.toDelete, '#noticeMag-info');
- update();
- }
- });
- }
- function update(){
- $(".record_record_update").off("click").on("click",function(){
- // e.preventDefault();
- //渲染window窗口
- base.renderwindow('.bd-w', {
- width: 750,
- height: 300,
- top: 50,
- title: '修改阀值'
- });
- // e.preventDefault();
- // base.renderwindow('.bd-w',
- // {
- // title: '修改阀值',
- // width: 450,
- // height: 250,
- // });
- var id=$(this).data('id');
- $('.bd-w').window('open');
- //将id的值绑定到确认按钮上
- base.ajaxFunc('get', config.threshold.getById, {id: id}, function(e) {
- var row = e.obj;
- $('.bd-w-form').form("clear").form('load',row);
- //当鼠标移动到文本框时显示该文本框的信息内容
- $(".bd-w-form input,textarea").each(function(i) {
- var str=$(this).val();
- $(this).attr("title", $(this).val());
- });
- doupdate();
- });
- });
- }
- function doupdate(){
- $(".btn-add-new").off().on("click",function(){
- var data = $('.bd-w-form').serializeArray();
- var valresult=$(".bd-w-form").form('validate');
- if(!valresult){
- $.messager.alert('提示', base.tooltip, 'info');
- return;
- }
- base.ajaxFunc('post', config.threshold.toUpdate, data, function(e) {
- base.requestTip(e, '.bd-w', '#base-table', 0);
- });
- });
- }
- function search(){
- $(".bd-search").off("click").on("click",function(){
- if(!$('.search-nameOther').textbox('isValid')) return;
- var type = $('.search-typeOther').combobox('getValue');
- var name = $('.search-nameOther').textbox('getValue');
- loadData(type,name);
- });
- }
- </script>
|