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.
494 lines
15 KiB
494 lines
15 KiB
1 month ago
|
<%@ 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 lang="zh-CN">
|
||
|
<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">
|
||
|
|
||
|
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
var _app_uuid;
|
||
|
/**加载应用包功能树*/
|
||
|
$(function(){
|
||
|
_app_uuid = $.getURLParam('app_uuid');//应用系统标识
|
||
|
appInfo();
|
||
|
initFuncTree();
|
||
|
//初始化单选框
|
||
|
init_radio('is_active','1',true);
|
||
|
init_radio('is_system','1',true);
|
||
|
});
|
||
|
|
||
|
/**
|
||
|
* 下拉框
|
||
|
*/
|
||
|
function combo_box(id, moduleCode){
|
||
|
$.combobox({
|
||
|
id:id
|
||
|
,width:$('#'+id).css("width")
|
||
|
,url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime()
|
||
|
,queryParams:{
|
||
|
_SRVNAME:'service.wdk.pub'
|
||
|
,_SRVMETHOD:'wql_queryCombobox'
|
||
|
,_DATA:$.json2str({
|
||
|
modulecode:moduleCode
|
||
|
,jparam:{
|
||
|
condition:''
|
||
|
}
|
||
|
})
|
||
|
,_RSFIELD:'result'
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
//查询应用信息
|
||
|
function appInfo(){
|
||
|
$.wait_open();
|
||
|
$.cuajax({
|
||
|
url:'wdk?action=portal.app&method=detail&ajaxparam='+new Date().getTime()
|
||
|
,method:"post"
|
||
|
,timeout:WDK_Timeout
|
||
|
,data:{
|
||
|
app_uuid:_app_uuid
|
||
|
}
|
||
|
,success:function(result){
|
||
|
$.wait_close();
|
||
|
var jres = $.str2json(result);
|
||
|
if(jres.code=='1'){
|
||
|
if(jres.rows[0]){
|
||
|
$("#apptitle").text("应用功能注册 > "+jres.rows[0].app_name);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
,error:function(result){
|
||
|
$.wait_close();
|
||
|
alert('网络错误!result='+result);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
//初始化功能树
|
||
|
function initFuncTree(){
|
||
|
$.tree({
|
||
|
id: 'listtree',
|
||
|
checkbox: false,
|
||
|
expandall: false,
|
||
|
cascadeCheck: false,
|
||
|
asyn: true,
|
||
|
url: "wdk?action=portal.app&method=funTree",
|
||
|
dataFilter: function (id, pnode, data) {
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
data[i].isParent = true;
|
||
|
}
|
||
|
return data;
|
||
|
},
|
||
|
queryParams: {
|
||
|
app_uuid: _app_uuid,
|
||
|
parent_uuid: '',
|
||
|
issync: '0'
|
||
|
},
|
||
|
onClick:function(event,treeid,node){
|
||
|
//$('#content_box').css('display','');
|
||
|
$("#func_uuid").val(node.id);
|
||
|
$("#parent_uuid").val(node.attributes.parent_uuid);
|
||
|
//读取原信息
|
||
|
refreshFunPanel(node.id);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
//返回应用列表
|
||
|
function gotoApp(){
|
||
|
window.location.href = "<%=basePath%>platform/portal/saconsole/appreg.jsp";
|
||
|
}
|
||
|
|
||
|
|
||
|
//刷新选择的功能信息
|
||
|
function refreshFunPanel(func_uuid) {
|
||
|
$.wait_open();
|
||
|
$.cuajax({
|
||
|
url:'wdk?action=portal.app&method=fundetail&ajaxparam='+new Date().getTime()
|
||
|
,method:"post"
|
||
|
,timeout:WDK_Timeout
|
||
|
,data:{
|
||
|
func_uuid:func_uuid
|
||
|
}
|
||
|
,success:function(result) {
|
||
|
$.wait_close();
|
||
|
var jres = $.str2json(result);
|
||
|
if(jres.code=='1'){
|
||
|
if(jres.data){
|
||
|
//初始化功能类别
|
||
|
init_func_type(jres.data.func_type_scode);
|
||
|
//将数据填充到表单中
|
||
|
$.setFieldValue(jres.data, "#functionform");
|
||
|
}
|
||
|
}else{
|
||
|
alert(jres.desc);
|
||
|
}
|
||
|
}
|
||
|
,error:function(result){
|
||
|
$.wait_close();
|
||
|
alert('网络错误!result='+result);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
//初始化功能类别
|
||
|
function init_func_type(func_type){
|
||
|
var data = [];
|
||
|
var initvalue = "";
|
||
|
if(func_type=="" || func_type=="02"){
|
||
|
data.push({id:'02',text:'子系统'});
|
||
|
initvalue = "02";
|
||
|
}else if(func_type=="03"){
|
||
|
data.push({id:'03',text:'模块'});
|
||
|
initvalue = "03";
|
||
|
}else if(func_type=="04"){
|
||
|
data.push({id:'04',text:'功能菜单'});
|
||
|
initvalue = "04";
|
||
|
}else if(func_type=="05"){
|
||
|
data.push({id:'05',text:'按钮'});
|
||
|
initvalue = "05";
|
||
|
}
|
||
|
|
||
|
//$("#func_type_scode_div").empty();
|
||
|
//$('#func_type_scode_div').attr('id','func_type_scode');
|
||
|
$.combobox({
|
||
|
id:"func_type_scode"
|
||
|
,data:data
|
||
|
,width:$('#func_type_scode').css('width')
|
||
|
,initvalue:initvalue
|
||
|
,onChange:function(e,v){
|
||
|
//functypeChange(v);
|
||
|
}
|
||
|
});
|
||
|
functypeChange(func_type);
|
||
|
}
|
||
|
|
||
|
//功能类型发生变化
|
||
|
function functypeChange(func_type){
|
||
|
//alert("functypeChange="+func_type);
|
||
|
if(func_type=="" || func_type=="02"){
|
||
|
//子系统
|
||
|
$("#package_func_uuid_div").css('display','none');
|
||
|
$("#is_system_div").css('display','none');
|
||
|
$("#ico_index_div").css('display','block');
|
||
|
$("#select_ico_index_div").css('display','block');
|
||
|
}else if(func_type=="03"){
|
||
|
//模块
|
||
|
$("#package_func_uuid_div").css('display','none');
|
||
|
$("#is_system_div").css('display','none');
|
||
|
$("#ico_index_div").css('display','block');
|
||
|
$("#select_ico_index_div").css('display','block');
|
||
|
}else if(func_type=="04"){
|
||
|
//功能菜单
|
||
|
$("#package_func_uuid_div").css('display','block');
|
||
|
$("#is_system_div").css('display','block');
|
||
|
$("#ico_index_div").css('display','block');
|
||
|
$("#select_ico_index_div").css('display','block');
|
||
|
}else if(func_type=="05"){
|
||
|
//按钮
|
||
|
$("#package_func_uuid_div").css('display','block');
|
||
|
$("#is_system_div").css('display','none');
|
||
|
$("#ico_index_div").css('display','none');
|
||
|
$("#select_ico_index_div").css('display','none');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**新增同级*/
|
||
|
function addBrotherFun(){
|
||
|
$.openWin({
|
||
|
id:$.getUUID(),
|
||
|
title:'功能注册-新增',
|
||
|
height:600,
|
||
|
width:850,
|
||
|
modal:true,
|
||
|
url:'platform/portal/saconsole/appfunctionreg_edit.jsp',
|
||
|
queryParams:{
|
||
|
actionflag:'add'
|
||
|
,app_uuid:_app_uuid
|
||
|
,parent_uuid:$("#parent_uuid").val()
|
||
|
},
|
||
|
maximized:false,
|
||
|
draggable:true,
|
||
|
resizable:false,
|
||
|
onClose:function(){
|
||
|
var ret = $.getWinReturn(this.id);//获取弹出窗口的返回值
|
||
|
if(ret){
|
||
|
var treeObj = $.fn.zTree.getZTreeObj("listtree");
|
||
|
var node = $.tree_getNodeById("listtree",$("#parent_uuid").val());
|
||
|
treeObj.reAsyncChildNodes(node, "refresh");
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**新增下级*/
|
||
|
function addChildFun(){
|
||
|
var func_uuid = $("#func_uuid").val();
|
||
|
if(!func_uuid || func_uuid.length==0){
|
||
|
alert("请先选择父级功能!");
|
||
|
return;
|
||
|
}
|
||
|
$.openWin({
|
||
|
id:$.getUUID(),
|
||
|
title:'功能注册-新增',
|
||
|
height:600,
|
||
|
width:850,
|
||
|
modal:true,
|
||
|
url:'platform/portal/saconsole/appfunctionreg_edit.jsp',
|
||
|
queryParams:{
|
||
|
actionflag:'add'
|
||
|
,app_uuid:_app_uuid
|
||
|
,parent_uuid:$("#func_uuid").val()
|
||
|
},
|
||
|
maximized:false,
|
||
|
draggable:true,
|
||
|
resizable:false,
|
||
|
onClose:function(){
|
||
|
var ret = $.getWinReturn(this.id);//获取弹出窗口的返回值
|
||
|
if(ret){
|
||
|
var treeObj = $.fn.zTree.getZTreeObj("listtree");
|
||
|
var node = $.tree_getNodeById("listtree",$("#func_uuid").val());
|
||
|
treeObj.reAsyncChildNodes(node, "refresh");
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**修改*/
|
||
|
function modifyFun() {
|
||
|
var func_uuid = $("#func_uuid").val();
|
||
|
if(!func_uuid || func_uuid.length==0){
|
||
|
alert("请先选择要修改的功能!");
|
||
|
return;
|
||
|
}
|
||
|
$.openWin({
|
||
|
id:$.getUUID(),
|
||
|
title:'功能注册-修改',
|
||
|
height:600,
|
||
|
width:850,
|
||
|
modal:true,
|
||
|
url:'platform/portal/saconsole/appfunctionreg_edit.jsp',
|
||
|
queryParams:{
|
||
|
actionflag:'mdf',
|
||
|
func_uuid:func_uuid,
|
||
|
app_uuid:_app_uuid,
|
||
|
parent_uuid:$("#parent_uuid").val()
|
||
|
},
|
||
|
maximized:false,
|
||
|
draggable:true,
|
||
|
resizable:false,
|
||
|
onClose:function(){
|
||
|
var ret = $.getWinReturn(this.id);//获取弹出窗口的返回值
|
||
|
if(ret){
|
||
|
//alert($.json2str(ret));
|
||
|
refreshFunPanel($("#func_uuid").val());
|
||
|
var node = $.tree_getNodeById("listtree",$("#func_uuid").val());
|
||
|
node.text = ret.func_name;
|
||
|
$.tree_updateNode("listtree",node);
|
||
|
if(ret.changeParent){
|
||
|
$.tree_reload("listtree");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**删除*/
|
||
|
function deleteFun() {
|
||
|
if($("#func_uuid").val()==""){
|
||
|
alert("请先选择要删除的功能!");
|
||
|
return;
|
||
|
}
|
||
|
confirmDialog("是否确认删除?",function(){
|
||
|
$.wait_open();
|
||
|
$.cuajax({
|
||
|
url:'wdk?action=portal.app&method=deletefun&ajaxparam='+new Date().getTime()
|
||
|
,method:"post"
|
||
|
,timeout:WDK_Timeout
|
||
|
,data:{
|
||
|
func_uuid:$("#func_uuid").val()
|
||
|
}
|
||
|
,success:function(result) {
|
||
|
$.wait_close();
|
||
|
var jres = $.str2json(result);
|
||
|
alert(jres.desc);
|
||
|
if(jres.code=="1"){
|
||
|
var treeObj = $.fn.zTree.getZTreeObj("listtree");
|
||
|
var node = $.tree_getNodeById("listtree",$("#parent_uuid").val());
|
||
|
treeObj.reAsyncChildNodes(node, "refresh");
|
||
|
}
|
||
|
}
|
||
|
,error:function(result){
|
||
|
$.wait_close();
|
||
|
alert('网络错误!result='+result);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 初始化单选框
|
||
|
*/
|
||
|
function init_radio(id,initvalue,disabled){
|
||
|
$.radio({
|
||
|
id: id,
|
||
|
initvalue: initvalue,
|
||
|
disabled:disabled,
|
||
|
data:[{id:"1",text:"是"},
|
||
|
{id:"0",text:"否"}
|
||
|
]
|
||
|
});
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body class="easyui-layout" data-options="fit:true" style="background:#fff;">
|
||
|
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow: hidden;height:40px;">
|
||
|
<div class="page-title-text">
|
||
|
<label id="apptitle" style="padding-right:15px;line-height:40px;">应用包功能注册</label>
|
||
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-arrow-left'" onclick="gotoApp()">返回</a>
|
||
|
</div>
|
||
|
<div class="edit-page-toolbar" style="line-height:30px;">
|
||
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="addBrotherFun()">新增同级</a>
|
||
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="addChildFun()">新增子级</a>
|
||
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-edit'" onclick="modifyFun()">修改</a>
|
||
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-remove'" onclick="deleteFun()">删除</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div data-options="region:'center',border:false,collapsed:false" >
|
||
|
<div class="easyui-layout" data-options="fit:true">
|
||
|
<div data-options="region:'west',border:true,collapsed:false" style="width:220px;" >
|
||
|
<div class="tree_title" style="width:95%;font-weight: bold;margin:15px 2px 0 8px;font-size:14px;">应用功能</div>
|
||
|
<div id="listtree"></div>
|
||
|
</div>
|
||
|
<div data-options="region:'center',border:true,collapsed:false" style="border-left:0;">
|
||
|
<div class="edit-container" style="width:985px;">
|
||
|
<form id="functionform">
|
||
|
<input type="hidden" id="func_uuid" name="func_uuid"/>
|
||
|
<input type="hidden" id="org_uuid" name="org_uuid"/>
|
||
|
<input type="hidden" id="parent_uuid" name="parent_uuid"/>
|
||
|
|
||
|
<div class="form-title" >
|
||
|
<span class="form-title-text">基本信息</span>
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>功能名称:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" name="func_name" id="func_name" readonly="readonly">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>功能简称:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="short_name" name="short_name" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>功能编码:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="func_code" name="func_code" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>功能类型:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="func_type_scode" name="func_type_scode" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>是否启用*:</label>
|
||
|
<div>
|
||
|
<input id="is_active" name="is_active" >
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>排序:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="display_order" name="display_order" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row" id="package_func_uuid_div">
|
||
|
<div class="formgroup col-12" >
|
||
|
<label>对应应用包功能:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" name="package_func_uuidname" id="package_func_uuidname" placeholder="" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="row" id="is_system_div">
|
||
|
<div class="formgroup col-12">
|
||
|
<label>是否系统菜单:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="is_system" name="is_system" />
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="row" id="ico_index_div">
|
||
|
<div class="formgroup col-12">
|
||
|
<label>功能图标:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="ico_index" name="ico_index" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="row" id="select_ico_index_div">
|
||
|
<div class="formgroup col-12" >
|
||
|
<label>选中的功能图标:</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="select_ico_index" name="select_ico_index" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row" style="height:80px;">
|
||
|
<div class="formgroup col-12">
|
||
|
<label>描述:</label>
|
||
|
<div>
|
||
|
<textarea class="" name="remark" id="remark" rows="3" style="width:100%;" readonly="readonly"></textarea>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</html>
|