477 lines
24 KiB
Plaintext
477 lines
24 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
|
<%@page import="com.sipai.entity.process.DataVisualContent" %>
|
|
<%request.setAttribute("Type_SignalPoint", DataVisualContent.Type_SignalPoint); %>
|
|
<%request.setAttribute("Type_DataPoint", DataVisualContent.Type_DataPoint); %>
|
|
|
|
<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">
|
|
.readauto {
|
|
pointer-events: auto;
|
|
background-color: #ffffff;
|
|
color: #555555;
|
|
}
|
|
|
|
.readonly {
|
|
pointer-events: none;
|
|
background-color: #f0f0f0;
|
|
color: #888888;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$('#colorContainer1').colorpicker({format: null});
|
|
$('#colorContainer2').colorpicker({format: null});
|
|
|
|
$('#switchBtnIsFixed').bootstrapSwitch({
|
|
onText: '是',
|
|
offText: '否',
|
|
size: "small",
|
|
});
|
|
if ('${dataVisualContent.isfixed}' == 'false') {
|
|
$('#switchBtnIsFixed').bootstrapSwitch('state', false, true);
|
|
} else if ('${dataVisualContent.isfixed}' == 'true') {
|
|
$('#switchBtnIsFixed').bootstrapSwitch('state', true, true);
|
|
} else {
|
|
$('#switchBtnIsFixed').bootstrapSwitch('state', false, true);
|
|
}
|
|
|
|
$('#titleSwitchBtnIsFixed').bootstrapSwitch({
|
|
onText: '开',
|
|
offText: '关',
|
|
size: "small",
|
|
});
|
|
if ('${dataVisualMPoint.titleSwitch}' == 'false') {
|
|
$('#titleSwitchBtnIsFixed').bootstrapSwitch('state', false, true);
|
|
} else if ('${dataVisualMPoint.titleSwitch}' == 'true') {
|
|
$('#titleSwitchBtnIsFixed').bootstrapSwitch('state', true, true);
|
|
} else {
|
|
$('#titleSwitchBtnIsFixed').bootstrapSwitch('state', true, true);
|
|
}
|
|
|
|
$('#unitSwitchBtnIsFixed').bootstrapSwitch({
|
|
onText: '开',
|
|
offText: '关',
|
|
size: "small",
|
|
});
|
|
if ('${dataVisualMPoint.unitSwitch}' == 'false') {
|
|
$('#unitSwitchBtnIsFixed').bootstrapSwitch('state', false, true);
|
|
} else if ('${dataVisualMPoint.unitSwitch}' == 'true') {
|
|
$('#unitSwitchBtnIsFixed').bootstrapSwitch('state', true, true);
|
|
} else {
|
|
$('#unitSwitchBtnIsFixed').bootstrapSwitch('state', true, true);
|
|
}
|
|
|
|
var showStyleSelectData = JSON.parse("[{\"id\":\"style1\",\"text\":\"样式1\"},{\"id\":\"style2\",\"text\":\"样式2\"}]");
|
|
var showStyleSelect = $("#showStyle").select2({
|
|
data: showStyleSelectData,
|
|
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;
|
|
} // 函数用于呈现当前的选择
|
|
});
|
|
showStyleSelect.val('${dataVisualMPoint.showStyle}').trigger("change");//设置选中
|
|
if ('${dataVisualMPoint.showStyle}' == 'style1') {
|
|
$(".readst").addClass("readauto");
|
|
} else if ('${dataVisualMPoint.showStyle}' == 'style2') {
|
|
$(".readst").addClass("readonly");
|
|
}
|
|
showStyleSelect.on("change", function (e) {
|
|
let value = $("#showStyle").val();
|
|
let element = $(".readst");
|
|
if (value == 'style1') {
|
|
element.removeClass("readonly");
|
|
element.addClass("readauto");
|
|
} else if (value == 'style2') {
|
|
element.removeClass("readauto");
|
|
element.addClass("readonly");
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
function doMpAIsave1() {
|
|
$("#subMpAIForm1").bootstrapValidator('validate');//提交验证
|
|
if ($("#subMpAIForm1").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|
$.post(ext.contextPath + "/process/dataVisualContent/doupdate.do", $("#subMpAIForm1").serialize(), function (data) {
|
|
if (data.code == 1) {
|
|
|
|
$("#subMpAIForm2").bootstrapValidator('validate');//提交验证
|
|
if ($("#subMpAIForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|
$.post(ext.contextPath + "/process/dataVisualMPoint/doupdate.do", $("#subMpAIForm2").serialize(), function (data) {
|
|
if (data.code == 1) {
|
|
closeModal('subModal');
|
|
if ('${dataVisualContent.istab}' == 'true') {
|
|
showOneContent('${dataVisualContent.id}', 'tab');
|
|
} else {
|
|
showOneContent('${dataVisualContent.id}');
|
|
}
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '保存失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
}
|
|
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '保存失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
}
|
|
}
|
|
|
|
function doMpAIsave2() {
|
|
$("#subMpAIForm3").bootstrapValidator('validate');//提交验证
|
|
if ($("#subMpAIForm3").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|
let form = $("#subMpAIForm3").serialize();
|
|
const isFixedStatus = $('#switchBtnIsFixed').bootstrapSwitch('state');
|
|
if (isFixedStatus) {
|
|
form = form + "&isfixed=true";
|
|
} else {
|
|
form = form + "&isfixed=false";
|
|
}
|
|
$.post(ext.contextPath + "/process/dataVisualContent/doupdate.do", form, function (data) {
|
|
if (data.code == 1) {
|
|
$("#subMpAIForm4").bootstrapValidator('validate');//提交验证
|
|
if ($("#subMpAIForm4").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|
let formD = $("#subMpAIForm4").serialize();
|
|
const isTitleSwitchStatus = $('#titleSwitchBtnIsFixed').bootstrapSwitch('state');
|
|
if (isTitleSwitchStatus) {
|
|
formD = formD + "&titleSwitch=true";
|
|
} else {
|
|
formD = formD + "&titleSwitch=false";
|
|
}
|
|
const isUnitSwitchStatus = $('#unitSwitchBtnIsFixed').bootstrapSwitch('state');
|
|
if (isUnitSwitchStatus) {
|
|
formD = formD + "&unitSwitch=true";
|
|
} else {
|
|
formD = formD + "&unitSwitch=false";
|
|
}
|
|
$.post(ext.contextPath + "/process/dataVisualMPoint/doupdate.do", formD, function (data) {
|
|
if (data.code == 1) {
|
|
closeModal('subModal');
|
|
if ('${dataVisualContent.istab}' == 'true') {
|
|
showOneContent('${dataVisualContent.id}', 'tab');
|
|
} else {
|
|
showOneContent('${dataVisualContent.id}');
|
|
}
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '保存失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
}
|
|
|
|
} else if (data.code == 0) {
|
|
showAlert('d', '保存失败');
|
|
} else {
|
|
showAlert('d', data.res);
|
|
}
|
|
}, 'json');
|
|
}
|
|
}
|
|
|
|
function doMpAIdel() {
|
|
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 + '/process/dataVisualContent/dodelete.do', {
|
|
id: '${dataVisualContent.id}',
|
|
did: '${dataVisualMPoint.id}',
|
|
type: '${Type_DataPoint}'
|
|
}, function (data) {
|
|
var datajson = JSON.parse(data);
|
|
if (datajson.code == 1) {
|
|
closeModal('subModal');
|
|
$('#${dataVisualContent.id}').remove();
|
|
} else {
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|
}
|
|
});
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
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);
|
|
$('#subMpAIForm4 #mpid').val(data[0].mpid);
|
|
$('#subMpAIForm4 #name').val(data[0].parmname);
|
|
closeModal('subModalMpoint');
|
|
}
|
|
|
|
</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>
|
|
<ul class="nav nav-tabs" id="myTab">
|
|
<li class="active"><a href="#tab1" data-toggle="tab"
|
|
index="0" aria-expanded="true">基础配置</a></li>
|
|
<li class=""><a href="#tab2" data-toggle="tab" index="1"
|
|
aria-expanded="true">详细配置</a></li>
|
|
</ul>
|
|
|
|
<div class="tab-content no-padding">
|
|
<div class="chart tab-pane active" id="tab1"
|
|
style="position: relative; padding:5px;">
|
|
<div class="modal-body">
|
|
<form class="form-horizontal" id="subMpAIForm1" autocomplete="off">
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|
<div id="alertDiv"></div>
|
|
<input type="hidden" name="id" id="id" value="${dataVisualContent.id}"/>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">左侧距离</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control readst" id="postx" name="postx"
|
|
placeholder="左侧距离"
|
|
value="${dataVisualContent.postx}">
|
|
</div>
|
|
<label class="col-sm-2 control-label">上侧距离</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control readst" id="posty" name="posty"
|
|
placeholder="上侧距离"
|
|
value="${dataVisualContent.posty}">
|
|
</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="${dataVisualContent.width}">
|
|
</div>
|
|
<label class="col-sm-2 control-label">高度</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control readst" id="height" name="height"
|
|
placeholder="高度"
|
|
value="${dataVisualContent.height}">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<form class="form-horizontal" id="subMpAIForm2" autocomplete="off">
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|
<div id="alertDiv"></div>
|
|
<input type="hidden" name="id" id="id" value="${dataVisualMPoint.id}"/>
|
|
|
|
<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="${dataVisualMPoint.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" onclick="doMpAIdel();">删除</button>
|
|
<button type="button" class="btn btn-primary" onclick="doMpAIsave1()" id="btn_save">保存</button>
|
|
</div>
|
|
</div>
|
|
<div class=" tab-pane" id="tab2"
|
|
style="position: relative; padding:5px;">
|
|
<div class="modal-body">
|
|
<!-- 新增界面formid强制为subForm -->
|
|
<form class="form-horizontal" id="subMpAIForm3" autocomplete="off">
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|
<div id="alertDiv"></div>
|
|
<input type="hidden" name="id" id="id" value="${dataVisualContent.id}"/>
|
|
|
|
<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="${dataVisualContent.width}">
|
|
</div>
|
|
<label class="col-sm-2 control-label">高度</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control readst" id="height" name="height"
|
|
placeholder="高度"
|
|
value="${dataVisualContent.height}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">刷新时间</label>
|
|
<div class="col-sm-3">
|
|
<input type="text" class="form-control" id="refreshtime" name="refreshtime"
|
|
placeholder="刷新时间"
|
|
value="${dataVisualContent.refreshtime}">
|
|
</div>
|
|
<div class="col-sm-1">
|
|
<div style="line-height: 34px;text-align: center;">min</div>
|
|
</div>
|
|
<label class="col-sm-2 control-label">图层</label>
|
|
<div class="col-sm-4">
|
|
<input type="text" class="form-control" id="zIndex" name="zIndex" placeholder="图层"
|
|
value="${dataVisualContent.zIndex}">
|
|
</div>
|
|
</div>
|
|
<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="switchBtnIsFixed" type="checkbox"/>
|
|
</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 readst" id="style" name="style"
|
|
placeholder="样式"
|
|
value="${dataVisualContent.style}">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<form class="form-horizontal" id="subMpAIForm4" autocomplete="off">
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|
<div id="alertDiv"></div>
|
|
<input type="hidden" name="id" id="id" value="${dataVisualMPoint.id}"/>
|
|
|
|
<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="${dataVisualMPoint.name}">
|
|
</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="${dataVisualMPoint.mpid}" onclick="selectmpid();">
|
|
</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 readst" id="fontsize" name="fontsize"
|
|
placeholder="文字大小"
|
|
value="${dataVisualMPoint.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 readst"
|
|
placeholder="文字颜色"
|
|
value="${dataVisualMPoint.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 readst" id="fontweight" name="fontweight"
|
|
placeholder="文字粗细"
|
|
value="${dataVisualMPoint.fontweight}">
|
|
</div>
|
|
<label class="col-sm-2 control-label">背景色</label>
|
|
<div class="col-sm-4">
|
|
<div class="input-group" id="colorContainer2">
|
|
<input name="background" id="background" type="text"
|
|
class="form-control readst"
|
|
placeholder="背景色"
|
|
value="${dataVisualMPoint.background}">
|
|
<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">
|
|
<div class="switch" data-on="primary" data-off="info">
|
|
<input id="titleSwitchBtnIsFixed" type="checkbox"/>
|
|
</div>
|
|
</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="unitSwitchBtnIsFixed" type="checkbox"/>
|
|
</div>
|
|
</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="showStyle" name="showStyle"
|
|
style="width: 170px;"></select>
|
|
</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" onclick="doMpAIdel();">删除</button>
|
|
<button type="button" class="btn btn-primary" onclick="doMpAIsave2()" id="btn_save">保存</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
</div> |