完善角色组创建页面样式

This commit is contained in:
Wisp X
2022-01-21 14:36:17 +08:00
parent 84e9caeb71
commit ffc2895a6c
5 changed files with 209 additions and 216 deletions
+28 -4
View File
@@ -11,7 +11,32 @@ use Illuminate\View\View;
class GroupController extends Controller
{
protected array $extensions = ['jpeg', 'jpg', 'png', 'gif', 'tif', 'bmp', 'ico', 'psd', 'webp'];
public function __construct()
{
\Illuminate\Support\Facades\View::share([
'extensions' => ['jpeg', 'jpg', 'png', 'gif', 'tif', 'bmp', 'ico', 'psd', 'webp'],
'positions' => [
'top-left' => '左上角',
'top' => '上中',
'top-right' => '右上角',
'left' => '左边',
'center' => '中间',
'right' => '右边',
'bottom-left' => '左下角',
'bottom' => '下中',
'bottom-right' => '右下角',
'tiled' => '平铺',
],
'scanAliyunScenes' => [
'porn' => '智能鉴黄',
'terrorism' => '暴恐涉政',
'ad' => '暴恐涉政',
'qrcode' => '二维码',
'live' => '不良场景',
'logo' => 'Logo',
]
]);
}
public function index(Request $request): View
{
@@ -23,14 +48,13 @@ class GroupController extends Controller
public function add(): View
{
return view('admin.group.add', ['extensions' => $this->extensions]);
return view('admin.group.add');
}
public function edit(Request $request): View
{
$group = Group::query()->findOrFail($request->route('id'));
$extensions = $this->extensions;
return view('admin.group.edit', compact('group', 'extensions'));
return view('admin.group.edit', compact('group'));
}
public function create(): Response