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.
 
 
 
 
 
 

246 lines
7.6 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标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<title>用户管理-用户新增</title>
<base href="<%=basePath%>" target="_self">
<style type="text/css">
</style>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
<script type="text/javascript">
var param = $.getURLParam('param');
var _wid = $.getURLParam('wid');
var jparam = $.str2json($.urlparam_decode(param));
var _actionflag = jparam.queryParams.actionflag; //操作类型 add-新增 update-修改,读取原信息
var _avatar_uuid = jparam.queryParams.avatar_uuid;
$(function(){
//不可输入空格键:
$(".nospaceinside").on("keypress",removeAllBlank);
function removeAllBlank(e) {
if(e.keyCode == 32){
e.preventDefault();
}
}
//如果是修改,则首先查询下详细信息
if('update'==_actionflag){
$.wait_open();
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:{
_SRVNAME:'service.usr.vrole',
_SRVMETHOD:'getVirtualRoleInfo',
_DATA:$.json2str({
op_acc : $.getSessionUser().account_id,
avatar_uuid : _avatar_uuid,
result_fields : '',
order_expr : ''
})
},
success:function(result) {
$.wait_close();
//返回值字符串转json
var jres = $.str2json(result);
if(jres.code=="1"){ //查询成功
init(jres.result);
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}else{
$("#display_order").val("10");
init(null);
}
});
function init(jres){
if(jres){
$.setFieldValue(jres, "#edit_form");
}
$.cuajax({
url : 'wdk?action=wdk.pub&method=call_service&ajaxparam='+ new Date().getTime(),
method : "post",
timeout : WDK_Timeout,
data : {
_SRVNAME: 'service.usr.role',
_SRVMETHOD: 'queryRoleList',
_DATA : $.json2str({
op_acc : $.getSessionUser().account_id,
attr_expr: $.json2str([
{"fieldName":"app_uuid","logicOperator":"=","logicValue":_sessionuser.appuuid},
{"fieldName":"role_type_scode","logicOperator":"=","logicValue":"04"},
{"fieldName":"sysisdelete","logicOperator":"=","logicValue":"0"}
]),
result_fields :'role_uuid,role_name',
order_expr : ''
})
},
success : function(result) {
$.wait_close();
var data = $.str2json(result);//返回值字符串转json
$.combobox({
id : 'role_uuid',
data : data.resultset,
required : true,
idField : 'role_uuid',
textField : 'role_name',
//initvalue : jres ? : '',
height : 25,
multiple : true,
panelHeight : 150,
onLoadSuccess : function(data){
if(jres){
$("#role_uuid").combobox('setValues',jres.role_uuid.split(","));
}
}
});
},
error : function(result) {
$.wait_close();
alert('网络错误!result=' + result);
}
});
}
//注册关闭按钮事件
function opt_save(){
//验证
var isok = $("#edit_form").form('validate');
if (!isok) {
alert('尚有必填项未填或填写有误,请检查后提交');
return false;
}
var _SRVMETHOD = "create";
if(_actionflag != "add"){
_SRVMETHOD= "change";
}
var fieldValues = $.getFieldValue({formid:'edit_form'});
fieldValues.manage_unit_uuid = _sessionuser.manageunituuid;
fieldValues.app_uuid = _sessionuser.appuuid;
fieldValues.role_uuid = $("#role_uuid").combobox('getValues').join(",");
$.wait_open();
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:{
_SRVNAME:'service.usr.vrole',
_SRVMETHOD:_SRVMETHOD,
_DATA:$.json2str({
op_acc:$.getSessionUser().account_id,
vrole_info : fieldValues
})
},
success:function(result) {
$.wait_close();
//返回值字符串转json
var jres = $.str2json(result);
if(jres.code=="1"){ //操作成功
alert(jres.desc);
$.closeWin();
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
//关闭当前页面
function opt_close() {
var wid = $.getURLParam("wid");
$.closeWin(wid);
}
</script>
</head>
<body class="easyui-layout win" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="height:50px;line-height:35px;">
<div class="page-toolbar">
<a href="javascript:void(0);" 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-close'" onclick="opt_close()">关闭</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false" >
<div class="edit-container-win1">
<form id="edit_form">
<input type="hidden" id="avatar_uuid">
<div class="row">
<div class="formgroup col-12">
<label class="required">虚拟角色名称</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="avatar_name" name="avatar_name" data-options="required:true,tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label class="required">自定义实现类</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="class_name" name="class_name" data-options="required:true,tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label class="required">关联角色</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="role_uuid" name="role_uuid" data-options="required:true,tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label>排序</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="display_order" name="display_order" data-options="required:true,validType:['isInteger'],tipPosition:'bottom'"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup ">
<label>备注</label>
<div>
<textarea class="" name="remark" id="remark" rows="3" style="width:100%;"></textarea>
</div>
</div>
</div>
</form>
</div>
</div>
</body>
</html>