241 lines
12 KiB
Plaintext
241 lines
12 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
|
<%@page import="com.sipai.entity.process.DataVisualContent" %>
|
|
<%request.setAttribute("Type_DateSelect", DataVisualContent.Type_DateSelect); %>
|
|
|
|
<style type="text/css">
|
|
|
|
</style>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$('#backgroundContainer').colorpicker({format: null});
|
|
$('#fontcolorContainer').colorpicker({format: null});
|
|
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});//选中元素上下居中
|
|
|
|
var typePosition = JSON.parse("[{\"id\":\"0\",\"text\":\"日-单日历\"},{\"id\":\"1\",\"text\":\"月-单日历\"},{\"id\":\"2\",\"text\":\"年-单日历\"},{\"id\":\"3\",\"text\":\"日-双日历\"},{\"id\":\"4\",\"text\":\"月-双日历\"},{\"id\":\"5\",\"text\":\"年-双日历\"}]");
|
|
var selecttype = $("#type").select2({
|
|
data: typePosition,
|
|
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;
|
|
} // 函数用于呈现当前的选择
|
|
});
|
|
selecttype.val('${dataVisualDateSelect.type}').trigger("change");//设置选中
|
|
|
|
});
|
|
|
|
function doDateSelectsave() {
|
|
$("#dateSelectsubForm1").bootstrapValidator('validate');//提交验证
|
|
if ($("#dateSelectsubForm1").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|
$.post(ext.contextPath + "/process/dataVisualContent/doupdate.do", $("#dateSelectsubForm1").serialize(), function (data) {
|
|
if (data.code == 1) {
|
|
|
|
$("#dateSelectsubForm2").bootstrapValidator('validate');//提交验证
|
|
if ($("#dateSelectsubForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|
$.post(ext.contextPath + "/process/dataVisualDateSelect/doupdate.do", $("#dateSelectsubForm2").serialize(), function (data) {
|
|
if (data.code == 1) {
|
|
closeModal('dateSelectSubModal');
|
|
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 doDateSelectdel() {
|
|
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: '${dataVisualDateSelect.id}',
|
|
type: '${Type_DateSelect}'
|
|
}, function (data) {
|
|
var datajson = JSON.parse(data);
|
|
if (datajson.code == 1) {
|
|
closeModal('dateSelectSubModal');
|
|
$('#${dataVisualContent.id}').remove();
|
|
} else {
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|
}
|
|
});
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<div class="modal fade" id="dateSelectSubModal">
|
|
<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="dateSelectsubForm1" 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-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-10">
|
|
<input type="text" class="form-control" id="style" name="style" placeholder="样式"
|
|
value="${dataVisualContent.style}">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<form class="form-horizontal" id="dateSelectsubForm2" autocomplete="off">
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|
<div id="alertDiv"></div>
|
|
<input type="hidden" name="id" id="id" value="${dataVisualDateSelect.id}"/>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">类型</label>
|
|
<div class="col-sm-4">
|
|
<select class="form-control select2 " id="type" name="type"
|
|
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="backgroundContainer">
|
|
<input name="background" id="background" type="text" class="form-control"
|
|
placeholder="背景色"
|
|
value="${dataVisualDateSelect.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="fontcolorContainer">
|
|
<input name="fontcolor" id="fontcolor" type="text" class="form-control"
|
|
placeholder="字体颜色"
|
|
value="${dataVisualDateSelect.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="${dataVisualDateSelect.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="${dataVisualDateSelect.fontweight}">
|
|
</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="${dataVisualDateSelect.style}">
|
|
</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="doDateSelectdel();">删除</button>
|
|
<button type="button" class="btn btn-primary" onclick="doDateSelectsave()" id="btn_save">保存</button>
|
|
</div>
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
</div> |