Compare commits

5 Commits

Author SHA1 Message Date
e5da30098f Merge branch 'deng' of http://101.43.41.9:13000/xzzn/SIPAIIS_WMS_JSSW into deng 2026-04-14 20:13:49 +08:00
65c2a978b8 feat(main_JS_Company): 重构主配置与企业模块数据加载逻辑 2026-04-14 20:13:47 +08:00
80fa5872fd bug 2026-04-13 21:37:01 +08:00
5c576ddfcb bug 2026-04-09 14:16:18 +08:00
f89ab0f90d bug 2026-04-09 09:09:00 +08:00
24 changed files with 758 additions and 570 deletions

View File

@ -2217,12 +2217,27 @@ public class EquipmentCardController {
HttpServletResponse response, Model model) throws IOException {
String wherestr = " where 1=1 ";
String unitId = request.getParameter("unitId");
if (unitId == null || unitId.isEmpty()) {
unitId = request.getParameter("companyId");
}
String search_name = request.getParameter("search_name");
if (search_name == null || search_name.trim().isEmpty()) {
search_name = request.getParameter("equipmentName");
}
String processSectionId = request.getParameter("processSectionId");
if (processSectionId == null || processSectionId.trim().isEmpty() || "undefined".equals(processSectionId)) {
processSectionId = request.getParameter("processSection");
}
String equipmentClassId = request.getParameter("equipmentClassId");
if (equipmentClassId == null || equipmentClassId.trim().isEmpty() || "undefined".equals(equipmentClassId)) {
equipmentClassId = request.getParameter("search_pid1");
}
String equipmentLevel = request.getParameter("equipmentLevel");
String equipmentClassCode = request.getParameter("equipmentClassCode");//类似竹一的计量表 该页面仅显示一种设备类型的
String ids = request.getParameter("ids");//页面勾选的设备id
if (ids == null || ids.trim().isEmpty()) {
ids = request.getParameter("equipmentIds");
}
if (unitId != null && !unitId.isEmpty()) {
//获取公司下所有子节点
@ -2272,6 +2287,26 @@ public class EquipmentCardController {
// System.out.println(wherestr);
if (ids != null && !ids.trim().isEmpty()) {
// 兼容前端可能携带的首尾逗号与空白,确保仅导出选中设备。
String[] idArr = ids.split(",");
StringBuilder selectedIds = new StringBuilder();
for (String id : idArr) {
if (id != null) {
String trimmedId = id.trim();
if (!trimmedId.isEmpty()) {
if (selectedIds.length() > 0) {
selectedIds.append("','");
}
selectedIds.append(trimmedId);
}
}
}
if (selectedIds.length() > 0) {
wherestr += " and id in ('" + selectedIds + "') ";
}
}
List<EquipmentCard> equipmentCards = this.equipmentCardService.selectListByWhere(wherestr);
//导出文件到指定目录,兼容Linux
this.equipmentCardService.downloadEquipmentExcel(response, equipmentCards);

View File

@ -242,11 +242,20 @@ public class ProcessSectionController {
@RequestMapping("/getProcessSection4Select.do")
public String getProcessSection4Select(HttpServletRequest request, Model model) {
String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
// 使用unitService获取Unit信息因为companyId来自tb_unit
// companyId在不同页面可能来自tb_unit或tb_company统一兼容两种来源
Unit unit = this.unitService.getUnitById(companyId);
String unitType = null;
if (unit != null) {
unitType = unit.getType();
} else if (companyId != null && !companyId.isEmpty()) {
Company company = this.unitService.getCompById(companyId);
if (company != null) {
unitType = company.getType();
}
}
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' ";
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
if (CommString.UNIT_TYPE_COMPANY.equals(unitType)) { // "C";//公司
String bizs = "";//公司下属所有厂id
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
if (blist != null && blist.size() > 0) {
@ -258,7 +267,7 @@ public class ProcessSectionController {
}
bizs = bizs.replace(",", "','");
wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) ";
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂
} else if (CommString.UNIT_TYPE_BIZ.equals(unitType)) { // B 水厂
wherestr += " and unit_id='" + companyId + "' ";
}
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
@ -273,13 +282,16 @@ public class ProcessSectionController {
for (int i = 0; i < processSections.size(); i++) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", processSections.get(i).getCode());
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
if (CommString.UNIT_TYPE_COMPANY.equals(unitType)) { // "C";//公司
if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
} else {
jsonObject.put("text", processSections.get(i).getSname());
}
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂
} else if (CommString.UNIT_TYPE_BIZ.equals(unitType)) { // "B";//水厂
jsonObject.put("text", processSections.get(i).getSname());
} else {
// 兜底避免前端下拉出现有id无text导致显示为空
jsonObject.put("text", processSections.get(i).getSname());
}

View File

@ -89,11 +89,26 @@ public class KPIPointController {
// List<MPointHistory> lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
for (int i=0; i < list.size(); i++) {
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
String rawBizId = list.get(i).getBizid();
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
if (processSection == null && list.get(i).getProcesssectionid() != null && !list.get(i).getProcesssectionid().isEmpty()) {
// KPI里历史数据存在按code保存工艺段的场景优先按厂区code匹配再回退到系统库
List<ProcessSection> processSectionList = this.processSectionService.selectSimpleListByWhere(
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + rawBizId + "' "
);
if (processSectionList == null || processSectionList.isEmpty()) {
processSectionList = this.processSectionService.selectSimpleListByWhere(
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + ProcessSection.UnitId_Sys + "' "
);
}
if (processSectionList != null && !processSectionList.isEmpty()) {
processSection = processSectionList.get(0);
}
}
if (processSection != null) {
list.get(i).setProcessectionname(processSection.getName());
}
Company company = this.unitService.getCompById(list.get(i).getBizid());
Company company = this.unitService.getCompById(rawBizId);
if (company != null) {
list.get(i).setBizid(company.getName());
}

View File

@ -636,45 +636,77 @@
var enterpriseTotal = 0;
var enterpriseOnline = 0;
var enterpriseList = [];
var enterprisePageSize = 20; // 每页20条
var enterpriseCurrentPage = 1; // 当前页码
// 加载企业数据
// 加载企业数据(分页)
function loadEnterpriseData() {
loadEnterpriseList(enterpriseCurrentPage);
}
// 加载企业列表(分页)
function loadEnterpriseList(page) {
enterpriseCurrentPage = page;
$.ajax({
type: 'POST',
url: ext.contextPath + '/sparepart/sewage/getList.do',
data: {
page: 1,
rows: 1000,
page: page,
rows: enterprisePageSize,
sort: "displacement",
order: "asc",
unitId: defaultUnitId,
},
// async: true,
// dataType: 'json',
// globle: false,
async: true,
globle: false,
error: function () {
// loadEnterpriseDataMock();
return false;
},
success: function (data) {
if (typeof data === "string") {
var dataList = JSON.parse(data);
if (dataList && dataList.rows) {
var list = dataList.rows || [];
enterpriseTotal = dataList.total;
enterpriseOnline = list.filter(function(item) {
return item._input;
}).length;
enterpriseList = list;
renderEnterpriseStats();
renderEnterpriseList(list);
} else {
loadEnterpriseDataMock();
if (typeof data === "string") {
var dataList = JSON.parse(data);
if (dataList && dataList.rows) {
var list = dataList.rows || [];
enterpriseTotal = dataList.total;
// 统计在线数量(全部数据,不仅仅是当前页)
enterpriseOnline = list.filter(function(item) {
return item._input;
}).length;
enterpriseList = list;
// 为每个企业查询瞬时流量
var promises = [];
list.forEach(function(item) {
if (item.ventNum) {
var mpointCode = item.ventNum + '_SSLL';
promises.push(
getMpointValueAsync(mpointCode).then(function(value) {
item.flow = value.parmvalue || '0';
})
);
} else {
item.flow = '--';
}
});
// 等待所有瞬时流量查询完成后渲染
Promise.all(promises).then(function() {
renderEnterpriseStats();
renderEnterpriseList(list);
renderEnterprisePagination();
}).catch(function() {
renderEnterpriseStats();
renderEnterpriseList(list);
renderEnterprisePagination();
});
} else {
loadEnterpriseDataMock();
}
}
}
}
});
}
});
}
// Mock企业数据
function loadEnterpriseDataMock() {
@ -700,9 +732,10 @@
$('#enterprise_total').text(enterpriseTotal);
$('#enterprise_online').text(enterpriseOnline);
$('#enterprise_offline').text(enterpriseTotal - enterpriseOnline);
// 计算总流量
// 计算总流量(当前页)
var totalFlow = enterpriseList.reduce(function(sum, item) {
return sum + (item.attributes && item.attributes.flow ? item.attributes.flow : 0);
var flow = item.flow || 0;
return sum + (typeof flow === 'number' ? flow : 0);
}, 0);
$('#enterprise_total_flow').text(formatNumber(totalFlow));
}
@ -713,7 +746,7 @@
list.forEach(function(item) {
var name = item.name || item.text || '--';
var status = item._input ? 'online' : 'offline';
var flow = item.attributes && item.attributes.flow ? item.attributes.flow : 0;
var flow = item.flow || '--';
var statusClass = status === 'online' ? 'online' : 'offline';
var statusText = status === 'online' ? '已接入' : '未接入';
@ -734,9 +767,34 @@
$('#enterprise_list').html(html);
}
// 渲染企业分页控件
function renderEnterprisePagination() {
var totalPages = Math.ceil(enterpriseTotal / enterprisePageSize);
// 更新分页信息
var pageInfo = '第 ' + enterpriseCurrentPage + '/' + totalPages + ' 页,共 ' + enterpriseTotal + ' 条';
$('#enterprise_page_info').text(pageInfo);
// 更新分页按钮
var btnHtml = '';
btnHtml += '<button class="pagination-btn" onclick="enterpriseGoToPage(1)" ' + (enterpriseCurrentPage === 1 ? 'disabled' : '') + '>首页</button>';
btnHtml += '<button class="pagination-btn" onclick="enterpriseGoToPage(' + (enterpriseCurrentPage - 1) + ')" ' + (enterpriseCurrentPage === 1 ? 'disabled' : '') + '>上一页</button>';
btnHtml += '<button class="pagination-btn" onclick="enterpriseGoToPage(' + (enterpriseCurrentPage + 1) + ')" ' + (enterpriseCurrentPage >= totalPages ? 'disabled' : '') + '>下一页</button>';
btnHtml += '<button class="pagination-btn" onclick="enterpriseGoToPage(' + totalPages + ')" ' + (enterpriseCurrentPage >= totalPages ? 'disabled' : '') + '>末页</button>';
$('#enterprise_page_btns').html(btnHtml);
}
// 企业列表分页跳转
function enterpriseGoToPage(page) {
var totalPages = Math.ceil(enterpriseTotal / enterprisePageSize);
if (page < 1) page = 1;
if (page > totalPages) page = totalPages;
loadEnterpriseList(page);
}
// 格式化数字
function formatNumber(num) {
if (num === null || num === undefined) return '--';
if (num === null || num === undefined || num === '--') return '--';
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
@ -857,11 +915,12 @@
// }
initProcessListByConfig(code, divid);
// 如果没有告警配置,使用默认数据
var hasAlarmConfig = mpcode.some(function(item) { return item.type === 'alarm'; });
if (!hasAlarmConfig) {
initAlarmList();
}
// // 如果没有告警配置,使用默认数据
// var hasAlarmConfig = mpcode.some(function(item) { return item.type === 'alarm'; });
// if (!hasAlarmConfig) {
// initAlarmList();
// }
initAlarmListByConfig(code, divid)
}
function initData() {
@ -1110,16 +1169,24 @@
return data;
}
// 根据配置初始化工艺列表 - 调用工艺段接口
// 根据配置初始化工艺列表 - 调用工艺段接口(支持分页)
// /TGLW/user/processSection/getlist.do?rows=50&page=1&order=asc&search_code=0533JS&unitId=0533JS&search_name=&_=1775558221772
var processTotal = 0; // 工艺段总数
function initProcessListByConfig(mpointCode, containerId) {
loadProcessList(processCurrentPage);
}
// 加载工艺列表(分页)
function loadProcessList(page) {
processCurrentPage = page;
$.ajax({
type: 'GET',
url: ext.contextPath + '/user/processSection/getlist.do',
data: {
unitId: defaultUnitId,
rows: 50,
page: 1,
rows: processPageSize,
page: page,
},
async: true,
dataType: 'json',
@ -1131,6 +1198,9 @@
},
success: function (data) {
if (data && data.rows) {
// 更新总数
processTotal = data.total || data.rows.length;
// 将接口返回的工艺段数据转换为表格格式
processData = [];
var rows = data.rows || [];
@ -1153,9 +1223,10 @@
var mpointCodeParam = item.id + '_' + suffix;
promises.push(
getMpointValueAsync(mpointCodeParam).then(function(value) {
if (suffix === '1') processItem.param1 = value;
else if (suffix === '2') processItem.param2 = value;
else if (suffix === '3') processItem.param3 = value;
let values = (value.parmname || '--') + ':' + (value.parmvalue || '--') + (value.unit || '')
if (suffix === '1') processItem.param1 = values;
else if (suffix === '2') processItem.param2 = values;
else if (suffix === '3') processItem.param3 = values;
})
);
});
@ -1164,8 +1235,10 @@
// 等待所有测点值获取完成后渲染表格
Promise.all(promises).then(function() {
renderProcessTable();
renderProcessPagination();
}).catch(function() {
renderProcessTable();
renderProcessPagination();
});
} else {
// processData = generateProcessData();
@ -1190,7 +1263,8 @@
globle: false,
success: function(data) {
if (data && data.parmvalue !== undefined && data.parmvalue !== null) {
resolve(data.parmname + ':' + data.parmvalue + data.unit);
resolve(data);
// resolve(data.parmname + ':' + data.parmvalue + data.unit);
} else {
resolve('--');
}
@ -1226,36 +1300,65 @@
return data;
}
// 根据配置初始化告警列表
// 根据配置初始化告警列表 - 调用告警接口
// 参考 proAlarmList.jsp 的接口调用
function initAlarmListByConfig(mpointCode, containerId) {
// 获取当前时间和7天前时间
var endTime = new Date();
var startTime = new Date(endTime.getTime() - 7 * 24 * 60 * 60 * 1000);
var formatDate = function(date) {
return date.getFullYear() + '-' +
String(date.getMonth() + 1).padStart(2, '0') + '-' +
String(date.getDate()).padStart(2, '0') + ' ' +
String(date.getHours()).padStart(2, '0') + ':' +
String(date.getMinutes()).padStart(2, '0');
};
$.ajax({
type: 'GET',
url: ext.contextPath + '/work/mpoint/getAlarmList.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
type: 'POST',
url: ext.contextPath + '/alarm/proAlarm/getlist.do',
data: {
companyId: defaultUnitId,
search_name: '',
pSectionCode: '',
alarmType: '',
alarmlevel: '',
status: '',
sdt: formatDate(startTime),
edt: formatDate(endTime)
},
async: true,
dataType: 'json',
globle: false,
error: function () {
alarmData = generateAlarmData();
renderAlarmTable();
// alarmData = generateAlarmData();
// renderAlarmTable();
return false;
},
success: function (data) {
if (data != null && data !== '') {
try {
var result = eval('(' + data + ')');
if (result.status === 'pass' && result.alarmList) {
alarmData = result.alarmList;
renderAlarmTable();
} else {
alarmData = generateAlarmData();
renderAlarmTable();
}
} catch (e) {
alarmData = generateAlarmData();
renderAlarmTable();
}
} else {
alarmData = generateAlarmData();
if (data && data.rows && data.rows.length > 0) {
// 将接口返回的告警数据转换为表格格式
alarmData = [];
data.rows.forEach(function(item) {
alarmData.push({
id: item.id,
process: item.pointName || item.processSectionName || '--',
pointCode: item.pointCode || '',
status: item.status || '',
alarmLevel: item.alarmLevel || '',
alarmTime: item.alarmTime || '',
describe: item.describe || '',
alarmTypeName: item.alarmTypeName || '',
confirmerName: item.confirmerName || '',
confirmTime: item.confirmTime || '',
time: item.alarmTime ? item.alarmTime.substring(0, 16) : '--',
bizId: item.bizId || ''
});
});
renderAlarmTable();
} else {
// alarmData = generateAlarmData();
// renderAlarmTable();
}
}
});
@ -1267,14 +1370,11 @@
}
function renderProcessTable() {
var start = (processCurrentPage - 1) * processPageSize;
var end = Math.min(start + processPageSize, processData.length);
var pageData = processData.slice(start, end);
// 服务端分页processData 已经是当前页数据
var html = '';
pageData.forEach(function(process) {
processData.forEach(function(process) {
html += '<tr>';
html += '<td>' + process.name + '</td>';
html += '<td>' + (process.processName || process.name || '--') + '</td>';
html += '<td>' + process.param1 + '</td>';
html += '<td>' + process.param2 + '</td>';
html += '<td>' + process.param3 + '</td>';
@ -1282,26 +1382,30 @@
html += '</tr>';
});
$('#process_table tbody').html(html);
}
// 渲染工艺列表分页控件
function renderProcessPagination() {
var totalPages = Math.ceil(processTotal / processPageSize);
// 更新分页信息
var totalPages = Math.ceil(processData.length / processPageSize);
$('#process_page_info').text('第 ' + processCurrentPage + '/' + totalPages + ' 页,共 ' + processData.length + ' 条');
$('#process_page_info').text('第 ' + processCurrentPage + '/' + totalPages + ' 页,共 ' + processTotal + ' 条');
// 更新分页按钮
var btnHtml = '';
btnHtml += '<button class="pagination-btn" onclick="processGoToPage(1)" ' + (processCurrentPage === 1 ? 'disabled' : '') + '>首页</button>';
btnHtml += '<button class="pagination-btn" onclick="processGoToPage(' + (processCurrentPage - 1) + ')" ' + (processCurrentPage === 1 ? 'disabled' : '') + '>上一页</button>';
btnHtml += '<button class="pagination-btn" onclick="processGoToPage(' + (processCurrentPage + 1) + ')" ' + (processCurrentPage === totalPages ? 'disabled' : '') + '>下一页</button>';
// btnHtml += '<button class="pagination-btn" onclick="processGoToPage(' + totalPages + ')" ' + (processCurrentPage === totalPages ? 'disabled' : '') + '>末页</button>';
btnHtml += '<button class="pagination-btn" onclick="processGoToPage(' + (processCurrentPage + 1) + ')" ' + (processCurrentPage >= totalPages ? 'disabled' : '') + '>下一页</button>';
btnHtml += '<button class="pagination-btn" onclick="processGoToPage(' + totalPages + ')" ' + (processCurrentPage >= totalPages ? 'disabled' : '') + '>末页</button>';
$('#process_page_btns').html(btnHtml);
}
// 工艺列表分页跳转
function processGoToPage(page) {
var totalPages = Math.ceil(processData.length / processPageSize);
var totalPages = Math.ceil(processTotal / processPageSize);
if (page < 1) page = 1;
if (page > totalPages) page = totalPages;
processCurrentPage = page;
renderProcessTable();
loadProcessList(page);
}
function initAlarmList() {
@ -1653,6 +1757,12 @@
<div class="enterprise-list-wrapper" id="enterprise_list">
<!-- 企业卡片将通过JS动态生成 -->
</div>
<!-- 企业分页 -->
<div class="pagination">
<span class="pagination-info" id="enterprise_page_info"></span>
<div class="pagination-btns" id="enterprise_page_btns"></div>
</div>
</div>
</div>
</div>

View File

@ -173,8 +173,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on('change', function () {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
//工艺段选择后,清空原有工艺段选择的设备
$("#equipmentIds").val("");
$("#equipname").val("");

View File

@ -159,8 +159,8 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${abnormity.processSectionId}').trigger("change");
},'json');
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
},'json');
};
var companyId = "${abnormity.bizId}";
$(function(){
@ -181,9 +181,9 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val('${abnormity.processSectionId}').trigger("change");
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
}
selelct_.on('change',function(){
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
//工艺段选择后,清空原有工艺段选择的设备
$("#equipmentIds").val("");
$("#equipname").val("");

View File

@ -195,8 +195,8 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(e){
dosearch();
});
},'json');

View File

@ -156,8 +156,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
initAPPFun();
});
}, 'json');
@ -493,8 +493,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
// dosearch();
$("#table").bootstrapTable('refresh');
});

View File

@ -170,16 +170,16 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');
var statusSelect = $("#statusSelect").select2({
minimumResultsForSearch: 10,
placeholder: '请选择',
}).val('').trigger("change");
statusSelect.on("change", function (e) {
}).val('').trigger("change.select2");
statusSelect.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
$("#table").bootstrapTable({ // 对应table标签的id

View File

@ -174,8 +174,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val("").trigger("change");
selelct_.on("change", function (e) {
selelct_.val("").trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -187,8 +187,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val("").trigger("change");
selelct_.on("change", function (e) {
selelct_.val("").trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -271,8 +271,8 @@
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
});
selelct_.val("").trigger("change");
selelct_.on("change", function (e) {
selelct_.val("").trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -113,7 +113,7 @@ var selectMPint = function(pid) {
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change");
selelct_.val(data[0].id).trigger("change.select2");
}
},'json');
}else{
@ -131,8 +131,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('').trigger("change");
selelct.on("change",function(e){
selelct.val('').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
var companyId= $(this).val();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processsectionid").empty();
@ -147,8 +147,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
},'json');
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json');
});
}
},'json');

View File

@ -89,8 +89,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
},'json');
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json');
};
$(function(){
@ -116,8 +116,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
},'json');
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json');
}else{
$("#hidden_bizid").attr("disabled","disabled");
$("#input_bizid").css("display", "none");
@ -133,8 +133,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('${kPIPoint.bizid}').trigger("change");
selelct.on("change",function(e){
selelct.val('${kPIPoint.bizid}').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
var companyId= $(this).val();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processsectionid").empty();
@ -149,8 +149,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
},'json');
selelct_.val('').trigger("change.select2");
},'json');
});
}
},'json');

