You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

238 lines
8.3 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="org.wdk.WDKConstant"%>
<%@ page import="org.wdk.WDKCore"%>
<%@ page import="org.wdk.WDK"%>
<%@ page import="com.noblelift.imp.platform.module.portal.source.SessionUser"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String WDK_ROOT = WDKCore.WDK_ROOT;
SessionUser su = (SessionUser)WDK.getSessionUser(request, response);
WDK.writeSessionUser(out, su);
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<base href="<%=basePath%>" target="_self">
<title>应用云平台-应用包注册(新增)</title>
<style type="text/css">
</style>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
<script type="text/javascript">
<% if(null==su){%>
$.timeout();
<%}%>
var _gridcode = "platform.portal.saconsole.packageregrid";
var _gridid = $.getUUID();
</script>
</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="height:45px;line-height:35px;">
<div class="page-title-text"></div>
<div class="edit-page-toolbar">
<a href="javascript:void(0);" id="btnsave" class="easyui-linkbutton" data-options="iconCls:'fa fa-save'" onclick="opt_save()">保存</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-window-close'" onclick="opt_close()">关闭</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false">
<div class="edit-container">
<form id="edit_form">
<input type="hidden" id="pack_uuid" name="pack_uuid" value=""/>
<div class="row">
<div class="formgroup">
<label class="required">应用包名称</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="required:true,validType:'length[3,10]',tipPosition:'bottom'" name="pack_name" id="pack_name" placeholder="">
</div>
</div>
<div class="formgroup">
<label>应用包简称</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="short_name" name="short_name" value=""/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label class="required">应用包代码</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="required:true,validType:'length[3,10]',tipPosition:'bottom'" id=pack_code name="pack_code" value=""/>
</div>
</div>
<div class="formgroup">
<label>地址</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:'length[0,50]',tipPosition:'bottom'" id="pack_url" name="pack_url" value=""/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>应用包提供商</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:'length[0,50]',tipPosition:'bottom'" id="manufacturer" name="manufacturer" value=""/>
</div>
</div>
<div class="formgroup">
<label>是否启用</label>
<div>
<input id="is_active" name="is_active" >
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>排序</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:'length[0,50]',tipPosition:'bottom'" id="display_order" name="display_order" value=""/>
</div>
</div>
</div>
<div class="row" style="height:80px;">
<div class="formgroup col-12">
<label>描述</label>
<div>
<textarea class="nospaceinside" name="remark" data-options="validType:'length[0,100]',tipPosition:'bottom'" id="remark" rows="3" style="width:100%;"></textarea>
</div>
</div>
</div>
</form>
</div>
</div>
</body>
<script>
var param = $.getURLParam('param');
var jparam = $.str2json($.urlparam_decode(param));
var _actionflag = jparam.queryParams.actionflag; //操作标识:add-添加、mdf-修改、detail-明细
var _pack_uuid=jparam.queryParams.pack_uuid;//应用包系统标识
$(function() {
//初始化数据权限属性
//$.initSelectOption("#data_right_level_scode","wdk?action=portal.package&method=dataModelCombox&modulecode=S_UC_ROLE_DATALEVEL");
// Combo_box("data_right_level_scode","S_UC_ROLE_DATALEVEL");
if("mdf"==_actionflag || "detail"==_actionflag){
//修改、或查看
$.wait_open();
$.cuajax({
url:'wdk?action=portal.package&method=detail&ajaxparam='+new Date().getTime()
,method:"post"
,data:{
pack_uuid:_pack_uuid
}
,success:function(result) {
$.wait_close();
var jres = $.str2json(result);
if(jres.code=='1'){
if(jres.rows[0]){
//将数据填充到表单中
$.setFieldValue(jres.rows[0], "#edit_form");
$("input[type=radio][name='is_active'][value='"+jres.rows[0].is_active+"']").iCheck("check");//.attr("checked",true);
//init_manage_unit_uuid(jres.rows[0].manage_unit_uuid,jres.rows[0].manage_unit_uuidname);
//查看时设置只读
if("detail"==_actionflag){
$("#pack_name").attr("readonly","readonly");
$("#pack_code").attr("readonly","readonly");
$("#short_name").attr("readonly","readonly");
$("#pack_url").attr("readonly","readonly");
$("#display_order").attr("readonly","readonly");
$("#manufacturer").attr("readonly","readonly");
$("#remark").attr("readonly","readonly");
$("#remark").css("resize","none");
init_radio('is_active',jres.rows[0].is_active,true);//只读,设置true后看不见了。
//隐藏保存按钮
$("#btnsave").hide();
} else {
init_radio('is_active',jres.rows[0].is_active,false);
}
}
}else{
alert(jres.desc);
}
}
,error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}else{
//新增
$('#pack_uuid').val($.getUUID());
$('#display_order').val("1");
init_radio('is_active','1',false);
}
});
/* 初始化单选框*/
function init_radio(id,initvalue,disabled){
$.radio({
id: id,
initvalue: initvalue,
disabled:disabled,
data:[{id:"1",text:"是"},
{id:"0",text:"否"}
]
});
}
//保存应用
function opt_save(){
//验证
var isok = $("#edit_form").form('validate');
if(!isok){
alert('尚有必填项未填或输入有误,请检查后提交');
return false;
}
//打开旋转
$.wait_open();
//获取所有input和textarea 的输入值
var mainFieldValues = $.getFieldValue({formid:'edit_form'});
mainFieldValues.is_active = $("input:radio[name='is_active']:checked").val();
var _param = {
actionflag:_actionflag,
_FILEDVALUE:$.json2str(mainFieldValues)
};
$.wait_open();
$.cuajax({
url:'wdk?action=portal.package&method=save&ajaxparam='+new Date().getTime(),
method:"post",
data:_param,
success:function(result) {
$.wait_close();
var jres = $.str2json(result);
alert(jres.desc);
if(jres.code=="1"){
$.notify("packagereg_add");//触发用户添加成功消息
opt_close();
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
//关闭当前页面
function opt_close() {
$.closeActiveTab();
}
</script>
</html>