first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View File

@ -0,0 +1 @@
alert('1');

View File

@ -0,0 +1,180 @@
/**
* 加载绩效附表
*/
function getCamera4EquipmentCard(equipmentId, viewType) {
$("#cameratable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/equipment/equipmentCardCamera/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
eqid: equipmentId
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
// viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'id_c',
checkbox: true, // 显示一个勾选框
},
{
field: 'camera.name', // 返回json数据中的name
title: '名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%'
},
{
field: 'camera.url', // 返回json数据中的name
title: '地址', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
},
{
field: 'camera.channel', // 返回json数据中的name
title: '通道号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
},
{
field: 'camera.type', // 返回json数据中的name
title: '摄像机类形', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
},
{
field: 'camera.style', // 返回json数据中的name
title: '摄像机外形', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
formatter: function (value, row, index) {
switch (value) {
case '1':
return '球机';
case '0':
return '枪机';
default:
return '';
}
}
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: 80, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button type="button" class="btn btn-default btn-sm" title="浏览" onclick="viewFun_Camera(\'' + row.cameraid + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
if (viewType == 'view') {
$("#cameratable").bootstrapTable('hideColumn', 'id_c');//隐藏上述variablevalue列
}
adjustBootstrapTableView("cameratable");
console.info("加载数据成功_摄像头");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败_摄像头");
}
})
}
/**
* 摄像头预览页面
* @param id
*/
var viewCameraWindow = null;
var viewFun_Camera = function (id) {
// $.post(ext.contextPath + '/work/camera/cameraIdsShowList.do', {cameraIds: id}, function (data) {
// $("#subCameraAddDiv").html(data);
// openModal('cameraSubModal');
// });
var features = "height=800, width=1200, top=100, left=100, toolbar=no, menubar=no,scrollbars=no,resizable=no, location=no, status=no";
// window.open(ext.contextPath + '/work/camera/cameraIdsShowList.do?cameraIds=' + id, "newW", features);
viewCameraWindow = window.open(ext.contextPath + "/work/camera/getCameraJsp.do?id=" + id, "newW", features);
viewCameraWindow.focus();
}
/**
* 弹窗摄像头选择页面
* @param equipmentId
*/
var doAdd_camera = function (equipmentId) {
$.post(ext.contextPath + '/equipment/equipmentCardCamera/selectListForCamera.do', {eqid: equipmentId}, function (data) {
$("#subCameraAddDiv").html(data);
openModal('cameraSubModal');
});
};
/**
* 删除关联的摄像头
*/
var doDelete_camera = function () {
var checkedItems_camera = $("#cameratable").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems_camera, function (index, item) {
datas += item.id + ",";
});
if (datas == "") {
showAlert('d', '请先选择记录', 'cameraAlertdiv');
} 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 + '/equipment/equipmentCardCamera/dodeletes.do', {ids: datas}, function (data) {
if (data > 0) {
$("#cameratable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
}
};

View File

@ -0,0 +1,152 @@
var minheight = 0;
var iframe_src = "";
var tab_id = "";
function showLinks(equipmentCardId){
$.post(ext.contextPath + '/equipment/equipmentCardLinks/getdata4equipmentCard.do',
{equipmentCardId:equipmentCardId},
function(data) {
var arr= JSON.parse(data);
var windowHeight = $(window).height();
minheight = windowHeight-250;
iframe_src ="";
tab_id = "";
if(arr.rows!=null && arr.rows!=undefined && arr.rows!=''){
for(var i=0;i<arr.rows.length;i++){
var equipmentCardView_tab_content = '';
var equipmentCardLinks = arr.rows[i];
if(equipmentCardLinks!=null && equipmentCardLinks!=undefined && equipmentCardLinks!=''){
tab_id = equipmentCardLinks.id;
var tab_name = equipmentCardLinks.linkName;
var link_url = equipmentCardLinks.linkUrl;
var link_parameter = equipmentCardLinks.linksParameterList;
var link_type = equipmentCardLinks.linkType;
iframe_src = link_url;
var equipmentCard = equipmentCardLinks.equipmentCard;
if(link_parameter!=null && link_parameter!=undefined && link_parameter!=''){
for(var p=0;p<link_parameter.length;p++){
var parameters = link_parameter[p];
var parameterType = parameters.parameterType;
var parameter = parameters.parameter;
var dynamic = parameters.dynamic;
var parameterValue = '';
//固定值
if(parameterType=='fixed'){
parameterValue = parameters.parameterValue;
}
//动态,去设备台账数据
if(parameterType=='dynamic'){
if(equipmentCard[dynamic]!=null && equipmentCard[dynamic]!=undefined ){
parameterValue = equipmentCard[dynamic];
}
}
if(p==0){
iframe_src += '?'+parameter+'='+encodeURI(parameterValue);
}else{
iframe_src += '&'+parameter+'='+encodeURI(parameterValue);
}
}
}
if(link_type=='inside'){
//内部地址
var fdStart = iframe_src.indexOf("/");
if(fdStart == 0){
iframe_src = ext.contextPath+iframe_src;
}else{
iframe_src = ext.contextPath+'/'+iframe_src;
}
}
}
}
$("#tab_iframe").removeClass("hidden");
}
}
);
}
function showIframe(){
$.ajax({
type: 'post',
url: ext.contextPath + '/znpd/getToken.do',
data: {unitId:unitId},
//async: false,
// globle: false,
error: function () {
$("#links").html("<label class='bg-danger'>请求PME设备数据失败</label>");
},
success: function (data) {
var str = $.parseJSON(data);
iframe_src = iframe_src+'&token=' + str.token + '&expirationTime=' + str.expirationTime;
tab_content = '<iframe frameborder="0" name="iframe-'+tab_id+'" style="min-height:'+minheight+'px;width:100%;" src="'+iframe_src+'"></iframe>';
$("#links").html(tab_content);
}
});
}
function showLinks_old(equipmentCardId){
$.post(ext.contextPath + '/equipment/equipmentCardLinks/getdata4equipmentCard.do',
{equipmentCardId:equipmentCardId},
function(data) {
var arr= JSON.parse(data);
var windowHeight = $(window).height();
var minheight = windowHeight-250;
if(arr.rows!=null && arr.rows!=undefined && arr.rows!=''){
for(var i=0;i<arr.rows.length;i++){
var equipmentCardView_tab_title = '';
var equipmentCardView_tab_content = '';
var equipmentCardLinks = arr.rows[i];
if(equipmentCardLinks!=null && equipmentCardLinks!=undefined && equipmentCardLinks!=''){
var tab_id = equipmentCardLinks.id;
var tab_name = equipmentCardLinks.linkName;
var link_url = equipmentCardLinks.linkUrl;
var link_parameter = equipmentCardLinks.linksParameterList;
var link_type = equipmentCardLinks.linkType;
var iframe_src = link_url;
var equipmentCard = equipmentCardLinks.equipmentCard;
if(link_parameter!=null && link_parameter!=undefined && link_parameter!=''){
for(var p=0;p<link_parameter.length;p++){
var parameters = link_parameter[p];
var parameterType = parameters.parameterType;
var parameter = parameters.parameter;
var dynamic = parameters.dynamic;
var parameterValue = '';
//固定值
if(parameterType=='fixed'){
parameterValue = parameters.parameterValue;
}
//动态,去设备台账数据
if(parameterType=='dynamic'){
if(equipmentCard[dynamic]!=null && equipmentCard[dynamic]!=undefined ){
parameterValue = equipmentCard[dynamic];
}
}
if(p==0){
iframe_src += '?'+parameter+'='+encodeURI(parameterValue);
}else{
iframe_src += '&'+parameter+'='+encodeURI(parameterValue);
}
}
}
if(link_type=='inside'){
//内部地址
var fdStart = iframe_src.indexOf("/");
if(fdStart == 0){
iframe_src = ext.contextPath+iframe_src;
}else{
iframe_src = ext.contextPath+'/'+iframe_src;
}
}
console.log(iframe_src);
equipmentCardView_tab_title = '<li class="kuandu"><a href="#'+tab_id+'" data-toggle="tab" aria-expanded="false">'+tab_name+'</a></li>';
equipmentCardView_tab_content = '<div class="tab-pane" id="'+tab_id+'">'+
'<iframe frameborder="0" name="iframe-'+tab_id+'" style="min-height:'+minheight+'px;width:100%;" src="'+iframe_src+'"></iframe>'+
'</div>';
}
$("#equipmentCardView_tab_title").append(equipmentCardView_tab_title);
$("#equipmentCardView_tab_content").append(equipmentCardView_tab_content);
}
}
}
);
}

View File

@ -0,0 +1,200 @@
/**
* 加载绩效附表
*/
function getRemark4EquipmentCard(equipmentId, viewType) {
$("#remarktable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/equipment/equipmentCardRemark/getRemarkList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
equId: equipmentId
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
// viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'id_c',
checkbox: true, // 显示一个勾选框
},
{
field: 'name', // 返回json数据中的name
title: '备注名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%'
},
{
field: 'content', // 返回json数据中的name
title: '备注内容', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '40%',
},
{
field: 'userName', // 返回json数据中的name
title: '备注人', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
},
{
field: 'insdt', // 返回json数据中的name
title: '备注时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: '25%', // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button type="button" class="btn btn-default btn-sm" title="查看" onclick="doView(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
if (viewType != 'view') {
buts += '<button type="button" class="btn btn-default btn-sm" title="编辑" onclick="doEdit(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts += '<button type="button" class="btn btn-default btn-sm" title="删除" onclick="doDeleteOne_remark(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg"> 删除</span></button>';
}
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
if (viewType == 'view') {
$("#remarktable").bootstrapTable('hideColumn', 'id_c');//隐藏上述variablevalue列
}
adjustBootstrapTableView("remarktable");
console.info("加载数据成功_备注");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败_备注");
}
})
}
/**
* 弹窗备注选择页面
* @param equipmentId
*/
var doAdd_Remark = function (equipmentId) {
$.post(ext.contextPath + '/equipment/equipmentCardRemark/doadd.do', {eqid: equipmentId}, function (data) {
$("#subRemarkAddDiv").html(data);
openModal('SubModal_equipmentRemarkprop');
});
};
var doEdit = function (id) {
$.post(ext.contextPath + '/equipment/equipmentCardRemark/doedit.do', {id: id}, function (data) {
$("#subRemarkEditDiv").html(data);
openModal('SubModal_equipmentRemarkEdit');
});
};
var doView = function (id) {
$.post(ext.contextPath + '/equipment/equipmentCardRemark/doview.do', {id: id}, function (data) {
$("#subRemarkViewDiv").html(data);
openModal('SubModal_equipmentRemarkView');
});
};
/**
* 删除关联的备注
*/
var doDelete_remark = function () {
var checkedItems_remark = $("#remarktable").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems_remark, 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 + '/equipment/equipmentCardRemark/dodeletes.do', {ids: datas}, function (data) {
if (data > 0) {
$("#remarktable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
}
};
/**
* 删除关联的备注
*/
var doDeleteOne_remark = 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 + '/equipment/equipmentCardRemark/dodelete.do', {id: id}, function (data) {
if (data > 0) {
$("#remarktable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
};

View File

@ -0,0 +1,85 @@
/**
* 加载绩效附表
*/
function getDoc(equipmentId) {
$("#table_doc").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/document/getInputFileList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
equipmentId: equipmentId,
tbName: 'tb_doc_file'
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
// viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'filename', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'user.caption', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
}, {
field: 'equipmentcardnames', // 返回json数据中的name
title: '关联设备', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun_Doc(\'' + row.abspath + '\',\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">浏览</span></button>';
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload_Doc(\'' + row.id + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_doc");
// console.info("加载数据成功");
},
onLoadError: function () { //加载失败时执行
// console.info("加载数据失败");
}
})
}
//浏览
var viewFun_Doc = function(urlpath,id){
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/teacher/teacherfile/doview_Layer.do', {urlpath:urlpath,id:id,tbName:'tb_doc_file'} , function(data) {
$("#subDiv_Doc").html(data);
openModal('subModal_Doc');
});
};
//下载文件
var fileDownload_Doc = function (id) {
stopBubbleDefaultEvent();
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=" + 'tb_doc_file');
};

View File

@ -0,0 +1,291 @@
var selectionIds = []; //保存选中ids
var locationFun = function (id){
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/cmd/cmdController/locationEquipment.do', {id: id}, function (data) {
alert('已发送定位指令');
});
}
//新增设备卡片
var addFun = function () {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/equipment/doadd.do', {unitId: unitId}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
// 批量新增申请
var addScrapApplyFuns = function () {
stopBubbleDefaultEvent();
// 检查数据是否选中
var checkedItems = $("#table").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems, function (index, item) {
datas += item.id + ",";
});
if (datas == "") {
showAlert('d', '请先选择记录', 'mainAlertdiv');
} else {
// 查看当前设备是否已存在报废明细表中
$.post(ext.contextPath + '/equipment/EquipmentScrapApply/doCheckAcrap.do', {ids: datas}, function (data) {
var result = eval("(" + data + ")");
if (result.res == 1) {
showAlert('d', result.data, '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 (will) {
if (will) {
// 调用报废申请保存接口
$.post(ext.contextPath + "/equipment/EquipmentScrapApply/doEquipmentCardSrcapSave.do", {companyId: unitId, ids: datas}, function (data) {
if (data.res == 1) {
$("#table").bootstrapTable('refresh');
// 报废申请编辑
$.post(ext.contextPath + "/equipment/EquipmentScrapApply/edit.do", {id: data.id}, function (data1) {
$("#subDiv_Scrap").html(data1);
openModal('subModal');
});
} else if (data.res == 0) {
showAlert('d', '保存失败');
} else {
showAlert('d', data.res);
}
}, 'json');
}
})
}
});
}
};
// 新增申请
var addScrapApplyFun = function (id) {
stopBubbleDefaultEvent();
// 查看当前设备是否已存在报废明细表中
$.post(ext.contextPath + '/equipment/EquipmentScrapApply/doCheckAcrap.do', {ids: id}, function (data) {
var result = eval("(" + data + ")");
if (result.res == 1) {
showAlert('d', result.data, '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 (will) {
if (will) {
// 调用报废申请保存接口
$.post(ext.contextPath + "/equipment/EquipmentScrapApply/doEquipmentCardSrcapSave.do", {companyId: unitId, ids: id}, function (data) {
if (data.res == 1) {
$("#table").bootstrapTable('refresh');
// 报废申请编辑
$.post(ext.contextPath + "/equipment/EquipmentScrapApply/edit.do", {id: data.id}, function (data1) {
$("#subDiv_Scrap").html(data1);
openModal('subModal');
});
} else if (data.res == 0) {
showAlert('d', '保存失败');
} else {
showAlert('d', data.res);
}
}, 'json');
}
})
}
});
};
//编辑资产类型
var editFun = function (id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/equipment/doedit.do', {id: id, unitId: unitId}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
//查看设备详情
var viewFun = function (id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/equipment/doview.do', {id: id}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
//删除多条资产类型数据
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 + '/equipment/dodeletes.do', {ids: datas}, function (data) {
var res = eval('(' + data + ')');
if (res.code > 0) {
$("#table").bootstrapTable('refresh');
} else {
$("#table").bootstrapTable('refresh');
showAlert('d', res.msg, 'mainAlertdiv');
}
});
}
});
}
};
//删除一条资产类型数据
var deleteFun = function (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 + '/equipment/dodelete.do', {id: id}, function (data) {
var res = eval('(' + data + ')');
if (res.code == 1) {
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', res.msg, 'mainAlertdiv');
}
});
}
});
};
/**
* 获取工艺段
*/
function getProcessSection() {
var selectType = $("#processSection").select2({minimumResultsForSearch: 10})
$.post(ext.contextPath + "/user/processSection/getList4EquipmentCard.do", {unitId: unitId}, function (data) {
$("#processSection").empty();
var selelct_ = $("#processSection").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('').trigger("change");
selelct_.on('change', function (e) {
// dosearch();
})
}, 'json');
}
//导入设备列表
function importFun() {
var companyId = unitId;
$.post(ext.contextPath + '/equipment/importEquipmentCard.do', {companyId: companyId}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
}
//导出设备列表
function downloadFun() {
var search_name = $("#equipment_search_name").val();
var companyId = $("#unitId").val();
var processSectionId = $("#processSectionId").val();
var equipmentClassId = $("#equipmentClassId").val();
var equipmentClassCode = $("#equipmentClassCode").val();
window.open(ext.contextPath + "/equipment/downloadEquipmentExcel.do?unitId=" + companyId
+ "&search_name=" + search_name
+ "&processSectionId=" + processSectionId
+ "&equipmentClassId=" + equipmentClassId
+ "&equipmentClassCode=" + equipmentClassCode
);
}
var dosearch = function () {
$("#table").bootstrapTable('refresh');
};

View File

@ -0,0 +1,98 @@
/**
* 加载绩效附表
*/
function getMaintenance4EquipmentCard(type, equipmentId) {
$("#table_maintain").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/workorder/workorderDetail/getlist.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
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: type,
equipmentId: equipmentId,
status: '1'
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
/*{
field: 'number',
title: '序号',
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '5%',
formatter: function (value, row, index) {
var pageSize = $('#table_maintain').bootstrapTable('getOptions').pageSize;//通过表的#id 可以得到每页多少条
var pageNumber = $('#table_maintain').bootstrapTable('getOptions').pageNumber;//通过表的#id 可以得到当前第几页
return pageSize * (pageNumber - 1) + index + 1; //返回每条的序号: 每页条数 * (当前页 - 1 + 序号
}
},*/
{
field: 'jobNumber', // 返回json数据中的name
title: '工单号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
},
{
field: 'planDate', // 返回json数据中的name
title: '计划时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
return value.substring(0, 10);
}
},
{
field: 'schemeResume', // 返回json数据中的name
title: '保养内容', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
formatter: function (value, row, index) {
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
}
},
{
field: 'user.caption', // 返回json数据中的name
title: '保养人员', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%'
},
{
field: 'repairDate', // 返回json数据中的name
title: '保养时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
formatter: function (value, row, index) {
return value.substring(0, 19);
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_maintain");
console.info("加载数据成功");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
}

View File

@ -0,0 +1,198 @@
/**
* 加载绩效附表
*/
function getMpoint4EquipmentCard(equipmentId, equipmentcardId, bizid, viewType) {
$("#table_mpoint2").bootstrapTable({ // 对应table标签的id
// url: ext.contextPath + '/work/mpoint/getlistES.do', // 获取表格数据的url
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
equipmentId: equipmentId,
equipmentcardId: equipmentcardId,
companyId: bizid
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
// viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'id_c',
checkbox: true, // 显示一个勾选框
},
{
field: 'parmname', // 返回json数据中的name
title: '点位名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
return value;
}
}
,
{
field: 'mpointcode', // 返回json数据中的name
title: '点位编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
return value;
}
}
,
{
field: 'parmvalue', // 返回json数据中的name
title: '最新值', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
return '<span onclick="showHis(\'' + row.mpointcode + '\',\'' + row.bizid + '\');" style="color:#004B97;cursor:pointer;">' + row.parmvalue + '</span>' + ' ' + row.unit;
}
}
,
{
field: 'measuredt', // 返回json数据中的name
title: '时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
value = value.replace(RegExp("T", "g"), " ");
value = value.replace(RegExp("Z", "g"), " ");
value = value.substring(0, 19);
return value;
}
}
],
onLoadSuccess: function () { //加载成功时执行
if (viewType == 'view') {
$("#table_mpoint2").bootstrapTable('hideColumn', 'id_c');//隐藏上述variablevalue列
}
adjustBootstrapTableView("table_mpoint2");
console.info("加载数据成功");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
}
//曲线
function showHis(mpcode, bizid) {
$.post(ext.contextPath + '/data/showOnlyLine.do', {mpcode: mpcode, unitId: bizid}, function (data) {
$("#subDivHis").html(data);
openModal('curveModal');
});
}
/**
* 弹窗摄像头选择页面
* @param equipmentId
*/
var doAdd_mpoint = function () {
$.post(ext.contextPath + '/work/mpoint/mpointList4Layer.do', {
mpids: '',
fucname: 'dosave_mpoint',
existenceIds: getIdsMPoint()
}, function (data) {
$("#subDiv_PatroPoint").html(data);
openModal('subModalMpoint');
});
};
//获取关联的ids测量点
function getIdsMPoint() {
var allTableData = $("#table_mpoint2").bootstrapTable('getData');
var mPointIds = "";
$.each(allTableData, function (index, item) {
if (mPointIds != "") {
mPointIds += ",";
}
if (item.mPoint != null && item.mPoint != '') {//避免因测量点删除 无法加载
mPointIds += "'" + item.mPoint.mpointid + "'";
}
})
return mPointIds;
}
//保存(测量点)
function dosave_mpoint(data) {
$.post(ext.contextPath + '/equipment/updateMPoints.do', {
mPointIds: data,
equipmentId: equipmentId,
bizId: bizId
}, function (data) {
if (data.res > 0) {
$("#table_mpoint2").bootstrapTable('refresh');
} else {
showAlert('d', '导入失败', 'mainAlertdiv');
}
}, 'json');
}
/**
* 删除关联的摄像头
*/
var doDelete_mpoint = function () {
var checkedItems_camera = $("#table_mpoint2").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems_camera, function (index, item) {
datas += item.id + ",";
});
if (datas == "") {
showAlert('d', '请先选择记录', 'cameraAlertdiv');
} 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 + '/equipment/deleteMPoints.do', {
ids: datas,
bizId: bizId
}, function (data) {
if (data > 0) {
$("#table_mpoint2").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
}
};

