first commit
This commit is contained in:
52
WebRoot/jsp/base/basicComponents4select.jsp
Normal file
52
WebRoot/jsp/base/basicComponents4select.jsp
Normal file
@ -0,0 +1,52 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var selectcompany = function () {
|
||||
alert('${param.hiddenId}' + '${param.textId}');
|
||||
}
|
||||
$(function () {
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
// console.info(data);
|
||||
if (data.length > 0) {
|
||||
$('#company_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#company_select_tree').on('nodeSelected', function (event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}').val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
//更新权限选择框
|
||||
if ($('#_roles').length > 0) {
|
||||
$('#_roles').empty();
|
||||
showRoleSelectFun();
|
||||
}
|
||||
//更新工艺段选择框
|
||||
if ($('#_process').length > 0) {
|
||||
$('#_process').empty();
|
||||
showProcessSelectFun();
|
||||
}
|
||||
closeModal("company4SelectModal");
|
||||
});
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="company4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择公司</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="company_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectcompany()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
182
WebRoot/jsp/base/basicComponentsAdd.jsp
Normal file
182
WebRoot/jsp/base/basicComponentsAdd.jsp
Normal file
@ -0,0 +1,182 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%request.setAttribute("UNIT_TYPE_BIZ",com.sipai.tools.CommString.UNIT_TYPE_BIZ);%>
|
||||
<%request.setAttribute("UNIT_TYPE_DEPT",com.sipai.tools.CommString.UNIT_TYPE_DEPT);%>
|
||||
<%request.setAttribute("Flag_Active",com.sipai.tools.CommString.Flag_Active);%>
|
||||
<%request.setAttribute("Flag_Unactive",com.sipai.tools.CommString.Flag_Unactive);%>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title></title>
|
||||
<script type="text/javascript">
|
||||
function doSaveCompany() {
|
||||
$("#companyAddForm").data('bootstrapValidator').resetForm();
|
||||
$("#companyAddForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#companyAddForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/user/saveCompany.do", $("#companyAddForm").serialize(), function (data) {
|
||||
//console.log("data",data);
|
||||
if (data.res == "1") {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#companyAddForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
longitude: {
|
||||
validators: {
|
||||
regexp: {
|
||||
regexp: /^(([^0][0-9]+|0)\.([0-9]{1,2}))$/,
|
||||
message: '请输入正确的经度'
|
||||
}
|
||||
}
|
||||
},
|
||||
latitude: {
|
||||
validators: {
|
||||
regexp: {
|
||||
regexp: /^(([^0][0-9]+|0)\.([0-9]{1,2}))$/,
|
||||
message: '请输入正确的纬度'
|
||||
}
|
||||
}
|
||||
},
|
||||
ename: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '英文编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showCompanySelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/showCompany4Select.do', { formId: "companyAddForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#company4SelectDiv").html(data);
|
||||
openModal('company4SelectModal');//待加
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#active").select2({ minimumResultsForSearch: 10 }).val("${Flag_Active}").trigger("change");
|
||||
fixSelect2ToForm("active");
|
||||
//若要添加水厂 id手动输入
|
||||
if ("${type}" == "${UNIT_TYPE_BIZ}") {
|
||||
document.getElementById('biz_id').style.display = 'block';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doSaveCompany()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="companyAddForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="company4SelectDiv"></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=""
|
||||
style="border-radius:4px">
|
||||
</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="上级"
|
||||
style="border-radius:4px;background-color: white;" readonly onclick="showCompanySelectFun();"
|
||||
value="${pname}">
|
||||
<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="sname" name="sname" placeholder="简称" value=""
|
||||
style="border-radius:4px" />
|
||||
<input id="type" name="type" type="hidden" value="${type}" />
|
||||
</div>
|
||||
<div id="biz_id" style="display:none;">
|
||||
<label class="col-sm-2 control-label">水厂编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="id" name="id" placeholder="编号" value=""
|
||||
style="border-radius:4px" />
|
||||
</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="longitude" name="longitude" placeholder="经度"
|
||||
style="border-radius:4px" value="">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">纬度</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="latitude" name="latitude" placeholder="纬度"
|
||||
style="border-radius:4px;" value="">
|
||||
</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="address" name="address" placeholder="地址" value=""
|
||||
style="border-radius:4px">
|
||||
</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="ename" name="ename" placeholder="规则编码"
|
||||
style="border-radius:4px" value="">
|
||||
</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=""
|
||||
style="border-radius:4px">
|
||||
</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="${Flag_Active}">启用</option>
|
||||
<option value="${Flag_Unactive}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
509
WebRoot/jsp/base/basicComponentsEdit.jsp
Normal file
509
WebRoot/jsp/base/basicComponentsEdit.jsp
Normal file
@ -0,0 +1,509 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<script type="text/javascript">
|
||||
/*** 上半部分 */
|
||||
var show4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/base/basicComponents/show4Select.do', { formId: "basicComponentsForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#basicComponents4SelectDiv").html(data);
|
||||
openModal("basicComponents4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var floorTbName = "TB_doc_file";
|
||||
var showUnit4SelectCopyFun = function () {
|
||||
$.post(ext.contextPath + '/base/basicComponents/showUnit4Select_Limited.do', { formId: "basicComponentsForm", hiddenId: "copyId", textId: "copyName" }, function (data) {
|
||||
$("#unit4SelectCopyDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
$("#basicComponentsForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
longitude: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '经度不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^(([^0][0-9]+|0)\.([0-9]{1,10})$)|^([^0][0-9]+|0)$/,
|
||||
message: '请输入正确的经度'
|
||||
}
|
||||
}
|
||||
},
|
||||
latitude: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '纬度不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^(([^0][0-9]+|0)\.([0-9]{1,10})$)|^([^0][0-9]+|0)$/,
|
||||
message: '请输入正确的纬度'
|
||||
}
|
||||
}
|
||||
},
|
||||
ename: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '英文编码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doSave() {
|
||||
$("#basicComponentsForm").data('bootstrapValidator').resetForm();
|
||||
$("#basicComponentsForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#basicComponentsForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/base/basicComponents/update.do", $("#basicComponentsForm").serialize(), function (data) {
|
||||
if (data.res == "1") {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
function del() {
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/delete.do', $("#basicComponentsForm").serialize(), function (data) {
|
||||
if (data.res > 0) {
|
||||
showAlert('s', '删除成功');
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//文件导入
|
||||
var fileinput = function () {
|
||||
//var url='/maintenance/updateProblemFile.do';//保存数据表方法
|
||||
$.post(ext.contextPath + '/base/fileinput.do', { masterId: masterId, tbName: tbName, nameSpace: nameSpace }, function (data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
};
|
||||
var masterId = $('#id').val();
|
||||
var tbName = 'TB_doc_file'; //数据表
|
||||
var nameSpace = 'File';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', { masterId: masterId, tbName: tbName }, function (data) {
|
||||
//console.info(data)
|
||||
previews = new Array();
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");;
|
||||
if (data[i].type.indexOf("audio") != -1) {
|
||||
var id = data[i].id;
|
||||
var blob = path;
|
||||
//console.info(blob)
|
||||
if ($("#" + id).length > 0) {
|
||||
continue;
|
||||
}
|
||||
recblob[id] = { blob: blob, rec: rec };
|
||||
|
||||
reclog('<div class="form-group" id=' + id + '> ' + data[i].insdt.substring(0, 16) + '录制 ' +
|
||||
'<div class="btn-group">' +
|
||||
'<button class="btn btn-primary btn-sm" onclick="recplay(\'' + id + '\')" type="button"><i class="fa fa-play " ></i></button>' +
|
||||
'<button class="btn btn-danger btn-sm" onclick="deleteFIleInput(\'' + id + '\')" type="button"><i class="fa fa-remove "></i></button>' +
|
||||
'</div>' +
|
||||
'</div>');
|
||||
} else {
|
||||
var previewConfig = new Object();
|
||||
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
|
||||
}
|
||||
if (previews.length > 0) {
|
||||
$('#basicComponentsfile').show();
|
||||
showFileInput("basicComponentsfile");
|
||||
} else {
|
||||
$('#basicComponentsfile').hide();
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
/*** 下半部分 */
|
||||
var addUserFun = function () {
|
||||
$.post(ext.contextPath + '/base/basicComponents/addUser.do', {}, function (data) {
|
||||
$("#userDiv").html(data + "<div id='unit4SelectDiv'></div> ");
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var delUserFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/deleteUsers.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '禁用失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var editUserFun = function (id) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/editUser.do', { id: id }, function (data) {
|
||||
$("#userDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//重置密码
|
||||
var pwdFun = function (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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/resetPassword.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
showAlert('s', '重置成功', 'mainAlertdiv');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '重置失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$("#copyPatrolForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
copyName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '复制模板不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#active").select2({ minimumResultsForSearch: 10 }).val("${basicComponents.active}").trigger("change");
|
||||
fixSelect2ToForm("active");
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/base/basicConfigure/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
pid:'${basicComponents.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [/*{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},*/
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: '_pname', // 返回json数据中的name
|
||||
title: '上级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '形式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 'file':
|
||||
return '附件';
|
||||
case 'text':
|
||||
return '文字';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '禁用';
|
||||
case '1':
|
||||
return '启用';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str+='<button class="btn btn-default btn-sm" title="编辑" onclick="editConfigureFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str+='<button class="btn btn-default btn-sm" title="启用" onclick="useConfigureFun(\'' + row.id + '\')"><i class="fa fa-repeat"></i></button>';
|
||||
str='<div class="btn-group" >'+str+'</div>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
$(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' })
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
getFileList();
|
||||
|
||||
});
|
||||
</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>
|
||||
<security:authorize buttonUrl="user/delete.do">
|
||||
<a onclick="del()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="basicComponentsForm">
|
||||
<input id="id" name="id" type="hidden" value="${basicComponents.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="basicComponents4SelectDiv"></div>
|
||||
<div id="unit4SelectCopyDiv"></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="名称"
|
||||
style="border-radius:4px" value="${basicComponents.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="上级"
|
||||
style="border-radius:4px;background-color: white;" onclick="show4SelectFun();"
|
||||
value="${pname}" readonly>
|
||||
<input id="pid" name="pid" type="hidden" value="${basicComponents.pid}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*ID编码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name=""code"" placeholder="ID编码"
|
||||
style="border-radius:4px" value="${basicComponents.code}">
|
||||
</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="顺序"
|
||||
style="border-radius:4px" value="${basicComponents.morder}">
|
||||
</div>
|
||||
<security:authorize buttonUrl="user/delete.do">
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="active" name="active" class="form-control select2">
|
||||
<option value="1">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">配置内容</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_user"></div>
|
||||
<div id="userDiv"></div>
|
||||
<div id="user4SelectDiv_func"></div>
|
||||
<br>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
180
WebRoot/jsp/base/basicComponentsManage.jsp
Normal file
180
WebRoot/jsp/base/basicComponentsManage.jsp
Normal file
@ -0,0 +1,180 @@
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css" />
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var nodeid = "-1";//树指针的全局变量
|
||||
var addFun = function (type) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/showAdd.do', { pid: nodeid, type: type }, function (data) {
|
||||
$("#basicComponentsBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
|
||||
};
|
||||
var deleteFun = function (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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/delete.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicComponents/deletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/base/basicComponents/getBasicComponentsForTree.do', { ng: '' }, function (data) {
|
||||
$('#basicComponentstree').treeview({
|
||||
data: data,
|
||||
showBorder: true,
|
||||
levels: 3,
|
||||
});
|
||||
$('#basicComponentstree').on('nodeSelected', function (event, data) {
|
||||
nodeid = data.id;
|
||||
$.post(ext.contextPath + '/base/basicComponents/edit.do', { id: data.id }, function (data1) {
|
||||
$("#basicComponentsBox").html(data1);
|
||||
});
|
||||
});
|
||||
}, 'json');
|
||||
$("#basicComponentsBox").html("");
|
||||
};
|
||||
$(function () {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<%-- <!-- 引用top --> --%>
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="alertDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">配置项列表</h3>
|
||||
<div class="box-tools">
|
||||
<button type="buttonB" class="btn btn-box-tool" onclick="addFun();" >
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="basicComponentstree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="basicComponentsBox">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
107
WebRoot/jsp/base/basicHomePageAdd.jsp
Normal file
107
WebRoot/jsp/base/basicHomePageAdd.jsp
Normal file
@ -0,0 +1,107 @@
|
||||
<%@ 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>
|
||||
|
||||
137
WebRoot/jsp/base/basicHomePageEdit.jsp
Normal file
137
WebRoot/jsp/base/basicHomePageEdit.jsp
Normal file
@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%@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/update.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == "1") {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
}, 'json');
|
||||
// }
|
||||
}
|
||||
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// url: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '地址不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
function del() {
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicHomePage/delete.do', $("#subForm").serialize(), function (data) {
|
||||
console.log(data)
|
||||
if (data.code > 0) {
|
||||
showAlert('s', '删除成功');
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${basicHomePage.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<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="地址"
|
||||
value="${basicHomePage.url}">
|
||||
</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="${basicHomePage.unrolepeople}"/>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
95
WebRoot/jsp/base/basicHomePageManage.jsp
Normal file
95
WebRoot/jsp/base/basicHomePageManage.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/base/basicHomePage/getBasicHomePageForTree.do', {unitId: unitId}, function (data) {
|
||||
$('#basicHomePagetree').treeview({
|
||||
data: data,
|
||||
showBorder: true,
|
||||
levels: 3,
|
||||
});
|
||||
$('#basicHomePagetree').on('nodeSelected', function (event, data) {
|
||||
$.post(ext.contextPath + '/base/basicHomePage/edit.do', {
|
||||
unitId: data.id
|
||||
}, function (data1) {
|
||||
$("#basicHomePageBox").html(data1);
|
||||
});
|
||||
});
|
||||
}, 'json');
|
||||
$("#basicHomePageBox").html("");
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<%-- <!-- 引用top --> --%>
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="alertDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">配置项列表</h3>
|
||||
<div class="box-tools">
|
||||
<%-- <button type="buttonB" class="btn btn-box-tool" onclick="addFun();" >--%>
|
||||
<%-- <i class="fa fa-plus"></i> 新增--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="basicHomePagetree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="basicHomePageBox">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
47
WebRoot/jsp/base/basicHomePageNoRole.jsp
Normal file
47
WebRoot/jsp/base/basicHomePageNoRole.jsp
Normal file
@ -0,0 +1,47 @@
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<%-- <!-- 引用top --> --%>
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<img name="img" id="img" src="<%=request.getContextPath()%>/IMG/noRole.png" style="width: 100%;height: 100%;" />
|
||||
<%-- <!-- Main content -->--%>
|
||||
<%-- <section class="content container-fluid">--%>
|
||||
<%-- <div id="alertDiv"></div>--%>
|
||||
<%-- <div id="subDiv"></div>--%>
|
||||
|
||||
<%-- <div id="main" style="width: 100%;height: 100%;"></div>--%>
|
||||
|
||||
<%-- </section>--%>
|
||||
<%-- <!-- /.content -->--%>
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
135
WebRoot/jsp/base/basicHomePageRoleEdit.jsp
Normal file
135
WebRoot/jsp/base/basicHomePageRoleEdit.jsp
Normal file
@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%@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/update.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == "1") {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
}, 'json');
|
||||
// }
|
||||
}
|
||||
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// url: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '地址不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
function del() {
|
||||
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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/base/basicHomePage/delete.do', $("#subForm").serialize(), function (data) {
|
||||
console.log(data)
|
||||
if (data.code > 0) {
|
||||
showAlert('s', '删除成功');
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${basicHomePage.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<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="地址"
|
||||
value="${basicHomePage.url}">
|
||||
</div>
|
||||
</div>
|
||||
<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="${basicHomePage.unrolepeople}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
95
WebRoot/jsp/base/basicHomePageRoleManage.jsp
Normal file
95
WebRoot/jsp/base/basicHomePageRoleManage.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ 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" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/base/basicHomePage/getBasicHomePageForTree.do', {unitId: unitId}, function (data) {
|
||||
$('#basicHomePagetree').treeview({
|
||||
data: data,
|
||||
showBorder: true,
|
||||
levels: 3,
|
||||
});
|
||||
$('#basicHomePagetree').on('nodeSelected', function (event, data) {
|
||||
$.post(ext.contextPath + '/base/basicHomePage/roleEdit.do', {
|
||||
unitId: data.id
|
||||
}, function (data1) {
|
||||
$("#basicHomePageBox").html(data1);
|
||||
});
|
||||
});
|
||||
}, 'json');
|
||||
$("#basicHomePageBox").html("");
|
||||
};
|
||||
|
||||
$(function () {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<%-- <!-- 引用top --> --%>
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="alertDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">配置项列表</h3>
|
||||
<div class="box-tools">
|
||||
<%-- <button type="buttonB" class="btn btn-box-tool" onclick="addFun();" >--%>
|
||||
<%-- <i class="fa fa-plus"></i> 新增--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="basicHomePagetree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="basicHomePageBox">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
101
WebRoot/jsp/base/fileInputForProcess.jsp
Normal file
101
WebRoot/jsp/base/fileInputForProcess.jsp
Normal file
@ -0,0 +1,101 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var filelist = new Array();
|
||||
var control;
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync:true,
|
||||
allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,//是否显示拖拽区域
|
||||
dropZoneEnabled: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
});
|
||||
/* control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
}); */
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
closeModal('fileInputModal');
|
||||
getFileList_process();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
initFileInput("filelist",ext.contextPath+ "/base/inputFile.do");
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function uploadFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!','alertFileDiv');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<div id="alertFileDiv"></div>
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group" >
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
102
WebRoot/jsp/base/fileInputForProcessMore.jsp
Normal file
102
WebRoot/jsp/base/fileInputForProcessMore.jsp
Normal file
@ -0,0 +1,102 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var filelist = new Array();
|
||||
var control;
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync:true,
|
||||
allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,//是否显示拖拽区域
|
||||
dropZoneEnabled: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}',
|
||||
"typeId": '${typeId}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
});
|
||||
/* control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
}); */
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
closeModal('fileInputModal');
|
||||
getFileList_process();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
initFileInput("filelist",ext.contextPath+ "/base/inputFilemore.do");
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function uploadFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!','alertFileDiv');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<div id="alertFileDiv"></div>
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group" >
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
102
WebRoot/jsp/base/fileInputForProcessMore1.jsp
Normal file
102
WebRoot/jsp/base/fileInputForProcessMore1.jsp
Normal file
@ -0,0 +1,102 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var filelist = new Array();
|
||||
var control;
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync:true,
|
||||
allowedFileExtensions : ['pdf'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,//是否显示拖拽区域
|
||||
dropZoneEnabled: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}',
|
||||
"typeId": '${typeId}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
});
|
||||
/* control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
}); */
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
closeModal('fileInputModal');
|
||||
getFileList_process();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
initFileInput("filelist",ext.contextPath+ "/base/inputFilemore.do");
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function uploadFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!','alertFileDiv');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<div id="alertFileDiv"></div>
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group" >
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
94
WebRoot/jsp/base/fileOnlinePic.jsp
Normal file
94
WebRoot/jsp/base/fileOnlinePic.jsp
Normal file
@ -0,0 +1,94 @@
|
||||
<%@ 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" %>
|
||||
<script type="text/javascript">
|
||||
var id = '${id}';//第一次点击查看的图片id
|
||||
var masterId = '${masterId}';
|
||||
var tbName = '${tbName}'; //数据表
|
||||
var nameSpace = '${nameSpace}';//保存文件夹
|
||||
|
||||
var list;
|
||||
var firstNum = 0;
|
||||
var nowNum = 0;
|
||||
var totalNum = 0;
|
||||
|
||||
$(function () {
|
||||
$.post(ext.contextPath + '/base/getPicSwitchJson.do', {
|
||||
id: id,
|
||||
masterId: masterId,
|
||||
tbName: tbName,
|
||||
sdt: '${sdt}',
|
||||
edt: '${edt}',
|
||||
}, function (data) {
|
||||
firstNum = data.firstNum;
|
||||
nowNum = firstNum;
|
||||
list = data.list;
|
||||
// console.log(list)
|
||||
totalNum = list.length - 1;
|
||||
switchPic(list[nowNum]);
|
||||
|
||||
}, 'json');
|
||||
})
|
||||
|
||||
function switchPic(obj) {
|
||||
let id = obj.id;
|
||||
$.post(ext.contextPath + '/base/getNowPicFromSwitch.do', {
|
||||
id: id,
|
||||
bucketName: nameSpace,
|
||||
tbName: tbName,
|
||||
}, function (data) {
|
||||
// console.log(data);
|
||||
$("#filePic").attr("src", "data:image/jpg;base64," + data[0].streamFile);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function doFilePicSwitch(st) {
|
||||
if (st == '0') {
|
||||
nowNum = nowNum - 1;
|
||||
if (nowNum < 0) {
|
||||
nowNum = 0;
|
||||
alert("无上一张图片");
|
||||
} else {
|
||||
switchPic(list[nowNum]);
|
||||
}
|
||||
} else if (st == '1') {
|
||||
nowNum = nowNum + 1;
|
||||
if (nowNum > totalNum) {
|
||||
nowNum = totalNum;
|
||||
alert("无下一张图片");
|
||||
} else {
|
||||
switchPic(list[nowNum]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="fileOnlinePicModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">图片预览</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn pull-left" onclick="doFilePicSwitch('0');">上一张</button>
|
||||
<button type="button" class="btn pull-right" onclick="doFilePicSwitch('1');">下一张</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<img id="filePic" style="width: 100%;height: 100%;" src=""/>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
109
WebRoot/jsp/base/fileinput.jsp
Normal file
109
WebRoot/jsp/base/fileinput.jsp
Normal file
@ -0,0 +1,109 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var filelist = new Array();
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync:true,
|
||||
allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates:{
|
||||
actionDelete:''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
/* console.info(data.response);
|
||||
var id = data.response.msg; //文件上传成功返回的文件名,可返回自定义文件名
|
||||
filelist.push({ id: id, KeyID: previewId }) */
|
||||
getFileList();
|
||||
}
|
||||
});
|
||||
/* control.on('filepredelete', function(event, key, jqXHR, data) {
|
||||
console.log("filelist",filelist);
|
||||
console.log("id",key);
|
||||
for (var i = 0; i < filelist.length; i++) {
|
||||
if (filelist[i].KeyID== key) {
|
||||
$.post(ext.contextPath + "/maintenance/deleteProblemFile.do", {key:filelist[i].id,tbName:'${tbName}'}, function(data) {
|
||||
console.log("resp",data);
|
||||
if (data.suc == true) {
|
||||
}else if(data.suc == false){
|
||||
showAlert('d','删除失败');
|
||||
}else{
|
||||
showAlert('d',data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}); */
|
||||
}
|
||||
$(function() {
|
||||
initFileInput("filelist",ext.contextPath+ "/base/inputFile.do");
|
||||
// initFileInput("filelist",ext.contextPath+ "/base/updateFile.do");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group" >
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
109
WebRoot/jsp/base/fileinputForAcceptanceModel.jsp
Normal file
109
WebRoot/jsp/base/fileinputForAcceptanceModel.jsp
Normal file
@ -0,0 +1,109 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var filelist = new Array();
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync:true,
|
||||
allowedFileExtensions : ['xls','xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates:{
|
||||
actionDelete:''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
/* console.info(data.response);
|
||||
var id = data.response.msg; //文件上传成功返回的文件名,可返回自定义文件名
|
||||
filelist.push({ id: id, KeyID: previewId }) */
|
||||
// getFileList();
|
||||
$("#initialPreviewTable").bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
/* control.on('filepredelete', function(event, key, jqXHR, data) {
|
||||
console.log("filelist",filelist);
|
||||
console.log("id",key);
|
||||
for (var i = 0; i < filelist.length; i++) {
|
||||
if (filelist[i].KeyID== key) {
|
||||
$.post(ext.contextPath + "/maintenance/deleteProblemFile.do", {key:filelist[i].id,tbName:'${tbName}'}, function(data) {
|
||||
console.log("resp",data);
|
||||
if (data.suc == true) {
|
||||
}else if(data.suc == false){
|
||||
showAlert('d','删除失败');
|
||||
}else{
|
||||
showAlert('d',data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}); */
|
||||
}
|
||||
$(function() {
|
||||
initFileInput("filelist",ext.contextPath+ "/achievement/acceptanceModel/inputFile.do");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group" >
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
89
WebRoot/jsp/base/fileinputMinio.jsp
Normal file
89
WebRoot/jsp/base/fileinputMinio.jsp
Normal file
@ -0,0 +1,89 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var filelist = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: true,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose: false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData: function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates: {
|
||||
actionDelete: ''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.suc) {
|
||||
getFileListMinio('${param.divId}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
// initFileInput("filelist",ext.contextPath+ "/base/inputFile.do");
|
||||
initFileInput("filelist", ext.contextPath + "/base/updateFile.do");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
92
WebRoot/jsp/base/fileinputMinioPic.jsp
Normal file
92
WebRoot/jsp/base/fileinputMinioPic.jsp
Normal file
@ -0,0 +1,92 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var filelist = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: true,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose: false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData: function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates: {
|
||||
actionDelete: ''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.suc) {
|
||||
<%--getFileListMinioPic('${param.divId}','edit');--%>
|
||||
// getFileListMinioPic('abnormityFileId', 'edit', '', previews, previewConfigs);
|
||||
getFileListMinioPic('${param.divId}', 'edit', '', previews, previewConfigs);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
// initFileInput("filelist",ext.contextPath+ "/base/inputFile.do");
|
||||
initFileInput("filelist", ext.contextPath + "/base/updateFile.do");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
|
||||
<div class="form-group">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
90
WebRoot/jsp/base/fileinputMinio_Report.jsp
Normal file
90
WebRoot/jsp/base/fileinputMinio_Report.jsp
Normal file
@ -0,0 +1,90 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var filelist = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: true,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose: false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData: function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates: {
|
||||
actionDelete: ''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.suc) {
|
||||
//fileTable
|
||||
$('#fileInputModal').modal('hide')
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
// initFileInput("filelist",ext.contextPath+ "/base/inputFile.do");
|
||||
initFileInput("filelist", ext.contextPath + "/base/updateFile.do");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<div class="form-group">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
90
WebRoot/jsp/base/fileinputMinio_Report_Creat.jsp
Normal file
90
WebRoot/jsp/base/fileinputMinio_Report_Creat.jsp
Normal file
@ -0,0 +1,90 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var filelist = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: true,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose: false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData: function (previewId, index) { //传参
|
||||
var data = {
|
||||
"masterId": '${masterId}', //此处自定义传参
|
||||
"tbName": '${tbName}',
|
||||
"nameSpace": '${nameSpace}'
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates: {
|
||||
actionDelete: ''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if (data.response.suc) {
|
||||
//fileTable
|
||||
$('#fileInputModal').modal('hide')
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initFileInput("filelist", ext.contextPath + "/base/updateFile_creat.do");
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="fileInputModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">上传</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
|
||||
<div class="form-group">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
141
WebRoot/jsp/base/fileupload.jsp
Normal file
141
WebRoot/jsp/base/fileupload.jsp
Normal file
@ -0,0 +1,141 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>文件选择</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/bootstrap-theme.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/syntax.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/styleWebuploader.css">
|
||||
<style type="text/css">
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
.wu-example {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding: 45px 15px 15px;
|
||||
margin: 0;
|
||||
background-color: white;
|
||||
box-shadow: inset 0 3px 6px rgba(0, 0, 0, .05);
|
||||
border-color: #e5e5e5 #eee #eee;
|
||||
border-style: solid;
|
||||
border-width: 1px 0;
|
||||
}
|
||||
|
||||
.uploader-list {
|
||||
width: 100%;
|
||||
height: 260px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.btns {
|
||||
position:relative;
|
||||
top:5px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var $list ;
|
||||
var uploader;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$btn = $('#ctlBtn'),
|
||||
state = 'pending';
|
||||
|
||||
$list = $('#thelist');
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/base/uploadfile.do?mappernamespace=${mappernamespace}&masterid=${masterid}',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: '#picker',
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false
|
||||
});
|
||||
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
//文件上传过程中创建进度条实时显示。
|
||||
uploader.on( 'uploadProgress', function( file, percentage ) {
|
||||
var $li = $( '#'+file.id ),
|
||||
$percent = $li.find('.progress .progress-bar');
|
||||
|
||||
// 避免重复创建
|
||||
if ( !$percent.length ) {
|
||||
$percent = $('<div class="progress progress-striped active">' +
|
||||
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
|
||||
'</div>' +
|
||||
'</div>').appendTo( $li ).find('.progress-bar');
|
||||
}
|
||||
|
||||
$li.find('p.state').text('上传中');
|
||||
|
||||
$percent.css( 'width', percentage * 100 + '%' );
|
||||
});
|
||||
uploader.on( 'uploadSuccess', function( file, response) {
|
||||
if (response.feedback.indexOf("成功") >= 0){
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
} else{
|
||||
$( '#'+file.id ).find('p.state').text(response.feedback);
|
||||
}
|
||||
});
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadComplete', function( file ) {
|
||||
$( '#'+file.id ).find('.progress').remove();
|
||||
});
|
||||
|
||||
uploader.on( 'all', function( type ) {
|
||||
if ( type === 'startUpload' ) {
|
||||
state = 'uploading';
|
||||
} else if ( type === 'stopUpload' ) {
|
||||
state = 'paused';
|
||||
} else if ( type === 'uploadFinished' ) {
|
||||
state = 'done';
|
||||
}
|
||||
|
||||
if ( state === 'uploading' ) {
|
||||
$btn.text('暂停上传');
|
||||
} else {
|
||||
$btn.text('开始上传');
|
||||
}
|
||||
});
|
||||
|
||||
$btn.on( 'click', function() {
|
||||
if ( state === 'uploading' ) {
|
||||
uploader.stop();
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
|
||||
</div>
|
||||
<div class="btns" >
|
||||
<div id="picker">选择文件</div>
|
||||
<button id="ctlBtn" class="btn btn-default">开始上传</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
WebRoot/jsp/base/importExcel.jsp
Normal file
78
WebRoot/jsp/base/importExcel.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'${param.dest}?param=${param.param}',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response=="1"){
|
||||
grid.datagrid('reload');
|
||||
alert("导入成功!");
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
167
WebRoot/jsp/base/mainPageAdd.jsp
Normal file
167
WebRoot/jsp/base/mainPageAdd.jsp
Normal file
@ -0,0 +1,167 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%request.setAttribute("MainPageType_Produce", CommString.MainPageType_Produce); %>
|
||||
<%request.setAttribute("MainPageType_Security", CommString.MainPageType_Security); %>
|
||||
<%request.setAttribute("MainPageType_Efficiency", CommString.MainPageType_Efficiency); %>
|
||||
|
||||
<%request.setAttribute("ChartType_Base", CommString.ChartType_Base); %>
|
||||
<%request.setAttribute("ChartType_Gauge", CommString.ChartType_Gauge); %>
|
||||
<%request.setAttribute("ChartType_Bar", CommString.ChartType_Bar); %>
|
||||
<%request.setAttribute("ChartType_Line", CommString.ChartType_Line); %>
|
||||
<script type="text/javascript">
|
||||
var selectMPint = function (pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', { formId: 'subForm', hiddenId: 'mpointId', textId: 'mpointName', mpid: $("#mpointId").val() }, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('mpointName', 'NOT_VALIDATED',null)
|
||||
.validateField('mpointName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/base/mainPage/save.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
$("#table_mainpage").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '用户名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
mpointName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
|
||||
$.post(ext.contextPath + "/base/mainPageType/getType4Select.do", {bizId:$('#bizId').val(),mainPageTypeId:$('#mainPageTypeId').val()}, function(data) {
|
||||
var selelct =$("#type").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
$("#type").select2({minimumResultsForSearch: 10});
|
||||
fixSelect2ToTool('type');
|
||||
$("#showWay").select2({minimumResultsForSearch: 10});
|
||||
fixSelect2ToTool('showWay');
|
||||
*/
|
||||
},'json');
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="bizId" name="bizId" type="hidden" value="${company.id}" />
|
||||
<input id="mainPageTypeId" name="mainPageTypeId" type="hidden" value="${mainPageTypeId}" />
|
||||
|
||||
<p class="form-control-static">${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control select2" id="type" name="type" style="width:220px;">
|
||||
<!--
|
||||
<c:forEach items="${list}" var="item">
|
||||
<c:if test="${mainPageTypeId eq item.id}">
|
||||
<option value="${item.id}" selected="selected">${item.title}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
-->
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*测量点</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="mpointName" name="mpointName"
|
||||
onclick="selectMPint()" placeholder="单击选择" />
|
||||
<input type="hidden" id="mpointId" name="mpointId" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">展示样式</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control select2" id="showWay" name="showWay">
|
||||
<option value="${ChartType_Base}" selected="selected">基础</option>
|
||||
<option value="${ChartType_Gauge}">仪表</option>
|
||||
<option value="${ChartType_Bar}">柱状图</option>
|
||||
<option value="${ChartType_Line}">折线</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
|
||||
<div class="col-sm-5">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<!-- 新增 -->
|
||||
<div id="mpSubDiv"></div>
|
||||
|
||||
135
WebRoot/jsp/base/mainPageEdit.jsp
Normal file
135
WebRoot/jsp/base/mainPageEdit.jsp
Normal file
@ -0,0 +1,135 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("MainPageType_Produce", CommString.MainPageType_Produce); %>
|
||||
<%request.setAttribute("MainPageType_Security", CommString.MainPageType_Security); %>
|
||||
<%request.setAttribute("MainPageType_Efficiency", CommString.MainPageType_Efficiency); %>
|
||||
|
||||
<%request.setAttribute("ChartType_Base", CommString.ChartType_Base); %>
|
||||
<%request.setAttribute("ChartType_Gauge", CommString.ChartType_Gauge); %>
|
||||
<%request.setAttribute("ChartType_Bar", CommString.ChartType_Bar); %>
|
||||
<%request.setAttribute("ChartType_Line", CommString.ChartType_Line); %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<script type="text/javascript">
|
||||
var selectMPint = function (pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', { formId: 'subForm', hiddenId: 'mpointId', textId: 'mpointName', codeId: $("#mpointId").val() }, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
|
||||
});
|
||||
};
|
||||
function doupdate() {
|
||||
$.post(ext.contextPath + "/base/mainPage/update.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table_mainpage").bootstrapTable('refresh');
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal')
|
||||
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
$(function(){
|
||||
$.post(ext.contextPath + "/base/mainPageType/getType4Select.do", {bizId:$('#bizId').val()}, function(data) {
|
||||
var selelct =$("#type").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
selelct.val('${mainPage.type}').trigger("change");
|
||||
$("#showWay").select2({minimumResultsForSearch: 10}).val("${mainPage.showWay}").trigger("change");
|
||||
/*
|
||||
$("#type").select2({minimumResultsForSearch: 10}).val("${mainPage.type}").trigger("change"); ;
|
||||
fixSelect2ToTool('type');
|
||||
$("#showWay").select2({minimumResultsForSearch: 10}).val("${mainPage.showWay}").trigger("change"); ;
|
||||
fixSelect2ToTool('showWay');
|
||||
*/
|
||||
},'json')
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${mainPage.id}" />
|
||||
<input id="bizId" name="bizId" type="hidden" value="${company.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${company.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control select2" id="type" name="type" style="width:220px;">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*测量点</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="mpointName" name="mpointName"
|
||||
onclick="selectMPint()" placeholder="单击选择" value="${mainPage.mPoint.parmname }" />
|
||||
<input type="hidden" id="mpointId" name="mpointId" value="${mainPage.mpointId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">展示样式</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control select2" id="showWay" name="showWay" style="width:220px;">
|
||||
|
||||
<option value="${ChartType_Base}" selected>基础
|
||||
</option>
|
||||
<option value="${ChartType_Gauge}">仪表
|
||||
</option>
|
||||
<option value="${ChartType_Bar}">柱状图
|
||||
</option>
|
||||
<option value="${ChartType_Line}">折线
|
||||
</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
|
||||
<div class="col-sm-5">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${mainPage.morder}" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<!-- 新增 -->
|
||||
<div id="mpSubDiv"></div>
|
||||
320
WebRoot/jsp/base/mainPageList.jsp
Normal file
320
WebRoot/jsp/base/mainPageList.jsp
Normal file
@ -0,0 +1,320 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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"%>
|
||||
<%request.setAttribute("MainPageType_Produce", CommString.MainPageType_Produce); %>
|
||||
<%request.setAttribute("MainPageType_Security", CommString.MainPageType_Security); %>
|
||||
<%request.setAttribute("MainPageType_Efficiency", CommString.MainPageType_Efficiency); %>
|
||||
|
||||
<%request.setAttribute("ChartType_Base", CommString.ChartType_Base); %>
|
||||
<%request.setAttribute("ChartType_Gauge", CommString.ChartType_Gauge); %>
|
||||
<%request.setAttribute("ChartType_Bar", CommString.ChartType_Bar); %>
|
||||
<%request.setAttribute("ChartType_Line", CommString.ChartType_Line); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/base/mainPage/add.do', {companyId:$('#search_code_mainpage').val()} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/base/mainPage/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(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 + '/base/mainPage/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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 + '/base/mainPage/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
var selelct =$("#search_code_mainpage").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
if(data.length==1){
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
$("#search_code_mainpage").next().css("display", "none");
|
||||
$("#companyName").text($("#search_code_mainpage").text());
|
||||
}else{
|
||||
selelct.val("").trigger("change");
|
||||
$("#companyName").css("display", "none");
|
||||
};
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
},'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/base/mainPage/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
bizId: $('#search_code_mainpage').val(),
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
sortName: 'type', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'mpointId', // 返回json数据中的name
|
||||
title: '测量点编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value
|
||||
}
|
||||
},{
|
||||
field: 'mpointName', // 返回json数据中的name
|
||||
title: '测量点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.mPoint==null?'':row.mPoint.parmname;
|
||||
}
|
||||
},{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch(value){
|
||||
case '${MainPageType_Produce}':
|
||||
return "生产";
|
||||
break;
|
||||
case '${MainPageType_Security}':
|
||||
return "安全";
|
||||
break;
|
||||
case '${MainPageType_Efficiency}':
|
||||
return "效率";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'showWay', // 返回json数据中的name
|
||||
title: '显示方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch(value){
|
||||
case '${ChartType_Base}':
|
||||
return "基础";
|
||||
break;
|
||||
case '${ChartType_Gauge}':
|
||||
return "仪表";
|
||||
break;
|
||||
case '${ChartType_Bar}':
|
||||
return "柱状图";
|
||||
break;
|
||||
case '${ChartType_Line}':
|
||||
return "折线";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts+='<button class="btn btn-default btn-sm" onclick="editFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" onclick="deleteFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
buts = '<div class = "btn-group">'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div >
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<label class="form-label" >公司:</label>
|
||||
<select class="form-control select2 " id="search_code_mainpage" name ="search_code_mainpage" style="width: 220px;"></select>
|
||||
<span id="companyName" style="width:220px;border: none;background: transparent;" ></span>
|
||||
</div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<!-- <div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
309
WebRoot/jsp/base/mainPageManage.jsp
Normal file
309
WebRoot/jsp/base/mainPageManage.jsp
Normal file
@ -0,0 +1,309 @@
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
if($("#search_pid").val()=='' || $("#search_pid").val()==null){
|
||||
showAlert('d','请选择公司','mainAlertdiv');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/base/mainPageType/add.do', {bizId:$('#search_pid').val()} , function(data) {
|
||||
$("#mainPageBox").html(data);
|
||||
})};
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/base/mainPageType/edit.do', {id:id} , function(data) {
|
||||
$("#mainPageBox").html(data);
|
||||
});
|
||||
};
|
||||
var deleteFun = function(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 + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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 + '/work/group/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initFun=function(){
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/base/mainPageType/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
//bizId: $('#search_code_mainpage').val(),
|
||||
bizId: $('#search_pid').val(),
|
||||
//search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
editFun(row.id);
|
||||
},
|
||||
sortName: 'type', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'title', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width:'110px'
|
||||
|
||||
},{
|
||||
field: 'classlg', // 返回json数据中的name
|
||||
title: '占比', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width:'110px'
|
||||
}
|
||||
/*
|
||||
{
|
||||
field: 'height', // 返回json数据中的name
|
||||
title: '高度/px', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
|
||||
}
|
||||
*/
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
//adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
var doRefreshTable = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
};
|
||||
$(function() {
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#companyselect").hide();
|
||||
$("#companyName").text("公司: " + data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
$("#search_pid").val(data[0].id);
|
||||
$("#cname_input").val(data[0].text);
|
||||
companyId = data[0].id;
|
||||
initFun();
|
||||
//$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3,
|
||||
});
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
$("#search_pid").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
companyId= data.id;
|
||||
doRefreshTable();
|
||||
|
||||
});
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
//防止点击树的+号收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击空白隐藏树
|
||||
$(document).click(function (e) {
|
||||
var divTree = $('#ul_tree'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
divTree.hide()
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<!--
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<label class="form-label" >公司:</label>
|
||||
<select class="form-control select2 " id="search_code_mainpage" name ="search_code_mainpage" style="width: 220px;"></select>
|
||||
<span id="companyName" style="width:220px;border: none;background: transparent;" ></span>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" />
|
||||
<span id="companyName" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
<ul id="companyselect" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
style="width:300px;" onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"
|
||||
style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">公司:</span>
|
||||
<input class="form-control " id="cname_input" name="cname_input"
|
||||
style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
</div><!-- /input-group -->
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">显示模块</h3>
|
||||
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<!--
|
||||
<div id="table" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
-->
|
||||
<div id="table" style="height:550px;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="mainPageBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
166
WebRoot/jsp/base/mainPageTypeAdd.jsp
Normal file
166
WebRoot/jsp/base/mainPageTypeAdd.jsp
Normal file
@ -0,0 +1,166 @@
|
||||
<%@page import="com.sipai.entity.base.MainPageTypeStyleEnum"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("verticalBlock", MainPageTypeStyleEnum.verticalBlock); %>
|
||||
<%request.setAttribute("horizontalBlock", MainPageTypeStyleEnum.horizontalBlock); %>
|
||||
<%request.setAttribute("produce", MainPageTypeStyleEnum.produce); %>
|
||||
<%request.setAttribute("efficiency", MainPageTypeStyleEnum.efficiency); %>
|
||||
<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">
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
title:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
classlg:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '横向占比不能为空'
|
||||
},
|
||||
|
||||
greaterThan: {
|
||||
value: 1,
|
||||
message: '输入一个大于0且小于等于12的数字'
|
||||
|
||||
},
|
||||
lessThan: {
|
||||
value: 12,
|
||||
message: '输入一个大于0且小于等于12的数字'
|
||||
},
|
||||
}
|
||||
},
|
||||
morder:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: { //正则表达式
|
||||
regexp: /^[0-9]+$/,
|
||||
message: '顺序只能是数字'
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function dosave() {
|
||||
//if ($("#subForm").form('validate')) {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
console.info($("#subForm").serialize());
|
||||
$.post(ext.contextPath + "/base/mainPageType/save.do", $("#subForm").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
doRefreshTable();
|
||||
//showAlert('s','保存成功');
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function saveDefault() {
|
||||
if($("#location").val()==''){
|
||||
top.$.messager.alert('提示','请先填写菜单地址','info');
|
||||
}else{
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/user/saveDefaultFunc.do", $(".form").serialize(), function(result) {
|
||||
if (result > 0) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
$('#grid').datagrid('reload');
|
||||
});
|
||||
} else {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
//var active=$("#active").select2();
|
||||
$("#active").select2({minimumResultsForSearch: 10}).val("true").trigger("change");
|
||||
$("#style").select2({minimumResultsForSearch: 10}).val("${block}").trigger("change");
|
||||
});
|
||||
</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">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></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="title" name ="title" placeholder="名称" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${company.name }</p>
|
||||
<input id="bizId" name="bizId" type="hidden" value="${company.id}"/>
|
||||
</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="classlg" name ="classlg" placeholder="最大12" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">样式</label>
|
||||
<div class="col-sm-4">
|
||||
<select id ="style" name="style" class="form-control select2">
|
||||
<option value="${verticalBlock}" >竖直排列</option>
|
||||
<option value="${horizontalBlock}" >水平排列</option>
|
||||
<option value="${produce}" >生产样式</option>
|
||||
<option value="${efficiency}" >效率样式</option>
|
||||
</select>
|
||||
</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="顺序" >
|
||||
</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="true" >启用</option>
|
||||
<option value="false" >禁用</option>
|
||||
</select>
|
||||
</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="height" name ="height" placeholder="像素" value="300">
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
359
WebRoot/jsp/base/mainPageTypeEdit.jsp
Normal file
359
WebRoot/jsp/base/mainPageTypeEdit.jsp
Normal file
@ -0,0 +1,359 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.base.MainPageTypeStyleEnum"%>
|
||||
<%request.setAttribute("verticalBlock", MainPageTypeStyleEnum.verticalBlock); %>
|
||||
<%request.setAttribute("horizontalBlock", MainPageTypeStyleEnum.horizontalBlock); %>
|
||||
<%request.setAttribute("produce", MainPageTypeStyleEnum.produce); %>
|
||||
<%request.setAttribute("efficiency", MainPageTypeStyleEnum.efficiency); %>
|
||||
|
||||
<%request.setAttribute("ChartType_Base", CommString.ChartType_Base); %>
|
||||
<%request.setAttribute("ChartType_Gauge", CommString.ChartType_Gauge); %>
|
||||
<%request.setAttribute("ChartType_Bar", CommString.ChartType_Bar); %>
|
||||
<%request.setAttribute("ChartType_Line", CommString.ChartType_Line); %>
|
||||
<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 + "/base/mainPageType/update.do", $("#subForm").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
showAlert('s','保存成功');
|
||||
doRefreshTable();
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
title:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
classlg:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '横向占比不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
function saveDefault() {
|
||||
if($("#location").val()==''){
|
||||
showAlert('i','请先填写菜单地址')
|
||||
}else{
|
||||
//if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/user/saveDefaultFunc.do", $("#subForm").serialize(), function(result) {
|
||||
if (result > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d','默认权限添加失败','alertDiv_power');
|
||||
}
|
||||
});
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
function dodel() {
|
||||
|
||||
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 + '/base/mainPageType/delete.do', {mainPageTypeId:$('#mainPageTypeId').val()}, function(data) {
|
||||
if(data>0){
|
||||
doRefreshTable();
|
||||
$("#mainPageBox").empty();
|
||||
}else{
|
||||
showAlert('d','删除失败');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function delPowerFun(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 + '/base/mainPage/delete.do', {id:id}, function(data) {
|
||||
if(data>0){
|
||||
$("#table_mainpage").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv_power');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var addPowerFun = function() {
|
||||
$.post(ext.contextPath + '/base/mainPage/add.do', {bizId:$('#bizId').val(),id:$('#mainPageTypeId').val()} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var editPowerFun = function(id) {
|
||||
$.post(ext.contextPath + '/base/mainPage/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
console.info("${mainPageType.active}");
|
||||
$("#active").select2({minimumResultsForSearch: 10}).val('${mainPageType.active}').trigger("change");
|
||||
$("#style").select2({minimumResultsForSearch: 10}).val('${mainPageType.style}').trigger("change");
|
||||
$("#table_mainpage").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/base/mainPage/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
type: '${mainPageType.id}'
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
sortName: 'type', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'mpointId', // 返回json数据中的name
|
||||
title: '测量点编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value
|
||||
}
|
||||
},{
|
||||
field: 'mpointName', // 返回json数据中的name
|
||||
title: '测量点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.mPoint==null?'':row.mPoint.parmname;
|
||||
}
|
||||
},{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.mainPageType.title;
|
||||
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'showWay', // 返回json数据中的name
|
||||
title: '显示方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch(value){
|
||||
case '${ChartType_Base}':
|
||||
return "基础";
|
||||
break;
|
||||
case '${ChartType_Gauge}':
|
||||
return "仪表";
|
||||
break;
|
||||
case '${ChartType_Bar}':
|
||||
return "柱状图";
|
||||
break;
|
||||
case '${ChartType_Line}':
|
||||
return "折线";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts+='<button class="btn btn-default btn-sm" onclick="editPowerFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" onclick="delPowerFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
buts = '<div class = "btn-group">'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_mainpage");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
</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()" 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">
|
||||
<input id="mainPageTypeId" name="mainPageTypeId" type="hidden" value="${mainPageType.id}"/>
|
||||
<input id="id" name="id" type="hidden" value="${mainPageType.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></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="title" name ="title" placeholder="名称" value="${mainPageType.title }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属公司</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static" >${company.name }</p>
|
||||
<input id="bizId" name="bizId" type="hidden" value="${company.id}"/>
|
||||
</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="classlg" name ="classlg" placeholder="最大12" value="${mainPageType.classlg }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">样式</label>
|
||||
<div class="col-sm-4">
|
||||
<select id ="style" name="style" class="form-control select2">
|
||||
<option value="${verticalBlock}" >竖直排列</option>
|
||||
<option value="${horizontalBlock}" >水平排列</option>
|
||||
<option value="${produce}" >生产样式</option>
|
||||
<option value="${efficiency}" >效率样式</option>
|
||||
</select>
|
||||
</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="${mainPageType.morder }">
|
||||
</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="true" >启用</option>
|
||||
<option value="false" >禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-solid" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">模块详细内容</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<div >
|
||||
<div id="alertDiv_mainpage"></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>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<table id="table_mainpage"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
320
WebRoot/jsp/base/mainPageTypeList.jsp
Normal file
320
WebRoot/jsp/base/mainPageTypeList.jsp
Normal file
@ -0,0 +1,320 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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"%>
|
||||
<%request.setAttribute("MainPageType_Produce", CommString.MainPageType_Produce); %>
|
||||
<%request.setAttribute("MainPageType_Security", CommString.MainPageType_Security); %>
|
||||
<%request.setAttribute("MainPageType_Efficiency", CommString.MainPageType_Efficiency); %>
|
||||
|
||||
<%request.setAttribute("ChartType_Base", CommString.ChartType_Base); %>
|
||||
<%request.setAttribute("ChartType_Gauge", CommString.ChartType_Gauge); %>
|
||||
<%request.setAttribute("ChartType_Bar", CommString.ChartType_Bar); %>
|
||||
<%request.setAttribute("ChartType_Line", CommString.ChartType_Line); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/base/mainPage/add.do', {companyId:$('#search_code_mainpage').val()} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/base/mainPage/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(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 + '/base/mainPage/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
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 + '/base/mainPage/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
var selelct =$("#search_code_mainpage").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
if(data.length==1){
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
$("#search_code_mainpage").next().css("display", "none");
|
||||
$("#companyName").text($("#search_code_mainpage").text());
|
||||
}else{
|
||||
selelct.val("").trigger("change");
|
||||
$("#companyName").css("display", "none");
|
||||
};
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
},'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/base/mainPage/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
bizId: $('#search_code_mainpage').val(),
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
sortName: 'type', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'mpointId', // 返回json数据中的name
|
||||
title: '测量点编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value
|
||||
}
|
||||
},{
|
||||
field: 'mpointName', // 返回json数据中的name
|
||||
title: '测量点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return row.mPoint==null?'':row.mPoint.parmname;
|
||||
}
|
||||
},{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch(value){
|
||||
case '${MainPageType_Produce}':
|
||||
return "生产";
|
||||
break;
|
||||
case '${MainPageType_Security}':
|
||||
return "安全";
|
||||
break;
|
||||
case '${MainPageType_Efficiency}':
|
||||
return "效率";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'showWay', // 返回json数据中的name
|
||||
title: '显示方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch(value){
|
||||
case '${ChartType_Base}':
|
||||
return "基础";
|
||||
break;
|
||||
case '${ChartType_Gauge}':
|
||||
return "仪表";
|
||||
break;
|
||||
case '${ChartType_Bar}':
|
||||
return "柱状图";
|
||||
break;
|
||||
case '${ChartType_Line}':
|
||||
return "折线";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '顺序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts+='<button class="btn btn-default btn-sm" onclick="editFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" onclick="deleteFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
buts = '<div class = "btn-group">'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div >
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<label class="form-label" >公司:</label>
|
||||
<select class="form-control select2 " id="search_code_mainpage" name ="search_code_mainpage" style="width: 220px;"></select>
|
||||
<span id="companyName" style="width:220px;border: none;background: transparent;" ></span>
|
||||
</div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<!-- <div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
42
WebRoot/jsp/base/print.html
Normal file
42
WebRoot/jsp/base/print.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>数据打印</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: white;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.pb {
|
||||
font-size: 13px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.pb th {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.pb td {
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
var win=document.write(window.dialogArguments);
|
||||
win.document.close();
|
||||
window.print();
|
||||
//window.close();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
53
WebRoot/jsp/base/print.jsp
Normal file
53
WebRoot/jsp/base/print.jsp
Normal file
@ -0,0 +1,53 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>数据打印</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: white;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.pb {
|
||||
font-size: 13px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.pb th {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.pb td {
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
alert('${param.tableString}')
|
||||
document.write('${param.tableString}');
|
||||
window.print();
|
||||
//window.close();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user