326 lines
7.7 KiB
Plaintext
326 lines
7.7 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
|
<!DOCTYPE html >
|
|
<html lang="en">
|
|
<head>
|
|
<%@include file="../../baseset.jsp" %>
|
|
<%@include file="../../systemset.jsp" %>
|
|
<style type="text/css">
|
|
.ui-state-focus{
|
|
display: none !important;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="page-content">
|
|
<div class="row-fluid">
|
|
<div class="col-xs-12">
|
|
<form id="baseForm" class="form-inline" method="POST" onsubmit="return false;">
|
|
<div class="widget-header widget-header-large" style="padding:10px;">
|
|
<div class="widget-main customBtn" >
|
|
<span>字典名称:</span><input id="keyWord" type="text" name="keyWord" />
|
|
<button class="btn btn-success btn-sm" onclick="getbaseList(1)" id="search" title="查询" type="button">查询</button>
|
|
</div>
|
|
<div class="widget-toolbar customBtn">
|
|
<a href="#" title="增加" id="addBtn" onclick="add()" class="lrspace3" ><i class='icon-plus-sign color bigger-180'></i></a>
|
|
<a href="#" title="批量删除" id="delBatchBtn" onclick="batchDelete()" class="lrspace3" ><i class='icon-trash color-red bigger-180'></i></a>
|
|
<a href="#" title="刷新" id="searchBtn" onclick="getbaseList()" class="lrspace3" ><i class='icon-refresh bigger-180 orange'></i></a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<table id="baseTable" class="table table-striped table-bordered table-hover" >
|
|
<thead>
|
|
<tr>
|
|
<th style="width:5%" class="center">
|
|
<!-- <label><input type="checkbox" class="ace" ><span class="lbl"></span></label> -->
|
|
选择
|
|
</th>
|
|
<th style="width:15%" class="center hidden-480">ID</th>
|
|
<th style="width:15%" class="center">字典类型</th>
|
|
<th style="width:15%" class="center">字典名称</th>
|
|
<th style="width:15%" class="center">字典值</th>
|
|
<th style="width:15%" class='center hidden-480'>是否启用</th>
|
|
<th style="width:20%" class="center">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
<img id="img">
|
|
</table>
|
|
<!-- #dialog-confirm -->
|
|
<%@include file="../../dialog.jsp" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="${bonuspath}/static/js/sys/sysDictType.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 启动执行
|
|
* @returns
|
|
*/
|
|
$(function () {
|
|
|
|
getbaseList(1);
|
|
$("#baseForm").keydown(function(e) {
|
|
keycode = e.which || e.keyCode;
|
|
if (keycode == 13) {
|
|
search();
|
|
}
|
|
});
|
|
|
|
$(".js-example-basic-single").select2({
|
|
"language": "zh-CN"
|
|
});
|
|
|
|
});
|
|
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-26
|
|
* @function 条件查询
|
|
* @returns
|
|
*/
|
|
function search(){
|
|
$("#search").trigger("click")
|
|
}
|
|
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 增加tr整行的双击选择事件
|
|
* @returns
|
|
*/
|
|
function setChecked(id){
|
|
if($("#inp"+id).is(':checked')){
|
|
$("#inp"+id).prop("checked", false);
|
|
}else{
|
|
$("#inp"+id).prop("checked", true);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 初始化页面ajax请求 返回html页面
|
|
* @returns
|
|
*/
|
|
function getbaseList(init){
|
|
|
|
if(!JY.Object.notNull(init) && JY.Object.notNull($("#pageNum").val())){
|
|
init = $("#pageNum").val();
|
|
}
|
|
|
|
var data = {pageNum:init};
|
|
var size = $("#pageSize").val();
|
|
if(JY.Object.notNull(size)){
|
|
data = {pageNum:init,pageSize:size};
|
|
}
|
|
var keyWord = $("#keyWord").val();
|
|
if(JY.Object.notNull(keyWord)){
|
|
data.keyWord = keyWord;
|
|
}
|
|
|
|
JY.Model.loading();
|
|
$.ajax({
|
|
type:"POST",
|
|
url:bonuspath +'/backstage/sysDataDict/findByPage',
|
|
data: data,
|
|
dataType:"html",
|
|
success:function(data){
|
|
$("#baseTable tbody").html(data);
|
|
JY.Model.loadingClose();
|
|
}
|
|
})
|
|
}
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 跳转页面
|
|
* @returns
|
|
*/
|
|
function toPage(pageNum){
|
|
getbaseList(pageNum);
|
|
}
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 跳转页面
|
|
* @returns
|
|
*/
|
|
function jumpPage(){
|
|
var pageNum = $("#inp").val();
|
|
var max = parseInt($("#inp").attr("max"));
|
|
if(!JY.Object.notNull(pageNum)){
|
|
pageNum = 1;
|
|
}
|
|
if(pageNum > max){
|
|
pageNum = max;
|
|
}
|
|
getbaseList(pageNum);
|
|
}
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 改变pageSize
|
|
* @returns
|
|
*/
|
|
function setPageSize(){
|
|
$("#pageSize").val($("#size").val());
|
|
getbaseList(1);
|
|
}
|
|
|
|
function batchDelete(){
|
|
var ids = "";
|
|
$("#baseTable tbody input:checkbox:checked").each(function(){
|
|
if(ids == ""){
|
|
ids=$(this).val();
|
|
}else{
|
|
ids += "," + $(this).val();
|
|
}
|
|
});
|
|
|
|
if(ids == ""){
|
|
JY.Model.info("请选择要删除的字典数据",function(){
|
|
});
|
|
return;
|
|
}
|
|
$.ajax({
|
|
type:"POST",
|
|
url:bonuspath +'/backstage/sysDataDict/batchDelete',
|
|
data: {ids:ids},
|
|
success:function(data){
|
|
data = JSON.parse(data);
|
|
JY.Model.info(data.resMsg,function(){
|
|
search();
|
|
});
|
|
}
|
|
})
|
|
}
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-27
|
|
* @function 字典值页面
|
|
* @returns
|
|
*/
|
|
function view(){
|
|
|
|
getDataDictList(1);
|
|
|
|
|
|
JY.Model.viewSetWidth(1000,"auAddDiv","字典类型详情",function(){});
|
|
}
|
|
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-24
|
|
* @function 初始化页面ajax请求 返回html页面
|
|
* @returns
|
|
*/
|
|
function getDataDictList(init){
|
|
var data = {pageNum:init};
|
|
var size = $("#pageSize").val();
|
|
if(JY.Object.notNull(size)){
|
|
data = {pageNum:init,pageSize:size};
|
|
}
|
|
JY.Model.loading();
|
|
$.ajax({
|
|
type:"POST",
|
|
url:bonuspath +'/backstage/sysDataDict/findByPage',
|
|
data: data,
|
|
dataType:"html",
|
|
success:function(data){
|
|
$("#dataDictList tbody").html(data);
|
|
JY.Model.loadingClose();
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-27
|
|
* @function 增加数据类型
|
|
* @returns
|
|
*/
|
|
function add(){
|
|
var index = layer.open({
|
|
type: 2,
|
|
title: "数据字典增加",
|
|
shade: [0],
|
|
btn: ['保存', '取消'], //按钮组
|
|
area: ['50%', '50%'],
|
|
anim: 2,
|
|
yes: function(index,layero){//layer.msg('yes'); //点击确定回调
|
|
var obj = $(layero).find("iframe")[0].contentWindow;
|
|
var value=obj.getInfo();
|
|
$.ajax({
|
|
type:'POST',
|
|
url:bonuspath+'/backstage/sysDataDict/add',
|
|
data:JSON.stringify(value),
|
|
contentType: "application/json",
|
|
success:function(data) {
|
|
data = JSON.parse(data);
|
|
JY.Model.info(data.resMsg,function(){
|
|
getbaseList();
|
|
});
|
|
}
|
|
});
|
|
|
|
layer.close(index);
|
|
},
|
|
content: [bonuspath +'/backstage/sysDataDict/toAdd']
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @author 无畏
|
|
* @date 2019-05-27
|
|
* @function 增加数据类型
|
|
* @returns
|
|
*/
|
|
function view(id){
|
|
var index = layer.open({
|
|
type: 2,
|
|
title: "数据字典增加",
|
|
shade: [0],
|
|
btn: ['保存', '取消'], //按钮组
|
|
area: ['300px', '350px'],
|
|
anim: 2,
|
|
yes: function(index,layero){//layer.msg('yes'); //点击确定回调
|
|
var obj = $(layero).find("iframe")[0].contentWindow;
|
|
var value=obj.getInfo();
|
|
$.ajax({
|
|
type:'POST',
|
|
url:bonuspath+'/backstage/sysDataDict/update',
|
|
data:JSON.stringify(value),
|
|
contentType: "application/json",
|
|
success:function(data) {
|
|
data = JSON.parse(data);
|
|
JY.Model.info(data.resMsg,function(){
|
|
search();
|
|
});
|
|
}
|
|
});
|
|
layer.close(index);
|
|
},
|
|
content: [bonuspath +'/backstage/sysDataDict/toAdd?id='+id, 'no']
|
|
});
|
|
}
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html> |