437 lines
21 KiB
Plaintext
437 lines
21 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
|
|
<%@page import="com.sipai.entity.process.DataVisualMpView" %>
|
||
|
|
<%request.setAttribute("JsMethod_0", DataVisualMpView.JsMethod_0); %>
|
||
|
|
<%request.setAttribute("JsMethod_1", DataVisualMpView.JsMethod_1); %>
|
||
|
|
<%request.setAttribute("JsMethod_2", DataVisualMpView.JsMethod_2); %>
|
||
|
|
<%request.setAttribute("JsMethod_3", DataVisualMpView.JsMethod_3); %>
|
||
|
|
<%request.setAttribute("JsMethod_4", DataVisualMpView.JsMethod_4); %>
|
||
|
|
|
||
|
|
<style type="text/css">
|
||
|
|
|
||
|
|
</style>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var masterId = '${dataVisualMpView.id}'
|
||
|
|
var tbName = 'tb_pro_dataVisual_mpView_file'; //数据表
|
||
|
|
var nameSpace = 'datavisual';//保存文件夹
|
||
|
|
var bucketName = 'datavisual';
|
||
|
|
var filelist = new Array();
|
||
|
|
var previews = new Array();
|
||
|
|
var previewConfigs = new Array();
|
||
|
|
|
||
|
|
$(function () {
|
||
|
|
$('#colorContainer1').colorpicker({format: null});
|
||
|
|
$('#colorContainer2').colorpicker({format: null});
|
||
|
|
|
||
|
|
$("#jsmethod").select2({minimumResultsForSearch: -1}).val("${dataVisualMpView.jsmethod}").trigger("change");
|
||
|
|
var datavaluemethod = JSON.parse("[{\"id\":\"nowTime\",\"text\":\"nowTime\"},{\"id\":\"sum\",\"text\":\"sum\"},{\"id\":\"diff\",\"text\":\"diff\"},{\"id\":\"avg\",\"text\":\"avg\"},{\"id\":\"max\",\"text\":\"max\"},{\"id\":\"min\",\"text\":\"min\"},{\"id\":\"first\",\"text\":\"first\"},{\"id\":\"last\",\"text\":\"last\"}]");
|
||
|
|
var selectvaluemethod = $("#valuemethod").select2({
|
||
|
|
data: datavaluemethod,
|
||
|
|
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;
|
||
|
|
} // 函数用于呈现当前的选择
|
||
|
|
});
|
||
|
|
selectvaluemethod.val('${dataVisualMpView.valuemethod}').trigger("change");//设置选中
|
||
|
|
|
||
|
|
$("#outValueType").select2({minimumResultsForSearch: -1}).val("${dataVisualMpView.outValueType}").trigger("change");
|
||
|
|
var outValueTypeJson = JSON.parse("[{\"id\":\"0\",\"text\":\"比较结果\"},{\"id\":\"1\",\"text\":\"测量点值\"}]");
|
||
|
|
var selectoutValueType = $("#outValueType").select2({
|
||
|
|
data: outValueTypeJson,
|
||
|
|
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;
|
||
|
|
} // 函数用于呈现当前的选择
|
||
|
|
});
|
||
|
|
selectoutValueType.on('change', function () {
|
||
|
|
let v = $("#outValueType").val();
|
||
|
|
if (v == '0') {
|
||
|
|
$('#outValueTypeShow1').css('display', 'block');
|
||
|
|
$('#outValueTypeShow2').css('display', 'block');
|
||
|
|
$('#outValueTypeShow3').css('display', 'none');
|
||
|
|
} else if (v == '1') {
|
||
|
|
$('#outValueTypeShow1').css('display', 'none');
|
||
|
|
$('#outValueTypeShow2').css('display', 'none');
|
||
|
|
$('#outValueTypeShow3').css('display', 'block');
|
||
|
|
}
|
||
|
|
})
|
||
|
|
selectoutValueType.val('${dataVisualMpView.outValueType}').trigger("change");//设置选中
|
||
|
|
|
||
|
|
|
||
|
|
$("#autoBkTextType").select2({minimumResultsForSearch: -1}).val("${dataVisualMpView.autoBkTextType}").trigger("change");
|
||
|
|
var autoBkTextTypeJson = JSON.parse("[{\"id\":\"1\",\"text\":\"数据值\"},{\"id\":\"2\",\"text\":\"百分比\"}]");
|
||
|
|
var selectautoBkTextType = $("#autoBkTextType").select2({
|
||
|
|
data: autoBkTextTypeJson,
|
||
|
|
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;
|
||
|
|
} // 函数用于呈现当前的选择
|
||
|
|
});
|
||
|
|
selectautoBkTextType.val('${dataVisualMpView.autoBkTextType}').trigger("change");//设置选中
|
||
|
|
|
||
|
|
|
||
|
|
$('#switchBtnFilest').bootstrapSwitch({
|
||
|
|
onText: '启用',
|
||
|
|
offText: '禁用',
|
||
|
|
size: "small",
|
||
|
|
});
|
||
|
|
if ('${dataVisualMpView.filest}' == 'false') {
|
||
|
|
$('#switchBtnFilest').bootstrapSwitch('state', false, true);
|
||
|
|
} else if ('${dataVisualMpView.filest}' == 'true') {
|
||
|
|
$('#switchBtnFilest').bootstrapSwitch('state', true, true);
|
||
|
|
} else {
|
||
|
|
$('#switchBtnFilest').bootstrapSwitch('state', false, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
$('#switchBtnAutoBkSt').bootstrapSwitch({
|
||
|
|
onText: '开启',
|
||
|
|
offText: '关闭',
|
||
|
|
size: "small",
|
||
|
|
// 当开关状态改变时触发
|
||
|
|
onSwitchChange: function (event, state) {
|
||
|
|
if (state) {//改input的值
|
||
|
|
$('#autoBkSt_display').css('display', 'block');
|
||
|
|
} else {
|
||
|
|
$('#autoBkSt_display').css('display', 'none');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
if ('${dataVisualMpView.autoBkSt}' == 'false') {
|
||
|
|
$('#switchBtnAutoBkSt').bootstrapSwitch('state', false, true);
|
||
|
|
$('#autoBkSt_display').css('display', 'none');
|
||
|
|
} else if ('${dataVisualMpView.autoBkSt}' == 'true') {
|
||
|
|
$('#switchBtnAutoBkSt').bootstrapSwitch('state', true, true);
|
||
|
|
$('#autoBkSt_display').css('display', 'block');
|
||
|
|
} else {
|
||
|
|
$('#switchBtnAutoBkSt').bootstrapSwitch('state', false, true);
|
||
|
|
$('#autoBkSt_display').css('display', 'none');
|
||
|
|
}
|
||
|
|
|
||
|
|
$('#switchBtnAutoBkTextSt').bootstrapSwitch({
|
||
|
|
onText: '显示',
|
||
|
|
offText: '不显示',
|
||
|
|
size: "small",
|
||
|
|
});
|
||
|
|
if ('${dataVisualMpView.autoBkTextSt}' == 'false') {
|
||
|
|
$('#switchBtnAutoBkTextSt').bootstrapSwitch('state', false, true);
|
||
|
|
} else if ('${dataVisualMpView.autoBkTextSt}' == 'true') {
|
||
|
|
$('#switchBtnAutoBkTextSt').bootstrapSwitch('state', true, true);
|
||
|
|
} else {
|
||
|
|
$('#switchBtnAutoBkTextSt').bootstrapSwitch('state', true, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
getFileListMinioPic('mpViewFileId', 'edit', masterId, previews, previewConfigs);
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
function doMpViewDSave() {
|
||
|
|
let form = $("#mpViewForm").serialize();
|
||
|
|
const filestStatus = $('#switchBtnFilest').bootstrapSwitch('state');
|
||
|
|
if (filestStatus) {
|
||
|
|
form = form + "&filest=true";
|
||
|
|
} else {
|
||
|
|
form = form + "&filest=false";
|
||
|
|
}
|
||
|
|
const autoBkStStatus = $('#switchBtnAutoBkSt').bootstrapSwitch('state');
|
||
|
|
if (autoBkStStatus) {
|
||
|
|
form = form + "&autoBkSt=true";
|
||
|
|
} else {
|
||
|
|
form = form + "&autoBkSt=false";
|
||
|
|
}
|
||
|
|
const autoBkTextStStatus = $('#switchBtnAutoBkTextSt').bootstrapSwitch('state');
|
||
|
|
if (autoBkTextStStatus) {
|
||
|
|
form = form + "&autoBkTextSt=true";
|
||
|
|
} else {
|
||
|
|
form = form + "&autoBkTextSt=false";
|
||
|
|
}
|
||
|
|
$.post(ext.contextPath + "/process/dataVisualMpView/doupdate.do", form, function (data) {
|
||
|
|
if (data.code == 1) {
|
||
|
|
closeModal('mpViewSubModal');
|
||
|
|
$("#mpViewTable").bootstrapTable('refresh');
|
||
|
|
// showOneContent('${param.contentId}');
|
||
|
|
} else if (data.code == 0) {
|
||
|
|
showAlert('d', '保存失败');
|
||
|
|
} else {
|
||
|
|
showAlert('d', data.res);
|
||
|
|
}
|
||
|
|
}, 'json');
|
||
|
|
}
|
||
|
|
|
||
|
|
function selectmpid() {
|
||
|
|
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
|
||
|
|
// mpids: mpids,
|
||
|
|
mpids: '',
|
||
|
|
fucname: 'ckmpidDone'
|
||
|
|
}, function (data) {
|
||
|
|
$("#mpSelectDiv").html(data);
|
||
|
|
openModal('subModalMpoint');
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function ckmpidDone(data) {
|
||
|
|
data = JSON.parse(data);
|
||
|
|
$('#mpViewForm #mpid').val(data[0].mpid);
|
||
|
|
closeModal('subModalMpoint');
|
||
|
|
}
|
||
|
|
|
||
|
|
function selectmpid2() {
|
||
|
|
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
|
||
|
|
// mpids: mpids,
|
||
|
|
mpids: '',
|
||
|
|
fucname: 'ckmpidDone2'
|
||
|
|
}, function (data) {
|
||
|
|
$("#mpSelectDiv").html(data);
|
||
|
|
openModal('subModalMpoint');
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function ckmpidDone2(data) {
|
||
|
|
data = JSON.parse(data);
|
||
|
|
$('#mpViewForm #jsmpid').val(data[0].mpid);
|
||
|
|
closeModal('subModalMpoint');
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|
||
|
|
<div class="modal fade" id="mpViewSubModal">
|
||
|
|
<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 id="alertDiv"></div>
|
||
|
|
|
||
|
|
<div class="modal-body">
|
||
|
|
<!-- 新增界面formid强制为subForm -->
|
||
|
|
<form class="form-horizontal" id="mpViewForm" autocomplete="off">
|
||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
||
|
|
<input type="hidden" name="id" id="id" value="${dataVisualMpView.id}"/>
|
||
|
|
<input type="hidden" name="pid" id="pid" value="${dataVisualMpView.pid}"/>
|
||
|
|
<input type="hidden" name="morder" id="morder" value="${dataVisualMpView.morder}"/>
|
||
|
|
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">输出类型</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<select id="outValueType" name="outValueType" class="form-control select2" style="width: 100%">
|
||
|
|
<option value="0" selected>比较结果</option>
|
||
|
|
<option value="1">测量点值</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="mpid" name="mpid" placeholder="测量点"
|
||
|
|
value="${dataVisualMpView.mpid}" onclick="selectmpid();">
|
||
|
|
</div>
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">计算方式</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<select class="form-control select2 " id="valuemethod" name="valuemethod"
|
||
|
|
style=";width: 169px"></select>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">比较方式</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<select id="jsmethod" name="jsmethod" class="form-control select2" style="width: 100%">
|
||
|
|
<option value="${JsMethod_0}" selected>></option>
|
||
|
|
<option value="${JsMethod_1}">>=</option>
|
||
|
|
<option value="${JsMethod_2}">=</option>
|
||
|
|
<option value="${JsMethod_3}"><</option>
|
||
|
|
<option value="${JsMethod_4}"><=</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
<label class="col-sm-2 control-label">比较值</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<input type="text" class="form-control" id="jsvalue" name="jsvalue" placeholder="比较值"
|
||
|
|
value="${dataVisualMpView.jsvalue}">
|
||
|
|
</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="jsmpid" name="jsmpid" placeholder="比较测量点"
|
||
|
|
value="${dataVisualMpView.jsmpid}" onclick="selectmpid2();">
|
||
|
|
</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="background" name="background"
|
||
|
|
placeholder="背景"
|
||
|
|
value="${dataVisualMpView.background}">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div id="outValueTypeShow1">
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">url</label>
|
||
|
|
<div class="col-sm-10">
|
||
|
|
<input type="text" class="form-control" id="url" name="url" placeholder="url"
|
||
|
|
value="${dataVisualMpView.url}">
|
||
|
|
</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="textshow" name="textshow" placeholder="文本"
|
||
|
|
value="${dataVisualMpView.textshow}">
|
||
|
|
</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="${dataVisualMpView.fontsize}">
|
||
|
|
</div>
|
||
|
|
<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"
|
||
|
|
placeholder="文字颜色"
|
||
|
|
value="${dataVisualMpView.fontcolor}">
|
||
|
|
<div class="input-group-addon">
|
||
|
|
<i></i>
|
||
|
|
</div>
|
||
|
|
</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="fontweight" name="fontweight"
|
||
|
|
placeholder="文字粗细"
|
||
|
|
value="${dataVisualMpView.fontweight}">
|
||
|
|
</div>
|
||
|
|
<label class="col-sm-2 control-label">透明度</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<div class="switch" data-on="primary" data-off="info">
|
||
|
|
<input type="text" class="form-control" id="opacity" name="opacity"
|
||
|
|
placeholder="0~1"
|
||
|
|
value="${dataVisualMpView.opacity}">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div id="outValueTypeShow3">
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">动态背景</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<div class="switch" data-on="primary" data-off="info">
|
||
|
|
<input id="switchBtnAutoBkSt" type="checkbox"/>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<label class="col-sm-2 control-label">动态背景色</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<div class="input-group" id="colorContainer2">
|
||
|
|
<input name="autoBkBackground" id="autoBkBackground" type="text"
|
||
|
|
class="form-control"
|
||
|
|
placeholder="动态背景色"
|
||
|
|
value="${dataVisualMpView.autoBkBackground}">
|
||
|
|
<div class="input-group-addon">
|
||
|
|
<i></i>
|
||
|
|
</div>
|
||
|
|
</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="autoBkStMaxvalue" name="autoBkStMaxvalue"
|
||
|
|
placeholder="最大值"
|
||
|
|
value="${dataVisualMpView.autoBkStMaxvalue}">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="form-group" id="autoBkSt_display">
|
||
|
|
<label class="col-sm-2 control-label">文本显示</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<div class="switch" data-on="primary" data-off="info">
|
||
|
|
<input id="switchBtnAutoBkTextSt" type="checkbox"/>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<label class="col-sm-2 control-label">显示样式</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<select id="autoBkTextType" name="autoBkTextType" class="form-control select2">
|
||
|
|
<option value="1" selected>数据值</option>
|
||
|
|
<option value="2">百分比</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
</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="style" name="style" placeholder="样式"
|
||
|
|
value="${dataVisualMpView.style}">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div id="outValueTypeShow2">
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">附件状态</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<div class="switch" data-on="primary" data-off="info">
|
||
|
|
<input id="switchBtnFilest" type="checkbox"/>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="form-group" style="margin:8px">
|
||
|
|
<button type="button" class="btn btn-default btn-file"
|
||
|
|
onclick="fileinputPic('mpViewFileId')"
|
||
|
|
id="btn_save"><i
|
||
|
|
class="fa fa-paperclip"></i>上传图片
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="form-group" style="margin:8px;">
|
||
|
|
<input type="file" name="mpViewFileId" id="mpViewFileId" 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="doMpViewDSave()">保存</button>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
<!-- /.modal-content -->
|
||
|
|
</div>
|
||
|
|
<!-- /.modal-dialog -->
|
||
|
|
</div>
|