View File

@ -0,0 +1,75 @@
/**
* 加载绩效附表
*/
function getRepair4EquipmentCard(type, equipmentId) {
$("#table_repair").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/workorder/workorderDetail/getlist.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
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: type,
equipmentId: equipmentId,
status: '1'
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'jobNumber', // 返回json数据中的name
title: '工单号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '30%',
},
{
field: 'faultDescription', // 返回json数据中的name
title: '故障现象', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '40%'
},
{
field: 'user.caption', // 返回json数据中的name
title: '维修人员', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%'
},
{
field: 'repairDate', // 返回json数据中的name
title: '维修时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '15%',
formatter: function (value, row, index) {
if(value!=null){
return value.substring(0, 19);
}
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_repair");
console.info("加载数据成功");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
}

View File

@ -0,0 +1,105 @@
/**
* 加载绩效附表
*/
function getSpecial(type, equipmentId) {
$("#table_special").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/equipment/specialEquipment/getList4EquipmentId.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
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: type,
equipmentId: equipmentId
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
title: '设备编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'equipmentCard.equipmentname', // 返回json数据中的name
title: '设备名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'equipmentClass', // 返回json数据中的name
title: '类型', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'recentTime', // 返回json数据中的name
title: '登记时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter: function (value, row, index) {
return value.substring(0, 10);
}
}, {
field: 'nextRecordTime', // 返回json数据中的name
title: '下次登记时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter: function (value, row, index) {
return value.substring(0, 10);
}
}, {
field: 'status', // 返回json数据中的name
title: '状态', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
cellStyle: function (value, row, index) {
if (value == '到期') {
return {css: {"background-color": "#FF7F27", "color": "#FFFFFF"}};
} else if (value == '预警') {
return {css: {"background-color": "#FFC90E", "color": "#FFFFFF"}};
} else if (value == '过期') {
return {css: {"background-color": "#FF0000", "color": "#FFFFFF"}};
} else {
return '';
}
},
}, {
field: 'actFinishTime', // 返回json数据中的name
title: '实际登记时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
formatter: function (value, row, index) {
return value.substring(0, 10);
}
}, {
field: 'dealDesc', // 返回json数据中的name
title: '处理情况', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table_special");
console.info("加载数据成功");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,220 @@
/**
* 加载绩效附表
*/
function getMaintenanceConfig4EquipmentCard(equipmentId, viewType) {
$("#maintenanceConfigtable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/maintenance/maintenanceEquipmentConfig/getlist.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
equipmentId: equipmentId
}
},
onClickRow: function (row) {//单击行事件,执行查看功能
// viewMaintainFun(row.id);
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'id_d',
checkbox: true, // 显示一个勾选框
},
// {
// field: 'month', // 返回json数据中的name
// title: '起始月份', // 表格表头显示文字
// align: 'center', // 左右居中
// valign: 'middle',
// width: '20%',
// formatter: function (value, row, index) {
// return value + '月份';
// }
// },
{
field: 'title', // 返回json数据中的name
title: '保养名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return value;
}
},
{
field: 'cycle', // 返回json数据中的name
title: '周期', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '10%',
formatter: function (value, row, index) {
return value + '个月';
}
},
{
field: 'lastTime', // 返回json数据中的name
title: '上次保养时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '20%',
formatter: function (value, row, index) {
return value.substring(0,10);
}
},
{
field: 'contents', // 返回json数据中的name
title: '保养内容', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '50%',
},
{
title: "操作",
align: 'center',
valign: 'middle',
width: '10%', // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
// buts += '<button type="button" class="btn btn-default btn-sm" title="查看" onclick="doView_MainConfig(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 浏览</span></button>';
if (viewType != 'view') {
buts += '<button type="button" class="btn btn-default btn-sm" title="编辑" onclick="doEdit_MainConfig(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts += '<button type="button" class="btn btn-default btn-sm" title="删除" onclick="doDeleteOne_MainConfig(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg"> 删除</span></button>';
}
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
if (viewType == 'view') {
$("#maintenanceConfigtable").bootstrapTable('hideColumn', 'id_d');//隐藏上述variablevalue列
}
adjustBootstrapTableView("maintenanceConfigtable");
console.info("加载数据成功_备注");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败_备注");
}
})
}
/**
* 弹窗备注选择页面
* @param equipmentId
*/
var doAdd_MainConfig = function (equipmentId) {
$.post(ext.contextPath + '/maintenance/maintenanceEquipmentConfig/doadd.do', {equipmentId: equipmentId}, function (data) {
$("#subMainConfigAddDiv").html(data);
openModal('SubModal_MainConfig_Add');
});
};
var doEdit_MainConfig = function (id) {
$.post(ext.contextPath + '/maintenance/maintenanceEquipmentConfig/doedit.do', {id: id}, function (data) {
$("#subMainConfigEditDiv").html(data);
openModal('SubModal_MainConfig_Edit');
});
};
var doView_MainConfig = function (id) {
$.post(ext.contextPath + '/maintenance/maintenanceEquipmentConfig/doview.do', {id: id}, function (data) {
$("#subRemarkViewDiv").html(data);
openModal('SubModal_MainConfig');
});
};
/**
* 删除关联的备注
*/
var doDelete_MainConfig = function () {
var checkedItems_remark = $("#maintenanceConfigtable").bootstrapTable('getSelections');
var datas = "";
$.each(checkedItems_remark, 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 + '/maintenance/maintenanceEquipmentConfig/dodeletes.do', {ids: datas}, function (data) {
if (data > 0) {
$("#maintenanceConfigtable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
}
};
/**
* 删除关联的备注
*/
var doDeleteOne_MainConfig = 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 + '/maintenance/maintenanceEquipmentConfig/dodelete.do', {id: id}, function (data) {
if (data > 0) {
$("#maintenanceConfigtable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
};