146 lines
5.4 KiB
Plaintext
146 lines
5.4 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.tools.CommString" %>
|
||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||
|
||
<!-- bootstrap switch -->
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||
charset="utf-8"></script>
|
||
|
||
<style type="text/css">
|
||
|
||
</style>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
$("#active").select2({minimumResultsForSearch: -1}).val("${appMenuitem.active}").trigger("change");
|
||
});
|
||
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||
//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/app/appMenuitem/doupdate.do", $("#subForm").serialize(), function (data) {
|
||
if (data.code == 1) {
|
||
initTreeView();
|
||
} else if (data.code == 0) {
|
||
showAlert('d', data.msg);
|
||
} else {
|
||
showAlert('d', data.code);
|
||
}
|
||
}, 'json');
|
||
}
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
morder: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '排序不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
|
||
function dodel(id) {
|
||
swal({
|
||
text: "您确定要删除此记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function (willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/app/appMenuitem/dodel.do', {id: id}, function (data) {
|
||
if (data.code == 1) {
|
||
initTreeView();
|
||
} else {
|
||
showAlert('d', data.msg, 'alertDiv');
|
||
}
|
||
}, 'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
</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="dodel('${appMenuitem.id}')" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||
class="glyphicon glyphicon-trash"></i></a>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<form class="form-horizontal" id="subForm" autocomplete="off">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" name="id" id="id" value="${appMenuitem.id}"/>
|
||
<input type="hidden" name="pid" id="pid" value="${appMenuitem.pid}"/>
|
||
|
||
<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="${appMenuitem.name}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">启用</label>
|
||
<div class="col-sm-4">
|
||
<select id="active" name="active" class="form-control select2">
|
||
<option value="${Active_True}">启用</option>
|
||
<option value="${Active_False}">禁用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">顺序</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||
value="${appMenuitem.morder}">
|
||
</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="location" name="location" placeholder="地址"
|
||
value="${appMenuitem.location}">
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|