去掉无用的模板文件

封装ajax提示方法
This commit is contained in:
2021-03-20 05:06:27 +08:00
parent bd9c315d7e
commit c564147f20
68 changed files with 664 additions and 21421 deletions
@@ -41,8 +41,20 @@ class DepartmentController extends DefaultController
'display' => $display['edit'],
]];
unset($cols['checkbox']);
unset($cols['seq_sn']);
unset($cols['name']);
$header['buttons'] = [
['name' => '删除','icon' => 'fa-remove','action' => 'delete','display' => $display['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['bys'] = Department::$bys;
//config.cols[0]['hide'] = true;
//config.cols[1]['hide'] = true;
$search = $header['search_form'];
$query = $search['query'];
@@ -62,21 +74,11 @@ class DepartmentController extends DefaultController
->addSelect(DB::raw('(select count(id) from [user] where department_id = department.id) as user_count'));
$items = $model->get()->toNested('name');
$items = Grid::dataFilters($items, $header, function($item) {
return Grid::dataFilters($items, $header, function($item) {
return $item;
});
return $this->json($items, true);
}
$header['buttons'] = [
['name' => '删除','icon' => 'fa-remove','action' => 'delete','display' => $display['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['bys'] = Department::$bys;
$header['js'] = Grid::js($header);
return $this->display([
'header' => $header,
]);
@@ -33,6 +33,13 @@ class GroupController extends DefaultController
'display' => $this->access['edit'],
]];
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$search = $header['search_form'];
$query = $search['query'];
@@ -55,13 +62,6 @@ class GroupController extends DefaultController
return Grid::dataFilters($rows, $header);
}
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['js'] = Grid::js($header);
return $this->display([
'header' => $header,
]);
+10 -11
View File
@@ -36,6 +36,16 @@ class MessageController extends Controller
'display' => 1,
]];
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => 1],
['action' => 'divider'],
['name' => '标记已读', 'icon' => '', 'action' => 'read', 'display' => 1],
['name' => '标记未读', 'icon' => '', 'action' => 'unread', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = Message::$tabs;
$header['bys'] = Message::$bys;
$search = $header['search_form'];
$query = $search['query'];
@@ -65,17 +75,6 @@ class MessageController extends Controller
return Grid::dataFilters($rows, $header);
}
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => 1],
['action' => 'divider'],
['name' => '标记已读', 'icon' => '', 'action' => 'read', 'display' => 1],
['name' => '标记未读', 'icon' => '', 'action' => 'unread', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = Message::$tabs;
$header['bys'] = Message::$bys;
$header['js'] = Grid::js($header);
return $this->display([
'header' => $header,
]);
@@ -33,6 +33,13 @@ class PositionController extends DefaultController
'display' => $this->access['edit'],
]];
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$search = $header['search_form'];
$query = $search['query'];
@@ -55,14 +62,6 @@ class PositionController extends DefaultController
return Grid::dataFilters($rows, $header);
}
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['js'] = Grid::js($header);
return $this->display([
'header' => $header,
]);
+6 -8
View File
@@ -60,6 +60,12 @@ class RoleController extends DefaultController
'display' => $this->access['edit'],
]];
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$search = $header['search_form'];
$query = $search['query'];
@@ -83,14 +89,6 @@ class RoleController extends DefaultController
return Grid::dataFilters($rows, $header);
}
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['bys'] = Role::$bys;
$header['js'] = Grid::js($header);
return $this->display([
'header' => $header,
]);
+22 -23
View File
@@ -41,15 +41,33 @@ class UserController extends DefaultController
}
$cols['actions']['options'] = [[
'name' => '显示',
'action' => 'show',
'name' => '显示',
'action' => 'show',
'display' => $this->access['show'],
],[
'name' => '编辑',
'action' => 'edit',
'name' => '编辑',
'action' => 'edit',
'display' => $this->access['edit'],
]];
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['left_buttons'] = [
['name' => '角色权限', 'color' => 'default', 'action' => 'user_role', 'display' => 1],
['name' => '仓库权限', 'color' => 'default', 'action' => 'user_warehouse', 'display' => 1],
];
$header['right_buttons'] = [
['name' => '导入', 'color' => 'default', 'icon' => 'fa-mail-reply', 'action' => 'import', 'display' => $this->access['import']],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['bys'] = User::$bys;
$search = $header['search_form'];
$query = $search['query'];
@@ -74,25 +92,6 @@ class UserController extends DefaultController
return Grid::dataFilters($rows, $header);
}
$header['buttons'] = [
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
];
$header['left_buttons'] = [
['name' => '角色权限', 'color' => 'default', 'action' => 'user_role', 'display' => 1],
['name' => '仓库权限', 'color' => 'default', 'action' => 'user_warehouse', 'display' => 1],
];
$header['right_buttons'] = [
['name' => '导入', 'color' => 'default', 'icon' => 'fa-mail-reply', 'action' => 'import', 'display' => $this->access['import']],
];
$header['cols'] = $cols;
$header['tabs'] = User::$tabs;
$header['bys'] = User::$bys;
$header['js'] = Grid::js($header);
return $this->display([
'header' => $header,
]);