<style>
|
/*.edui-editor {*/
|
/*height: 260px !important;*/
|
/*}*/
|
|
/*.edui-editor-iframeholder {*/
|
/*height: 200px !important;*/
|
/*}*/
|
</style>
|
<form class="form-horizontal" id="kjfwform" method="post" 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">
|
<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="${resExtSpaceServer.serverurl}" id="serverurl" name="serverurl"
|
class="form-control col-sm-11" required=""/>
|
<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="posttype" name="posttype" class="form-control col-sm-9" required="">
|
<option value="">--请选择--</option>
|
<option th:selected="(${resExtSpaceServer.posttype}==0)?'true':'false'" value="0">
|
HttpGet
|
</option>
|
<option th:selected="(${resExtSpaceServer.posttype}==1)?'true':'false'" value="1">
|
HttpPost
|
</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-12">
|
<div class="control-group">
|
<label class="control-label">自定义参数界面</label>
|
<div class="controls input-icon">
|
<input th:value="${resExtSpaceServer.diyparamurl}" id="diyparamurl" name="diyparamurl"
|
class="form-control col-sm-11" maxchar="200"/>
|
<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-12">
|
<div class="control-group">
|
<label class="control-label">帮助说明文档</label>
|
<div class="controls input-icon" >
|
<script id="contents" name="contents" type="text/plain" class="col-sm-11" style="z-index: 0;" ></script>
|
<!--<script id="contents" name="contents" type="text/plain" class="col-sm-11" style="margin-left: -0.5%;"></script>-->
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<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" style="padding: 30px">
|
<table class="table">
|
<tr>
|
<th>参数序号</th>
|
<th>参数名称</th>
|
<th>参数别名</th>
|
<th>参数类型</th>
|
<th>参数数据类型</th>
|
<th>参数默认值</th>
|
<th>参数是否必填</th>
|
</tr>
|
<tr th:each="spaces,spacesStat : ${res_spacesParams}">
|
<td th:text="${spaces.orderindex}"></td>
|
<td >
|
<a style="cursor: pointer;" target="_blank" th:text="${spaces.paramname}" th:onclick="'javascript:skip('+${spaces.paramid}+','+${spaces.resourceid}+')'"></a>
|
</td>
|
<th th:text="${spaces.paramalias}"></th>
|
<th th:text="${spaces.paramtype}"></th>
|
<th th:text="${spaces.datatype}"></th>
|
<th th:text="${spaces.defaultValue}"></th>
|
<th th:text="${spaces.required}==1?'是':'否'"></th>
|
</tr>
|
</table>
|
</div>
|
</div>
|
<div class="form-actions navbar-fixed-bottom" style="z-index: 0;">
|
<div style="float: left;">
|
<button class="btn btn-primary" id="addKongJianFuWuSave" type="button">
|
<i class="fa fa-check"></i> 保存
|
</button>
|
<button th:if="${not #lists.isEmpty(resMainInfoId)}" class="btn btn-danger" id="KongJianFuWuDelete"
|
type="button">
|
<i class="fa fa-trash-o"></i> 删除
|
</button>
|
<button class="btn btn-primary" id="NewServiceParameters"
|
type="button" onclick="ServiceParameters()">
|
<i class="fa fa-plus"></i> 新增服务参数
|
</button>
|
<button class="btn btn-warning" id="close" type="button" onclick="window.close()">
|
<i class="fa fa-remove"></i> 关闭
|
</button>
|
<button th:if="${not #lists.isEmpty(resMainInfoId) and resMainInfo.auditstatus eq 2}" class="btn btn-primary" id="copyRes" type="button" onclick="reflayerCopy()">
|
<i class="fa fa-copy"></i> 复制
|
</button>
|
</div>
|
</div>
|
</form>
|
<div id="resCopyInfo" style="display:none;padding:10px;">
|
<div class="col-sm-10">
|
<div class="control-group">
|
<label class="control-label">资源名称:</label>
|
<div class="controls input-icon">
|
<input id="copyname" name="copyname" class="form-control col-sm-10" value="" maxchar="50" />
|
<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 style="margin-top:25px;float:right;">
|
<button class="btn btn-primary" onclick="copyRes()" type="button">
|
<i class="fa fa-check"></i> 保存
|
</button>
|
<button class="btn btn-warning" id="close" type="button" onclick="colseLayer()">
|
<i class="fa fa-remove"></i> 关闭
|
</button>
|
</div>
|
</div>
|
<script th:inline="javascript">
|
$(function () {
|
var content = [[${content}]];
|
cheackForm("kjfwform");
|
initEditor(content!=""?htmlDecodeByRegExp(content):"");
|
});
|
|
//点击链接跳转页面
|
function skip(paramid,resourceid) {
|
layer.open({
|
type: 2,
|
title: '空间服务参数',
|
id: 'ServiceParameters',
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['900px', '700px'],
|
content: '/res/resExtSpaceServer/SpaceParameters?paramid='+paramid+'&resourceid='+resourceid
|
});
|
|
}
|
|
|
//服务参数页面新增
|
function ServiceParameters(){
|
var resMainInfoId = $("#resMainInfoId").val();
|
layer.open({
|
type: 2,
|
title: '空间服务参数',
|
id: 'ServiceParameters',
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['900px', '700px'],
|
content: '/res/resExtSpaceServer/SpaceParameters?resourceid='+resMainInfoId
|
});
|
};
|
|
//复制弹框
|
function reflayerCopy() {
|
//弹出一个页面层
|
layer.open({
|
type: 1,
|
title: '复制',
|
shadeClose: true,
|
shade: false,
|
maxmin: false, //开启最大化最小化按钮
|
area: ['650px', '170px'],
|
content: jQuery("#resCopyInfo")
|
});
|
}
|
//关闭复制弹框
|
function colseLayer(){
|
$(".layui-layer-close1").click();
|
}
|
//实例化编辑器
|
function initEditor(content) {
|
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
|
UE.Editor.prototype.getActionUrl = function(action){
|
if(action == 'uploadimage' || action == 'uploadfile'){
|
return "/res/common/uploadueditorfile";
|
}else{
|
return this._bkGetActionUrl.call(this,action);
|
}
|
}
|
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
|
var ue = UE.getEditor('contents', {
|
toolbars: [
|
[
|
'source',
|
'undo', //撤销
|
'redo', //重做
|
'|',
|
'bold', //加粗
|
'italic', //斜体
|
'strikethrough', //删除线
|
'underline', //下划线
|
'|',
|
'forecolor', //字体颜色
|
'backcolor', //背景色
|
'|',
|
'insertorderedlist', //有序列表
|
'insertunorderedlist', //无序列表
|
'|',
|
'fontfamily', //字体
|
'fontsize', //字号
|
'|',
|
'justifyleft', //居左对齐
|
'justifyright', //居右对齐
|
'justifycenter', //居中对齐
|
'justifyjustify', //两端对齐
|
'|',
|
'link', //超链接
|
'unlink', //取消链接
|
'|',
|
'simpleupload' //单图上传
|
]
|
],
|
initialContent: content, //初始化显示内容
|
initialFrameHeight: 300, //初始化高度
|
enableAutoSave: false //是否启用自动保存
|
});
|
}
|
//解码
|
function htmlDecodeByRegExp(str){
|
var s = "";
|
if(str == null || str.length == 0) return "";
|
s = str.replace(/&/g,"&");
|
s = s.replace(/</g,"<");
|
s = s.replace(/>/g,">");
|
s = s.replace(/ /g," ");
|
s = s.replace(/'/g,"\'");
|
s = s.replace(/"/g,"\"");
|
return s;
|
}
|
</script>
|
<script th:inline="javascript">
|
var resMainInfoId = $("#resMainInfoId").val();
|
var admin = [[${admin}]];
|
var auditstatus = [[${resMainInfo.auditstatus}]];
|
$('#addKongJianFuWuSave').on('click', function () {
|
var content = UE.getEditor('contents').getContent();
|
//判断当前用户是否是管理员,是管理员或是未提交的资源才可以修改资源相关信息
|
if(admin == true || auditstatus == 0 || auditstatus == null) {
|
if ($('#kjfwform').valid()) {
|
$('#kjfwform').ajaxSubmit({
|
url: '/res/resExtSpaceServer/insertSelectiveAndUpdate?resourceid=' + resMainInfoId,
|
type: 'post',
|
dataType: 'text',
|
data: {
|
helpurl: htmlEncodeByRegExp(content)
|
},
|
success: function (data) {
|
if (data == "1") {
|
alert("保存成功!");
|
UE.getEditor('contents').destroy();
|
// parent.FTabPages.resetTab();
|
reloadExt("ExtSpaceServer");
|
}
|
else {
|
alert("保存失败!");
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
else {
|
// alert("您输入的信息存在错误,请更正后再提交!");
|
}
|
}
|
else {
|
alert("注销后才可以对该资源进行修改!");
|
}
|
});
|
//转码
|
function htmlEncodeByRegExp(str){
|
var s = "";
|
if(str == null || str.length == 0) return "";
|
s = str.replace(/&/g,"&");
|
s = s.replace(/</g,"<");
|
s = s.replace(/>/g,">");
|
s = s.replace(/ /g," ");
|
s = s.replace(/\'/g,"'");
|
s = s.replace(/\"/g,""");
|
return s;
|
}
|
$("#KongJianFuWuDelete").click(function () {
|
if(confirm("删除扩展信息,确定删除吗?")){
|
$.ajax({
|
url: '/res/resExtSpaceServer/deleteByPrimaryKey?resourceid=' + resMainInfoId,
|
type: 'post',
|
dataType: 'json',
|
data: {},
|
success: function (data) {
|
if (data == "1") {
|
alert("删除成功!");
|
// parent.FTabPages.resetTab();
|
reloadExt("ExtSpaceServer");
|
}
|
else {
|
alert("删除失败!");
|
}
|
},
|
error: function (e) {
|
alert(e.message)
|
}
|
});
|
}
|
|
});
|
//复制
|
function copyRes(){
|
if($("#copyname").val() == ""){
|
alert("资源名称不能为空!");
|
return false;
|
}
|
$.ajax({
|
url: '/res/ZiYuan/copyMainInfoAndKZ',
|
type: 'post',
|
dataType: 'json',
|
data: {
|
"resourceid":resMainInfoId,
|
"copyname":$("#copyname").val(),
|
"copyurl":"",
|
"type":"ExtSpaceServer"
|
},
|
success: function (data) {
|
if(data != 0){
|
alert("复制成功!")
|
parent.location.href = "/res/ResManage/ResRegister/ResEdit?resMainInfoId=" + data;
|
}
|
},
|
error: function (e) {
|
alert(e.message)
|
}
|
});
|
}
|
|
</script>
|