288 lines
12 KiB
Plaintext
288 lines
12 KiB
Plaintext
<%@page import="com.sipai.tools.CommString"%>
|
||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<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 doupdate() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/efficiency/efficiencyOverviewMpConfigure/doupdate.do", $("#subMpForm").serialize(), function(data) {
|
||
if (data.code == 1){
|
||
closeModal('subMpModal');
|
||
showImg();
|
||
}else if(data.code == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
|
||
function dodel(){
|
||
stopBubbleDefaultEvent();
|
||
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 + '/efficiency/efficiencyOverviewMpConfigure/dodel.do', {id : '${efficiencyOverviewMpConfigure.id}'}, function(data) {
|
||
if(data.code==1){
|
||
closeModal('subMpModal');
|
||
showImg();
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
},'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
//输入框验证
|
||
// $("#subForm").bootstrapValidator({
|
||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
// fields: {
|
||
// name: {
|
||
// validators: {
|
||
// notEmpty: {
|
||
// message: '名称不能为空'
|
||
// }
|
||
// }
|
||
// },
|
||
// }
|
||
// });
|
||
|
||
function doMpclose(){
|
||
closeModal('subMpModal');
|
||
}
|
||
|
||
$(function() {
|
||
$("#dMptable").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/getList.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [5, 10,15], // 设置页面可以显示的数据条数
|
||
pageSize: 5, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
picId:'${efficiencyOverviewMpConfigure.id}',
|
||
unitId:unitId
|
||
}
|
||
},
|
||
sortName: 'morder', // 要排序的字段
|
||
sortOrder: 'asc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'mPoint', // 返回json数据中的name
|
||
title: '测量点编号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function(value,row,index){
|
||
return value==null?'':value.mpointcode;
|
||
}
|
||
},{
|
||
field: 'mPoint', // 返回json数据中的name
|
||
title: '测量点名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function(value,row,index){
|
||
return value==null?'':value.parmname;
|
||
}
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 100, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
return '<button class="btn btn-default btn-sm" onclick="delDMpointFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
},
|
||
//当拖拽结束后,整个表格的数据
|
||
onReorderRow: function (newData) {
|
||
//这里的newData是整个表格数据,数组形式
|
||
// console.log("data",newData); //调试用代码
|
||
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/dosort.do',{ jsondata: JSON.stringify(newData) },//将整张表数据 不能分页
|
||
function(data) {
|
||
if (data == 1) {
|
||
//$("#table").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','数据错误','mainAlertdiv');
|
||
}
|
||
});
|
||
}
|
||
})
|
||
|
||
$("#dMptable").tableDnD();
|
||
});
|
||
|
||
function delDMpointFun(id){
|
||
stopBubbleDefaultEvent();
|
||
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 + '/efficiency/efficiencyOverviewMpConfigure/dodel.do', {id : id}, function(data) {
|
||
if(data.code==1){
|
||
$("#dMptable").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
},'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
function addDMpointFun(){
|
||
$.post(ext.contextPath + '/efficiency/efficiencyOverviewMpConfigure/dMpConfigure.do', {unitId:unitId,picId:'${efficiencyOverviewMpConfigure.id}'}, function (data){
|
||
$("#dMpSubDiv").html(data);
|
||
openModal('DMPointModel');
|
||
});
|
||
}
|
||
|
||
var selectMPint = function() {
|
||
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {formId:'subMpForm',hiddenId:'mpid',textId:'mpname'} , function(data) {
|
||
$("#mpSubDiv").html(data);
|
||
openModal('mpSubModal');
|
||
});
|
||
};
|
||
|
||
</script>
|
||
<div class="modal fade" id="subMpModal">
|
||
<div style="padding: 5px;">
|
||
<div class="modal-content" >
|
||
<div class="modal-header">
|
||
<button type="button" class="close" onclick="doMpclose();">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">编辑</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subMpForm">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<div id="mp4SelectDiv"></div>
|
||
<input type="hidden" name="id" value= "${efficiencyOverviewMpConfigure.id}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">测量点</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="mpid" name ="mpid" placeholder="点击选择" value="${efficiencyOverviewMpConfigure.mpid}" onclick="selectMPint();" readonly>
|
||
</div>
|
||
<label class="col-sm-2 control-label">测量名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="mpname" name ="mpname" value="${efficiencyOverviewMpConfigure.mpname}" >
|
||
</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="x" name ="x" value="${efficiencyOverviewMpConfigure.x}" >
|
||
</div>
|
||
<label class="col-sm-2 control-label">纵向距离</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="y" name ="y" value="${efficiencyOverviewMpConfigure.y}" >
|
||
</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="width" name ="width" value="${efficiencyOverviewMpConfigure.width}" >
|
||
</div>
|
||
<label class="col-sm-2 control-label">高度</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="height" name ="height" value="${efficiencyOverviewMpConfigure.height}" >
|
||
</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="txtsize" name ="txtsize" value="${efficiencyOverviewMpConfigure.txtsize}" >
|
||
</div>
|
||
<label class="col-sm-2 control-label">文字颜色</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="textcolor" name ="textcolor" value="${efficiencyOverviewMpConfigure.textcolor}" >
|
||
</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="bkcolor" name ="bkcolor" value="${efficiencyOverviewMpConfigure.bkcolor}" >
|
||
</div>
|
||
</div>
|
||
</form>
|
||
|
||
<div class="box-body ">
|
||
<div >
|
||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||
<button type="button" class="btn btn-default" onclick="addDMpointFun();"><i class="fa fa-plus"></i>新增</button>
|
||
</div>
|
||
<table id="dMptable" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default pull-left" onclick="doMpclose();">关闭</button>
|
||
<button type="button" class="btn btn-primary" onclick="doupdate();" id="btn_update">保存</button>
|
||
<button type="button" class="btn" onclick="dodel();" >删除</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|