完全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
@@ -92,7 +92,7 @@ class BusinessController extends DefaultController
$row['address'] = str_replace("\n", " ", $row['address']);
$attachments = AttachmentService::show($row['attachment']);
$row['attachments'] = $attachments['main'];
return response()->json($row);
return $row;
}
// 负责人列表
@@ -142,7 +142,7 @@ class ContactController extends DefaultController
$item['text'] = $item['name'];
return $item;
});
return response()->json($items);
return $items;
}
$query['form_id'] = $query['jqgrid'] == '' ? $query['id'] : $query['jqgrid'];
return $this->render([
@@ -102,7 +102,7 @@ class CustomerClassController extends DefaultController
}
}
$rows = $model->get();
return response()->json(['data' => $rows]);
return ['data' => $rows];
}
return $this->render([
'search' => $search
@@ -278,19 +278,14 @@ class CustomerController 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) {
$item['text'] = $item['name'];
$item['sid'] = 'u'.$item['user_id'];
return $item;
});
}
return response()->json($items);
return Grid::dataFilters($rows, $header, function($item) {
$item['text'] = $item['name'];
$item['sid'] = 'u'.$item['user_id'];
return $item;
});
}
return $this->render([
'search' => $search,
@@ -139,11 +139,7 @@ class DeliveryAddressController extends DefaultController
$model->select($header['select']);
$rows = $model->paginate($query['limit']);
if (isset($query['autocomplete'])) {
return response()->json($rows->items());
}
return response()->json($rows);
return $rows;
}
return $this->render([
'search' => $search,
@@ -140,7 +140,7 @@ class RegionController extends DefaultController
foreach($rows as $row) {
$json[] = $row;
}
return response()->json(['data' => $json]);
return ['data' => $json];
}
return $this->render([
'search' => $search
@@ -135,8 +135,7 @@ class TaxController extends AuditController
}
$model->select(['customer_tax.*','customer.code as customer_code', 'customer.name as customer_name']);
$rows = $model->paginate($query['limit']);
return response()->json($rows);
return $model->paginate($query['limit']);
}
return $this->render([
'search' => $search,
@@ -97,7 +97,7 @@ class TypeController extends DefaultController
}
}
$rows = $model->get(['*', 'name as text']);
return response()->json(['data' => $rows]);
return ['data' => $rows];
}
return $this->render([
'get' => Request::all()
@@ -49,7 +49,7 @@ class WidgetController extends DefaultController
$json['total'] = sizeof($rows);
$json['data'] = $rows;
return response()->json($json);
return $json;
}
return $this->render();
}
@@ -15,11 +15,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
gridDiv.style.height = getPanelHeight(48);
@@ -15,11 +15,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
gridDiv.style.height = getPanelHeight(48);
@@ -15,11 +15,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
action.priceEdit = function() {
var me = this;
var grid = config.grid;
@@ -15,11 +15,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
gridDiv.style.height = getPanelHeight(48);
@@ -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");
@@ -15,11 +15,6 @@
//action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
gridDiv.style.height = getPanelHeight(48);
@@ -14,11 +14,6 @@
var search = config.search;
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
@@ -12,14 +12,8 @@ var config = gdoo.grids[table];
var action = config.action;
var search = config.search;
(function ($) {
var options = new agGridOptions();
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
config.cols[0]['hide'] = true;
config.cols[1]['hide'] = true;
config.cols[2]['hide'] = true;
@@ -15,11 +15,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
gridDiv.style.height = getPanelHeight(48);
@@ -14,11 +14,6 @@
var search = config.search;
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
@@ -15,11 +15,6 @@
action.dialogType = 'layer';
// 自定义搜索方法
search.searchInit = function (e) {
var self = this;
}
var options = new agGridOptions();
var gridDiv = document.querySelector("#{{$header['master_table']}}-grid");
gridDiv.style.height = getPanelHeight(48);
@@ -13,11 +13,6 @@
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");
gridDiv.style.height = getPanelHeight(48);