View File

@ -1,406 +1,435 @@
<%@ 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"%>
<%@ 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>
<title><%= ServerObject.atttable.get("TOPTITLE")%>
</title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<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">
var companyId = "";
var showMaintenanceList = function(id) {
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId:id} , function(data) {
$("#subDiv").html(data);
openModal('subMaintenanceModal');
});
};
var showHandleDetailList = function(id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId:id} , function(data) {
$("#subDiv").html(data);
openModal('handleDetailModal');
});
};
var viewEquipmentFun = function(equipmentName,equipmentCardID,id) {
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {equipmentName:equipmentName,equipmentCardID:equipmentCardID,id:id} , function(data) {
$("#subEquipmentDiv").html(data);
openModal('subEquipmentModal');
});
};
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<style type="text/css">
.select2-container .select2-selection--single {
height: 34px;
line-height: 34px;
}
var addFun = function() {
$.post(ext.contextPath + '/work/kpipoint/add.do', {} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
.select2-selection__arrow {
margin-top: 3px;
}
</style>
<script type="text/javascript">
var companyId = "";
var showMaintenanceList = function (id) {
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId: id}, function (data) {
$("#subDiv").html(data);
openModal('subMaintenanceModal');
});
};
var showHandleDetailList = function (id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId: id}, function (data) {
$("#subDiv").html(data);
openModal('handleDetailModal');
});
};
var viewEquipmentFun = function (equipmentName, equipmentCardID, id) {
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {
equipmentName: equipmentName,
equipmentCardID: equipmentCardID,
id: id
}, function (data) {
$("#subEquipmentDiv").html(data);
openModal('subEquipmentModal');
});
};
var editFun = function(id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/work/kpipoint/edit.do', {id:id} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var addFun = function () {
$.post(ext.contextPath + '/work/kpipoint/add.do', {}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var viewFun = function(id){
$.post(ext.contextPath + '/work/kpipoint/view.do', {id:id} , function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var editFun = function (id) {
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/work/kpipoint/edit.do', {id: id}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var viewFun = function (id) {
$.post(ext.contextPath + '/work/kpipoint/view.do', {id: id}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
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 + '/work/kpipoint/delete.do', {id: id}, function (data) {
if (data == 1) {
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', '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 + '/work/kpipoint/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/kpipoint/deletes.do', {ids:datas} , function(data) {
if(data>0){
$("#table").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','mainAlertdiv');
}
});
}
});
}
};
var dosearch = function() {
$("#table").bootstrapTable('refresh');
};
var refreshSelect = function() {
var selelct_ =$("#processSection").select2({
data: null,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
$("#processSection").empty();
// $("#table").bootstrapTable('refresh', {data:null});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
};
$(function() {
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
if(data.length == 1){
//选择厂区为一个厂时隐藏选择框
$("#search_code").css("display", "none");
$("#company").text(data[0].text);
companyId=data[0].id;
dosearch();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
};
//删除多条资产类型数据
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/kpipoint/deletes.do', {ids: datas}, function (data) {
if (data > 0) {
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
}
};
var dosearch = function () {
$("#table").bootstrapTable('refresh');
};
var loadProcessSectionSelect = function (bizId) {
if (!bizId) {
refreshSelect();
return;
}
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: bizId}, function (data) {
$("#processSection").empty();
var selelct_ = $("#processSection").select2({
data: data,
cache: false,
placeholder: '请选择',
allowClear: true,
escapeMarkup: function (markup) {
return markup;
},
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,
formatResult: function formatRepo(repo) {
return repo.text;
},
formatSelection: function formatRepoSelection(repo) {
return repo.text;
}
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
// 初始化时仅刷新控件显示,不触发查询
selelct_.val('').trigger("change.select2");
// 用select2事件触发查询避免普通change导致选中文本被立即重置
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
// 让select2先完成渲染再执行查询
setTimeout(function () {
dosearch();
}, 0);
});
}, 'json');
};
var refreshSelect = function () {
var selelct_ = $("#processSection").select2({
data: null,
placeholder: '请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) {
return markup;
}, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
$("#processSection").empty();
// $("#table").bootstrapTable('refresh', {data:null});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
};
$(function () {
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
if (data.length == 1) {
//选择厂区为一个厂时隐藏选择框
$("#search_code").css("display", "none");
$("#company").text(data[0].text);
companyId = data[0].id;
loadProcessSectionSelect(companyId);
dosearch();
} else {
// 当前页面可能不展示厂区下拉search_code被注释兜底按当前厂区/首个厂区加载工艺段
if ($("#search_code").length == 0) {
companyId = (typeof unitId !== "undefined" && unitId) ? unitId : data[0].id;
loadProcessSectionSelect(companyId);
dosearch();
return;
}
$("#company").css("display", "none");
var selelct = $("#search_code").select2({
data: data,
cache : false,
placeholder:'请选择',//默认文字提示
placeholder: '请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
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;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
}else{
$("#company").css("display", "none");
var selelct=$("#search_code").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;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change");
refreshSelect();
selelct.on("change",function(e){
companyId= $(this).val();
dosearch();
refreshSelect();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
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;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
});
}
},'json');
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/work/kpipoint/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,
search_name : $('#search_name').val(),
companyId: unitId,
pSectionId: $("#processSection").val(),
formatResult: function formatRepo(repo) {
return repo.text;
}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text;
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change.select2");
refreshSelect();
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function () {
companyId = $(this).val();
dosearch();
refreshSelect();
loadProcessSectionSelect(companyId);
});
}
},
sortName: 'grade', // 要排序的字段
sortOrder: 'asc', // 排序规则
onClickRow: function (row) {//单击行事件,执行查看功能
viewFun(row.id);
},
columns: [
{
checkbox: true, // 显示一个勾选框
},{
field: 'mpointid', // 返回json数据中的name
title: '测量点编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'mpointname', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'bizid', // 返回json数据中的name
title: '所属厂区', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'processectionname', // 返回json数据中的name
title: '工艺段', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'grade', // 返回json数据中的name
title: '重要等级', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle'
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 120, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts="";
buts+= '<security:authorize buttonUrl="work/scadaPic/edit.do">';
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts+= '</security:authorize>';
buts+= '<security:authorize buttonUrl="work/scadaPic/delete.do">';
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
buts+= '</security:authorize>';
buts='<div class="btn-group" >'+buts+'</div>';
return buts;
}, 'json');
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/work/kpipoint/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,
search_name: $('#search_name').val(),
companyId: companyId,
pSectionId: $("#processSection").val(),
}
},
sortName: 'grade', // 要排序的字段
sortOrder: 'asc', // 排序规则
onClickRow: function (row) {//单击行事件,执行查看功能
viewFun(row.id);
},
columns: [
{
checkbox: true, // 显示一个勾选框
}, {
field: 'mpointid', // 返回json数据中的name
title: '测量点编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'mpointname', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'bizid', // 返回json数据中的name
title: '所属厂区', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'processectionname', // 返回json数据中的name
title: '工艺段', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'grade', // 返回json数据中的name
title: '重要等级', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle'
}, {
title: "操作",
align: 'center',
valign: 'middle',
width: 120, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = "";
buts += '<security:authorize buttonUrl="work/scadaPic/edit.do">';
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
buts += '</security:authorize>';
buts += '<security:authorize buttonUrl="work/scadaPic/delete.do">';
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
buts += '</security:authorize>';
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
})
});
</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">
<label class="form-label" id="companylabel">水厂:</label>
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
</div> -->
<div class="form-group form-inline" style="padding:0;">
<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">
<label class="form-label" id="companylabel">水厂:</label>
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
</div> -->
<div class="form-group form-inline" style="padding:0;">
<div class="form-group form-inline">
<div class="form-group form-inline">
<div class="form-group form-inline">
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<security:authorize buttonUrl="work/scadaPic/add.do">
<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 btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
</security:authorize>
</div>
</div>
</div>
<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 class="btn-group" style="width: 220px;padding-bottom:10px;">
<security:authorize buttonUrl="work/scadaPic/add.do">
<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 btn-sm" onclick="deletesFun();"><i
class="fa fa-trash-o"></i> 删除
</button>
</security:authorize>
</div>
</div>
<div class="form-group pull-right">
<label class="form-label">工艺段</label>
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 220px;"></select>
</div>
</div>
<table id="table"></table>
<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 class="form-group pull-right">
<label class="form-label">工艺段</label>
<select class="form-control select2 " id="processSection" name="processSection"
style="width: 220px;"></select>
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
<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>
<!-- 文件上传-->
<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">
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
</script>
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc" + "ript>")
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc" + "ript>")
</script>
<!-- 引入ChartJS-->
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js"
charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js"
charset="utf-8"></script>
<!-- 引入daterangepicker-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
charset="utf-8"></script>
<!-- echarts-->
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>

