物联网平台 +Web 组态
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

146 lines
5.2 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.lp.cfg.ProConfig" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/WEB-INF/oss/base/common/variable.jsp"%>
<%@ include file="/WEB-INF/oss/base/common/resource_lib.jsp"%>
<%@ include file="/WEB-INF/oss/base/common/variable_js.jsp"%>
<style type="text/css">
.self-base-icon{
padding: 0 10px;
font-size: 14px;
cursor: pointer;
}
.self-base-icon:HOVER {
color: #00aaee;
}
.span-name{
display: inline-block;
width: 70px;
}
</style>
</head>
<body>
<div class="app-container">
<div class="search-condition" type-option="search_table" config-option=" 'submit':'#searchbtns',
'table':'#init-table' ">
<input type-name="name" placeholder="名称查询" id="sub-name-alias" style="width: 100px;" class="input input-auto" />
<button id="searchbtns" class="button ml-20 bg-sub"><span class="icon-search"></span> 查询</button>
<button type-option="button" class="button ml-10 bg-sub"
config-option="'type':'window','title':'增加LPM','selector':'#add','width':'460px','before':'beforeFunc' " ><span class="icon-plus"></span> 增加LPM</button>
</div>
<div>
<div id="init-table" type-option="table" config-option="'url':'/page/lpm',
'param':{ },
'columns':[
{'name':'序号','type':'seq','value':'seq','width':'6%'},
{'name':'名称','value':'name','width':'10%'},
{'name':'IP','value':'ip','width':'15%'},
{'name':'PORT','value':'port','width':'10%'},
{'name':'LPM-KEY','type':'value','value':'lpm_key','width':'16%'},
{'name':'操作','type':'self','value_callback':'value_function','width':'18%'}]" >
</div>
</div>
</div>
<div style="display:none;padding:20px;" id="add"
type-option="form_submit" config-option=" 'url':'/lpm',
'submit':'#add-Btn',
'success':'sunccessReturn',
'validate':{ 'tigger':'focusout,submit','style':'color,pop'} ">
<div>
<span class="span-name">名称:</span>
<input validate="empty" type-name="name" style="width: 340px;" placeholder="请输入名称" class="input input-auto"/>
</div>
<div style="margin-top: 10px;">
<span class="span-name">IP:</span>
<input validate="empty" type-name="ip" style="width: 340px;" placeholder="请输入ip" class="input input-auto" />
</div>
<div style="margin-top: 10px;">
<span class="span-name">PORT:</span>
<input type-name="port" validate="empty" style="width: 340px;" placeholder="请输入端口" class="input input-auto" />
</div>
<div style="margin-top: 10px;">
<span class="span-name">LPM-KEY:</span>
<input type-name="lpm_key" placeholder="请输入LPM KEY" style="width: 340px;" class="input input-auto" />
</div>
<div style="margin-top: 10px;">
<button id="add-Btn" class="button button-small" >保存</button>
</div>
</div>
<div style="display:none;padding:20px;" id ="table-detail-info"
type-option="form_submit" config-option=" 'url':'/lpm',
'method':'PUT',
'submit':'#update_btn',
'success':'sunccessReturn',
'validate':{ 'tigger':'focusout,submit','style':'color,pop'}" >
<div id="detail_get" config-option=" url:'/lpm?id=$#init-id$' ">
<input type-name="id" id="init-id" type="hidden" />
<div>
<span class="span-name">名称:</span>
<input validate="empty" type-name="name" style="width: 340px;" placeholder="请输入名称" class="input input-auto"/>
</div>
<div style="margin-top: 10px;">
<span class="span-name">IP:</span>
<input validate="empty" type-name="ip" style="width: 340px;" placeholder="请输入ip" class="input input-auto" />
</div>
<div style="margin-top: 10px;">
<span class="span-name">PORT:</span>
<input type-name="port" validate="empty" style="width: 340px;" placeholder="请输入端口" class="input input-auto" />
</div>
<div style="margin-top: 10px;">
<span class="span-name">LPM-KEY:</span>
<input type-name="lpm_key" placeholder="请输入LPM KEY" style="width: 340px;" class="input input-auto" />
</div>
<div style="margin-top: 10px;">
<button id="update_btn" class="button button-small" >保存</button>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function value_function(data,seq){
return "<span tag='编辑' onclick='t_edit(this,"+data.id+")' class='self-base-icon icon-edit'>编辑</span>"+
"<span tag='删除' onclick='t_delete(this,"+data.id+")' class='self-base-icon icon-bitbucket'>删除</span>";
}
function beforeFunc(){
}
function sunccessReturn(data){
if( data.status == status_code.OK ){
tip("成功");
setTimeout(function(){
closeAll();
$("#init-table").tableAdaptor();
},1000)
}else{
tip(data.statusMsg);
}
}
function t_edit(obj,id){
writeVal("init-id",id);
openWindow("编辑LPM","#table-detail-info","460px");
manual_init_detail_get($("#detail_get"));
}
function t_delete(obj,id){
lcomfirm('是否确定删除该LPM?',function(){
commonAjax("DELETE",localUrl+"/lpm?id="+id, "",function(){
tip("删除成功");
setTimeout(function(){
closeAll();
$("#init-table").tableAdaptor();
},1000)
});
});
}
</script>
</html>