完全vue渲染列表的功能

去掉不必要的js函数定义
修改返回json的方式
This commit is contained in:
2021-03-15 06:12:12 +08:00
parent d795809fb3
commit 975be7cc91
135 changed files with 402 additions and 792 deletions
@@ -99,7 +99,6 @@ class CategoryController extends DefaultController
['text','product_category.id','ID'],
]);
$query = $search['query'];
$type = Request::get('type', 1);
if (Request::method() == 'POST') {
$model = ProductCategory::orderBy('lft', 'asc');
@@ -110,7 +109,7 @@ class CategoryController extends DefaultController
$data[] = $row;
}
$json = ['data' => $data];
return response()->json($json);
return $json;
}
return $this->render(array(
@@ -163,17 +163,10 @@ class ProductController extends DefaultController
if ($query['suggest']) {
$rows = $model->limit(15)->get();
$data = Grid::dataFilters($rows, $header, function($item) {
return $item;
});
$items['data'] = $data;
} else {
$rows = $model->paginate($query['limit']);
$items = Grid::dataFilters($rows, $header, function($item) {
return $item;
});
}
return response()->json($items);
return Grid::dataFilters($rows, $header);
}
return $this->render([
'search' => $search,
@@ -246,17 +239,10 @@ class ProductController extends DefaultController
if ($query['suggest']) {
$rows = $model->limit(15)->get();
$data = Grid::dataFilters($rows, $header, function($item) {
return $item;
});
$items['data'] = $data;
} else {
$rows = $model->paginate($query['limit']);
$items = Grid::dataFilters($rows, $header, function($item) {
return $item;
});
}
return response()->json($items);
return Grid::dataFilters($rows, $header);
}
return $this->render([
'search' => $search,
@@ -270,7 +256,7 @@ class ProductController extends DefaultController
$rows = $model->get(['*', 'name as text'])->toArray();
$rows = array_nest($rows);
$rows = array_merge($rows);
return response()->json(['data' => $rows]);
return ['data' => $rows];
}
}
@@ -94,7 +94,7 @@ class UnitController extends DefaultController
}
}
$rows = $model->get(['*', 'name as text']);
return response()->json(['data' => $rows]);
return ['data' => $rows];
}
return $this->render([
'search' => $search,
@@ -14,11 +14,6 @@
var action = config.action;
var search = config.search;
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var grid = new agGridOptions;
var gridDiv = document.querySelector("#{{$header['table']}}-grid");
@@ -83,11 +83,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var height = getPanelHeight(140);
var treeOptions = new agGridOptions();
treeOptions.rowSelection = 'single';
@@ -12,11 +12,6 @@
var config = gdoo.grids[table];
var action = config.action;
var search = config.search;
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['table']}}-grid");