View File

@ -139,6 +139,34 @@ var companyId = "";
var dosearch = function() {
$("#table").bootstrapTable('refresh');
};
var loadProcessSectionSelect = function(companyId) {
if (!companyId) {
refreshSelect();
return;
}
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',
allowClear: true,
escapeMarkup: function (markup) { return markup; },
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,
formatResult: function formatRepo(repo){return repo.text;},
formatSelection: function formatRepoSelection(repo){return repo.text;}
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
setTimeout(function(){
dosearch();
},0);
});
},'json');
};
var refreshSelect = function() {
var selelct_ =$("#processSection").select2({
data: null,
@ -163,27 +191,7 @@ var companyId = "";
$("#company").text(data[0].text);
companyId=data[0].id;
dosearch();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
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;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
loadProcessSectionSelect(companyId);
}else{
$("#company").css("display", "none");
var selelct=$("#search_code").select2({
@ -198,33 +206,14 @@ var companyId = "";
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
refreshSelect();
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val();
dosearch();
refreshSelect();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
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;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
});
loadProcessSectionSelect(companyId);
});
}
},'json');

View File

@ -366,8 +366,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');
@ -394,9 +394,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change");
//refreshSelect();
selelct.on("change", function (e) {
selelct.val('').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
companyId = $(this).val();
//dosearch();
//refreshSelect();
@ -422,8 +421,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -325,8 +325,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');
@ -353,9 +353,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change");
//refreshSelect();
selelct.on("change", function (e) {
selelct.val('').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
companyId = $(this).val();
//dosearch();
//refreshSelect();
@ -381,8 +380,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -133,8 +133,8 @@
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});

View File

@ -149,8 +149,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val('').trigger("change");
select.on("change", function (e) {
select.val('').trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});
@ -166,8 +166,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val("").trigger("change");
select.on("change", function (e) {
select.val("").trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});
@ -196,8 +196,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});

