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.
 
 
 
 
 
 

216 lines
7.0 KiB

<%@page import="org.wdk.module.auth.mount.bean.BaseSessionUser"%>
<%@page import="org.wdk.WDK"%>
<%@page import="org.wdk.module.auth.source.bean.TokenBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
BaseSessionUser su = WDK.getSessionUser(request, response);
if(null==su){
su = new BaseSessionUser();
}
String WDK_ROOT = WDKCore.WDK_ROOT;
String RSS_ROOT = WDK_ROOT +"/"+WDKConstant.Theme+"/"+WDKCore.THEME;
String commonURL = "/"+RSS_ROOT+"/module/public/common.jsp";
%>
<!DOCTYPE html>
<%@page import="org.wdk.WDKConstant"%>
<%@page import="org.wdk.WDKCore"%>
<html>
<head>
<base href="<%=basePath%>" target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page='<%=commonURL %>'></jsp:include>
<script type="text/javascript" src="<%=RSS_ROOT%>/core/js/wdk.js"></script>
<title>grid管理</title>
<script type="text/javascript">
<% if(null==su){%>
$.timeout();
<%}%>
var data_datatype = [
{'id':'0','text':'静态表头'},
{'id':'1','text':'动态表头'}
];
var _gridcode = "wdk.module.sys.gridgrid";
var _gridid = 'layout_grid';
window.onload = function(){
_gridid = $.grid({
containerid:_gridid,
gridcode:_gridcode,
fit: true,//自动大小
url:'wdk?action=wdk.public&method=grid_load&ajaxparam='+new Date().getTime(),
remoteSort:false,
queryParams:{},
idField:'gridcode',
editor:[
{
field : 'gridname',
editor : {
type : 'text'
}
},
{
field : 'datatype',
editor : {
type:'combobox',
options:{
data:data_datatype,
valueField:'id',
textField:'text'
}
}
},
{
field : 'datasource',
editor : {
type : 'text'
}
},
{
field : 'importhandler',
editor : {
type : 'text'
}
}
]
});
};
function _handler_click(type,mgcode){
switch(type){
case 'edit':
$.getRoot().tab_add({
menucode:'grid_field',
title:'GRID字段编辑',
url:'<%=WDK_ROOT%>/module/sys/grid_field.jsp?mgcode='+mgcode,
closable:true
});
break;
default:
break;
}
}
//新增一行
function _append(){
$("#dlg_gridcode").val('');
$("#dlg_gridname").val('');
$("#dlg_datatype").combobox('clear');
$("#dlg_datasource").val('');
$("#dlg_importhandler").val('');
$('#dlg').dialog('open');
}
function _addnew(){
$('#dlg').dialog('close');
/*var _data = [
{name:"gridcode",value:$("#dlg_gridcode").val()},
{name:"gridname",value:$("#dlg_gridname").val()}
];
*/
var _data = {
gridcode:$("#dlg_gridcode").val(),
gridname:$("#dlg_gridname").val(),
datatype:$("#dlg_datatype").combobox('getValue'),
datasource:$("#dlg_datasource").val(),
importhandler:$("#dlg_importhandler").val()
};
$.cuajax({
url: 'wdk?action=wdk.public&method=gridmanager_add&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
var jres = $.str2json(result);
$.grid_reload({id:_gridid});
alert(jres.desc);
},
error:function(result){
alert('网络错误!result='+result);
}
});
}
//删除一行
function _remove(){
$.grid_editor_remove({id:_gridid});
}
//结束编辑
function _ending(){
$.grid_editor_ending({id:_gridid});
}
//撤销修改
function _reject(){
$.grid_editor_reject({id:_gridid});
}
//保存提交
function _update(){
var jrows = $.grid_getData({id:_gridid});
//保存提交
var _data = {jrows:$.encode($.json2str(jrows))};
$.cuajax({
url: 'wdk?action=wdk.public&method=gridmanager_update&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
var jres = $.str2json(result);
alert(jres.desc);
$.grid_reload({id:_gridid});
},
error:function(result){
alert('网络错误!result='+result);
}
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true" style="padding:0px;margin:0px;background-color:#FF0000;">
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="overflow:hidden;border:1px solid #ddd;" >
</div>
<!-- <div id="layout_grid_toolbar" data-options="region:'north',border:false,collapsed:false" style="height:30px;overflow:hidden;border:1px solid #ddd;text-align:left;" >-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="_append()">新增</a>-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="_remove()">删除</a>-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true" onclick="_ending()">完成</a>-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" onclick="_reject()">撤销</a>-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="_update()">保存提交</a>-->
<!-- </div>-->
<!-- -->
<!-- <div id="dlg" class="easyui-dialog" style="width:350px;height:350px;padding:10px 10px" title="新增grid" closed="true" buttons="#dlg-buttons">-->
<!-- <table>-->
<!-- <tr>-->
<!-- <td> <label>表格标识:</label></td>-->
<!-- <td><input id="dlg_gridcode" name="dlg_gridcode" class="easyui-validatebox" style="width:200px" required="true"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>表格名称:</label></td>-->
<!-- <td><input id="dlg_gridname" name="dlg_gridname" class="easyui-validatebox" style="width:200px" required="true"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>数据类型:</label></td>-->
<!-- <td><input id="dlg_datatype" name="dlg_datatype" class="txt" style="width:200px"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>数据来源:</label></td>-->
<!-- <td><input id="dlg_datasource" name="dlg_datasource" class="txt" style="width:200px" ></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>导入处理类:</label></td>-->
<!-- <td><input id="dlg_importhandler" name="dlg_importhandler" class="txt" style="width:200px"></td>-->
<!-- </tr>-->
<!-- </table>-->
<!-- </div>-->
<!-- <div id="dlg-buttons">-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="_addnew()">确定</a>-->
<!-- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">关闭</a>-->
<!-- </div>-->
</body>
</html>