<!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>新增模块</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>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/winPro.js'}"></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;
|
text-align: right;
|
}
|
|
.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">
|
$(function () {
|
cheackForm("mainfrom");
|
$(".date-picker").datepicker({
|
language: 'zh-CN',
|
format: 'yyyy-mm-dd'
|
});
|
var resourceClass = [[${resourceClass}]];
|
if (resourceClass == "KJ_YWTC") {
|
$('#diyclusterstyle').show();
|
}
|
initAssociationlayers();
|
//如果是修改,则判断属于自定义图表还是业务集成
|
if([[${resThemeModule.moduleid}]] != "" && [[${resThemeModule.moduleid}]] != null){
|
if([[${resThemeModule.serviceconfig}]] !="" && [[${resThemeModule.serviceconfig}]] != null){
|
changeStatus(0);
|
$("input[name='wstatus'][value='0']").attr("checked",true);
|
}else{
|
changeStatus(1);
|
$("input[name='wstatus'][value='1']").attr("checked",true);
|
}
|
$("#changestatusdiv").hide();
|
}else{
|
$("#changestatusdiv").show();
|
$("#isbrowser").hide();
|
}
|
});
|
|
function saveForm() {
|
//判断是自定义图表(关联图层和图表必填),还是业务集成(微件资源和微件地址至少填写一项)
|
var isEchart = $('input:radio[name="wstatus"]:checked').val();
|
if(isEchart == "0" && ($("#associationlayer").val() == "" || $("#serviceconfig").val() == "")) {
|
alert("请选择关联图层和设置图表!");
|
return false;
|
}
|
if(isEchart == "1" && $("#panelurl").val() == "" && $("#panelresid").val() == "" && $("#panelresname").val() == "") {
|
alert("微件资源和微件地址至少填写一项!");
|
return false;
|
}
|
if($("#associationlayer").val() != "" && $("#associationlayer").val() != "null"){
|
$("#mapresid").val( $("#associationlayer").find("option:selected").attr("mapresid"));
|
}
|
if(parent.parent.$("#resourceid").val() != undefined && parent.parent.$("#resourceid").val() != 0
|
&& parent.parent.$("#resourceid").val() != "0" && $("#moduleid").val() ==""){
|
$("#thememapid").val(parent.parent.$("#resourceid").val());
|
}
|
if ($('#mainfrom').valid()) {
|
$('#mainfrom').ajaxSubmit({
|
url: '/res/ResThemeModule/updateOrInsert',
|
type: 'post',
|
dataType: 'text',
|
data: {
|
serviceconfig: $("#serviceconfig").val().trim()
|
},
|
success: function (data) {
|
var result = eval('(' + data + ')');
|
alert(result.msg);
|
$("#moduleid").val(result.id);
|
// location.href = "/res/ResThemeModule/AddResThemeModule?moduleid=" + result.id;
|
//window.parent.location.reload(); //刷新父页面
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index)
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
} else {
|
// alert("您输入的信息存在错误,请更正后再提交!");
|
}
|
};
|
|
function closeWin() {
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
};
|
|
function deleteTM() {
|
if (confirm("删除扩展信息,确定删除吗?")) {
|
var id = $("#moduleid").val();
|
|
$.ajax({
|
url: '/res/ResThemeModule/deleteById?moduleid=' + id,
|
type: 'post',
|
success: function (data) {
|
if (data == 1) {
|
alert("删除成功,页面即将关闭!");
|
window.parent.location.reload(); //刷新父页面
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
} else {
|
alert("删除失败!");
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
}
|
|
function showMapSelect() {
|
layer.open({
|
type: 2,
|
title: "关联上图选择",
|
shadeClose: true,
|
area: ["500px", "450px"],
|
content: "selectMap"
|
})
|
}
|
|
function showPanlSelect() {
|
layer.open({
|
type: 2,
|
title: "微件资源选择",
|
shadeClose: true,
|
area: ["500px", "450px"],
|
content: "selectPanel"
|
})
|
}
|
|
function SetEchart(type) {
|
if ($("#associationlayer").val() == "") {
|
alert("请选择关联图层!");
|
return;
|
}
|
var url = "/res/common/addserviceconfig?resourceid=" + $("#mapresid").val() + "&type=" + type + "&settype=1&moduleid=" + $("#moduleid").val()
|
+ "&associationlayer=" + encodeURIComponent($("#associationlayer").val());
|
// winPro.openFullwin(url, "添加配置", "yes");
|
openFullWindow(url,"添加配置");
|
}
|
|
function changeStatus(status) {
|
if (status == 0) {
|
$("[name=paneldiv]").hide();
|
$("#mapresdiv").hide();
|
$("#chartdiv").show();
|
$("#istubiao").show();
|
$("#isbrowser").hide();
|
$("#associationlayerdiv").show();
|
initAssociationlayers();
|
} else {
|
$("[name=paneldiv]").show();
|
$("#mapresdiv").show();
|
$("#chartdiv").hide();
|
$("#istubiao").hide();
|
$("#isbrowser").show();
|
$("#associationlayerdiv").hide();
|
}
|
}
|
|
function initAssociationlayers() {
|
var id = [[${resThemeModule.mapresid}]];
|
if(parent.parent.$("#resourceid").val() != undefined && parent.parent.$("#resourceid").val() != 0
|
&& parent.parent.$("#resourceid").val() != "0"){
|
id = parent.parent.$("#resourceid").val();
|
}
|
if($("#thememapid").val()!="" && $("#thememapid").val()!=null && $("#thememapid").val() != 0){
|
id = $("#thememapid").val();
|
}
|
var html = "<option value=''>--请选择--</option>";
|
var thisLayers = [[${resThemeModule.associationlayer}]];
|
if(id != ""){
|
$.ajax({
|
url: '/res/ResThemeModule/getMapLayers?resourceid=' + id,
|
type: 'get',
|
success: function (result) {
|
if(result != ""){
|
var text = JSON.parse(decodeURIComponent(JSON.parse(result).text))
|
if(text != "" && text.operationalLayers != ""){
|
for(var i=0;i<text.operationalLayers.length;i++){
|
var style = "";
|
if(thisLayers != "" && thisLayers == text.operationalLayers[i].url ) style = " selected='true'";
|
var id = text.operationalLayers[i].id.substring(text.operationalLayers[i].id.indexOf('-')+1,text.operationalLayers[i].id.length);
|
html+="<option mapresid='"+id+"' value='"+text.operationalLayers[i].url+"'"+style+">"+text.operationalLayers[i].title+"</option>"
|
}
|
}
|
}
|
$("#associationlayer").empty().append(html);
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
}
|
</script>
|
</head>
|
<body>
|
<div id="rapp" shiro:hasPermission="org_user_admin" layout:fragment="content" style="background-color: #fff;">
|
<div class="tabbable tabbable-custom" id="divTabsView">
|
<div 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="moduleid" name="moduleid" th:value="${resThemeModule.moduleid}" />
|
<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" id="changestatusdiv">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<div class="controls input-icon">
|
<label class="radio-inline" onclick="changeStatus(0)">
|
<input type="radio" name="wstatus" value="0" checked="checked" /> 自定义图表
|
</label>
|
<label class="radio-inline" style="margin-left: 20px;" onclick="changeStatus(1)">
|
<input type="radio" name="wstatus" value="1" /> 业务集成
|
</label>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">微件名称<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:value="${resThemeModule.title}" type="text" id="title" name="title" class="form-control col-sm-9" required="" maxchar="20"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="mapresdiv" style="display: none;">
|
<div class="col-sm-12" style="padding:0;">
|
<div class="control-group">
|
<label class="control-label">关联上图</label>
|
<div class="controls input-icon">
|
<input th:value="${resThemeModule.mapresid}" id="mapresid" name="mapresid" type="hidden" />
|
<input id="mapresname" name="mapresname" th:value="${mapresid}" class="form-control col-sm-8" readonly="readonly" />
|
<a class="btn" style="background-color: #e5e5e5;vertical-align:baseline !important;color: black;" title='选择地图' onclick="showMapSelect();">...</a>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="associationlayerdiv">
|
<div class="col-sm-12" style="padding:0;">
|
<div class="control-group">
|
<label class="control-label">关联图层</label>
|
<div class="controls input-icon">
|
<select class="form-control col-sm-8" id="associationlayer" name="associationlayer">
|
<option value=''>--请选择--</option>
|
</select>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="diyclusterstyle" style="display: none;">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">聚合风格</label>
|
<div class="controls input-icon">
|
<!--<input id="clusterstyle" name="clusterstyle"-->
|
<!--th:value="${resThemeModule.clusterstyle}" class="form-control col-sm-8" />-->
|
<select id="clusterstyle" name="clusterstyle" class="form-control col-sm-8">
|
<option value="">--请选择--</option>
|
<option th:each="item:${layerInfos}" th:value="${item.diyid}" th:text="${item.title}" th:selected="(${resThemeModule.clusterstyle}==${item.diyid})?'true':'false'"></option>
|
</select>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" name="paneldiv" style="display: none;">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">微件资源</label>
|
<div class="controls input-icon">
|
<input th:value="${resThemeModule.panelresid}" id="panelresid" name="panelresid" type="hidden" />
|
<input id="panelresname" name="panelresname" th:value="${panelresid}" class="form-control col-sm-8" readonly="readonly" />
|
<a class="btn" style="background-color: #e5e5e5;vertical-align:baseline !important;color: black;" title='选择面板' onclick="showPanlSelect();">...</a>
|
<a class="btn btn-primary" style="vertical-align:baseline !important;" title='清除' onclick="javascript:$('#panelresid').val('');$('#panelresname').val('');">清除</a>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" name="paneldiv" style="display:none;">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">微件地址</label>
|
<div class="controls input-icon">
|
<input id="panelurl" name="panelurl" th:value="${resThemeModule.panelurl}" class="form-control col-sm-8" maxchar="50" />
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="chartdiv">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">图表</label>
|
<div class="controls input-icon">
|
<input id="thememapid" name="thememapid" type="hidden" th:value="${resThemeModule.thememapid}" />
|
<input id="charttitle" name="charttitle" th:value="${charttitle}" class="form-control col-sm-8" readonly="readonly" />
|
<input type="hidden" id="serviceconfig" th:value="${resThemeModule.serviceconfig}" />
|
<a class="btn" style="background-color: #e5e5e5;vertical-align:baseline !important;color: black;" title='设置统计图' onclick="SetEchart('charts');">统计图</a>
|
<a class="btn" style="background-color: #e5e5e5;vertical-align:baseline !important;color: black;" title='设置表格' onclick="SetEchart('tables');">表格</a>
|
<a class="btn btn-primary" style="vertical-align:baseline !important;" title='清除' onclick="javascript:$('#serviceconfig').val('');$('#charttitle').val('');">清除</a>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">微件高度</label>
|
<div class="controls input-icon">
|
<input th:value="${echartsheight}" type="text" id="echartsheight" name="echartsheight" class="form-control col-sm-2" olnynum="true" />
|
<span>px</span>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="icon-warning-sign" style="display: none;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="istubiao">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label"></label>
|
<div class="controls input-icon">
|
<input type="checkbox" id="isclickchartfilter" name="isclickchartfilter" value="1" th:checked="(${resThemeModule.isclickchartfilter}==1)?'true':'false'" />
|
<label for="isclickchartfilter" style="vertical-align: middle;">是否点击图表过滤</label>
|
|
<input type="checkbox" id="ismaplinkage" name="ismaplinkage" value="1" th:checked="(${resThemeModule.ismaplinkage}==1)?'true':'false'" style="margin-left: 30px;" />
|
<label for="ismaplinkage" style="vertical-align: middle;">是否地图联动</label>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="isbrowser">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label" style="margin-top: -3px">兼容浏览器</label>
|
<div class="controls input-icon">
|
<input type="checkbox" id="isIE" name="isIE" value="1" th:checked="(${resThemeModule.isIE}==1)?'true':'false'" style="vertical-align:middle; margin-top:0;"/>
|
<label for="isIE" >IE</label>
|
|
<input type="checkbox" id="isGoogle" name="isGoogle" value="1" th:checked="(${resThemeModule.isGoogle}==1)?'true':'false'" style="vertical-align:middle; margin-top:0;margin-left: 10px" />
|
<label for="isGoogle" style="vertical-align: center;">Google</label>
|
<input type="checkbox" id="isFirefox" name="isFirefox" value="1" th:checked="(${resThemeModule.isFirefox}==1)?'true':'false'" style="vertical-align:middle; margin-top:0;margin-left: 10px" />
|
<label for="isFirefox" style="vertical-align: center;">Firefox</label>
|
<span style="color: red;margin-left: 10px">(默认不勾选,表示全部兼容)</span>
|
</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(resThemeModule.moduleid)}" class="btn btn-danger" id="delete" onclick="deleteTM();" type="button">
|
<i class="fa fa-trash-o"></i> 删除
|
</button>
|
<button class="btn btn-warning" id="close" type="button" onclick="closeWin();">
|
<i class="fa fa-remove"></i> 关闭
|
</button>
|
</div>
|
</div>
|
</form>
|
<div style="color: #0079ff;text-align: center;margin: -4px 0;">
|
关联上图:配置图表对应的地图图层,若该资源属业务图层,则有聚合风格; 微件资源、微件地址:配置成对应统计图表
|
<br>
|
<span style="margin-left: -81px;">自定义图表:设置自定义统计图表,统计图和表格二选一;业务集成:选择业务集成的资源或自定义资源地址</span>
|
</div>
|
<div style="color: red;text-align: center;margin: 15px 0;">
|
<!--注:微件资源、微件地址至少填写一项-->
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|