View File

@ -181,8 +181,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val('').trigger("change");
select.on("change", function (e) {
select.val('').trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1});
});
@ -200,8 +200,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val("").trigger("change");
select.on("change", function (e) {
select.val("").trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1});
});
@ -231,8 +231,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1});
});

View File

@ -108,7 +108,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change");
selelct_.val(data[0].id).trigger("change.select2");
}
},'json');
}else{
@ -126,7 +126,7 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val();
//重新选择厂区后清空设备和工艺段数据
$("#equipname").val("");
@ -134,7 +134,7 @@
$("#processSectionId").val("");
$("#processectionname").val("");
});
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
}
},'json');
@ -149,9 +149,9 @@
.updateStatus('plannedenddt', 'NOT_VALIDATED',null)
.validateField('plannedenddt');
});
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change");
});
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change.select2");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change.select2");
});
//选择设备根据厂区id选择厂内设备
var selectEquipmentCard = function() {
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipid").val()} , function(data) {

View File

@ -101,7 +101,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change");
selelct_.val(data[0].id).trigger("change.select2");
}
},'json');
}else{
@ -119,7 +119,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function(e){
companyId = $(this).val();
//重新选择厂区后清空设备和工艺段数据
if(companyId != "${maintenanceDetail.companyid}"){
@ -129,10 +129,10 @@
$("#processectionname").val("");
}
});
selelct.val('${maintenanceDetail.companyid}').trigger("change");
selelct.val('${maintenanceDetail.companyid}').trigger("change.select2");
}
},'json');
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change.select2");
//选择时间
$('#startDate').datepicker({
language: 'zh-CN',

View File

@ -133,8 +133,8 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
dosearch();
});
@ -153,9 +153,9 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
refreshSelect();
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val();
dosearch();
refreshSelect();
@ -174,8 +174,8 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
dosearch();
});
},'json');