<style>
|
.addTagWrap {
|
background: none repeat scroll 0 0 #FFFFFF;
|
border: 1px solid #D9D9D9;
|
padding: 0 5px;
|
}
|
|
.addTagWrap .inner-tag-wrapper, .layer-tag-name {
|
background: none repeat scroll 0 0 #40A8CD;
|
border-radius: 3px;
|
color: #FFFFFF;
|
float: left;
|
height: 26px;
|
line-height: 26px;
|
margin: 4px 6px 0 0;
|
padding: 0 5px 0 10px;
|
white-space: nowrap;
|
}
|
|
.addTagWrap .inner-tag-close {
|
color: #A0D4E6;
|
font-family: "宋体",sans-serif;
|
margin-left: 4px;
|
text-decoration: none;
|
}
|
</style>
|
<form class="form-horizontal" id="ztdtform" xmlns:th="http://www.w3.org/1999/xhtml">
|
<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">
|
<input type="hidden" id="extThemeMapId" th:value="${resExtThemeMap.resourceid}"/>
|
<input type="hidden" id="themeType" th:value="${resExtThemeMap.type}"/>
|
<input type="hidden" id="themePortalguid" th:value="${resExtThemeMap.portalguid}"/>
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">服务地址</label>
|
<div class="controls input-icon">
|
<input name="urlid" type="hidden" th:value="${resExtMapUrl.urlid}" />
|
<input type="text" id="serverurl" name="serverurl" class="form-control col-sm-11" th:value="${resExtMapUrl.serverurl}"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">协议</label>
|
<div class="controls input-icon">
|
<select id="typeandurl" name="typeandurl" class="form-control col-sm-9">
|
<option value=''>--请选择--</option>
|
<option th:each="item:${typeandurlList}" th:value="${item.key}" th:text="${item.value}" th:selected="(${resExtMapUrl.typeandurl}==${item.key})?'true':'false'"></option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6" id="ztle">
|
<div class="control-group">
|
<label class="control-label">专题类型<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<select id="type" name="type" class="form-control col-sm-9" required="">
|
<option value="">--请选择--</option>
|
<option th:each="item:${typeList}" th:value="${item.key}" th:text="${item.value}" th:selected="(${resExtThemeMap.type}==${item.key})?'true':'false'"></option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<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">
|
<select id="publishsoft" name="publishsoft" class="form-control col-sm-9" required="">
|
<option value="">--请选择--</option>
|
<option th:each="item:${PublishSoftList}" th:value="${item.key}" th:text="${item.value}" th:selected="(${resExtThemeMap.publishsoft}==${item.key})?'true':'false'"></option>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6" id="zyguid">
|
<div class="control-group">
|
<label class="control-label">Portal资源GUID</label>
|
<div class="controls input-icon">
|
<input th:value="${resExtThemeMap.portalguid}" id="portalguid" name="portalguid" type="text" class="form-control col-sm-9"/>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6" id="dtsz">
|
<div class="control-group">
|
<label class="control-label">底图设置</label>
|
<div class="controls input-icon">
|
<input type="hidden" id="defaultlayerset" name="defaultlayerset" th:value="${resExtThemeMap.defaultlayerset}"/>
|
<input th:value="${baseMapLayerName}" id="baseMapLayerName" name="baseMapLayerName" type="text" class="form-control col-sm-7" disabled="disabled" style="padding: 0.3rem 0.7rem;width:60%"/>
|
<button type="button" class="btn btn-primary" onclick="sheZhi();" style="vertical-align:baseline; padding: 0.375em 0.7em;">设置
|
</button>
|
<button type="button" class="btn btn-primary" onclick="diTuClear();" style="vertical-align:baseline;padding: 0.375em 0.7em;">清除
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-6" id="ytcmc">
|
<div class="control-group">
|
<div class="control-group">
|
<label class="control-label">原图层名称</label>
|
<div class="controls input-icon">
|
<input th:value="${resExtThemeMap.layername}" id="layername" name="layername" type="text" class="form-control col-sm-9"/>
|
</div>
|
</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="${resExtThemeMap.legendurl}" id="showurl" type="text" class="form-control col-sm-9" style="width: 84%;"/>
|
<input th:value="${resExtThemeMap.legendurl}" id="legendurl" name="legendurl" type="hidden" class="form-control col-sm-9" style="width: 84%;"/>
|
<input type="file" id="upfilepath" name="upfilepath" multiple="multiple" accept="image/*" style="display: none;"/>
|
<button type="button" id="filebutton" class="btn btn-primary " style="vertical-align: top;" onclick="openDialog('upfilepath')">
|
<span class="fa fa-upload"></span> 上传
|
</button>
|
</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 type="hidden" id="sublayerset" name="sublayerset" th:value="${resExtThemeMap.sublayerset}"/>
|
<div class="tags-wrapper clearfix" style="float: left;width:84%;">
|
<div class="addTagWrap" style="max-height: 100px;overflow-y: scroll;height: 100px;margin-bottom:16px;">
|
<div id="moduleDiv" style="">
|
|
</div>
|
</div>
|
</div>
|
<button title="选择子图层" type="button" class="btn btn-primary" id="ShowTuCeng" onclick="TuCeng();" style="float: left;margin-left: 5px;">设置
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</form>
|
<script>
|
$(function () {
|
cheackForm("ztdtform");
|
if ($("#extThemeMapId").val().trim() != '') {
|
if ($("#themeType").val().trim() != '') {
|
$("#type").attr("disabled", true);
|
}
|
if ($("#themePortalguid").val().trim() != '') {
|
$("#portalguid").attr("disabled", true);
|
}
|
}
|
var type = $("#type").val();
|
if (type == "ArcMap") {
|
$("#ytcmc").show();
|
$("#dtsz").show();
|
} else {
|
$("#ytcmc").hide();
|
$("#dtsz").hide();
|
}
|
if (type == "Portal专题") {
|
$("#zyguid").show();
|
} else {
|
$("#zyguid").hide();
|
}
|
|
//协议
|
if ($('#typeandurl').val().trim() != "") {
|
$('#typeandurl').attr("disabled", true);
|
}
|
});
|
|
function sheZhi() {
|
//弹出一个页面层
|
layer.open({
|
type: 2,
|
title: '底图设置',
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['600px', '500px'],
|
content: '../ResRegister/BaseMapSelect'
|
});
|
}
|
|
function diTuClear() {
|
$("#defaultlayerset").val("");
|
$("#baseMapLayerName").val("");
|
}
|
</script>
|
<script th:inline="javascript">
|
var removedOpts = [];
|
/*<![CDATA[*/
|
var moduleList = [[${tucengList}]];
|
var oldesbids = [[${oldesbids}]];
|
/*]]>*/
|
|
$(function () {
|
showModuleName(0, moduleList);
|
});
|
|
//复制
|
$("#type").bind("change", function () {
|
if ($(this).val() == "ArcMap") {
|
$("#ytcmc").show();
|
$("#dtsz").show();
|
} else {
|
$("#ytcmc").hide();
|
$("#dtsz").hide();
|
}
|
if ($(this).val() == "Portal专题") {
|
$("#zyguid").show();
|
} else {
|
$("#zyguid").hide();
|
}
|
});
|
|
/*<![CDATA[*/
|
function TuCeng() {
|
var selectId = getModuleId();
|
layer.open({
|
type: 2,
|
title: "选择子图层",
|
shadeClose: true,
|
area: ["550px", "500px"],
|
content: "/res/ResExtThemeMap/ZiTuCengSheZhi?selectids=" + selectId
|
})
|
}
|
|
//模块设置
|
function showModuleName(type, selectList) {//0为初次加载,1为追加
|
if (type == 0) {
|
var html = "";
|
for (var key in moduleList) {
|
html += "<div class='inner-tag-wrapper'><span class='inner-tag-name' key='" + key + "'>" + moduleList[key] + "</span>"
|
+ "<a class=\"inner-tag-close\" title=\"删除\" onclick='deleteModule(this)' href=\"javascript:;\">×</a></div>";
|
}
|
$("#moduleDiv").html(html);
|
}
|
if (type == 1) {
|
var selectHtml = "";
|
selectList.forEach(function (value, key) {
|
selectHtml += "<div class='inner-tag-wrapper'><span class='inner-tag-name' key='" + key + "'>" + value + "</span>"
|
+ "<a class=\"inner-tag-close\" title=\"删除\" onclick='deleteModule(this)' href=\"javascript:;\">×</a></div>";
|
})
|
$("#moduleDiv").append(selectHtml);
|
}
|
}
|
|
//删除板块
|
function deleteModule(obj) {
|
$(obj).parent().remove();
|
}
|
|
function getModuleId() {
|
var id = "";
|
$("#moduleDiv .inner-tag-name").each(function () {
|
if (id.length != 0) {
|
id += ",";
|
}
|
id += $(this).attr("key");
|
});
|
return id;
|
}
|
/*]]>*/
|
|
function openDialog(id) {
|
document.getElementById(id).click();
|
var legendurl = $("#legendurl").val();
|
if (document.getElementById(id).value != '') {
|
var formdata = new FormData();
|
formdata.append('file', $('#upfilepath')[0].files[0]);
|
formdata.append('legendurl', legendurl);
|
$.ajax({
|
url: "/res/ResExtThemeMap/fileUploadTuLi",
|
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 if (json.result == '1') {
|
$("#showurl").val(json.Path);
|
$('#legendurl').val(json.Path);
|
} else if (json.result == '-1') {
|
alert("上传的文件格式不正确,请上传图片格式文件!");
|
}
|
}
|
});
|
}
|
}
|
</script>
|