first commit
This commit is contained in:
216
WebRoot/jsp/work/KPIPointAdd.jsp
Normal file
216
WebRoot/jsp/work/KPIPointAdd.jsp
Normal file
@ -0,0 +1,216 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$("#hidden_bizid").val(unitId);
|
||||
$.post(ext.contextPath + "/work/kpipoint/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
grade: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '重要等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//初始化工艺段选择框
|
||||
var refreshSelect = function() {
|
||||
$("#processsectionid").select2({
|
||||
data: null,
|
||||
placeholder:'请先选择厂区',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
};
|
||||
|
||||
$(function(){
|
||||
console.log(unitId);
|
||||
//选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
if(data.length == 1){
|
||||
$("#bizid").css("display", "none");
|
||||
$("#input_bizid").val(data[0].text);
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
var companyId = data[0].id;
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
if(data!=null && data.length>0){
|
||||
selelct_.val(data[0].id).trigger("change");
|
||||
}
|
||||
},'json');
|
||||
}else{
|
||||
$("#hidden_bizid").attr("disabled","disabled");
|
||||
$("#input_bizid").css("display", "none");
|
||||
refreshSelect();
|
||||
var selelct =$("#bizid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
var companyId= $(this).val();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
|
||||
},'json');
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增KPI测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*所属厂区</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="bizid" name ="bizid" style="width: 270px;">
|
||||
</select>
|
||||
<input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*工艺段</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="processsectionid" name ="processsectionid" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*测量点编号</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="hidden" class="form-control" style="cursor: pointer"id="mpcode" >
|
||||
<input type="text" class="form-control" style="cursor: pointer"id="mpid" name="mpointid" onclick="selectMPint('')" placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">测量点名称</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="txt" placeholder="测量点名称" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*重要等级</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="grade" name ="grade" placeholder="重要等级" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
240
WebRoot/jsp/work/KPIPointChart.jsp
Normal file
240
WebRoot/jsp/work/KPIPointChart.jsp
Normal file
@ -0,0 +1,240 @@
|
||||
<%@page import="com.sipai.entity.user.ExtSystem"%>
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
|
||||
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
|
||||
<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 mpcodestr="${idstr}";
|
||||
var mpnamestr="${namestr}";
|
||||
var mpunitstr="${unitstr}";
|
||||
var colors = ['#c12e34', '#e6b600', '#0098d9','#2b821d','#005eaa', '#339ca8', '#cda819','#32a487','#f3a43b','#60c0dd','#d7504b','#c6e579','#f4e001'];
|
||||
|
||||
//var colors = ['#c1232b', '#27727b', '#fcce10','#e87c25','#b5c334', '#fe8463', '#9bca63','#fad860','#f3a43b','#60c0dd','#d7504b','#c6e579','#f4e001'];
|
||||
$(function() {
|
||||
initDate1();
|
||||
mpcodestr = mpcodestr.substring(0, mpcodestr.length-1);
|
||||
mpcodestr = mpcodestr.split(",");
|
||||
mpnamestr = mpnamestr.substring(0, mpnamestr.length-1);
|
||||
|
||||
mpnamestr = mpnamestr.split(",");
|
||||
|
||||
mpunitstr = mpunitstr.substring(0, mpunitstr.length-1);
|
||||
mpunitstr = mpunitstr.split(",");
|
||||
getHistoryJsons('${idstr}','${namestr}','${unitstr}');
|
||||
});
|
||||
var beginTimeStore1 = '';
|
||||
var endTimeStore1 = '';
|
||||
function initDate1() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore1 = moment().subtract(6, 'days').format('YYYY-MM-DD');;
|
||||
endTimeStore1 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
if(${param.sdt==''}){
|
||||
beginTimeStore1='2019-03-16';
|
||||
}else{
|
||||
beginTimeStore1 ='${param.sdt}';
|
||||
}
|
||||
if(${param.edt==''}){
|
||||
endTimeStore1='2019-03-20';
|
||||
}else{
|
||||
endTimeStore1 ='${param.edt}';
|
||||
}
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker({
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function(start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if(!this.startDate){
|
||||
this.element.val('');
|
||||
}else{
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
};
|
||||
function getHistoryJsons(ids,names,units){
|
||||
|
||||
console.log(ids);
|
||||
console.log(names);
|
||||
console.log(units);
|
||||
$.post(ext.contextPath +"/work/mpoint/getHistory.do",{bizId:'${param.companyId}',ids:ids,sdt:beginTimeStore1,edt:endTimeStore1},function(data){
|
||||
//console.log(data);
|
||||
var ArrayDatas = eval("(" + data + ")");
|
||||
console.log(ArrayDatas);
|
||||
var measuredt = [];
|
||||
var res = ArrayDatas[0];
|
||||
for(var i=0;i<res.length;i++){
|
||||
measuredt.push(res[i].measuredt.substring(0,16));
|
||||
}
|
||||
var parmvalue = [];
|
||||
var mpnamestr = names.substring(0, names.length-1);
|
||||
mpnamestr = mpnamestr.split(",");
|
||||
var mpunitstr = units.substring(0, units.length-1);
|
||||
mpunitstr = mpunitstr.split(",");
|
||||
|
||||
var offset=50;
|
||||
var yaAxis=[];
|
||||
var series=[];
|
||||
for(var i=0;i<mpnamestr.length;i++){
|
||||
var xobj = {};
|
||||
xobj.type='value';
|
||||
if(i==0){
|
||||
xobj.name=mpnamestr[i];
|
||||
xobj.position='left';
|
||||
xobj.offset=0;
|
||||
}else{
|
||||
xobj.name=mpnamestr[i].split("").join("\n");
|
||||
xobj.nameLocation='middle'; //name位置,'start' 'middle' 'end'
|
||||
xobj.nameRotate=0;//name角度
|
||||
xobj.position='right';
|
||||
xobj.offset=offset*(i-1);
|
||||
}
|
||||
xobj.nameGap=30;//name与y轴距离
|
||||
var axisLine={};
|
||||
var lineStyle={};
|
||||
var length=mpnamestr.length;
|
||||
lineStyle.color=colors[i%colors.length];
|
||||
|
||||
axisLine.lineStyle=lineStyle;
|
||||
xobj.axisLine=axisLine;
|
||||
var axisLabel={};
|
||||
axisLabel.formatter='{value}'+mpunitstr[i];
|
||||
xobj.axisLabel=axisLabel;
|
||||
yaAxis.push(xobj);
|
||||
|
||||
var yobj = {};
|
||||
yobj.type='line';
|
||||
yobj.name=mpnamestr[i];
|
||||
yobj.yAxisIndex=i;
|
||||
var data =[];
|
||||
for(var j=0;j<measuredt.length;j++){
|
||||
var resy = ArrayDatas[i];
|
||||
data.push(resy[j].parmvalue);
|
||||
}
|
||||
yobj.data=data;
|
||||
series.push(yobj);
|
||||
}
|
||||
var option = {
|
||||
color: colors,
|
||||
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
right: '20%'
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
dataView: {show: false, readOnly: false},
|
||||
restore: {show: false},
|
||||
saveAsImage: {show: false}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data:mpnamestr,
|
||||
type: 'scroll',
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
data: measuredt,
|
||||
axisLabel: {
|
||||
|
||||
rotate: 340,//横坐标倾斜角度
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
],
|
||||
yAxis:yaAxis,
|
||||
series:series
|
||||
|
||||
};
|
||||
var chart = document.getElementById("box1");
|
||||
var number=mpnamestr.length;
|
||||
$("#box1").height(450);
|
||||
$("#box1").width( 900);
|
||||
// chart.style.width = 900-offset;
|
||||
var chartData = echarts.init(chart);
|
||||
|
||||
//setTimeout(function(){
|
||||
chartData.setOption(option);
|
||||
//},1000);
|
||||
});
|
||||
|
||||
}
|
||||
function dosearch(){
|
||||
mpcodestr="";
|
||||
mpnamestr="";
|
||||
mpunitstr="";
|
||||
getHistoryJsons('${idstr}','${namestr}','${unitstr}')
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal" >
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content" id="model">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">${namestr }曲线</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="model-body" style="overflow:auto;overflow-y:hidden;">
|
||||
<div class="input-group pull-right input-group-sm" >
|
||||
<input type="text" class="form-control pull-right" id="reservationtime2" style="width:175px">
|
||||
<div class="input-group-btn ">
|
||||
<button type="button" class="btn btn-default" onclick="dosearch();" ><i class="fa fa-search"></i> 查询</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="box1" style="margin-left:-30px"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
219
WebRoot/jsp/work/KPIPointEdit.jsp
Normal file
219
WebRoot/jsp/work/KPIPointEdit.jsp
Normal file
@ -0,0 +1,219 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/kpipoint/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
bizid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
grade: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '重要等级不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//初始化工艺段
|
||||
var refreshSelect = function(companyId) {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
|
||||
},'json');
|
||||
};
|
||||
|
||||
$(function(){
|
||||
//选择厂区
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
if(data.length == 1){
|
||||
$("#bizid").css("display", "none");
|
||||
$("#input_bizid").val(data[0].text);
|
||||
$("#hidden_bizid").val(data[0].id);
|
||||
var companyId = data[0].id;
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
|
||||
},'json');
|
||||
}else{
|
||||
$("#hidden_bizid").attr("disabled","disabled");
|
||||
$("#input_bizid").css("display", "none");
|
||||
refreshSelect('${kPIPoint.bizid}');
|
||||
var selelct =$("#bizid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('${kPIPoint.bizid}').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
var companyId= $(this).val();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ =$("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
},'json');
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑KPI测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${kPIPoint.id}">
|
||||
<label class="col-sm-3 control-label">*所属厂区</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="bizid" name ="bizid" style="width: 270px;">
|
||||
</select>
|
||||
<input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">工艺段</label>
|
||||
<div class="col-sm-7">
|
||||
<select class="form-control select2" id="processsectionid" name ="processsectionid" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*测量点编号</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="hidden" class="form-control" style="cursor: pointer"id="mpcode" >
|
||||
<input type="text" class="form-control" style="cursor: pointer"id="mpid" value="${kPIPoint.mpointid}" name ="mpointid" onclick="selectMPint('')" placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">测量点名称</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="txt" value="${kPIPoint.mpointname}" placeholder="测量点名称" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*重要等级</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="grade" name ="grade" placeholder="重要等级" value="${kPIPoint.grade}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
407
WebRoot/jsp/work/KPIPointList.jsp
Normal file
407
WebRoot/jsp/work/KPIPointList.jsp
Normal file
@ -0,0 +1,407 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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');
|
||||
});
|
||||
};
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/work/kpipoint/add.do', {} , 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 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({
|
||||
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');
|
||||
}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(),
|
||||
}
|
||||
},
|
||||
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("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
</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="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>
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
<!-- 引入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>
|
||||
<!-- 引入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>
|
||||
<!-- 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>
|
||||
</html>
|
||||
56
WebRoot/jsp/work/KPIPointProfessorEdit.jsp
Normal file
56
WebRoot/jsp/work/KPIPointProfessorEdit.jsp
Normal file
@ -0,0 +1,56 @@
|
||||
<%@page import="com.sipai.entity.user.ExtSystem"%>
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
|
||||
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
|
||||
<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 addAbnorm = function() {
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doadd.do', {abnormityDescription:'${kPIPointProfessor.text}',processSectionId:'${kPIPointProfessor.processSectionId}'} , function(data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModalAbnorm');
|
||||
});
|
||||
};
|
||||
var addProcessAdjustment = function() {
|
||||
//var bizid = ${kPIPointProfessor.bizId};
|
||||
$.post(ext.contextPath + '/work/processAdjustment/add.do', {bizId:'${kPIPointProfessor.bizId}',contents:'${kPIPointProfessor.text}'} , function(data) {
|
||||
$("#subDiv_processAdjustment").html(data);
|
||||
openModal('subModal_processAdjust');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal" style="width:100%">
|
||||
<div class="modal-dialog modal-lg" style="width:60%">
|
||||
<div class="modal-content" id="model" >
|
||||
<div class="modal-header" >
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">水行家风险分析与决策建议</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="model-body" >
|
||||
|
||||
<h4 style="color:#ff0000" >风险等级: <span class="label " style="background-color:#ff0000">高</span></h4>
|
||||
<br>
|
||||
<h4 style="color:#0000ff" >${kPIPointProfessor.text }</h4>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-default pull-right" onclick="addAbnorm()">生成异常</button>
|
||||
<button type="button" class="btn btn-default pull-right" onclick="addProcessAdjustment()">工艺调度</button>
|
||||
<!-- <button type="button" class="btn btn-default pull-right" >执行</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
436
WebRoot/jsp/work/KPIPointProfessorList.jsp
Normal file
436
WebRoot/jsp/work/KPIPointProfessorList.jsp
Normal file
@ -0,0 +1,436 @@
|
||||
<%@ 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"%>
|
||||
<%@page import="com.sipai.entity.work.KPIPointProfessor"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%
|
||||
request.setAttribute("Flag_Yes", KPIPointProfessor.Flag_Yes);
|
||||
%>
|
||||
<%
|
||||
request.setAttribute("Flag_No", KPIPointProfessor.Flag_No);
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<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 addFun = function() {
|
||||
$.post(ext.contextPath + '/work/KPIPro/add.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/work/KPIPro/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(flag,mpid){
|
||||
if(flag=='${Flag_No}'){
|
||||
swal('暂无建议');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/work/KPIPro/view.do', {companyId:companyId,mpid:mpid} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal1');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
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(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/KPIPro/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/KPIPro/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({
|
||||
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');
|
||||
}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/KPIPro/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: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
if(row.mpid!=null &&row.mpid!=''){
|
||||
viewFun(row.flag,row.mpid);
|
||||
}else{
|
||||
editFun(row.id);
|
||||
}
|
||||
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'processSectionName', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'text', // 返回json数据中的name
|
||||
title: '内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'mpid', // 返回json数据中的name
|
||||
title: 'KPI', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'flag', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if(value == '${Flag_Yes}'){
|
||||
return "建议";
|
||||
}else if(value == '${Flag_No}'){
|
||||
return "建议解除";
|
||||
}else{
|
||||
return "建议恢复";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '更新时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width:150,
|
||||
formatter: function(value,row) {
|
||||
if(value!=''){
|
||||
return value.substring(0,16);
|
||||
} else{
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}/* {
|
||||
field: 'mark', // 返回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/KPIPro/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/KPIPro/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("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
</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 id="subDiv_processAdjustment"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></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="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/KPIPro/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>
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
<!-- 引入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>
|
||||
<!-- 引入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>
|
||||
<!-- 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>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
</html>
|
||||
324
WebRoot/jsp/work/KPIPointProfessorView.jsp
Normal file
324
WebRoot/jsp/work/KPIPointProfessorView.jsp
Normal file
@ -0,0 +1,324 @@
|
||||
<%@page import="com.sipai.entity.user.ExtSystem"%>
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
|
||||
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
|
||||
<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 ArrayDatas = eval(${data});
|
||||
var MpDatas=[];
|
||||
|
||||
$(function() {
|
||||
initDate1();
|
||||
//dochart();
|
||||
//dochart1();
|
||||
for (var i=0;i<ArrayDatas.length;i++){
|
||||
MpDatas = ArrayDatas[i].mpoint;
|
||||
for (var j=0;j<MpDatas.length;j++){
|
||||
showchart(i,j,MpDatas[j].chartType);
|
||||
}
|
||||
}
|
||||
});
|
||||
var beginTimeStore1 = '';
|
||||
var endTimeStore1 = '';
|
||||
function initDate1() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore1 = moment().subtract(6, 'days').format('YYYY-MM-DD');;
|
||||
endTimeStore1 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
if(${param.sdt==''}){
|
||||
beginTimeStore1='2017-09-09';
|
||||
}
|
||||
if(${param.edt==''}){
|
||||
endTimeStore1='2018-09-09';
|
||||
}
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime1').daterangepicker({
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function(start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = end.format(this.locale.format);
|
||||
if(!this.startDate){
|
||||
this.element.val('');
|
||||
}else{
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtime1').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
};
|
||||
function dochart(){
|
||||
console.log();
|
||||
//$.post(ext.contextPath +"/maintenance/getStaffMaintenanceResultView.do",{userId:"${param.userId}",sdt:beginTimeStore1,edt:endTimeStore1},function(data){
|
||||
var option = {
|
||||
/* title: {
|
||||
text: '折线图堆叠'
|
||||
}, */
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data:['沉淀池出水浊度','出水浊度上限']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
/* toolbox: {
|
||||
feature: {
|
||||
saveAsImage: {}
|
||||
}
|
||||
}, */
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data:['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00'],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name:'NUT'
|
||||
},
|
||||
color:['#00a65a','#ff0000'],
|
||||
series: [
|
||||
{
|
||||
name:'沉淀池出水浊度',
|
||||
type:'line',
|
||||
//stack: '总量',
|
||||
data:[5, 4, 4, 5, 4.5, 4.3, 4.7,5.1,5,4.6,4.9,10.9,4.5,5,4,4.5,4.1,4.2,4.5,5.1,5.6,5.3,5.9,6]
|
||||
},
|
||||
{
|
||||
name:'出水浊度上限',
|
||||
type:'line',
|
||||
data:[10, 10, 10, 10, 10, 10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
|
||||
if(myChart2!=null){
|
||||
myChart2.clear();
|
||||
myChart2.dispose();
|
||||
}
|
||||
//var boxHeight=legendData.length*200;
|
||||
var boxHeight=$("#subModal1").height()*0.2;
|
||||
var boxWidth=$("#subModal1").width()*0.6;
|
||||
$("#box2").height(boxHeight);
|
||||
$("#box2").width(boxWidth);
|
||||
/* var boxWidth=$("#boxdiv").width();
|
||||
$("#box").height(boxHeight);
|
||||
$("#box").width(boxWidth); */
|
||||
setTimeout(function(){
|
||||
myChart2 = echarts.init(document.getElementById("box2"));
|
||||
//自适用大小
|
||||
//用于使chart自适应高度和宽度
|
||||
//window.onresize=myChart.resize;
|
||||
myChart2.setOption(option);
|
||||
},100);
|
||||
|
||||
//},'json');
|
||||
}
|
||||
var myChart2;
|
||||
|
||||
|
||||
function dochart1(){
|
||||
//$.post(ext.contextPath +"/maintenance/getStaffMaintenanceResultView.do",{userId:"${param.userId}",sdt:beginTimeStore1,edt:endTimeStore1},function(data){
|
||||
var option = {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00'],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name:'m3',
|
||||
max: 1200,
|
||||
interval: 400,
|
||||
axisLabel: {
|
||||
formatter: '{value} '
|
||||
}
|
||||
},
|
||||
color:['#3c8dbc'],
|
||||
series: [{
|
||||
data: [1100, 1130, 1120,1070, 1200,1120, 1230, 1210,1120, 1220,1070,1120,1070,1130,1070,1060,1120,1130,1120,1150,1070,1130,1050,1120],
|
||||
type: 'bar'
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
if(myChart3!=null){
|
||||
myChart3.clear();
|
||||
myChart3.dispose();
|
||||
}
|
||||
//var boxHeight=legendData.length*200;
|
||||
var boxHeight=$("#subModal1").height()*0.2;
|
||||
var boxWidth=$("#subModal1").width()*0.6;
|
||||
$("#box3").height(boxHeight);
|
||||
$("#box3").width(boxWidth);
|
||||
/* var boxWidth=$("#boxdiv").width();
|
||||
$("#box").height(boxHeight);
|
||||
$("#box").width(boxWidth); */
|
||||
setTimeout(function(){
|
||||
myChart3 = echarts.init(document.getElementById("box3"));
|
||||
//自适用大小
|
||||
//用于使chart自适应高度和宽度
|
||||
//window.onresize=myChart.resize;
|
||||
myChart3.setOption(option);
|
||||
},100);
|
||||
|
||||
//},'json');
|
||||
}
|
||||
var myChart3;
|
||||
|
||||
function showchart(i,j,t){
|
||||
var myChart;
|
||||
var type = ['line','bar'];
|
||||
var color=['#00a65a','#00c0ef'];
|
||||
//console.log(ArrayDatas);
|
||||
console.log(MpDatas[j].id);
|
||||
//$.post(ext.contextPath +"/maintenance/getStaffMaintenanceResultView.do",{userId:"${param.userId}",sdt:beginTimeStore1,edt:endTimeStore1},function(data){
|
||||
$.post(ext.contextPath +"/work/mpoint/getHistory.do",{bizId:ArrayDatas[i].companyId,ids:MpDatas[j].mpcode,sdt:MpDatas[j].sdt,edt:MpDatas[j].edt},function(data){
|
||||
//console.log(data);
|
||||
var ArrayRes = eval(data);
|
||||
//console.log(MpDatas[j].mpoint.parmname);
|
||||
var measuredt = [];
|
||||
var parmvalue = [];
|
||||
var name = [];
|
||||
var unit = [];
|
||||
name.push(MpDatas[j].mpoint.parmname);
|
||||
unit.push(MpDatas[j].mpoint.unit);
|
||||
var res = ArrayRes[0];
|
||||
for(var k=0;k<res.length;k++){
|
||||
measuredt.push(res[k].measuredt.substring(0,16));
|
||||
parmvalue.push(res[k].parmvalue);
|
||||
|
||||
}
|
||||
console.log(parmvalue);
|
||||
var option = {
|
||||
title : {
|
||||
//text: name[0],
|
||||
subtext: name[0]
|
||||
},
|
||||
legend: {
|
||||
data:name
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data:measuredt,
|
||||
//data: ['0:00','1:00','2:00','3:00','4:00','5:00','6:00','7:00','8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00'],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name:unit[0],
|
||||
//max: 1200,
|
||||
//interval: 400,
|
||||
axisLabel: {
|
||||
formatter: '{value} '
|
||||
}
|
||||
},
|
||||
color:color[t],
|
||||
series: [{
|
||||
name:name[0],
|
||||
data:parmvalue,
|
||||
//data: [1100, 1130, 1120,1070, 1200,1120, 1230, 1210,1120, 1220,1070,1120,1070,1130,1070,1060,1120,1130,1120,1150,1070,1130,1050,1120],
|
||||
type: type[t]
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
if(myChart!=null){
|
||||
myChart.clear();
|
||||
myChart.dispose();
|
||||
}
|
||||
//var boxHeight=legendData.length*200;
|
||||
var boxHeight=$("#subModal1").height()*0.2;
|
||||
var boxWidth=$("#subModal1").width()*0.4;
|
||||
$("#box"+i+j).height(boxHeight);
|
||||
$("#box"+i+j).width(boxWidth);
|
||||
/* var boxWidth=$("#boxdiv").width();
|
||||
$("#box").height(boxHeight);
|
||||
$("#box").width(boxWidth); */
|
||||
setTimeout(function(){
|
||||
myChart = echarts.init(document.getElementById("box"+i+j));
|
||||
//自适用大小
|
||||
//用于使chart自适应高度和宽度
|
||||
//window.onresize=myChart.resize;
|
||||
myChart.setOption(option);
|
||||
},100);
|
||||
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal1" >
|
||||
<div class="modal-dialog modal-lg" >
|
||||
<div class="modal-content" id="model" >
|
||||
<div class="modal-header" >
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">水行家风险分析与决策建议</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="model-body" >
|
||||
<c:if test="${fn:length(list)>0}">
|
||||
<c:set var="rowcount" value="${0}" />
|
||||
<c:forEach var="current" items="${list}">
|
||||
<h4 style="color:#ff0000" >风险等级: <span class="label " style="background-color:#ff0000">高</span></h4>
|
||||
<br>
|
||||
<h4 style="color:#0000ff" >${current.text }</h4>
|
||||
<!-- <div id="box2" ></div>
|
||||
<div id="box3" ></div> -->
|
||||
<div id="box${rowcount}0" ></div>
|
||||
<div id="box${rowcount}1" ></div>
|
||||
<div id="box${rowcount}2" ></div>
|
||||
<div id="box${rowcount}3" ></div>
|
||||
<c:set var="rowcount" value="${rowcount+1}" />
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-default pull-right" >执行</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
69
WebRoot/jsp/work/KPIPointView.jsp
Normal file
69
WebRoot/jsp/work/KPIPointView.jsp
Normal file
@ -0,0 +1,69 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看KPI测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${kPIPoint.id}">
|
||||
<label class="col-sm-3 control-label">*所属厂区</label>
|
||||
<div class="col-sm-7">
|
||||
<input class="form-control select2" id="bizid" name ="bizid" style="width: 270px;" value ="${kPIPoint.bizid}" disabled/>
|
||||
<!-- <input class="form-control" id="input_bizid" style="border: none;background: transparent;">
|
||||
<input type="hidden" id="hidden_bizid" name ="bizid" > -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">工艺段</label>
|
||||
<div class="col-sm-7">
|
||||
<input class="form-control select2" id="processsectionid" name ="processsectionid" value ="${kPIPoint.processectionname}" style="width: 270px;" disabled/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*测量点编号</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" style="cursor: pointer"id="mpid" value="${kPIPoint.mpointid}" name ="mpointid" onclick="selectMPint('')" placeholder="单击选择" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">测量点名称</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="txt" value="${kPIPoint.mpointname}" placeholder="测量点名称" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*重要等级</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="grade" name ="grade" placeholder="重要等级" value="${kPIPoint.grade}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
264
WebRoot/jsp/work/MPoint4Select4Single.jsp
Normal file
264
WebRoot/jsp/work/MPoint4Select4Single.jsp
Normal file
@ -0,0 +1,264 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var dosearchMp = function() {
|
||||
$("#table_mpoint").bootstrapTable('refresh');
|
||||
};
|
||||
function doselect(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas_name="";
|
||||
var value_name="";
|
||||
var datas_code="";
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
$.post(ext.contextPath + '/work/mpoint/getlist.do', {companyId:unitId,checkedIds : checkedItem.id,page:1,rows:50}, function(resp) {
|
||||
//console.info(checkedItem.id)
|
||||
$.each(resp.rows, function(index, item){
|
||||
datas_name=item.parmname;//测量点一次只能添加一个
|
||||
value_name=item.parmvalue;
|
||||
datas_code=item.mpointcode;
|
||||
});
|
||||
// console.log("formid","${param.formId}");
|
||||
// console.log("formid","${param.hiddenId}");
|
||||
// console.log(companyId);
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(checkedItem.id);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
if('${param.valueId}'!=''){
|
||||
$('#${param.formId} #${param.valueId}').val(value_name);
|
||||
}
|
||||
if('${param.codeId}'!=''){
|
||||
$('#${param.formId} #${param.codeId}').val(datas_code);
|
||||
}
|
||||
if('${param.unitId}'!=''){
|
||||
$('#${param.formId} #${param.unitId}').val(unitId);
|
||||
}
|
||||
|
||||
|
||||
closeModal('mpSubModal');
|
||||
},'json');
|
||||
}else{
|
||||
showAlert('d','尚未选择测量点!','mpoint_mainAlertdiv');
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${mpid}'){
|
||||
flag=true;
|
||||
checkedItem = "";
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
var $table;
|
||||
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
pid:params.pid,
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
search_name: $('#search_mpointname').val(),
|
||||
search_mpointcode: $('#search_mpointcode').val(),
|
||||
companyId:unitId
|
||||
};
|
||||
/* var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
*/ return temp;
|
||||
}
|
||||
$(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;
|
||||
dosearchMp();
|
||||
}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();
|
||||
dosearchMp();
|
||||
});
|
||||
}
|
||||
},'json'); */
|
||||
//简易公司combotree
|
||||
|
||||
|
||||
//initialSelectionIds();
|
||||
//alert();
|
||||
$table=$("#table_mpoint").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'signaltype', // 返回json数据中的name
|
||||
title: '信号类型', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter : function(value, row) {
|
||||
if('${Flag_Enable}'==value){
|
||||
return "启用";
|
||||
}else{
|
||||
return "禁用";
|
||||
}
|
||||
|
||||
} // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_mpoint");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
if('check'==e.type){
|
||||
$('#table_mpoint .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="mpSubModal" >
|
||||
<div class="modal-dialog modal-md" >
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div id="mpoint_mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<!-- <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 " style="margin-bottom:10px;">
|
||||
<input id="search_code" name="search_code" type="hidden" />
|
||||
<span id="company" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm " style="width: 220px;margin-left:30px">
|
||||
<input type="text" id="search_mpointname" name="search_mpointname" class="form-control pull-right" placeholder="点位名称">
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 220px;">
|
||||
|
||||
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control " placeholder="点位编码">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchMp();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 重置</button> -->
|
||||
</div>
|
||||
<!-- <div class="form-group " style="padding:0;">
|
||||
<label class="form-label">班组</label>
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 500px;">
|
||||
<input type="text" id="search_pid" name="search_pid" class="form-control pull-right" style="width: 200px;" placeholder="所属车间">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" style="width: 200px;margin-right:10px" placeholder="系统名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_mpoint"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doselect()" id="btn_save">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
100
WebRoot/jsp/work/OneCameraVideoForDP.jsp
Normal file
100
WebRoot/jsp/work/OneCameraVideoForDP.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
.ztree li a.level0 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level1 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level2 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level3 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level4 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.white{
|
||||
border: 0px solid white;
|
||||
}
|
||||
.red{
|
||||
border: 0px solid red;
|
||||
}
|
||||
img[src=""],img:not([src]){
|
||||
opacity:0;
|
||||
}
|
||||
.gray {
|
||||
-webkit-filter: grayscale(100%);
|
||||
-moz-filter: grayscale(100%);
|
||||
-ms-filter: grayscale(100%);
|
||||
-o-filter: grayscale(100%);
|
||||
filter: grayscale(100%);
|
||||
filter: gray;
|
||||
opacity:0.3;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function viewThisCamera(id,online){
|
||||
//alert(id+'---'+online);
|
||||
if(!online){
|
||||
swal('该摄像头无法连接。');
|
||||
return;
|
||||
}
|
||||
var websocket = null;
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = '${time}';
|
||||
if(time==null || time==''){
|
||||
time="now";
|
||||
}
|
||||
websocket = new WebSocket(ext.basePath.replace("http","ws")+"/videoWebSocket/"+id+"/"+time+"/dpvideo/high");
|
||||
}
|
||||
else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
//连接发生错误的回调方法
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result= JSON.parse(event.data);
|
||||
$("#show_video_1").attr("src", event.data);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="viewThisCamera('${id}','${online}')" class="hold-transition ${cu.themeclass} sidebar-mini" style="width: 100%;height: 100%;background-color: rgb(23, 39, 55);">
|
||||
<div id="videos" style="width:100%;height:100%;float: left;background-color: rgb(23, 39, 55);">
|
||||
<div style="width: 100%;height: 100%;float: left;background-color: rgb(23, 39, 55);" id="video_1" class="white">
|
||||
<img id="show_video_1" style="width: 100%;height: 100%;" src="" >
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
57
WebRoot/jsp/work/alarmTypes4select.jsp
Normal file
57
WebRoot/jsp/work/alarmTypes4select.jsp
Normal file
@ -0,0 +1,57 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/getAlarmTypesJson.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#fault_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#fault_select_tree').on('nodeSelected', function(event, data) {
|
||||
if ('${type}' == 's') {
|
||||
if (data.pid != "-1") {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("fault4SelectModal")
|
||||
} else {
|
||||
showAlert('d','只可选择子级!', 'alArmAlertDiv');
|
||||
}
|
||||
} else if('${type}' == 'f') {
|
||||
if (data.pid == "-1") {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("fault4SelectModal")
|
||||
} else {
|
||||
showAlert('d','只可选择父级!', 'alArmAlertDiv');
|
||||
}
|
||||
} else {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
}
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="fault4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div id="alArmAlertDiv"></div>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择风险类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="fault_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
63
WebRoot/jsp/work/alarmTypesAdd.jsp
Normal file
63
WebRoot/jsp/work/alarmTypesAdd.jsp
Normal file
@ -0,0 +1,63 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showAlarmTypes4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname", type:"f"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
$.post(ext.contextPath + "/work/alarmTypes/save.do", $("#subForm").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
initTreeView();
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">风险名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="风险名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">风险大类</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="pname" name ="pname" placeholder="请点击选择风险大类" onclick="showAlarmTypes4SelectFun();" readonly="readonly"></input>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
113
WebRoot/jsp/work/alarmTypesEdit.jsp
Normal file
113
WebRoot/jsp/work/alarmTypesEdit.jsp
Normal file
@ -0,0 +1,113 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<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 showAlarmTyps4SelectFun = function() {
|
||||
var pid = ${alarmTypes.pid}
|
||||
if (pid != "-1") {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname", type:"f"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d','当前风险等级为第一层级不可配置上级');
|
||||
}
|
||||
};
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
$.post(ext.contextPath + "/work/alarmTypes/update.do", $("#subForm").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
showAlert('s','保存成功');
|
||||
initTreeView();
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function dodel() {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/delete.do', $("#subForm").serialize(), function(data) {
|
||||
if(data>0){
|
||||
initTreeView();
|
||||
}else{
|
||||
showAlert('d','删除失败');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
});
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#powerids").val();
|
||||
// $.post(ext.contextPath + '/user/userForSelect4FirstActiviti.do', { formId: "subForm", hiddenId: "powerids", textId: "_powers", userIds: userIds }, function (data) {
|
||||
$.post(ext.contextPath + '/user/userForSelect4FirstActiviti.do', { formId: "subForm", hiddenId: "powerids", textId: "_powers", userIds: userIds }, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">编辑</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${alarmTypes.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">风险名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="风险名称" value="${alarmTypes.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">风险大类</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="pname" name ="pname" placeholder="请点击选择风险大类" onclick="showAlarmTyps4SelectFun();" value="${alarmTypes.pName}" readonly="readonly"></input>
|
||||
<input id="pid" name="pid" type="hidden" value="${alarmTypes.pid}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
92
WebRoot/jsp/work/alarmTypesList.jsp
Normal file
92
WebRoot/jsp/work/alarmTypesList.jsp
Normal file
@ -0,0 +1,92 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="-1";
|
||||
console.info(node)
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
console.log("pid is = ", pid)
|
||||
$.post(ext.contextPath + '/work/alarmTypes/add.do', {pid:pid} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/edit.do', {id:id} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/getAlarmTypesJson.do', function(data) {
|
||||
$('#tree').treeview({data: data});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
editFun(data.id);
|
||||
});
|
||||
},'json');
|
||||
$("#faultBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<%-- <section class="content-header">--%>
|
||||
<%-- <h1 id ="head_title"></h1>--%>
|
||||
<%-- <ol class="breadcrumb">--%>
|
||||
<%-- <li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||||
<%-- <!-- <li class="active">Here</li> -->--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">风险类型</h3>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="faultBox"></div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
97
WebRoot/jsp/work/appCameraView.jsp
Normal file
97
WebRoot/jsp/work/appCameraView.jsp
Normal file
@ -0,0 +1,97 @@
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var websocket = null;
|
||||
|
||||
function viewThisCamera(id) {
|
||||
var uuid = '${uuid}';
|
||||
var net = '${net}';
|
||||
var definition = 'standard';
|
||||
if ('${param.definition}' != null && '${param.definition}' != '') {
|
||||
definition = '${param.definition}';
|
||||
}
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = '${time}';
|
||||
if (time == null || time == '') {
|
||||
time = "now";
|
||||
}
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/" + definition);
|
||||
<%--if (data.type == '1') {--%>
|
||||
<%-- websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/high");--%>
|
||||
<%--} else if (data.type == '2') {--%>
|
||||
<%-- websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.netUrl + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/high");--%>
|
||||
<%--}--%>
|
||||
}
|
||||
});
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result = JSON.parse(event.data);
|
||||
$("#show_video_1").attr("src", event.data);
|
||||
}
|
||||
})
|
||||
// websocket = new WebSocket(ext.basePath.replace("http", "ws") + "/videoWebSocket/" + id + "/" + time + "/dpvideo");
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
}
|
||||
|
||||
//关闭WebSocket连接
|
||||
function closeWebSocket() {
|
||||
websocket.onclose = function () {
|
||||
}; // disable onclose handler first
|
||||
websocket.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="viewThisCamera('${id}')" class="hold-transition ${cu.themeclass} sidebar-mini"
|
||||
style="width: 100%;height: 100%;background-color: rgb(23, 39, 55);">
|
||||
<div id="videos" style="width:100%;height:100%;float: left;background-color: rgb(23, 39, 55);">
|
||||
<div style="width: 100%;height: 100%;float: left;background-color: rgb(23, 39, 55);" id="video_1" class="white">
|
||||
<img id="show_video_1" style="width: 100%;height: 100%;" src="">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
105
WebRoot/jsp/work/autoAlertAdd.jsp
Normal file
105
WebRoot/jsp/work/autoAlertAdd.jsp
Normal file
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/work/autoAlert/save.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('autoAlertAddModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
//水厂
|
||||
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {}, function (data) {
|
||||
var select = $("#bizId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
select.on("change", function (e) {
|
||||
});
|
||||
select.val(companyId).trigger("change");
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="autoAlertAddModal">
|
||||
<div class="modal-dialog" style="height:500px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称" />
|
||||
<input id="bizId" name="bizId" type="hidden" value="${param.companyId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提醒内容</label>
|
||||
<div class="col-sm-10">
|
||||
<select id ="alertType" name="alertType" class="form-control select2">
|
||||
<option value='contract' selected="selected">合同到期</option>
|
||||
<option value='payment' >合同付款</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提醒时限(天)</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="alertDate" name="alertDate" style="width: 250px;"
|
||||
class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" class="form-control" id="describe" name="describe" placeholder="备注"
|
||||
row="15"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
107
WebRoot/jsp/work/autoAlertEdit.jsp
Normal file
107
WebRoot/jsp/work/autoAlertEdit.jsp
Normal file
@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/work/autoAlert/update.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('autoAlertEditModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//水厂
|
||||
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {}, function (data) {
|
||||
var select = $("#bizId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
select.on("change", function (e) {
|
||||
});
|
||||
select.val("${autoAlert.bizId}").trigger("change");
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="autoAlertEditModal">
|
||||
<div class="modal-dialog" style="height:500px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${autoAlert.id}" />
|
||||
<input id="bizId" name="bizId" type="hidden" value="${autoAlert.bizId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称" value="${autoAlert.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提醒内容</label>
|
||||
<div class="col-sm-10">
|
||||
<select id ="alertType" name="alertType" class="form-control select2">
|
||||
<option value='contract'
|
||||
<c:if test="${autoAlert.alertType=='contract'}">selected</c:if> >合同到期</option>
|
||||
<option value='payment'
|
||||
<c:if test="${autoAlert.alertType=='payment'}">selected</c:if>>合同付款</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">提醒时限(天)</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="alertDate" name="alertDate" style="width: 250px;" value="${autoAlert.alertDate}"
|
||||
class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" class="form-control" id="describe" name="describe" placeholder="备注"
|
||||
row="15">${autoAlert.describe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
189
WebRoot/jsp/work/autoAlertList.jsp
Normal file
189
WebRoot/jsp/work/autoAlertList.jsp
Normal file
@ -0,0 +1,189 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var companyId;
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/autoAlert/add.do', {companyId :companyId } ,
|
||||
function (data) {
|
||||
$("#addDiv").html("");//清空
|
||||
$("#addDiv").html(data);
|
||||
openModal('autoAlertAddModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/autoAlert/edit.do', { id: id }, function (data) {
|
||||
$("#editDiv").html("");//清空
|
||||
$("#editDiv").html(data);
|
||||
openModal('autoAlertEditModal');
|
||||
});
|
||||
};
|
||||
|
||||
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/autoAlert/deletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function () {
|
||||
var $table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/autoAlert/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
bizId: companyId,
|
||||
}
|
||||
},
|
||||
//sortName: 'id', // 要排序的字段
|
||||
//sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'alertDate', // 返回json数据中的name
|
||||
title: '提醒时限', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'describe', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
//查询方法,选择厂区后自动加载
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
//简易公司combotree
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/side.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="addDiv"></div>
|
||||
<div id="editDiv"></div>
|
||||
<div>
|
||||
|
||||
<div id="companySelectTree" style="float:left;"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-warning"></i>删除</button>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
256
WebRoot/jsp/work/cameraAdd.jsp
Normal file
256
WebRoot/jsp/work/cameraAdd.jsp
Normal file
@ -0,0 +1,256 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/camera/save.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
},
|
||||
/*remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
||||
url: ext.contextPath + '/equipment/maintenancePlan/checkExist.do',//验证地址
|
||||
message: '计划编号已存在',//提示消息
|
||||
type: 'POST',//请求方式
|
||||
data: function(validator) {
|
||||
return {
|
||||
planNumber: $('#planNumber').val()
|
||||
};
|
||||
}
|
||||
},*/
|
||||
}
|
||||
},
|
||||
url: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '地址不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
channel: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '通道号不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
username: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '用户名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
password: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '密码不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(function () {
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${param.companyId}'}, function (data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ = $("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
<%--selelct_.val('${camera.processsectionid}').trigger("change");--%>
|
||||
}, 'json');
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增摄像头</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="bizid" name="bizid" value="${param.companyId}">
|
||||
<input type="hidden" class="form-control" id="status" name="status" value="${Status_Edit}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="processsectionid" name="processsectionid"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">IP+端口</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="url" name="url" class="form-control pull-right"
|
||||
placeholder="IP:port">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">通道号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="channel" name="channel" class="form-control pull-right"
|
||||
placeholder="通道(通道号)">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">外网IP+端口</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input type="text" id="netUrl" name="netUrl" class="form-control pull-right"--%>
|
||||
<%-- placeholder="IP:port">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">手持端地址</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input type="text" id="phoneUrl" name="phoneUrl" class="form-control pull-right"--%>
|
||||
<%-- placeholder="">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">用户名</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="username" name="username" class="form-control pull-right"
|
||||
placeholder="用户名">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="password" name="password" class="form-control pull-right"
|
||||
placeholder="密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">摄像机类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="type" class="form-control pull-right" name="type">
|
||||
<option value="hikvision">海康类型1</option>
|
||||
<option value="hikvision2">海康类型2</option>
|
||||
<option value="dahua">大华</option>
|
||||
<option value="dahuaDSS">大华DSS</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">摄像机外形</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="style" class="form-control pull-right" name="style">
|
||||
<option value="1">球机</option>
|
||||
<option value="0">枪机</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="active" class="form-control pull-right" name="active">
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">用途分类</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="viewscopes" class="form-control pull-right" name="viewscopes">
|
||||
<option value="1">生产</option>
|
||||
<option value="0">安防</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">定时抓拍</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="issavepic" name="issavepic" class="form-control pull-right">
|
||||
<option value="1">启用</option>
|
||||
<option value="0" selected>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">抓拍周期</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" id="savepicnum" name="savepicnum" class="form-control pull-right"
|
||||
placeholder="抓拍周期" min="10">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label"
|
||||
style="padding-right: 0px;padding-left: 0px;text-align: left;">分钟</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否报警</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="isneedalarm" name="isneedalarm" class="form-control pull-right">
|
||||
<option value="1">启用</option>
|
||||
<option value="0" selected>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="morder" name="morder" class="form-control pull-right"
|
||||
placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i>上传图片</button>
|
||||
<button type="button" class="btn btn-default btn-file" onclick="showFaultLibrary4SelectFun()" id="btn_save"><i class="fa fa-file-o"></i>问题库</button>
|
||||
</div> -->
|
||||
<!-- <div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="maintenancefile" id="maintenancefile" multiple class="file-loading" />
|
||||
</div>
|
||||
-->
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
43
WebRoot/jsp/work/cameraDetail.jsp
Normal file
43
WebRoot/jsp/work/cameraDetail.jsp
Normal file
@ -0,0 +1,43 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doClose() {
|
||||
$('#cameraIframe').attr("src","about:blank");
|
||||
closeModal('subModal');
|
||||
}
|
||||
$(function() {
|
||||
switch('${param.type}'){
|
||||
case 'dahua':
|
||||
$('#cameraIframe').attr("src",ext.contextPath +"/work/camera/cameraview_dahua.do?id=${param.id}");
|
||||
break;
|
||||
default:
|
||||
$('#cameraIframe').attr("src",ext.contextPath +"/work/camera/cameraview.do?id=${param.id}");
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">实时预览</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe id='cameraIframe' style="width:100%;height:440px" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doClose()">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
487
WebRoot/jsp/work/cameraEdit.jsp
Normal file
487
WebRoot/jsp/work/cameraEdit.jsp
Normal file
@ -0,0 +1,487 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%request.setAttribute("Status_Launch", Maintenance.Status_Launch);%>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
// console.log($("#subForm").serialize())
|
||||
$.post(ext.contextPath + "/work/camera/update.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
// $(".modal").modal("hide");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/work/cameraDetail/dodel.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var deleteNVRFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/work/cameraNVR/dodel.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_nvr_Detail").bootstrapTable('refresh');
|
||||
console.log(1111)
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function () {
|
||||
var cameraid=$('#id').val();
|
||||
$("#table_Detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/cameraDetail/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
cameraid: cameraid,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'workModel.name', // 返回json数据中的name
|
||||
title: '算法名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '50%'
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '30%',
|
||||
formatter:function(value){
|
||||
if(value==0){
|
||||
return "禁用";
|
||||
}else if(value==1){
|
||||
return "启用";
|
||||
}else{
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '20%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteDetailFun(\''+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(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#table_nvr_Detail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/cameraNVR/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign:' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
cameraid: cameraid,
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: 'NVR名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '20%'
|
||||
},{
|
||||
field: 'areaText', // 返回json数据中的name
|
||||
title: '区域', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '20%'
|
||||
},{
|
||||
field: 'ip', // 返回json数据中的name
|
||||
title: 'nvr地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%'
|
||||
},{
|
||||
field: 'channel', // 返回json数据中的name
|
||||
title: 'nvr通道', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '5%'
|
||||
},{
|
||||
field: 'username', // 返回json数据中的name
|
||||
title: '用户名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%'
|
||||
},{
|
||||
field: 'password', // 返回json数据中的name
|
||||
title: '密码', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '15%'
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editNVRFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteNVRFun(\''+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(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_nvr_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${camera.bizid}'}, function (data) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ = $("#processsectionid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${camera.processsectionid}').trigger("change");
|
||||
}, 'json');
|
||||
})
|
||||
|
||||
|
||||
var addDetailFun = function() {
|
||||
var id=$('#id').val();
|
||||
$.post(ext.contextPath + '/work/cameraDetail/doadd.do' ,{cameraid:id}, function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/cameraDetail/doedit.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editNVRFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/cameraNVR/doEdit.do', {id:id} , function(data) {
|
||||
$("#subNVRDiv").html(data);
|
||||
openModal('subNVRModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deletesDetailFun = function() {
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/work/cameraDetail/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
var deletesNVRFun = function() {
|
||||
var checkedItems = $("#table_nvr_Detail").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
}else{
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/work/cameraNVR/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var addNVRFun = function() {
|
||||
var id=$('#id').val();
|
||||
$.post(ext.contextPath + '/work/cameraNVR/doadd.do' ,{cameraid:id}, function(data) {
|
||||
$("#subNVRDiv").html(data);
|
||||
openModal('subNVRModal');
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑摄像头</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${camera.id}">
|
||||
<input type="hidden" class="form-control" id="bizid" name="bizid" value="${camera.bizid}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="名称"
|
||||
value="${camera.name}"></input>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="processsectionid" name="processsectionid"
|
||||
style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">IP+端口</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="url" name="url" class="form-control pull-right" placeholder="地址"
|
||||
value="${camera.url}"></input>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">通道号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="channel" name="channel" class="form-control pull-right"
|
||||
placeholder="通道(通道号)" value="${camera.channel}"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">用户名</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="username" name="username" class="form-control pull-right"
|
||||
placeholder="用户名" value="${camera.username}"></input>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="password" name="password" class="form-control pull-right"
|
||||
placeholder="密码" value="${camera.password}"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">摄像机类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="type" class="form-control select2 pull-right" name="type"
|
||||
style="width: 100%">
|
||||
<option value="hikvision"
|
||||
<c:if test="${camera.type=='hikvision'}">selected</c:if> >海康类型1
|
||||
</option>
|
||||
<option value="hikvision2"
|
||||
<c:if test="${camera.type=='hikvision2'}">selected</c:if> >海康类型2
|
||||
</option>
|
||||
<option value="dahua"
|
||||
<c:if test="${camera.type=='dahua'}">selected</c:if> >大华
|
||||
</option>
|
||||
<option value="dahuaDSS"
|
||||
<c:if test="${camera.type=='dahuaDSS'}">selected</c:if> >大华DSS
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">摄像机外形</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="style" class="form-control select2 pull-right" name="style"
|
||||
style="width: 100%">
|
||||
<option value="1" <c:if test="${camera.style=='1'}">selected</c:if>>球机</option>
|
||||
<option value="0" <c:if test="${camera.style=='0'}">selected</c:if>>枪机</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="active" class="form-control select2 pull-right" name="active"
|
||||
style="width: 100%">
|
||||
<option value="1" <c:if test="${camera.active=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${camera.active=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">用途分类</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="viewscopes" class="form-control select2 pull-right"
|
||||
name="viewscopes" style="width: 100%">
|
||||
<option value="1" <c:if test="${camera.viewscopes==1}">selected</c:if>>生产</option>
|
||||
<option value="0" <c:if test="${camera.viewscopes==0}">selected</c:if>>安防</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">定时抓拍</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="issavepic" name="issavepic" class="form-control pull-right">
|
||||
<option value="1" <c:if test="${camera.issavepic=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${camera.issavepic=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">抓拍周期</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" id="savepicnum" name="savepicnum" class="form-control pull-right"
|
||||
placeholder="抓拍周期" value="${camera.savepicnum}" min="10">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label"
|
||||
style="padding-right: 0px;padding-left: 0px;text-align: left;">分钟</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否报警</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="isneedalarm" name="isneedalarm" class="form-control pull-right">
|
||||
<option value="1" <c:if test="${camera.isneedalarm=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${camera.isneedalarm=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="morder" name="morder" class="form-control pull-right"
|
||||
placeholder="0" value="${camera.morder}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" >
|
||||
<div id="mainAlertDetaildiv"></div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联算法模型</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">所属NVR信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addNVRFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesNVRFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<table id="table_nvr_Detail" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
875
WebRoot/jsp/work/cameraIdsHisShowlist.jsp
Normal file
875
WebRoot/jsp/work/cameraIdsHisShowlist.jsp
Normal file
@ -0,0 +1,875 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<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>
|
||||
|
||||
<style type="text/css">
|
||||
.ztree li a.level0 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level1 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level2 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level3 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level4 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.white {
|
||||
border: 1px solid white;
|
||||
}
|
||||
|
||||
.red {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
img[src=""], img:not([src]) {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.gray {
|
||||
-webkit-filter: grayscale(100%);
|
||||
-moz-filter: grayscale(100%);
|
||||
-ms-filter: grayscale(100%);
|
||||
-o-filter: grayscale(100%);
|
||||
filter: grayscale(100%);
|
||||
filter: gray;
|
||||
opacity: 0.3;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var width = 0;
|
||||
var map = new Map();//用于存放websocket
|
||||
var map2 = new Map();//用于存放窗口对应的摄像头
|
||||
var map3 = new Map();//用于存放摄像头对应的窗口,便于判断是否已经打开
|
||||
var focusid;
|
||||
var this_uuid = '${uuid}';
|
||||
var definitionSt = 'standard';
|
||||
|
||||
function fenpin() {
|
||||
var f = $('#fenpin').val();
|
||||
for (var i = 0; i < 9; i++) {
|
||||
if (map.get("video_" + (i + 1)) != null) {
|
||||
map.get("video_" + (i + 1)).close();
|
||||
//map.delete("video_"+(i+1));
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: map2.get("video_" + (i + 1)),
|
||||
time: beginTimeStore,
|
||||
uuid: this_uuid + "video_" + (i + 1)
|
||||
}, function () {
|
||||
//map3.delete(map2.get("video_"+(i+1)));
|
||||
//map2.delete("video_"+(i+1));
|
||||
});
|
||||
}
|
||||
}
|
||||
map.clear();
|
||||
map2.clear();
|
||||
map3.clear();
|
||||
$('#videos').html("");
|
||||
if (f == 1) {
|
||||
$('#videos').append('<div style="width: ' + (width - 440 - 10) + 'px;height: ' + ((width - 440) * 0.6168 - 10) + 'px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;" id="video_1" class="white" onclick="focusThis(this.id)" ><img id="show_video_1" style="width: 100%;height: 100%;" src="" ></div>');
|
||||
} else if (f == 2) {
|
||||
for (var i = 0; i < 4; i++) {
|
||||
$('#videos').append('<div style="width: ' + ((width - 440 - 10 - 3) / 2) + 'px;height: ' + (((width - 440) * 0.6168 - 10 - 3) / 2) + 'px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;" id="video_' + (i + 1) + '" class="white" onclick="focusThis(this.id)" ondblclick="dblclickt(this.id)"><img id="show_video_' + (i + 1) + '" style="width:100%;height:100%;" src="" ></div>');
|
||||
}
|
||||
} else if (f == 3) {
|
||||
for (var i = 0; i < 9; i++) {
|
||||
$('#videos').append('<div style="width: ' + ((width - 440 - 10 - 6) / 3) + 'px;height: ' + (((width - 440) * 0.6168 - 10 - 6) / 3) + 'px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;" id="video_' + (i + 1) + '" class="white" onclick="focusThis(this.id)" ondblclick="dblclickt(this.id)"><img id="show_video_' + (i + 1) + '" style="width: 100%;height:100%;" src=""></div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function focusThis(id) {
|
||||
focusid = id;
|
||||
/*var oldFocus = $('.red');
|
||||
for(var i=0;i<oldFocus.length;i++){
|
||||
oldFocus[i].removeClass('red');
|
||||
oldFocus[i].addClass('white');
|
||||
//oldFocus[i].className = 'white';
|
||||
}*/
|
||||
$(".red").each(function (i, n) {
|
||||
$(this).removeClass('red');
|
||||
$(this).removeClass('white');
|
||||
})
|
||||
$('#' + id).removeClass('white');
|
||||
$('#' + id).addClass('red');
|
||||
//document.getElementById(id).className='red';
|
||||
}
|
||||
|
||||
function viewThisCamera(id, online) {
|
||||
if (!online) {
|
||||
swal('该摄像头无法连接。');
|
||||
return;
|
||||
}
|
||||
console.log("前" + map);
|
||||
// console.log(map3)
|
||||
if (map3.get(id) != null) {
|
||||
focusThis(map3.get(id));
|
||||
} else {
|
||||
if (focusid == null || focusid == '') {
|
||||
focusThis('video_1');
|
||||
}
|
||||
var fid = focusid;
|
||||
var oldid = map2.get(fid);
|
||||
map2.set(fid, id);
|
||||
map3.set(id, fid);
|
||||
if (map.get(fid) != null) {
|
||||
map.get(fid).close();
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: oldid,
|
||||
time: beginTimeStore,
|
||||
uuid: this_uuid + fid
|
||||
}, function (data) {
|
||||
map.delete(fid);
|
||||
map3.delete(oldid);
|
||||
console.log("关闭旧的流");
|
||||
$("#show_" + fid).attr("src", "");
|
||||
setTimeout(function () {
|
||||
var websocket = null;
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = beginTimeStore;
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
}
|
||||
});
|
||||
map.set(fid, websocket);
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
$("#show_" + fid).attr("src", event.data);
|
||||
// var result = JSON.parse(event.data);
|
||||
// $("#show_" + fid).attr("src", "data:image/*;base64," + result.data);
|
||||
}
|
||||
})
|
||||
console.log("后" + map);
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
//连接发生错误的回调方法
|
||||
|
||||
}, 1000);
|
||||
});
|
||||
} else {
|
||||
var websocket = null;
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = beginTimeStore;
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
console.log('当前fid:' + fid);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
}
|
||||
});
|
||||
map.set(fid, websocket);
|
||||
websocket.onerror = function () {
|
||||
console.log('错误');
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result = JSON.parse(event.data);
|
||||
// console.log(result)
|
||||
$("#show_" + fid).attr("src", event.data);
|
||||
}
|
||||
})
|
||||
//websocket = new WebSocket(ext.basePath.replace("http","ws")+"/videoWebSocket/"+id+"/"+time+"/"+fid);
|
||||
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
//连接发生错误的回调方法
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
var beginTimeStore = '';
|
||||
$(function () {
|
||||
width = document.body.clientWidth;
|
||||
$('#videos').css('width', (width - 440));
|
||||
$('#videos').css('height', (width - 440) * 0.6168);
|
||||
$('#tree').css('height', (width - 440) * 0.6168);
|
||||
$('#video_1').css('width', (width - 440 - 10));
|
||||
$('#video_1').css('height', (width - 440) * 0.6168 - 10);
|
||||
$('#show_video_1').css('width', (width - 440 - 10 - 3));
|
||||
$('#show_video_1').css('height', (width - 440) * 0.6168 - 10 - 3);
|
||||
|
||||
|
||||
//定义locale汉化插件
|
||||
if ('${param.hisData}' != null && '${param.hisData}' != '') {
|
||||
beginTimeStore = '${param.hisData}';
|
||||
} else {
|
||||
beginTimeStore = moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
|
||||
// endTimeStore = moment().format('YYYY-MM-DD HH:mm');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
// "timePickerIncrement": 10,
|
||||
"singleDatePicker": true,
|
||||
"locale": locale,
|
||||
// //汉化按钮部分
|
||||
// ranges: {
|
||||
// '今日': [moment().subtract(1, 'days'), moment()],
|
||||
// '昨日': [moment().subtract(2, 'days'), moment().subtract(1, 'days')],
|
||||
// '最近7日': [moment().subtract(7, 'days'), moment()],
|
||||
// '本月': [moment().startOf('month'), moment().endOf('month')],
|
||||
// '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
// },
|
||||
startDate: beginTimeStore,
|
||||
// endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
// endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format));
|
||||
}
|
||||
|
||||
var cid = "";
|
||||
$(".red").each(function (i, n) {
|
||||
cid = map2.get($(this).attr("id"));
|
||||
})
|
||||
|
||||
if (map3.get(cid) != null) {
|
||||
map3.delete(cid);
|
||||
}
|
||||
// console.log(cid)
|
||||
viewThisCamera(cid, 'true');
|
||||
});
|
||||
$('#reservationtime').val(beginTimeStore);
|
||||
|
||||
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
|
||||
// console.log(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) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ = $("#processsectionid").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');
|
||||
//loadCameraList(companyId);
|
||||
initTreeView(companyId);
|
||||
$('#company').val(companyId);
|
||||
} 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) {
|
||||
// console.log(data)
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ = $("#processsectionid").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');
|
||||
});
|
||||
//loadCameraList(companyId);
|
||||
initTreeView(companyId);
|
||||
$('#company').val(companyId);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
|
||||
function loadCameraList(companyId) {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/camera/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,
|
||||
unitId: companyId,
|
||||
search_name: $('#search_name').val(),
|
||||
processsectionid: $("#processsectionid").val(),
|
||||
}
|
||||
},
|
||||
sortName: 'name', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的number
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 200
|
||||
}, {
|
||||
field: 'style', // 返回json数据中的model
|
||||
title: '样式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 80,
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
if (row.online) {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiuji.svg" style="width:40%;height:auto;" alt=""/>';
|
||||
} else {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiuji.svg" style="width:40%;height:auto;" alt="" class="gray"/>';
|
||||
}
|
||||
case '0':
|
||||
if (row.online) {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiangji.svg" style="width:40%;height:auto;" alt=""/>';
|
||||
} else {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiangji.svg" style="width:40%;height:auto;" alt="" class="gray"/>';
|
||||
}
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
onDblClickRow: function (row) {
|
||||
viewThisCamera(row.id, row.online);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cleanFocus() {
|
||||
if (map.get(focusid) != null) {
|
||||
map.get(focusid).close();
|
||||
map.delete(focusid);
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: map2.get(focusid),
|
||||
time: beginTimeStore,
|
||||
uuid: this_uuid + focusid
|
||||
}, function () {
|
||||
map3.delete(map2.get(focusid));
|
||||
map2.delete(focusid);
|
||||
});
|
||||
$("#show_" + focusid).attr("src", "");
|
||||
}
|
||||
}
|
||||
|
||||
function cleanAll() {
|
||||
var f = $('#fenpin').val();
|
||||
for (var i = 0; i < f * f; i++) {
|
||||
if (map.get("video_" + (i + 1)) != null) {
|
||||
map.get("video_" + (i + 1)).close();
|
||||
map.delete("video_" + (i + 1));
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: map2.get("video_" + (i + 1)),
|
||||
time: beginTimeStore,
|
||||
uuid: this_uuid + "video_" + (i + 1)
|
||||
}, function () {
|
||||
});
|
||||
$("#show_video_" + (i + 1)).attr("src", "");
|
||||
}
|
||||
map3.delete(map2.get("video_" + (i + 1)));
|
||||
map2.delete("video_" + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
function dblclickt(id) {
|
||||
if ($('#' + focusid).hasClass('big')) {
|
||||
reset();
|
||||
} else {
|
||||
var f = $('#fenpin').val();
|
||||
for (var i = 0; i < f * f; i++) {
|
||||
if (id != ('video_' + (i + 1))) {
|
||||
$('#video_' + (i + 1)).prop('hidden', 'hidden');
|
||||
}
|
||||
}
|
||||
$('#' + id).css({'height': (width - 440) * 0.6168 - 10, 'width': (width - 440 - 10)});
|
||||
$('#' + id).addClass('big');
|
||||
$('#show_' + id).css({'height': (width - 440) * 0.6168 - 10 - 3, 'width': (width - 440 - 10 - 3)});
|
||||
}
|
||||
}
|
||||
|
||||
function reset() {
|
||||
var f = $('#fenpin').val();
|
||||
$('#' + focusid).removeClass('big');
|
||||
for (var i = 0; i < f * f; i++) {
|
||||
$('#video_' + (i + 1)).removeAttr('hidden');
|
||||
}
|
||||
if (f == 1) {
|
||||
$('#' + focusid).css({'height': (width - 440) * 0.6168 - 10, 'width': (width - 440 - 10)});
|
||||
$('#show_' + focusid).css({'height': (width - 440) * 0.6168 - 10 - 3, 'width': (width - 440 - 10 - 3)});
|
||||
} else if (f == 2) {
|
||||
$('#' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 3) / 2),
|
||||
'width': ((width - 440 - 10 - 3) / 2)
|
||||
});
|
||||
$('#show_' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 3) / 2 - 3),
|
||||
'width': ((width - 440 - 10 - 3) / 2 - 3)
|
||||
});
|
||||
} else {
|
||||
$('#' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 6) / 3),
|
||||
'width': ((width - 440 - 10 - 6) / 3)
|
||||
});
|
||||
$('#show_' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 6) / 3 - 3),
|
||||
'width': ((width - 440 - 10 - 6) / 3 - 3)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/work/camera/getCamerasTree.do', {cameraIds: '${cameraIds}'}, function (data) {
|
||||
// console.log(data)
|
||||
// var json = data;
|
||||
$('#tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
if (data.type == 'V') {
|
||||
let id = data.id;
|
||||
// console.log(data);
|
||||
viewThisCamera(id, data.online);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
function getTreeCameraBotton(json) {
|
||||
for (let i = 0; i < json.length; i++) {
|
||||
// console.log(json[i].nodes)
|
||||
if (json[i].nodes != null) {
|
||||
if (json[i].nodes.length > 0) {
|
||||
getTreeCameraBotton(json[i].nodes);
|
||||
}
|
||||
} else {
|
||||
if (json[i].type == 'V') {
|
||||
// console.log(json[i].id)
|
||||
$('#' + json[i].id).append("<span class='fa fa-wrench pull-right' style='padding-top:2px;' title='相关设备' onclick='showEqCamera(\"" + json[i].id + "\");'></span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var searchCamera = function () {
|
||||
$.post(ext.contextPath + '/work/camera/getCamerasTree.do', {
|
||||
cameraIds: '${cameraIds}',
|
||||
cameraName: $('#search_name').val()
|
||||
}, function (data) {
|
||||
$('#tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
if (data.type == 'V') {
|
||||
viewThisCamera(data.id, data.online);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var notonline = function () {
|
||||
$.post(ext.contextPath + '/work/camera/getTree.do', {
|
||||
ng: '',
|
||||
companyId: $('#company').val(),
|
||||
online: 1
|
||||
}, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
//console.info(data)
|
||||
$('#tree').treeview({
|
||||
data: json.cameras,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
if (data.type == 'V') {
|
||||
viewThisCamera(data.id, data.online);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var mclear = function () {
|
||||
$('#search_name').val("");
|
||||
}
|
||||
|
||||
|
||||
<%--$(function () {--%>
|
||||
<%-- $('#switchBtnDefinition').bootstrapSwitch({--%>
|
||||
<%-- onText: '高清',--%>
|
||||
<%-- offText: '标清',--%>
|
||||
<%-- // size: "small",--%>
|
||||
<%-- });--%>
|
||||
<%-- $('#switchBtnDefinition').bootstrapSwitch('state', false, true);--%>
|
||||
<%-- <%–if ('${dataVisualContent.isfull}' == '${Isfull_False}') {–%>--%>
|
||||
<%-- <%– $('#switchBtnIsFull').bootstrapSwitch('state', false, true);–%>--%>
|
||||
<%-- <%–} else if ('${dataVisualContent.isfull}' == '${Isfull_True}') {–%>--%>
|
||||
<%-- <%– $('#switchBtnIsFull').bootstrapSwitch('state', true, true);–%>--%>
|
||||
<%-- <%–} else {–%>--%>
|
||||
<%-- <%– $('#switchBtnIsFull').bootstrapSwitch('state', false, true);–%>--%>
|
||||
<%-- <%–}–%>--%>
|
||||
<%--});--%>
|
||||
|
||||
function clickDefinition(st) {
|
||||
definitionSt = st;
|
||||
if (st == 'standard') {
|
||||
$('#highDefinition').css('color', '#444444');
|
||||
$('#highDefinition').css('background-color', '#f4f4f4');
|
||||
$('#standardDefinition').css('color', '#ffffff');
|
||||
$('#standardDefinition').css('background-color', '#0AB1DF');
|
||||
} else {
|
||||
$('#standardDefinition').css('color', '#444444');
|
||||
$('#standardDefinition').css('background-color', '#f4f4f4');
|
||||
$('#highDefinition').css('color', '#ffffff');
|
||||
$('#highDefinition').css('background-color', '#0AB1DF');
|
||||
}
|
||||
}
|
||||
|
||||
var viewCameraWindow = null;
|
||||
|
||||
function showNowCamera() {
|
||||
var id = "";
|
||||
$(".red").each(function (i, n) {
|
||||
id = map2.get($(this).attr("id"));
|
||||
})
|
||||
if (id != '') {
|
||||
viewCameraWindow = window.open(ext.contextPath + "/work/camera/getCameraJsp.do?id=" + id, 'nowViewCamera', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
viewCameraWindow.focus();
|
||||
} else {
|
||||
alert("未识别到当前选择的摄像头!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function showEqCamera() {
|
||||
event.stopPropagation();
|
||||
var id = "";
|
||||
$(".red").each(function (i, n) {
|
||||
id = map2.get($(this).attr("id"));
|
||||
})
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardCamera/showListForEqView.do', {
|
||||
cameraId: id
|
||||
},
|
||||
function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('eqCameraModal');
|
||||
});
|
||||
}
|
||||
|
||||
function showImageList() {
|
||||
let id = "";
|
||||
$(".red").each(function (i, n) {
|
||||
id = map2.get($(this).attr("id"));
|
||||
})
|
||||
if (id != '') {
|
||||
$.post(ext.contextPath + '/work/camera/showAlarmImageList.do', {
|
||||
masterId: id,
|
||||
tbName: 'tb_work_camera_File',
|
||||
nameSpace: 'cameraimg',
|
||||
alarmId: '${alarmId}'
|
||||
}, function (data) {
|
||||
$("#fileInputDiv").html(data);
|
||||
openModal('fileInputModal');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini" style="background-color: rgb(255,255,255)">
|
||||
<div class="wrapper">
|
||||
<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>--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fileOnlinePicDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div class="form-group form-inline" style="float: left;width:calc(100% - 150px);">
|
||||
<input type="hidden" name="company" id="company">
|
||||
<div class="input-group" style="margin-right: 10px;float: left;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control" placeholder="摄像机..."
|
||||
value="" style="width: 160px;">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-flat" onclick="mclear()"
|
||||
style="background-color: #fff;border-top: 1px solid #ccc;border-right: 1px solid #ccc;border-bottom: 1px solid #ccc;">x</button>
|
||||
<button type="button" onclick="searchCamera();" class="btn btn-flat"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<div style="float: left;border-bottom: 1px #000000 solid;width: calc(100% - 250px);">
|
||||
<label style="float: left;margin-left: 5px;line-height: 34px;">回放时间:</label>
|
||||
<input type="text" class="form-control pull-left" id="reservationtime"
|
||||
style="width:150px;margin-left: 5px;">
|
||||
<%-- <%– <label><font color="#8DEEEE">摄像常用画面</font></label>–%>--%>
|
||||
<%-- <label style="margin-left:5px;">视频总数:<font id='cameracount'></font>(在线:<font--%>
|
||||
<%-- id='onlinecount'></font>;离线:<font id='notonlinecount'></font>)|</label>--%>
|
||||
<%-- <label style="margin-left:5px;">生产:<span id="scNum"></span> 安防:<span id="afNum"></span> |</label>--%>
|
||||
<%-- <label style="margin-left:5px;">球机:<font id='qiujicount'></font> 枪机:<font--%>
|
||||
<%-- id='qiangjicount'></font> </label>--%>
|
||||
|
||||
<%-- <%– <label class="form-label" style="margin-left: 5px;">开始时间</label>–%>--%>
|
||||
<%-- <%– <input type="text" class="form-control" id="rptdt" name="rptdt">–%>--%>
|
||||
|
||||
<div class="btn-group" style="float: right;">
|
||||
<label class="form-label" style="margin-left: 5px;">分屏选择</label>
|
||||
<select class="form-control select2-selection--single" id="fenpin"
|
||||
style="width: 80px;height: 30px;"
|
||||
onchange="fenpin();" placeholder="请选择">
|
||||
<!-- <option disabled value>-分屏选择</option> -->
|
||||
<option selected value="1">单屏</option>
|
||||
<option value="2">2X2</option>
|
||||
<option value="3">3X3</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="cleanFocus();"> 清除当前</button>
|
||||
<button type="button" class="btn btn-default btn-sm" style="margin-left: 5px;"
|
||||
onclick="cleanAll();">全部清除
|
||||
</button>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" style="margin-left: 5px;" onclick="reset();">还原分屏</button> -->
|
||||
|
||||
</div>
|
||||
<%-- <select class="form-control select2-selection--single" id="net" style="width: 80px;height: 30px;">--%>
|
||||
<%-- <!-- <option disabled value>-分屏选择</option> -->--%>
|
||||
<%-- <option selected value="1">内网</option>--%>
|
||||
<%-- <option value="2">外网</option>--%>
|
||||
<%-- </select>--%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width: 100%;height:100%;float: left;background-color: rgb(255,255,255)">
|
||||
<div id="cameralist" style="width: 240px;float: left;">
|
||||
<!-- <table id="table"></table> -->
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:500px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="videos" style="width:753px;height:483px;border:2px solid gray;float: left;">
|
||||
<div style="width: 743px;height: 473px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;"
|
||||
id="video_1" class="white" onclick="focusThis(this.id)">
|
||||
<img id="show_video_1" style="width: 100%;height: 100%;" src="">
|
||||
</div>
|
||||
</div>
|
||||
<div id="controlArea" style="width: 150px;height:483px;float: left;background-color: rgb(255,255,255)">
|
||||
<div>
|
||||
<div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">
|
||||
<div style="float: left;width: 50%;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="showNowCamera();">当前
|
||||
</button>
|
||||
</div>
|
||||
<div style="float: left;width: 50%;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="showImageList();">图片
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">
|
||||
<div style="float: left;width: 50%;">
|
||||
<button id="standardDefinition" type="button" class="btn btn-default btn-sm"
|
||||
style="color: #ffffff;background-color: #0AB1DF;"
|
||||
onclick="clickDefinition('standard');">标清
|
||||
</button>
|
||||
</div>
|
||||
<div style="float: left;width: 50%;">
|
||||
<button id="highDefinition" type="button" class="btn btn-default btn-sm"
|
||||
style="color: #444444;background-color: #f4f4f4;"
|
||||
onclick="clickDefinition('high');">高清
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">--%>
|
||||
<%-- <div style="float: left;width: 50%;">--%>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" style="width: 46px;height: 30px;" onclick="showEqCamera();">--%>
|
||||
<%-- <span class='fa fa-wrench' ></span>--%>
|
||||
<%-- </button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">--%>
|
||||
<%-- <input id="switchBtnDefinition" type="checkbox"/>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<%-- <div style="width: 150px;text-align: center;margin-top: 5px;">--%>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" style="margin-left: 5px;"--%>
|
||||
<%-- onclick="notonline();">离线摄像头--%>
|
||||
<%-- </button>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
842
WebRoot/jsp/work/cameraIdsShowlist.jsp
Normal file
842
WebRoot/jsp/work/cameraIdsShowlist.jsp
Normal file
@ -0,0 +1,842 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.ztree li a.level0 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level1 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level2 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level3 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.ztree li a.level4 span {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.white {
|
||||
border: 1px solid white;
|
||||
}
|
||||
|
||||
.red {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
img[src=""], img:not([src]) {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.gray {
|
||||
-webkit-filter: grayscale(100%);
|
||||
-moz-filter: grayscale(100%);
|
||||
-ms-filter: grayscale(100%);
|
||||
-o-filter: grayscale(100%);
|
||||
filter: grayscale(100%);
|
||||
filter: gray;
|
||||
opacity: 0.3;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var width = 0;
|
||||
var map = new Map();//用于存放websocket
|
||||
var map2 = new Map();//用于存放窗口对应的摄像头
|
||||
var map3 = new Map();//用于存放摄像头对应的窗口,便于判断是否已经打开
|
||||
var focusid;
|
||||
var this_uuid = '${uuid}';
|
||||
var definitionSt = 'standard';
|
||||
|
||||
function fenpin() {
|
||||
var f = $('#fenpin').val();
|
||||
for (var i = 0; i < 9; i++) {
|
||||
if (map.get("video_" + (i + 1)) != null) {
|
||||
map.get("video_" + (i + 1)).close();
|
||||
//map.delete("video_"+(i+1));
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: map2.get("video_" + (i + 1)),
|
||||
time: "now",
|
||||
uuid: this_uuid + "video_" + (i + 1)
|
||||
}, function () {
|
||||
//map3.delete(map2.get("video_"+(i+1)));
|
||||
//map2.delete("video_"+(i+1));
|
||||
});
|
||||
}
|
||||
}
|
||||
map.clear();
|
||||
map2.clear();
|
||||
map3.clear();
|
||||
$('#videos').html("");
|
||||
if (f == 1) {
|
||||
$('#videos').append('<div style="width: ' + (width - 440 - 10) + 'px;height: ' + ((width - 440) * 0.6168 - 10) + 'px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;" id="video_1" class="white" onclick="focusThis(this.id)" ><img id="show_video_1" style="width: 100%;height: 100%;" src="" ></div>');
|
||||
} else if (f == 2) {
|
||||
for (var i = 0; i < 4; i++) {
|
||||
$('#videos').append('<div style="width: ' + ((width - 440 - 10 - 3) / 2) + 'px;height: ' + (((width - 440) * 0.6168 - 10 - 3) / 2) + 'px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;" id="video_' + (i + 1) + '" class="white" onclick="focusThis(this.id)" ondblclick="dblclickt(this.id)"><img id="show_video_' + (i + 1) + '" style="width:100%;height:100%;" src="" ></div>');
|
||||
}
|
||||
} else if (f == 3) {
|
||||
for (var i = 0; i < 9; i++) {
|
||||
$('#videos').append('<div style="width: ' + ((width - 440 - 10 - 6) / 3) + 'px;height: ' + (((width - 440) * 0.6168 - 10 - 6) / 3) + 'px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;" id="video_' + (i + 1) + '" class="white" onclick="focusThis(this.id)" ondblclick="dblclickt(this.id)"><img id="show_video_' + (i + 1) + '" style="width: 100%;height:100%;" src=""></div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function focusThis(id) {
|
||||
focusid = id;
|
||||
/*var oldFocus = $('.red');
|
||||
for(var i=0;i<oldFocus.length;i++){
|
||||
oldFocus[i].removeClass('red');
|
||||
oldFocus[i].addClass('white');
|
||||
//oldFocus[i].className = 'white';
|
||||
}*/
|
||||
$(".red").each(function (i, n) {
|
||||
$(this).removeClass('red');
|
||||
$(this).removeClass('white');
|
||||
})
|
||||
$('#' + id).removeClass('white');
|
||||
$('#' + id).addClass('red');
|
||||
//document.getElementById(id).className='red';
|
||||
}
|
||||
|
||||
function viewThisCamera(id, online) {
|
||||
if (!online) {
|
||||
swal('该摄像头无法连接。');
|
||||
return;
|
||||
}
|
||||
console.log("前" + map);
|
||||
if (map3.get(id) != null) {
|
||||
focusThis(map3.get(id));
|
||||
} else {
|
||||
if (focusid == null || focusid == '') {
|
||||
focusThis('video_1');
|
||||
}
|
||||
var fid = focusid;
|
||||
var oldid = map2.get(fid);
|
||||
map2.set(fid, id);
|
||||
map3.set(id, fid);
|
||||
if (map.get(fid) != null) {
|
||||
map.get(fid).close();
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: oldid,
|
||||
time: "now",
|
||||
uuid: this_uuid + fid
|
||||
}, function (data) {
|
||||
map.delete(fid);
|
||||
map3.delete(oldid);
|
||||
console.log("关闭旧的流");
|
||||
$("#show_" + fid).attr("src", "");
|
||||
setTimeout(function () {
|
||||
var websocket = null;
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = "now";
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
// if (data.type == '1') {
|
||||
// websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
// } else if (data.type == '2') {
|
||||
// websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.netUrl + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
// }
|
||||
}
|
||||
});
|
||||
<%--if($('#net').val()=='2'){--%>
|
||||
<%-- websocket = new WebSocket("${netws}/videoWebSocket/"+camera.type+"/"+camera.url+"/"+camera.username+"/"+camera.password+"/"+camera.channel+"/"+time+"/"+this_uuid+fid);--%>
|
||||
<%--}else{--%>
|
||||
<%-- websocket = new WebSocket("${ws}/videoWebSocket/"+camera.type+"/"+camera.url+"/"+camera.username+"/"+camera.password+"/"+camera.channel+"/"+time+"/"+this_uuid+fid);--%>
|
||||
<%--}--%>
|
||||
map.set(fid, websocket);
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
$("#show_" + fid).attr("src", event.data);
|
||||
// var result = JSON.parse(event.data);
|
||||
// $("#show_" + fid).attr("src", "data:image/*;base64," + result.data);
|
||||
}
|
||||
})
|
||||
// websocket = new WebSocket(ext.basePath.replace("http","ws")+"/videoWebSocket/"+id+"/"+time+"/"+fid);
|
||||
// map.set(fid,websocket);
|
||||
console.log("后" + map);
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
//连接发生错误的回调方法
|
||||
|
||||
}, 1000);
|
||||
});
|
||||
} else {
|
||||
var websocket = null;
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = "now";
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
console.log('当前fid:' + fid);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
// if (data.type == '1') {
|
||||
// websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
// } else if (data.type == '2') {
|
||||
// websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.netUrl + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid + "/" + definitionSt);
|
||||
// }
|
||||
}
|
||||
});
|
||||
<%--if ($('#net').val() == '2') {--%>
|
||||
<%-- websocket = new WebSocket("${netws}/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid);--%>
|
||||
<%--} else {--%>
|
||||
<%-- websocket = new WebSocket("${ws}/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/" + this_uuid + fid);--%>
|
||||
<%--}--%>
|
||||
map.set(fid, websocket);
|
||||
websocket.onerror = function () {
|
||||
console.log('错误');
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result = JSON.parse(event.data);
|
||||
// console.log(result)
|
||||
$("#show_" + fid).attr("src", event.data);
|
||||
}
|
||||
})
|
||||
//websocket = new WebSocket(ext.basePath.replace("http","ws")+"/videoWebSocket/"+id+"/"+time+"/"+fid);
|
||||
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
//连接发生错误的回调方法
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = "";
|
||||
$(function () {
|
||||
width = document.body.clientWidth;
|
||||
$('#videos').css('width', (width - 440));
|
||||
$('#videos').css('height', (width - 440) * 0.6168);
|
||||
$('#tree').css('height', (width - 440) * 0.6168);
|
||||
$('#video_1').css('width', (width - 440 - 10));
|
||||
$('#video_1').css('height', (width - 440) * 0.6168 - 10);
|
||||
$('#show_video_1').css('width', (width - 440 - 10 - 3));
|
||||
$('#show_video_1').css('height', (width - 440) * 0.6168 - 10 - 3);
|
||||
// $("#rptdt").datetimepicker({
|
||||
// // startDate: date,
|
||||
// language: 'zh-CN',
|
||||
// format: 'yyyy-mm-dd hh:ii:ss',
|
||||
// startView: "month", //初始化视图是‘年’
|
||||
// minView: 0,
|
||||
// maxView: "year",
|
||||
// autoclose: true
|
||||
// // todayBtn: "linked"
|
||||
// });
|
||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
|
||||
// console.log(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) {
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ = $("#processsectionid").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');
|
||||
//loadCameraList(companyId);
|
||||
initTreeView(companyId);
|
||||
$('#company').val(companyId);
|
||||
} 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) {
|
||||
console.log(data)
|
||||
$("#processsectionid").empty();
|
||||
var selelct_ = $("#processsectionid").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');
|
||||
});
|
||||
//loadCameraList(companyId);
|
||||
initTreeView(companyId);
|
||||
$('#company').val(companyId);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
//获取用途信息
|
||||
$.post(ext.contextPath + "/work/camera/getViewscopes.do", {unitId: unitId}, function (data) {
|
||||
$('#scNum').text(data.sc);
|
||||
$('#afNum').text(data.af);
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
|
||||
function loadCameraList(companyId) {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/camera/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,
|
||||
unitId: companyId,
|
||||
search_name: $('#search_name').val(),
|
||||
processsectionid: $("#processsectionid").val(),
|
||||
}
|
||||
},
|
||||
sortName: 'name', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的number
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 200
|
||||
}, {
|
||||
field: 'style', // 返回json数据中的model
|
||||
title: '样式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 80,
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
if (row.online) {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiuji.svg" style="width:40%;height:auto;" alt=""/>';
|
||||
} else {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiuji.svg" style="width:40%;height:auto;" alt="" class="gray"/>';
|
||||
}
|
||||
case '0':
|
||||
if (row.online) {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiangji.svg" style="width:40%;height:auto;" alt=""/>';
|
||||
} else {
|
||||
return '<img src="<%=request.getContextPath()%>/IMG/qiangji.svg" style="width:40%;height:auto;" alt="" class="gray"/>';
|
||||
}
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
onDblClickRow: function (row) {
|
||||
viewThisCamera(row.id, row.online);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cleanFocus() {
|
||||
if (map.get(focusid) != null) {
|
||||
map.get(focusid).close();
|
||||
map.delete(focusid);
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: map2.get(focusid),
|
||||
time: "now",
|
||||
uuid: this_uuid + focusid
|
||||
}, function () {
|
||||
map3.delete(map2.get(focusid));
|
||||
map2.delete(focusid);
|
||||
});
|
||||
$("#show_" + focusid).attr("src", "");
|
||||
}
|
||||
}
|
||||
|
||||
function cleanAll() {
|
||||
var f = $('#fenpin').val();
|
||||
for (var i = 0; i < f * f; i++) {
|
||||
if (map.get("video_" + (i + 1)) != null) {
|
||||
map.get("video_" + (i + 1)).close();
|
||||
map.delete("video_" + (i + 1));
|
||||
$.post(ext.contextPath + '/work/camera/closeRPCWebSocket.do', {
|
||||
id: map2.get("video_" + (i + 1)),
|
||||
time: "now",
|
||||
uuid: this_uuid + "video_" + (i + 1)
|
||||
}, function () {
|
||||
});
|
||||
$("#show_video_" + (i + 1)).attr("src", "");
|
||||
}
|
||||
map3.delete(map2.get("video_" + (i + 1)));
|
||||
map2.delete("video_" + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
function dblclickt(id) {
|
||||
if ($('#' + focusid).hasClass('big')) {
|
||||
reset();
|
||||
} else {
|
||||
var f = $('#fenpin').val();
|
||||
for (var i = 0; i < f * f; i++) {
|
||||
if (id != ('video_' + (i + 1))) {
|
||||
$('#video_' + (i + 1)).prop('hidden', 'hidden');
|
||||
}
|
||||
}
|
||||
$('#' + id).css({'height': (width - 440) * 0.6168 - 10, 'width': (width - 440 - 10)});
|
||||
$('#' + id).addClass('big');
|
||||
$('#show_' + id).css({'height': (width - 440) * 0.6168 - 10 - 3, 'width': (width - 440 - 10 - 3)});
|
||||
}
|
||||
}
|
||||
|
||||
function reset() {
|
||||
var f = $('#fenpin').val();
|
||||
$('#' + focusid).removeClass('big');
|
||||
for (var i = 0; i < f * f; i++) {
|
||||
$('#video_' + (i + 1)).removeAttr('hidden');
|
||||
}
|
||||
if (f == 1) {
|
||||
$('#' + focusid).css({'height': (width - 440) * 0.6168 - 10, 'width': (width - 440 - 10)});
|
||||
$('#show_' + focusid).css({'height': (width - 440) * 0.6168 - 10 - 3, 'width': (width - 440 - 10 - 3)});
|
||||
} else if (f == 2) {
|
||||
$('#' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 3) / 2),
|
||||
'width': ((width - 440 - 10 - 3) / 2)
|
||||
});
|
||||
$('#show_' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 3) / 2 - 3),
|
||||
'width': ((width - 440 - 10 - 3) / 2 - 3)
|
||||
});
|
||||
} else {
|
||||
$('#' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 6) / 3),
|
||||
'width': ((width - 440 - 10 - 6) / 3)
|
||||
});
|
||||
$('#show_' + focusid).css({
|
||||
'height': (((width - 440) * 0.6168 - 10 - 6) / 3 - 3),
|
||||
'width': ((width - 440 - 10 - 6) / 3 - 3)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/work/camera/getCamerasTree.do', {cameraIds: '${cameraIds}'}, function (data) {
|
||||
// console.log(data)
|
||||
// var json = data;
|
||||
$('#tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
if (data.type == 'V') {
|
||||
let id = data.id;
|
||||
// console.log(data);
|
||||
viewThisCamera(id, data.online);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
function getTreeCameraBotton(json) {
|
||||
for (let i = 0; i < json.length; i++) {
|
||||
// console.log(json[i].nodes)
|
||||
if (json[i].nodes != null) {
|
||||
if (json[i].nodes.length > 0) {
|
||||
getTreeCameraBotton(json[i].nodes);
|
||||
}
|
||||
} else {
|
||||
if (json[i].type == 'V') {
|
||||
// console.log(json[i].id)
|
||||
$('#' + json[i].id).append("<span class='fa fa-wrench pull-right' style='padding-top:2px;' title='相关设备' onclick='showEqCamera(\"" + json[i].id + "\");'></span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var searchCamera = function () {
|
||||
$.post(ext.contextPath + '/work/camera/getCamerasTree.do', {
|
||||
cameraIds: '${cameraIds}',
|
||||
cameraName: $('#search_name').val()
|
||||
}, function (data) {
|
||||
$('#tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
if (data.type == 'V') {
|
||||
viewThisCamera(data.id, data.online);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var notonline = function () {
|
||||
$.post(ext.contextPath + '/work/camera/getTree.do', {
|
||||
ng: '',
|
||||
companyId: $('#company').val(),
|
||||
online: 1
|
||||
}, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
//console.info(data)
|
||||
$('#tree').treeview({
|
||||
data: json.cameras,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
if (data.type == 'V') {
|
||||
viewThisCamera(data.id, data.online);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var mclear = function () {
|
||||
$('#search_name').val("");
|
||||
}
|
||||
|
||||
|
||||
<%--$(function () {--%>
|
||||
<%-- $('#switchBtnDefinition').bootstrapSwitch({--%>
|
||||
<%-- onText: '高清',--%>
|
||||
<%-- offText: '标清',--%>
|
||||
<%-- // size: "small",--%>
|
||||
<%-- });--%>
|
||||
<%-- $('#switchBtnDefinition').bootstrapSwitch('state', false, true);--%>
|
||||
<%-- <%–if ('${dataVisualContent.isfull}' == '${Isfull_False}') {–%>--%>
|
||||
<%-- <%– $('#switchBtnIsFull').bootstrapSwitch('state', false, true);–%>--%>
|
||||
<%-- <%–} else if ('${dataVisualContent.isfull}' == '${Isfull_True}') {–%>--%>
|
||||
<%-- <%– $('#switchBtnIsFull').bootstrapSwitch('state', true, true);–%>--%>
|
||||
<%-- <%–} else {–%>--%>
|
||||
<%-- <%– $('#switchBtnIsFull').bootstrapSwitch('state', false, true);–%>--%>
|
||||
<%-- <%–}–%>--%>
|
||||
<%--});--%>
|
||||
|
||||
function clickDefinition(st) {
|
||||
definitionSt = st;
|
||||
if (st == 'standard') {
|
||||
$('#highDefinition').css('color', '#444444');
|
||||
$('#highDefinition').css('background-color', '#f4f4f4');
|
||||
$('#standardDefinition').css('color', '#ffffff');
|
||||
$('#standardDefinition').css('background-color', '#0AB1DF');
|
||||
} else {
|
||||
$('#standardDefinition').css('color', '#444444');
|
||||
$('#standardDefinition').css('background-color', '#f4f4f4');
|
||||
$('#highDefinition').css('color', '#ffffff');
|
||||
$('#highDefinition').css('background-color', '#0AB1DF');
|
||||
}
|
||||
}
|
||||
|
||||
var hisCameraViewWindow = null;
|
||||
|
||||
function showHisCamera() {
|
||||
var id = "";
|
||||
$(".red").each(function (i, n) {
|
||||
id = map2.get($(this).attr("id"));
|
||||
})
|
||||
if (id != '') {
|
||||
hisCameraViewWindow = window.open(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
hisCameraViewWindow.focus();
|
||||
} else {
|
||||
alert("未识别到当前选择的摄像头!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function showEqCamera() {
|
||||
event.stopPropagation();
|
||||
var id = "";
|
||||
$(".red").each(function (i, n) {
|
||||
id = map2.get($(this).attr("id"));
|
||||
})
|
||||
$.post(ext.contextPath + '/equipment/equipmentCardCamera/showListForEqView.do', {
|
||||
cameraId: id
|
||||
},
|
||||
function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('eqCameraModal');
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini" style="background-color: rgb(255,255,255)">
|
||||
<div class="wrapper">
|
||||
<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>--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div class="form-group form-inline" style="float: left;width:calc(100% - 150px);">
|
||||
<input type="hidden" name="company" id="company">
|
||||
<div class="input-group" style="margin-right: 10px;float: left;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control" placeholder="摄像机..."
|
||||
value="" style="width: 160px;">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-flat" onclick="mclear()"
|
||||
style="background-color: #fff;border-top: 1px solid #ccc;border-right: 1px solid #ccc;border-bottom: 1px solid #ccc;">x</button>
|
||||
<button type="button" onclick="searchCamera();" class="btn btn-flat"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<div style="float: left;border-bottom: 1px #000000 solid;width: calc(100% - 250px);">
|
||||
<%-- <%– <label><font color="#8DEEEE">摄像常用画面</font></label>–%>--%>
|
||||
<%-- <label style="margin-left:5px;">视频总数:<font id='cameracount'></font>(在线:<font--%>
|
||||
<%-- id='onlinecount'></font>;离线:<font id='notonlinecount'></font>)|</label>--%>
|
||||
<%-- <label style="margin-left:5px;">生产:<span id="scNum"></span> 安防:<span id="afNum"></span> |</label>--%>
|
||||
<%-- <label style="margin-left:5px;">球机:<font id='qiujicount'></font> 枪机:<font--%>
|
||||
<%-- id='qiangjicount'></font> </label>--%>
|
||||
|
||||
<%-- <%– <label class="form-label" style="margin-left: 5px;">开始时间</label>–%>--%>
|
||||
<%-- <%– <input type="text" class="form-control" id="rptdt" name="rptdt">–%>--%>
|
||||
|
||||
<div class="btn-group" style="float: right;">
|
||||
<label class="form-label" style="margin-left: 5px;">分屏选择</label>
|
||||
<select class="form-control select2-selection--single" id="fenpin"
|
||||
style="width: 80px;height: 30px;"
|
||||
onchange="fenpin();" placeholder="请选择">
|
||||
<!-- <option disabled value>-分屏选择</option> -->
|
||||
<option selected value="1">单屏</option>
|
||||
<option value="2">2X2</option>
|
||||
<option value="3">3X3</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="cleanFocus();"> 清除当前</button>
|
||||
<button type="button" class="btn btn-default btn-sm" style="margin-left: 5px;"
|
||||
onclick="cleanAll();">全部清除
|
||||
</button>
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" style="margin-left: 5px;" onclick="reset();">还原分屏</button> -->
|
||||
|
||||
</div>
|
||||
<%-- <select class="form-control select2-selection--single" id="net" style="width: 80px;height: 30px;">--%>
|
||||
<%-- <!-- <option disabled value>-分屏选择</option> -->--%>
|
||||
<%-- <option selected value="1">内网</option>--%>
|
||||
<%-- <option value="2">外网</option>--%>
|
||||
<%-- </select>--%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width: 100%;height:100%;float: left;background-color: rgb(255,255,255)">
|
||||
<div id="cameralist" style="width: 240px;float: left;">
|
||||
<!-- <table id="table"></table> -->
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:500px;overflow:auto; "></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="videos" style="width:753px;height:483px;border:2px solid gray;float: left;">
|
||||
<div style="width: 743px;height: 473px;float: left;margin-left: 3px;margin-top: 3px;background-color: black;"
|
||||
id="video_1" class="white" onclick="focusThis(this.id)">
|
||||
<img id="show_video_1" style="width: 100%;height: 100%;" src="">
|
||||
</div>
|
||||
</div>
|
||||
<div id="controlArea" style="width: 150px;height:483px;float: left;background-color: rgb(255,255,255)">
|
||||
<div id="nowCameraName" style="height:30px;line-height: 30px;padding-left: 5px;"><span>球机控制</span>
|
||||
</div>
|
||||
<div style="width: 150px;text-align: center;margin-top: 15px;">
|
||||
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-left"
|
||||
style="transform: rotate(45deg);"></i></button>
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-up"></i></button>
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-right"
|
||||
style="transform: rotate(-45deg);"></i></button>
|
||||
</div>
|
||||
<div style="width: 150px;text-align: center;margin-top: 5px;">
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-left"></i></button>
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-arrows"></i></button>
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-right"></i></button>
|
||||
</div>
|
||||
<div style="width: 150px;text-align: center;margin-top: 5px;">
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-left"
|
||||
style="transform: rotate(-45deg);"></i></button>
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-down"></i></button>
|
||||
<button style="width: 30px;height: 30px;"><i class="fa fa-angle-right"
|
||||
style="transform: rotate(45deg);"></i></button>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-top:20px;float: left;width: 100%;padding-left: 10px;border-top:1px dashed #3c3c3c;">
|
||||
</div>
|
||||
<div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">
|
||||
<div style="float: left;width: 50%;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="showHisCamera();">回放
|
||||
</button>
|
||||
</div>
|
||||
<div style="float: left;width: 50%;">
|
||||
<button type="button" class="btn btn-default btn-sm">图片
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">
|
||||
<div style="float: left;width: 50%;">
|
||||
<button id="standardDefinition" type="button" class="btn btn-default btn-sm"
|
||||
style="color: #ffffff;background-color: #0AB1DF;"
|
||||
onclick="clickDefinition('standard');">标清
|
||||
</button>
|
||||
</div>
|
||||
<div style="float: left;width: 50%;">
|
||||
<button id="highDefinition" type="button" class="btn btn-default btn-sm"
|
||||
style="color: #444444;background-color: #f4f4f4;"
|
||||
onclick="clickDefinition('high');">高清
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">--%>
|
||||
<%-- <div style="float: left;width: 50%;">--%>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" style="width: 46px;height: 30px;" onclick="showEqCamera();">--%>
|
||||
<%-- <span class='fa fa-wrench' ></span>--%>
|
||||
<%-- </button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div style="margin-top:20px;float: left;width: 100%;padding-left: 20px;">--%>
|
||||
<%-- <input id="switchBtnDefinition" type="checkbox"/>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<%-- <div style="width: 150px;text-align: center;margin-top: 5px;">--%>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" style="margin-left: 5px;"--%>
|
||||
<%-- onclick="notonline();">离线摄像头--%>
|
||||
<%-- </button>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
645
WebRoot/jsp/work/cameraList.jsp
Normal file
645
WebRoot/jsp/work/cameraList.jsp
Normal file
@ -0,0 +1,645 @@
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<%-- <jsp:include page="/jsp/inc.jsp"></jsp:include>--%>
|
||||
<jsp:include page="/jsp/incProVisual.jsp"></jsp:include>
|
||||
<%@ page import="com.sipai.tools.Mqtt" %>
|
||||
<%@ page import="org.springframework.context.ApplicationContext" %>
|
||||
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
|
||||
<%-- mqtt依赖--%>
|
||||
<script src="<%=request.getContextPath()%>/JS/mqtt/mqtt.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/camera/add.do', {companyId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/camera/edit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function (id, type) {
|
||||
$.post(ext.contextPath + '/work/camera/showCameraDetail.do', {id: id, type: type}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
var viewVideoFun = function (id, channel) {
|
||||
$.post(ext.contextPath + '/work/camera/showCameraVideo.do', {
|
||||
id: id,
|
||||
nowUrl: window.location.host
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subCameraModal');
|
||||
});
|
||||
}
|
||||
|
||||
Date.prototype.format = function (format) {
|
||||
var args = {
|
||||
"M+": this.getMonth() + 1,
|
||||
"d+": this.getDate(),
|
||||
"h+": this.getHours(),
|
||||
"m+": this.getMinutes(),
|
||||
"s+": this.getSeconds(),
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //quarter
|
||||
"S": this.getMilliseconds()
|
||||
};
|
||||
if (/(y+)/.test(format))
|
||||
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var i in args) {
|
||||
var n = args[i];
|
||||
if (new RegExp("(" + i + ")").test(format))
|
||||
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? n : ("00" + n).substr(("" + n).length));
|
||||
}
|
||||
return format;
|
||||
};
|
||||
|
||||
var hisCameraViewWindow = null;
|
||||
var definitionSt = 'standard';
|
||||
function showHisCamera(id) {
|
||||
var time = new Date(new Date().getTime() - 60 * 60 * 1000).format("yyyy-MM-dd hh:mm:ss")
|
||||
hisCameraViewWindow = window.open(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt + "&time=" + time, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
// console.log(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt + "&time=" + time, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
hisCameraViewWindow.focus();
|
||||
}
|
||||
|
||||
// var viewVideoHFFun = function(id,channel){
|
||||
// $.post(ext.contextPath + '/work/camera/showVideo.do', {id:id,time:$('#datetimepicker').val()} , 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 + '/work/camera/deletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
}).then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/camera/deletes.do', {ids: id}, 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 () {
|
||||
|
||||
if ('${param.unitId}' != "") {
|
||||
unitId = '${param.unitId}'
|
||||
}
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, 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_.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
if ('${param.selectId}' != '') {
|
||||
selelct_.val('${param.selectId}').trigger("change");
|
||||
dosearch();
|
||||
} else {
|
||||
selelct_.val('').trigger("change");
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
|
||||
//init();
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/camera/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,
|
||||
search_name: $('#search_name').val(),
|
||||
search_channel: $('#search_channel').val(),
|
||||
unitId: unitId,
|
||||
processsectionid: $("#processsection").val(),
|
||||
}
|
||||
},
|
||||
sortName: 'url,channel', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的number
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'url', // 返回json数据中的model
|
||||
title: '地址', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'channel', // 返回json数据中的libraryid
|
||||
title: '通道号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'type', // 返回json数据中的state
|
||||
title: '摄像机类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'style', // 返回json数据中的state
|
||||
title: '摄像机外形', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '球机';
|
||||
case '0':
|
||||
return '枪机';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'viewscopes', // 返回json数据中的state
|
||||
title: '用途分类', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '生产';
|
||||
case '0':
|
||||
return '安防';
|
||||
default:
|
||||
return '——';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'active', // 返回json数据中的state
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '启用';
|
||||
case '0':
|
||||
return '禁用';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = "";
|
||||
str += '<button class="btn btn-default btn-sm" onclick="viewVideoFun(\'' + row.id + '\',\'' + row.channel + '\')"><i class="fa fa-video-camera"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" onclick="showHisCamera(\'' + row.id + '\')"><i class="fa fa-play-circle-o"></i></button>';
|
||||
// str += '<button class="btn btn-default btn-sm" onclick="showHisCamera(\'' + row.id + '\')">回放</button>';
|
||||
/*str+='<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\',\'' + row.type + '\')"><i class="fa fa-eye"></i></button>';*/
|
||||
str += '<button class="btn btn-default btn-sm" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
var hisCameraViewWindow = null;
|
||||
var definitionSt = 'standard';
|
||||
// 视频回放
|
||||
// function showHisCamera(id) {
|
||||
// $(".red").each(function (i, n) {
|
||||
// id = map2.get($(this).attr("id"));
|
||||
// })
|
||||
// if (id != '') {
|
||||
// hisCameraViewWindow = window.open(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
// hisCameraViewWindow.focus();
|
||||
// } else {
|
||||
// alert("未识别到当前选择的摄像头!");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
$(function () {
|
||||
$('#datetimepicker').prop("readonly", true).datetimepicker({
|
||||
language: 'zh-CN',
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
minuteStep: 1,
|
||||
dataFormat: 'yyyy-mm-dd',
|
||||
timeFormat: 'HH:mm:ss',
|
||||
showSecond: true,
|
||||
//format: "yyyy-mm-dd hh:ii:ss",
|
||||
endDate: new Date(),
|
||||
});
|
||||
getMqtt(mqttStatus, mqttHostWeb);
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 重启模型
|
||||
var restart = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("是否重启模型?")){
|
||||
$.post(ext.contextPath + '/work/pythonModel/restart.do',{}, function(data) {
|
||||
if(data==1){
|
||||
showAlert('s','重启成功','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
// 识别区域
|
||||
var identifyAreasDiv = function(id) {
|
||||
|
||||
$.post(ext.contextPath + '/work/camera/showCameraVideo4identifyAreas.do', {
|
||||
id: id,
|
||||
nowUrl: window.location.host
|
||||
}, function (data) {
|
||||
$("#identifyAreasDiv").html(data);
|
||||
openModal('identifyAreasModal');
|
||||
});
|
||||
};
|
||||
// 视野区域
|
||||
var visionAreasDiv = function(id) {
|
||||
$.post(ext.contextPath + '/work/camera/showCameraVideo4visionAreas.do', {
|
||||
id: id,
|
||||
}, function (data) {
|
||||
$("#visionAreasDiv").html(data);
|
||||
openModal('visionAreasModal');
|
||||
});
|
||||
};
|
||||
|
||||
var client;
|
||||
|
||||
function getMqtt(mqttStatus, mqttHostWeb) {
|
||||
try {
|
||||
//初始化mqtt
|
||||
if (mqttStatus == '0') {
|
||||
let mqttId = "camera_model" + "_" + Math.random();
|
||||
|
||||
initialMqtt(mqttId, mqttHostWeb);
|
||||
// setTimeout(function () {
|
||||
//
|
||||
// }, 10000);
|
||||
} else {
|
||||
console.log('mq已关闭')
|
||||
}
|
||||
} catch (err) {
|
||||
//处理错误
|
||||
}
|
||||
}
|
||||
|
||||
function initialMqtt(mqttId, mqttHostWeb) {
|
||||
// console.log(personnelPositioning_auto_mq_theme)
|
||||
//动态拿取mq定制化数据
|
||||
// $.ajax({
|
||||
// type: 'POST',
|
||||
// url: ext.contextPath + "/mqtt/addTopic.do",
|
||||
// async: false,
|
||||
// globle: false,
|
||||
// data: {
|
||||
// topic: 'topic_dataVisual_' + nowUnitId + '_' + frameId,
|
||||
// mpointIds: mqttMpcode
|
||||
// },
|
||||
// dataType: 'json',
|
||||
// error: function () {
|
||||
// return false;
|
||||
// },
|
||||
// success: function (data) {
|
||||
// }
|
||||
// });
|
||||
// console.log(mqttMpcode);
|
||||
const options = {
|
||||
clean: true,
|
||||
// cleanSession : false,
|
||||
// reconnect : true,
|
||||
connectTimeout: 10000,
|
||||
clientId: mqttId,
|
||||
username: "admin",
|
||||
password: 'public'
|
||||
}
|
||||
console.log(mqttHostWeb)
|
||||
const connectUrl = mqttHostWeb;
|
||||
client = mqtt.connect(connectUrl, options);
|
||||
|
||||
//当重新连接启动触发回调
|
||||
client.on('reconnect', function () {
|
||||
// console.log('正在重连.....');
|
||||
});
|
||||
//连接断开后触发的回调
|
||||
client.on("close", function () {
|
||||
console.log('客户端已断开连接.....');
|
||||
});
|
||||
//从broker接收到断开连接的数据包后发出。MQTT 5.0特性
|
||||
client.on("disconnect", function (packet) {
|
||||
console.log('从broker接收到断开连接的数据包.....' + packet);
|
||||
});
|
||||
//客户端脱机下线触发回调
|
||||
client.on("offline", function () {
|
||||
console.log('客户端脱机下线.....');
|
||||
});
|
||||
//当客户端无法连接或出现错误时触发回调
|
||||
client.on("error", (error) => {
|
||||
console.log('客户端出现错误.....' + error);
|
||||
});
|
||||
//当客户端发送任何数据包时发出。这包括published()包以及MQTT用于管理订阅和连接的包
|
||||
client.on("packetsend", (packet) => {
|
||||
// console.log('客户端已发出数据包:' + packet);
|
||||
});
|
||||
//当客户端接收到任何数据包时发出。这包括来自订阅主题的信息包以及MQTT用于管理订阅和连接的信息包
|
||||
client.on("packetreceive", (packet) => {
|
||||
// console.log('收到:' + packet);
|
||||
});
|
||||
|
||||
//成功连接后触发的回调
|
||||
client.on("connect", function (connack) {
|
||||
// layer.msg('成功连接上mq服务器');
|
||||
console.log('成功连接上mq服务器');
|
||||
//订阅某主题
|
||||
/**
|
||||
* client.subscribe(topic/topic array/topic object, [options], [callback])
|
||||
* topic:一个string类型的topic或者一个topic数组,也可以是一个对象
|
||||
* options
|
||||
*/
|
||||
let auto_mq_theme_in = ['cameraModel'];
|
||||
|
||||
client.subscribe(auto_mq_theme_in, {qos: 1});
|
||||
//每隔2秒发布一次数据
|
||||
// setInterval(publish, 2000)
|
||||
});
|
||||
|
||||
function publish() {
|
||||
//发布数据
|
||||
/**
|
||||
* client.publish(topic,message,[options], [callback])
|
||||
*
|
||||
* message: Buffer or String
|
||||
* options:{
|
||||
* qos:0, //默认0
|
||||
* retain:false, //默认false
|
||||
* dup:false, //默认false
|
||||
* properties:{}
|
||||
* }
|
||||
* callback:function (err){}
|
||||
*/
|
||||
const message = "h5 message " + Math.random() + new Date();
|
||||
client.publish("testtopic/123", message, {qos: 2});
|
||||
}
|
||||
|
||||
//当客户端接收到发布消息时触发回调
|
||||
/**
|
||||
* topic:收到的数据包的topic
|
||||
* message:收到的数据包的负载playload
|
||||
* packet:收到的数据包
|
||||
*/
|
||||
client.on('message', (topic, message, packet) => {
|
||||
var json = JSON.parse(message.toString());
|
||||
if (json.result == "1") {
|
||||
showAlert('s', '模型重启成功', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
//页面离开自动断开连接
|
||||
$(window).bind("beforeunload", () => {
|
||||
// console.log("客户端窗口关闭,断开连接");
|
||||
client.disconnect();
|
||||
})
|
||||
}
|
||||
|
||||
</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="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="subNVRDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="fault4SelectNVRDiv"></div>
|
||||
<div id="identifyAreasDiv"></div>
|
||||
<div id="visionAreasDiv"></div>
|
||||
<div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
|
||||
<div class="form-group pull-right">
|
||||
<div class="form-group ">
|
||||
<label class="form-label" style="line-height: 34px;">工艺段:</label>
|
||||
<select class="form-control select2-selection--single" id="processsection"
|
||||
name="processsection" style="width: 220px;"></select>
|
||||
<!-- select2 select2-container select2-selection--single -->
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="form-label" style="line-height: 34px;">通道号:</label>
|
||||
<input type="text" id="search_channel" name="search_channel" class="form-control pull-right"
|
||||
placeholder="通道号">
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="form-label" style="line-height: 34px;">名称/地址:</label>
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="名称/地址">
|
||||
</div>
|
||||
|
||||
<div class="form-group " style="vertical-align: top;">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<%-- <div class="input-group input-group-sm" style="width: 300px;">--%>
|
||||
<%-- <label class="form-label">回放开始时间</label>--%>
|
||||
<%-- <input type="text" style="width:200px" id="datetimepicker" name="datetimepicker" class="form-control pull-right" >--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
新增
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
|
||||
<security:authorize buttonUrl="work/pythonModel/restart.do">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="restart();"><i
|
||||
class="fa fa-refresh"></i> 重启模型
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
261
WebRoot/jsp/work/cameraListForSelectShow.jsp
Normal file
261
WebRoot/jsp/work/cameraListForSelectShow.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchPatrolPoint = function () {
|
||||
$("#table_CameraModalForSelect").bootstrapTable('refresh');
|
||||
};
|
||||
function doSelect() {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
datas_name = "";
|
||||
$.each(selectionIds, function (index, item) {
|
||||
if (datas != "") {
|
||||
datas += ",";
|
||||
}
|
||||
console.log(item);
|
||||
datas += item;
|
||||
});
|
||||
//调用上一界面方法完成选择
|
||||
doFinishSelectCamera(datas);
|
||||
closeModal("cameraModal");
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag = false;
|
||||
$.each(eval('${cameras}'), function (index, item) {
|
||||
if (row.id == item.id) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
if (flag)
|
||||
return {
|
||||
checked: true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus = false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds() {
|
||||
var check_array = eval('${cameras}');
|
||||
if (check_array != null && check_array.length > 0) {
|
||||
selectionIds = new Array(check_array.length);
|
||||
for (var i = 0; i < check_array.length; i++) {
|
||||
selectionIds[i] = check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds() {
|
||||
var ids = "";
|
||||
var check_array = eval('${cameras}');
|
||||
$.each(check_array, function (index, item) {
|
||||
if (ids != "") {
|
||||
ids += ",";
|
||||
}
|
||||
ids += item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
var temp = {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
cameraName: $('#search_name_equ').val(),
|
||||
companyId: '${param.bizId}',
|
||||
processSectionId:'${processSectionId}'
|
||||
};
|
||||
var status = $('#switchBtn').bootstrapSwitch('state');
|
||||
if (status) {
|
||||
temp.checkedIds = getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function () {
|
||||
$("#searchForm_Equ").attr("onsubmit", "return false;");
|
||||
$("#search_name_equ").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchPatrolPoint();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
})
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
|
||||
initialSelectionIds();
|
||||
$table = $("#table_CameraForSelect").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/camera/getList.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect: true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
clickToSelect: true,
|
||||
responseHandler: responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
//formatter: stateFormatter
|
||||
formatter: function (i, row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if ($.inArray(row.id, Array.from(selectionIds)) != -1) { // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked: true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'name',
|
||||
title: "摄像头名称",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%'
|
||||
}, {
|
||||
field: 'url',
|
||||
title: "摄像头ip",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '50%',/*
|
||||
formatter:function(value,row,index){
|
||||
return row.processSection.name;
|
||||
}*/
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_CameraForSelect");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if ('check' == e.type) {
|
||||
obj.parent().addClass("checked");
|
||||
} else {
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_user");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
if ($.inArray(id, array) == -1) {
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function (array, ids) {
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id, array);
|
||||
if (index != -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = { "union": union, "difference": difference };
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="cameraModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择摄像头</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse">
|
||||
<form class="form-horizontal " id="searchForm_Equ">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<!-- <label class="col-sm-2 control-label">部门</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="search_pid" name ="search_pid" style="width:170px;"></select>
|
||||
</div> -->
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_name_equ" name="search_name_equ"
|
||||
class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-sm-offset-6 button-group" style="padding: 0;">
|
||||
<button type="button" class="btn btn-default btn-sm pull-right"
|
||||
onclick="doSearchPatrolPoint();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_CameraForSelect" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
116
WebRoot/jsp/work/cameraNVRAdd.jsp
Normal file
116
WebRoot/jsp/work/cameraNVRAdd.jsp
Normal file
@ -0,0 +1,116 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* table[ip] tr th,table[ip] tr td{
|
||||
border: 1px solid grey;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
width:25%;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function docamerasave() {
|
||||
|
||||
$.post(ext.contextPath + "/work/cameraNVR/dosave.do", $("#subFormnvr").serialize(), function(data) {
|
||||
if (data == 1) {
|
||||
$("#table_nvr_Detail").bootstrapTable('refresh');
|
||||
document.getElementById("subNVRModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
|
||||
$("#subFormnvr").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// name: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '用户名不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// }
|
||||
});
|
||||
|
||||
$(function() {
|
||||
});
|
||||
|
||||
|
||||
var showAreaManage4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/areaManage/showList4Select.do', {formId:"subFormnvr",hiddenId:"areamanageid",textId:"aname"} , function(data) {
|
||||
$("#fault4SelectNVRDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subNVRModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content" style="width: 850px;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增视频回放地址</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subFormnvr" enctype="multipart/form-data" >
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<input type="hidden" id="id" name="id" value="${cameraid}">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">NVR名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="NVR名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="aname" name ="aname" placeholder="上级区域" onclick="showAreaManage4SelectFun();" ></input>
|
||||
<input id="areamanageid" name="areamanageid" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">用户名</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="username" name="username" class="form-control pull-right" placeholder="NVR用户名">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="password" name="password" class="form-control pull-right" placeholder="NVR密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">NVR地址</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="ip" name="ip" class="form-control pull-right" placeholder="NVR地址">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">NVR通道</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="channel" name="channel" class="form-control pull-right" placeholder="1">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="docamerasave()" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
117
WebRoot/jsp/work/cameraNVREdit.jsp
Normal file
117
WebRoot/jsp/work/cameraNVREdit.jsp
Normal file
@ -0,0 +1,117 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
/* table[ip] tr th,table[ip] tr td{
|
||||
border: 1px solid grey;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
width:25%;
|
||||
} */
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function docameraupdate(){
|
||||
|
||||
$.post(ext.contextPath + "/work/cameraNVR/update.do", $("#subFormnvr").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#table_nvr_Detail").bootstrapTable('refresh');
|
||||
document.getElementById("subNVRModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
|
||||
$("#subFormnvr").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// name: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '用户名不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// }
|
||||
});
|
||||
|
||||
$(function() {
|
||||
});
|
||||
|
||||
|
||||
var showAreaManage4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/areaManage/showList4Select.do', {formId:"subFormnvr",hiddenId:"areamanageid",textId:"aname"} , function(data) {
|
||||
$("#fault4SelectNVRDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subNVRModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content" style="width: 850px;">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑视频回放地址</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subFormnvr" enctype="multipart/form-data" >
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<input type="hidden" id="id" name="id" value="${cameraNVR.id}">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">NVR名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" value="${cameraNVR.name}" placeholder="NVR名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="aname" name ="aname" placeholder="上级区域" value="${cameraNVR.areaManage.name}" onclick="showAreaManage4SelectFun();" ></input>
|
||||
<input id="areamanageid" name="areamanageid" value="${cameraNVR.areaManage.id}" type="hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">用户名</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="username" name="username" class="form-control pull-right" value="${cameraNVR.username}" placeholder="NVR用户名">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="password" name="password" class="form-control pull-right" value="${cameraNVR.password}" placeholder="NVR密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">NVR地址</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="ip" name="ip" class="form-control pull-right" value="${cameraNVR.ip}" placeholder="NVR地址">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">NVR通道</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="channel" name="channel" class="form-control pull-right" value="${cameraNVR.channel}" placeholder="1">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="docameraupdate()" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
106
WebRoot/jsp/work/cameraVideoJsp.jsp
Normal file
106
WebRoot/jsp/work/cameraVideoJsp.jsp
Normal file
@ -0,0 +1,106 @@
|
||||
<%@ 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>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<style type="text/css">
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
$('#videos').css('width', width);
|
||||
$('#videos').css('height', height);
|
||||
|
||||
viewThisCamera('${id}', '${online}');
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
$('#videos').css('width', width);
|
||||
$('#videos').css('height', height);
|
||||
});
|
||||
|
||||
function viewThisCamera(id, online) {
|
||||
// console.log(id + '---' + online);
|
||||
if (!online) {
|
||||
swal('该摄像头无法连接。');
|
||||
return;
|
||||
}
|
||||
var websocket = null;
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = '${time}';
|
||||
if (time == null || time == '') {
|
||||
time = "now";
|
||||
}
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/high");
|
||||
<%--if (data.type == '1') {--%>
|
||||
<%-- websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/high");--%>
|
||||
<%--} else if (data.type == '2') {--%>
|
||||
<%-- websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.netUrl + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/high");--%>
|
||||
<%--}--%>
|
||||
}
|
||||
});
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result = JSON.parse(event.data);
|
||||
$("#show_video_1").attr("src", event.data);
|
||||
}
|
||||
})
|
||||
<%--websocket = new WebSocket(ext.basePath.replace("http", "ws") + "/videoWebSocket/" + id + "/" + time + "/${uuid}");--%>
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body style="background-color: rgb(23, 39, 55);">
|
||||
<div id="videos" style="float: left;background-color: rgb(23, 39, 55);">
|
||||
<div style="width: 100%;height: 100%;float: left;background-color: rgb(23, 39, 55);" id="video_1">
|
||||
<img id="show_video_1" style="width: 100%;height: 100%;" src="">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
190
WebRoot/jsp/work/cameradetailAdd.jsp
Normal file
190
WebRoot/jsp/work/cameradetailAdd.jsp
Normal file
@ -0,0 +1,190 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($("#iAreasType").val() == 1 && $("#identifyAreas").val() == "") {
|
||||
$("#identifyAreas").val("1")
|
||||
}
|
||||
if ($("#vAreasType").val() == 1 && $("#visionAreas").val() == "") {
|
||||
$("#visionAreas").val("1")
|
||||
}
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/cameraDetail/dosave.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
document.getElementById("subDetailModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
function doclose() {
|
||||
closeModal('subDetailModal');
|
||||
}
|
||||
//输入框验证
|
||||
// $("#subForm2").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// project: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$.post(ext.contextPath + "/hqconfig/workModel/getJson.do", {}, function(data) {
|
||||
var selelct =$("#algorithmid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
if(data.length>=1){
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
|
||||
}else{
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
}
|
||||
},'json');
|
||||
|
||||
var selectMPint = function () {
|
||||
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {
|
||||
formId: 'subForm2',
|
||||
hiddenId: 'pointid',
|
||||
textId: 'alarmPointName'
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
document.getElementById('iDiv').style.visibility = 'hidden';
|
||||
document.getElementById('vDiv').style.visibility = 'hidden';
|
||||
$("#iAreasType").change(function () {
|
||||
let iAreasType = $("#iAreasType").val();
|
||||
if (iAreasType == '1') {
|
||||
console.log(1)
|
||||
document.getElementById('iDiv').style.visibility = 'visible';
|
||||
} else {
|
||||
console.log(2)
|
||||
document.getElementById('iDiv').style.visibility = 'hidden';
|
||||
}
|
||||
});
|
||||
$("#vAreasType").change(function () {
|
||||
let vAreasType = $("#vAreasType").val();
|
||||
if (vAreasType == '1') {
|
||||
console.log(3)
|
||||
document.getElementById('vDiv').style.visibility = 'visible';
|
||||
} else {
|
||||
console.log(4)
|
||||
document.getElementById('vDiv').style.visibility = 'hidden';
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<input type="hidden" id="cameraid" name="cameraid" value ="${cameraid}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">外部算法</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="algorithmid" name="algorithmid" class="form-control select2" style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="state" class="form-control pull-right" name="status" >
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">关键触发点</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="alarmPointName" name="alarmPointName"
|
||||
placeholder="关键触发点" onclick="selectMPint();"
|
||||
readonly>
|
||||
<input type="hidden" id="pointid" name="pointid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*是否设置识别区域</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="iAreasType" class="form-control pull-right" name="iAreasType" >
|
||||
<option value="0" selected>否</option>
|
||||
<option value="1" >是</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*是否设置视野区域</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="vAreasType" class="form-control pull-right" name="vAreasType" >
|
||||
<option value="0" selected>否</option>
|
||||
<option value="1" >是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div id="iDiv">
|
||||
<label class="col-sm-2 control-label">识别区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="identifyAreas" name="identifyAreas">
|
||||
</div>
|
||||
</div>
|
||||
<div id="vDiv">
|
||||
<label class="col-sm-2 control-label">视野区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="visionAreas" name="visionAreas">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
188
WebRoot/jsp/work/cameradetailEdit.jsp
Normal file
188
WebRoot/jsp/work/cameradetailEdit.jsp
Normal file
@ -0,0 +1,188 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doUpdateDetail() {
|
||||
if ($("#iAreasType").val() == 1 && $("#identifyAreas").val() == "") {
|
||||
$("#identifyAreas").val("1")
|
||||
}
|
||||
if ($("#vAreasType").val() == 1 && $("#visionAreas").val() == "") {
|
||||
$("#visionAreas").val("1")
|
||||
}
|
||||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/cameraDetail/update.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
document.getElementById("subDetailModal").setAttribute("class", "modal hidden fade");
|
||||
$(".modal-backdrop").remove();
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
// }
|
||||
}
|
||||
|
||||
function doclose() {
|
||||
closeModal('subDetailModal');
|
||||
}
|
||||
|
||||
$.post(ext.contextPath + "/hqconfig/workModel/getJson.do", {}, function(data) {
|
||||
var selelct =$("#algorithmid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
// if(data.length>=1){
|
||||
// selelct.val(data[0].id).trigger("change");
|
||||
// }else{
|
||||
// selelct.val(data[0].id).trigger("change");
|
||||
// }
|
||||
selelct.val('${cameraDetail.algorithmid}').trigger("change");
|
||||
},'json');
|
||||
|
||||
var selectMPint = function () {
|
||||
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {
|
||||
formId: 'subForm2',
|
||||
hiddenId: 'pointid',
|
||||
textId: 'alarmPointName'
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
if ('${cameraDetail.iAreasType}' == '1') {
|
||||
document.getElementById('iDiv').style.visibility = 'visible';
|
||||
console.log(1)
|
||||
} else {
|
||||
document.getElementById('iDiv').style.visibility = 'hidden';
|
||||
console.log(2)
|
||||
}
|
||||
|
||||
if ('${cameraDetail.vAreasType}' == '1') {
|
||||
document.getElementById('vDiv').style.visibility = 'visible';
|
||||
console.log(3)
|
||||
} else {
|
||||
document.getElementById('vDiv').style.visibility = 'hidden';
|
||||
console.log(4)
|
||||
}
|
||||
$("#iAreasType").change(function () {
|
||||
let iAreasType = $("#iAreasType").val();
|
||||
if (iAreasType == '1') {
|
||||
document.getElementById('iDiv').style.visibility = 'visible';
|
||||
} else {
|
||||
document.getElementById('iDiv').style.visibility = 'hidden';
|
||||
}
|
||||
});
|
||||
$("#vAreasType").change(function () {
|
||||
let vAreasType = $("#vAreasType").val();
|
||||
if (vAreasType == '1') {
|
||||
document.getElementById('vDiv').style.visibility = 'visible';
|
||||
} else {
|
||||
document.getElementById('vDiv').style.visibility = 'hidden';
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<input type="hidden" id="id" name="id" value ="${cameraDetail.id}">
|
||||
<input type="hidden" id="cameraid" name="cameraid" value ="${cameraDetail.cameraid}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">外部算法</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="algorithmid" name="algorithmid" class="form-control select2" style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="state" class="form-control pull-right" name="status" >
|
||||
<option value="1" <c:if test="${cameraDetail.status == '1'}"> selected </c:if>>启用</option>
|
||||
<option value="0" <c:if test="${cameraDetail.status == '0'}"> selected </c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">关键触发点</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="alarmPointName" name="alarmPointName"
|
||||
placeholder="关键触发点" onclick="selectMPint();" value ="${cameraDetail.mPoint.parmname}"
|
||||
readonly>
|
||||
<input type="hidden" id="pointid" name="pointid" value ="${cameraDetail.pointid}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*是否设置识别区域</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="iAreasType" class="form-control pull-right" name="iAreasType" >
|
||||
<option value="0" <c:if test="${cameraDetail.iAreasType == '0'}"> selected </c:if>>否</option>
|
||||
<option value="1" <c:if test="${cameraDetail.iAreasType == '1'}"> selected </c:if>>是</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*是否设置视野区域</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="vAreasType" class="form-control pull-right" name="vAreasType" >
|
||||
<option value="0" <c:if test="${cameraDetail.vAreasType == '0'}"> selected </c:if>>否</option>
|
||||
<option value="1" <c:if test="${cameraDetail.vAreasType == '1'}"> selected </c:if>>是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div id="iDiv">
|
||||
<label class="col-sm-2 control-label">识别区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="identifyAreas" onclick="identifyAreasDiv('${cameraDetail.cameraid}')" name="identifyAreas" value="${cameraDetail.identifyAreas}">
|
||||
</div>
|
||||
</div>
|
||||
<div id="vDiv">
|
||||
<label class="col-sm-2 control-label">视野区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="visionAreas" onclick="visionAreasDiv('${cameraDetail.cameraid}')" name="visionAreas" value="${cameraDetail.visionAreas}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doUpdateDetail()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
261
WebRoot/jsp/work/cameraview.jsp
Normal file
261
WebRoot/jsp/work/cameraview.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
</head>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/camera/camera.css" rel='stylesheet' />
|
||||
<style type="text/css">
|
||||
.ptz .btn2 {
|
||||
margin: 2px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
padding: 2px 0;
|
||||
height: auto;
|
||||
}
|
||||
.ptz .btn2:hover{
|
||||
background: #4d90fe;
|
||||
color: #fff;
|
||||
}
|
||||
.tt{
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
<!-- camera -->
|
||||
<%-- <script src="<%=request.getContextPath()%>/node_modules/jquery/dist/jquery.min.js"></script> --%>
|
||||
<script src="<%=request.getContextPath()%>/plugins/camera/webVideoCtrl.js"></script>
|
||||
<script src="<%=request.getContextPath()%>/plugins/camera/camera.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
changeWndNum(1);
|
||||
clickLogin();
|
||||
setTimeout("clickStartRealPlay()",1000);
|
||||
//clickStartRealPlay();
|
||||
});
|
||||
var stopRealPlay= function(){
|
||||
clickStopRealPlay();
|
||||
//setTimeout("",1000)
|
||||
}
|
||||
|
||||
//实时预览
|
||||
function shishi(){
|
||||
$('#ssyl', parent.document).html('实时预览');
|
||||
changeWndNum(1);
|
||||
clickLogin();
|
||||
setTimeout("clickStartRealPlay()",1000);
|
||||
}
|
||||
|
||||
// 开始回放
|
||||
function clickStartPlayback() {
|
||||
// var start = $("#starttime").val();
|
||||
// var end = $("#endtime").val();
|
||||
|
||||
$('#ssyl', parent.document).html('回放');
|
||||
var oWndInfo = WebVideoCtrl.I_GetWindowStatus(g_iWndIndex),
|
||||
szIP = $("#ip").val(),
|
||||
bZeroChannel = $("#channels option").eq($("#channels").get(0).selectedIndex).attr("bZero") == "true" ? true : false,
|
||||
iChannelID = $("#channels").val(),
|
||||
szStartTime = $("#starttime").val(),
|
||||
szEndTime = $("#endtime").val(),
|
||||
szInfo = "",
|
||||
bChecked = $("#transstream").prop("checked"),
|
||||
iRet = -1;
|
||||
|
||||
if ("" == szIP) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (bZeroChannel) {// 零通道不支持回放
|
||||
return;
|
||||
}
|
||||
|
||||
if (oWndInfo != null) {// 已经在播放了,先停止
|
||||
WebVideoCtrl.I_Stop();
|
||||
}
|
||||
|
||||
if (bChecked) {// 启用转码回放
|
||||
var oTransCodeParam = {
|
||||
TransFrameRate: "16",// 0:全帧率,5:1,6:2,7:4,8:6,9:8,10:10,11:12,12:16,14:15,15:18,13:20,16:22
|
||||
TransResolution: "2",// 255:Auto,3:4CIF,2:QCIF,1:CIF
|
||||
TransBitrate: "23"// 2:32K,3:48K,4:64K,5:80K,6:96K,7:128K,8:160K,9:192K,10:224K,11:256K,12:320K,13:384K,14:448K,15:512K,16:640K,17:768K,18:896K,19:1024K,20:1280K,21:1536K,22:1792K,23:2048K,24:3072K,25:4096K,26:8192K
|
||||
};
|
||||
iRet = WebVideoCtrl.I_StartPlayback(szIP, {
|
||||
iChannelID: iChannelID,
|
||||
szStartTime: szStartTime,
|
||||
szEndTime: szEndTime,
|
||||
oTransCodeParam: oTransCodeParam
|
||||
});
|
||||
} else {
|
||||
iRet = WebVideoCtrl.I_StartPlayback(szIP, {
|
||||
iChannelID: iChannelID,
|
||||
szStartTime: szStartTime,
|
||||
szEndTime: szEndTime
|
||||
});
|
||||
}
|
||||
|
||||
if (0 == iRet) {
|
||||
szInfo = "开始回放成功!";
|
||||
} else {
|
||||
szInfo = "开始回放失败!";
|
||||
}
|
||||
showOPInfo(szIP + " " + szInfo);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$(".timecheck").datetimepicker({
|
||||
bootcssVer:3, //bootstrap-datetimepicker+bootstrap v3,但这个插件使用的时候,并没有和V3相匹配,仍然调用的是bootstrap V2的图标 把bootcssVer的值直接设为3,否则datetimepicker不会显示出上、下个月的箭头
|
||||
format: 'yyyy-mm-dd HH:mm',
|
||||
minView: 'day',//设置时间选择为年月日 去掉时分秒选择
|
||||
todayBtn: true, //如果此值为true 或 "linked",则在日期时间选择器组件的底部显示一个 "Today" 按钮用以选择当前日期。如果是true的话,"Today" 按钮仅仅将视图转到当天的日期,如果是"linked",当天日期将会被选中。
|
||||
language: 'zh-CN',
|
||||
autoclose: true, //当选择一个日期之后是否立即关闭此日期时间选择器。
|
||||
keyboardNavigation: true, //是否允许通过方向键改变日期。
|
||||
forceParse: true, //当选择器关闭的时候,是否强制解析输入框中的值。
|
||||
todayHighlight: 1 //如果为true, 高亮当前日期
|
||||
})
|
||||
});
|
||||
// //獲取當前日期
|
||||
// function getToday(){
|
||||
// var today = new Date()
|
||||
// var year = today.getFullYear();
|
||||
// var month = today.getMonth() + 1;
|
||||
// var day = today.getDate();
|
||||
// var todayStr = year+"-"+month+"-"+day;
|
||||
// return todayStr;
|
||||
// }
|
||||
|
||||
</script>
|
||||
<body onUnLoad="stopRealPlay();clickLogout();">
|
||||
<div id="divPlugin" class="plugin"></div>
|
||||
<input id="loginip" type="hidden" value="${url}" />
|
||||
<input id="port" type="hidden" value="${port}" />
|
||||
<input id="username" type="hidden" value="${camera.username}" />
|
||||
<input id="password" type="hidden" value="${camera.password}" />
|
||||
<input id="deviceport" type="hidden" value="8000" />
|
||||
<input id="ip" type="hidden" value="${url}" />
|
||||
<input id="channels" type="hidden" value="${camera.channel}" />
|
||||
<input id="streamtype" type="hidden" value="${streamtype}" />
|
||||
<div class="left">
|
||||
<!-- <fieldset class="ptz" style="width:95%;">
|
||||
<legend style="width:auto;border: 0;padding: 0 10px;margin-bottom: 0;">云台控制</legend>
|
||||
<div style="width:100%;" >
|
||||
<table cellpadding="0" cellspacing="3" border="0" class="left" style="width:60%;height:100%;float:left;text-align:center;">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="button" class="btn2" value="左上" onmousedown="mouseDownPTZControl(5);" onmouseup="mouseUpPTZControl();" />
|
||||
<input type="button" class="btn2" value="上" onmousedown="mouseDownPTZControl(1);" onmouseup="mouseUpPTZControl();" />
|
||||
<input type="button" class="btn2" value="右上" onmousedown="mouseDownPTZControl(7);" onmouseup="mouseUpPTZControl();" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="button" class="btn2" value="左" onmousedown="mouseDownPTZControl(3);" onmouseup="mouseUpPTZControl();" />
|
||||
<input type="button" class="btn2" value="自动" onclick="mouseDownPTZControl(9);" />
|
||||
<input type="button" class="btn2" value="右" onmousedown="mouseDownPTZControl(4);" onmouseup="mouseUpPTZControl();" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="button" class="btn2" value="左下" onmousedown="mouseDownPTZControl(6);" onmouseup="mouseUpPTZControl();" />
|
||||
<input type="button" class="btn2" value="下" onmousedown="mouseDownPTZControl(2);" onmouseup="mouseUpPTZControl();" />
|
||||
<input type="button" class="btn2" value="右下" onmousedown="mouseDownPTZControl(8);" onmouseup="mouseUpPTZControl();" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellpadding="0" cellspacing="3" border="0" class="left" style="width:40%;height:100%;float:left;text-align:center;">
|
||||
<tr>
|
||||
<td class="tt"><input type="button" style="margin-right: -20px;" class="btn2" value="变倍+" onmousedown="PTZZoomIn()" onmouseup="PTZZoomStop()"></td>
|
||||
<td><input type="button" style="margin-right: 20px;" class="btn2" value="变倍-" onmousedown="PTZZoomout()" onmouseup="PTZZoomStop()"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tt"><input type="button" style="margin-right: -20px;" class="btn2" value="变焦+" onmousedown="PTZFocusIn()" onmouseup="PTZFoucusStop()"></td>
|
||||
<td><input type="button" style="margin-right: 20px;" class="btn2" value="变焦-" onmousedown="PTZFoucusOut()" onmouseup="PTZFoucusStop()"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tt"><input type="button" style="margin-right: -20px;" class="btn2" value="光圈+" onmousedown="PTZIrisIn()" onmouseup="PTZIrisStop()"></td>
|
||||
<td><input type="button" style="margin-right: 20px;" class="btn2" value="光圈-" onmousedown="PTZIrisOut()" onmouseup="PTZIrisStop()"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</fieldset> -->
|
||||
<fieldset class="playback" style="width:95%;padding-top: 0px">
|
||||
<legend>回放</legend>
|
||||
<table width="100%" cellpadding="0" cellspacing="3" border="0" >
|
||||
<!-- <tr>
|
||||
<td class="tt">码流类型</td>
|
||||
<td>
|
||||
<select id="record_streamtype" class="sel">
|
||||
<option value="1">主码流</option>
|
||||
<option value="2">子码流</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td class="tt">开始时间</td>
|
||||
<td>
|
||||
<!-- <input id="starttime" type="text" class="txt" value="2013-12-10 00:00:00" />(时间格式:2013-11-11 12:34:56) -->
|
||||
<input type="text" id="starttime" class="txt timecheck" name="recordDate" />
|
||||
</td>
|
||||
<!-- </tr>
|
||||
<tr> -->
|
||||
<td class="tt">结束时间</td>
|
||||
<td>
|
||||
<!-- <input id="endtime" type="text" class="txt" value="2013-12-11 23:59:59" /> -->
|
||||
<input type="text" id="endtime" class="txt timecheck" name="recordDate" />
|
||||
<!-- <input type="button" class="btn" value="搜索" onclick="clickRecordSearch(0);" /> -->
|
||||
</td>
|
||||
<!-- <td>
|
||||
<div class='input-group date' id='datetimepicker2'>
|
||||
<input type='text' class="form-control" />
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</td> -->
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td colspan="2">
|
||||
<div id="searchdiv" class="searchdiv">
|
||||
<table id="searchlist" class="searchlist" cellpadding="0" cellspacing="0" border="0"></table>
|
||||
</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<input type="button" class="btn2" value="开始回放" onclick="clickStartPlayback();" />
|
||||
<input type="button" class="btn2" value="停止回放" onclick="clickStopPlayback();" />
|
||||
<!-- <input type="button" class="btn" value="倒放" onclick="clickReversePlayback();" />
|
||||
<input type="button" class="btn" value="单帧" onclick="clickFrame();" />
|
||||
<input id="transstream" type="checkbox" class="vtop" /> 启用转码码流 -->
|
||||
<!-- </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> -->
|
||||
<input type="button" class="btn2" value="暂停" onclick="clickPause();" />
|
||||
<input type="button" class="btn2" value="恢复" onclick="clickResume();" />
|
||||
<input type="button" class="btn2" value="慢放-" onclick="clickPlaySlow();" />
|
||||
<input type="button" class="btn2" value="快放+" onclick="clickPlayFast();" />
|
||||
<input type="button" class="btn2" value="实时预览" onclick="shishi();" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td colspan="2">
|
||||
<input type="button" class="btn" value="抓图" onclick="clickCapturePic();" />
|
||||
<input type="button" class="btn2" value="开始剪辑" onclick="clickStartRecord('playback');" />
|
||||
<input type="button" class="btn2" value="停止剪辑" onclick="clickStopRecord('playback');" />
|
||||
<input type="button" class="btn2" value="OSD时间" onclick="clickGetOSDTime();" /> <input id="osdtime" type="text" class="txt" readonly />
|
||||
</td>
|
||||
</tr> -->
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
551
WebRoot/jsp/work/cameraview_dahua.jsp
Normal file
551
WebRoot/jsp/work/cameraview_dahua.jsp
Normal file
@ -0,0 +1,551 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=6;IE=7; IE=8; IE=EmulateIE7" />
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
</head>
|
||||
<body onUnLoad="StopPlay();LogoutDevice();">
|
||||
<!-- <div >
|
||||
<button id="Login" href="javascript:;"Onclick = "LoginDevice()">Login</button>
|
||||
<button id="Play" href="javascript:;"Onclick = "RealPlay()" style = "display:none;">RealPlay</button>
|
||||
<button id="Stop" href="javascript:;"Onclick = "StopPlay()" style = "display:none;">Stop</button>
|
||||
<button id="OpenIVS" href="javascript:;"Onclick = "OpenIVS()" style = "display:none;">OpenIVS</button>
|
||||
<button id="CloseIVS" href="javascript:;"Onclick = "CloseIVS()" style = "display:none;">CloseIVS</button>
|
||||
<button id="FullScreen" href="javascript:;"Onclick = "FullScreen()" style = "display:none;">FullScreen</button>
|
||||
<button id="LocalPlay" href="javascript:;"Onclick = "LocalPlay()" style = "display:none;">LocalPlay</button>
|
||||
<button id="SnapPicture" href="javascript:;"Onclick = "SnapPicture()" style = "display:none;">SnapPicture</button>
|
||||
<button id="GetAllChannelInfo" href="javascript:;"Onclick = "GetAllChannelInfo()" style = "display:none;">GetAllChannelInfo</button>
|
||||
<button id="Logout" href="javascript:;"Onclick = "LogoutDevice()" style = "display:none;">Logout</button>
|
||||
<button id="control" href="javascript:;" Onclick="control()" style="display:none;">control</button>
|
||||
</div> -->
|
||||
<div id="f_ocx" style="top:60px; left:0; height:400px;">
|
||||
</div>
|
||||
<!-- <div >
|
||||
<div>
|
||||
<button id="idQuery" href="javascript:;"Onclick = "QueryRecord()" style = "display:none;">QueryRecord</button>
|
||||
<button id="QueryFaceImageRecord" href="javascript:;"Onclick = "QueryFaceImageRecord()" style = "display:none;">QueryFaceImageRecord</button>
|
||||
<button id="QueryRecordInfoByTimeEx" href="javascript:;"Onclick = "QueryRecordInfoByTimeEx()" style = "display:none;">QueryRecordInfoByTime</button>
|
||||
<button id="DownloadFaceImageRecord" href="javascript:;"Onclick = "DownloadRecordByFile()" style = "display:none;">DownloadRecordByFile</button>
|
||||
<button id="download" href="javascript:;"Onclick = "DownloadByTime()" style = "display:none;">DownloadByTime</button>
|
||||
</div>
|
||||
<button id="PlayBack" href="javascript:;"Onclick = "PlayBack()" style = "display:none;">Playback</button>
|
||||
<button id="PlayRec" href="javascript:;"Onclick = "PlayRec()" style = "display:none;">PlayRec</button>
|
||||
<button id="PauseRec" href="javascript:;"Onclick = "PauseRec()" style = "display:none;">PauseRec</button>
|
||||
<button id="FastPlay" href="javascript:;"Onclick = "FastPlay()" style = "display:none;">FastPlay</button>
|
||||
<button id="SlowPlay" href="javascript:;"Onclick = "SlowPlay()" style = "display:none;">SlowPlay</button>
|
||||
<button id="SlowPlay" href="javascript:;" Onclick="control()" style="display:none;">control</button>
|
||||
|
||||
</div >
|
||||
<div id="TransEvent" style = "display:none;">
|
||||
<label >TransEvent</label><input type="text" style="width:900px" id="trEvent">
|
||||
</div>
|
||||
<div id="ShowPlayTime" style = "display:none;">
|
||||
<label >now time</label><input type="text" id="playtime">
|
||||
</div>
|
||||
<div id="DwonLoadPos" style = "display:none;">
|
||||
<label >pos</label><input type="text" style="width:900px" id="downPos">
|
||||
</div>
|
||||
<div style="display:none;" id="RecInfo">
|
||||
<div id="RecInfoList" style = "overflow:auto;width:600px;height:200px;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="DwonLoadByTimeInfo" style = "display:none;">
|
||||
<label >DwonLoadByTimeInfo</label><input type="text" style="width:900px" id="DwonLoadInfo">
|
||||
</div> -->
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
$(function(){
|
||||
LoginDevice();
|
||||
setTimeout("RealPlay()",1000)
|
||||
})
|
||||
var Sys = {};
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var s;
|
||||
(s = ua.match(/(msie\s|trident.*rv:)([\d.]+)/)) ? Sys.ie = s[2] :
|
||||
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
|
||||
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
|
||||
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
|
||||
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
|
||||
|
||||
var hasPlugin = checkPlugins();
|
||||
|
||||
var g_ocx; //控件对象,初始化完毕后,可以调用《二次开发使用 WEB32网页调用接口说明.doc》文档中的接口
|
||||
var g_PlayTime;
|
||||
var g_curSpeed = 4; //默认的正常速度
|
||||
var htmlStChn1 = '';
|
||||
var recInfosByFile = [];
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP1:插件初始化/////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//加载插件到网页中去。
|
||||
loadPageOcx();
|
||||
|
||||
/**
|
||||
* 检测浏览器是否存在视频插件
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function checkPlugins() {
|
||||
var PLUGINS_NAME = 'WebActiveEXE.Plugin.1';
|
||||
var result;
|
||||
if (Sys.ie) {
|
||||
try {
|
||||
result = new ActiveXObject(PLUGINS_NAME);
|
||||
delete result;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
navigator.plugins.refresh(false);
|
||||
result = navigator.mimeTypes["application/media-plugin-version-3.1.0.2"];
|
||||
return !!(result && result.enabledPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
function loadPageOcx() {
|
||||
var mainOcxHtml = '';
|
||||
if (Sys.ie) {
|
||||
mainOcxHtml = '<object id="ocx" width="100%" height="100%" classid="CLSID:7F9063B6-E081-49DB-9FEC-D72422F2727F"></object>';
|
||||
} else {
|
||||
mainOcxHtml = '<object id="ocx" width="100%" height="100%" type="application/media-plugin-version-3.1.0.2" VideoWindTextColor="9c9c9c" VideoWindBarColor="414141"></object>';
|
||||
}
|
||||
document.getElementById('f_ocx').innerHTML = mainOcxHtml;
|
||||
//document.getElementById('Login').style.display = '';
|
||||
initPageOcx();
|
||||
}
|
||||
|
||||
/**
|
||||
* [initPageOcx 初始化g_ocx,绑定插件事件;有些信息(录像信息等)会主动调用注册的回调接口]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
function initPageOcx() {
|
||||
g_ocx = document.getElementById('ocx');
|
||||
//控件加载成功后注册需要关注的监听事件
|
||||
//详见《二次开发使用 WEB32网页调用接口说明》章节二:事件
|
||||
|
||||
//TransEvent: 注册这个事件接收控件内部状态
|
||||
//这个非常重要,是按时间查找录像查询的关键;调用本例中QueryRecordInfoByTimeEx()会触发回调
|
||||
g_ocx.AddEventListener('TransEvent', TransEvent);
|
||||
|
||||
//SetNetPlayFileInfo: 注册这个事件接收查询到的录像信息
|
||||
//这个非常重要,是录像查询的关键;调用本例中QueryRecord()会触发回调
|
||||
g_ocx.AddEventListener('SetNetPlayFileInfo', ShowRecInfo);
|
||||
g_ocx.AddEventListener('NetPlayTimeInform', ShowPlayTime);
|
||||
|
||||
//InsertNetRecordFileInfo: 注册这个事件接收查询到的录像信息
|
||||
//这个非常重要,是按时间查找录像查询的关键;调用本例中QueryRecordInfoByTimeEx()会触发回调
|
||||
g_ocx.AddEventListener('InsertNetRecordFileInfo', InsertNetRecordFileInfo);
|
||||
|
||||
//在这里可以隐藏工具栏上的按钮
|
||||
hideToolbarBtns();
|
||||
}
|
||||
|
||||
/**
|
||||
* [hideToolbarBtns 隐藏工具栏按钮]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
function hideToolbarBtns() {
|
||||
//按钮隐藏可以自由选择怎么设置,遵从此协议格式即可
|
||||
//按钮名称有如下几种:{"Fisheye", "ZoomIn", "Record", "CloseVideo", "Snapshot", "Audio"}
|
||||
var str = '{"Protocol":"VideoFuncProtocol","Params":{"Audio":false, "Snapshot": false, "Record": false, "Fisheye":false, "ZoomIn":false}}';
|
||||
g_ocx.ProtocolPluginWithWebCall(str);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP2:登录设备///////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function LoginDevice() {
|
||||
var url='${camera.url}';
|
||||
var arr=url.split(':');
|
||||
var ip =arr[0];
|
||||
var port=37777;
|
||||
if(arr.length>1){
|
||||
port=arr[1];
|
||||
}
|
||||
var bRet = g_ocx.LoginDeviceEx(ip.toString(), parseInt(port), '${camera.username}', '${camera.password}', 0);
|
||||
//登录后,默认四窗口显示。若需要自定义其他窗口数,可以调用g_ocx.SetWinBindedChannel
|
||||
g_ocx.SetWinBindedChannel(1, 0, 0, 0); //这样调用可以切换为单窗口模式,参数意义详见《二次开发使用 WEB32网页调用接口说明.doc》
|
||||
if (bRet == 0) {
|
||||
/* document.getElementById('LocalPlay').style.display = '';
|
||||
document.getElementById('Stop').style.display = '';
|
||||
document.getElementById('FullScreen').style.display = '';
|
||||
document.getElementById('Logout').style.display = '';
|
||||
document.getElementById('idQuery').style.display = '';
|
||||
document.getElementById('Play').style.display = '';
|
||||
document.getElementById('OpenIVS').style.display = '';
|
||||
document.getElementById('CloseIVS').style.display = '';
|
||||
document.getElementById('QueryFaceImageRecord').style.display = '';
|
||||
document.getElementById('QueryRecordInfoByTimeEx').style.display = '';
|
||||
document.getElementById('DownloadFaceImageRecord').style.display = '';
|
||||
document.getElementById('TransEvent').style.display = '';
|
||||
document.getElementById('control').style.display = ''; */
|
||||
//document.getElementById('SnapPicture').style.display = '';
|
||||
//document.getElementById('GetAllChannelInfo').style.display = '';
|
||||
|
||||
//登录成功后可以获取设备通道信息
|
||||
//GetAllChannelInfo();
|
||||
//QueryConnectState();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [GetAllChannelInfo 获取各通道名信息]
|
||||
*/
|
||||
function GetAllChannelInfo() {
|
||||
var data = g_ocx.GetAllChannelInfo();
|
||||
}
|
||||
/**
|
||||
* [QueryConnectState 查询对应通道的IPC是否在线]
|
||||
*/
|
||||
function QueryConnectState() {
|
||||
/*此协议字段说明:
|
||||
Protocol 表示和控件交互的协议名 目前控件支持的交互协议具体见文档,这里的QueryDevCfgInfo表示需要查询设备的配置信息
|
||||
Params 字段表示查询的配置参数:
|
||||
Command 表示向设备查询的配置名称 cameraConnectState 表示前端连接状态
|
||||
Channel 表示查询的通道号
|
||||
*/
|
||||
var strRet = g_ocx.ProtocolPluginWithWebCall('{"Protocol":"QueryDevCfgInfo", "Params":{"Command":"CameraConnectState","Channel":0}}');
|
||||
}
|
||||
|
||||
/**
|
||||
* [LogoutDevice 登出]
|
||||
*/
|
||||
function LogoutDevice() {
|
||||
g_ocx.LogoutDevice();
|
||||
document.getElementById('Login').style.display = '';
|
||||
document.getElementById('PlayBack').style.display = 'none';
|
||||
document.getElementById('LocalPlay').style.display = 'none';
|
||||
document.getElementById('Stop').style.display = 'none';
|
||||
document.getElementById('FullScreen').style.display = 'none';
|
||||
document.getElementById('Play').style.display = 'none';
|
||||
document.getElementById('OpenIVS').style.display = 'none';
|
||||
document.getElementById('CloseIVS').style.display = 'none';
|
||||
document.getElementById('Logout').style.display = 'none';
|
||||
document.getElementById('PlayRec').style.display = 'none';
|
||||
document.getElementById('PauseRec').style.display = 'none';
|
||||
document.getElementById('FastPlay').style.display = 'none';
|
||||
document.getElementById('SlowPlay').style.display = 'none';
|
||||
document.getElementById('ShowPlayTime').style.display = 'none';
|
||||
document.getElementById('TransEvent').style.display = 'none';
|
||||
document.getElementById('DwonLoadPos').style.display = 'none';
|
||||
document.getElementById('RecInfo').style.display = 'none';
|
||||
document.getElementById('SnapPicture').style.display = 'none';
|
||||
document.getElementById('GetAllChannelInfo').style.display = 'none';
|
||||
document.getElementById('idQuery').style.display = 'none';
|
||||
document.getElementById('QueryFaceImageRecord').style.display = 'none';
|
||||
document.getElementById('QueryRecordInfoByTimeEx').style.display = 'none';
|
||||
document.getElementById('DownloadFaceImageRecord').style.display = 'none';
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP3:实时监视///////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function RealPlay() {
|
||||
//首先切换到监视模式
|
||||
// g_ocx.SetModuleMode(1); //监视模式
|
||||
//打开通道视频
|
||||
var channel = '${camera.channel}';
|
||||
g_ocx.ConnectRealVideo(parseInt(channel), 1);
|
||||
/* g_ocx.ConnectRealVideo(8, 1);
|
||||
g_ocx.ConnectRealVideo(9, 1);
|
||||
g_ocx.ConnectRealVideo(10, 1); */
|
||||
// control();
|
||||
}
|
||||
function control()
|
||||
{
|
||||
alert(1);
|
||||
|
||||
g_ocx.ControlPtzEx(nchid, 1, 1, 8, 1, 0);
|
||||
alter(2);
|
||||
|
||||
|
||||
}
|
||||
function StopPlay() { //关闭通道视频
|
||||
g_ocx.DisConnectRealVideo(0);
|
||||
}
|
||||
|
||||
function OpenIVS() {//打开智能
|
||||
g_ocx.SetIVSEnable(true);
|
||||
}
|
||||
|
||||
function CloseIVS() {//关闭智能
|
||||
g_ocx.SetIVSEnable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* [LocalPlay 播放电脑上保存的录像文件]
|
||||
*/
|
||||
function LocalPlay() {
|
||||
g_ocx.QuickOperation(0);
|
||||
}
|
||||
|
||||
function SnapPicture() {
|
||||
g_ocx.SnapPicEx(2, "c:\\test", "123.jpg");
|
||||
}
|
||||
|
||||
function FullScreen() {
|
||||
g_ocx.OnFullScreenClk();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP4:网络回放(直接播放设备上的录像)/////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* [QueryRecord 回放之前先按照这个步骤调用,并查询录像信息;]
|
||||
*/
|
||||
function QueryRecord() {
|
||||
var year = new Date().getFullYear();
|
||||
var month = new Date().getMonth() + 1;
|
||||
var date = new Date().getDate();
|
||||
|
||||
g_ocx.SetModuleMode(4); //回放模式
|
||||
// g_ocx.SetWinBindedChannel(4, 0, 0, 3);
|
||||
|
||||
var chnlArray = '{'+'"channels"'+ ':[0,2,3,4]}';
|
||||
//参数1:窗口分割数;参数2:窗口号; 参数3:通道号数组; 参数4:对应通道3解析的字符串
|
||||
g_ocx.SetWinBindedChannelEx(4, 0, chnlArray, 'channels');
|
||||
|
||||
g_ocx.SwitchMonth(year, month, date);
|
||||
g_ocx.SwitchDay(year, month, date);
|
||||
htmlStChn1 = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* [TransEvent 控件状态事件]
|
||||
* @param {[type]} jsonStr [状态事件信息字符串]
|
||||
*/
|
||||
function TransEvent(jsonStr) {
|
||||
//jsonStr格式:'{"EventName" : "xxx", "EventParam" : { ... }}'
|
||||
//控件内部的一些状态都会通过该回调上报给js,js根据jsonStr中不同的"EventName"字段判断具体事件
|
||||
//如:"EventName"=="QueryItemInfo"时,调用本例中QueryRecordInfoByTimeEx()会触发,表示录像查询时返回的总的录像记录条数信息
|
||||
// { "EventName" : "QueryItemInfo",
|
||||
// "EventParam" : {
|
||||
// "ItemTotal" : 220, //总的录像记录条数
|
||||
// "LastItem" : true } } //true时表示查询结束,false表示查询正在进行中
|
||||
// 录像信息比较多时,会分多次接收该事件,直到 "LastItem" 为true
|
||||
//
|
||||
//"EventName"=="NetPlayState"时,回放模式下切换选中窗口会触发,表示当前窗口的回放状态
|
||||
// {"EventName":"NetPlaySate",
|
||||
// "EventParam":{
|
||||
// "MultiScreeninfo":{"Enable":false,"ShowMode":0}, //4K分屏信息:Enable是否使能,ShowMode显示模式
|
||||
// "channel":2, //通道号
|
||||
// "direction":"normal", //回放方向:normal 正放;backwards倒放
|
||||
// "fisheyeinfo":{"Enable",0}, // 鱼眼信息:Enable是否使能
|
||||
// "isSwitchwin":true, //该值始终为true
|
||||
// "open":false, //是否正在回放
|
||||
// "speed":4, //回放速度
|
||||
// "state":"stop", //回放状况:play播放,pause暂停,stop关闭,speed快进,preFrame前帧,backFrame后帧,backwards倒放
|
||||
// "winID":0}} //当前窗口号
|
||||
//
|
||||
//"EventName"=="ReturnWindInfo"时,监视模式下切换选中窗口会触发,表示当前窗口的监视状态
|
||||
document.getElementById('trEvent').value = jsonStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* [InsertNetRecordFileInfo 接收新的录像信息:由于录像信息比较多,这里会分多次接收]
|
||||
* @param {[type]} nChannel [录像的通道号]
|
||||
* @param {[type]} nEnd [该通道是否查询完毕]
|
||||
* @param {[type]} strRecordInfo [录像信息字符串]
|
||||
*/
|
||||
function InsertNetRecordFileInfo(nChannel, nEnd, strRecordInfo) {
|
||||
//console.log('InsertNetRecordFileInfo')
|
||||
//strRecordInfo格式:2016011120372620160111203741-14-13824-0-00-00-00-19527-00-00:2016011120372620160111203741-14-13824-0-00-00-00-19527-00-00
|
||||
//2016011120372620160111203741-14-13824-0-00-00-00-19527-00-00
|
||||
//录像时间-录像类型-文件大小-文件索引-码流类型-...
|
||||
var htmlRecordInfo = '';
|
||||
var recInfo = [];
|
||||
if (strRecordInfo != '') {
|
||||
recInfo = strRecordInfo.split(':');
|
||||
var num = recInfo.length;
|
||||
for (var i = 0; i < num; i++) {
|
||||
if (recInfo[i] == '') {
|
||||
continue;
|
||||
}
|
||||
htmlRecordInfo += '<li><a id="StChn' + (i) + '">' + 'channel: ' + nChannel + ' info: ' + recInfo[i] + '</a></li>';
|
||||
}
|
||||
|
||||
document.getElementById('RecInfo').style.display = '';
|
||||
document.getElementById('DwonLoadPos').style.display = '';
|
||||
document.getElementById('RecInfoList').innerHTML = htmlRecordInfo;
|
||||
saveRecordFileInfo(recInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [saveRecordFileInfo 保存并处理录像信息]
|
||||
* @param {[type]} recInfo [录像信息字符串]注:这里的字符串格式是收到的录像信息格式,与下载接口所需要的字符串格式不同。详见本函数中的说明
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
function saveRecordFileInfo(recInfo) {
|
||||
var index = 0;
|
||||
for (var i = 0; i < recInfo.length; i++) {
|
||||
var tmpInfo = recInfo[i];
|
||||
if (tmpInfo == '') continue;
|
||||
var recArry = tmpInfo.split('-');
|
||||
//原始的文件结构信息(下载文件结构不同):
|
||||
//2014102216001120141022160011- 04 - 279 - 53 - 00 -01
|
||||
//2013041109102020130411100000-type1-size2-nIndex3-stream4-nRecChannel5-nDriveNo6-nStartCluster7
|
||||
//下载的时候需要传给控件的结构信息:
|
||||
//开始时间结束时间-type-channel-stream-文件大小2- 磁盘3-起始簇号4
|
||||
var infoAttach = recArry[0] + '-' + recArry[1] + '-' + recArry[5] + '-' + recArry[4] + (recArry[6] == undefined ? '' : '-' + recArry[2] + '-' + recArry[6] + '-' + recArry[7]);
|
||||
if (contains(recInfosByFile, infoAttach)) {
|
||||
continue;
|
||||
}
|
||||
recInfosByFile[index] = infoAttach;
|
||||
index++;
|
||||
}
|
||||
//console.log(recInfosByFile)
|
||||
}
|
||||
|
||||
//播放控制
|
||||
function PlayBack() {
|
||||
g_ocx.PlayBackByTime(0, '01:00:00');
|
||||
}
|
||||
function PlayRec() {
|
||||
g_ocx.PlayBack();
|
||||
}
|
||||
function PauseRec() {
|
||||
g_ocx.PausePlayBack();
|
||||
}
|
||||
function FastPlay() {
|
||||
if (g_curSpeed >= 8) { //达到最大速度以后再快放就回到正常速度,客户可以按照自己的意愿来处理此时是否灰显快放按钮
|
||||
g_curSpeed = 4;
|
||||
} else {
|
||||
g_curSpeed++;
|
||||
}
|
||||
ocx.SpeedPlayBack(g_curSpeed);
|
||||
}
|
||||
function SlowPlay() {
|
||||
if (g_curSpeed <= 0) { //达到最小速度以后再慢放就回到正常速度,客户可以按照自己的意愿来处理此时是否灰显快放按钮
|
||||
g_curSpeed = 4;
|
||||
} else {
|
||||
g_curSpeed--;
|
||||
}
|
||||
ocx.SpeedPlayBack(g_curSpeed);
|
||||
}
|
||||
|
||||
//可以得到当前的播放时间, 见g_ocx.AddEventListener('NetPlayTimeInform', ShowPlayTime);
|
||||
function ShowPlayTime(time) {
|
||||
//时间的格式00020018| |是通道分隔符
|
||||
var ar = time.split('|');
|
||||
if (ar[0] == "01010032")
|
||||
{
|
||||
ocx.StopPlayBack();
|
||||
}
|
||||
g_PlayTime = time;
|
||||
document.getElementById('playtime').value = g_PlayTime;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP5:录像下载(直接播放设备上的录像)/////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//查询:按时间查询
|
||||
function QueryRecordInfoByTimeEx() {
|
||||
recInfosByFile = [];
|
||||
//channel:通道号,-1表示查询所有通道
|
||||
//streamType查询码流类型,0主辅码流,1主码流,2辅码流
|
||||
//recType:
|
||||
//RECORD_QUERY = 0, //所有录像文件
|
||||
//ALARM_QUERY = 1, //外部报警
|
||||
//MOTION_QUERY = 2, //动态检测报警
|
||||
//CARD_SEARCH = 4, //卡号查询
|
||||
//CARD_COM_SEARCH = 5, //卡号查询(串口查询)
|
||||
//RECORD_POSITION = 6,
|
||||
//PICTURE_QUERY = 9, //图片查询
|
||||
//CARD_NET_SEARCH = 10, //卡号查询(网络查询)
|
||||
//AUDIO_FILE_SEARCH = 18 //音频文件查询(车载)
|
||||
//13=人脸图片, 14=人脸录像
|
||||
//maxNumber:每页返回的最大信息条数,接口调用后注册回调InsertNetRecordFileInfo会返回第一页数据;
|
||||
//调用ocx.QueryGroupRecordInfo(2)接口进行翻页(2:要切到的页码),InsertNetRecordFileInfo会返回第2页数据
|
||||
|
||||
//通过AddEventListener()注册的事件监听函数TransEvent(strValue)将总的页数信息传给调用者(["EventName"] = "QueryItemInfo")
|
||||
//通过AddEventListener()注册的事件监听函数InsertNetRecordFileInfo(nChannel, bEnd, str)将录像文件信息传给调用者,
|
||||
// 没有满足条件的录像则不触发该监听函数(可通过TransEvent: ["EventName"] = "QueryItemInfo"判断是否有录像)
|
||||
//TransEvent回调见 function TransEvent
|
||||
//InsertNetRecordFileInfo回调见 function InsertNetRecordFileInfo
|
||||
var queryInfo = '{"channel":-1, "streamType":0,"startTime":"2017-6-13 00:00:00","endTime":"2017-6-23 23:59:59","maxNumber":100,"recType":0}'
|
||||
var bRet = ocx.QueryRecordInfoByTimeEx(queryInfo);
|
||||
}
|
||||
function QueryFaceImageRecord() {
|
||||
recInfosByFile = [];
|
||||
// recType: 13=人脸图片, 14=人脸录像
|
||||
var queryInfo = '{"channel":0, "streamType":0,"startTime":"2015-1-10 00:00:00","endTime":"2016-1-15 23:59:59","maxNumber":100,"recType":13}'
|
||||
var bRet = ocx.QueryRecordInfoByTimeEx(queryInfo);
|
||||
}
|
||||
|
||||
//下载:按文件下载 和 按时间下载两种方式
|
||||
function DownloadRecordByFile() {
|
||||
// recInfosByFile
|
||||
if(recInfosByFile.length == 0) {
|
||||
alert('请先点击“QueryRecordInfoByTime”按钮查询录像。');
|
||||
return;
|
||||
}
|
||||
var params = '{"fileList":"' + recInfosByFile.join(':') + '"}';
|
||||
var bRet = ocx.DownloadRecordByFileEx(params, "c:\\test\\", "dav")
|
||||
}
|
||||
function DownloadByTime() {
|
||||
//支持JS自定义保存的录像文件名
|
||||
var str = '{"Protocol":"DownloadByTimeWithFileName","Params":{"ChannelID":1, "BeginTime":"2017-06-13 00:10:00", "EndTime":"2017-06-13 00:18:00", "Path":"C:\/\/RecordFile", "SaveName":"大华二次开发_DHFILE","Format":"dav"}}';
|
||||
g_ocx.ProtocolPluginWithWebCall(str);
|
||||
//按时间保存录像文件,不支持自定义文件名
|
||||
//g_ocx.DownloadRecordByTime(0, '2014-11-04 01:05:00', '2014-11-04 01:18:00', 'C:\\RecordDownload', 'dav');
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//STEP6:公共接口///////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
function contains(arr, obj) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i] == obj) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function Sleep(n) {
|
||||
var start = new Date().getTime();
|
||||
while (true) {
|
||||
if (new Date().getTime() - start > n) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ShowRecInfo(nCh, strRecodInfo) {
|
||||
document.getElementById('PlayBack').style.display = '';
|
||||
document.getElementById('PlayRec').style.display = '';
|
||||
document.getElementById('PauseRec').style.display = '';
|
||||
document.getElementById('FastPlay').style.display = '';
|
||||
document.getElementById('SlowPlay').style.display = '';
|
||||
document.getElementById('download').style.display = '';
|
||||
document.getElementById('RecInfo').style.display = '';
|
||||
document.getElementById('ShowPlayTime').style.display = '';
|
||||
document.getElementById('DwonLoadPos').style.display = '';
|
||||
g_PlayTime = "";
|
||||
var readtime = strRecodInfo.split(':');
|
||||
var num = readtime.length;
|
||||
for (var i = 0; i < num; i++) {
|
||||
if (readtime[i] == '')
|
||||
continue;
|
||||
htmlStChn1 += '<li><a id="StChn' + (i) + '">' + 'channel: ' + nCh + ' info: ' + readtime[i] + '</a></li>';
|
||||
}
|
||||
document.getElementById('RecInfoList').innerHTML = htmlStChn1;
|
||||
}
|
||||
</script>
|
||||
248
WebRoot/jsp/work/channelPortConfigAdd.jsp
Normal file
248
WebRoot/jsp/work/channelPortConfigAdd.jsp
Normal file
@ -0,0 +1,248 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
var filelist = new Array();
|
||||
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function initFileInput(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true,
|
||||
allowedFileExtensions : ['jpg', 'png', 'svg', 'jpeg', 'gif'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: true,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 2, //表示允许同时上传的最大文件个数
|
||||
maxFileSize: 1048576,
|
||||
enctype: 'multipart/form-data',
|
||||
dropZoneEnabled: false ,//是否显示拖拽区域
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) {
|
||||
//var editorText = editor.txt.html();
|
||||
//传参
|
||||
var data = {
|
||||
"masterId": '${id}', //此处自定义传参
|
||||
"tbName": 'tb_doc_file',
|
||||
"nameSpace": 'Document',
|
||||
//"wName":$("#wName").val(),
|
||||
//"wContent": editorText
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
//actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
slugCallback: function (data,data2) {
|
||||
console.log(data2);
|
||||
return data;
|
||||
},
|
||||
});
|
||||
/* control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
$(this).fileinput("upload");
|
||||
}); */
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(!data.response.pdf) {
|
||||
closeModal('fileInputModal');
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
showAlert('d','上传的文件转换为预览PDF格式失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/channelPortConfig/doSave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
control.fileinput("upload");
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '用户名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// processid: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '请选择工艺段'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择状态'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var getProcessList = function() {
|
||||
$.post(ext.contextPath + "/user/processSection/getSelectList.do", {}, function (data) {
|
||||
$("#processsectionCode").empty();
|
||||
var selelct_ = $("#processsectionCode").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#processid').val(e.target.value);
|
||||
})
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
//获取巡检区域
|
||||
var selectAreaFun = function () {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
|
||||
|
||||
}, function (data) {
|
||||
$("#areaSubDiv").html(data);
|
||||
openModal('areaSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$("#unitid").val(unitId)
|
||||
getProcessList();
|
||||
initFileInput("filelist",ext.contextPath+ "/document/inputFile.do");
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增出入口配置</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="unitid" name="unitid">
|
||||
<input type="hidden" id="id" name="id" value="${id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="请输入">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="type" class="form-control pull-right" name="type" >
|
||||
<option value="1" selected>安全出入口</option>
|
||||
<option value="2">出入口</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="status" class="form-control pull-right" name="status" >
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="sort" name="sort" class="form-control pull-right" oninput="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">工艺段</label>--%>
|
||||
<%-- <div class="col-sm-10">--%>
|
||||
<%-- <select class="form-control select2" id="processsectionCode" name="processsectionCode"></select>--%>
|
||||
<%-- <input type="hidden" class="form-control" id="processid" name="processid" value=""/>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所在地址</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="areaName" name="areaName"
|
||||
onclick="selectAreaFun()" placeholder="点击选择">
|
||||
<input type="hidden" class="form-control" id="address" name="address">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">出入口描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea maxlength="200" class="form-control " id="describe" name="describe" rows="2" placeholder="出入口描述"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">图片坐标</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="remarks" name="remarks" class="form-control pull-right" value="${channelPortConfig.remarks}">
|
||||
<%--<textarea maxlength="200" class="form-control " id="remarks" name="remarks" rows="2" placeholder="备注"></textarea>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-2 control-label">上传图片</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
317
WebRoot/jsp/work/channelPortConfigEdit.jsp
Normal file
317
WebRoot/jsp/work/channelPortConfigEdit.jsp
Normal file
@ -0,0 +1,317 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var filelist = new Array();
|
||||
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var tbName = 'tb_doc_file';
|
||||
|
||||
function showFileInput(ctrlName) {
|
||||
control = $('#' + ctrlName);
|
||||
|
||||
//control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: ext.contextPath+ "/document/inputFile.do", //上传的地址
|
||||
uploadAsync: true,
|
||||
allowedFileExtensions : ['jpg', 'png', 'svg', 'jpeg', 'gif'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: true,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 2, //表示允许同时上传的最大文件个数
|
||||
maxFileSize: 1048576,
|
||||
enctype: 'multipart/form-data',
|
||||
dropZoneEnabled: false ,//是否显示拖拽区域
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
overwriteInitial: false,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
|
||||
uploadExtraData:function (previewId, index) {
|
||||
//传参
|
||||
var data = {
|
||||
"masterId": '${channelPortConfig.id}', //此处自定义传参
|
||||
"tbName": 'tb_doc_file',
|
||||
"nameSpace": 'Document',
|
||||
};
|
||||
return data;
|
||||
},
|
||||
//设置缩略图上的按钮,为空不显示,默认显示
|
||||
layoutTemplates:{
|
||||
//actionDelete:'',
|
||||
actionUpload:''
|
||||
},
|
||||
slugCallback: function (data,data2) {
|
||||
console.log(data2);
|
||||
return data;
|
||||
},
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on('filezoomhide', function (event, params) {
|
||||
//关闭预览模态框后清空内部,防止音视频继续播放
|
||||
$(params.modal).find('.kv-zoom-body').empty();
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
closeModal('fileInputEditModal');
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
}
|
||||
if(!data.response.pdf) {
|
||||
closeModal('fileInputModal');
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
showAlert('d','上传的文件转换为预览PDF格式失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileListById.do', {
|
||||
id: '${channelPortConfig.id}',
|
||||
masterId: '${channelPortConfig.id}',
|
||||
tbName: tbName
|
||||
}, function (data) {
|
||||
//console.info(data)
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '2500px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
if (data[i].type.split("/")[0] == 'application') {
|
||||
previewConfig['type'] = 'pdf';
|
||||
} else {
|
||||
previewConfig['type'] = data[i].type.split("/")[0];
|
||||
}
|
||||
previewConfig['size'] = data[i].size;
|
||||
previewConfig['filetype'] = data[i].type;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
}
|
||||
|
||||
showFileInput("filelist");
|
||||
/*else {
|
||||
$('#filelist').hide();
|
||||
}*/
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/channelPortConfig/doUpdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.result == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
control.fileinput("upload");
|
||||
}else if(data.result == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '用户名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
// processid: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '请选择工艺段'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
status: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请选择状态'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var getProcessList = function() {
|
||||
$.post(ext.contextPath + "/user/processSection/getSelectList.do", {}, function (data) {
|
||||
$("#processsectionCode").empty();
|
||||
var selelct_ = $("#processsectionCode").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${channelPortConfig.processid}').trigger("change");
|
||||
selelct_.on('change', function (e) {
|
||||
$('#processid').val(e.target.value);
|
||||
})
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
//获取巡检区域
|
||||
var selectAreaFun = function () {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
|
||||
|
||||
}, function (data) {
|
||||
$("#areaSubDiv").html(data);
|
||||
openModal('areaSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$("#unitid").val(unitId)
|
||||
getFileList();
|
||||
getProcessList();
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑出入口配置</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="unitid" name="unitid">
|
||||
<input type="hidden" id="id" name="id" value="${channelPortConfig.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" value="${channelPortConfig.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="type" class="form-control pull-right" name="type" >
|
||||
<option value="1" <c:if test="${channelPortConfig.type=='1'}">selected</c:if>>安全出入口</option>
|
||||
<option value="2" <c:if test="${channelPortConfig.type=='2'}">selected</c:if>>出入口</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="status" class="form-control pull-right" name="status" >
|
||||
<option value="1" <c:if test="${channelPortConfig.status=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${channelPortConfig.status=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="sort" name="sort" class="form-control pull-right" oninput="value=value.replace(/[^\d]/g,'')" value="${channelPortConfig.sort}">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">工艺段</label>--%>
|
||||
<%-- <div class="col-sm-10">--%>
|
||||
<%-- <select class="form-control select2" id="processsectionCode" name="processsectionCode"></select>--%>
|
||||
<%-- <input type="hidden" class="form-control" id="processid" name="processid" value="${channelPortConfig.processid}"/>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所在地址</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="areaName" name="areaName" value="${channelPortConfig.area.name}"
|
||||
onclick="selectAreaFun()" placeholder="点击选择">
|
||||
<input type="hidden" class="form-control" id="address" name="address" value="${channelPortConfig.area.id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">出入口描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea maxlength="200" class="form-control " id="describe" name="describe" rows="2" placeholder="出入口描述">${channelPortConfig.describe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">图片坐标</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="channelPortConfigPic" name="remarks" class="form-control pull-right" value="${channelPortConfig.remarks}" onclick="channelPortConfigPicDiv()">
|
||||
<%--<textarea maxlength="200" class="form-control " id="remarks" name="remarks" rows="2" placeholder="备注">${channelPortConfig.remarks}</textarea>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-2 control-label">上传图片</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
470
WebRoot/jsp/work/channelPortConfigList.jsp
Normal file
470
WebRoot/jsp/work/channelPortConfigList.jsp
Normal file
@ -0,0 +1,470 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title>
|
||||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<style>
|
||||
#tv {
|
||||
border: 1px solid #D6D6D6;
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
width: 300px;
|
||||
height: 400px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css" />
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ztree/css/metroStyle/metroStyle.css" rel="stylesheet"
|
||||
type="text/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" src="<%=request.getContextPath()%>/node_modules/ztree/js/jquery.ztree.all.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var getProcessList = function() {
|
||||
$.post(ext.contextPath + "/user/processSection/getSelectList.do", {}, function (data) {
|
||||
$("#processSelect").empty();
|
||||
var selelct_ = $("#processSelect").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/work/channelPortConfig/doAdd.do', {}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/channelPortConfig/doEdit.do', {
|
||||
id: id
|
||||
}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/channelPortConfig/doView.do', {
|
||||
id: id
|
||||
}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/channelPortConfig/dodel.do', {id : id}, function(data) {
|
||||
if(data.code=="1"){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
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/channelPortConfig/deletes.do', {ids:datas} , function(data) {
|
||||
if(data.code>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var refreshTable = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function() {
|
||||
treeView();
|
||||
getProcessList();
|
||||
|
||||
$("#risklevelForSelect").on("change", function (e) {
|
||||
refreshTable();
|
||||
});
|
||||
$("#type").on("change", function (e) {
|
||||
refreshTable();
|
||||
});
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/channelPortConfig/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
checkboxHeader: true,
|
||||
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(),
|
||||
type: $('#types').val(),
|
||||
processSelect: $('#processSelect').val(),
|
||||
areaId:$('#areaId').val()
|
||||
/*search_warehouseinfor: $('#search_warehouseinfor').val(),*/
|
||||
/*search_shelf: $('#search_shelf').val(),*/
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
// {
|
||||
// title : '序号',
|
||||
// align: "center",
|
||||
// valign: 'middle',
|
||||
// width: 40,
|
||||
// formatter: function (value, row, index) {
|
||||
// //获取每页显示的数量
|
||||
// var pageSize=$('#table').bootstrapTable('getOptions').pageSize;
|
||||
// //获取当前是第几页
|
||||
// var pageNumber=$('#table').bootstrapTable('getOptions').pageNumber;
|
||||
// //返回序号,注意index是从0开始的,所以要加上1
|
||||
// return pageSize * (pageNumber - 1) + index + 1;
|
||||
// }
|
||||
//
|
||||
// },
|
||||
{
|
||||
width: 100,
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
width: 100,
|
||||
field: 'address', // 返回json数据中的name
|
||||
title: '所在地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
width: 100,
|
||||
field: 'type', // 返回json数据中的shelfclass
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '2':
|
||||
return '出入口';
|
||||
case '1':
|
||||
return '安全出入口';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
width: '200',
|
||||
field: 'describe', // 返回json数据中的shelfclass
|
||||
title: '出入口描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'status', // 返回json数据中的shelfclass
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case true:
|
||||
return '启用';
|
||||
case false:
|
||||
return '禁用';
|
||||
default:
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function(value, row, index) {
|
||||
var buts = "";
|
||||
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+='<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\''+row.id+'\')"><i class="fa fa fa-photo"></i><span class="hidden-md hidden-lg">查看</span></button>';
|
||||
// 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+='<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='<div class="btn-group" >'+buts+'</div>';
|
||||
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function() { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function() { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
function treeView () {
|
||||
var nodeData = [];
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/work/areaManage/getAreaManageJson.do',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
nodeData = data;
|
||||
}
|
||||
})
|
||||
|
||||
$('#tv').treeview({
|
||||
data: nodeData, // 节点数据
|
||||
levels: 1, // 节点层级数
|
||||
color: "#000", // 每一级通用的 节点字体颜色
|
||||
backColor: "#fff", // 每一级通用的 节点字背景色
|
||||
onhoverColor: "skyblue", // 选中浮动颜色
|
||||
showBorder: false, // 不显示边框
|
||||
showTags: true, // 是否在每个节点的右侧显示标签。 其值必须在每个节点的数据结构中提供
|
||||
highlightSelected: true, // 是否突出显示选定的节点
|
||||
selectedColor: "#fff", // 设置选定节点的前景色
|
||||
selectedBackColor: "skyblue", // 设置选定节点的背景色
|
||||
onNodeSelected: function (event, data) {
|
||||
$('#sname').val(data.text);
|
||||
$('#areaId').val(data.id);
|
||||
$('#tv').hide();
|
||||
}
|
||||
})
|
||||
|
||||
$('#sname').click(function () {
|
||||
$('#tv').show();
|
||||
})
|
||||
|
||||
if ('${param.selectId}' != '') {
|
||||
var node = $('#tv').treeview('findNodes', ['${param.selectId}', 'id']);
|
||||
$('#tv').treeview('selectNode', [node[0], { silent: true }]);
|
||||
$("#areaId").val(node[0].id);
|
||||
$("#sname").val(node[0].text);
|
||||
}
|
||||
|
||||
$("#wrap-clear").click(function(){
|
||||
$("#areaId").val("");
|
||||
$("#sname").val("");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 画面坐标
|
||||
var channelPortConfigPicDiv = function() {
|
||||
var processid = $("#address").val();
|
||||
$.post(ext.contextPath + '/work/channelPortConfig/getCoordinate4ChannelPort.do', {
|
||||
processid: processid,
|
||||
}, function (data) {
|
||||
$("#channelPortConfigPicDiv").html(data);
|
||||
openModal('channelPortConfigPicModal');
|
||||
});
|
||||
};
|
||||
|
||||
var delName = function () {
|
||||
$('#areaId').val("")
|
||||
$('#sname').val("")
|
||||
};
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
||||
<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="subDivDetail"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="areaSubDiv"></div>
|
||||
<div id="channelPortConfigPicDiv"></div>
|
||||
<div style="float: left;width: 100%">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;float: left;">
|
||||
<security:authorize buttonUrl="maintenance/addProblem.do">
|
||||
<button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa fa-trash-o"></i> 删除</button>
|
||||
|
||||
<!-- <button type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button> -->
|
||||
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<label class="form-label pull-left" style="margin-top: 5px">区域:</label>
|
||||
<input type="text" id="sname" name="sname" class="form-control pull-left"
|
||||
style="height:34px;" autocomplete="off" readonly="true" placeholder="请选择" />
|
||||
<button class="btn btn-default" style="height:34px;" onclick="delName();"><i
|
||||
class="fa fa-close"></i></button>
|
||||
<input type="hidden" id="areaId" name="areaId"/>
|
||||
<div id="tv"></div>
|
||||
<label class="form-label">类型:</label>
|
||||
<select type="text" id="types" class="form-control select2 " name="type" style="height: 30px">
|
||||
<option value="" selected>全部</option>
|
||||
<option value="1">安全出入口</option>
|
||||
<option value="2">出入口</option>
|
||||
</select>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
style="height: 30px"
|
||||
placeholder="出入口名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group pull-right form-inline hidden-xs">--%>
|
||||
<%-- <div class="form-group " style="padding:0;">--%>
|
||||
<%-- <div class="form-group pull-right">--%>
|
||||
<%-- <div class="input-group input-group-sm" style="width: 250px;">--%>
|
||||
<%-- <input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="出入口名称">--%>
|
||||
<%-- <div class="input-group-btn">--%>
|
||||
<%-- <button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<%-- <div class="input-group input-group-sm pull-right" style="width: 250px; padding-left: 5px">--%>
|
||||
<%-- <div class="input-group input-group-sm " style="width: 250px;">--%>
|
||||
<%-- <label class="form-label" style="float: left;line-height: 2;">类型:</label>--%>
|
||||
<%-- <select type="text" id="type" class="form-control pull-right" name="type">--%>
|
||||
<%-- <option value="1" selected="">安全出入口</option>--%>
|
||||
<%-- <option value="2">出入口</option>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<table id="table" style="width: 100%;word-break:break-all"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
77
WebRoot/jsp/work/channelPortConfigModal.jsp
Normal file
77
WebRoot/jsp/work/channelPortConfigModal.jsp
Normal file
@ -0,0 +1,77 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<!-- 引入viewer.js-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/viewer-js/viewer.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/viewer-js/viewer.min.js"
|
||||
charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.viewer{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 470px;
|
||||
}
|
||||
.viewer>li{
|
||||
overflow: hidden;
|
||||
width: calc(100% / 2);
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
padding: 0 1px;
|
||||
}
|
||||
.viewer>li>img{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var tbName = 'tb_doc_file';
|
||||
$(function(){
|
||||
$('#viewer').empty();
|
||||
var viewer = null;
|
||||
$.post(ext.contextPath + '/base/getInputFileListById.do', {
|
||||
id: '${channelPortConfig.id}',
|
||||
masterId: '${channelPortConfig.id}',
|
||||
tbName: tbName
|
||||
}, function (data) {
|
||||
if (data.length > 0) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
let str = '<li><img src="'+path+'" alt="'+data[i].filename+'"></li>';
|
||||
$('#viewer').append(str);
|
||||
}
|
||||
if (viewer) {
|
||||
viewer.destroy();
|
||||
}
|
||||
viewer = new Viewer(document.getElementById('viewer'), {
|
||||
url: 'data-original',
|
||||
fullscreen: false,
|
||||
});
|
||||
}
|
||||
}, 'json');
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="imgModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">${channelPortConfig.name}(${channelPortConfig.area.name})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>${channelPortConfig.describe}</p>
|
||||
<%--<p>${channelPortConfig.remarks}</p>--%>
|
||||
|
||||
<!-- 多张图片 -->
|
||||
<ul id="viewer" class="viewer">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
158
WebRoot/jsp/work/channelPortConfigView.jsp
Normal file
158
WebRoot/jsp/work/channelPortConfigView.jsp
Normal file
@ -0,0 +1,158 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var filelist = new Array();
|
||||
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var tbName = 'tb_doc_file';
|
||||
|
||||
function showFileInput(ctrlName) {
|
||||
control = $('#' + ctrlName);
|
||||
|
||||
//control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx', 'wmv', 'mp4'],
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: false,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false,
|
||||
showDownload: true, // 显示下载按钮 (这个也很重要)
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
previewFileIconSettings: {
|
||||
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
|
||||
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
|
||||
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
|
||||
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
|
||||
'zip': '<i class="fa fa-file-zip-o" ></i>',
|
||||
},
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
layoutTemplates: {
|
||||
actionDelete: '', //这行可以隐藏删除按钮
|
||||
actionUpload: '' //这行可以隐藏上传按钮
|
||||
}
|
||||
});
|
||||
control.on('filezoomhide', function (event, params) {
|
||||
//关闭预览模态框后清空内部,防止音视频继续播放
|
||||
$(params.modal).find('.kv-zoom-body').empty();
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.suc) {
|
||||
closeModal('fileInputEditModal');
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
}
|
||||
if(!data.response.pdf) {
|
||||
closeModal('fileInputModal');
|
||||
$("#fileTable").bootstrapTable('refresh');
|
||||
showAlert('d','上传的文件转换为预览PDF格式失败!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//名称定义不可修改
|
||||
var getFileList = function () {
|
||||
$.post(ext.contextPath + '/base/getInputFileListById.do', {
|
||||
id: '${channelPortConfig.id}',
|
||||
masterId: '${channelPortConfig.id}',
|
||||
tbName: tbName
|
||||
}, function (data) {
|
||||
//console.info(data)
|
||||
if (data.length > 0) {
|
||||
previews = new Array();
|
||||
$('#maintenancefile').show();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
||||
;
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '2500px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
if (data[i].type.split("/")[0] == 'application') {
|
||||
previewConfig['type'] = 'pdf';
|
||||
} else {
|
||||
previewConfig['type'] = data[i].type.split("/")[0];
|
||||
}
|
||||
previewConfig['size'] = data[i].size;
|
||||
previewConfig['filetype'] = data[i].type;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
}
|
||||
|
||||
showFileInput("filelist");
|
||||
/*else {
|
||||
$('#filelist').hide();
|
||||
}*/
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$("#unitid").val(unitId)
|
||||
getFileList();
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">查看图片</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" id="unitid" name="unitid">
|
||||
<input type="hidden" id="id" name="id" value="${channelPortConfig.id}">
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-2 control-label">图片</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<%-- <button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
289
WebRoot/jsp/work/clientTasks.jsp
Normal file
289
WebRoot/jsp/work/clientTasks.jsp
Normal file
@ -0,0 +1,289 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
|
||||
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
||||
|
||||
<%request.setAttribute("resp_pass",CommString.Resp_Success);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var districtwork = function(planid,workorderid,processid){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '任务调度',
|
||||
url : ext.contextPath + '/work/workorder/districtwork.do?planid='+planid+'&workorderid='+workorderid+'&processid='+processid,
|
||||
width:1000,
|
||||
height:500,
|
||||
onClose:function(){
|
||||
var res=dialog.find('iframe').get(0).contentWindow.returnVal;
|
||||
if(res=="refresh"){
|
||||
$('#grid').datagrid("reload");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getClientTasks.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
|
||||
function onchangedate(){
|
||||
var date=$("#nowdate").val();
|
||||
loadworkorders(date);
|
||||
}
|
||||
function loadProcedures(){
|
||||
$("#procedureno").combobox({
|
||||
url : ext.contextPath + '/process/taskprocedure/getAllProcedurelist4Select.do',
|
||||
valueField : 'procedurecode',
|
||||
textField : 'procedurename',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess: function(record){
|
||||
if($("#procedureno").combobox('getData').length>0){
|
||||
var procedure=getCookie("wo_procedure");
|
||||
$("#procedureno").combobox('select',procedure);
|
||||
}
|
||||
},
|
||||
onSelect: function () {
|
||||
delCookie("wo_procedure");
|
||||
setCookie("wo_procedure",$("#procedureno").combobox('getValue'));
|
||||
searchgrid();
|
||||
}
|
||||
});
|
||||
}
|
||||
//开工
|
||||
var dostart = function(id) {
|
||||
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {id : id,status:'${Flag_Start}'}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','开工成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','开工失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
//报工
|
||||
var doreport=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单报工',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_Report}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//查看工单
|
||||
var doview=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看工单',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_view.do?taskcode='+taskcode+'&workorderno='+workorderno,
|
||||
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
loadProcedures();
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getClientTasks.do?'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '180', title : '工单编号', field : '_taskName', halign:'center', formatter : function(value, row){
|
||||
return row.workOrder.workorderno;
|
||||
}
|
||||
},
|
||||
{width : '80', title : '计划良率', field : 'preyield', halign:'center'},
|
||||
{width : '80', title : '实际良率', field : 'actyield', halign:'center'},
|
||||
{width : '80', title : '计划产量', field : 'preamount', halign:'center'},
|
||||
{width : '80', title : '实际产量', field : 'actamount', halign:'center'},
|
||||
{width : '180', title : '良率未达标原因', field : 'yieldreason', halign:'center', align:'center'},
|
||||
{width : '180', title : '产量未达标原因', field : 'amountreason', halign:'center', align:'center'},
|
||||
{width : '100', title : '工单状态', field : 'status', align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case '${Flag_Start}': return "已开工";
|
||||
case '${Flag_Report}': return "已报工";
|
||||
case '${Flag_CarryOver}': return "已结转";
|
||||
default:return "待开工";
|
||||
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '130', title : '操作', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="doview(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
if(row.status=='${Flag_Start}'){
|
||||
str += '<img class="iconImg ext-icon-table_row_insert" title="报工" onclick="doreport(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
}else if(row.status=='${Flag_Report}'){
|
||||
str += '<img class="iconImg ext-icon-table_relationship" title="结转" onclick="docarryover(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
}else if(row.status!='${Flag_CarryOver}'){
|
||||
str += '<img class="iconImg ext-icon-table_go" title="开工" onclick="dostart(\''+row.id+'\');"/> ';
|
||||
}
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
//写cookies
|
||||
function setCookie(name,value) {
|
||||
var Days = 365;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + Days*24*60*60*1000);
|
||||
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
|
||||
//读取cookies
|
||||
function getCookie(name) {
|
||||
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
|
||||
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
|
||||
else return null;
|
||||
}
|
||||
|
||||
//删除cookies
|
||||
function delCookie(name) {
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() - 1*24*60*60*1000);
|
||||
var cval=getCookie(name);
|
||||
if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%-- <%if (sessionManager.havePermission(session,"work/workorder/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workorder/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%> --%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td><input id="dt" name="dt" type="hidden" value="${dt }" ></td>
|
||||
<td>工序</td>
|
||||
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 180px;" panelMaxHeight="400px" data-options="panelHeight:'auto'" value=""/></td>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchgrid();">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');searchgrid();">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
65
WebRoot/jsp/work/demoAdd.jsp
Normal file
65
WebRoot/jsp/work/demoAdd.jsp
Normal file
@ -0,0 +1,65 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/group/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '用户名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" >
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
69
WebRoot/jsp/work/demoEdit.jsp
Normal file
69
WebRoot/jsp/work/demoEdit.jsp
Normal file
@ -0,0 +1,69 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doupdate() {
|
||||
/* $("#baseForm").validate({
|
||||
rules: {
|
||||
name: "required"
|
||||
},
|
||||
messages: {
|
||||
name: "请输入用户名"
|
||||
},
|
||||
// 校验全部通过
|
||||
submitHandler: function () {
|
||||
alert("校验全部通过!")
|
||||
$.post(ext.contextPath + "/work/group/save.do", $("#baseForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
alert("保存成功")
|
||||
}else if(data.res == 0){
|
||||
alert("保存失败")
|
||||
}else{
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}); */
|
||||
$.post(ext.contextPath + "/work/group/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$(".modal").modal("hide");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input id ="id" name="id" type="hidden" value="${group.id}"/>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${group.name}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
260
WebRoot/jsp/work/demolist.jsp
Normal file
260
WebRoot/jsp/work/demolist.jsp
Normal file
@ -0,0 +1,260 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/work/group/add.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/group/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/group/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var init = function() {
|
||||
$.post(ext.contextPath + '/work/group/getListForSelect.do', {} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
for(var i=0;i<data.length;i++){
|
||||
console.info(data)
|
||||
$("#search_code").append("<option value='"+data[i].id+"'>"+data[i].text+"</option>");
|
||||
}
|
||||
/* $("#search_code").select2({
|
||||
placeholder: "请选择班组",
|
||||
language: "zh-CN",
|
||||
allowClear: true,
|
||||
data: data
|
||||
}); */
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function() {
|
||||
//init();
|
||||
$("#search_code").select2({
|
||||
ajax: {
|
||||
type:'POST',
|
||||
url: ext.contextPath +"/work/group/getListForSelect.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
}
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
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'})
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/group/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()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return '<button class="btn btn-default btn-sm" onclick="editFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div >
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="plan/dailyplan/add.do">
|
||||
<button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</security:authorize>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
<button type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<label class="form-label">班组</label>
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
67
WebRoot/jsp/work/demolist2.jsp
Normal file
67
WebRoot/jsp/work/demolist2.jsp
Normal file
@ -0,0 +1,67 @@
|
||||
<%@ 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"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/user/showMenuListByCu.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#tree').treeview({data: data,
|
||||
showCheckbox: true,
|
||||
hierarchicalCheck:true,//级联勾选
|
||||
state: {
|
||||
checked: true,
|
||||
// disabled: true,
|
||||
expanded: true,
|
||||
// selected: true
|
||||
}
|
||||
});
|
||||
/* $('#tree').on('nodeSelected', function(event, data) {
|
||||
// 事件代码...
|
||||
alert(data.text);
|
||||
}); */
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
|
||||
</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>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="tree"></div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
215
WebRoot/jsp/work/districtmaterial.jsp
Normal file
215
WebRoot/jsp/work/districtmaterial.jsp
Normal file
@ -0,0 +1,215 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '添加物料',
|
||||
url : ext.contextPath + '/process/realDetailsMaterial/add.do?processrealdetailid=${param.processrealdetailid}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '编辑物料',
|
||||
url : ext.contextPath + '/process/realDetailsMaterial/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var amounts="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.materialid+",";
|
||||
if(item.amount==null || item.amount==""){
|
||||
amounts+="0,";
|
||||
}else{
|
||||
var editor = $('#grid').datagrid('getEditor', {index:index,field:"amount"});
|
||||
if(editor!=null&&editor!=undefined){
|
||||
var editAmount = editor.target.val();
|
||||
amounts+=editAmount+",";
|
||||
}else{
|
||||
amounts+=item.amount+",";
|
||||
}
|
||||
}
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择物料','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskMaterial/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',amounts:amounts,workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetailsMaterial/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetailsMaterial/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workTaskMaterial/getlist.do?processrealdetailid=${param.processrealdetailid}&taskid=${param.taskid}&workstationid=${param.workstationid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '物料编码', field : 'materialcode', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.materialinfo.materialcode;
|
||||
}},
|
||||
{width : '150', title : '物料名称', field : 'materialname', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.materialinfo.materialname;
|
||||
}},
|
||||
{width : '150', title : '物料规格', field : 'materialspec', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.materialinfo.spec;
|
||||
}},
|
||||
{width : '150', title : '数量', field : 'amount', sortable : false, halign:'center',
|
||||
editor:{type:'numberbox',options:{precision:1 }}
|
||||
}
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
if (field != "amount" )
|
||||
{
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
//alert("行号:"+rowIndex);
|
||||
editIndex = rowIndex;
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'amount' });
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined)
|
||||
{ return true; }
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'amount' });
|
||||
var number = $(ed.target).numberbox('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['amount'] = number;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workTaskMaterial/save.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="dosave();">分配</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
146
WebRoot/jsp/work/districtwork.jsp
Normal file
146
WebRoot/jsp/work/districtwork.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var realid=checkedItems[0].processRealid;
|
||||
var realdetailid=checkedItems[0].processRealdetailid;
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.workstationid+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请选择工位','info');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/work/worktaskworkstation/save.do', {ids:datas,taskid:'${param.taskid}',processrealid:realid,processrealdetailid:realdetailid} , function(data) {
|
||||
if(data.res==1){
|
||||
top.$.messager.alert('提示','保存成功','info',function(){
|
||||
grid.datagrid('selectRecord',grid.datagrid('getSelected'));
|
||||
returnVal=data.refresh;
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
};
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getlist_detail.do?planid=${planid}&processid=${processid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', field:'name',title:'工序名称',halign:'center'},
|
||||
{width : '100', field:'id',title:'工序编码',halign:'center'},
|
||||
{width : '60', field:'preamount',title:'计划产量',halign:'center',formatter:function(value,row){
|
||||
return row.dailyPlanTaskDemand.preamount;
|
||||
}},
|
||||
{width : '60', field:'preyield',title:'良率',halign:'center',formatter:function(value,row){
|
||||
return row.dailyPlanTaskDemand.preyield;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
|
||||
//$("#name_search").combobox("select",data.lineid);
|
||||
},
|
||||
onSelect:function(index,row){
|
||||
showdetailsFun('${workorderid}','${processid}',row.id);
|
||||
}
|
||||
});
|
||||
|
||||
/* $("#name_search").combobox({
|
||||
url : ext.contextPath + '/process/real/getLineListByRealid.do?realid=${workorder.processrealid}&random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto'
|
||||
}); */
|
||||
});
|
||||
|
||||
var showdetailsFun = function(workorderid,processid,taskid) {
|
||||
//$("#rightFrameScheduling").attr("src",ext.contextPath+"/work/workscheduling/showlist.do?processrealdetailid="+id+"&taskid="+taskid+"&workstationid="+workstationid);
|
||||
$("#rightFrameEquipment").attr("src",ext.contextPath+"/work/workorder/showdistrictwork_equ.do?workorderid="+workorderid+"&processid="+processid+"&taskid="+taskid);
|
||||
$("#rightFrameScheduling").attr("src",ext.contextPath+"/work/workorder/showdistrictwork_group.do?workorderid="+workorderid+"&processid="+processid+"&taskid="+taskid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="maindiv" class="easyui-layout" data-options="fit:true">
|
||||
<div id="leftdiv" data-options="region:'west',split:true" title="按工序分配 " style="width:400px;padding:0;">
|
||||
<!-- <table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>工序</td>
|
||||
<td><input id="name_search" name="name_search" class="easyui-combobox"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table> -->
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center'">
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true">
|
||||
|
||||
<div title="相关设备">
|
||||
<iframe id="rightFrameEquipment" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="排班管理">
|
||||
<iframe id="rightFrameScheduling" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<!-- <div title="相关物料">
|
||||
<iframe id="rightFrameMaterial" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
215
WebRoot/jsp/work/districtwork_equ.jsp
Normal file
215
WebRoot/jsp/work/districtwork_equ.jsp
Normal file
@ -0,0 +1,215 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function selectEquipment(){
|
||||
//alert('${requestScope.plandate}')
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width : 850,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/showEquipCardForDistrictWork.do?plandate=${requestScope.plandate}&workorderid=${workorderid}&processid=${processid}&taskid=${taskid}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/save_task_equ.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}',arrangementdate:'${requestScope.plandate}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width : 850,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipCardForDistrictWork.do?plandate=${requestScope.plandate}&workorderid=${workorderid}&processid=${processid}&taskid=${taskid}&equipmentid='+id,
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.updateFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/update_task_equ.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}',arrangementdate:'${requestScope.plandate}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=',';
|
||||
}
|
||||
datas+="'"+item.id+"'";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes_task_equ.do', {ids:datas,workorderid:'${workorderid}',taskid:'${taskid}',arrangementdate:'${requestScope.plandate}'} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.equipmentid+",";
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择设备','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskEquipment/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
$.each(arrangement, function(index, item){
|
||||
if(str !=""){
|
||||
str+="\n";
|
||||
}
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
fit: true,
|
||||
url : ext.contextPath + '/work/workorder/getlist_detail_equ.do?workorderid=${workorderid}&processid=${processid}&taskid=${taskid}&plandate=${requestScope.plandate}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
nowrap:false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '设备编码', field : 'equipmentcardid', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
}},
|
||||
{width : '150', title : '设备名称', field : 'equipmentname', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.equipmentCard.equipmentname;
|
||||
}},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentCard.equipmentArrangements);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.equipmentCard.id+'\');"/> ';
|
||||
<%}%>
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
$("#capacity").html(data.statistic);
|
||||
grid.datagrid('resize',{
|
||||
height:($(window).height())
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body data-options="fit:true,border:false">
|
||||
<table id="toolbar" style="width:100%" data-options="fit:true">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workTaskEquipment/save.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" style="width:68px;"
|
||||
onclick="selectEquipment();">添加</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td >
|
||||
<span id ='capacity'></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="region:'center',fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
216
WebRoot/jsp/work/districtwork_group.jsp
Normal file
216
WebRoot/jsp/work/districtwork_group.jsp
Normal file
@ -0,0 +1,216 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function selectEquipment(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择班组',
|
||||
width : 800,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/work/group/showlistForSelectByGroup.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/save_task_group.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var editFun = function(id) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '编辑设备',
|
||||
url : ext.contextPath + '/process/realDetailsEquipment/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var viewSkillFun = function(groupId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '资质一览',
|
||||
url : ext.contextPath + '/process/staffskill/viewStaffSkill.do?groupId=' + groupId,
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetailsEquipment/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=',';
|
||||
}
|
||||
datas+="'"+item.id+"'";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes_task_group.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.equipmentid+",";
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择设备','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskEquipment/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getlist_detail_group.do?workorderid=${workorderid}&processid=${processid}&taskid=${taskid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'equipmentcardid', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.group.name;
|
||||
}} ,
|
||||
{width : '100', title : '课长', field : 'chief', sortable : false, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.group.groupmembers, function(index, item){
|
||||
if(item.usertype=="chief"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
|
||||
}} ,
|
||||
{width : '100', title : '组长', field : 'leader', sortable : false, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.group.groupmembers, function(index, item){
|
||||
if(item.usertype=="leader"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
|
||||
}} ,
|
||||
{width : '150', title : '人数(双击修改)', field : 'num', sortable : false, halign:'center'},
|
||||
{width : '130', title : '资质一览', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="资历一览" onclick="viewSkillFun(\''+row.groupid+'\');"/>';
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onDblClickRow :function(rowIndex, rowData){
|
||||
$.messager.prompt('提示', '请填写('+rowData.group.name+')人员数量', function(r){
|
||||
if (parseInt(r)==r && r.length<4){
|
||||
$.post(ext.contextPath + '/work/workorder/update_task_group.do', {id:rowData.id,num:r} , function(data) {
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
$.messager.alert('提示','请输入3位内整数','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workTaskEquipment/save.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="selectEquipment();">添加</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
43
WebRoot/jsp/work/districtworkstationSnakerList.jsp
Normal file
43
WebRoot/jsp/work/districtworkstationSnakerList.jsp
Normal file
@ -0,0 +1,43 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title>工艺流程</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script src="<%=contextPath%>/JS/raphael-min.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/extends/snaker.designer.select.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/snaker.model.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
$(function() {
|
||||
var json="${process }";
|
||||
var model;
|
||||
if(json) {
|
||||
model=eval("(" + json + ")");
|
||||
} else {
|
||||
model="";
|
||||
}
|
||||
$('#snakerflow').snakerflow({
|
||||
basePath : ext.contextPath+"/JS/snaker/",
|
||||
restore : model,
|
||||
title:"${processrealname} - ",
|
||||
modalDialogWidth:"1000",
|
||||
modalDialogHeight:"600",
|
||||
url:ext.contextPath + "/work/worktaskworkstation/districtworkstation.do?taskid=${param.id}"
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="snakerflow"></div>
|
||||
</body>
|
||||
</html>
|
||||
37
WebRoot/jsp/work/districtworkstationSnakerViewList.jsp
Normal file
37
WebRoot/jsp/work/districtworkstationSnakerViewList.jsp
Normal file
@ -0,0 +1,37 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title>工艺流程</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script src="<%=contextPath%>/JS/raphael-min.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/extends/snaker.designer.select.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/snaker.model.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
$(function() {
|
||||
$('#snakerflow').snakerflow($.extend(true,{
|
||||
basePath : ext.contextPath+"/JS/snaker/",
|
||||
restore : eval("(${process})"),
|
||||
title:"${processrealname} - ",
|
||||
modalDialogWidth:"1000",
|
||||
modalDialogHeight:"600",
|
||||
url:ext.contextPath + "/work/worktaskworkstation/districtworkstation.do?taskid=${param.id}"
|
||||
},eval("(${state})")
|
||||
));
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="snakerflow"></div>
|
||||
</body>
|
||||
</html>
|
||||
93
WebRoot/jsp/work/getCoordinate4Areas.jsp
Normal file
93
WebRoot/jsp/work/getCoordinate4Areas.jsp
Normal file
@ -0,0 +1,93 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<div class="modal fade" id="coordinatesPicModal">
|
||||
<div>
|
||||
<div class="modal-content" id="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择画面坐标</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="min-width: 1660px;width:100%;height: 740px">
|
||||
<div style="" id="showCoordinatesPicDiv"><div id="show_coordinatesPic"></div></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="coordinatesPicPointList();">确定</button>
|
||||
<button type="button" class="btn btn-default" onclick="coordinatesPicReDo();">重置</button>
|
||||
<button type="button" class="btn btn-default" onclick="closeModal('coordinatesPicModal');">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/penCutout/penCutout.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
let coordinatesPicpenCutout = new penCutout();
|
||||
$(function () {
|
||||
let img = "<%=request.getContextPath()%>/IMG/main_bg_hqaq_1.png";
|
||||
let imgType = "${layer}";
|
||||
let height=667;
|
||||
let width=642;
|
||||
if(imgType=="2"){
|
||||
img = "<%=request.getContextPath()%>/IMG/main_bg_hqaq_2.png";
|
||||
width = 637;
|
||||
height = 814;
|
||||
}
|
||||
$('#showCoordinatesPicDiv').height(height+"px");
|
||||
$('#showCoordinatesPicDiv').width(width+"px");
|
||||
let defaultPoints = new Array();
|
||||
let defaultPoint = $('#coordinatesPosition').val();
|
||||
if(defaultPoint!=null && defaultPoint!=''){
|
||||
let points = defaultPoint.split(";")
|
||||
$.each(points,function(key,val){
|
||||
//回调函数有两个参数,第一个是元素索引,第二个为当前值
|
||||
let point = val.split(",");
|
||||
let p = new Object();
|
||||
p.pointx = point[0];
|
||||
p.pointy = point[1];
|
||||
defaultPoints.push(p)
|
||||
});
|
||||
}
|
||||
coordinatesPicpenCutout.init({
|
||||
drawPanel: "show_coordinatesPic",
|
||||
//抠图图片src
|
||||
imgSrc: img,
|
||||
//抠图完成填充背景图片(默认)
|
||||
imgBackSrc: img,
|
||||
//钢笔色
|
||||
penColor: "#0087C4",
|
||||
penBgColor: 'rgba(0,102,255,0.30)',
|
||||
//初始话钢笔抠图坐标集合
|
||||
defaultPointList: defaultPoints,
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
})
|
||||
function coordinatesPicPointList(){
|
||||
let points = coordinatesPicpenCutout.can.pointList;
|
||||
let coordinatesPic = "";
|
||||
$.each(points,function(key,val){
|
||||
//回调函数有两个参数,第一个是元素索引,第二个为当前值
|
||||
coordinatesPic = coordinatesPic+val.pointx+","+val.pointy+";";
|
||||
});
|
||||
$('#coordinatesPosition').val(coordinatesPic);
|
||||
closeModal('coordinatesPicModal');
|
||||
}
|
||||
function coordinatesPicReDo(){
|
||||
coordinatesPicpenCutout.ReDo();
|
||||
}
|
||||
|
||||
</script>
|
||||
97
WebRoot/jsp/work/getCoordinate4ChannelPort.jsp
Normal file
97
WebRoot/jsp/work/getCoordinate4ChannelPort.jsp
Normal file
@ -0,0 +1,97 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<div class="modal fade" id="channelPortConfigPicModal">
|
||||
<div>
|
||||
<div class="modal-content" id="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择图片坐标(当前坐标:<span id="nowCoordinate"></span>)</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="min-width: 1660px;width:100%;height: 740px">
|
||||
<div style="background-size: 100% 100%;background-repeat:no-repeat;background-position:center center;" id="showchannelPortConfigPicDiv">
|
||||
<canvas id="show_channelPortConfigPic" style=""></canvas>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" onclick="channelPortConfigPicPointList();">确定</button>
|
||||
<button type="button" class="btn btn-default" onclick="channelPortConfigPicReDo();">重置</button>
|
||||
<button type="button" class="btn btn-default" onclick="closeModal('channelPortConfigPicModal');">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var canvas;
|
||||
$(function () {
|
||||
let img = "<%=request.getContextPath()%>/IMG/main_bg_hqaq_1.png";
|
||||
let imgType = "${layer}";
|
||||
let height=667;
|
||||
let width=642;
|
||||
if(imgType=="2"){
|
||||
img = "<%=request.getContextPath()%>/IMG/main_bg_hqaq_2.png";
|
||||
width = 637;
|
||||
height = 814;
|
||||
}
|
||||
$('#showchannelPortConfigPicDiv').height(height+"px");
|
||||
$('#showchannelPortConfigPicDiv').width(width+"px");
|
||||
$('#showchannelPortConfigPicDiv').css("background-image","url("+img+")");
|
||||
|
||||
canvas = document.getElementById("show_channelPortConfigPic");
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
drawBeauty();
|
||||
let defaultPoint = $('#channelPortConfigPic').val();
|
||||
if(defaultPoint!=null && defaultPoint!=''){
|
||||
$('#nowCoordinate').html(defaultPoint);
|
||||
newCoordinate(defaultPoint);
|
||||
}
|
||||
})
|
||||
function windowToCanvas(e) {
|
||||
var x = e.x || e.clientX,
|
||||
y = e.y || e.clientY,
|
||||
bbox = canvas.getBoundingClientRect();
|
||||
return { x: x - bbox.left,
|
||||
y: y - bbox.top
|
||||
};
|
||||
}
|
||||
function drawBeauty(){
|
||||
//点击获取坐标
|
||||
canvas.onmousedown = function (e) {
|
||||
var loc = windowToCanvas(e);
|
||||
e.preventDefault(); // prevent cursor change
|
||||
var lnglats=(loc.x+15)+','+(loc.y+15);
|
||||
$('#nowCoordinate').html(lnglats);
|
||||
newCoordinate(lnglats);
|
||||
};
|
||||
}
|
||||
function newCoordinate(lnglats){
|
||||
$('.coordinateDiv').remove();
|
||||
let p = lnglats.split(',');
|
||||
let coordinateDiv = '<div class="coordinateDiv" style="background-color: rgb(20,93,255);' +
|
||||
'position: absolute;top:'+(p[1]-5)+'px;left:'+(p[0]-5)+'px;height: 10px;width: 10px;border-radius: 10px;"></div>';
|
||||
$('#showchannelPortConfigPicDiv').append(coordinateDiv);
|
||||
}
|
||||
function channelPortConfigPicPointList(){
|
||||
let nowCoordinate = $('#nowCoordinate').html();
|
||||
$('#channelPortConfigPic').val(nowCoordinate);
|
||||
closeModal('channelPortConfigPicModal');
|
||||
}
|
||||
function channelPortConfigPicReDo(){
|
||||
$('.coordinateDiv').remove();
|
||||
$('#nowCoordinate').html('');
|
||||
}
|
||||
|
||||
</script>
|
||||
136
WebRoot/jsp/work/groupContentAdd.jsp
Normal file
136
WebRoot/jsp/work/groupContentAdd.jsp
Normal file
@ -0,0 +1,136 @@
|
||||
<%@ 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 import="com.sipai.entity.work.GroupContent" %>
|
||||
<% request.setAttribute("Type_Point", GroupContent.Type_Point); %>
|
||||
<% request.setAttribute("Type_Content", GroupContent.Type_Content); %>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupContent/dosave.do", $("#subForm").serialize(), function (result) {
|
||||
var data = $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
initTreeView();
|
||||
// showAlert('s','保存成功');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$.post(ext.contextPath + "/work/groupType/getGroupTypeTree.do", function (data) {
|
||||
//console.log("sdata",data);
|
||||
var select = $("#grouptypeid").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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$("#grouptypeid").on("select2:select", function (e) {
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||||
if (data.length != 0) {
|
||||
select.val(data[0].id).trigger("change");//设置选中
|
||||
} else {
|
||||
select.val("").trigger("change");//设置选中
|
||||
}
|
||||
}, 'json');
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="unitId" name="unitId" type="hidden" value="${param.unitId}"/>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
<input id="type" name="type" type="hidden" value="${param.type}"/>
|
||||
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${groupContent.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${groupContent.morder}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${param.type==Type_Content}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">班组类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="grouptypeid" name="grouptypeid"
|
||||
style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
470
WebRoot/jsp/work/groupContentEdit.jsp
Normal file
470
WebRoot/jsp/work/groupContentEdit.jsp
Normal file
@ -0,0 +1,470 @@
|
||||
<%@ 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 import="com.sipai.entity.work.GroupContent" %>
|
||||
<% request.setAttribute("Type_Point", GroupContent.Type_Point); %>
|
||||
<% request.setAttribute("Type_Content", GroupContent.Type_Content); %>
|
||||
|
||||
<%@page import="com.sipai.entity.work.GroupContentForm" %>
|
||||
<% request.setAttribute("Type_row", GroupContentForm.Type_row);%>
|
||||
<% request.setAttribute("Type_column", GroupContentForm.Type_column);%>
|
||||
|
||||
<% request.setAttribute("Showtextst_TRUE", GroupContentForm.Showtextst_TRUE);%>
|
||||
<% request.setAttribute("Showtextst_FALSE", GroupContentForm.Showtextst_FALSE);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<!-- 颜色选择器-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css"
|
||||
type="text/css" rel="stylesheet" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var grouptypeid="";
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupContent/doupdate.do", $("#subForm").serialize()+"&grouptypeid="+grouptypeid, function (result) {
|
||||
var data = $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
initTreeView();
|
||||
// showAlert('s','保存成功');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function dodel() {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/groupContent/dodelete.do', $("#subForm").serialize(), function (result) {
|
||||
// var data= $.parseJSON(result);
|
||||
if (result.code == 1) {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', result.msg);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
if ('${groupContent.type}'=='${Type_Content}') {
|
||||
$.post(ext.contextPath + "/work/groupType/getGroupTypeTree.do", function (data) {
|
||||
//console.log("sdata",data);
|
||||
var select = $("#grouptypeName").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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$("#grouptypeName").on("select2:select", function (e) {
|
||||
// doReloadCalendar();
|
||||
});
|
||||
select.on("change", function (e) {
|
||||
grouptypeid = $('#grouptypeName').val();
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||||
if (data.length != 0) {
|
||||
select.val('${groupContent.grouptypeid}').trigger("change");//设置选中
|
||||
} else {
|
||||
select.val("").trigger("change");//设置选中
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
$("#contentFormTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/groupContentForm/getlist.do', // 获取表格数据的url
|
||||
// cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [5, 10, 15], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
detailView: true,//父子表
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
type: '${Type_row}',
|
||||
pid: '${groupContent.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'insertrow', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onExpandRow: function (index, row, $detail) {
|
||||
initDetailTable(index, row, $detail);
|
||||
//存入sessionStorage
|
||||
sessionStorage.setItem("index", index);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'insertrow', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return "第" + value + "行";
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="doContentFormForColumnAddFun(\'' + row.id + '\')"><i class="fa fa-plus-circle"></i></button>' +
|
||||
'<button class="btn btn-default btn-sm" onclick="delContentFormForRowFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
$(".bs-checkbox").css({'text-align': 'center', 'vertical-align': 'middle'})
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
var initDetailTable = function (index, row, $detail) {
|
||||
var pid = row.id;
|
||||
var detailTable = $detail.html('<table></table>').find('table');
|
||||
$(detailTable).bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/groupContentForm/getlist.do', // 获取表格数据的url
|
||||
// cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [15, 30, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 15, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
type: '${Type_column}',
|
||||
pid: pid
|
||||
}
|
||||
},
|
||||
sortName: 'insertColumn', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [{
|
||||
field: 'insertcolumn', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return "第" + value + "列";
|
||||
}
|
||||
}, {
|
||||
field: 'rows', // 返回json数据中的name
|
||||
title: '所占行', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'columns', // 返回json数据中的name
|
||||
title: '所占列', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'showtext', // 返回json数据中的name
|
||||
title: '单元内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'showtextst', // 返回json数据中的name
|
||||
title: '输入单元', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if(value=='${Showtextst_TRUE}'){
|
||||
return "是";
|
||||
}else if(value=='${Showtextst_FALSE}'){
|
||||
return "否";
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'mpid', // 返回json数据中的name
|
||||
// title: '测量点', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// },
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="editContentFormForColumnFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>' +
|
||||
'<button class="btn btn-default btn-sm" onclick="delContentFormForColumnFun(\'' + row.id + '\',\'' + pid + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||||
}
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//通过sessionStorage自动展开
|
||||
var doExpend = function () {
|
||||
if (sessionStorage.getItem("index") != null) {
|
||||
$("#contentFormTable").bootstrapTable('expandRow', sessionStorage.getItem("index"));
|
||||
}
|
||||
};
|
||||
|
||||
function addContentFormRowFun() {
|
||||
$.post(ext.contextPath + "/work/groupContentForm/dosaveForRow.do", {pid: '${groupContent.id}'}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#contentFormTable").bootstrapTable('refresh');
|
||||
setTimeout(doExpend, 500);
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function doContentFormForColumnAddFun(pid) {
|
||||
$.post(ext.contextPath + '/work/groupContentForm/doadd.do', {pid: pid}, function (data) {
|
||||
$("#contentFormSubDiv").html(data);
|
||||
openModal('contentFormSubModal');
|
||||
});
|
||||
}
|
||||
|
||||
function editContentFormForColumnFun(id) {
|
||||
$.post(ext.contextPath + '/work/groupContentForm/doedit.do', {id: id}, function (data) {
|
||||
$("#contentFormSubDiv").html(data);
|
||||
openModal('contentFormSubModal');
|
||||
});
|
||||
}
|
||||
|
||||
function delContentFormForRowFun(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/groupContentForm/dodelForRow.do', {
|
||||
id: id,
|
||||
pid: '${groupContent.id}'
|
||||
}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#contentFormTable").bootstrapTable('refresh');
|
||||
setTimeout(doExpend, 500);
|
||||
} else {
|
||||
showAlert('d', data.msg, 'alertDiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delContentFormForColumnFun(id, pid) {
|
||||
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/groupContentForm/dodelForColumn.do', {
|
||||
id: id,
|
||||
pid: pid
|
||||
}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#contentFormTable").bootstrapTable('refresh');
|
||||
setTimeout(doExpend, 500);
|
||||
} else {
|
||||
showAlert('d', data.msg, 'alertDiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">修改</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${groupContent.id}"/>
|
||||
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${groupContent.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${groupContent.morder}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${groupContent.type==Type_Content}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">班组类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="grouptypeName" name="grouptypeName"
|
||||
style="width: 220px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${groupContent.type==Type_Content}">
|
||||
<div class="box box-solid" id="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">内容配置</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_power"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default" onclick="addContentFormRowFun();"><i
|
||||
class="fa fa-plus"></i> 插入行
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<table id="contentFormTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
|
||||
279
WebRoot/jsp/work/groupContentFormAdd.jsp
Normal file
279
WebRoot/jsp/work/groupContentFormAdd.jsp
Normal file
@ -0,0 +1,279 @@
|
||||
<%@ 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" %>
|
||||
<%@page import="com.sipai.entity.work.GroupContentForm" %>
|
||||
<% request.setAttribute("Showtextst_TRUE", GroupContentForm.Showtextst_TRUE);%>
|
||||
<% request.setAttribute("Showtextst_FALSE", GroupContentForm.Showtextst_FALSE);%>
|
||||
|
||||
<% request.setAttribute("Mpst_1", GroupContentForm.Mpst_1);%>
|
||||
<% request.setAttribute("Mpst_2", GroupContentForm.Mpst_2);%>
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
});
|
||||
|
||||
$('#switchBtn_Mpst').bootstrapSwitch({
|
||||
onText: '输入',
|
||||
offText: '输出',
|
||||
size: "small",
|
||||
});
|
||||
|
||||
$('#colorContainer1').colorpicker({format: null});
|
||||
$('#colorContainer2').colorpicker({format: null});
|
||||
|
||||
var dataTextalign = JSON.parse("[{\"id\":\"center\",\"text\":\"居中\"},{\"id\":\"left\",\"text\":\"靠左\"},{\"id\":\"right\",\"text\":\"靠右\"}]");
|
||||
var select = $("#textalign").select2({
|
||||
data: dataTextalign,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
// select.on("change", function (e) {
|
||||
//
|
||||
// });
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||||
if (dataTextalign.length != 0) {
|
||||
select.val(dataTextalign[0].id).trigger("change");//设置选中
|
||||
} else {
|
||||
select.val("").trigger("change");//设置选中
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
function doContentFormSave() {
|
||||
$("#contentFormSubForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#contentFormSubForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var form = $("#contentFormSubForm").serialize();
|
||||
var status = $('#switchBtn').bootstrapSwitch('state');
|
||||
if (status) {
|
||||
form = form + "&showtextst=${Showtextst_TRUE}";
|
||||
} else {
|
||||
form = form + "&showtextst=${Showtextst_FALSE}";
|
||||
}
|
||||
var statusMpst = $('#switchBtn_Mpst').bootstrapSwitch('state');
|
||||
if (statusMpst) {
|
||||
form = form + "&mpst=${Mpst_1}";
|
||||
} else {
|
||||
form = form + "&mpst=${Mpst_2}";
|
||||
}
|
||||
$.post(ext.contextPath + "/work/groupContentForm/dosave.do", form, function (data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('contentFormSubModal');
|
||||
$("#contentFormTable").bootstrapTable('refresh');
|
||||
setTimeout(doExpend, 500);
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#contentFormSubForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
insertcolumn: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '列数不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '列数必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
insertcolumn: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '所占行不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '所占行必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
insertcolumn: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '所占列不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '所占列必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doContentFormClose() {
|
||||
closeModal('contentFormSubModal');
|
||||
}
|
||||
|
||||
function selectmpid() {
|
||||
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
|
||||
// mpids: mpids,
|
||||
mpids: '',
|
||||
fucname: 'ckmpidDone'
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('subModalMpoint');
|
||||
});
|
||||
}
|
||||
|
||||
function ckmpidDone(data) {
|
||||
data = JSON.parse(data);
|
||||
$('#contentFormSubForm #datampid').val(data[0].mpid);
|
||||
closeModal('subModalMpoint');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="contentFormSubModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" onclick="doContentFormClose()">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">添加列</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为contentFormSubForm -->
|
||||
<form class="form-horizontal" id="contentFormSubForm">
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">列数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="insertcolumn" name="insertcolumn"
|
||||
placeholder="第...列" value="${groupContentForm.insertcolumn}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所占行</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="rows" name="rows" placeholder="所占行" value="1">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所占列</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="columns" name="columns" placeholder="所占列"
|
||||
value="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">宽度</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="width" name="width" placeholder="宽度">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">高度</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="height" name="height" placeholder="高度">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">单元内容</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="showtext" name="showtext" placeholder="显示内容"
|
||||
value="${groupContentForm.showtext}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">输入单元</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn" type="checkbox"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">数据测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="datampid" name="datampid" placeholder="数据测量点"
|
||||
value="${groupContentForm.datampid}" onclick="selectmpid();">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">测量点类型</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn_Mpst" type="checkbox"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文字大小</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="fontsize" name="fontsize" placeholder="文字大小"
|
||||
value="16"
|
||||
value="${groupContentForm.fontsize}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">文字粗细</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="fontweight" name="fontweight" placeholder="文字粗细"
|
||||
value="400"
|
||||
value="${groupContentForm.fontweight}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文字颜色</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group " id="colorContainer1">
|
||||
<input name="fontcolor" id="fontcolor" type="text" class="form-control"
|
||||
value="#000000">
|
||||
<div class="input-group-addon">
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">文字位置</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="textalign" name="textalign"
|
||||
style="width: 170px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">背景色</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group " id="colorContainer2">
|
||||
<input name="backgroundcolor" id="backgroundcolor" type="text" class="form-control"
|
||||
value="#FFFFFF">
|
||||
<div class="input-group-addon">
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doContentFormClose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doContentFormSave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
311
WebRoot/jsp/work/groupContentFormEdit.jsp
Normal file
311
WebRoot/jsp/work/groupContentFormEdit.jsp
Normal file
@ -0,0 +1,311 @@
|
||||
<%@ 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" %>
|
||||
<%@page import="com.sipai.entity.work.GroupContentForm" %>
|
||||
<% request.setAttribute("Showtextst_TRUE", GroupContentForm.Showtextst_TRUE);%>
|
||||
<% request.setAttribute("Showtextst_FALSE", GroupContentForm.Showtextst_FALSE);%>
|
||||
|
||||
<% request.setAttribute("Mpst_1", GroupContentForm.Mpst_1);%>
|
||||
<% request.setAttribute("Mpst_2", GroupContentForm.Mpst_2);%>
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
$("#valuerange").select2({minimumResultsForSearch: -1}).val("${groupContentForm.valuerange}").trigger("change");
|
||||
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText: '是',
|
||||
offText: '否',
|
||||
size: "small",
|
||||
});
|
||||
if ('${groupContentForm.showtextst}' == '${Showtextst_FALSE}') {
|
||||
$('#switchBtn').bootstrapSwitch('state', false, true);
|
||||
} else if ('${groupContentForm.showtextst}' == '${Showtextst_TRUE}') {
|
||||
$('#switchBtn').bootstrapSwitch('state', true, true);
|
||||
} else {
|
||||
$('#switchBtn').bootstrapSwitch('state', false, true);
|
||||
}
|
||||
|
||||
$('#switchBtn_Mpst').bootstrapSwitch({
|
||||
onText: '输入',
|
||||
offText: '输出',
|
||||
size: "small",
|
||||
});
|
||||
if ('${groupContentForm.mpst}' == '${Mpst_2}') {
|
||||
$('#switchBtn_Mpst').bootstrapSwitch('state', false, true);
|
||||
} else if ('${groupContentForm.mpst}' == '${Mpst_1}') {
|
||||
$('#switchBtn_Mpst').bootstrapSwitch('state', true, true);
|
||||
} else {
|
||||
$('#switchBtn_Mpst').bootstrapSwitch('state', false, true);
|
||||
}
|
||||
|
||||
$('#colorContainer1').colorpicker({format: null});
|
||||
$('#colorContainer2').colorpicker({format: null});
|
||||
|
||||
|
||||
var dataTextalign = JSON.parse("[{\"id\":\"center\",\"text\":\"居中\"},{\"id\":\"left\",\"text\":\"靠左\"},{\"id\":\"right\",\"text\":\"靠右\"}]");
|
||||
var select = $("#textalign").select2({
|
||||
data: dataTextalign,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
// select.on("change", function (e) {
|
||||
//
|
||||
// });
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||||
select.val('${groupContentForm.textalign}').trigger("change");//设置选中
|
||||
})
|
||||
|
||||
function doContentFormSave() {
|
||||
$("#contentFormSubForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#contentFormSubForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var form = $("#contentFormSubForm").serialize();
|
||||
var status = $('#switchBtn').bootstrapSwitch('state');
|
||||
if (status) {
|
||||
form = form + "&showtextst=${Showtextst_TRUE}";
|
||||
} else {
|
||||
form = form + "&showtextst=${Showtextst_FALSE}";
|
||||
}
|
||||
var statusMpst = $('#switchBtn_Mpst').bootstrapSwitch('state');
|
||||
if (statusMpst) {
|
||||
form = form + "&mpst=${Mpst_1}";
|
||||
} else {
|
||||
form = form + "&mpst=${Mpst_2}";
|
||||
}
|
||||
$.post(ext.contextPath + "/work/groupContentForm/doupdateForColumn.do", form, function (data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('contentFormSubModal');
|
||||
$("#contentFormTable").bootstrapTable('refresh');
|
||||
setTimeout(doExpend, 500);
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#contentFormSubForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
insertcolumn: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '列数不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '列数必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
insertcolumn: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '所占行不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '所占行必须为数字'
|
||||
}
|
||||
}
|
||||
},
|
||||
insertcolumn: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '所占列不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '所占列必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doContentFormClose() {
|
||||
closeModal('contentFormSubModal');
|
||||
}
|
||||
|
||||
var selectMPint = function () {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {
|
||||
formId: 'contentFormSubForm',
|
||||
hiddenId: 'mpid',
|
||||
textId: 'mpcode',
|
||||
mpid: $("#mpid").val()
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
function selectmpid() {
|
||||
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
|
||||
// mpids: mpids,
|
||||
mpids: '',
|
||||
fucname: 'ckmpidDone'
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('subModalMpoint');
|
||||
});
|
||||
}
|
||||
|
||||
function ckmpidDone(data) {
|
||||
data = JSON.parse(data);
|
||||
$('#contentFormSubForm #datampid').val(data[0].mpid);
|
||||
closeModal('subModalMpoint');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="contentFormSubModal">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" onclick="doContentFormClose()">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑列</h4>
|
||||
</div>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为contentFormSubForm -->
|
||||
<form class="form-horizontal" id="contentFormSubForm">
|
||||
<input id="id" name="id" type="hidden" value="${groupContentForm.id}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">列数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="insertcolumn" name="insertcolumn"
|
||||
placeholder="第...列" value="${groupContentForm.insertcolumn}">
|
||||
</div>
|
||||
<%-- <label class="col-sm-2 control-label">测量点</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input type="text" class="form-control" id="mpid" name ="mpid" placeholder="测量点" onclick="selectMPint()" value="${groupContentForm.mpid}">--%>
|
||||
<%-- <input type="hidden" class="form-control" id="mpcode" name ="mpcode" >--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所占行</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="rows" name="rows" placeholder="所占行"
|
||||
value="${groupContentForm.rows}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所占列</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="columns" name="columns" placeholder="所占列"
|
||||
value="${groupContentForm.columns}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">宽度</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="width" name="width" placeholder="宽度"
|
||||
value="${groupContentForm.width}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">高度</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="height" name="height" placeholder="高度"
|
||||
value="${groupContentForm.height}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">单元内容</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="showtext" name="showtext" placeholder="显示内容"
|
||||
value="${groupContentForm.showtext}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">输入单元</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn" type="checkbox"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">数据测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="datampid" name="datampid" placeholder="数据测量点"
|
||||
value="${groupContentForm.datampid}" onclick="selectmpid();">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">测量点类型</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id="switchBtn_Mpst" type="checkbox"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文字大小</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="fontsize" name="fontsize" placeholder="文字大小"
|
||||
value="${groupContentForm.fontsize}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">文字粗细</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="fontweight" name="fontweight" placeholder="文字粗细"
|
||||
value="${groupContentForm.fontweight}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">文字颜色</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group " id="colorContainer1">
|
||||
<input name="fontcolor" id="fontcolor" type="text" class="form-control"
|
||||
value="${groupContentForm.fontcolor}">
|
||||
<div class="input-group-addon">
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">文字位置</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="textalign" name="textalign"
|
||||
style="width: 170px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">背景色</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group " id="colorContainer2">
|
||||
<input name="backgroundcolor" id="backgroundcolor" type="text" class="form-control"
|
||||
value="${groupContentForm.backgroundcolor}">
|
||||
<div class="input-group-addon">
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doContentFormClose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doContentFormSave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
120
WebRoot/jsp/work/groupContentList.jsp
Normal file
120
WebRoot/jsp/work/groupContentList.jsp
Normal file
@ -0,0 +1,120 @@
|
||||
<%@ 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 import="com.sipai.entity.work.GroupContent" %>
|
||||
<% request.setAttribute("Type_Point", GroupContent.Type_Point); %>
|
||||
<% request.setAttribute("Type_Content", GroupContent.Type_Content); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var unitId = '';
|
||||
var addFun = function (type) {
|
||||
var node = $('#tree').treeview('getSelected');
|
||||
var pid = "";
|
||||
if (node != null && node.length > 0) {
|
||||
pid = node[0].id;
|
||||
} else {
|
||||
pid = "-1";
|
||||
}
|
||||
$.post(ext.contextPath + '/work/groupContent/doadd.do', {
|
||||
unitId: unitId,
|
||||
pid: pid,
|
||||
type: type
|
||||
}, function (data) {
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/groupContent/doedit.do', {unitId: unitId, id: id}, function (data) {
|
||||
$("#menuBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var initTreeView = function () {
|
||||
$.post(ext.contextPath + '/work/groupContent/getGroupContentTree.do', {unitId: unitId}, function (data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({
|
||||
data: data,
|
||||
level: 2
|
||||
});
|
||||
$('#tree').on('nodeSelected', function (event, data) {
|
||||
editFun(data.id);
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
}, 'json');
|
||||
$("#menuBox").html("");
|
||||
};
|
||||
$(function () {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="contentFormSubDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">内容方案</h3>
|
||||
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun('${Type_Point}');"><i
|
||||
class="fa fa-plus">新增节点</i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun('${Type_Content}');"><i
|
||||
class="fa fa-plus">新增内容</i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:750px;overflow:auto;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="menuBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
139
WebRoot/jsp/work/groupDetailAdd.jsp
Normal file
139
WebRoot/jsp/work/groupDetailAdd.jsp
Normal file
@ -0,0 +1,139 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('grouptypeName', 'NOT_VALIDATED',null)
|
||||
.validateField('grouptypeName');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('_leader', 'NOT_VALIDATED',null)
|
||||
.validateField('_leader');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupDetail/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
// showAlert('s','保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
$.post(ext.contextPath + '/work/groupType/showGroupType4Select.do', { formId: formId, hiddenId: hiddenId, textId: textId }, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("menu4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var showUser4SelectsFun1 = function() {
|
||||
var userIds= $("#leader").val();
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do', {formId:"subForm",hiddenId:"leader",textId:"_leader",userIds:userIds,companyId:unitId} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var showUser4SelectsFun2 = function() {
|
||||
var userIds= $("#members").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"members",textId:"_members",userIds:userIds,companyId:unitId} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
grouptypeName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '班组类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_leader: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '组长不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">新增班组</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${groupDetail.id}">
|
||||
<input type="hidden" class="form-control" id="unitId" name ="unitId" value ="${param.unitId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="name" name ="name" value="${groupDetail.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*班组类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="grouptypeId" name="grouptypeId" type="hidden" value="${groupDetail.grouptypeId}" />
|
||||
<input class="form-control" type="text" id="grouptypeName" name ="grouptypeName" value="${groupDetail.groupType.name}" onclick="showEquipment4SelectsFun('subForm','grouptypeId','grouptypeName');" placeholder="选择班组类型">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*组长</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="leader" name="leader" type="hidden" value="${groupDetail.leader}" />
|
||||
<input class="form-control" type="text" id="_leader" name ="_leader" value="${groupDetail._leader}" onclick="showUser4SelectsFun1();" placeholder="选择人员" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">组员</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" id="members" name="members" type="hidden" value="${groupDetail.members}" />
|
||||
<textarea class="form-control" type="text" style="height: 60px;" id="_members" name ="_members" onclick="showUser4SelectsFun2();" placeholder="选择人员" readonly>${groupDetail._members}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
139
WebRoot/jsp/work/groupDetailEdit.jsp
Normal file
139
WebRoot/jsp/work/groupDetailEdit.jsp
Normal file
@ -0,0 +1,139 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('grouptypeName', 'NOT_VALIDATED',null)
|
||||
.validateField('grouptypeName');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('_leader', 'NOT_VALIDATED',null)
|
||||
.validateField('_leader');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupDetail/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
// showAlert('s','保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
$.post(ext.contextPath + '/work/groupType/showGroupType4Select.do', { formId: formId, hiddenId: hiddenId, textId: textId }, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("menu4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var showUser4SelectsFun1 = function() {
|
||||
var userIds= $("#leader").val();
|
||||
$.post(ext.contextPath + '/user/userForOneSelect.do', {formId:"subForm",hiddenId:"leader",textId:"_leader",userIds:userIds,companyId:unitId} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var showUser4SelectsFun2 = function() {
|
||||
var userIds= $("#members").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"members",textId:"_members",userIds:userIds,companyId:unitId} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
grouptypeName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '班组类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_leader: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '组长不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">编辑班组</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${groupDetail.id}">
|
||||
<input type="hidden" class="form-control" id="unitId" name ="unitId" value ="${groupDetail.unitId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="name" name ="name" value="${groupDetail.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*班组类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="grouptypeId" name="grouptypeId" type="hidden" value="${groupDetail.grouptypeId}" />
|
||||
<input class="form-control" type="text" id="grouptypeName" name ="grouptypeName" value="${groupDetail.groupType.name}" onclick="showEquipment4SelectsFun('subForm','grouptypeId','grouptypeName');" placeholder="选择班组类型">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*组长</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="leader" name="leader" type="hidden" value="${groupDetail.leader}" />
|
||||
<input class="form-control" type="text" id="_leader" name ="_leader" value="${groupDetail._leader}" onclick="showUser4SelectsFun1();" placeholder="选择人员" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">组员</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" id="members" name="members" type="hidden" value="${groupDetail.members}" />
|
||||
<textarea class="form-control" type="text" style="height: 60px;" id="_members" name ="_members" onclick="showUser4SelectsFun2();" placeholder="选择人员" readonly>${groupDetail._members}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
313
WebRoot/jsp/work/groupDetailList.jsp
Normal file
313
WebRoot/jsp/work/groupDetailList.jsp
Normal file
@ -0,0 +1,313 @@
|
||||
<%@ 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" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<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;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/groupDetail/doadd.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/groupDetail/doedit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/groupDetail/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/groupDetail/dodelete.do', {id: id}, function (data) {
|
||||
if (data.code == "1") {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
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/groupDetail/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data.code > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
var initFun = function () {
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||||
|
||||
$.post(ext.contextPath + '/work/groupType/getSelect2ForSearch.do', function (data) {
|
||||
var select = $("#grouptype").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
select.val(data[0].id).trigger("change");//设置选中
|
||||
$("#grouptype").on("select2:select", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/groupDetail/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(),
|
||||
unitId: unitId,
|
||||
grouptypeId:$('#grouptype').val()
|
||||
// pSectionId: $("#processSection").val(),
|
||||
// statusSelect:$("#statusSelect").val(),
|
||||
}
|
||||
},
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
sortName: 'grouptype_id,name', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: '_leader', // 返回json数据中的name
|
||||
title: '班组长', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'groupType.name', // 返回json数据中的name
|
||||
title: '班组类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'user.caption', // 返回json数据中的name
|
||||
title: '创建人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '创建时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
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 = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="library4SelectDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group" style="padding-bottom:10px;float:right;">
|
||||
<div>
|
||||
<label class="control-label">班组类型:</label>
|
||||
<select class="form-control select2 " id="grouptype"
|
||||
name="grouptype" style="width: 150px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
175
WebRoot/jsp/work/groupListForScheduling.jsp
Normal file
175
WebRoot/jsp/work/groupListForScheduling.jsp
Normal file
@ -0,0 +1,175 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var grid;
|
||||
var editFun = function(id,index) {
|
||||
//alert(index);
|
||||
var row=$('#grid').datagrid('getRows')[index];
|
||||
var userids="";
|
||||
var workstationids="";
|
||||
$.each(row.groupmembers, function(index, item){
|
||||
userids=userids+item.userid+",";
|
||||
workstationids=workstationids+item.workstationid+",";
|
||||
});
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '组员指派',
|
||||
url : ext.contextPath + '/work/group/edit4scheduling.do?id=' + id+"&userids="+userids+"&workstationids="+workstationids,
|
||||
buttons : [ {
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
changerow(res);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var changerow =function( res){
|
||||
//alert(index);
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var members=JSON.parse(res);
|
||||
$('#grid').datagrid('getRows')[editIndex]['groupmembers'] = members;
|
||||
$('#grid').datagrid('refreshRow',editIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
url : ext.contextPath + '/work/workscheduling/getlist.do?querytype=select&dt=${dt}&groupManageid=${groupManageid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
nowrap:false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '380', title : '班组当班人员', field : 'groupmembers', sortable : false, halign:'center',formatter:function(value, row){
|
||||
var res="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='leader'){
|
||||
res+=value[i].username+"("+value[i].workstationname+"), ";
|
||||
}
|
||||
}
|
||||
var res1="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='member'){
|
||||
res1+=value[i].username+"("+value[i].workstationname+"), ";
|
||||
}
|
||||
}
|
||||
return "<b>"+res+"</b>"+res1;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row,index) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="组员指派" onclick="editFun(\''+row.id+'\',\''+index+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item.schedulingflag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
editable:false
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var dosave = function(dialog,parentWin) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
if(checkedItems==""){
|
||||
top.$.messager.alert('提示', '请选择班组','info');
|
||||
}else{
|
||||
var errflag="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
var groupmembers=item.groupmembers;
|
||||
$.each(groupmembers, function(index, item_m){
|
||||
if(item_m.workstationid==null||item_m.workstationid==""){
|
||||
top.$.messager.alert('提示',item.name+"中的“"+item_m.username+"”未安排工位!",'info');
|
||||
errflag="1";
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(errflag!=""){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(errflag!=""){
|
||||
return false;
|
||||
}
|
||||
var res=JSON.stringify(checkedItems);
|
||||
$.post(ext.contextPath + '/work/workscheduling/save.do', {res:res,dt:'${dt}',groupManageid:'${groupManageid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
parentWin.refreshcalerdar();//更新父窗体
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" >
|
||||
<table id="toolbar" style="display: none;width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="easyui-panel" data-options="fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<!-- <div id="ft" style="padding:5px;">
|
||||
选择需排班的班组,点击保存,完成排班。
|
||||
</div> -->
|
||||
</body>
|
||||
</html>
|
||||
112
WebRoot/jsp/work/groupListForSelect.jsp
Normal file
112
WebRoot/jsp/work/groupListForSelect.jsp
Normal file
@ -0,0 +1,112 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid1').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"userid":"'+item.userid +'","usertype":"'+item.usertype +'","username":"'+item.username +'"},';
|
||||
});
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '班组选择',
|
||||
url : ext.contextPath + '/work/group/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
height:300,
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onSelect:function(index,row){
|
||||
loadMembers(row.id);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
editable:false
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function loadMembers(groupid){
|
||||
$('#grid1').datagrid({
|
||||
title : '人员选择',
|
||||
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid='+groupid,
|
||||
height:400,
|
||||
striped : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
|
||||
if(value=='leader'){
|
||||
return "组长";
|
||||
}else{
|
||||
return "组员";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'}
|
||||
] ]
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="padding:5px;">
|
||||
<table id="toolbar" style="display: none;width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid"></table>
|
||||
<div style="height:10px"></div>
|
||||
<table id="grid1"></table>
|
||||
</body>
|
||||
</html>
|
||||
147
WebRoot/jsp/work/groupListForSelectByGroup.jsp
Normal file
147
WebRoot/jsp/work/groupListForSelectByGroup.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","name":"'+item.name +'"}';
|
||||
});
|
||||
datas="["+datas+"]";
|
||||
//alert(datas)
|
||||
return datas;//$.parseJSON(datas);
|
||||
}
|
||||
var viewSkillFun = function(groupId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '资质一览',
|
||||
url : ext.contextPath + '/process/staffskill/viewStaffSkill.do?groupId=' + groupId,
|
||||
});
|
||||
};
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/group/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '180', title : '课长', field : 'chief', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.groupmembers, function(index, item){
|
||||
if(item.usertype=="chief"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
}},
|
||||
{width : '180', title : '组长', field : 'leader', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.groupmembers, function(index, item){
|
||||
if(item.usertype=="leader"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
}},
|
||||
{width : '100', title : '资质一览', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="" onclick="viewSkillFun(\''+row.id+'\');"/>';
|
||||
return str;
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onSelect:function(index,row){
|
||||
//loadMembers(row.id);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
editable:false
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function loadMembers(groupid){
|
||||
$('#grid1').datagrid({
|
||||
title : '人员选择',
|
||||
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid='+groupid,
|
||||
height:400,
|
||||
striped : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
|
||||
if(value=='leader'){
|
||||
return "组长";
|
||||
}else{
|
||||
return "组员";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'}
|
||||
|
||||
] ]
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" >
|
||||
<table id="toolbar" style="display: none;width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
124
WebRoot/jsp/work/groupManageAdd.jsp
Normal file
124
WebRoot/jsp/work/groupManageAdd.jsp
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/work/groupManage/save.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('groupManageAddModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
var nowTime = '<%=DateTime.Now.ToString("HH:mm")%>';
|
||||
$("#sdt").val(nowTime).timepicker('setTime', nowTime);
|
||||
$("#edt").val(nowTime).timepicker('setTime', nowTime);
|
||||
|
||||
//水厂
|
||||
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {}, function (data) {
|
||||
var select = $("#bizId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
select.on("change", function (e) {
|
||||
});
|
||||
select.val(companyId).trigger("change");
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="groupManageAddModal">
|
||||
<div class="modal-dialog" style="height:500px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增班次</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">班次名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="班次名称" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group " style="padding:0;">
|
||||
<label class="col-sm-2 control-label">厂区</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2 " id="bizId" name="bizId"
|
||||
style="width: 250px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">开始时间</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" id="sdt" name="sdt" style="width: 250px;" readonly="readonly"
|
||||
class="form-control timepicker timepicker-default" placeholder="请选择" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">结束时间</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" id="edt" name="edt" style="width: 250px;" readonly="readonly"
|
||||
class="form-control timepicker timepicker-default" placeholder="请选择" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" class="form-control" id="remark" name="remark" placeholder="备注"
|
||||
row="15"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
126
WebRoot/jsp/work/groupManageEdit.jsp
Normal file
126
WebRoot/jsp/work/groupManageEdit.jsp
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$.post(ext.contextPath + '/work/groupManage/update.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('groupManageEditModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
var nowTime = '<%=DateTime.Now.ToString("HH:mm")%>';
|
||||
$("#sdt").val(nowTime).timepicker('setTime', "${groupManage.sdt}");
|
||||
$("#edt").val(nowTime).timepicker('setTime', "${groupManage.edt}");
|
||||
|
||||
document.getElementById("remark").value = "${groupManage.remark}";
|
||||
//水厂
|
||||
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {}, function (data) {
|
||||
var select = $("#bizId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
select.on("change", function (e) {
|
||||
});
|
||||
select.val("${groupManage.bizId}").trigger("change");
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="groupManageEditModal">
|
||||
<div class="modal-dialog" style="height:500px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑班次</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${groupManage.id}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">班次名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="班次名称" value="${groupManage.name}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group " style="padding:0;">
|
||||
<label class="col-sm-2 control-label">厂区</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2 " id="bizId" name="bizId"
|
||||
style="width: 250px;" disabled></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">开始时间</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" id="sdt" name="sdt" style="width: 250px;" readonly="readonly"
|
||||
class="form-control timepicker timepicker-default" placeholder="请选择" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">结束时间</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" id="edt" name="edt" style="width: 250px;" readonly="readonly"
|
||||
class="form-control timepicker timepicker-default" placeholder="请选择" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" class="form-control" id="remark" name="remark" placeholder="备注"
|
||||
row="15"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
228
WebRoot/jsp/work/groupManageList.jsp
Normal file
228
WebRoot/jsp/work/groupManageList.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var companyId;
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/groupManage/add.do',
|
||||
function (data) {
|
||||
$("#addDiv").html("");//清空
|
||||
$("#addDiv").html(data);
|
||||
openModal('groupManageAddModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/groupManage/edit.do', { id: id }, function (data) {
|
||||
$("#editDiv").html("");//清空
|
||||
$("#editDiv").html(data);
|
||||
openModal('groupManageEditModal');
|
||||
});
|
||||
};
|
||||
|
||||
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/groupManage/deletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initTableFun = function () {
|
||||
var $table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/groupManage/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
bizId: companyId,
|
||||
}
|
||||
},
|
||||
//sortName: 'id', // 要排序的字段
|
||||
//sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sdt', // 返回json数据中的name
|
||||
title: '开始时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'edt', // 返回json数据中的name
|
||||
title: '结束时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//公司
|
||||
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {}, function (data) {
|
||||
var selelct = $("#companyid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.on("change", function (e) {
|
||||
companyId = $("#companyid").val();
|
||||
initTableFun();
|
||||
});
|
||||
if (data.length == 1) {
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
$("#companyid").next().css("display", "none");
|
||||
selelct.attr("disabled", "disabled");
|
||||
var companyText = $("#companyid").text();
|
||||
companyId = data[0].id;
|
||||
initTableFun();
|
||||
$("#company").text(companyText);
|
||||
$("#companylabel").html("厂区:");
|
||||
} else {
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
$("#company").css("display", "none");
|
||||
companyId = data[0].id;
|
||||
initTableFun();
|
||||
};
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' });
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/side.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="addDiv"></div>
|
||||
<div id="editDiv"></div>
|
||||
<div>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<label class="form-label" id="companylabel">厂区</label>
|
||||
<select class="form-control select2 " id="companyid" name="companyid"
|
||||
style="width: 220px;"></select>
|
||||
<span class="select2-selection select2-selection--single" id="company"
|
||||
style="width:220px;border: none;background: transparent;"></span>
|
||||
</div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i>新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-warning"></i>删除</button>
|
||||
</div>
|
||||
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
84
WebRoot/jsp/work/groupManageListForSelect.jsp
Normal file
84
WebRoot/jsp/work/groupManageListForSelect.jsp
Normal file
@ -0,0 +1,84 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id+'"}';
|
||||
});
|
||||
//alert(datas);
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
}
|
||||
var groupManage = function(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工段维护',
|
||||
url : ext.contextPath + '/work/groupManage/showlist.do',
|
||||
width:1200,
|
||||
height:600
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/groupManage/getlistForSelect.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : false,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '100', title : '开始时间', field : 'sdt', sortable : true, halign:'center',align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(value.length>6){
|
||||
str = value.substring(0,5);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '100', title : '结束时间', field : 'edt', sortable : true, halign:'center',align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(value.length>6){
|
||||
str = value.substring(0,5);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<input id="userids" name="userids" type="hidden" />
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
193
WebRoot/jsp/work/groupMemberListForScheduling.jsp
Normal file
193
WebRoot/jsp/work/groupMemberListForScheduling.jsp
Normal file
@ -0,0 +1,193 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"userid":"'+item.userid +'","usertype":"'+item.usertype +'","username":"'+item.username +'"},';
|
||||
});
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
}
|
||||
|
||||
var grid;
|
||||
var stationlist;
|
||||
var getworkstationFun = function() {
|
||||
$.post(ext.contextPath + '/work/group/getworkstation.do', {} , function(data) {
|
||||
stationlist=eval(data);
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
getworkstationFun();
|
||||
$('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid=${groupid}&userids=${userids}&workstationids=${workstationids}',
|
||||
striped : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
|
||||
if(value=='leader'){
|
||||
return "组长";
|
||||
}else{
|
||||
return "组员";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'},
|
||||
{width : '180', title : '人员工位', field : 'workstationid', sortable : false, halign:'center',
|
||||
formatter:function(value,row){
|
||||
var te;
|
||||
for(var i=0;i<stationlist.length;i++){
|
||||
if(value==stationlist[i].id){
|
||||
te=stationlist[i].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return te;
|
||||
},
|
||||
editor:{type:'combobox',
|
||||
options:{url:ext.contextPath + '/work/group/getworkstation.do',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get',
|
||||
required:false,
|
||||
}
|
||||
}
|
||||
}
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
var userids='${userids}';
|
||||
var userid;
|
||||
if(userids!=""){
|
||||
userid=userids.split(',');
|
||||
}
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checkflag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
//if(grid.datagrid('getSelected')==null){
|
||||
// grid.datagrid('selectRow',0);
|
||||
//}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
if (field != "workstationid" )
|
||||
{
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
endEditing();
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
//alert("行号:"+rowIndex);
|
||||
editIndex = rowIndex;
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'workstationid' });
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined)
|
||||
{ return true; }
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'workstationid' });
|
||||
var number = $(ed.target).combobox('getValue');
|
||||
//alert();
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationid'] = number;
|
||||
var numbern = $(ed.target).combobox('getText');
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationname'] = numbern;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var dosave = function(dialog,grid) {
|
||||
//若用户未确认编辑状态,则自动完成编辑
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'workstationid' });
|
||||
if(ed!=null){
|
||||
var number = $(ed.target).combobox('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationid'] = number;
|
||||
var numbern = $(ed.target).combobox('getText');
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationname'] = numbern;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
}
|
||||
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var stationids="";
|
||||
var errorflag="";//标记是否勾选选人员未设置工位
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.userid+",";
|
||||
stationids+=item.workstationid+",";
|
||||
if(item.workstationid==""){
|
||||
errorflag="error";
|
||||
}
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请选择至少一名成员','info');
|
||||
}else if(errorflag!=""){
|
||||
top.$.messager.alert('提示', '已选的人员中有人员未设置工位!','info');
|
||||
}else{
|
||||
var res=JSON.stringify(checkedItems);
|
||||
//alert(res);
|
||||
$.post(ext.contextPath + '/work/group/saveuserworkstation.do', {ids:datas,stationids:stationids} , function(data) {
|
||||
if(data==1){
|
||||
//top.$.messager.alert('提示','保存成功','info');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
top.$.messager.alert('提示','信息提交失败','info');
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" >
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
182
WebRoot/jsp/work/groupTimeAdd.jsp
Normal file
182
WebRoot/jsp/work/groupTimeAdd.jsp
Normal file
@ -0,0 +1,182 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('sdt', 'NOT_VALIDATED',null)
|
||||
.validateField('sdt');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('edt', 'NOT_VALIDATED',null)
|
||||
.validateField('edt');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('grouptypeName', 'NOT_VALIDATED',null)
|
||||
.validateField('grouptypeName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupTime/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
// showAlert('s','保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function(formId,hiddenId,textId) {
|
||||
$.post(ext.contextPath + '/work/groupType/showGroupType4Select.do', { formId: formId, hiddenId: hiddenId, textId: textId }, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("menu4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$('#sdt').timepicker({
|
||||
showMeridian: false
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('sdt', 'NOT_VALIDATED', null)
|
||||
.validateField('sdt');
|
||||
});
|
||||
//日期格式需对齐,不然会不准
|
||||
$('#edt').timepicker({
|
||||
showMeridian: false
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('edt', 'NOT_VALIDATED', null)
|
||||
.validateField('edt');
|
||||
});
|
||||
});
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '开始时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
edt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '结束时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
grouptypeName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '班组类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
edtadd: {
|
||||
validators: {
|
||||
callback:{
|
||||
callback : function(value, validator, $field) {
|
||||
if (Number(value)==0||Number(value)==1){
|
||||
return true
|
||||
}else{
|
||||
return {
|
||||
valid: false,
|
||||
message: '只能输入0或者1!'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">新增班次</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${groupTime.id}">
|
||||
<input type="hidden" class="form-control" id="unitId" name ="unitId" value ="${param.unitId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="name" name ="name" value="${groupTime.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*班组类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="grouptypeId" name="grouptypeId" type="hidden" value="${groupTime.grouptypeId}" />
|
||||
<input class="form-control" type="text" id="grouptypeName" name ="grouptypeName" value="${groupTime.groupType.name}" onclick="showEquipment4SelectsFun('subForm','grouptypeId','grouptypeName');" placeholder="选择班组类型">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*开始时间</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="sdt" name ="sdt" value="${groupTime.sdt}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*结束时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-7" style="padding-left: 0px;">
|
||||
<input class="form-control" type="text" id="edt" name ="edt" value="${groupTime.edt}">
|
||||
</div>
|
||||
<div class="col-sm-5" style="padding-left: 0px;padding-right: 0px;">
|
||||
<div style="float: left;width: 80%;">
|
||||
<input class="form-control" type="number" id="edtadd" name ="edtadd" value="0">
|
||||
</div>
|
||||
<div style="float: left;width: 20%;line-height: 34px;"> 天</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">延长时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div style="float: left;width: 80%;">
|
||||
<input class="form-control" type="number" id="timeexpand" name ="timeexpand" value="60">
|
||||
</div>
|
||||
<div style="float: left;width: 20%;line-height: 34px;"> 分钟</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
193
WebRoot/jsp/work/groupTimeEdit.jsp
Normal file
193
WebRoot/jsp/work/groupTimeEdit.jsp
Normal file
@ -0,0 +1,193 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('sdt', 'NOT_VALIDATED', null)
|
||||
.validateField('sdt');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('edt', 'NOT_VALIDATED', null)
|
||||
.validateField('edt');
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('grouptypeName', 'NOT_VALIDATED', null)
|
||||
.validateField('grouptypeName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupTime/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
// showAlert('s', '保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//选择设备,根据厂区id和工艺段id选择厂内设备,可多选
|
||||
var showEquipment4SelectsFun = function (formId, hiddenId, textId) {
|
||||
$.post(ext.contextPath + '/work/groupType/showGroupType4Select.do', {
|
||||
formId: formId,
|
||||
hiddenId: hiddenId,
|
||||
textId: textId
|
||||
}, function (data) {
|
||||
$("#equ4SelectDiv").html(data);
|
||||
openModal("menu4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$('#sdt').timepicker({
|
||||
showMeridian: false
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('sdt', 'NOT_VALIDATED', null)
|
||||
.validateField('sdt');
|
||||
});
|
||||
//日期格式需对齐,不然会不准
|
||||
$('#edt').timepicker({
|
||||
showMeridian: false
|
||||
}).on('hide', function (e) {
|
||||
//当日期选择框关闭时,执行刷新校验
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('edt', 'NOT_VALIDATED', null)
|
||||
.validateField('edt');
|
||||
});
|
||||
});
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
sdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '开始时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
edt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '结束时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
grouptypeName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '班组类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
edtadd: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (value, validator, $field) {
|
||||
if (Number(value) == 0 || Number(value) == 1) {
|
||||
return true
|
||||
} else {
|
||||
return {
|
||||
valid: false,
|
||||
message: '只能输入0或者1!'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">编辑班组类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${groupTime.id}">
|
||||
<input type="hidden" class="form-control" id="unitId" name="unitId" value="${groupTime.unitId}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="name" name="name" value="${groupTime.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*班组类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="grouptypeId" name="grouptypeId" type="hidden"
|
||||
value="${groupTime.grouptypeId}"/>
|
||||
<input class="form-control" type="text" id="grouptypeName" name="grouptypeName"
|
||||
value="${groupTime.groupType.name}"
|
||||
onclick="showEquipment4SelectsFun('subForm','grouptypeId','grouptypeName');"
|
||||
placeholder="选择班组类型">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*开始时间</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="sdt" name="sdt" value="${groupTime.sdt}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*结束时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-7" style="padding-left: 0px;">
|
||||
<input class="form-control" type="text" id="edt" name="edt" value="${groupTime.edt}">
|
||||
</div>
|
||||
<div class="col-sm-5" style="padding-left: 0px;padding-right: 0px;">
|
||||
<div style="float: left;width: 80%;">
|
||||
<input class="form-control" type="number" id="edtadd" name="edtadd"
|
||||
value="${groupTime.edtadd}">
|
||||
</div>
|
||||
<div style="float: left;width: 20%;line-height: 34px;"> 天</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">延长时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div style="float: left;width: 80%;">
|
||||
<input class="form-control" type="number" id="timeexpand" name="timeexpand"
|
||||
value="${groupTime.timeexpand}">
|
||||
</div>
|
||||
<div style="float: left;width: 20%;line-height: 34px;"> 分钟</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
276
WebRoot/jsp/work/groupTimeList.jsp
Normal file
276
WebRoot/jsp/work/groupTimeList.jsp
Normal file
@ -0,0 +1,276 @@
|
||||
<%@ 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"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<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;
|
||||
}
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/work/groupTime/doadd.do', {unitId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/groupTime/doedit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/groupTime/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/groupTime/dodelete.do', {id : id}, function(data) {
|
||||
if(data.code=="1"){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
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/groupTime/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data.code>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function() {
|
||||
initFun();
|
||||
});
|
||||
var initFun = function(){
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/groupTime/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(),
|
||||
unitId: unitId,
|
||||
// pSectionId: $("#processSection").val(),
|
||||
// statusSelect:$("#statusSelect").val(),
|
||||
}
|
||||
},
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
sortName: 'grouptype_id,sdt', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '所属', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'groupType.name', // 返回json数据中的name
|
||||
title: '班组类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'sdt', // 返回json数据中的name
|
||||
title: '开始时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,5)
|
||||
}
|
||||
},{
|
||||
field: 'edt', // 返回json数据中的name
|
||||
title: '结束时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,5)
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
|
||||
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+='<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='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="library4SelectDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div >
|
||||
<!-- <div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" />
|
||||
<span id="companyName" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div> -->
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
</html>
|
||||
42
WebRoot/jsp/work/groupType4Select.jsp
Normal file
42
WebRoot/jsp/work/groupType4Select.jsp
Normal file
@ -0,0 +1,42 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var selectMenu = function() {
|
||||
|
||||
alert('${param.hiddenId}'+'${param.textId}');
|
||||
}
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/work/groupType/getGroupTypeTree.do', {ng:''} , function(data) {
|
||||
// console.info(data);
|
||||
if(data.length>0){
|
||||
$('#menu_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#menu_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("menu4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="menu4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择班组类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="menu_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
138
WebRoot/jsp/work/groupTypeAdd.jsp
Normal file
138
WebRoot/jsp/work/groupTypeAdd.jsp
Normal file
@ -0,0 +1,138 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupType/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
|
||||
function initFun() {
|
||||
$.post(ext.contextPath + "/user/processSection/getPatrolType4SelectAndNull.do", {}, function (data) {
|
||||
$("#patroltype").empty();
|
||||
var selelct_1 = $("#patroltype").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_1.trigger("change");
|
||||
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">新增班组类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="name" name="name" value="${groupType.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="code" name="code" value="${groupType.code}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">巡检类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="patroltype" name="patroltype"
|
||||
style="width: 170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="number" id="morder" name="morder"
|
||||
value="${groupType.morder}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark"
|
||||
placeholder="备注">${groupType.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
146
WebRoot/jsp/work/groupTypeEdit.jsp
Normal file
146
WebRoot/jsp/work/groupTypeEdit.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/groupType/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
|
||||
function initFun() {
|
||||
console.log('in');
|
||||
$.post(ext.contextPath + "/user/processSection/getPatrolType4SelectAndNull.do", {}, function (data) {
|
||||
$("#patroltype").empty();
|
||||
var selelct_1 = $("#patroltype").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_1.val("${groupType.patroltype}").trigger("change");//设置选中
|
||||
// patrolType = $("#patrolType").val();
|
||||
// selelct_1.on("change", function (e) {
|
||||
// patrolType = $("#patrolType").val();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// });
|
||||
|
||||
}, 'json');
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">编辑班组类型</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name="id" value="${groupType.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="name" name="name" value="${groupType.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="code" name="code" value="${groupType.code}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">巡检类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2 " id="patroltype" name="patroltype"
|
||||
style="width: 170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="number" id="morder" name="morder"
|
||||
value="${groupType.morder}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="remark" name="remark"
|
||||
placeholder="备注">${groupType.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
275
WebRoot/jsp/work/groupTypeList.jsp
Normal file
275
WebRoot/jsp/work/groupTypeList.jsp
Normal file
@ -0,0 +1,275 @@
|
||||
<%@ 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" %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<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;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/groupType/doadd.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/groupType/doedit.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/groupType/doview.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/groupType/dodelete.do', {id: id}, function (data) {
|
||||
if (data.code == "1") {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
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/groupType/dodeletes.do', {ids: datas}, function (data) {
|
||||
if (data.code > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/groupType/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()
|
||||
}
|
||||
},
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'user.caption', // 返回json数据中的name
|
||||
title: '创建人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '创建时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
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 = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="library4SelectDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div>
|
||||
<!-- <div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_pid" name="search_pid" type="hidden" />
|
||||
<span id="companyName" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div> -->
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
179
WebRoot/jsp/work/hisCameraView.jsp
Normal file
179
WebRoot/jsp/work/hisCameraView.jsp
Normal file
@ -0,0 +1,179 @@
|
||||
<%@ 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>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var websocket = null;
|
||||
var beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
$(function () {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
$('#videos').css('width', width);
|
||||
$('#videos').css('height', height);
|
||||
|
||||
if ('${time}' != "") {
|
||||
beginTimeStore = '${time}'
|
||||
} else {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore = moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
|
||||
// endTimeStore = moment().format('YYYY-MM-DD HH:mm');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
// "timePickerIncrement": 10,
|
||||
"singleDatePicker": true,
|
||||
"locale": locale,
|
||||
// //汉化按钮部分
|
||||
// ranges: {
|
||||
// '今日': [moment().subtract(1, 'days'), moment()],
|
||||
// '昨日': [moment().subtract(2, 'days'), moment().subtract(1, 'days')],
|
||||
// '最近7日': [moment().subtract(7, 'days'), moment()],
|
||||
// '本月': [moment().startOf('month'), moment().endOf('month')],
|
||||
// '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
// },
|
||||
startDate: beginTimeStore,
|
||||
// endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
// endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format));
|
||||
}
|
||||
websocket.close();
|
||||
viewThisCamera('${id}', '${online}');
|
||||
});
|
||||
$('#reservationtime').val(beginTimeStore);
|
||||
|
||||
viewThisCamera('${id}', '${online}');
|
||||
})
|
||||
|
||||
$(window).resize(function () {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
$('#videos').css('width', width);
|
||||
$('#videos').css('height', height);
|
||||
});
|
||||
|
||||
function viewThisCamera(id, online) {
|
||||
// console.log(id + '---' + online);
|
||||
if (!online) {
|
||||
swal('该摄像头无法连接。');
|
||||
return;
|
||||
}
|
||||
var restartDialog;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var time = beginTimeStore;
|
||||
console.log("time is ", time)
|
||||
$.post(ext.contextPath + '/work/camera/getCameraById.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
var camera = JSON.parse(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/work/camera/isNet.do?nowUrl=" + window.location.host,
|
||||
async: false,
|
||||
globle: false,
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
let hostUrl = window.location.href;
|
||||
if (hostUrl.substring(0, 5) == 'https') {
|
||||
data.url = data.url.replace('ws', 'wss');
|
||||
}
|
||||
if (camera.cameraNVR == '' || camera.cameraNVR == null) {
|
||||
cameraUrl = "" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/${param.definitionSt}";
|
||||
} else {
|
||||
cameraUrl = "" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.cameraNVR.ip + "/" + camera.cameraNVR.username + "/" + camera.cameraNVR.password + "/" + camera.cameraNVR.channel + "/" + time + "/${uuid}" + "/${param.definitionSt}";
|
||||
}
|
||||
websocket = new WebSocket(cameraUrl);
|
||||
<%--websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.cameraNVR.ip + "/" + camera.cameraNVR.username + "/" + camera.cameraNVR.password + "/" + camera.cameraNVR.channel + "/" + time + "/${uuid}" + "/${param.definitionSt}");--%>
|
||||
<%--console.log("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/${param.definitionSt}")--%>
|
||||
<%--if (data.type == '1') {--%>
|
||||
<%-- websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.url + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/${param.definitionSt}");--%>
|
||||
<%--} else if (data.type == '2') {--%>
|
||||
<%-- websocket = new WebSocket("" + data.url + "/videoWebSocket/" + camera.type + "/" + camera.netUrl + "/" + camera.username + "/" + camera.password + "/" + camera.channel + "/" + time + "/${uuid}" + "/${param.definitionSt}");--%>
|
||||
<%--}--%>
|
||||
}
|
||||
});
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result = JSON.parse(event.data);
|
||||
$("#show_video_his").attr("src", event.data);
|
||||
}
|
||||
})
|
||||
<%--websocket = new WebSocket(ext.basePath.replace("http", "ws") + "/videoWebSocket/" + id + "/" + time + "/${uuid}");--%>
|
||||
} else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body style="background-color: rgb(23, 39, 55);">
|
||||
<div id="videos" style="float: left;background-color: rgb(23, 39, 55);">
|
||||
<div style="width: 100%;height: 34px;float: left;background-color: rgb(23, 39, 55);">
|
||||
<label style="color: #FFFFFF;float: left;margin-left: 5px;line-height: 34px;">回放时间</label>
|
||||
<input type="text" class="form-control pull-left" id="reservationtime"
|
||||
style="width:150px;background-color: rgb(23, 39, 55);color: #FFFFFF;margin-left: 5px;">
|
||||
<%-- <div class="input-group-btn pull-left">--%>
|
||||
<%-- <button style="background-color: rgb(23, 39, 55);color: #FFFFFF" type="button" class="btn btn-default"--%>
|
||||
<%-- onclick="showHisCamera();"><i--%>
|
||||
<%-- class="fa fa-search"></i> 查询--%>
|
||||
<%-- </button>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div style="width: 100%;height: calc(100% - 34px);float: left;background-color: rgb(23, 39, 55);" id="video_1">
|
||||
<img id="show_video_his" style="width: 100%;height: 100%;" src="">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
396
WebRoot/jsp/work/kPointList.jsp
Normal file
396
WebRoot/jsp/work/kPointList.jsp
Normal file
@ -0,0 +1,396 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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 viewFun = function(id) {
|
||||
console.info(id)
|
||||
$.post(ext.contextPath + '/work/mpoint/showHistory.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var addFun = function() {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/add.do', {companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/edit.do', {id:id,bizId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
var propFun = function(id) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mPointProp/doedit.do', {id:id,companyId:companyId} , 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 + '/work/mpoint/deletes.do', {ids:datas,bizId:companyId} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
initFun();
|
||||
};
|
||||
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'})
|
||||
};
|
||||
var companyId = "";
|
||||
var initFun = function () {
|
||||
$.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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
}, 'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getKPIList.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: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.mpointcode);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '采集时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,19);
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 150, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts="";
|
||||
buts+= '<security:authorize buttonUrl="work/mpoint/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/mpoint/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="配置评价指标" onclick="propFun(\'' + row.id + '\')"><i class="fa fa-pencil"></i><span class="hidden-md hidden-lg"> 配置评价指标</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
$(function() {
|
||||
$("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
search_code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
$('#companySelectTree').html(data);
|
||||
|
||||
});
|
||||
//init();
|
||||
/* $.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({
|
||||
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');
|
||||
}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'); */
|
||||
|
||||
|
||||
});
|
||||
</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="subSourceDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div >
|
||||
<!-- <div class="form-group form-inline">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div> -->
|
||||
<div id="companySelectTree">
|
||||
|
||||
</div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/mpoint/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 class="form-group pull-right form-inline" >
|
||||
<!-- <div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 120px;"></select>
|
||||
</div> -->
|
||||
<div class="form-group" >
|
||||
<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>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 引入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>
|
||||
<!-- 引入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>
|
||||
|
||||
</html>
|
||||
297
WebRoot/jsp/work/lineAdd.jsp
Normal file
297
WebRoot/jsp/work/lineAdd.jsp
Normal file
@ -0,0 +1,297 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>xxx</title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
//获取已选的工位id
|
||||
function getWids(){
|
||||
var wrows= $('#grid').datagrid("getRows");
|
||||
var wids="";
|
||||
$.each(wrows, function(index, item){
|
||||
wids+=item.id+",";
|
||||
});
|
||||
wids=wids.replace(/,$/gi,"");
|
||||
return wids;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getQids(){
|
||||
var qrows= $('#gridp').datagrid("getRows");
|
||||
var qids="";
|
||||
$.each(qrows, function(index, item){
|
||||
qids+=item.id+",";
|
||||
});
|
||||
qids=qids.replace(/,$/gi,"");
|
||||
return qids;
|
||||
}
|
||||
|
||||
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/line/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
|
||||
|
||||
|
||||
$.post(ext.contextPath + "/work/line/saveWorkstation.do",{lineid:data.id,wids:getWids(),qids:getQids()},function(data1){
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
gridp.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function doadd_Q(){
|
||||
$("#mids").val(getQids());
|
||||
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
|
||||
/* var qrows= gridp.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < qrows.length; j++) {
|
||||
copyRows.push(qrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
gridp.datagrid('deleteRow', gridp.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
var checkedItems = $('#gridp').datagrid('getChecked'); */
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?iframeId=lineAdd',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
console.log('enter',datas);
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
gridp.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
equipmentcardid:datas[i].equipmentcardid,
|
||||
equipmentname:datas[i].equipmentname,
|
||||
equipmentmodel:datas[i].equipmentmodel,
|
||||
equipmentclassid:datas[i].equipmentclass,
|
||||
areaid:datas[i].geographyarea
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function dodelete_Q(){
|
||||
var rows = $('#gridp').datagrid('getChecked');
|
||||
if(rows.length==0){
|
||||
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
||||
}else{
|
||||
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
||||
if (r) {
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < rows.length; j++) {
|
||||
copyRows.push(rows[j]);
|
||||
}
|
||||
|
||||
$.each(copyRows, function(index, item){
|
||||
$('#gridp').datagrid('deleteRow',$('#gridp').datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function doadd_W(){
|
||||
|
||||
$("#wids").val(getWids());
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工位',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelects.do?iframeId=lineAdd',
|
||||
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
if(data.res.length>0){
|
||||
for(var i=0;i<data.res.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:data.res[i].id,
|
||||
serial:data.res[i].serial,
|
||||
name:data.res[i].name,
|
||||
typename:data.res[i].typename,
|
||||
deptname:data.res[i].deptname
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
|
||||
function dodelete_W(){
|
||||
var rows = $('#grid').datagrid('getChecked');
|
||||
if(rows.length==0){
|
||||
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
||||
}else{
|
||||
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
||||
if (r) {
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < rows.length; j++) {
|
||||
copyRows.push(rows[j]);
|
||||
}
|
||||
|
||||
$.each(copyRows, function(index, item){
|
||||
$('#grid').datagrid('deleteRow',$('#grid').datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto'
|
||||
});
|
||||
|
||||
$('#insertp').panel({
|
||||
width:"100%",
|
||||
height:"165",
|
||||
title: '相关设备',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_Q();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_Q();}
|
||||
}]
|
||||
});
|
||||
|
||||
gridp = $('#gridp').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备类型', field : 'equipmentclassid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '存放位置', field : 'areaid', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ]
|
||||
});
|
||||
|
||||
$('#p').panel({
|
||||
width:"100%",
|
||||
height:"170",
|
||||
title: '相关工位',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_W();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_W();}
|
||||
}]
|
||||
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '140', title : '工位编号', field : 'serial', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '180', title : '工位名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '工位类型', field : 'typename', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产线名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产线工序编号</th>
|
||||
<td><input name="serial" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input name="remark" class="easyui-textbox" style="width:100%;height:25px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="insertp">
|
||||
<table id="gridp" data-options="border:false"></table>
|
||||
</div>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
295
WebRoot/jsp/work/lineEdit.jsp
Normal file
295
WebRoot/jsp/work/lineEdit.jsp
Normal file
@ -0,0 +1,295 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" 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"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
//获取已选的工位id
|
||||
function getWids(){
|
||||
var rows= $('#grid').datagrid("getRows");
|
||||
var wids="";
|
||||
$.each(rows, function(index, item){
|
||||
wids+=item.id+",";
|
||||
});
|
||||
wids=wids.replace(/,$/gi,"");
|
||||
return wids;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getQids(){
|
||||
var qrows= $('#gridp').datagrid("getRows");
|
||||
var qids="";
|
||||
$.each(qrows, function(index, item){
|
||||
qids+=item.id+",";
|
||||
});
|
||||
qids=qids.replace(/,$/gi,"");
|
||||
return qids;
|
||||
}
|
||||
|
||||
function doupdate(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/line/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/work/line/saveWorkstation.do",{lineid:data.id,wids:getWids(),qids:getQids()},function(data1){
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
});
|
||||
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function doadd_Q(){
|
||||
|
||||
$("#mids").val(getQids());
|
||||
|
||||
/* localStorage.setItem("mids",$("#mids").val());
|
||||
var rows= gridp.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < rows.length; j++) {
|
||||
copyRows.push(rows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
gridp.datagrid('deleteRow', gridp.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
var checkedItems = $('#gridp').datagrid('getChecked'); */
|
||||
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
console.log('enter',datas);
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
gridp.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
equipmentcardid:datas[i].equipmentcardid,
|
||||
equipmentname:datas[i].equipmentname,
|
||||
equipmentmodel:datas[i].equipmentmodel,
|
||||
equipmentclassid:datas[i].equipmentclass,
|
||||
areaid:datas[i].geographyarea
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
|
||||
function dodelete_Q(){
|
||||
var rows = $('#gridp').datagrid('getChecked');
|
||||
if(rows.length==0){
|
||||
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
||||
}else{
|
||||
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
||||
if (r) {
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < rows.length; j++) {
|
||||
copyRows.push(rows[j]);
|
||||
}
|
||||
|
||||
$.each(copyRows, function(index, item){
|
||||
$('#gridp').datagrid('deleteRow',$('#gridp').datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function doadd_W(){
|
||||
$("#wids").val(getWids());
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工位',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelects.do?iframeId=lineEdit',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
if(data.res.length>0){
|
||||
for(var i=0;i<data.res.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:data.res[i].id,
|
||||
serial:data.res[i].serial,
|
||||
name:data.res[i].name,
|
||||
typename:data.res[i].typename,
|
||||
deptname:data.res[i].deptname
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
|
||||
function dodelete_W(){
|
||||
var rows = $('#grid').datagrid('getChecked');
|
||||
if(rows.length==0){
|
||||
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
||||
}else{
|
||||
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
||||
if (r) {
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < rows.length; j++) {
|
||||
copyRows.push(rows[j]);
|
||||
}
|
||||
|
||||
$.each(copyRows, function(index, item){
|
||||
$('#grid').datagrid('deleteRow',$('#grid').datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
var value ="${line.workshopid}";
|
||||
if(value!=null && value!=""){
|
||||
$("#workshopid").combobox('setValue',value);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
$('#insertp').panel({
|
||||
width:"100%",
|
||||
height:"165",
|
||||
title: '相关设备',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_Q();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_Q();}
|
||||
}]
|
||||
});
|
||||
|
||||
gridp = $('#gridp').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '设备类型', field : 'equipmentclassid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '存放位置', field : 'areaid', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ],
|
||||
data:${equipmentcardList}
|
||||
|
||||
});
|
||||
|
||||
$('#p').panel({
|
||||
width:"100%",
|
||||
height:"150px",
|
||||
title: '相关工位',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_W();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_W();}
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '130', title : '工位编号', field : 'serial', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '工位名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '工位类型', field : 'typename', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '170', title : '所属车间', field : 'deptname', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ],
|
||||
data:${workstationList}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${line.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产线名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${line.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产线工序编号</th>
|
||||
<td><input name="serial" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${line.serial}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<textarea name="remark" class="easyui-textbox" data-options="multiline:true" style="height:25px;width:100%" validtype="length[0,250]" invalidMessage="有效长度0-250">${line.remark}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="insertp">
|
||||
<table id="gridp" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</P>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
190
WebRoot/jsp/work/lineList.jsp
Normal file
190
WebRoot/jsp/work/lineList.jsp
Normal file
@ -0,0 +1,190 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加产线',
|
||||
iframeId:"lineAdd",
|
||||
url : ext.contextPath + '/work/line/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑产线',
|
||||
iframeId:"lineEdit",
|
||||
url : ext.contextPath + '/work/line/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doupdate(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/line/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/line/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/line/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/line/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '产线名称', field : 'name', halign:'center'},
|
||||
{width : '100', title : '产线工序编号', field : 'serial', halign:'center'},
|
||||
{width : '100', title : '产线工序编号', field : 'workshopname', halign:'center', formatter : function(value, row) {
|
||||
return row.workShop.name;
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/line/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/line/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#search_pid").tree("search_pid");
|
||||
}
|
||||
},
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/line/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/line/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>产线名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
379
WebRoot/jsp/work/mPointAdd.jsp
Normal file
379
WebRoot/jsp/work/mPointAdd.jsp
Normal file
@ -0,0 +1,379 @@
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql", MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus", MPoint.Flag_Modbus);%>
|
||||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||||
<%request.setAttribute("Flag_Type_Model", MPoint.Flag_Type_Model);%>
|
||||
<%request.setAttribute("Flag_BizType_Hand", MPoint.Flag_BizType_Hand);%>
|
||||
<%request.setAttribute("Flag_BizType_Auto", MPoint.Flag_BizType_Auto);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//初始化转发类型选择框
|
||||
var refreshBizTypeSelect = function () {
|
||||
var select = $("#biztype1").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
//select.val('${Flag_BizType_Auto}').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
if ($("#biztype1").val() == '${Flag_BizType_Auto}') {
|
||||
$("#biztype2").val('');
|
||||
} else {
|
||||
$("#biztype2").val($("#biztype1").val());
|
||||
}
|
||||
});
|
||||
};
|
||||
var selectEM = function (companyId) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showEquipmentCardForMpointSelect.do', {
|
||||
companyId: companyId,
|
||||
equipmentId: $("#equipmentid").val()
|
||||
}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mpoint/save.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
id: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: 'ID不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点id不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
mpointcode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点code不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
parmname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
active: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '启用状态不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
refreshBizTypeSelect();
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, function (data) {
|
||||
$("#processsectioncode").empty();
|
||||
var selelct_ = $("#processsectioncode").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) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// });
|
||||
|
||||
}, 'json');
|
||||
|
||||
$("#sourceType").select2({
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 验证是否输入的为汉字
|
||||
* @param str
|
||||
* @returns {string}
|
||||
*/
|
||||
function check(str, name) {
|
||||
var temp = ""
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 255) {
|
||||
temp += str.charAt(i)
|
||||
} else {
|
||||
alert(name + '无法输入汉字');
|
||||
return temp
|
||||
}
|
||||
}
|
||||
return temp
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*ID</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="id" name="id" value="${mPoint.id}"
|
||||
autocomplete="off" onkeyup="this.value=check(this.value,'ID')">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*隶属</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="bizidname" name="bizidname"
|
||||
value="${company.name}" readonly>
|
||||
<input class="form-control" type="hidden" id="bizid" name="bizid" value="${company.id}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*mpointid</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="mpointid" name="mpointid"
|
||||
value="${mPoint.mpointid}" autocomplete="off"
|
||||
onkeyup="this.value=check(this.value,'mpointid')">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*mpointcode</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="mpointcode" name="mpointcode"
|
||||
value="${mPoint.mpointcode}" autocomplete="off"
|
||||
onkeyup="this.value=check(this.value,'mpointcode')">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="parmname" name="parmname"
|
||||
value="${mPoint.parmname}" autocomplete="off">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">简称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="disname" name="disname"
|
||||
value="${mPoint.disname}" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="processsectioncode" name="processsectioncode"
|
||||
style="width: 270px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">含义</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="valuemeaning" name="valuemeaning"
|
||||
value="${mPoint.valuemeaning}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*信号类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="signaltype" name="signaltype" class="form-control select2">
|
||||
<option value="AI">AI</option>
|
||||
<option value="DI">DI</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">信号标签</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="signaltag" name="signaltag"
|
||||
value="${mPoint.signaltag}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="alarmmax" name="alarmmax"
|
||||
value="${mPoint.alarmmax}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="alarmmin" name="alarmmin"
|
||||
value="${mPoint.alarmmin}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警超上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="halarmmax" name="halarmmax"
|
||||
value="${mPoint.halarmmax}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警超下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="lalarmmin" name="lalarmmin"
|
||||
value="${mPoint.lalarmmin}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">量程上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="forcemax" name="forcemax"
|
||||
value="${mPoint.forcemax}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">量程下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="forcemin" name="forcemin"
|
||||
value="${mPoint.forcemin}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">精度</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="numtail" name="numtail" value="0"
|
||||
placeholder="1/2/3/4">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">倍率</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="rate" name="rate" value="${mPoint.rate}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采集类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="sourceType" name="sourceType" class="form-control select2"
|
||||
style="width: 270px;">
|
||||
<option value="${Flag_Type_Data}">自控采集点</option>
|
||||
<option value="${Flag_Type_Hand}">手动录入点</option>
|
||||
<option value="${Flag_Type_KPI}">KPI计算点</option>
|
||||
<option value="${Flag_Type_Model}">模型预测点</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">信号源</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="valuetype" name="valuetype" class="form-control select2">
|
||||
<option value="sql">数据库</option>
|
||||
<option value="Modbus">Modbus</option>
|
||||
<option value="OPC">OPC</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">单位</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="unit" name="unit" value="${mPoint.unit}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">关联设备</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="equipmentname" name="equipmentname"
|
||||
value="${equipmentCard.equipmentname}" onclick="selectEM('${company.id}')"
|
||||
placeholder="单击选择" readonly/>
|
||||
<input class="form-control" id="equipmentid" name="equipmentid" type="hidden"
|
||||
value="${mPoint.equipmentid}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="triggeralarm" name="triggeralarm" class="form-control select2">
|
||||
<option value="${Active_True}">开启</option>
|
||||
<option value="${Active_False}">关闭</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="active" name="active" class="form-control select2">
|
||||
<option value="${Flag_Enable}">启用</option>
|
||||
<option value="${Flag_Disable}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">网关编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="biztype" name="biztype"
|
||||
value="${mPoint.biztype}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">数值取反</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="directtype" name="directtype" class="form-control select2">
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
528
WebRoot/jsp/work/mPointEdit.jsp
Normal file
528
WebRoot/jsp/work/mPointEdit.jsp
Normal file
@ -0,0 +1,528 @@
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
<%@ page language="java" import="java.util.*" 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" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql", MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus", MPoint.Flag_Modbus);%>
|
||||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||||
<%request.setAttribute("Flag_Type_Model", MPoint.Flag_Type_Model);%>
|
||||
<%request.setAttribute("Flag_BizType_Hand", MPoint.Flag_BizType_Hand);%>
|
||||
<%request.setAttribute("Flag_BizType_Auto", MPoint.Flag_BizType_Auto);%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var selectEM = function (companyId) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showEquipmentCardForMpointSelect.do', {
|
||||
companyId: companyId,
|
||||
equipmentId: $("#equipmentid").val()
|
||||
}, function (data) {
|
||||
$("#emSubDiv").html(data);
|
||||
openModal('emSubModal');
|
||||
});
|
||||
};
|
||||
//初始化转发类型选择框
|
||||
var refreshBizTypeSelect = function () {
|
||||
var select = $("#biztype1").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
if (${mPoint.biztype == Flag_BizType_Hand}) {
|
||||
select.val('${mPoint.biztype}').trigger("change");
|
||||
} else {
|
||||
select.val('${Flag_BizType_Auto}').trigger("change");
|
||||
}
|
||||
|
||||
select.on("change", function (e) {
|
||||
if ($("#biztype1").val() == '${Flag_BizType_Auto}') {
|
||||
$("#biztype2").val('');
|
||||
} else {
|
||||
$("#biztype2").val($("#biztype1").val());
|
||||
}
|
||||
});
|
||||
};
|
||||
//初始化测量点类型选择框
|
||||
var refreshTypeSelect = function () {
|
||||
var select = $("#sourceType").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.sourceType}').trigger("change");
|
||||
|
||||
};
|
||||
//初始化启用状态选择框
|
||||
var refreshActiveSelect = function () {
|
||||
var select = $("#active").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.active}').trigger("change");
|
||||
|
||||
};
|
||||
//初始化信号类型选择框
|
||||
var refreshSignaltypeSelect = function () {
|
||||
var select = $("#signaltype").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.signaltype}').trigger("change");
|
||||
|
||||
};
|
||||
|
||||
//初始化信号源选择框
|
||||
var refreshValuetypeSelect = function () {
|
||||
var select = $("#valuetype").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.valuetype}').trigger("change");
|
||||
|
||||
};
|
||||
|
||||
//初始化数值取反选择框
|
||||
var refreshDirecttype = function () {
|
||||
var select = $("#directtype").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.directtype}').trigger("change");
|
||||
|
||||
};
|
||||
|
||||
//初始化报警状态选择框
|
||||
var refreshtriggeralarm = function () {
|
||||
var select = $("#triggeralarm").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.triggeralarm}').trigger("change");
|
||||
|
||||
};
|
||||
|
||||
//初始化信号源选择框
|
||||
var refreshvaluetype = function () {
|
||||
var select = $("#valuetype").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('${mPoint.valuetype}').trigger("change");
|
||||
|
||||
};
|
||||
|
||||
function getProcessSection() {
|
||||
//选择工艺段
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, function (data) {
|
||||
var selelct_ = $("#processsectioncode").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;
|
||||
} // 函数用于呈现当前的选择
|
||||
}).val(data).trigger("change");
|
||||
selelct_.val('${mPoint.processsectioncode }').trigger("change");
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
// selelct_.on("change", function (e) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// });
|
||||
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function update() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mpoint/update.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
id: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: 'ID不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点id不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
mpointcode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点code不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
parmname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
active: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '启用状态不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
refreshDirecttype();
|
||||
refreshActiveSelect();
|
||||
refreshSignaltypeSelect();
|
||||
refreshTypeSelect();
|
||||
refreshvaluetype();
|
||||
refreshtriggeralarm();
|
||||
// refreshValuetypeSelect();
|
||||
// refreshBizTypeSelect();
|
||||
|
||||
getProcessSection();
|
||||
})
|
||||
|
||||
/**
|
||||
* 验证是否输入的为汉字
|
||||
* @param str
|
||||
* @returns {string}
|
||||
*/
|
||||
function check(str, name) {
|
||||
var temp = ""
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 255) {
|
||||
temp += str.charAt(i)
|
||||
} else {
|
||||
alert(name + '无法输入汉字');
|
||||
return temp
|
||||
}
|
||||
}
|
||||
return temp
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*ID</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="id" name="id" value="${mPoint.id}" readonly
|
||||
onkeyup="this.value=check(this.value,'ID')">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*隶属</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="bizname" name="bizname" value="${company.name}"
|
||||
readonly>
|
||||
<input class="form-control" type="hidden" id="bizid" name="bizid" value="${mPoint.bizid}"
|
||||
readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*mpointid</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="mpointid" name="mpointid"
|
||||
value="${mPoint.mpointid}" autocomplete="off"
|
||||
onkeyup="this.value=check(this.value,'mpointid')">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*mpointcode</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="mpointcode" name="mpointcode"
|
||||
value="${mPoint.mpointcode}" readonly autocomplete="off"
|
||||
onkeyup="this.value=check(this.value,'mpointcode')">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="parmname" name="parmname"
|
||||
value="${mPoint.parmname}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">简称</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="disname" name="disname"
|
||||
value="${mPoint.disname}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属工艺段</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="processsectioncode" name="processsectioncode"
|
||||
style="width: 270px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">含义</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="valuemeaning" name="valuemeaning"
|
||||
value="${mPoint.valuemeaning}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*信号类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="signaltype" name="signaltype" class="form-control select2"
|
||||
style="width: 270px;">
|
||||
<option value="AI">AI</option>
|
||||
<option value="DI">DI</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">信号标签</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="signaltag" name="signaltag"
|
||||
value="${mPoint.signaltag}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="alarmmax" name="alarmmax"
|
||||
value="<fmt:formatNumber type="number" value="${mPoint.alarmmax}" groupingUsed="false" maxFractionDigits="2"/>">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="alarmmin" name="alarmmin"
|
||||
value="<fmt:formatNumber type="number" value="${mPoint.alarmmin}" groupingUsed="false" maxFractionDigits="2"/>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警超上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="halarmmax" name="halarmmax"
|
||||
value="<fmt:formatNumber type="number" value="${mPoint.halarmmax}" groupingUsed="false" maxFractionDigits="2"/>">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警超下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="lalarmmin" name="lalarmmin"
|
||||
value="<fmt:formatNumber type="number" value="${mPoint.lalarmmin}" groupingUsed="false" maxFractionDigits="2"/>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">量程上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="forcemax" name="forcemax"
|
||||
value="${mPoint.forcemax}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">量程下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="forcemin" name="forcemin"
|
||||
value="${mPoint.forcemin}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">精度</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="numtail" name="numtail"
|
||||
value="${mPoint.numtail}" placeholder="1/2/3/4">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">倍率</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="rate" name="rate"
|
||||
value="<fmt:formatNumber type="number" value="${mPoint.rate}" groupingUsed="false" maxFractionDigits="10"/>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采集类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="sourceType" name="sourceType" class="form-control select2"
|
||||
style="width: 270px;">
|
||||
<option value="${Flag_Type_Data}">自控采集点</option>
|
||||
<option value="${Flag_Type_Hand}">手动录入点</option>
|
||||
<option value="${Flag_Type_KPI}">KPI计算点</option>
|
||||
<option value="${Flag_Type_Model}">模型预测点</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">信号源</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="valuetype" name="valuetype" class="form-control select2" style="width: 270px;">
|
||||
<option value="sql">数据库</option>
|
||||
<option value="Modbus">Modbus</option>
|
||||
<option value="OPC">OPC</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">单位</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="unit" name="unit" value="${mPoint.unit}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">关联设备</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="equipmentname" name="equipmentname"
|
||||
value="${equipmentCard.equipmentname}" onclick="selectEM('${company.id}')"
|
||||
placeholder="单击选择" readonly/>
|
||||
<input class="form-control" id="equipmentid" name="equipmentid" type="hidden"
|
||||
value="${mPoint.equipmentid}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="triggeralarm" name="triggeralarm" class="form-control select2"
|
||||
style="width: 270px;">
|
||||
<option value="${Active_True}">开启</option>
|
||||
<option value="${Active_False}">关闭</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="active" name="active" class="form-control select2" style="width: 270px;">
|
||||
<option value="${Flag_Enable}">启用</option>
|
||||
<option value="${Flag_Disable}">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">网关编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="biztype" name="biztype"
|
||||
value="${mPoint.biztype}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">数值取反</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="directtype" name="directtype" class="form-control select2"
|
||||
style="width: 270px;">
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">点位解释</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" type="text" id="explain" name="explain"
|
||||
value="${mPointExpand.explain}">
|
||||
<input type="hidden" id="expandId" name="expandId" value="${mPointExpand.id}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="update()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
121
WebRoot/jsp/work/mPointEditModbus.jsp
Normal file
121
WebRoot/jsp/work/mPointEditModbus.jsp
Normal file
@ -0,0 +1,121 @@
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" import="java.util.*" 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" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql", MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus", MPoint.Flag_Modbus);%>
|
||||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||||
<%request.setAttribute("Flag_BizType_Hand", MPoint.Flag_BizType_Hand);%>
|
||||
<%request.setAttribute("Flag_BizType_Auto", MPoint.Flag_BizType_Auto);%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
// refreshTypeSelect();
|
||||
// refreshActiveSelect();
|
||||
// refreshSignaltypeSelect();
|
||||
// refreshValuetypeSelect();
|
||||
// refreshBizTypeSelect();
|
||||
|
||||
$("#modbusfigid").select2({minimumResultsForSearch: -1}).val("${mPoint.modbusfigid}").trigger("change");
|
||||
|
||||
$.post(ext.contextPath + "/work/mpoint/getJson.do", {}, function (data) {
|
||||
var selelct = $("#modbusfigid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
selelct.val('${mPoint.modbusfigid}').trigger("change");
|
||||
}, 'json');
|
||||
|
||||
})
|
||||
|
||||
function update() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mpoint/update2.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑Modbus</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="hidden" class="form-control" id="id" name ="id" placeholder="id" value="${mPoint.id }">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Modbus服务器</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="modbusfigid" name="modbusfigid"
|
||||
style="width: 100%"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">寄存器地址</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="register" name="register" placeholder="寄存器地址"
|
||||
value="${mPoint.register }" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="update()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
109
WebRoot/jsp/work/mPointForSignalTest.jsp
Normal file
109
WebRoot/jsp/work/mPointForSignalTest.jsp
Normal file
@ -0,0 +1,109 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Modbus",MPoint.Flag_Modbus);%>
|
||||
<%request.setAttribute("Flag_Sql",MPoint.Flag_Sql);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var testFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getRows');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
$('#grid').datagrid({
|
||||
url:ext.contextPath +'/work/mpoint/getvaluefunc.do',
|
||||
queryParams:{ids:datas },
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
/* $.post(ext.contextPath + '/work/mpoint/getvaluefunc.do', {ids : datas}, function(data) {
|
||||
$('#grid').datagrid("loadData",data);
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','通讯成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','通讯失败','info');
|
||||
}
|
||||
}); */
|
||||
};
|
||||
function FormatDate (strTime) {
|
||||
var date = new Date(strTime);
|
||||
return date.Format("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath +'/work/mpoint/getvaluefunc.do',
|
||||
queryParams:{ids:'${ids}' },
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'ID',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
{width : '100', title : '测量点Code', field : 'mpointcode', sortable : true, halign:'center'},
|
||||
{width : '150', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
{width : '120', title : '测量时间', field : 'measuredt', sortable : true, halign:'center', formatter : function(value, row) {
|
||||
return row.measuredt.substring(0,19);
|
||||
|
||||
}},
|
||||
{width : '60', title : '值', field : 'parmvalue', sortable : false, align:'center'},
|
||||
{width : '60', title : '信号源', field : 'valuetype', sortable : true, align:'center', formatter : function(value, row) {
|
||||
if(row.valuetype=='${Flag_Modbus}'){
|
||||
return "Modbus";
|
||||
}else{
|
||||
return "数据库";
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '80', title : '信号类型', field : 'signaltype', sortable : false, align:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
//testFun();
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#search_pid").tree("search_pid");
|
||||
}
|
||||
},
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
521
WebRoot/jsp/work/mPointFormula.jsp
Normal file
521
WebRoot/jsp/work/mPointFormula.jsp
Normal file
@ -0,0 +1,521 @@
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%@page import="com.sipai.tools.CommString" %>
|
||||
<%@ page language="java" import="java.util.*" 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" %>
|
||||
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
||||
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
||||
<%request.setAttribute("Flag_Enable", MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable", MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql", MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus", MPoint.Flag_Modbus);%>
|
||||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||||
<%request.setAttribute("Flag_BizType_Hand", MPoint.Flag_BizType_Hand);%>
|
||||
<%request.setAttribute("Flag_BizType_Auto", MPoint.Flag_BizType_Auto);%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
$("#formulaTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mPointProp/getPropSourceList.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,
|
||||
companyId: $('#bizId').val(),
|
||||
pid: $('#pid').val()
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.mpointcode);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'indexDetails', // 返回json数据中的name
|
||||
title: '元素名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'mpid', // 返回json数据中的name
|
||||
title: '测量点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'valueType', // 返回json数据中的name
|
||||
title: '取值方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 'first':
|
||||
return "首值";
|
||||
case 'last':
|
||||
return "末值";
|
||||
case 'avg':
|
||||
return "均值";
|
||||
case 'diff':
|
||||
return "差值";
|
||||
case 'sum':
|
||||
return "累加";
|
||||
case 'max':
|
||||
return "最大值";
|
||||
case 'min':
|
||||
return "最小值";
|
||||
case 'nowTime':
|
||||
return "当前值";
|
||||
case 'mark':
|
||||
return "唯一标识";
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'calRangeUnit', // 返回json数据中的name
|
||||
title: '频率类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 'minute':
|
||||
return "分钟";
|
||||
case 'hour':
|
||||
return "小时";
|
||||
case 'day':
|
||||
return "日";
|
||||
case 'month':
|
||||
return "月";
|
||||
case 'year':
|
||||
return "年";
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'calRange', // 返回json数据中的name
|
||||
title: '采样频率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'calculationType', // 返回json数据中的name
|
||||
title: '时间偏移', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'deadline', // 返回json数据中的name
|
||||
title: '截止时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 'closing_time':
|
||||
return "期末时间";
|
||||
case 'now_time':
|
||||
return "当前时间";
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '排序', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFormulaFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFormulaFun(\'' + 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;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("formulaTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// $("#formulaDenominatorTable").bootstrapTable({ // 对应table标签的id
|
||||
// url: ext.contextPath + '/work/mPointFormulaDenominator/getList.do', // 获取表格数据的url
|
||||
// cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
// striped: true, //表格显示条纹,默认为false
|
||||
// pagination: true, // 在表格底部显示分页组件,默认false
|
||||
// pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
// pageSize: 50, // 页面数据条数
|
||||
// pageNumber: 1, // 首页页码
|
||||
// sidePagination: 'server', // 设置为服务器端分页
|
||||
// queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
// return {
|
||||
// rows: params.limit, // 每页要显示的数据条数
|
||||
// page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
// sort: params.sort, // 要排序的字段
|
||||
// order: params.order,
|
||||
// bizid: $('#bizId').val(),
|
||||
// pmpid: $('#id').val()
|
||||
// }
|
||||
// },
|
||||
// sortName: 'denominatorName', // 要排序的字段
|
||||
// sortOrder: 'asc', // 排序规则
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// //viewFun(row.mpointcode);
|
||||
// },
|
||||
// columns: [
|
||||
// {
|
||||
// field: 'denominatorname', // 返回json数据中的name
|
||||
// title: '分母元素名称', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// },{
|
||||
// field: 'moleculename', // 返回json数据中的name
|
||||
// title: '分子元素名称', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// },{
|
||||
// title: "操作",
|
||||
// align: 'center',
|
||||
// valign: 'middle',
|
||||
// width: 100, // 定义列的宽度,单位为像素px
|
||||
// formatter: function (value, row, index) {
|
||||
// var buts="";
|
||||
// buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFormulaDenominatorFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
// buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFormulaDenominatorFun(\''+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;
|
||||
// //return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// onLoadSuccess: function(){ //加载成功时执行
|
||||
// adjustBootstrapTableView("formulaTable");
|
||||
// },
|
||||
// onLoadError: function(){ //加载失败时执行
|
||||
// console.info("加载数据失败");
|
||||
// }
|
||||
//
|
||||
// });
|
||||
});
|
||||
|
||||
function updateFormula() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointProp/dosave2.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#subMainForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subMainForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mpoint/update2.do", $("#subMainForm").serialize(), function (data) {
|
||||
closeModal('subModal')
|
||||
}, 'json');
|
||||
}
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// exp: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '计算公式'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// });
|
||||
|
||||
var addFormulaFun = function () {
|
||||
let exp = $('#evaluationFormula').val();
|
||||
if (exp != '') {
|
||||
$.post(ext.contextPath + '/work/mPointFormula/doadd.do', {
|
||||
pmpid: '${mPointProp.pid}',
|
||||
bizid: $('#bizId').val()
|
||||
}, function (data) {
|
||||
$("#formulasubDiv").html(data);
|
||||
openModal('formulaModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '请先保存公式!', 'formulaAlert');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var addFormulaDenominatorFun = function () {
|
||||
$.post(ext.contextPath + '/work/mPointFormulaDenominator/doadd.do', {
|
||||
pmpid: '${mPoint.id}',
|
||||
bizid: $('#bizId').val()
|
||||
}, function (data) {
|
||||
$("#formulaDenominatorsubDiv").html(data);
|
||||
openModal('formulaDenominatorModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFormulaFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/mPointFormula/doedit.do', {id: id, bizid: $('#bizId').val()}, function (data) {
|
||||
$("#formulasubDiv").html(data);
|
||||
openModal('formulaModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFormulaDenominatorFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/mPointFormulaDenominator/doedit.do', {
|
||||
id: id,
|
||||
bizid: $('#bizId').val()
|
||||
}, function (data) {
|
||||
$("#formulaDenominatorsubDiv").html(data);
|
||||
openModal('formulaDenominatorModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFormulaFun = 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/mPointProp/dodelete2.do', {
|
||||
id: id,
|
||||
companyId: $('#bizId').val()
|
||||
}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#formulaTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFormulaDenominatorFun = 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/mPointFormulaDenominator/dodelete.do', {
|
||||
id: id,
|
||||
bizid: $('#bizId').val()
|
||||
}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#formulaDenominatorTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">计算公式配置</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="formulaAlert"></div>
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subMainForm">
|
||||
|
||||
<input id="id" name="id" type="hidden" value="${mPoint.id}"/>
|
||||
<input id="bizid" name="bizid" type="hidden" value="${mPoint.bizid}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计算类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="frequnit" name="frequnit" class="form-control select2"
|
||||
style="width: 100%">
|
||||
<option value="nowTime"
|
||||
<c:if test="${mPoint.frequnit=='nowTime'}">selected</c:if> >实时值
|
||||
</option>
|
||||
<option value="hour"
|
||||
<c:if test="${mPoint.frequnit=='hour'}">selected</c:if> >小时
|
||||
</option>
|
||||
<option value="day"
|
||||
<c:if test="${mPoint.frequnit=='day'}">selected</c:if> >日
|
||||
</option>
|
||||
<option value="month"
|
||||
<c:if test="${mPoint.frequnit=='month'}">selected</c:if> >月
|
||||
</option>
|
||||
<option value="mark"
|
||||
<c:if test="${mPoint.frequnit=='mark'}">selected</c:if> >唯一标识
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="form-horizontal" id="subForm">
|
||||
|
||||
<input id="bizId" name="bizId" type="hidden" value="${param.bizId}"/>
|
||||
<input id="id" name="id" type="hidden" value="${mPointProp.id}"/>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.id}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计算公式</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="evaluationFormula" name="evaluationFormula"
|
||||
placeholder="公式..." value="${mPointProp.evaluationFormula }">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">日起始时间</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="starthour" name="starthour"
|
||||
value="<c:if test="${mPointProp.starthour!=null}">${mPointProp.starthour}</c:if><c:if test="${mPointProp.starthour==null}">8</c:if>">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">月起始日期</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="startday" name="startday"
|
||||
value="<c:if test="${mPointProp.startday!=null}">${mPointProp.startday}</c:if><c:if test="${mPointProp.startday==null}">1</c:if>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">存储类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="saveType" name="saveType" class="form-control select2"
|
||||
style="width: 100%">
|
||||
<option value="nowTime"
|
||||
<c:if test="${mPointProp.saveType=='nowTime'}">selected</c:if> >实时值
|
||||
</option>
|
||||
<option value="hour"
|
||||
<c:if test="${mPointProp.saveType=='hour'}">selected</c:if> >小时
|
||||
</option>
|
||||
<option value="day"
|
||||
<c:if test="${mPointProp.saveType=='day'}">selected</c:if> >日
|
||||
</option>
|
||||
<option value="month"
|
||||
<c:if test="${mPointProp.saveType=='month'}">selected</c:if> >月
|
||||
</option>
|
||||
<option value="year"
|
||||
<c:if test="${mPointProp.saveType=='year'}">selected</c:if> >年
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">存储偏移</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="saveTimeShifting" name="saveTimeShifting"
|
||||
value="<c:if test="${mPointProp.saveTimeShifting!=null}">${mPointProp.saveTimeShifting}</c:if><c:if test="${mPointProp.saveTimeShifting==null}">0</c:if>">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">公式元素配置</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFormulaFun();"><i
|
||||
class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<table id="formulaTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="modal-body">--%>
|
||||
<%-- <div class="box-header with-border">--%>
|
||||
<%-- <h3 class="box-title">动态分母配置</h3>--%>
|
||||
<%-- <div class="box-tools pull-right">--%>
|
||||
<%-- <button type="button" class="btn btn-box-tool" onclick="addFormulaDenominatorFun();"><i class="fa fa-plus"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="box-body ">--%>
|
||||
<%-- <div >--%>
|
||||
<%-- <table id="formulaDenominatorTable"></table>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="updateFormula()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
207
WebRoot/jsp/work/mPointFormulaAdd.jsp
Normal file
207
WebRoot/jsp/work/mPointFormulaAdd.jsp
Normal file
@ -0,0 +1,207 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.scada.MPointProp" %>
|
||||
<%request.setAttribute("Flag_Cal_Range_Hour_1", MPointProp.Flag_Cal_Range_Hour_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Hour_8", MPointProp.Flag_Cal_Range_Hour_8);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Day_1", MPointProp.Flag_Cal_Range_Day_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Month_1", MPointProp.Flag_Cal_Range_Month_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Year_1", MPointProp.Flag_Cal_Range_Year_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Day_7", MPointProp.Flag_Cal_Range_Day_7);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doFormulaDsave() {
|
||||
$("#subFormulaForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormulaForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointProp/dosavePropSource2.do", $("#subFormulaForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('formulaModal');
|
||||
$("#formulaTable").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
$("#subFormulaForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
formulaname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '元素名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
function doClose() {
|
||||
closeModal('formulaModal');
|
||||
}
|
||||
|
||||
// $.post(ext.contextPath + "/achievement/acceptanceModelMPoint/getValueTypeJson.do", {}, function(data) {
|
||||
// var selelct =$("#mode").select2({
|
||||
// data: data,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: false,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
|
||||
// if(data.length>=1){
|
||||
// selelct.val(data[0].id).trigger("change");
|
||||
|
||||
// }else{
|
||||
// selelct.val(data[0].id).trigger("change");
|
||||
// }
|
||||
// },'json');
|
||||
|
||||
var selectMPint = function () {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {
|
||||
formId: 'subFormulaForm',
|
||||
hiddenId: 'hiddenId',
|
||||
codeId: 'mpid',
|
||||
unitId: 'unitId',
|
||||
textId: 'txt',
|
||||
valueId: 'value',
|
||||
mpid: $("#mpid").val()
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
function dompAdd() {
|
||||
$.post(ext.contextPath + '/work/mpoint/getMPLikeName.do', {
|
||||
unitId: unitId,
|
||||
formulaname: $("#formulaname").val()
|
||||
}, function (data) {
|
||||
$('#mpid').val(data[0].mpointcode);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="formulaModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">新增公式元素</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subFormulaForm -->
|
||||
<form class="form-horizontal" id="subFormulaForm">
|
||||
<input name="pid" type="hidden" value="${param.pmpid}"/>
|
||||
<input name="unitId" type="hidden" value="${param.bizid}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">元素名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="indexDetails" name="indexDetails"
|
||||
placeholder="元素名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="mpid" name="mpid" placeholder="点击选择"
|
||||
onclick="selectMPint();" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">取值方式</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="valueType" name="valueType" class="form-control select2" style="width: 100%">
|
||||
<option value="first">首值</option>
|
||||
<option value="last">末值</option>
|
||||
<option value="avg">均值</option>
|
||||
<option value="diff">差值</option>
|
||||
<option value="sum">累加</option>
|
||||
<option value="max">最大值</option>
|
||||
<option value="min">最小值</option>
|
||||
<option value="nowTime">当前值</option>
|
||||
<option value="mark">唯一标识</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">频率类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="calRangeUnit" name="calRangeUnit" class="form-control select2"
|
||||
style="width: 100%">
|
||||
<option value="minute">分钟</option>
|
||||
<option value="hour">小时</option>
|
||||
<option value="day">日</option>
|
||||
<option value="month">月</option>
|
||||
<option value="year">年</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采样频率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="calRange" name="calRange">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">时间偏移</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="calculationType" name="calculationType"
|
||||
value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">截止时间</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="deadline" name="deadline" class="form-control select2"
|
||||
style="width: 100%">
|
||||
<option value="closing_time">期末时间</option>
|
||||
<option value="now_time">当前时间</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder"
|
||||
value="">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">时间类型</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <select id="datatype" name="datatype" class="form-control select2" style="width: 100%">--%>
|
||||
<%-- <option value="day">day</option>--%>
|
||||
<%-- <option value="hour">hour</option>--%>
|
||||
<%-- <option value="today">today</option>--%>
|
||||
<%-- <option value="yesterday">yesterday</option>--%>
|
||||
<%-- <option value="week">week</option>--%>
|
||||
<%-- <option value="month">month</option>--%>
|
||||
<%-- <option value="year">year</option>--%>
|
||||
<%-- <option value="lastmonth">lastmonth</option>--%>
|
||||
<%-- <option value="nowTime">nowTime</option>--%>
|
||||
<%-- <option value="autoHour">autoHour</option>--%>
|
||||
<%-- <option value="8hour">8hour</option>--%>
|
||||
<%-- <option value="mainFormDay">mainFormDay</option>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doClose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doFormulaDsave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
90
WebRoot/jsp/work/mPointFormulaAutoHourAdd.jsp
Normal file
90
WebRoot/jsp/work/mPointFormulaAutoHourAdd.jsp
Normal file
@ -0,0 +1,90 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doMPointFormulaAutoHoursave() {
|
||||
$("#subMPointFormulaAutoHourForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subMPointFormulaAutoHourForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointFormulaAutoHour/dosave.do", $("#subMPointFormulaAutoHourForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('mPointFormulaAutoHourModal');
|
||||
$("#autoHourTable").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
$("#subMPointFormulaAutoHourForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
sdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '起始小时'
|
||||
}
|
||||
}
|
||||
},
|
||||
edt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '结束小时'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doDenominatorClose() {
|
||||
closeModal('mPointFormulaAutoHourModal');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="mPointFormulaAutoHourModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subMPointFormulaAutoHourForm -->
|
||||
<form class="form-horizontal" id="subMPointFormulaAutoHourForm">
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<input name="bizid" type="hidden" value="${param.bizid}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*起始小时</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="sdt" name="sdt" placeholder="起始小时">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*结束小时</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="edt" name="edt" placeholder="结束小时">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doDenominatorClose();">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doMPointFormulaAutoHoursave();">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
87
WebRoot/jsp/work/mPointFormulaAutoHourEdit.jsp
Normal file
87
WebRoot/jsp/work/mPointFormulaAutoHourEdit.jsp
Normal file
@ -0,0 +1,87 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doFormulaDupdate() {
|
||||
$("#subMPointFormulaAutoHourForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subMPointFormulaAutoHourForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointFormulaAutoHour/doupdate.do", $("#subMPointFormulaAutoHourForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('mPointFormulaAutoHourModal');
|
||||
$("#autoHourTable").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subMPointFormulaAutoHourForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
sdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '起始小时'
|
||||
}
|
||||
}
|
||||
},
|
||||
edt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '结束小时'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doDenominatorClose(){
|
||||
closeModal('mPointFormulaAutoHourModal');
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="mPointFormulaAutoHourModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subMPointFormulaAutoHourForm -->
|
||||
<form class="form-horizontal" id="subMPointFormulaAutoHourForm">
|
||||
<input name="id" type="hidden" value="${mPointFormulaAutoHour.id}"/>
|
||||
<input name="bizid" type="hidden" value="${param.bizid}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*起始小时</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="sdt" name ="sdt" placeholder="起始小时" value="${mPointFormulaAutoHour.sdt}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*结束小时</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="edt" name ="edt" placeholder="结束小时" value="${mPointFormulaAutoHour.edt}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doDenominatorClose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doFormulaDupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
88
WebRoot/jsp/work/mPointFormulaDenominatorAdd.jsp
Normal file
88
WebRoot/jsp/work/mPointFormulaDenominatorAdd.jsp
Normal file
@ -0,0 +1,88 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doFormulaDenominatorsave() {
|
||||
$("#subFormulaDenominatorForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormulaDenominatorForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointFormulaDenominator/dosave.do", $("#subFormulaDenominatorForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('formulaDenominatorModal');
|
||||
$("#formulaDenominatorTable").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subFormulaDenominatorForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
denominatorname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '分母元素名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
moleculename: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '分子元素名称'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doDenominatorClose(){
|
||||
closeModal('formulaDenominatorModal');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="formulaDenominatorModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">新增分母元素</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subFormulaDenominatorForm -->
|
||||
<form class="form-horizontal" id="subFormulaDenominatorForm">
|
||||
<input name="pmpid" type="hidden" value="${param.pmpid}"/>
|
||||
<input name="bizid" type="hidden" value="${param.bizid}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*分母元素名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="denominatorname" name ="denominatorname" placeholder="分母元素名称" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*分子元素名称</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" id="moleculename" name ="moleculename" placeholder="分子元素名称" >
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doDenominatorClose();">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doFormulaDenominatorsave();" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
86
WebRoot/jsp/work/mPointFormulaDenominatorEdit.jsp
Normal file
86
WebRoot/jsp/work/mPointFormulaDenominatorEdit.jsp
Normal file
@ -0,0 +1,86 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doFormulaDupdate() {
|
||||
$("#subFormulaDenominatorForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormulaDenominatorForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointFormulaDenominator/doupdate.do", $("#subFormulaDenominatorForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('formulaDenominatorModal');
|
||||
$("#formulaDenominatorTable").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subFormulaDenominatorForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
denominatorname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '分母元素名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
moleculename: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '分子元素名称'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function doDenominatorClose(){
|
||||
closeModal('formulaDenominatorModal');
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="formulaDenominatorModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">编辑分母元素</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subFormulaDenominatorForm -->
|
||||
<form class="form-horizontal" id="subFormulaDenominatorForm">
|
||||
<input name="id" type="hidden" value="${mPointFormulaDenominator.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*分母元素名称</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" id="denominatorname" name ="denominatorname" placeholder="分母元素名称" value="${mPointFormulaDenominator.denominatorname}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*分子元素名称</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" id="moleculename" name ="moleculename" placeholder="分子元素名称" value="${mPointFormulaDenominator.moleculename}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doDenominatorClose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doFormulaDupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
434
WebRoot/jsp/work/mPointFormulaEdit.jsp
Normal file
434
WebRoot/jsp/work/mPointFormulaEdit.jsp
Normal file
@ -0,0 +1,434 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.scada.MPointProp" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%request.setAttribute("Flag_Cal_Range_Hour_1", MPointProp.Flag_Cal_Range_Hour_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Hour_8", MPointProp.Flag_Cal_Range_Hour_8);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Day_1", MPointProp.Flag_Cal_Range_Day_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Month_1", MPointProp.Flag_Cal_Range_Month_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Year_1", MPointProp.Flag_Cal_Range_Year_1);%>
|
||||
<%request.setAttribute("Flag_Cal_Range_Day_7", MPointProp.Flag_Cal_Range_Day_7);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doFormulaDupdate() {
|
||||
$("#subFormulaForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormulaForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/mPointProp/doupdatePropSource.do", $("#subFormulaForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('formulaModal');
|
||||
$("#formulaTable").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
//输入框验证
|
||||
$("#subFormulaForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
formulaname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '元素名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
changeDatatype();
|
||||
|
||||
<%--$("#autoHourTable").bootstrapTable({ // 对应table标签的id--%>
|
||||
<%-- url: ext.contextPath + '/work/mPointFormulaAutoHour/getList.do', // 获取表格数据的url--%>
|
||||
<%-- cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true--%>
|
||||
<%-- striped: true, //表格显示条纹,默认为false--%>
|
||||
<%-- pagination: true, // 在表格底部显示分页组件,默认false--%>
|
||||
<%-- pageList: [10, 20, 50], // 设置页面可以显示的数据条数--%>
|
||||
<%-- pageSize: 50, // 页面数据条数--%>
|
||||
<%-- pageNumber: 1, // 首页页码--%>
|
||||
<%-- sidePagination: 'server', // 设置为服务器端分页--%>
|
||||
<%-- queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求--%>
|
||||
<%-- return {--%>
|
||||
<%-- rows: params.limit, // 每页要显示的数据条数--%>
|
||||
<%-- page: params.offset / params.limit + 1, // 每页显示数据的开始页码--%>
|
||||
<%-- sort: params.sort, // 要排序的字段--%>
|
||||
<%-- order: params.order,--%>
|
||||
<%-- bizid: '${param.bizid}',--%>
|
||||
<%-- pid: '${mPointFormula.id}'--%>
|
||||
<%-- }--%>
|
||||
<%-- },--%>
|
||||
<%-- sortName: 'sdt', // 要排序的字段--%>
|
||||
<%-- sortOrder: 'asc', // 排序规则--%>
|
||||
<%-- onClickRow: function (row) {//单击行事件,执行查看功能--%>
|
||||
<%-- //viewFun(row.mpointcode);--%>
|
||||
<%-- },--%>
|
||||
<%-- columns: [--%>
|
||||
<%-- {--%>
|
||||
<%-- field: 'sdt', // 返回json数据中的name--%>
|
||||
<%-- title: '起始小时', // 表格表头显示文字--%>
|
||||
<%-- align: 'center', // 左右居中--%>
|
||||
<%-- valign: 'middle' // 上下居中--%>
|
||||
<%-- }, {--%>
|
||||
<%-- field: 'edt', // 返回json数据中的name--%>
|
||||
<%-- title: '结束小时', // 表格表头显示文字--%>
|
||||
<%-- align: 'center', // 左右居中--%>
|
||||
<%-- valign: 'middle' // 上下居中--%>
|
||||
<%-- }, {--%>
|
||||
<%-- title: "操作",--%>
|
||||
<%-- align: 'center',--%>
|
||||
<%-- valign: 'middle',--%>
|
||||
<%-- width: 100, // 定义列的宽度,单位为像素px--%>
|
||||
<%-- formatter: function (value, row, index) {--%>
|
||||
<%-- var buts = "";--%>
|
||||
<%-- buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFormulaAutoHourFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';--%>
|
||||
<%-- buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFormulaAutoHourFun(\'' + 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;--%>
|
||||
<%-- //return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';--%>
|
||||
<%-- }--%>
|
||||
<%-- }--%>
|
||||
<%-- ],--%>
|
||||
<%-- onLoadSuccess: function () { //加载成功时执行--%>
|
||||
<%-- adjustBootstrapTableView("autoHourTable");--%>
|
||||
<%-- },--%>
|
||||
<%-- onLoadError: function () { //加载失败时执行--%>
|
||||
<%-- console.info("加载数据失败");--%>
|
||||
<%-- }--%>
|
||||
|
||||
<%--});--%>
|
||||
|
||||
})
|
||||
|
||||
function addAutoHourFun() {
|
||||
$.post(ext.contextPath + '/work/mPointFormulaAutoHour/doadd.do', {
|
||||
pid: '${mPointFormula.id}',
|
||||
bizid: '${param.bizid}'
|
||||
}, function (data) {
|
||||
$("#mPointFormulaAutoHourDiv").html(data);
|
||||
openModal('mPointFormulaAutoHourModal');
|
||||
});
|
||||
}
|
||||
|
||||
function editFormulaAutoHourFun(id) {
|
||||
$.post(ext.contextPath + '/work/mPointFormulaAutoHour/doedit.do', {
|
||||
id: id,
|
||||
bizid: '${param.bizid}',
|
||||
}, function (data) {
|
||||
$("#mPointFormulaAutoHourDiv").html(data);
|
||||
openModal('mPointFormulaAutoHourModal');
|
||||
});
|
||||
};
|
||||
|
||||
function deleteFormulaAutoHourFun(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/mPointFormulaAutoHour/dodelete.do', {
|
||||
id: id,
|
||||
bizid: '${param.bizid}',
|
||||
}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#autoHourTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// $.post(ext.contextPath + "/achievement/acceptanceModelMPoint/getValueTypeJson.do", {}, function(data) {
|
||||
// var selelct =$("#mode").select2({
|
||||
// data: data,
|
||||
// placeholder:'请选择',//默认文字提示
|
||||
// allowClear: false,//允许清空
|
||||
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
// });
|
||||
|
||||
// if(data.length>=1){
|
||||
// selelct.val('${mPointFormula.mode}').trigger("change");
|
||||
// }else{
|
||||
// // selelct.val(data[0].id).trigger("change");
|
||||
// }
|
||||
// },'json');
|
||||
|
||||
function doClose() {
|
||||
closeModal('formulaModal');
|
||||
}
|
||||
|
||||
var selectMPint = function () {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {
|
||||
formId: 'subFormulaForm',
|
||||
hiddenId: 'hiddenId',
|
||||
codeId: 'mpid',
|
||||
unitId: 'unitId',
|
||||
textId: 'txt',
|
||||
valueId: 'value',
|
||||
mpid: $("#mpid").val()
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
function changeDatatype() {
|
||||
let datatype = $('#datatype').val();
|
||||
if (datatype == 'autoHour') {
|
||||
$('#autoHourShow').css('display', 'block');
|
||||
} else {
|
||||
$('#autoHourShow').css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="formulaModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">编辑公式元素</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subFormulaForm -->
|
||||
<form class="form-horizontal" id="subFormulaForm">
|
||||
<input name="id" type="hidden" value="${mPointPropSource.id}"/>
|
||||
<input name="unitId" type="hidden" value="${param.bizid}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">元素名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="indexDetails" name="indexDetails"
|
||||
placeholder="元素名称" value="${mPointPropSource.indexDetails}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="mpid" name="mpid" placeholder="点击选择"
|
||||
value="${mPointPropSource.mpid}" onclick="selectMPint();" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">取值方式</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="valueType" name="valueType" class="form-control select2" style="width: 100%">
|
||||
<option value="first"
|
||||
<c:if test="${mPointPropSource.valueType=='first'}">selected</c:if> >首值
|
||||
</option>
|
||||
<option value="last"
|
||||
<c:if test="${mPointPropSource.valueType=='last'}">selected</c:if> >末值
|
||||
</option>
|
||||
<option value="avg"
|
||||
<c:if test="${mPointPropSource.valueType=='avg'}">selected</c:if> >均值
|
||||
</option>
|
||||
<option value="diff"
|
||||
<c:if test="${mPointPropSource.valueType=='diff'}">selected</c:if> >差值
|
||||
</option>
|
||||
<option value="sum"
|
||||
<c:if test="${mPointPropSource.valueType=='sum'}">selected</c:if> >累加
|
||||
</option>
|
||||
<option value="max"
|
||||
<c:if test="${mPointPropSource.valueType=='max'}">selected</c:if> >最大值
|
||||
</option>
|
||||
<option value="min"
|
||||
<c:if test="${mPointPropSource.valueType=='min'}">selected</c:if> >最小值
|
||||
</option>
|
||||
<option value="nowTime"
|
||||
<c:if test="${mPointPropSource.valueType=='nowTime'}">selected</c:if> >当前值
|
||||
</option>
|
||||
<option value="mark"
|
||||
<c:if test="${mPointPropSource.valueType=='mark'}">selected</c:if> >唯一标识
|
||||
</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">频率类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="calRangeUnit" name="calRangeUnit" class="form-control select2"
|
||||
style="width: 100%">
|
||||
<option value="minute"
|
||||
<c:if test="${mPointPropSource.calRangeUnit=='minute'}">selected</c:if> >分钟
|
||||
</option>
|
||||
<option value="hour"
|
||||
<c:if test="${mPointPropSource.calRangeUnit=='hour'}">selected</c:if> >小时
|
||||
</option>
|
||||
<option value="day"
|
||||
<c:if test="${mPointPropSource.calRangeUnit=='day'}">selected</c:if> >日
|
||||
</option>
|
||||
<option value="month"
|
||||
<c:if test="${mPointPropSource.calRangeUnit=='month'}">selected</c:if> >月
|
||||
</option>
|
||||
<option value="year"
|
||||
<c:if test="${mPointPropSource.calRangeUnit=='year'}">selected</c:if> >年
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">采样频率</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="calRange" name="calRange"
|
||||
value="${mPointPropSource.calRange}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">时间偏移</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="calculationType" name="calculationType"
|
||||
value="${mPointPropSource.calculationType}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">截止时间</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="deadline" name="deadline" class="form-control select2"
|
||||
style="width: 100%">
|
||||
<option value="closing_time"
|
||||
<c:if test="${mPointPropSource.deadline=='closing_time'}">selected</c:if> >期末时间
|
||||
</option>
|
||||
<option value="now_time"
|
||||
<c:if test="${mPointPropSource.deadline=='now_time'}">selected</c:if> >当前时间
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder"
|
||||
value="${mPointPropSource.morder}">
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">采集方式</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <select id="mode" name="mode" class="form-control select2" style="width: 100%">--%>
|
||||
<%-- <option value="first"--%>
|
||||
<%-- <c:if test="${mPointFormula.mode=='first'}">selected</c:if> >first--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="last"--%>
|
||||
<%-- <c:if test="${mPointFormula.mode=='last'}">selected</c:if> >last--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="sum"--%>
|
||||
<%-- <c:if test="${mPointFormula.mode=='sum'}">selected</c:if> >sum--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="avg"--%>
|
||||
<%-- <c:if test="${mPointFormula.mode=='avg'}">selected</c:if> >avg--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="diff"--%>
|
||||
<%-- <c:if test="${mPointFormula.mode=='diff'}">selected</c:if> >diff--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="tomorrowlast"--%>
|
||||
<%-- <c:if test="${mPointFormula.mode=='tomorrowlast'}">selected</c:if> >tomorrowlast--%>
|
||||
<%-- </option>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <label class="col-sm-2 control-label">计算时间</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <input type="text" class="form-control" id="starthour" name="starthour"--%>
|
||||
<%-- value="${mPointFormula.starthour}">--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="form-group">--%>
|
||||
<%-- <label class="col-sm-2 control-label">时间类型</label>--%>
|
||||
<%-- <div class="col-sm-4">--%>
|
||||
<%-- <select id="datatype" name="datatype" class="form-control select2" style="width: 100%"--%>
|
||||
<%-- onchange="changeDatatype();">--%>
|
||||
<%-- <option value="day"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='day'}">selected</c:if> >day--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="hour"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='hour'}">selected</c:if> >hour--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="today"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='today'}">selected</c:if> >today--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="yesterday"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='yesterday'}">selected</c:if> >yesterday--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="week"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='week'}">selected</c:if> >week--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="month"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='month'}">selected</c:if> >month--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="year"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='year'}">selected</c:if> >year--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="lastmonth"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='lastmonth'}">selected</c:if> >lastmonth--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="nowTime"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='nowTime'}">selected</c:if> >nowTime--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="autoHour"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='autoHour'}">selected</c:if> >autoHour--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="8hour"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='8hour'}">selected</c:if> >8hour--%>
|
||||
<%-- </option>--%>
|
||||
<%-- <option value="mainFormDay"--%>
|
||||
<%-- <c:if test="${mPointFormula.datatype=='mainFormDay'}">selected</c:if> >--%>
|
||||
<%-- mainFormDay--%>
|
||||
<%-- </option>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</form>
|
||||
</div>
|
||||
<%-- <div id="autoHourShow" class="modal-body" style="display: block;">--%>
|
||||
<%-- <div class="box-header with-border">--%>
|
||||
<%-- <h3 class="box-title">动态小时列表</h3>--%>
|
||||
<%-- <div class="box-tools pull-right">--%>
|
||||
<%-- <button type="button" class="btn btn-box-tool" onclick="addAutoHourFun();"><i--%>
|
||||
<%-- class="fa fa-plus"></i></button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="box-body ">--%>
|
||||
<%-- <div>--%>
|
||||
<%-- <table id="autoHourTable"></table>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" onclick="doClose()">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doFormulaDupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
186
WebRoot/jsp/work/mPointHisChangeDataView.jsp
Normal file
186
WebRoot/jsp/work/mPointHisChangeDataView.jsp
Normal file
@ -0,0 +1,186 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.work.MPointHisChangeData" %>
|
||||
<%request.setAttribute("Change_Delete", MPointHisChangeData.Change_Delete);%>
|
||||
<%request.setAttribute("Change_Edit", MPointHisChangeData.Change_Edit);%>
|
||||
<%request.setAttribute("Change_Add", MPointHisChangeData.Change_Add);%>
|
||||
<%request.setAttribute("Change_Cleaning", MPointHisChangeData.Change_Cleaning);%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var beginTimeStore2 = '';
|
||||
var endTimeStore2 = '';
|
||||
$(function () {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(7, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore2 = moment().format('YYYY-MM-DD HH:mm');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment().subtract(1, 'days'), moment()],
|
||||
'昨日': [moment().subtract(2, 'days'), moment().subtract(1, 'days')],
|
||||
'最近7日': [moment().subtract(7, 'days'), moment()],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
},
|
||||
startDate: beginTimeStore2,
|
||||
endDate: endTimeStore2
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
// doHisChangeDataSearch();
|
||||
});
|
||||
$('#reservationtime2').val(beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
|
||||
inHisChangeDataTable();
|
||||
})
|
||||
|
||||
function inHisChangeDataTable() {
|
||||
$("#hisChangeDataTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mPointHisChangeData/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 15, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
mpid: '${param.mpcode}',
|
||||
sdt: beginTimeStore2,
|
||||
edt: endTimeStore2
|
||||
}
|
||||
},
|
||||
sortName: 'valueTime', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'valuetime', // 返回json数据中的name
|
||||
title: '数据时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 16)
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '_changepeopleName', // 返回json数据中的name
|
||||
title: '修改人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'changetime', // 返回json数据中的name
|
||||
title: '修改时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 16)
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'changedata', // 返回json数据中的name
|
||||
title: '修改值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'olddata', // 返回json数据中的name
|
||||
title: '原始值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value.indexOf('_${Change_Add}') == -1 ? false : true) {
|
||||
return "新增";
|
||||
} else if (value.indexOf('_${Change_Delete}') == -1 ? false : true) {
|
||||
return "删除";
|
||||
} else if (value.indexOf('${Change_Cleaning}') == -1 ? false : true) {
|
||||
return "清洗";
|
||||
} else {
|
||||
return "修改";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("hisChangeDataTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function doHisChangeDataSearch() {
|
||||
$("#hisChangeDataTable").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="hisChangeDataModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">历史修改数据</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input type="text" class="form-control pull-left" id="reservationtime2" style="width:270px">
|
||||
<div class="input-group-btn pull-left">
|
||||
<button type="button" class="btn btn-default" onclick="doHisChangeDataSearch();"><i
|
||||
class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<div class="input-group input-group-sm">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="container">
|
||||
<table id="hisChangeDataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
427
WebRoot/jsp/work/mPointHisData.jsp
Normal file
427
WebRoot/jsp/work/mPointHisData.jsp
Normal file
@ -0,0 +1,427 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.work.MPointHisChangeData" %>
|
||||
<%request.setAttribute("Change_Delete", MPointHisChangeData.Change_Delete);%>
|
||||
<%request.setAttribute("Change_Edit", MPointHisChangeData.Change_Edit);%>
|
||||
<%request.setAttribute("Change_Add", MPointHisChangeData.Change_Add);%>
|
||||
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.input-group-sm>.form-control,
|
||||
.input-group-sm>.input-group-addon,
|
||||
.input-group-sm>.input-group-btn>.btn{
|
||||
padding: 5px;
|
||||
}
|
||||
.form-horizontal .form-group {
|
||||
margin-bottom: 5px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.border-right{
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
$(function () {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore = moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore = moment().format('YYYY-MM-DD HH:mm');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment().subtract(1, 'days'), moment()],
|
||||
'昨日': [moment().subtract(2, 'days'), moment().subtract(1, 'days')],
|
||||
'最近7日': [moment().subtract(7, 'days'), moment()],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
},
|
||||
startDate: beginTimeStore,
|
||||
endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
// doHisDataSearch();
|
||||
});
|
||||
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
|
||||
|
||||
inHisDataTable();
|
||||
})
|
||||
|
||||
function inHisDataTable() {
|
||||
var hisDataTable = $('#hisDataTable');
|
||||
hisDataTable.bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getHisDataList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
uniqueId:"itemid",
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
mpid: '${param.mpcode}',
|
||||
sdt: beginTimeStore,
|
||||
edt: endTimeStore,
|
||||
bizid: '${param.unitId}',
|
||||
maxData: $('#maxData').val(),
|
||||
minData: $('#minData').val(),
|
||||
equalData: $('#equalData').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'measuredt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '210px',
|
||||
formatter: function (value, row, index) {
|
||||
if(value.length>22){
|
||||
return value;
|
||||
}else{
|
||||
return value.substring(0, 16);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '当前值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '值',
|
||||
mode: "inline",
|
||||
validate: function (v) {
|
||||
if (!v) return '值不能为空';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'oldData', // 返回json数据中的name
|
||||
title: '原始值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'memo',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=null && value!=undefined){
|
||||
if(value.length>22){
|
||||
return value;
|
||||
}else{
|
||||
return '<div class="btn-group">'+
|
||||
'<button class="btn btn-default btn-sm" onclick="delMPointHistory(\''+row.itemid+'\',\''+row.measuredt+'\',\''+row.parmvalue+'\')" title="删除"><i class="fa fa-trash-o"></i></button>'+
|
||||
'</div>';
|
||||
}
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("hisDataTable");
|
||||
getHisData4Screen();
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
//保存列修改后的数据
|
||||
onEditableSave: function (field, row, oldValue, $el) {
|
||||
if(row.itemid!=null && row.itemid!=undefined && row.itemid!='newData'){
|
||||
if(row.parmvalue != oldValue){
|
||||
upHisDateValue(row.measuredt, row.parmvalue, oldValue);
|
||||
}else{
|
||||
showAlert('d','修改数据与原始数据相同','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
}else{
|
||||
var measuredt = $("#hisDataModal #measuredt").val();
|
||||
if(measuredt!=null && measuredt!=undefined && measuredt!=''){
|
||||
saveMPointHistory(measuredt, row.parmvalue);
|
||||
}else{
|
||||
showAlert('d','请选择时间','mPointHisChangeDataAlertdiv');
|
||||
hisDataTable.bootstrapTable('removeByUniqueId',row.itemid);
|
||||
insertTableRow(row.parmvalue);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
//获取最大值、最小值、平均值等
|
||||
function getHisData4Screen() {
|
||||
$.post(ext.contextPath + "/work/mpoint/getHisData4Screen.do", {
|
||||
mpid: '${param.mpcode}',
|
||||
sdt: beginTimeStore,
|
||||
edt: endTimeStore,
|
||||
bizid: '${param.unitId}',
|
||||
maxData: $('#maxData').val(),
|
||||
minData: $('#minData').val(),
|
||||
equalData: $('#equalData').val(),
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
var hisData4ScreenStr = "";
|
||||
if(data.avg!=null && data.avg!=undefined && data.avg!=''){
|
||||
hisData4ScreenStr+='<li>平均值:'+data.avg+';</li>';
|
||||
}
|
||||
if(data.max!=null && data.max!=undefined && data.max!=''){
|
||||
hisData4ScreenStr+='<li>最大值:'+data.max+';</li>';
|
||||
}
|
||||
if(data.min!=null && data.min!=undefined && data.min!=''){
|
||||
hisData4ScreenStr+='<li>最小值:'+data.min+';</li>';
|
||||
}
|
||||
$("#hisData4Screen").html(hisData4ScreenStr);
|
||||
});
|
||||
}
|
||||
function insertTableRow(parmvalue) {
|
||||
if($("#hisDataModal #measuredt").length > 0){
|
||||
showAlert('d','已存在!','mPointHisChangeDataAlertdiv');
|
||||
}else{
|
||||
if(parmvalue==null || parmvalue==undefined || parmvalue==''){
|
||||
parmvalue = 0;
|
||||
}
|
||||
var newData = [{
|
||||
itemid:'newData',
|
||||
measuredt: '<input type="text" class="form-control" id="measuredt" placeholder="请先点击选择时间" readonly/>',
|
||||
parmvalue: parmvalue,
|
||||
}];
|
||||
$('#hisDataTable').bootstrapTable('prepend', newData);
|
||||
$("#measuredt").datetimepicker({
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
minuteStep: 5, //分钟间隔为5分
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
startView: "month", //初始化视图
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
language: 'zh-CN'
|
||||
}).on('changeDate', function (ev) {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
function doHisDataSearch() {
|
||||
$("#hisDataTable").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
function delMPointHistory(itemid,measuredt,parmValue) {
|
||||
$.post(ext.contextPath + "/work/mpoint/delMPointHistory.do", {
|
||||
unitId: '${param.unitId}',
|
||||
mpid: '${param.mpcode}',
|
||||
itemid: itemid,
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
$.post(ext.contextPath + "/work/mPointHisChangeData/dosave.do", {
|
||||
measuredt: measuredt,
|
||||
mpid: '${param.mpcode}',
|
||||
olddata: parmValue,
|
||||
changeType: '${Change_Delete}'
|
||||
});
|
||||
doHisDataSearch();
|
||||
}else{
|
||||
showAlert('d','删除失败!','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveMPointHistory(measuredt, parmValue) {
|
||||
$.post(ext.contextPath + "/work/mpoint/saveMPointHistory.do", {
|
||||
measuredt: measuredt,
|
||||
parmValue: parmValue,
|
||||
unitId: '${param.unitId}',
|
||||
mpid: '${param.mpcode}'
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
$.post(ext.contextPath + "/work/mPointHisChangeData/dosave.do", {
|
||||
measuredt: measuredt,
|
||||
mpid: '${param.mpcode}',
|
||||
newValue: parmValue,
|
||||
changeType: '${Change_Add}'
|
||||
});
|
||||
doHisDataSearch();
|
||||
}else{
|
||||
showAlert('d','添加失败!','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function upHisDateValue(measuredt, newValue, olddata) {
|
||||
$.post(ext.contextPath + "/work/mpoint/upHisDateValue.do", {
|
||||
measuredt: measuredt,
|
||||
unitId: '${param.unitId}',
|
||||
mpid: '${param.mpcode}',
|
||||
newValue: newValue
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
$.post(ext.contextPath + "/work/mPointHisChangeData/dosave.do", {
|
||||
measuredt: measuredt,
|
||||
mpid: '${param.mpcode}',
|
||||
newValue: newValue,
|
||||
olddata: olddata,
|
||||
changeType: '${Change_Edit}'
|
||||
});
|
||||
doHisDataSearch();
|
||||
}else{
|
||||
showAlert('d','修改失败!','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showChange() {
|
||||
$.post(ext.contextPath + '/work/mPointHisChangeData/doView.do', {mpcode: '${param.mpcode}'}, function (data) {
|
||||
$("#hisChangeDataDiv").html(data);
|
||||
openModal('hisChangeDataModal');
|
||||
});
|
||||
}
|
||||
function exportExcel() {
|
||||
showAlert('s','导出中...','mPointHisChangeDataAlertdiv');
|
||||
var iframe = document.getElementById("theone")
|
||||
iframe.src=ext.contextPath + "/work/mpoint/HisDataExportExcel.do?mpid=${param.mpcode}&sdt="+beginTimeStore
|
||||
+"&edt="+endTimeStore+"&bizid=${param.unitId}&maxData="+$('#maxData').val()+"&minData="+$('#minData').val()+"&equalData="+$('#equalData').val();
|
||||
}
|
||||
|
||||
|
||||
function importExcelMPoint(){
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {} , function(res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
$.post(ext.contextPath + '/work/mpoint/importMpointHis.do?mpid=${param.mpcode}&bizid=${param.unitId}', {} , function(data) {
|
||||
$("#subHisDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d',resp.msg,'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="hisDataModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">历史数据</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="mPointHisChangeDataAlertdiv"></div>
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group bg-info">
|
||||
<div class="row">
|
||||
<label class="col-sm-1 control-label">ID</label>
|
||||
<div class="col-sm-3 border-right">
|
||||
<p class="form-control-static" >${mPoint.id}</p>
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">名称</label>
|
||||
<div class="col-sm-5 border-right">
|
||||
<p class="form-control-static" >${mPoint.parmname}</p>
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">单位</label>
|
||||
<div class="col-sm-1">
|
||||
<p class="form-control-static" >${mPoint.unit}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 5px;">
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">单值</span>
|
||||
<input type="number" class="form-control" id="equalData" placeholder="单值">
|
||||
<span class="input-group-addon">值范围</span>
|
||||
<input type="number" class="form-control" id="minData" placeholder="下限">
|
||||
<span class="input-group-addon">-</span>
|
||||
<input type="number" class="form-control" id="maxData" placeholder="上限">
|
||||
<span class="input-group-addon">时间</span>
|
||||
<input type="text" class="form-control" id="reservationtime" style="width:225px;">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="doHisDataSearch();"><i
|
||||
class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
</span>
|
||||
</div><!-- /input-group -->
|
||||
</div>
|
||||
<div class="col-lg-3 text-right">
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="..." style="width: 300px">
|
||||
<button type="button" class="btn btn-default" onclick="insertTableRow();" style="margin-left: 5px;">
|
||||
<i class="fa fa-plus"></i> 添加</button>
|
||||
<button type="button" class="btn btn-default" onclick="showChange();" style="margin-left: 5px;">
|
||||
<i class="fa fa-book"></i> 记录</button>
|
||||
<button type="button" class="btn btn-default" onclick="exportExcel();" style="margin-left: 5px;">
|
||||
<i class="fa fa-file-excel-o"></i> 导出</button>
|
||||
<button type="button" class="btn btn-default" onclick="importExcelMPoint();" style="margin-left: 5px;">
|
||||
<i class="fa fa-file-excel-o"></i> 导入</button>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
<div class="input-group-btn pull-right">
|
||||
</div>
|
||||
</form>
|
||||
<div id="container">
|
||||
<table id="hisDataTable"></table>
|
||||
</div>
|
||||
<div style="display:none;">
|
||||
<iframe id="theone" src=""></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<ul class="list-inline pull-left" id="hisData4Screen"></ul>
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
426
WebRoot/jsp/work/mPointHisDataNew.jsp
Normal file
426
WebRoot/jsp/work/mPointHisDataNew.jsp
Normal file
@ -0,0 +1,426 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@page import="com.sipai.entity.work.MPointHisChangeData" %>
|
||||
<%request.setAttribute("Change_Delete", MPointHisChangeData.Change_Delete);%>
|
||||
<%request.setAttribute("Change_Edit", MPointHisChangeData.Change_Edit);%>
|
||||
<%request.setAttribute("Change_Add", MPointHisChangeData.Change_Add);%>
|
||||
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
<style type="text/css">
|
||||
.input-group-sm>.form-control,
|
||||
.input-group-sm>.input-group-addon,
|
||||
.input-group-sm>.input-group-btn>.btn{
|
||||
padding: 5px;
|
||||
}
|
||||
.form-horizontal .form-group {
|
||||
margin-bottom: 5px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.border-right{
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
$(function () {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore = moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore = moment().format('YYYY-MM-DD HH:mm');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
'今日': [moment().subtract(1, 'days'), moment()],
|
||||
'昨日': [moment().subtract(2, 'days'), moment().subtract(1, 'days')],
|
||||
'最近7日': [moment().subtract(7, 'days'), moment()],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
},
|
||||
startDate: beginTimeStore,
|
||||
endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
// doHisDataSearch();
|
||||
});
|
||||
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
|
||||
|
||||
inHisDataTable();
|
||||
})
|
||||
|
||||
function inHisDataTable() {
|
||||
var hisDataTable = $('#hisDataTable');
|
||||
hisDataTable.bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getHisDataListForKPI.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
uniqueId:"itemid",
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
mpid: '${param.mpcode}',
|
||||
sdt: beginTimeStore,
|
||||
edt: endTimeStore,
|
||||
bizid: '${param.unitId}',
|
||||
maxData: $('#maxData').val(),
|
||||
minData: $('#minData').val(),
|
||||
equalData: $('#equalData').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'measuredt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: '210px',
|
||||
formatter: function (value, row, index) {
|
||||
if(value.length>22){
|
||||
return value;
|
||||
}else{
|
||||
return value.substring(0, 16);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '值',
|
||||
mode: "inline",
|
||||
validate: function (v) {
|
||||
if (!v) return '值不能为空';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'user.caption', // 返回json数据中的name
|
||||
title: '计算人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '计算时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'memo',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=null && value!=undefined){
|
||||
if(value.length>22){
|
||||
return value;
|
||||
}else{
|
||||
return '<div class="btn-group">'+
|
||||
'<button class="btn btn-default btn-sm" onclick="delMPointHistory(\''+row.itemid+'\',\''+row.measuredt+'\',\''+row.parmvalue+'\')" title="删除"><i class="fa fa-trash-o"></i></button>'+
|
||||
'</div>';
|
||||
}
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("hisDataTable");
|
||||
getHisData4Screen();
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
//保存列修改后的数据
|
||||
onEditableSave: function (field, row, oldValue, $el) {
|
||||
if(row.itemid!=null && row.itemid!=undefined && row.itemid!='newData'){
|
||||
if(row.parmvalue != oldValue){
|
||||
upHisDateValue(row.measuredt, row.parmvalue, oldValue);
|
||||
}else{
|
||||
showAlert('d','修改数据与原始数据相同','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
}else{
|
||||
var measuredt = $("#hisDataModal #measuredt").val();
|
||||
if(measuredt!=null && measuredt!=undefined && measuredt!=''){
|
||||
saveMPointHistory(measuredt, row.parmvalue);
|
||||
}else{
|
||||
showAlert('d','请选择时间','mPointHisChangeDataAlertdiv');
|
||||
hisDataTable.bootstrapTable('removeByUniqueId',row.itemid);
|
||||
insertTableRow(row.parmvalue);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
//获取最大值、最小值、平均值等
|
||||
function getHisData4Screen() {
|
||||
$.post(ext.contextPath + "/work/mpoint/getHisData4Screen.do", {
|
||||
mpid: '${param.mpcode}',
|
||||
sdt: beginTimeStore,
|
||||
edt: endTimeStore,
|
||||
bizid: '${param.unitId}',
|
||||
maxData: $('#maxData').val(),
|
||||
minData: $('#minData').val(),
|
||||
equalData: $('#equalData').val(),
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
var hisData4ScreenStr = "";
|
||||
if(data.avg!=null && data.avg!=undefined && data.avg!=''){
|
||||
hisData4ScreenStr+='<li>平均值:'+data.avg+';</li>';
|
||||
}
|
||||
if(data.max!=null && data.max!=undefined && data.max!=''){
|
||||
hisData4ScreenStr+='<li>最大值:'+data.max+';</li>';
|
||||
}
|
||||
if(data.min!=null && data.min!=undefined && data.min!=''){
|
||||
hisData4ScreenStr+='<li>最小值:'+data.min+';</li>';
|
||||
}
|
||||
$("#hisData4Screen").html(hisData4ScreenStr);
|
||||
});
|
||||
}
|
||||
function insertTableRow(parmvalue) {
|
||||
if($("#hisDataModal #measuredt").length > 0){
|
||||
showAlert('d','已存在!','mPointHisChangeDataAlertdiv');
|
||||
}else{
|
||||
if(parmvalue==null || parmvalue==undefined || parmvalue==''){
|
||||
parmvalue = 0;
|
||||
}
|
||||
var newData = [{
|
||||
itemid:'newData',
|
||||
measuredt: '<input type="text" class="form-control" id="measuredt" placeholder="请先点击选择时间" readonly/>',
|
||||
parmvalue: parmvalue,
|
||||
}];
|
||||
$('#hisDataTable').bootstrapTable('prepend', newData);
|
||||
$("#measuredt").datetimepicker({
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
minuteStep: 5, //分钟间隔为5分
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
startView: "month", //初始化视图
|
||||
minView: 0,
|
||||
maxView: "year",
|
||||
language: 'zh-CN'
|
||||
}).on('changeDate', function (ev) {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
function doHisDataSearch() {
|
||||
$("#hisDataTable").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
function delMPointHistory(itemid,measuredt,parmValue) {
|
||||
$.post(ext.contextPath + "/work/mpoint/delMPointHistory.do", {
|
||||
unitId: '${param.unitId}',
|
||||
mpid: '${param.mpcode}',
|
||||
itemid: itemid,
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
$.post(ext.contextPath + "/work/mPointHisChangeData/dosave.do", {
|
||||
measuredt: measuredt,
|
||||
mpid: '${param.mpcode}',
|
||||
olddata: parmValue,
|
||||
changeType: '${Change_Delete}'
|
||||
});
|
||||
doHisDataSearch();
|
||||
}else{
|
||||
showAlert('d','删除失败!','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveMPointHistory(measuredt, parmValue) {
|
||||
$.post(ext.contextPath + "/work/mpoint/saveMPointHistory.do", {
|
||||
measuredt: measuredt,
|
||||
parmValue: parmValue,
|
||||
unitId: '${param.unitId}',
|
||||
mpid: '${param.mpcode}'
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
$.post(ext.contextPath + "/work/mPointHisChangeData/dosave.do", {
|
||||
measuredt: measuredt,
|
||||
mpid: '${param.mpcode}',
|
||||
newValue: parmValue,
|
||||
changeType: '${Change_Add}'
|
||||
});
|
||||
doHisDataSearch();
|
||||
}else{
|
||||
showAlert('d','添加失败!','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function upHisDateValue(measuredt, newValue, olddata) {
|
||||
$.post(ext.contextPath + "/work/mpoint/upHisDateValue.do", {
|
||||
measuredt: measuredt,
|
||||
unitId: '${param.unitId}',
|
||||
mpid: '${param.mpcode}',
|
||||
newValue: newValue
|
||||
},function(result) {
|
||||
var data= $.parseJSON(result);
|
||||
if (data.code == 1) {
|
||||
$.post(ext.contextPath + "/work/mPointHisChangeData/dosave.do", {
|
||||
measuredt: measuredt,
|
||||
mpid: '${param.mpcode}',
|
||||
newValue: newValue,
|
||||
olddata: olddata,
|
||||
changeType: '${Change_Edit}'
|
||||
});
|
||||
doHisDataSearch();
|
||||
}else{
|
||||
showAlert('d','修改失败!','mPointHisChangeDataAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showChange() {
|
||||
$.post(ext.contextPath + '/work/mPointHisChangeData/doView.do', {mpcode: '${param.mpcode}'}, function (data) {
|
||||
$("#hisChangeDataDiv").html(data);
|
||||
openModal('hisChangeDataModal');
|
||||
});
|
||||
}
|
||||
function exportExcel() {
|
||||
showAlert('s','导出中...','mPointHisChangeDataAlertdiv');
|
||||
var iframe = document.getElementById("theone")
|
||||
iframe.src=ext.contextPath + "/work/mpoint/HisDataExportExcel.do?mpid=${param.mpcode}&sdt="+beginTimeStore
|
||||
+"&edt="+endTimeStore+"&bizid=${param.unitId}&maxData="+$('#maxData').val()+"&minData="+$('#minData').val()+"&equalData="+$('#equalData').val();
|
||||
}
|
||||
|
||||
|
||||
function importExcelMPoint(){
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {} , function(res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
$.post(ext.contextPath + '/work/mpoint/importMpointHis.do?mpid=${param.mpcode}&bizid=${param.unitId}', {} , function(data) {
|
||||
$("#subHisDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d',resp.msg,'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="hisDataModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">历史数据</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="mPointHisChangeDataAlertdiv"></div>
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div class="form-group bg-info">
|
||||
<div class="row">
|
||||
<label class="col-sm-1 control-label">ID</label>
|
||||
<div class="col-sm-3 border-right">
|
||||
<p class="form-control-static" >${mPoint.id}</p>
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">名称</label>
|
||||
<div class="col-sm-5 border-right">
|
||||
<p class="form-control-static" >${mPoint.parmname}</p>
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">单位</label>
|
||||
<div class="col-sm-1">
|
||||
<p class="form-control-static" >${mPoint.unit}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 5px;">
|
||||
<div class="col-lg-4 pull-right">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">时间</span>
|
||||
<input type="text" class="form-control" id="reservationtime" style="width:225px;">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="doHisDataSearch();"><i
|
||||
class="fa fa-search"></i> 查询
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" onclick="doHisDataSearch();">计算
|
||||
</button>
|
||||
</span>
|
||||
</div><!-- /input-group -->
|
||||
</div>
|
||||
<%-- <div class="col-lg-3 text-right">--%>
|
||||
<%-- <div class="btn-group btn-group-sm" role="group" aria-label="..." style="width: 300px">--%>
|
||||
<%-- <button type="button" class="btn btn-default" onclick="insertTableRow();" style="margin-left: 5px;">--%>
|
||||
<%-- <i class="fa fa-plus"></i> 添加</button>--%>
|
||||
<%-- <button type="button" class="btn btn-default" onclick="showChange();" style="margin-left: 5px;">--%>
|
||||
<%-- <i class="fa fa-book"></i> 记录</button>--%>
|
||||
<%-- <button type="button" class="btn btn-default" onclick="exportExcel();" style="margin-left: 5px;">--%>
|
||||
<%-- <i class="fa fa-file-excel-o"></i> 导出</button>--%>
|
||||
<%-- <button type="button" class="btn btn-default" onclick="importExcelMPoint();" style="margin-left: 5px;">--%>
|
||||
<%-- <i class="fa fa-file-excel-o"></i> 导入</button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div><!-- /.row -->
|
||||
<div class="input-group-btn pull-right">
|
||||
</div>
|
||||
</form>
|
||||
<div id="container">
|
||||
<table id="hisDataTable"></table>
|
||||
</div>
|
||||
<div style="display:none;">
|
||||
<iframe id="theone" src=""></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<ul class="list-inline pull-left" id="hisData4Screen"></ul>
|
||||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
95
WebRoot/jsp/work/mPointHisImport.jsp
Normal file
95
WebRoot/jsp/work/mPointHisImport.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<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 control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": unitId, //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/work/mpoint/hisDataImportExcel.do?companyId="+unitId + "&mpid=" + '${mpid}');
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">导入单点位数据</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
100
WebRoot/jsp/work/mPointHisImportMultiple.jsp
Normal file
100
WebRoot/jsp/work/mPointHisImportMultiple.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<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 control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": unitId, //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/work/mpoint/hisDataMultipleImportExcel.do?companyId="+unitId);
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
// 导出模板
|
||||
function hisDataMultipleImportExcelTemp(){
|
||||
window.open(ext.contextPath + "/work/mpoint/hisDataMultipleImportExcelTemp.do?unitId=" + unitId);
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">导入多点位数据</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="hisDataMultipleImportExcelTemp()">模板下载</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
95
WebRoot/jsp/work/mPointImport.jsp
Normal file
95
WebRoot/jsp/work/mPointImport.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<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 control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"companyId": unitId, //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/work/mpoint/saveExcelData.do?companyId="+unitId);
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">导入</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
521
WebRoot/jsp/work/mPointList.jsp
Normal file
521
WebRoot/jsp/work/mPointList.jsp
Normal file
@ -0,0 +1,521 @@
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%@ 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" %>
|
||||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<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 editFun = function (id) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/edit.do', {id: id, bizId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var modbusFun = function (id) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/editModbus.do', {id: id, bizId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var formulaFun = function (id) {
|
||||
$.post(ext.contextPath + '/work/mpoint/formula.do', {id: id, bizId: companyId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
console.info(id)
|
||||
$.post(ext.contextPath + '/work/mpoint/showHistory.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/add.do', {companyId: companyId}, 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 + '/work/mpoint/deletes.do', {
|
||||
ids: datas,
|
||||
bizId: companyId
|
||||
}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
// initFun();
|
||||
};
|
||||
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'})
|
||||
};
|
||||
//初始化AI选择框
|
||||
var refreshsignaltypeSelect = function() {
|
||||
var select = $("#signaltypeSelect").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
};
|
||||
//初始化采集类型选择框
|
||||
var refreshtypeForSelect = function() {
|
||||
var select = $("#typeForSelect").select2({
|
||||
data: null,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val("").trigger("change");
|
||||
select.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
};
|
||||
var companyId = "";
|
||||
var initFun = function () {
|
||||
//refreshSelect();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, 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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
}, 'json');
|
||||
|
||||
|
||||
// $.post(ext.contextPath + "/work/mpoint/getJson.do", {}, function (data) {
|
||||
// var selelct = $("#modbusfigidSelect").select2({
|
||||
// data: data,
|
||||
// placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
// escapeMarkup: function (markup) {
|
||||
// return markup;
|
||||
// }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: -1,//禁用搜索框
|
||||
// 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) {
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// });
|
||||
|
||||
// }, 'json');
|
||||
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/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(),
|
||||
modbusfigidSelect: $("#modbusfigidSelect").val(),
|
||||
type: $('#typeForSelect').val(),
|
||||
signaltype: $('#signaltypeSelect').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.mpointcode);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '变量名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '测量点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'disname', // 返回json数据中的name
|
||||
title: '简称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'sourceType', // 返回json数据中的name
|
||||
title: '采集类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value=="${Flag_Type_Data}") {
|
||||
return "自控采集点";
|
||||
}else if (value=="${Flag_Type_Hand}") {
|
||||
return "手动录入点";
|
||||
}else if (value=="${Flag_Type_KPI}") {
|
||||
return "KPI计算点";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'signaltype', // 返回json数据中的name
|
||||
title: '信号类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'signaltag', // 返回json数据中的name
|
||||
title: '信号标签', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '采集时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}, {
|
||||
field: 'company.name', // 返回json数据中的name
|
||||
title: '隶属', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 200, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<security:authorize buttonUrl="work/mpoint/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/mpoint/formula.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="公式配置" onclick="formulaFun(\'' + row.id + '\')"><i class="fa fa-calculator"></i><span class="hidden-md hidden-lg"> 公式配置</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="查看曲线" onclick="showHis(\'' + row.id + '\')"><i class="fa fa-line-chart"></i><span class="hidden-md hidden-lg"> 查看曲线</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="历史数据" onclick="showHisData(\'' + row.id + '\',\'' + row.bizid + '\')"><i class="fa fa-database"></i><span class="hidden-md hidden-lg"> 历史数据</span></button>';
|
||||
// <%--buts += '<security:authorize buttonUrl="work/mpoint/modbus.do">';--%>
|
||||
if (row.modbusfigid != null && row.modbusfigid != '' && row.register != null && row.register != '') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="\'' + row.register + '\'" onclick="modbusFun(\'' + row.id + '\')" style="color:#0080FF;"><i class="fa fa-cog"></i><span class="hidden-md hidden-lg"> modbus配置</span></button>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" title="modbus配置" onclick="modbusFun(\'' + row.id + '\')" ><i class="fa fa-cog"></i><span class="hidden-md hidden-lg"> modbus配置</span></button>';
|
||||
}
|
||||
// <%--buts += '</security:authorize>';--%>
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
}/* ,{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 150, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str="";
|
||||
str+='<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.mpointcode + '\')" data-toggle="tooltip" title="查看"><span class="hidden-md">查看</span><i class="fa fa-eye hidden-xs"></i></button>';
|
||||
str='<div class="btn-group" >'+str+'</div>';
|
||||
return str;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
} */
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
$(function () {
|
||||
companyId = unitId;
|
||||
refreshsignaltypeSelect();
|
||||
refreshtypeForSelect();
|
||||
$("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
search_code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
//init();
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
|
||||
initFun();
|
||||
|
||||
});
|
||||
|
||||
function showHis(mpcode) {
|
||||
$.post(ext.contextPath + '/data/showOnlyLine.do', {mpcode: mpcode}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('curveModal');
|
||||
});
|
||||
}
|
||||
|
||||
//历史数据
|
||||
function showHisData(mpcode, bizid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showHisData.do', {mpcode: mpcode, unitId: bizid}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('hisDataModal');
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<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>
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="formulasubDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="formulaDenominatorsubDiv"></div>
|
||||
<div id="hisChangeDataDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div id="companySelectTree">
|
||||
|
||||
</div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/mpoint/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 class="form-group pull-right form-inline">
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;padding-right: 5px;">
|
||||
<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 class="input-group input-group-sm" style="padding-right: 5px;">
|
||||
<label class="form-label">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name="processSection"
|
||||
style="width: 180px;"></select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="input-group input-group-sm pull-left" style="padding-right: 5px;">
|
||||
<label class="form-label" style="float: left;line-height: 2;">Modbus服务器:</label>
|
||||
<select class="form-control select2 " id="modbusfigidSelect" name="modbusfigidSelect"
|
||||
style="width: 120px;"></select>
|
||||
</div> -->
|
||||
|
||||
<div class="input-group input-group-sm ">
|
||||
<label class="form-label">采集类型:</label>
|
||||
<select type="text" id="typeForSelect" class="form-control pull-right"
|
||||
name="typeForSelect" style="width: 180px;">
|
||||
<option value="${Flag_Type_Data}">自控采集点</option>
|
||||
<option value="${Flag_Type_Hand}">手动录入点</option>
|
||||
<option value="${Flag_Type_KPI}">KPI计算点</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm ">
|
||||
<label class="form-label">信号类型:</label>
|
||||
<select type="text" id="signaltypeSelect" class="form-control pull-right"
|
||||
name="signaltypeSelect" style="width: 120px;">
|
||||
<option value="AI">AI</option>
|
||||
<option value="DI">DI</option>
|
||||
<option value="AO">AO</option>
|
||||
<option value="DO">DO</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 引入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>
|
||||
<!-- 引入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>
|
||||
|
||||
</html>
|
||||
657
WebRoot/jsp/work/mPointListES.jsp
Normal file
657
WebRoot/jsp/work/mPointListES.jsp
Normal file
@ -0,0 +1,657 @@
|
||||
<%@page import="com.sipai.entity.scada.MPoint" %>
|
||||
<%@ 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" %>
|
||||
<%request.setAttribute("Flag_Type_KPI", MPoint.Flag_Type_KPI);%>
|
||||
<%request.setAttribute("Flag_Type_Hand", MPoint.Flag_Type_Hand);%>
|
||||
<%request.setAttribute("Flag_Type_Data", MPoint.Flag_Type_Data);%>
|
||||
<%request.setAttribute("Flag_Type_Model", MPoint.Flag_Type_Model);%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<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 editFun = function (id, bizid) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/edit.do', {id: id, bizId: bizid}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//公式配置
|
||||
var formulaFun = function (id, bizid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/formula.do', {id: id, bizId: bizid}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//曲线
|
||||
function showHisLine(mpcode, bizid) {
|
||||
$.post(ext.contextPath + '/data/showOnlyLine.do', {mpcode: mpcode, unitId: bizid}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('curveModal');
|
||||
});
|
||||
}
|
||||
|
||||
//历史数据
|
||||
function showHisData(mpcode, bizid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showHisData.do', {mpcode: mpcode, unitId: bizid}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('hisDataModal');
|
||||
});
|
||||
}
|
||||
|
||||
//modbus配置
|
||||
var modbusFun = function (id, bizid) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/editModbus.do', {id: id, bizId: bizid}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var viewFun = function (id) {
|
||||
// console.info(id)
|
||||
$.post(ext.contextPath + '/work/mpoint/showHistory.do', {id: id}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addFun = function () {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/add.do', {companyId: unitId}, 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 + '/work/mpoint/deletesEs.do', {
|
||||
ids: datas,
|
||||
bizId: companyId
|
||||
}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||
// initFun();
|
||||
};
|
||||
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'})
|
||||
};
|
||||
|
||||
//初始化AI选择框
|
||||
var refreshsignaltypeSelect = function () {
|
||||
var select = $("#signaltypeSelect").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val('').trigger("change");
|
||||
select.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||
});
|
||||
|
||||
};
|
||||
//初始化采集类型选择框
|
||||
var refreshtypeForSelect = function () {
|
||||
var select = $("#typeForSelect").select2({
|
||||
data: null,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
select.val("").trigger("change");
|
||||
select.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
var initFun = function () {
|
||||
//refreshSelect();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, 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) {
|
||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||
});
|
||||
|
||||
}, 'json');
|
||||
|
||||
|
||||
/*$.post(ext.contextPath + "/work/mpoint/getJson.do", {}, function (data) {
|
||||
var selelct = $("#modbusfigidSelect").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
}, 'json');*/
|
||||
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlistES.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(),
|
||||
search_code: $('#search_code1').val(),
|
||||
unitId: unitId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
modbusfigidSelect: $("#modbusfigidSelect").val(),
|
||||
type: $('#typeForSelect').val(),
|
||||
signaltype: $('#signaltypeSelect').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.mpointcode);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'mpointid', // 返回json数据中的name
|
||||
title: '变量Id', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '变量名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '测量点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
/*{
|
||||
field: 'disname', // 返回json数据中的name
|
||||
title: '简称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, */
|
||||
{
|
||||
field: 'processSection.name', // 返回json数据中的name
|
||||
title: '工艺段', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'sourceType', // 返回json数据中的name
|
||||
title: '采集类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value == "${Flag_Type_Data}") {
|
||||
return "自控采集点";
|
||||
} else if (value == "${Flag_Type_Hand}") {
|
||||
return "手动录入点";
|
||||
} else if (value == "${Flag_Type_KPI}") {
|
||||
return "KPI计算点";
|
||||
} else if (value == "${Flag_Type_Model}") {
|
||||
return "模型预测点";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'signaltype', // 返回json数据中的name
|
||||
title: '信号类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'signaltag', // 返回json数据中的name
|
||||
title: '信号标签', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '采集时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: 90, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
value = value.replace("T", " ");
|
||||
value = value.replace("Z", "");
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}, {
|
||||
field: 'bizname', // 返回json数据中的name
|
||||
title: '隶属', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 160, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<security:authorize buttonUrl="work/mpoint/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\',\'' + row.bizid + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<security:authorize buttonUrl="work/mpoint/formula.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="公式配置" onclick="formulaFun(\'' + row.id + '\',\'' + row.bizid + '\')"><i class="fa fa-calculator"></i><span class="hidden-md hidden-lg"> 公式配置</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="查看曲线" onclick="showHisLine(\'' + row.id + '\',\'' + row.bizid + '\')"><i class="fa fa-line-chart"></i><span class="hidden-md hidden-lg"> 查看曲线</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" title="历史数据" onclick="showHisData(\'' + row.id + '\',\'' + row.bizid + '\')"><i class="fa fa-database"></i><span class="hidden-md hidden-lg"> 历史数据</span></button>';
|
||||
// <%--buts += '<security:authorize buttonUrl="work/mpoint/modbus.do">';--%>
|
||||
if (row.modbusfigid != null && row.modbusfigid != '' && row.register != null && row.register != '') {
|
||||
// buts += '<button class="btn btn-default btn-sm" title="\'' + row.register + '\'" onclick="modbusFun(\'' + row.id + '\',\'' + row.bizid + '\')" style="color:#0080FF;"><i class="fa fa-cog"></i><span class="hidden-md hidden-lg"> modbus配置</span></button>';
|
||||
} else {
|
||||
// buts += '<button class="btn btn-default btn-sm" title="modbus配置" onclick="modbusFun(\'' + row.id + '\',\'' + row.bizid + '\')" ><i class="fa fa-cog"></i><span class="hidden-md hidden-lg"> modbus配置</span></button>';
|
||||
}
|
||||
// <%--buts += '</security:authorize>';--%>
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
}/* ,{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 150, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str="";
|
||||
str+='<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.mpointcode + '\')" data-toggle="tooltip" title="查看"><span class="hidden-md">查看</span><i class="fa fa-eye hidden-xs"></i></button>';
|
||||
str='<div class="btn-group" >'+str+'</div>';
|
||||
return str;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
} */
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
$(function () {
|
||||
refreshsignaltypeSelect();
|
||||
refreshtypeForSelect();
|
||||
/*$("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
search_code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});*/
|
||||
//init();
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
|
||||
initFun();
|
||||
|
||||
});
|
||||
|
||||
function doExport() {
|
||||
if (unitId == "") {//获取验证结果,如果成功,执行下面代码
|
||||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||||
} else {
|
||||
var checkedItems = $("#table").bootstrapTable('getAllSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {}, function (res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
window.open(ext.contextPath + "/work/mpoint/doExport.do?unitId=" + unitId
|
||||
+ "&mpids=" + datas);
|
||||
} else {
|
||||
showAlert('d', resp.msg, 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function importExcelMPoint() {
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {}, function (res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
$.post(ext.contextPath + '/work/mpoint/importMpoint.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d', resp.msg, 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function importExcelMPointHisMultiple() {
|
||||
$.post(ext.contextPath + "/work/mpoint/getUnType.do?unitId=" + unitId, {}, function (res) {
|
||||
var resp = eval('(' + res + ')');
|
||||
if (resp.status) {
|
||||
$.post(ext.contextPath + '/work/mpoint/importMpointHisMultiple.do', {unitId: unitId}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
} else {
|
||||
showAlert('d', resp.msg, 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.onkeydown = function (event) {
|
||||
var target, code, tag;
|
||||
if (!event) {
|
||||
event = window.event; //针对ie浏览器
|
||||
target = event.srcElement;
|
||||
code = event.keyCode;
|
||||
if (code == 13) {
|
||||
tag = target.tagName;
|
||||
if (tag == "TEXTAREA") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
target = event.target; //针对遵循w3c标准的浏览器,如Firefox
|
||||
code = event.keyCode;
|
||||
if (code == 13) {
|
||||
tag = target.tagName;
|
||||
if (tag == "INPUT") {
|
||||
return false;
|
||||
} else if (tag == "BUTTON") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subHisDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="formulasubDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="formulaDenominatorsubDiv"></div>
|
||||
<div id="mPointFormulaAutoHourDiv"></div>
|
||||
<div id="hisChangeDataDiv"></div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div id="companySelectTree">
|
||||
|
||||
</div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 325px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/mpoint/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="work/mpoint/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="work/mpoint/doImport.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick='importExcelMPoint()'><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入
|
||||
</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="work/mpoint/doExport.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="doExport();"><i
|
||||
class="fa fa-cloud-download"></i>
|
||||
导出
|
||||
</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="work/mpoint/doImportData.do">
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
onclick='importExcelMPointHisMultiple()'><i
|
||||
class="fa fa-cloud-upload"></i>
|
||||
导入数据
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;padding-right: 5px;">
|
||||
<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 class="input-group input-group-sm" style="width: 250px;padding-right: 5px;">
|
||||
<input type="text" id="search_code1" name="search_code"
|
||||
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 class="input-group input-group-sm" style="padding-right: 5px;">
|
||||
<label class="form-label">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name="processSection"
|
||||
style="width: 180px;"></select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm ">
|
||||
<label class="form-label">采集类型:</label>
|
||||
<select type="text" id="typeForSelect" class="form-control pull-right"
|
||||
name="typeForSelect" style="width: 180px;">
|
||||
<option value="${Flag_Type_Data}">自控采集点</option>
|
||||
<option value="${Flag_Type_Hand}">手动录入点</option>
|
||||
<option value="${Flag_Type_KPI}">KPI计算点</option>
|
||||
<option value="${Flag_Type_Model}">模型预测点</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm ">
|
||||
<label class="form-label">信号类型:</label>
|
||||
<select type="text" id="signaltypeSelect" class="form-control pull-right"
|
||||
name="signaltypeSelect" style="width: 120px;">
|
||||
<option value="AI">AI</option>
|
||||
<option value="DI">DI</option>
|
||||
<option value="AO">AO</option>
|
||||
<option value="DO">DO</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 引入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>
|
||||
<!-- 引入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>
|
||||
|
||||
</html>
|
||||
280
WebRoot/jsp/work/mPointListForEquipmentSelects.jsp
Normal file
280
WebRoot/jsp/work/mPointListForEquipmentSelects.jsp
Normal file
@ -0,0 +1,280 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
<script type="text/javascript">
|
||||
var dosearchMp = function() {
|
||||
$("#table_mpoint").bootstrapTable('refresh');
|
||||
};
|
||||
function doselect() {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
if(datas!=""){
|
||||
$.post(ext.contextPath + '/equipment/updateEquipmentAndMPointRelation.do',{mPointIds : datas,equipmentId:'${param.equipmentId}',companyId:'${param.companyId}'}, function(resp) {
|
||||
if(resp.res > 0){
|
||||
$("#table_point").bootstrapTable('refresh');
|
||||
closeModal("mpSubModal")
|
||||
}else{
|
||||
showAlert('d','保存失败','mpoint_mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
}else{
|
||||
showAlert('d','请选择测量点','mpoint_mainAlertdiv');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if('${mpoints}' != ''){
|
||||
$.each(eval('${mpoints}'), function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${mpoints}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${mpoints}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_mpointcode : $('#search_mpointcode').val(),
|
||||
search_mpointname : $('#search_mpointname').val(),
|
||||
companyId : '${param.companyId}',
|
||||
};
|
||||
var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
|
||||
|
||||
|
||||
//jquery html()方法加载,导致box无法执行boxwidget(),手动初始化
|
||||
$('#searchBox').boxWidget();
|
||||
$('#switchBtn').bootstrapSwitch({
|
||||
onText:'是',
|
||||
offText:'否',
|
||||
size:"small",
|
||||
})
|
||||
//$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_mpoint").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '测量点ID', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
//width:Width/10
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'signaltype', // 返回json数据中的name
|
||||
title: '信号类型', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter : function(value, row) {
|
||||
if('${Flag_Enable}'==value){
|
||||
return "启用";
|
||||
}else{
|
||||
return "禁用";
|
||||
}
|
||||
|
||||
} // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_mpoint");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="mpSubModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="mpoint_mainAlertdiv"></div>
|
||||
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
|
||||
<div class="box-header">
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
|
||||
style="margin-right: 5px;">
|
||||
<i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
<!-- /. tools -->
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="box-body collapse" >
|
||||
<form class="form-horizontal " style="padding:0;">
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
<label class="control-label col-sm-2">点位编码</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control input-sm" placeholder="编码" style="width:170px;">
|
||||
</div>
|
||||
<label class="control-label col-sm-2 ">点位名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="search_mpointname" name="search_mpointname" class="form-control input-sm" placeholder="名称" style="width:170px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-right: 20px;">
|
||||
|
||||
<label class="col-sm-2 control-label">只看选中</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="switch" data-on="primary" data-off="info">
|
||||
<input id ="switchBtn" type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-sm-6 button-group" style="padding: 0;">
|
||||
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="dosearchMp();"><i class="fa fa-search"> 搜索</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div id="table_mpoint" style="height:230px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doselect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
421
WebRoot/jsp/work/mPointListForSWJ.jsp
Normal file
421
WebRoot/jsp/work/mPointListForSWJ.jsp
Normal file
@ -0,0 +1,421 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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 editFun = function(id) {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/edit.do', {id:id,bizId:"021NS"} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var formulaFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/mpoint/formula.do', {id:id,bizId:"021NS"} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id) {
|
||||
console.info(id)
|
||||
$.post(ext.contextPath + '/work/mpoint/showHistory.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var addFun = function() {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/work/mpoint/add.do', {companyId:"021NS"} , 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 + '/work/mpoint/deletes.do', {ids:datas,bizId:"021NS"} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
// initFun();
|
||||
};
|
||||
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'})
|
||||
};
|
||||
var companyId = "";
|
||||
var initFun = function () {
|
||||
//refreshSelect();
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", { companyId: "021NS" }, 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) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
}, 'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/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: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.mpointcode);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '采集时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,19);
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
},{
|
||||
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="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
// buts+= '<security:authorize buttonUrl="work/mpoint/formula.do">';
|
||||
// buts+= '<button class="btn btn-default btn-sm" title="公式配置" onclick="formulaFun(\'' + row.id + '\')"><i class="fa fa-calculator"></i><span class="hidden-md hidden-lg"> 公式配置</span></button>';
|
||||
// buts+= '</security:authorize>';
|
||||
// buts+= '<button class="btn btn-default btn-sm" title="查看曲线" onclick="showHis(\'' + row.id + '\')"><i class="fa fa-line-chart"></i><span class="hidden-md hidden-lg"> 查看曲线</span></button>';
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
}/* ,{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 150, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str="";
|
||||
str+='<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.mpointcode + '\')" data-toggle="tooltip" title="查看"><span class="hidden-md">查看</span><i class="fa fa-eye hidden-xs"></i></button>';
|
||||
str='<div class="btn-group" >'+str+'</div>';
|
||||
return str;
|
||||
//return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>';
|
||||
}
|
||||
} */
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
$(function() {
|
||||
companyId="021NS";
|
||||
$("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
search_code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '厂区不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
//init();
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
initFun();
|
||||
// $.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||||
// $('#companySelectTree').html(data);
|
||||
|
||||
// });
|
||||
/* $.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/getProcessSection4SelectCode.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');
|
||||
}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/getProcessSection4SelectCode.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'); */
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function showHis(mpcode){
|
||||
$.post(ext.contextPath + '/data/showOnlyLine.do', {mpcode:mpcode} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('curveModal');
|
||||
});
|
||||
}
|
||||
|
||||
</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="emSubDiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="formulasubDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="formulaDenominatorsubDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div >
|
||||
<!-- <div class="form-group form-inline">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
</div>
|
||||
</div> -->
|
||||
<div id="companySelectTree">
|
||||
|
||||
</div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/mpoint/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 class="form-group pull-right form-inline" >
|
||||
<!-- <div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">工艺段</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 120px;"></select>
|
||||
</div> -->
|
||||
<div class="form-group" >
|
||||
<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>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 引入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>
|
||||
<!-- 引入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>
|
||||
|
||||
</html>
|
||||
308
WebRoot/jsp/work/mPointListForSelect.jsp
Normal file
308
WebRoot/jsp/work/mPointListForSelect.jsp
Normal file
@ -0,0 +1,308 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var companyId=unitId;
|
||||
var dosearchMp = function() {
|
||||
$("#table_mpoint").bootstrapTable('refresh');
|
||||
};
|
||||
function doselect(dialog,grid) {
|
||||
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||||
var datas_name="";
|
||||
var value_name="";
|
||||
var datas_code="";
|
||||
if(checkedItem!= null && checkedItem!=""){
|
||||
$.post(ext.contextPath + '/work/mpoint/getlist.do', {companyId:companyId,checkedIds : checkedItem.id,page:1,rows:50}, function(resp) {
|
||||
//console.info(checkedItem.id)
|
||||
$.each(resp.rows, function(index, item){
|
||||
datas_name=item.parmname;//测量点一次只能添加一个
|
||||
value_name=item.parmvalue;
|
||||
datas_code=item.mpointcode;
|
||||
});
|
||||
// console.log("formid","${param.formId}");
|
||||
// console.log("formid","${param.hiddenId}");
|
||||
// console.log(companyId);
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(checkedItem.id);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
if('${param.valueId}'!=''&&'${param.valueId}'!=null){
|
||||
$('#${param.formId} #${param.valueId}').val(value_name);
|
||||
}
|
||||
if('${param.codeId}'!=''&&'${param.codeId}'!=null){
|
||||
$('#${param.formId} #${param.codeId}').val(datas_code);
|
||||
}
|
||||
if('${param.unitId}'!=''&&'${param.unitId}'!=null){
|
||||
$('#${param.formId} #${param.unitId}').val(companyId);
|
||||
}
|
||||
|
||||
closeModal('mpSubModal');
|
||||
},'json');
|
||||
}else{
|
||||
showAlert('d','尚未选择测量点!','mpoint_mainAlertdiv');
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${mpid}'){
|
||||
flag=true;
|
||||
checkedItem = "";
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
var $table;
|
||||
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
pid:params.pid,
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
search_name: $('#search_mpointname').val(),
|
||||
search_mpointcode: $('#search_mpointcode').val(),
|
||||
companyId:companyId,
|
||||
active:'启用'
|
||||
};
|
||||
/* var status =$('#switchBtn').bootstrapSwitch('state')
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
*/ return temp;
|
||||
}
|
||||
$(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;
|
||||
dosearchMp();
|
||||
}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();
|
||||
dosearchMp();
|
||||
});
|
||||
}
|
||||
},'json'); */
|
||||
//简易公司combotree
|
||||
// $.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
// if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
// //当登陆者的pid以下没有子节点时显示单独一个span
|
||||
// $("#search_code").val(data[0].id);
|
||||
// $("#companyselect").hide();
|
||||
// $("#company").text("公司: " + data[0].text);
|
||||
// companyId = data[0].id;
|
||||
// dosearchMp();
|
||||
// //initFun();
|
||||
// } else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
||||
// //第一次加载时赋值
|
||||
// $("#search_code").val(data[0].id);
|
||||
// $("#cname_input").val(data[0].text);
|
||||
// companyId = data[0].id;
|
||||
// dosearchMp();
|
||||
// //initFun();
|
||||
// //$table.bootstrapTable('refresh');//异步加载重新刷新,待修改
|
||||
// $('#companytree').treeview({
|
||||
// data: data,
|
||||
// showBorder: false,
|
||||
// levels: 3,
|
||||
// });
|
||||
// $('#companytree').on('nodeSelected', function (event, data) {
|
||||
// $("#search_code").val(data.id);
|
||||
// $("#cname_input").val(data.text);
|
||||
// document.getElementById('ul_tree').style.display = "none";
|
||||
// companyId= data.id;
|
||||
// dosearchMp();
|
||||
// //initFun();
|
||||
// });
|
||||
// } else {
|
||||
// //待完善
|
||||
// };
|
||||
// }, 'json');
|
||||
// //防止点击树的+号收起下拉框
|
||||
// $("#ul_tree").on("click", function (e) {
|
||||
// event.stopPropagation();
|
||||
// });
|
||||
// //点击空白隐藏树
|
||||
// $(document).click(function (e) {
|
||||
// var divTree = $('#ul_tree'); // 设置目标区域
|
||||
// if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
// divTree.hide()
|
||||
// }
|
||||
// })
|
||||
//initialSelectionIds();
|
||||
//alert();
|
||||
$table=$("#table_mpoint").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'signaltype', // 返回json数据中的name
|
||||
title: '信号类型', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
// ,{
|
||||
// field: 'active', // 返回json数据中的name
|
||||
// title: '启用状态', // 表格表头显示文字
|
||||
// sortable : true,
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// formatter : function(value, row) {
|
||||
// if('${Flag_Enable}'==value){
|
||||
// return "启用";
|
||||
// }else{
|
||||
// return "禁用";
|
||||
// }
|
||||
|
||||
// } // 上下居中
|
||||
// }
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_mpoint");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
if('check'==e.type){
|
||||
$('#table_mpoint .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="mpSubModal" >
|
||||
<div class="modal-dialog modal-md" >
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div id="mpoint_mainAlertdiv"></div>
|
||||
<div id="menu4SelectDiv"></div>
|
||||
<div id="modal-body">
|
||||
<!-- <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 " style="margin-bottom:10px;">
|
||||
<input id="search_code" name="search_code" type="hidden" />
|
||||
<span id="company" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm " style="width: 220px;margin-left:30px">
|
||||
<input type="text" id="search_mpointname" name="search_mpointname" class="form-control pull-right" placeholder="点位名称">
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 220px;">
|
||||
|
||||
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control " placeholder="点位编码">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchMp();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 重置</button> -->
|
||||
</div>
|
||||
<!-- <div class="form-group " style="padding:0;">
|
||||
<label class="form-label">班组</label>
|
||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||
<div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 500px;">
|
||||
<input type="text" id="search_pid" name="search_pid" class="form-control pull-right" style="width: 200px;" placeholder="所属车间">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" style="width: 200px;margin-right:10px" placeholder="系统名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_mpoint"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doselect()" id="btn_save">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user