继续重构模块列表前端样式

This commit is contained in:
2021-03-17 03:15:10 +08:00
parent 181fa17fdd
commit cd3a44340e
192 changed files with 3321 additions and 4596 deletions
+36 -24
View File
@@ -98,29 +98,6 @@ class Grid
}
}
$_header = $header;
unset($_header['columns']);
unset($_header['cols']);
unset($_header['dialogs']);
unset($_header['join']);
unset($_header['js']);
unset($_header['raw_select']);
unset($_header['search']);
unset($_header['select']);
// 重新组合字段给前端
$columns = [];
foreach ($header['cols'] as $field => $col) {
if ($field == 'action' && empty($col['events'])) {
continue;
}
if ($col['field'] == 'created_by') {
$col['formatter'] = 'created_by';
}
$columns[] = $col;
}
$_header['columns'] = $columns;
$header['runs'] = $runs;
$header['dialogs'] = $dialogs;
$header['regions'] = $regions;
@@ -136,10 +113,45 @@ class Grid
} else {
$ret = collect(['data' => $rows]);
}
$ret['header'] = $_header;
$ret['header'] = static::getColumns($header);
return $ret;
}
/**
* 重新组合字段(主要给前端使用)
*/
public static function getColumns($header)
{
$columns = [];
foreach ($header['cols'] as $field => $col) {
if ($field == 'action' && empty($col['events'])) {
continue;
}
if ($col['field'] == 'created_by') {
$col['formatter'] = 'created_by';
}
$columns[] = $col;
}
unset($header['cols']);
unset($header['dialogs']);
unset($header['join']);
unset($header['js']);
unset($header['raw_select']);
unset($header['search']);
unset($header['select']);
unset($header['runs']);
unset($header['regions']);
$header['columns'] = $columns;
if (empty($header['bill_uri'])) {
$header['bill_uri'] = Request::module().'/'.Request::controller();
}
return $header;
}
public static function dataFilter($item, $header, $callback = null)
{
$master_prefix = $header['master_prefix'];