989 lines
45 KiB
Plaintext
989 lines
45 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||
|
||
<%request.setAttribute("Status_Launch", Maintenance.Status_Launch);%>
|
||
|
||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single {
|
||
height: 34px;
|
||
line-height: 34px;
|
||
}
|
||
|
||
.select2-selection__arrow {
|
||
margin-top: 3px;
|
||
}
|
||
</style>
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||
charset="utf-8"></script>
|
||
|
||
<!-- 拖拽排序-->
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js"
|
||
charset="utf-8"></script>
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
|
||
|
||
<script type="text/javascript">
|
||
|
||
//刷新列表(测量点)
|
||
var doRefreshMPoints = function () {
|
||
$("#table_mPoint").bootstrapTable('refresh');
|
||
};
|
||
|
||
//刷新列表(设备)
|
||
var doRefreshEquipmentCards = function () {
|
||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||
};
|
||
|
||
//刷新列表(摄像头)
|
||
var doRefreshCameras = function () {
|
||
$("#table_Camera").bootstrapTable('refresh');
|
||
};
|
||
|
||
//获取关联的ids(测量点)
|
||
function getIdsMPoint() {
|
||
var allTableData = $("#table_mPoint").bootstrapTable('getData');
|
||
var mPointIds = "";
|
||
$.each(allTableData, function (index, item) {
|
||
if (mPointIds != "") {
|
||
mPointIds += ",";
|
||
}
|
||
if (item.mPoint != null && item.mPoint != '') {//避免因测量点删除 无法加载
|
||
mPointIds += "'" + item.mPoint.mpointid + "'";
|
||
}
|
||
})
|
||
return mPointIds;
|
||
}
|
||
|
||
//弹窗选择(测量点)
|
||
var doEditMPoint = function () {
|
||
$.post(ext.contextPath + '/work/mpoint/mpointList4Layer.do', {
|
||
mpids: '',
|
||
fucname: 'choiceMeasurePointsMpList',
|
||
existenceIds: getIdsMPoint()
|
||
}, function (data) {
|
||
$("#subDiv_PatroPoint").html(data);
|
||
openModal('subModalMpoint');
|
||
});
|
||
};
|
||
|
||
//弹窗选择(设备)
|
||
/*var doEditEquipmentCard = function () {
|
||
var allTableData = $("#table_equipmentCard").bootstrapTable('getData');
|
||
var equipmentCardIds = "";
|
||
$.each(allTableData, function (index, item) {
|
||
if (equipmentCardIds != "") {
|
||
equipmentCardIds += ",";
|
||
}
|
||
equipmentCardIds += item.equipmentCard.id;
|
||
})
|
||
$.post(ext.contextPath + '/equipment/patroPointEquipmentCardForSelect.do', {
|
||
equipmentCardIds: equipmentCardIds,
|
||
bizId: '${param.bizId}',
|
||
processSectionId: $('#processSectionId').val()
|
||
}, function (data) {
|
||
$("#subDiv_PatroPoint").html(data);
|
||
openModal('patroPointModal');
|
||
});
|
||
};*/
|
||
|
||
//弹窗选择(设备)
|
||
function doEditEquipmentCard() {
|
||
var allTableData = $("#table_equipmentCard").bootstrapTable('getData');
|
||
var equipmentCardIds = "";
|
||
$.each(allTableData, function (index, item) {
|
||
if (equipmentCardIds != "") {
|
||
equipmentCardIds += ",";
|
||
}
|
||
if (item.equipmentCard != null) {
|
||
equipmentCardIds += item.equipmentCard.id;
|
||
}
|
||
})
|
||
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
|
||
equipmentIds: equipmentCardIds,
|
||
unitId: '${param.bizId}',
|
||
processSectionId: ''
|
||
}, function (data) {
|
||
$("#subDiv_PatroPoint").html(data);
|
||
openModal("equipment4SelectModal");
|
||
});
|
||
}
|
||
|
||
//弹窗选择(摄像头)
|
||
var doEditCamera = function () {
|
||
var allTableData = $("#table_Camera").bootstrapTable('getData');
|
||
var cameraIds = "";
|
||
$.each(allTableData, function (index, item) {
|
||
if (cameraIds != "") {
|
||
cameraIds += ",";
|
||
}
|
||
cameraIds += item.camera.id;
|
||
})
|
||
$.post(ext.contextPath + '/work/camera/patroPointCameraForSelect.do', {
|
||
cameraIds: cameraIds,
|
||
bizId: '${param.bizId}', processSectionId: $('#processSectionId').val()
|
||
}, function (data) {
|
||
$("#subDiv_PatroPoint").html(data);
|
||
openModal('patroPointModal');
|
||
});
|
||
};
|
||
|
||
//保存(测量点)
|
||
function choiceMeasurePointsMpList(data) {
|
||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/updateMPoints.do', {
|
||
mPointIds: data,
|
||
patrolPointId: '${patrolPoint.id}'
|
||
}, function (data) {
|
||
if (data.res > 0) {
|
||
doRefreshMPoints();
|
||
} else {
|
||
showAlert('d', '导入失败', 'mainAlertdiv');
|
||
}
|
||
}, 'json');
|
||
}
|
||
|
||
//保存(设备)
|
||
/*var doFinishSelectEquipmentCard = function (data) {
|
||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/updateEquipmentCards.do', {
|
||
patrolPointId: '${patrolPoint.id}',
|
||
equipmentCardIds: data + ''
|
||
}, function (data) {
|
||
if (data.res) {
|
||
doRefreshEquipmentCards();
|
||
}
|
||
}, 'json');
|
||
};*/
|
||
|
||
//保存(设备)
|
||
var doFinishSelectEquipment = function (data) {
|
||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/updateEquipmentCards.do', {
|
||
patrolPointId: '${patrolPoint.id}',
|
||
equipmentCardIds: data + ''
|
||
}, function (data) {
|
||
closeModal("equipment4SelectModal");
|
||
if (data.res) {
|
||
doRefreshEquipmentCards();
|
||
}
|
||
}, 'json');
|
||
};
|
||
|
||
//保存(摄像头)
|
||
var doFinishSelectCamera = function (data) {
|
||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/updateCameras.do', {
|
||
patrolPointId: '${patrolPoint.id}',
|
||
cameraIds: data
|
||
}, function (data) {
|
||
if (data.res) {
|
||
doRefreshCameras();
|
||
}
|
||
}, 'json');
|
||
};
|
||
|
||
//修改保存巡检点
|
||
function doupdate() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/timeEfficiency/patrolPoint/update.do", $("#subForm").serialize(), function (data) {
|
||
if (data.res == 1) {
|
||
$(".modal").modal("hide");
|
||
$("#table").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: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
// processSectionId: {
|
||
// validators: {
|
||
// notEmpty: {
|
||
// message: '所属工艺段不能为空'
|
||
// }
|
||
// }
|
||
// },
|
||
latitude: {
|
||
validators: {
|
||
// notEmpty: {
|
||
// message: '纬度不能为空'
|
||
// },
|
||
regexp: {
|
||
regexp: /^(([^0][0-9]+|0)\.([0-9]{1,10})$)|^([^0][0-9]+|0)$/,
|
||
message: '请输入正确的纬度'
|
||
}
|
||
}
|
||
},
|
||
longitude: {
|
||
validators: {
|
||
// notEmpty: {
|
||
// message: '经度不能为空'
|
||
// },
|
||
regexp: {
|
||
regexp: /^(([^0][0-9]+|0)\.([0-9]{1,10})$)|^([^0][0-9]+|0)$/,
|
||
message: '请输入正确的经度'
|
||
}
|
||
}
|
||
},
|
||
morder: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '顺序不能为空'
|
||
}
|
||
}
|
||
},
|
||
patrolContent: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '巡检内容不能为空'
|
||
}
|
||
}
|
||
},
|
||
|
||
}
|
||
});
|
||
|
||
//初始化工艺段
|
||
var refreshSelect = function (companyId) {
|
||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||
$("#processSectionId").empty();
|
||
var selelct_ = $("#processSectionId").select2({
|
||
data: data,
|
||
placeholder: '请选择',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
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('${patrolPoint.processSectionId}').trigger("change");
|
||
}, 'json');
|
||
};
|
||
|
||
//初始化楼层
|
||
var refreshSelect4Floor = function (companyId) {
|
||
$.post(ext.contextPath + "/timeEfficiency/patrolArea/getPatrolAreaFloor4Select.do", {companyId: companyId}, function (data) {
|
||
$("#processSectionId").empty();
|
||
var selelct_ = $("#processSectionId").select2({
|
||
data: data,
|
||
placeholder: '请选择',//默认文字提示
|
||
allowClear: true,//允许清空
|
||
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('${patrolPoint.processSectionId}').trigger("change");
|
||
}, 'json');
|
||
};
|
||
|
||
//删除测量点
|
||
var doDeletesMPoint = function () {
|
||
var checkedItems = $("#table_mPoint").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 + '/timeEfficiency/patrolPoint/dodeletes4MPoint.do', {ids: datas}, function (data) {
|
||
if (data > 0) {
|
||
$("#table_mPoint").bootstrapTable('refresh');
|
||
} else {
|
||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
|
||
//删除设备
|
||
var doDeletesEquipmentCard = function () {
|
||
var checkedItems = $("#table_equipmentCard").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 + '/timeEfficiency/patrolPoint/dodeletes4EquipmentCard.do', {ids: datas}, function (data) {
|
||
if (data > 0) {
|
||
$("#table_equipmentCard").bootstrapTable('refresh');
|
||
} else {
|
||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
};
|
||
|
||
$(function () {
|
||
// console.info('${param.bizId}')
|
||
// console.info('${patrolPoint.id}')
|
||
//日期格式需对齐,不然会不准
|
||
$("#table_Camera").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/timeEfficiency/patrolPoint/getCameras.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,
|
||
patrolPointId: '${patrolPoint.id}',
|
||
bizId: '${patrolPoint.unitId}',
|
||
unitId: '${patrolPoint.unitId}'
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'name', // 返回json数据中的name
|
||
title: '摄像机名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '50%',
|
||
formatter: function (value, row, index) {
|
||
if (row.camera != null && row.camera != '') {
|
||
return row.camera.name;
|
||
} else {
|
||
return '';
|
||
}
|
||
}
|
||
}, {
|
||
field: 'url', // 返回json数据中的name
|
||
title: '摄像机ip', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '50%',
|
||
formatter: function (value, row, index) {
|
||
if (row.camera != null && row.camera != '') {
|
||
return row.camera.url;
|
||
} else {
|
||
return '';
|
||
}
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("table_Camera");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
})
|
||
|
||
$("#table_equipmentCard").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/timeEfficiency/patrolPoint/getEquipmentCards.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,
|
||
patrolPointId: '${patrolPoint.id}',
|
||
bizId: '${patrolPoint.unitId}',
|
||
unitId: '${patrolPoint.unitId}'
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
width: '40px'
|
||
}, {
|
||
field: 'equipmentcardid', // 返回json数据中的name
|
||
title: '设备编号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '50%',
|
||
formatter: function (value, row, index) {
|
||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||
return row.equipmentCard.equipmentcardid;
|
||
} else {
|
||
return '该设备已删除';
|
||
}
|
||
}
|
||
}, {
|
||
field: 'equipmentname', // 返回json数据中的name
|
||
title: '设备名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '50%',
|
||
formatter: function (value, row, index) {
|
||
if (row.equipmentCard != null && row.equipmentCard != '') {
|
||
return row.equipmentCard.equipmentname;
|
||
} else {
|
||
return '';
|
||
}
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("table_equipmentCard");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
//日期格式需对齐,不然会不准
|
||
$("#table_mPoint").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/timeEfficiency/patrolPoint/getMPoints.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [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,
|
||
patrolPointId: '${patrolPoint.id}',
|
||
bizId: '${patrolPoint.unitId}',
|
||
unitId: '${patrolPoint.unitId}'
|
||
}
|
||
},
|
||
sortName: 'morder', // 要排序的字段
|
||
sortOrder: 'asc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
width: '40px'
|
||
}, {
|
||
field: 'mPoint.parmname', // 返回json数据中的name
|
||
title: '测量点名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '45%',
|
||
formatter: function (value, row, index) {
|
||
if (row.mPoint != null && row.mPoint != '') {//避免因测量点删除 无法加载
|
||
return row.mPoint.parmname;
|
||
} else {
|
||
return '该点位已删除';
|
||
}
|
||
}
|
||
}, {
|
||
field: 'mPoint.mpointcode', // 返回json数据中的name
|
||
title: '测量点Code', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '45%',
|
||
formatter: function (value, row, index) {
|
||
if (row.mPoint != null && row.mPoint != '') {//避免因测量点删除 无法加载
|
||
return row.mPoint.mpointcode;
|
||
} else {
|
||
return '';
|
||
}
|
||
}
|
||
}, {
|
||
field: 'mPoint.sourceType', // 返回json数据中的name
|
||
title: '类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '10%',
|
||
formatter: function (value, row, index) {
|
||
if (row.mPoint != null && row.mPoint != '') {//避免因测量点删除 无法加载
|
||
if (row.mPoint.sourceType == '${Flag_Type_Data}') {
|
||
return '采集点';
|
||
}
|
||
if (row.mPoint.sourceType == '${Flag_Type_Hand}') {
|
||
return '手动点';
|
||
}
|
||
if (row.mPoint.sourceType == '${Flag_Type_KPI}') {
|
||
return '计算点';
|
||
}
|
||
} else {
|
||
return '';
|
||
}
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("table_mPoint");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
},
|
||
//当拖拽结束后,整个表格的数据
|
||
onReorderRow: function (newData) {
|
||
//这里的newData是整个表格数据,数组形式
|
||
// var str = JSON.stringify(newData);
|
||
/*let arr = []
|
||
for (var i in newData) {
|
||
// console.log(newData[i]);
|
||
// ids += newData[i].id + ",";
|
||
let cate = JSON.stringify({id: newData[i].id, morder: newData[i].morder})
|
||
cate = JSON.parse(cate)
|
||
arr.push(cate)
|
||
}*/
|
||
|
||
var ids = "";
|
||
for (var i in newData) {
|
||
ids += newData[i].id + ",";
|
||
}
|
||
|
||
$.ajax({
|
||
type: "post",
|
||
url: ext.contextPath + '/timeEfficiency/patrolPoint/dosortMeasurePoint.do',
|
||
data: {
|
||
ids: ids
|
||
},
|
||
dataType: "json",
|
||
success: function (data) {
|
||
console.log(data)
|
||
}
|
||
})
|
||
|
||
/*$.post(ext.contextPath + '/timeEfficiency/patrolPoint/dosortMeasurePoint.do', {jsondata: arr},
|
||
function (data) {
|
||
if (data == 1) {
|
||
//$("#table").bootstrapTable('refresh');
|
||
} else {
|
||
showAlert('d', '数据错误', 'mainAlertdiv');
|
||
}
|
||
});*/
|
||
}
|
||
})
|
||
//选择厂区
|
||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
|
||
//选择厂区为一个厂时隐藏选择框
|
||
if (data.length == 1) {
|
||
$("#bizId").css("display", "none");
|
||
$("#input_bizid").val(data[0].text);
|
||
$("#hidden_bizid").val(data[0].id);
|
||
var companyId = data[0].id;
|
||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||
$("#processSectionId").empty();
|
||
var selelct_ = $("#processSectionId").select2({
|
||
data: data,
|
||
cache: false,
|
||
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('${patrolPoint.processSectionId}').trigger("change");
|
||
}, 'json');
|
||
} else {
|
||
$("#hidden_bizid").attr("disabled", "disabled");
|
||
$("#input_bizid").css("display", "none");
|
||
refreshSelect('${patrolPoint.bizId}');
|
||
var selelct = $("#bizId").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('${patrolPoint.bizId}').trigger("change");
|
||
selelct.on("change", function (e) {
|
||
var companyId = $(this).val();
|
||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: companyId}, function (data) {
|
||
$("#processSectionId").empty();
|
||
var selelct_ = $("#processSectionId").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('').trigger("change");
|
||
}, 'json');
|
||
});
|
||
}
|
||
}, 'json');
|
||
|
||
//选择modbus
|
||
$.post(ext.contextPath + "/work/modbusfig/getModbusFig4Select.do", {}, function (data) {
|
||
var selelct = $("#modbusFigId").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('${patrolPoint.modbusFigId}').trigger("change");
|
||
}, 'json');
|
||
|
||
|
||
//巡检楼层下拉数据
|
||
var selectType = $("#floorName").select2({minimumResultsForSearch: 10})
|
||
$.post(ext.contextPath + "/timeEfficiency/patrolArea/getPatrolAreaFloor4Select.do", {unitId: '${patrolPoint.unitId}'}, function (data) {
|
||
$("#floorName").empty();
|
||
var selelct_ = $("#floorName").select2({
|
||
data: data,
|
||
placeholder: '请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
||
formatResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
formatSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
selelct_.val('${patrolPoint.floorId}').trigger("change");
|
||
selelct_.on('change', function (e) {
|
||
$('#floorId').val(e.target.value);
|
||
})
|
||
}, 'json');
|
||
|
||
})
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-lg">
|
||
<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" enctype="multipart/form-data">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" class="form-control" id="id" name="id" value="${patrolPoint.id}">
|
||
<input type="hidden" class="form-control" name="unitId" value="${patrolPoint.unitId}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="名称"
|
||
value="${patrolPoint.name}"></input>
|
||
</div>
|
||
<label class="col-sm-2 control-label">所属工艺段</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="processSectionId" name="processSectionId"
|
||
style="width: 100%">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">所属厂区</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="companyName" name="companyName" class="form-control pull-right"
|
||
placeholder="所属厂区"
|
||
value="${companyName}" readonly="true"></input>
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">所属楼层</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="floorName" name="floorName"
|
||
style="width: 100%"></select>
|
||
<input type="hidden" class="form-control" id="floorId" name="floorId"
|
||
value="${patrolPoint.floorId}"/>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">纬度</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="latitude" name="latitude" class="form-control pull-right"
|
||
placeholder="纬度"
|
||
value="${patrolPoint.latitude}"></input>
|
||
</div>
|
||
<label class="col-sm-2 control-label">经度</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="longitude" name="longitude" class="form-control pull-right"
|
||
placeholder="经度"
|
||
value="${patrolPoint.longitude}"></input>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">编号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="pointCode" name="pointCode" class="form-control pull-right"
|
||
placeholder="编号"
|
||
value="${patrolPoint.pointCode}"></input>
|
||
</div>
|
||
<label class="col-sm-2 control-label">*顺序</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="morder" name="morder" class="form-control pull-right"
|
||
placeholder="顺序"
|
||
value="${patrolPoint.morder}"></input>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">modbus配置</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="modbusFigId" name="modbusFigId"
|
||
style="width: 100%">
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">寄存器</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="register" name="register" class="form-control pull-right"
|
||
placeholder="寄存器"
|
||
value="${patrolPoint.register}"></input>
|
||
</div>
|
||
</div>
|
||
<input name="type" type="hidden" value="${patrolPoint.type}"/>
|
||
<!-- <div class="form-group">
|
||
<label class="col-sm-2 control-label">巡检分类(生产/设备)</label>
|
||
<div class="col-sm-10">
|
||
<select type="text" id="type" class="form-control select2 pull-right" name="type" style="width: 100%">
|
||
<option value="1">生产</option>
|
||
<option value="0">设备</option>
|
||
</select>
|
||
</div>
|
||
</div> -->
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">读写方式</label>
|
||
<div class="col-sm-4">
|
||
<select type="text" id="readOrWrite" class="form-control select2 pull-right"
|
||
name="readOrWrite"
|
||
style="width: 100%">
|
||
<option value="1">只读</option>
|
||
<option value="0">只写</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">启用状态</label>
|
||
<div class="col-sm-4">
|
||
<select type="text" id="active" class="form-control select2 pull-right" name="active"
|
||
style="width: 100%">
|
||
<option value="1">启用</option>
|
||
<option value="0">禁用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*巡检内容</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="3" id="patrolContent" name="patrolContent"
|
||
placeholder="巡检内容...">${patrolPoint.patrolContent}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">备注</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="3" id="remark" name="remark"
|
||
placeholder="备注...">${patrolPoint.remark}</textarea>
|
||
</div>
|
||
</div>
|
||
<!--
|
||
<div class="form-group" style="margin:8px">
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传图片</button>
|
||
<button type="button" class="btn btn-default btn-file" onclick="showFaultLibrary4SelectFun()" id="btn_save"><i class="fa fa-file-o"></i>问题库</button>
|
||
</div>
|
||
<div class="form-group" style="margin:8px;">
|
||
<input type="file" name="maintenancefile" id="maintenancefile" multiple class="file-loading" />
|
||
</div> -->
|
||
|
||
|
||
</form>
|
||
<c:choose>
|
||
<c:when test="${patrolPoint.type=='C'}">
|
||
<div class="box box-primary">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">关联摄像头</h3>
|
||
|
||
<div class="box-tools pull-right">
|
||
<a onclick="doEditCamera()" class="btn btn-box-tool" data-toggle="tooltip"
|
||
title="编辑"><i
|
||
class="glyphicon glyphicon-edit"></i></a>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<table id="table_Camera"></table>
|
||
</div>
|
||
</div>
|
||
</c:when>
|
||
<c:otherwise>
|
||
<div class="box box-primary">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">关联测量点</h3>
|
||
<div class="box-tools pull-right">
|
||
<a onclick="doEditMPoint()" class="btn btn-box-tool" data-toggle="tooltip"
|
||
title="新增"><i class="fa fa-plus"></i></a>
|
||
<a onclick="doDeletesMPoint()" class="btn btn-box-tool" data-toggle="tooltip"
|
||
title="删除"><i class="fa fa-minus"></i></a>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<table id="table_mPoint" data-use-row-attr-func="true"
|
||
data-reorderable-rows="true"></table>
|
||
</div>
|
||
</div>
|
||
<div class="box box-primary">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">关联设备</h3>
|
||
<div class="box-tools pull-right">
|
||
<a onclick="doEditEquipmentCard()" class="btn btn-box-tool" data-toggle="tooltip"
|
||
title="新增"><i class="fa fa-plus"></i></a>
|
||
<a onclick="doDeletesEquipmentCard()" class="btn btn-box-tool" data-toggle="tooltip"
|
||
title="删除"><i class="fa fa-minus"></i></a>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<table id="table_equipmentCard"></table>
|
||
</div>
|
||
</div>
|
||
</c:otherwise>
|
||
</c:choose>
|
||
|
||
</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> |