<!DOCTYPE html>
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.w3.org/1999/xhtml"
|
xmlns:th="http://www.thymeleaf.org" layout:decorator="MasterPage/Layout.Empty"
|
xmlns:shiro="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta charset="UTF-8"/>
|
<title th:text="'出图模板 - ' + ${systemName}"></title>
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
<link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/jqgrid/ui.jqgrid-bootstrap.css'}"/>
|
<link rel="stylesheet"
|
th:href="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/datepicker.css'}"/>
|
<link rel="stylesheet" href="/css/tagsinput.css"/>
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
|
<link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/css/portlet.css'}"/>
|
<link th:href="@{${pubzyWebRoot} + 'media/css/uniform.default.css'}"/>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/portlet.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/bootstrap-datepicker.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/bootstrap-datepicker.zh-CN.min.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/bootstrap-fileupload.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/tabPages.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/jquery.form-3.51.0.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/layer/layer.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/jquery.tagsinput.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/jquery.validate.min.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/messages_zh.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/additional-methods.min.js'}"
|
type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/yanzhen.js'}" type="text/javascript"></script>
|
<style>
|
body {
|
background-color: white;
|
box-sizing: border-box;
|
overflow-x: hidden;
|
}
|
|
.form-control {
|
padding: 0.3rem 0.7rem;
|
height: 34px;
|
display: inline-block;
|
}
|
|
.control-label {
|
padding-top: 0 !important;
|
width: 160px;
|
float: left;
|
line-height: 30px;
|
padding-right: 1.5em;
|
}
|
|
.control-group {
|
margin-bottom: 1em;
|
}
|
|
.controls {
|
margin-left: 160px;
|
}
|
|
.col-sm-3,
|
.col-sm-6, .col-sm-12 {
|
padding-left: 0;
|
padding-right: 0;
|
}
|
|
.fade {
|
display: none;
|
}
|
|
.in.fade {
|
display: block;
|
}
|
|
.control-group error {
|
border-color: #b94a48;
|
}
|
|
#button {
|
color: #fff !important;
|
background-color: #039cfd !important;
|
border-color: #039cfd !important;
|
}
|
|
img {
|
cursor: pointer;
|
}
|
|
.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
|
color: #555;
|
cursor: default;
|
background-color: #fff;
|
border: 1px solid #ddd;
|
border-bottom-color: transparent;
|
}
|
|
. {
|
display: none;
|
}
|
|
.tags-wrapper {
|
width: 75%;
|
display: inline-block;
|
}
|
|
#tagInput {
|
width: 100%;
|
}
|
|
.layer-tags-wrapper {
|
z-index: 9;
|
}
|
|
td {
|
border: 1px solid #ccc;
|
}
|
|
#tbGKList input {
|
text-align: center;
|
width: 100%;
|
min-height: 30px;
|
}
|
</style>
|
<script th:inline="javascript">
|
var oldrtname;
|
$(function () {
|
cheackForm("mainfrom");
|
oldrtname = $("#rtname").val();
|
$(".date-picker").datepicker({
|
language: 'zh-CN',
|
format: 'yyyy-mm-dd'
|
});
|
});
|
|
//保存
|
function saveForm() {
|
var rtname = $("#rtname").val();
|
var scalemin = $("#scalemin").val();
|
var scalemax = $("#scalemax").val();
|
var mapwidth = $("#mapwidth").val();//保留整数
|
var mapheight = $("#mapheight").val();
|
$("#mapwidth").val(mapwidth.split(".")[0]);
|
$("#mapheight").val(mapheight.split(".")[0]);
|
if (parseInt(scalemin) > parseInt(scalemax)) {
|
alert("最小比例尺不能大于最大比例尺");
|
return;
|
}
|
var exist = 'false';
|
var id = $("#rtid").val();
|
if (id == "" && rtname != null && rtname != '') {
|
$.ajax({
|
type: 'POST',
|
url: '/res/restemplate/checkRtname?rtname=' + rtname,
|
async: false,
|
dataType: 'text',
|
success: function (result) {
|
exist = result;
|
}
|
});
|
}
|
if (exist == 'true') {
|
alert("名称已存在,请重新输入");
|
return;
|
}
|
if ($('#mainfrom').valid()) {
|
$('#mainfrom').ajaxSubmit({
|
url: '/res/restemplate/updateResTemplate',
|
type: 'post',
|
dataType: 'text',
|
data: {},
|
success: function (data) {
|
var result = eval('(' + data + ')');
|
alert(result.msg);
|
//window.close();
|
//parent.window.opener.location.reload();
|
parent.window.opener.Search();
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
} else {
|
// alert("您输入的信息存在错误,请更正后再提交!");
|
}
|
};
|
|
//删除模板
|
function deleteRestemplate() {
|
if (confirm("你确定删除模板吗?")) {
|
var id = $("#rtid").val();
|
var rtname = $("#rtname").val();
|
$.ajax({
|
url: '/res/restemplate/deleteResTemplate?rtid=' + id,
|
type: 'post',
|
success: function (data) {
|
if (data == 1) {
|
var deleteRestemplateURL = $("#deleteRestemplateURL").val();
|
$.ajax({
|
url:deleteRestemplateURL+'?rtname='+rtname,
|
type:'POST',
|
success:function(){
|
alert("删除成功,页面即将关闭!");
|
parent.window.opener.location.reload();
|
window.close();
|
},
|
error:function(){
|
alert("删除失败");
|
}
|
});
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
}
|
|
function setChartcontent() {
|
var rtid = $("#rtid").val();
|
layer.open({
|
type: 2,
|
title: "模板参数配置",
|
shadeClose: true,
|
area: ["900px", "500px"],
|
content: "EditChartcontent?rtid=" + rtid
|
})
|
}
|
|
//自动上传
|
function upload(id) {
|
var uploadRestemplateURL = $("#uploadRestemplateURL").val();
|
var rtid = $("#rtid").val();
|
if (document.getElementById(id).value != '') {
|
var formdata = new FormData();
|
formdata.append('rtid', rtid);
|
formdata.append('rtname', oldrtname);
|
formdata.append('file', $('#filepath')[0].files[0]);
|
$.ajax({
|
url: uploadRestemplateURL,
|
/* xhrFields: {withCredentials: true},
|
crossDomain: true, */
|
type: "POST",
|
data: formdata,
|
cache: false,
|
async: false,
|
processData: false, // 告诉jQuery不要去处理发送的数据
|
contentType: false, // 告诉jQuery不要去设置Content-Type请求头
|
success: function (data) {
|
var json = eval('(' + data + ')');
|
if (json.result == '0') {
|
alert("上传失败");
|
} else {
|
$("#rtname").removeAttr("disabled");
|
$("#rtname").val(json.name.split(".")[0]);
|
$("#templateurl").val(json.Path);
|
}
|
},
|
error: function () {
|
alert("请求失败,网络异常!");
|
}
|
});
|
}
|
}
|
|
//点击上传文件
|
function openUploadDialog(id) {
|
document.getElementById(id).click();
|
}
|
</script>
|
</head>
|
<body>
|
<div id="rapp" shiro:hasPermission="org_user_admin" layout:fragment="content" style="background-color: #fff;">
|
<div id="div_content" style="width: 100%;">
|
<div class="tabbable tabbable-custom" id="divTabsView">
|
<div class="tab-content" id="divContent">
|
<div class="tab-pane active" id="tabContent" style="overflow-y: auto;">
|
<div class="row-fluid">
|
<div class="span12">
|
<!--BEGIN TABS-->
|
<div class="tabbable tabbable-custom">
|
<ul class="nav nav-tabs" role="tablist">
|
<li class="nav-item">
|
<a class="nav-link active" href="#tab_MainInfo" data-toggle="tab">
|
<div class="top_tabs_li">编辑出图模板</div>
|
</a>
|
</li>
|
</ul>
|
<div class="tab-content" style="border-left: 1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;">
|
<form class="form-horizontal" id="mainfrom">
|
<input type="hidden" id="rtid" name="rtid" th:value="${rtid}"/>
|
<input type="hidden" id="edit" name="edit" th:value="${edit}"/>
|
<input type="hidden" id="uploadRestemplateURL" name="uploadRestemplateURL" th:value="${uploadRestemplateURL}"/>
|
<input type="hidden" id="deleteRestemplateURL" name="deleteRestemplateURL" th:value="${deleteRestemplateURL}"/>
|
<div class="portlet box ltblue">
|
<div class="portlet-title">
|
出图模板信息
|
<div class="caption">
|
<i class="fa fa-reorder"></i>
|
</div>
|
<div class="tools">
|
<a class="collapse" onclick="portlet_body_ShowOrHide(this);"></a>
|
</div>
|
</div>
|
<div class="portlet-body">
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">模板名称<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:disabled="${restemplate.rtname!=null}" th:value="${restemplate.rtname}" type="text" id="rtname" name="rtname" class="form-control col-sm-9" required="" maxchar="50"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">出图最小比例尺<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:disabled="${restemplate.scalemin!=null}" th:value="${restemplate.scalemin}" type="text" id="scalemin" name="scalemin" class="form-control col-sm-9" required="" maxchar="11" onkeyup="value=value.replace(/[^\d]/g,'')"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">地图宽度<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:disabled="${restemplate.mapwidth!=null}" th:value="${restemplate.mapwidth}" type="text" id="mapwidth" name="mapwidth" class="form-control col-sm-9" required="" onkeyup="value=value.replace(/[^\d]/g,'')"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">纸张大小</label>
|
<div class="controls input-icon">
|
<select th:disabled="${restemplate.paperstyle!=null}" class="form-control col-sm-9" id="paperstyle" name="paperstyle">
|
<option value="">全部</option>
|
<option value="A3" th:selected="${restemplate.paperstyle=='A3'?'true':'false'}">A3</option>
|
<option value="A4" th:selected="${restemplate.paperstyle=='A4'?'true':'false'}">A4</option>
|
<option value="其他" th:selected="${restemplate.paperstyle=='其他'?'true':'false'}">其他</option>
|
</select>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">模板类型<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<select th:disabled="${restemplate.templatetype!=null}" class="form-control col-sm-9" id="templatetype" name="templatetype" required="">
|
<option value="">请选择</option>
|
<option value="用户模板" th:selected="${restemplate.templatetype=='用户模板'?'true':'false'}">用户模板</option>
|
<option value="标准图幅" th:selected="${restemplate.templatetype=='标准图幅'?'true':'false'}">标准图幅</option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">业务类型<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<select th:disabled="${restemplate.businesstype!=null}" class="form-control col-sm-9" id="businesstype" name="businesstype" required="">
|
<option value="">请选择</option>
|
<option th:each="item:${map}" th:value="${item.key}" th:text="${item.value}" th:selected="(${item.key} == ${restemplate.businesstype})?'true':'false'"></option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">出图最大比例尺<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:disabled="${restemplate.scalemax!=null}" th:value="${restemplate.scalemax}" type="text" id="scalemax" name="scalemax" class="form-control col-sm-9" required="" maxchar="11" onkeyup="value=value.replace(/[^\d]/g,'')"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">地图高度<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:disabled="${restemplate.mapheight!=null}" th:value="${restemplate.mapheight}" type="text" id="mapheight" name="mapheight" class="form-control col-sm-9" required="" onkeyup="value=value.replace(/[^\d]/g,'')"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
<div class="control-group">
|
<label class="control-label">纸张排版<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<select th:disabled="${restemplate.paperdirection!=null}" class="form-control col-sm-9" id="paperdirection" name="paperdirection" required="">
|
<option value="">请选择</option>
|
<option value="横版" th:selected="${restemplate.paperdirection=='横版'?'true':'false'}">横版</option>
|
<option value="纵版" th:selected="${restemplate.paperdirection=='纵版'?'true':'false'}">纵版</option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-11" style="padding:0;">
|
<div class="control-group">
|
<label class="control-label">模板上传<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input id="templateurl" name="templateurl" th:value="${restemplate.templateurl}" class="form-control col-sm-11" type="text" required=""/>
|
<input type="file" name="filepath" id="filepath" style="display:none" onchange="upload('filepath');"/>
|
<button class="btn btn-primary wenjian" id="remarkfilebtn" onclick="openUploadDialog('filepath','filename','filesize','remarkfilebtn')" style="vertical-align: baseline;" type="button">
|
<span class="fa fa-upload"></span> 上传
|
</button>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">模板参数</label>
|
<div class="controls input-icon">
|
<textarea th:text="${restemplate.chartcontent}" id="chartcontent" name="chartcontent" class="form-control col-sm-10" cols="20" style="height: 300px; vertical-align: bottom;"></textarea>
|
<button title="配置" type="button" class="btn btn-primary" onclick="setChartcontent()" style="vertical-align:baseline;padding: 0.375em 0.7em;">
|
配置
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="form-actions navbar-fixed-bottom" style="z-index: 0;">
|
<div style="float: left;">
|
<button class="btn btn-primary" id="addSave" type="button" onclick="saveForm();">
|
<i class="fa fa-check"></i> 保存
|
</button>
|
<button th:if="${not #lists.isEmpty(rtid)}" class="btn btn-danger" id="delete" onclick="deleteRestemplate();" type="button">
|
<i class="fa fa-trash-o"></i> 删除
|
</button>
|
<button class="btn btn-warning" id="close" type="button" onclick="window.close();">
|
<i class="fa fa-remove"></i> 关闭
|
</button>
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|