108 lines
4.3 KiB
Plaintext
108 lines
4.3 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||
<%@page import="com.sipai.tools.CommString" %>
|
||
<%request.setAttribute("Flag_Active", CommString.Flag_Active); %>
|
||
<%request.setAttribute("Flag_Unactive", CommString.Flag_Unactive); %>
|
||
|
||
<script type="text/javascript">
|
||
|
||
$(function () {
|
||
$("#active").select2({minimumResultsForSearch: 10}).val("${Flag_Active}").trigger("change");
|
||
})
|
||
|
||
function doSave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/base/basicHomePage/save.do", $("#subForm").serialize(), function (data) {
|
||
if (data.res == 1) {
|
||
initTreeView();
|
||
} else if (data.res == 0) {
|
||
showAlert('d', '保存失败');
|
||
} else {
|
||
showAlert('d', data.res);
|
||
}
|
||
}, 'json');
|
||
}
|
||
|
||
}
|
||
|
||
// $("#subForm").bootstrapValidator({
|
||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
// fields: {
|
||
// url: {
|
||
// validators: {
|
||
// notEmpty: {
|
||
// message: '地址不能为空'
|
||
// }
|
||
// }
|
||
// }
|
||
// }
|
||
// });
|
||
|
||
var showUser4SelectsFun = function () {
|
||
var userIds = $("#unrolepeople").val();
|
||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {
|
||
formId: "subForm",
|
||
hiddenId: "unrolepeople",
|
||
textId: "unrolepeopleName",
|
||
userIds: userIds
|
||
}, function (data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal("user4SelectModal");
|
||
});
|
||
};
|
||
|
||
</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>
|
||
<%-- <a onclick="del()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i--%>
|
||
<%-- class="glyphicon glyphicon-trash"></i></a>--%>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<input id="unitid" name="unitid" type="hidden" value="${param.unitId}" />
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">启用</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="active" name="active" style="width:220px;">
|
||
<option value="${Flag_Active}">启用</option>
|
||
<option value="${Flag_Unactive}">禁用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">地址</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control" id="url" name="url" placeholder="地址" >
|
||
</div>
|
||
</div>
|
||
<c:if test="${userId==emp01}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">不可见用户</label>
|
||
<div class="col-sm-10">
|
||
<textarea type="text" style="height: 80px;" class="form-control" id="unrolepeopleName"
|
||
name="unrolepeopleName" placeholder="不可见用户" onclick="showUser4SelectsFun();"
|
||
readonly>${basicHomePage.unrolepeopleName}</textarea>
|
||
<input id="unrolepeople" name="unrolepeople" type="hidden"
|
||
value="${dataVisualFrame.unrolepeople}"/>
|
||
</div>
|
||
</div>
|
||
</c:if>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|