288 lines
14 KiB
Plaintext
288 lines
14 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
|
|
<%@page import="com.sipai.entity.process.DataVisualWeather" %>
|
||
|
|
<%request.setAttribute("Type_Weather2", DataVisualWeather.Type_Weather); %>
|
||
|
|
<%request.setAttribute("Type_Temp", DataVisualWeather.Type_Temp); %>
|
||
|
|
<%request.setAttribute("Type_Wind", DataVisualWeather.Type_Wind); %>
|
||
|
|
<%request.setAttribute("Type_WindPower", DataVisualWeather.Type_WindPower); %>
|
||
|
|
<%request.setAttribute("Type_Humidity", DataVisualWeather.Type_Humidity); %>
|
||
|
|
|
||
|
|
<%@page import="com.sipai.entity.process.DataVisualContent" %>
|
||
|
|
<%request.setAttribute("Type_Weather", DataVisualContent.Type_Weather); %>
|
||
|
|
|
||
|
|
<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">
|
||
|
|
|
||
|
|
</style>
|
||
|
|
<script type="text/javascript">
|
||
|
|
$(function () {
|
||
|
|
$('#colorContainer').colorpicker({format: null});
|
||
|
|
$('#backgroundContainer').colorpicker({format: null});
|
||
|
|
|
||
|
|
$("#type").select2({minimumResultsForSearch: -1}).val("${dataVisualWeather.type}").trigger("change");
|
||
|
|
|
||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
||
|
|
|
||
|
|
var textAlignPosition = JSON.parse("[{\"id\":\"center\",\"text\":\"居中\"},{\"id\":\"left\",\"text\":\"靠左\"},{\"id\":\"right\",\"text\":\"靠右\"}]");
|
||
|
|
var selecttextAlign = $("#textAlign").select2({
|
||
|
|
data: textAlignPosition,
|
||
|
|
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;
|
||
|
|
} // 函数用于呈现当前的选择
|
||
|
|
});
|
||
|
|
selecttextAlign.val('${dataVisualWeather.textAlign}').trigger("change");//设置选中
|
||
|
|
|
||
|
|
$('#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);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
function doDatesave() {
|
||
|
|
$("#datesubForm1").bootstrapValidator('validate');//提交验证
|
||
|
|
if ($("#datesubForm1").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
|
|
let form = $("#datesubForm1").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) {
|
||
|
|
$("#datesubForm2").bootstrapValidator('validate');//提交验证
|
||
|
|
if ($("#datesubForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
|
|
$.post(ext.contextPath + "/process/dataVisualWeather/doupdate.do", $("#datesubForm2").serialize(), function (data) {
|
||
|
|
if (data.code == 1) {
|
||
|
|
closeModal('dateSubModal');
|
||
|
|
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 doDatedel() {
|
||
|
|
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: '${dataVisualWeather.id}',
|
||
|
|
type: '${Type_Weather}'
|
||
|
|
}, function (data) {
|
||
|
|
var datajson = JSON.parse(data);
|
||
|
|
if (datajson.code == 1) {
|
||
|
|
closeModal('dateSubModal');
|
||
|
|
$('#${dataVisualContent.id}').remove();
|
||
|
|
} else {
|
||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|
||
|
|
<div class="modal fade" id="dateSubModal">
|
||
|
|
<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="datesubForm1" autocomplete="off">
|
||
|
|
<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="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" 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" 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-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-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;">sec</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-10">
|
||
|
|
<input type="text" class="form-control" id="style" name="style" placeholder="样式"
|
||
|
|
value="${dataVisualContent.style}">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
|
||
|
|
<form class="form-horizontal" id="datesubForm2" autocomplete="off">
|
||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
||
|
|
<div id="alertDiv"></div>
|
||
|
|
<input type="hidden" name="id" id="id" value="${dataVisualWeather.id}"/>
|
||
|
|
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-sm-2 control-label">天气类型</label>
|
||
|
|
<div class="col-sm-10">
|
||
|
|
<select class="form-control select2" id="type" name="type"
|
||
|
|
style="width: 170px;">
|
||
|
|
<option value="${Type_Weather2}">天气情况</option>
|
||
|
|
<option value="${Type_Temp}">当前温度</option>
|
||
|
|
<option value="${Type_Wind}">风向</option>
|
||
|
|
<option value="${Type_WindPower}">风力</option>
|
||
|
|
<option value="${Type_Humidity}">湿度</option>
|
||
|
|
</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="backgroundContainer">
|
||
|
|
<input name="background" id="background" type="text" class="form-control"
|
||
|
|
placeholder="背景色"
|
||
|
|
value="${dataVisualWeather.background}">
|
||
|
|
<div class="input-group-addon">
|
||
|
|
<i></i>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<label class="col-sm-2 control-label">字体颜色</label>
|
||
|
|
<div class="col-sm-4">
|
||
|
|
<div class="input-group" id="colorContainer">
|
||
|
|
<input name="fontcolor" id="fontcolor" type="text" class="form-control"
|
||
|
|
placeholder="字体颜色"
|
||
|
|
value="${dataVisualWeather.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="fontsize" name="fontsize" placeholder="字体大小"
|
||
|
|
value="${dataVisualWeather.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="${dataVisualWeather.fontweight}">
|
||
|
|
</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="textAlign" name="textAlign"
|
||
|
|
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="doDatedel();">删除</button>
|
||
|
|
<button type="button" class="btn btn-primary" onclick="doDatesave()" id="btn_save">保存</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<!-- /.modal-content -->
|
||
|
|
</div>
|
||
|
|
<!-- /.modal-dialog -->
|
||
|
|
</div>
|