184 lines
7.3 KiB
Plaintext
184 lines
7.3 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
|||
|
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
|||
|
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
|||
|
|
<%@page import="com.sipai.entity.data.DataCurve" %>
|
|||
|
|
<% request.setAttribute("Type_group", DataCurve.Type_group);%>
|
|||
|
|
<% request.setAttribute("Type_sys", DataCurve.Type_sys);%>
|
|||
|
|
<% request.setAttribute("Type_user", DataCurve.Type_user);%>
|
|||
|
|
<style type="text/css">
|
|||
|
|
.select2-container .select2-selection--single {
|
|||
|
|
height: 34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.select2-selection__arrow {
|
|||
|
|
margin-top: 3px;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/data/saveCurve.do", $("#subForm").serialize(), function (result) {
|
|||
|
|
var data = $.parseJSON(result);
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
initTreeView();
|
|||
|
|
// showAlert('s','保存成功');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.msg);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// _pname: {
|
|||
|
|
// validators: {
|
|||
|
|
// notEmpty: {
|
|||
|
|
// message: '上级菜单不能为空'
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// },
|
|||
|
|
morder: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '顺序不能为空'
|
|||
|
|
},
|
|||
|
|
regexp: {
|
|||
|
|
regexp: /^[0-9]*$/,
|
|||
|
|
message: '顺序必须为数字'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function changeType() {
|
|||
|
|
let type = $('#type').val();
|
|||
|
|
console.log(type)
|
|||
|
|
if (type == '${Type_group}') {
|
|||
|
|
$('#sysShow').css('display', 'none');
|
|||
|
|
} else if (type == '${Type_sys}') {
|
|||
|
|
$('#sysShow').css('display', 'block');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
<div class="box box-primary">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">新增</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
|||
|
|
class="glyphicon glyphicon-floppy-disk"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<form class="form-horizontal " id="subForm">
|
|||
|
|
<input id="id" name="id" type="hidden" value="${curve.id}"/>
|
|||
|
|
<input id="unitId" name="unitId" type="hidden" value="${param.unitId}"/>
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div id="menu4SelectDiv"></div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
|||
|
|
value="${curve.name }">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">上级名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="pname" name="pname" placeholder="上级菜单"
|
|||
|
|
onclick="showMenu4SelectFun();"
|
|||
|
|
<c:if test="${!empty pname}">value="${pname}" </c:if>
|
|||
|
|
<c:if test="${empty pname}">value="-1"</c:if> readonly>
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">顺序</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
|||
|
|
value="${curve.morder}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="type" name="type" class="form-control select2" onchange="changeType();">
|
|||
|
|
<option value="${Type_group}">分组</option>
|
|||
|
|
<option value="${Type_sys}">系统曲线</option>
|
|||
|
|
<!-- <option value="${Type_user}" >用户曲线</option> -->
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div id="sysShow" style="display: none;">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">曲线类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="curvetype" name="curvetype" class="select2"
|
|||
|
|
style="height: 34px;padding: 0px 10px;border-color: #d2d6de;">
|
|||
|
|
<option value="0" selected>折线图</option>
|
|||
|
|
<option value="1">柱状图</option>
|
|||
|
|
<option value="2">散点图</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">轴类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="axistype" name="axistype" class="select2"
|
|||
|
|
style="height: 34px;padding: 0px 10px;border-color: #d2d6de;">
|
|||
|
|
<option value="1" selected>单Y轴</option>
|
|||
|
|
<option value="0">多Y轴</option>
|
|||
|
|
<option value="2">多表</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">备注</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="remark" name="remark" value="${curve.remark}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- <div class="box box-solid" id="box">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">测量点配置</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<div >
|
|||
|
|
<div id="alertDiv_power"></div>
|
|||
|
|
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
|||
|
|
<button type="button" class="btn btn-default" onclick="addPowerFun();"><i class="fa fa-plus"></i> 新增</button>
|
|||
|
|
<button type="button" class="btn btn-default" onclick="saveDefault();"><i class="fa fa-plus-square"></i> 默认</button>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div id="powerDiv"></div>
|
|||
|
|
<div id="menu4SelectDiv_func"></div>
|
|||
|
|
<br>
|
|||
|
|
<table id="table"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div> -->
|