- 注册时间
- 2020-11-5
- 最后登录
- 2021-2-8
- 阅读权限
- 10
- 积分
- 10
- 精华
- 0
- 帖子
- 3
|
本帖最后由 leijun_no1 于 2021-2-6 12:33 编辑
代码如下,请版主指点下。困惑了N久
<!DOCTYPE html>
<html>
<head>
<title>采购订单列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<style type="text/css">html{zoom :100%}</style><script>var IMG = "http://127.0.0.1";var FILE = "http://127.0.0.1/data";var ENV = "DEV";var EOVA_FORM = "";var EOVA_ZOOM = "100%";var EOVA_LOCAL = "zh_CN";</script>
<script src="/scripts/boot.js" type="text/javascript"></script><script src="/scripts/boot.js" type="text/javascript"></script>
<script src="/scripts/miniui/resource/datagrid/js/ColumnsMenu.js" type="text/javascript"></script>
<script src="/scripts/miniui/locale/zh_CN.js" type="text/javascript"></script>
<style type="text/css">
html,body
{
width:100%;
height:100%;
border:0;
margin:0;
padding:0;
overflow:visible;
}
</style>
</head>
<body>
<div class="mini-fit" >
<div class="mini-splitter" vertical="true" style="width:100%;height:100%;">
<div size="40%" showCollapseButton="true">
<a href="">111</a>
<div class="mini-fit" >
<table id="master_grid" lay-filter="master_grid"></table>
<div id="master_grid" class="mini-datagrid" style="width:100%;height:100%;"
allowCellEdit="false" allowCellSelect="true" allowResize="true" virtualScroll="true"
multiSelect="true">
</div>
<script>
// init param
var ID = "master_grid";
var PID = "";
//var $grid = $("#" + ID);
var $parentWidget;
if(PID != ""){
$parentWidget = $("#" + PID);
}
// 离线数据模式
var isData = false;
var menuCode = 'pur_order_vend_001';
var objectCode = 'purOrderHForVend';
var toolbar = 'master_grid_toolbar';// grid ref toolbar
var isPaging = eval('true');// is show pagination
var url = '';// diy grid load data url
var height = '';// diy grid load data url
var objectJson = '';// object is json
var fieldsJson = '';// fiedlds is json
var configJson = '';// config is json
//alert(objectCode);
//alert(JSON.stringify(objectJson));
if (url == '') {
url = '/grid/query/' + objectCode;
if(menuCode != ''){
url = url + '-' + menuCode;
}
}
var paras = $.getUrlParas();
// 自动传递所有参数
// 是否含有关联查询条件
if(paras && (paras.indexOf('query_') != -1 || paras.indexOf('filter_') != -1)){
url = url + '?' + paras;
}
// 初始化组件
EovaWidget.init(objectCode, objectJson, fieldsJson, configJson);
var config = EovaWidget.data.config,
object = EovaWidget.data.object,
fields = EovaWidget.data.fields;
// 当前对象是否允许初始加载数据
var isFirstLoad = false;
var isFirstLoadNow = eval('true');
// 必须当前业务和对象都允许加载数据
if(isFirstLoadNow && object.is_first_load){
isFirstLoad = true;
}
// 单元格编辑, 自定义开关
var cols = [];
// var validators = {};
// 构建其它列
//cols = $.table.buildColumn(object, fields, cols);
cols = $.table.buildMiniUIColumn(object, fields, cols);
// 构建首列
//cols = $.table.buildFirstColumn(object, fields, cols);
// 构建表头合并列
/*if(object.config){
cols = $.table.buildMergeColumn(object.config, cols);
} else {
cols = [cols];
}*/
var limit = isPaging ? 100 : 5000;
// 分页配置
/*if(object.config && object.config != ''){
var objectConfig = $.json.toObj(object.config);
if (objectConfig.limit) {
limit = objectConfig.limit;
}
}*/
//-------miniUI----table
mini.parse();
var grid = mini.get(ID);
grid.setColumns(cols);//设置列
grid.setUrl(url);
grid.load();
var menu = new ColumnsMenu(grid);
</script> </div>
</div>
<div size="40%" showCollapseButton="true">
<div id="editForm1" style="width:700px;position:relative;">
<a href="">222</a>
<div class="mini-tabs" style="width:100%;height:400px" activeIndex="0">
<div title="采购订单">
<div class="mini-fit" >
<table id="purOrderL_grid" lay-filter="purOrderL_grid"></table>
<div id="purOrderL_grid" class="mini-datagrid" style="width:100%;height:100%;"
allowCellEdit="false" allowCellSelect="true" allowResize="true" virtualScroll="true"
multiSelect="true">
</div>
<script>
// init param
var ID = "purOrderL_grid";
var PID = "master_grid";
//var $grid = $("#" + ID);
var $parentWidget;
if(PID != ""){
$parentWidget = $("#" + PID);
}
// 离线数据模式
var isData = false;
var menuCode = '';
var objectCode = 'purOrderL';
var toolbar = 'purOrderL_toolbar';// grid ref toolbar
var isPaging = eval('true');// is show pagination
var url = '';// diy grid load data url
var height = '';// diy grid load data url
var objectJson = '';// object is json
var fieldsJson = '';// fiedlds is json
var configJson = '';// config is json
//alert(objectCode);
//alert(JSON.stringify(objectJson));
if (url == '') {
url = '/grid/query/' + objectCode;
if(menuCode != ''){
url = url + '-' + menuCode;
}
}
var paras = $.getUrlParas();
// 自动传递所有参数
// 是否含有关联查询条件
if(paras && (paras.indexOf('query_') != -1 || paras.indexOf('filter_') != -1)){
url = url + '?' + paras;
}
// 初始化组件
EovaWidget.init(objectCode, objectJson, fieldsJson, configJson);
var config = EovaWidget.data.config,
object = EovaWidget.data.object,
fields = EovaWidget.data.fields;
// 当前对象是否允许初始加载数据
var isFirstLoad = false;
var isFirstLoadNow = eval('true');
// 必须当前业务和对象都允许加载数据
if(isFirstLoadNow && object.is_first_load){
isFirstLoad = true;
}
// 单元格编辑, 自定义开关
var cols = [];
// var validators = {};
// 构建其它列
//cols = $.table.buildColumn(object, fields, cols);
cols = $.table.buildMiniUIColumn(object, fields, cols);
// 构建首列
//cols = $.table.buildFirstColumn(object, fields, cols);
// 构建表头合并列
/*if(object.config){
cols = $.table.buildMergeColumn(object.config, cols);
} else {
cols = [cols];
}*/
var limit = isPaging ? 100 : 5000;
// 分页配置
/*if(object.config && object.config != ''){
var objectConfig = $.json.toObj(object.config);
if (objectConfig.limit) {
limit = objectConfig.limit;
}
}*/
//-------miniUI----table
mini.parse();
var grid = mini.get(ID);
grid.setColumns(cols);//设置列
grid.setUrl(url);
grid.load();
var menu = new ColumnsMenu(grid);
</script> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
|
|