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.
487 lines
14 KiB
487 lines
14 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 _pack_uuid;
|
||
|
/**加载应用包功能树*/
|
||
|
|
||
|
$(function(){
|
||
|
$("#parent_uuid").val("-1");
|
||
|
_pack_uuid = $.getURLParam('pack_uuid');//应用包系统标识
|
||
|
packageInfo();
|
||
|
initFuncTree();
|
||
|
|
||
|
//初始化单选框
|
||
|
init_radio('is_ctrl_button',"1",true);
|
||
|
init_radio('is_active',"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 packageInfo(){
|
||
|
$.wait_open();
|
||
|
$.cuajax({
|
||
|
url:'wdk?action=portal.package&method=detail&ajaxparam='+new Date().getTime()
|
||
|
,method:"post"
|
||
|
,timeout:WDK_Timeout
|
||
|
,data:{
|
||
|
pack_uuid:_pack_uuid
|
||
|
}
|
||
|
,success:function(result){
|
||
|
$.wait_close();
|
||
|
var jres = $.str2json(result);
|
||
|
if(jres.code=='1'){
|
||
|
if(jres.rows[0]){
|
||
|
$("#packagetitle").text("应用包功能注册 > "+jres.rows[0].pack_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.pkgfunction&method=funTree",
|
||
|
dataFilter: function (id, pnode, data) {
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
data[i].isParent = true;
|
||
|
}
|
||
|
return data;
|
||
|
},
|
||
|
queryParams: {
|
||
|
pack_uuid: _pack_uuid,
|
||
|
parent_uuid: '',
|
||
|
issync: '1'
|
||
|
},
|
||
|
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 gotoPackage(){
|
||
|
window.location.href = "<%=basePath%>platform/portal/saconsole/packagereg.jsp";
|
||
|
}
|
||
|
|
||
|
|
||
|
//刷新选择的功能信息
|
||
|
function refreshFunPanel(func_uuid) {
|
||
|
$.wait_open();
|
||
|
$.cuajax({
|
||
|
url:'wdk?action=portal.pkgfunction&method=detail&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);
|
||
|
//将数据填充到表单中
|
||
|
$.setFieldValue(jres.data, "#functionform");
|
||
|
/* $("input[name='is_ctrl_button'][value='"+jres.data.is_ctrl_button+"']").attr("checked",true);
|
||
|
$("input[name='is_active'][value='"+jres.data.is_active+"']").attr("checked",true); */
|
||
|
}
|
||
|
}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=="01"){
|
||
|
data.push({id:'01',text:'目录'});
|
||
|
initvalue = "01";
|
||
|
}else if(func_type=="02"){
|
||
|
data.push({id:'02',text:'功能'});
|
||
|
initvalue = "02";
|
||
|
}else if(func_type=="03"){
|
||
|
data.push({id:'03',text:'按钮'});
|
||
|
initvalue = "03";
|
||
|
}
|
||
|
|
||
|
$("#func_type_div").empty();
|
||
|
$('#func_type_div').attr('id','func_type');
|
||
|
$.combobox({
|
||
|
id:"func_type"
|
||
|
,data:data
|
||
|
,width:$('#func_type').css('width')
|
||
|
,initvalue:initvalue
|
||
|
,onChange:function(e,v){
|
||
|
//functypeChange(v);
|
||
|
}
|
||
|
});
|
||
|
functypeChange(func_type);
|
||
|
}
|
||
|
|
||
|
//功能类型发生变化
|
||
|
function functypeChange(func_type){
|
||
|
if(func_type=="" || func_type=="01"){
|
||
|
//目录
|
||
|
$("#func_url_div").css('display','none');
|
||
|
$("#is_ctrl_button_div").css('display','none');
|
||
|
$("#org_attr_div").css('display','none');
|
||
|
}else if(func_type=="02"){
|
||
|
//功能
|
||
|
$("#func_url_div").css('display','block');
|
||
|
$("#is_ctrl_button_div").css('display','block');
|
||
|
$("#org_attr_div").css('display','block');
|
||
|
}else if(func_type=="03"){
|
||
|
//按钮
|
||
|
$("#func_url_div").css('display','none');
|
||
|
$("#is_ctrl_button_div").css('display','none');
|
||
|
$("#org_attr_div").css('display','none');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**新增同级*/
|
||
|
function addBrotherFun(){
|
||
|
$.openWin({
|
||
|
id:$.getUUID(),
|
||
|
title:'功能注册-新增',
|
||
|
height:600,
|
||
|
width:850,
|
||
|
modal:true,
|
||
|
url:'platform/portal/saconsole/functionreg_edit.jsp',
|
||
|
queryParams:{
|
||
|
actionflag:'add'
|
||
|
,pack_uuid:_pack_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;
|
||
|
}
|
||
|
|
||
|
var func_type = $.combobox_getValue({id:"func_type"});
|
||
|
if(func_type=="03"){
|
||
|
alert("按钮不能再增加下级了!");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
$.openWin({
|
||
|
id:$.getUUID(),
|
||
|
title:'功能注册-新增',
|
||
|
height:600,
|
||
|
width:850,
|
||
|
modal:true,
|
||
|
url:'platform/portal/saconsole/functionreg_edit.jsp',
|
||
|
queryParams:{
|
||
|
actionflag:'add'
|
||
|
,pack_uuid:_pack_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:620,
|
||
|
width:850,
|
||
|
modal:true,
|
||
|
url:'platform/portal/saconsole/functionreg_edit.jsp',
|
||
|
queryParams:{
|
||
|
actionflag:'mdf',
|
||
|
func_uuid:func_uuid,
|
||
|
pack_uuid:_pack_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 treeObj = $.fn.zTree.getZTreeObj("listtree");
|
||
|
var node = $.tree_getNodeById("listtree",$("#func_uuid").val());
|
||
|
node.text = ret.func_name;
|
||
|
$.tree_updateNode("listtree",node);
|
||
|
treeObj.reAsyncChildNodes(node, "refresh");
|
||
|
if(ret.changeParent){
|
||
|
$.tree_reload("listtree");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**删除*/
|
||
|
function deleteFun() {
|
||
|
if($("#func_uuid").val()==""){
|
||
|
alert("请先选择要删除的功能!");
|
||
|
return;
|
||
|
}
|
||
|
confirmDialog("是否确认删除?",function(){
|
||
|
$.wait_open();
|
||
|
$.cuajax({
|
||
|
url:'wdk?action=portal.pkgfunction&method=delete&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="height:45px;line-height:35px;">
|
||
|
<div class="page-title-text" style="padding-top:6px;">
|
||
|
<label id="packagetitle" style="padding-right:15px">应用包功能注册</label>
|
||
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-arrow-left'" onclick="gotoPackage()">返回</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 0 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="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" 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" name="func_name" id="func_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="short_name" name="short_name" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="formgroup" style="width:450px;">
|
||
|
<label>功能类型</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="func_type" name="func_type" 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="func_url_div">
|
||
|
<div class="formgroup col-12" >
|
||
|
<label>功能地址</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" name="func_url" id="func_url" placeholder="" readonly="readonly"/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row" id="is_ctrl_button_div">
|
||
|
<div class="formgroup col-12" >
|
||
|
<label>是否控制到按钮</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="is_ctrl_button" name="is_ctrl_button" />
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="row" id="org_attr_div">
|
||
|
<div class="formgroup col-12">
|
||
|
<label>业务组织属性</label>
|
||
|
<div>
|
||
|
<input type="text" class="easyui-validatebox" id="org_attr_scodename" name="org_attr_scodename" 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>
|