From 98e797948dc124bc1906c727e697febe4845d536 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Wed, 2 Nov 2022 11:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=8B=E6=83=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FriendLinkController.php | 132 +++++ app/Admin/bootstrap.php | 51 +- app/Admin/routes.php | 2 + app/Http/Controllers/FriendLinkController.php | 19 + app/Http/Resources/FriendLinkResource.php | 26 + app/ModelFilters/FriendLinkFilter.php | 26 + app/Models/FriendLink.php | 52 ++ ...11_01_100721_create_friend_links_table.php | 37 ++ dcat_admin_ide_helper.php | 529 ++++++++++++++++++ lang/zh_CN/friend-link.php | 17 + routes/api.php | 3 + 11 files changed, 893 insertions(+), 1 deletion(-) create mode 100644 app/Admin/Controllers/FriendLinkController.php create mode 100644 app/Http/Controllers/FriendLinkController.php create mode 100644 app/Http/Resources/FriendLinkResource.php create mode 100644 app/ModelFilters/FriendLinkFilter.php create mode 100644 app/Models/FriendLink.php create mode 100644 database/migrations/2022_11_01_100721_create_friend_links_table.php create mode 100644 dcat_admin_ide_helper.php create mode 100644 lang/zh_CN/friend-link.php diff --git a/app/Admin/Controllers/FriendLinkController.php b/app/Admin/Controllers/FriendLinkController.php new file mode 100644 index 0000000..4ee46eb --- /dev/null +++ b/app/Admin/Controllers/FriendLinkController.php @@ -0,0 +1,132 @@ +column('id')->sortable(); + $grid->column('name'); + $grid->column('type')->display(function(){ + return $this->typeLabel(); + }); + // $grid->column('content'); + $grid->column('sort'); + $grid->column('is_recommend')->switch(); + $grid->column('is_show')->switch(); + $grid->column('created_at')->sortable(); + // $grid->column('updated_at')->sortable(); + + $grid->model()->orderBy('sort', 'desc')->orderBy('created_at', 'desc'); + + $grid->showCreateButton(! config('admin.permission.enable') || Admin::user()->can('dcat.admin.friend_links.create')); + $grid->showQuickEditButton(! config('admin.permission.enable') || Admin::user()->can('dcat.admin.friend_links.edit')); + $grid->showDeleteButton(! config('admin.permission.enable') || Admin::user()->can('dcat.admin.friend_links.destroy')); + + $grid->filter(function (Grid\Filter $filter) { + $filter->like('name')->width(3); + + }); + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new FriendLink(), function (Form $form) { + $form->display('id'); + $form->text('name'); + $form->radio('type') + ->options(FriendLink::typeMap()) + ->default(FriendLink::TYPE_LINK) + ->when(FriendLink::TYPE_LINK, function($form){ + $form->text('content_1', '内容')->customFormat(function () { + if ($this->model()->type == FriendLink::TYPE_LINK) { + return $this->model()->content; + } else { + return ''; + } + }); + }) + ->when(FriendLink::TYPE_VIDEO, function($form){ + $form->file('content_2', '内容')->chunked() + ->accept('mp4', 'mp4/*') + ->move('friend-link/'.Carbon::now()->toDateString()) + ->maxSize(204800)//默认最大200M + ->saveFullUrl() + ->removable(false) + ->autoUpload()->autoSave(false)->customFormat(function () { + if ($this->model()->type == FriendLink::TYPE_VIDEO) { + return $this->model()->content; + } else { + return ''; + }; + }); + }) + ->when(FriendLink::TYPE_ARTICLE, function($form){ + $form->editor('content_3', '内容')->options([ + 'plugins' => [ + 'image', + 'lists', + 'preview', + 'fullscreen', + 'table', + ], + 'toolbar' => [ + 'undo redo | preview fullscreen | styleselect | fontsizeselect bold italic underline strikethrough forecolor backcolor | image blockquote removeformat codesample', + 'alignleft aligncenter alignright alignjustify| indent outdent bullist numlist table subscript superscript | code', + ], + ])->height('300')->customFormat(function () { + if ($this->model()->type == FriendLink::TYPE_ARTICLE) { + return $this->model()->content; + } else { + return ''; + } + }); + Admin::style( + <<<'css' + .tox.tox-silver-sink.tox-tinymce-aux{ + z-index:99999999; + } + css + ); + }); + $form->hidden('content'); + + $form->number('sort'); + $form->switch('is_recommend'); + $form->switch('is_show'); + + $form->saving(function ($form) { + $content = 'content_'.$form->type; + $form->content = $form->$content; + + $form->deleteInput('content_1'); + $form->deleteInput('content_2'); + $form->deleteInput('content_3'); + }); + + $form->display('created_at'); + $form->display('updated_at'); + }); + } +} diff --git a/app/Admin/bootstrap.php b/app/Admin/bootstrap.php index 9b4bfba..01497bd 100644 --- a/app/Admin/bootstrap.php +++ b/app/Admin/bootstrap.php @@ -1,7 +1,9 @@ disableRowSelector(); + $grid->disableCreateButton(); + $grid->disableViewButton(); + $grid->disableEditButton(); + $grid->disableDeleteButton(); + $grid->enableDialogCreate(); + + $grid->setDialogFormDimensions('50%', '70%'); + + // $grid->scrollbarX(); + // $grid->fixColumns(0, -1); + + $grid->filter(function (Grid\Filter $filter) { + $filter->panel(); + $filter->expand(); + }); +}); + +Show::resolving(function (Show $show) { + $show->panel() + ->tools(function ($tools) { + $tools->disableEdit(); + // $tools->disableList(); + $tools->disableDelete(); + }); +}); + +Form::resolving(function (Form $form) { + $form->disableViewButton(); + $form->disableViewCheck(); + $form->disableResetButton(); +}); + +Admin::style( + <<<'CSS' +.main-footer { +display: none; +} +.layui-layer-nobg{ + max-width: 800px; + max-height: 1100px; +} +CSS); diff --git a/app/Admin/routes.php b/app/Admin/routes.php index 02d4706..9958f16 100644 --- a/app/Admin/routes.php +++ b/app/Admin/routes.php @@ -12,4 +12,6 @@ Route::group([ 'middleware' => config('admin.route.middleware'), ], function (Router $router) { $router->get('/', 'HomeController@index'); + + $router->resource('friend-links', 'FriendLinkController')->names('friend_links'); }); diff --git a/app/Http/Controllers/FriendLinkController.php b/app/Http/Controllers/FriendLinkController.php new file mode 100644 index 0000000..b3f378c --- /dev/null +++ b/app/Http/Controllers/FriendLinkController.php @@ -0,0 +1,19 @@ +all()); + + $list = $query->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50)); + + return $this->json(FriendLinkResource::collection($list)); + } +} diff --git a/app/Http/Resources/FriendLinkResource.php b/app/Http/Resources/FriendLinkResource.php new file mode 100644 index 0000000..0d395f3 --- /dev/null +++ b/app/Http/Resources/FriendLinkResource.php @@ -0,0 +1,26 @@ + $this->id, + 'name' => $this->name, + 'type' => $this->type, + 'content' => $this->content, + 'sort' => $this->sort, + 'created_at' => strtotime($this->created_at) ?? 0, //录入时间 + ]; + } +} diff --git a/app/ModelFilters/FriendLinkFilter.php b/app/ModelFilters/FriendLinkFilter.php new file mode 100644 index 0000000..7be1a98 --- /dev/null +++ b/app/ModelFilters/FriendLinkFilter.php @@ -0,0 +1,26 @@ +where('name', 'like', $name.'%'); + } + + public function type($type) + { + return $this->where('type', $type); + } + + public function recommend($recommend){ + return $this->where('is_recommend', $recommend); + } + + public function show($show){ + return $this->where('is_show', $show); + } +} diff --git a/app/Models/FriendLink.php b/app/Models/FriendLink.php new file mode 100644 index 0000000..5d503a5 --- /dev/null +++ b/app/Models/FriendLink.php @@ -0,0 +1,52 @@ + '链接', + self::TYPE_VIDEO => '视频', + self::TYPE_ARTICLE => '文章' + ]; + } + + public function typeLabel() + { + $color = match ($this->type) { + static::TYPE_LINK => 'green', + static::TYPE_VIDEO => 'primary', + static::TYPE_ARTICLE => 'warning' + }; + + $background = Admin::color()->get($color, $color); + + $name = static::typeMap()[$this->type] ?? '未知'; + + return "{$name}"; + } + + public function scopeSort($q){ + return $q->orderBy('sort', 'desc')->orderBy('created_at', 'desc'); + } +} diff --git a/database/migrations/2022_11_01_100721_create_friend_links_table.php b/database/migrations/2022_11_01_100721_create_friend_links_table.php new file mode 100644 index 0000000..4b0804e --- /dev/null +++ b/database/migrations/2022_11_01_100721_create_friend_links_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('name')->comment('名称'); + $table->unsignedTinyInteger('type')->comment('类型:1友链,2视频,3文章'); + $table->text('content')->nullable()->comment('内容'); + $table->unsignedInteger('sort')->default(0)->comment('排序'); + $table->unsignedTinyInteger('is_recommend')->default(0)->comment('推荐'); + $table->unsignedInteger('is_show')->default(0)->comment('显示'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('friend_links'); + } +}; diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php new file mode 100644 index 0000000..f08b661 --- /dev/null +++ b/dcat_admin_ide_helper.php @@ -0,0 +1,529 @@ + + */ +namespace Dcat\Admin { + use Illuminate\Support\Collection; + + /** + * @property Grid\Column|Collection id + * @property Grid\Column|Collection name + * @property Grid\Column|Collection type + * @property Grid\Column|Collection version + * @property Grid\Column|Collection detail + * @property Grid\Column|Collection created_at + * @property Grid\Column|Collection updated_at + * @property Grid\Column|Collection is_enabled + * @property Grid\Column|Collection parent_id + * @property Grid\Column|Collection order + * @property Grid\Column|Collection icon + * @property Grid\Column|Collection uri + * @property Grid\Column|Collection extension + * @property Grid\Column|Collection permission_id + * @property Grid\Column|Collection menu_id + * @property Grid\Column|Collection slug + * @property Grid\Column|Collection http_method + * @property Grid\Column|Collection http_path + * @property Grid\Column|Collection role_id + * @property Grid\Column|Collection user_id + * @property Grid\Column|Collection value + * @property Grid\Column|Collection base_id + * @property Grid\Column|Collection username + * @property Grid\Column|Collection password + * @property Grid\Column|Collection avatar + * @property Grid\Column|Collection remember_token + * @property Grid\Column|Collection department + * @property Grid\Column|Collection phone + * @property Grid\Column|Collection status + * @property Grid\Column|Collection is_enable + * @property Grid\Column|Collection person + * @property Grid\Column|Collection address + * @property Grid\Column|Collection address_lat + * @property Grid\Column|Collection address_lng + * @property Grid\Column|Collection map + * @property Grid\Column|Collection areas + * @property Grid\Column|Collection workforce + * @property Grid\Column|Collection crop_id + * @property Grid\Column|Collection flow_name + * @property Grid\Column|Collection time_year + * @property Grid\Column|Collection sale + * @property Grid\Column|Collection created_by + * @property Grid\Column|Collection updated_by + * @property Grid\Column|Collection crops_cate_id + * @property Grid\Column|Collection crops_output + * @property Grid\Column|Collection yield + * @property Grid\Column|Collection cultivated + * @property Grid\Column|Collection output + * @property Grid\Column|Collection quarter + * @property Grid\Column|Collection category_id + * @property Grid\Column|Collection crop_type + * @property Grid\Column|Collection path + * @property Grid\Column|Collection is_end + * @property Grid\Column|Collection unit + * @property Grid\Column|Collection sort + * @property Grid\Column|Collection extends + * @property Grid\Column|Collection device_id + * @property Grid\Column|Collection lv + * @property Grid\Column|Collection content + * @property Grid\Column|Collection remarks + * @property Grid\Column|Collection linkos_device_id + * @property Grid\Column|Collection linkos_reported_at + * @property Grid\Column|Collection agricultural_base_id + * @property Grid\Column|Collection sn + * @property Grid\Column|Collection monitoring_point + * @property Grid\Column|Collection uuid + * @property Grid\Column|Collection connection + * @property Grid\Column|Collection queue + * @property Grid\Column|Collection payload + * @property Grid\Column|Collection exception + * @property Grid\Column|Collection failed_at + * @property Grid\Column|Collection is_recommend + * @property Grid\Column|Collection is_show + * @property Grid\Column|Collection key + * @property Grid\Column|Collection type_key + * @property Grid\Column|Collection level + * @property Grid\Column|Collection device_unit + * @property Grid\Column|Collection device_category + * @property Grid\Column|Collection data + * @property Grid\Column|Collection reported_at + * @property Grid\Column|Collection wind_speed + * @property Grid\Column|Collection wind_direction + * @property Grid\Column|Collection wind_degree + * @property Grid\Column|Collection air_humidity + * @property Grid\Column|Collection air_temperature + * @property Grid\Column|Collection air_pressure + * @property Grid\Column|Collection co2 + * @property Grid\Column|Collection noise + * @property Grid\Column|Collection illumination + * @property Grid\Column|Collection daily_rainfall + * @property Grid\Column|Collection pm25 + * @property Grid\Column|Collection pm10 + * @property Grid\Column|Collection monitored_at + * @property Grid\Column|Collection wind_power + * @property Grid\Column|Collection accumulated_rainfall + * @property Grid\Column|Collection current_rainfall + * @property Grid\Column|Collection moment_rainfall + * @property Grid\Column|Collection email + * @property Grid\Column|Collection token + * @property Grid\Column|Collection tokenable_type + * @property Grid\Column|Collection tokenable_id + * @property Grid\Column|Collection abilities + * @property Grid\Column|Collection last_used_at + * @property Grid\Column|Collection expires_at + * @property Grid\Column|Collection year + * @property Grid\Column|Collection area + * @property Grid\Column|Collection product_output + * @property Grid\Column|Collection product_value + * @property Grid\Column|Collection price + * @property Grid\Column|Collection conductivity + * @property Grid\Column|Collection humidity + * @property Grid\Column|Collection temperature + * @property Grid\Column|Collection n + * @property Grid\Column|Collection p + * @property Grid\Column|Collection k + * @property Grid\Column|Collection email_verified_at + * @property Grid\Column|Collection chlorine + * @property Grid\Column|Collection oxygen + * @property Grid\Column|Collection ph + * @property Grid\Column|Collection turbidity + * + * @method Grid\Column|Collection id(string $label = null) + * @method Grid\Column|Collection name(string $label = null) + * @method Grid\Column|Collection type(string $label = null) + * @method Grid\Column|Collection version(string $label = null) + * @method Grid\Column|Collection detail(string $label = null) + * @method Grid\Column|Collection created_at(string $label = null) + * @method Grid\Column|Collection updated_at(string $label = null) + * @method Grid\Column|Collection is_enabled(string $label = null) + * @method Grid\Column|Collection parent_id(string $label = null) + * @method Grid\Column|Collection order(string $label = null) + * @method Grid\Column|Collection icon(string $label = null) + * @method Grid\Column|Collection uri(string $label = null) + * @method Grid\Column|Collection extension(string $label = null) + * @method Grid\Column|Collection permission_id(string $label = null) + * @method Grid\Column|Collection menu_id(string $label = null) + * @method Grid\Column|Collection slug(string $label = null) + * @method Grid\Column|Collection http_method(string $label = null) + * @method Grid\Column|Collection http_path(string $label = null) + * @method Grid\Column|Collection role_id(string $label = null) + * @method Grid\Column|Collection user_id(string $label = null) + * @method Grid\Column|Collection value(string $label = null) + * @method Grid\Column|Collection base_id(string $label = null) + * @method Grid\Column|Collection username(string $label = null) + * @method Grid\Column|Collection password(string $label = null) + * @method Grid\Column|Collection avatar(string $label = null) + * @method Grid\Column|Collection remember_token(string $label = null) + * @method Grid\Column|Collection department(string $label = null) + * @method Grid\Column|Collection phone(string $label = null) + * @method Grid\Column|Collection status(string $label = null) + * @method Grid\Column|Collection is_enable(string $label = null) + * @method Grid\Column|Collection person(string $label = null) + * @method Grid\Column|Collection address(string $label = null) + * @method Grid\Column|Collection address_lat(string $label = null) + * @method Grid\Column|Collection address_lng(string $label = null) + * @method Grid\Column|Collection map(string $label = null) + * @method Grid\Column|Collection areas(string $label = null) + * @method Grid\Column|Collection workforce(string $label = null) + * @method Grid\Column|Collection crop_id(string $label = null) + * @method Grid\Column|Collection flow_name(string $label = null) + * @method Grid\Column|Collection time_year(string $label = null) + * @method Grid\Column|Collection sale(string $label = null) + * @method Grid\Column|Collection created_by(string $label = null) + * @method Grid\Column|Collection updated_by(string $label = null) + * @method Grid\Column|Collection crops_cate_id(string $label = null) + * @method Grid\Column|Collection crops_output(string $label = null) + * @method Grid\Column|Collection yield(string $label = null) + * @method Grid\Column|Collection cultivated(string $label = null) + * @method Grid\Column|Collection output(string $label = null) + * @method Grid\Column|Collection quarter(string $label = null) + * @method Grid\Column|Collection category_id(string $label = null) + * @method Grid\Column|Collection crop_type(string $label = null) + * @method Grid\Column|Collection path(string $label = null) + * @method Grid\Column|Collection is_end(string $label = null) + * @method Grid\Column|Collection unit(string $label = null) + * @method Grid\Column|Collection sort(string $label = null) + * @method Grid\Column|Collection extends(string $label = null) + * @method Grid\Column|Collection device_id(string $label = null) + * @method Grid\Column|Collection lv(string $label = null) + * @method Grid\Column|Collection content(string $label = null) + * @method Grid\Column|Collection remarks(string $label = null) + * @method Grid\Column|Collection linkos_device_id(string $label = null) + * @method Grid\Column|Collection linkos_reported_at(string $label = null) + * @method Grid\Column|Collection agricultural_base_id(string $label = null) + * @method Grid\Column|Collection sn(string $label = null) + * @method Grid\Column|Collection monitoring_point(string $label = null) + * @method Grid\Column|Collection uuid(string $label = null) + * @method Grid\Column|Collection connection(string $label = null) + * @method Grid\Column|Collection queue(string $label = null) + * @method Grid\Column|Collection payload(string $label = null) + * @method Grid\Column|Collection exception(string $label = null) + * @method Grid\Column|Collection failed_at(string $label = null) + * @method Grid\Column|Collection is_recommend(string $label = null) + * @method Grid\Column|Collection is_show(string $label = null) + * @method Grid\Column|Collection key(string $label = null) + * @method Grid\Column|Collection type_key(string $label = null) + * @method Grid\Column|Collection level(string $label = null) + * @method Grid\Column|Collection device_unit(string $label = null) + * @method Grid\Column|Collection device_category(string $label = null) + * @method Grid\Column|Collection data(string $label = null) + * @method Grid\Column|Collection reported_at(string $label = null) + * @method Grid\Column|Collection wind_speed(string $label = null) + * @method Grid\Column|Collection wind_direction(string $label = null) + * @method Grid\Column|Collection wind_degree(string $label = null) + * @method Grid\Column|Collection air_humidity(string $label = null) + * @method Grid\Column|Collection air_temperature(string $label = null) + * @method Grid\Column|Collection air_pressure(string $label = null) + * @method Grid\Column|Collection co2(string $label = null) + * @method Grid\Column|Collection noise(string $label = null) + * @method Grid\Column|Collection illumination(string $label = null) + * @method Grid\Column|Collection daily_rainfall(string $label = null) + * @method Grid\Column|Collection pm25(string $label = null) + * @method Grid\Column|Collection pm10(string $label = null) + * @method Grid\Column|Collection monitored_at(string $label = null) + * @method Grid\Column|Collection wind_power(string $label = null) + * @method Grid\Column|Collection accumulated_rainfall(string $label = null) + * @method Grid\Column|Collection current_rainfall(string $label = null) + * @method Grid\Column|Collection moment_rainfall(string $label = null) + * @method Grid\Column|Collection email(string $label = null) + * @method Grid\Column|Collection token(string $label = null) + * @method Grid\Column|Collection tokenable_type(string $label = null) + * @method Grid\Column|Collection tokenable_id(string $label = null) + * @method Grid\Column|Collection abilities(string $label = null) + * @method Grid\Column|Collection last_used_at(string $label = null) + * @method Grid\Column|Collection expires_at(string $label = null) + * @method Grid\Column|Collection year(string $label = null) + * @method Grid\Column|Collection area(string $label = null) + * @method Grid\Column|Collection product_output(string $label = null) + * @method Grid\Column|Collection product_value(string $label = null) + * @method Grid\Column|Collection price(string $label = null) + * @method Grid\Column|Collection conductivity(string $label = null) + * @method Grid\Column|Collection humidity(string $label = null) + * @method Grid\Column|Collection temperature(string $label = null) + * @method Grid\Column|Collection n(string $label = null) + * @method Grid\Column|Collection p(string $label = null) + * @method Grid\Column|Collection k(string $label = null) + * @method Grid\Column|Collection email_verified_at(string $label = null) + * @method Grid\Column|Collection chlorine(string $label = null) + * @method Grid\Column|Collection oxygen(string $label = null) + * @method Grid\Column|Collection ph(string $label = null) + * @method Grid\Column|Collection turbidity(string $label = null) + */ + class Grid {} + + class MiniGrid extends Grid {} + + /** + * @property Show\Field|Collection id + * @property Show\Field|Collection name + * @property Show\Field|Collection type + * @property Show\Field|Collection version + * @property Show\Field|Collection detail + * @property Show\Field|Collection created_at + * @property Show\Field|Collection updated_at + * @property Show\Field|Collection is_enabled + * @property Show\Field|Collection parent_id + * @property Show\Field|Collection order + * @property Show\Field|Collection icon + * @property Show\Field|Collection uri + * @property Show\Field|Collection extension + * @property Show\Field|Collection permission_id + * @property Show\Field|Collection menu_id + * @property Show\Field|Collection slug + * @property Show\Field|Collection http_method + * @property Show\Field|Collection http_path + * @property Show\Field|Collection role_id + * @property Show\Field|Collection user_id + * @property Show\Field|Collection value + * @property Show\Field|Collection base_id + * @property Show\Field|Collection username + * @property Show\Field|Collection password + * @property Show\Field|Collection avatar + * @property Show\Field|Collection remember_token + * @property Show\Field|Collection department + * @property Show\Field|Collection phone + * @property Show\Field|Collection status + * @property Show\Field|Collection is_enable + * @property Show\Field|Collection person + * @property Show\Field|Collection address + * @property Show\Field|Collection address_lat + * @property Show\Field|Collection address_lng + * @property Show\Field|Collection map + * @property Show\Field|Collection areas + * @property Show\Field|Collection workforce + * @property Show\Field|Collection crop_id + * @property Show\Field|Collection flow_name + * @property Show\Field|Collection time_year + * @property Show\Field|Collection sale + * @property Show\Field|Collection created_by + * @property Show\Field|Collection updated_by + * @property Show\Field|Collection crops_cate_id + * @property Show\Field|Collection crops_output + * @property Show\Field|Collection yield + * @property Show\Field|Collection cultivated + * @property Show\Field|Collection output + * @property Show\Field|Collection quarter + * @property Show\Field|Collection category_id + * @property Show\Field|Collection crop_type + * @property Show\Field|Collection path + * @property Show\Field|Collection is_end + * @property Show\Field|Collection unit + * @property Show\Field|Collection sort + * @property Show\Field|Collection extends + * @property Show\Field|Collection device_id + * @property Show\Field|Collection lv + * @property Show\Field|Collection content + * @property Show\Field|Collection remarks + * @property Show\Field|Collection linkos_device_id + * @property Show\Field|Collection linkos_reported_at + * @property Show\Field|Collection agricultural_base_id + * @property Show\Field|Collection sn + * @property Show\Field|Collection monitoring_point + * @property Show\Field|Collection uuid + * @property Show\Field|Collection connection + * @property Show\Field|Collection queue + * @property Show\Field|Collection payload + * @property Show\Field|Collection exception + * @property Show\Field|Collection failed_at + * @property Show\Field|Collection is_recommend + * @property Show\Field|Collection is_show + * @property Show\Field|Collection key + * @property Show\Field|Collection type_key + * @property Show\Field|Collection level + * @property Show\Field|Collection device_unit + * @property Show\Field|Collection device_category + * @property Show\Field|Collection data + * @property Show\Field|Collection reported_at + * @property Show\Field|Collection wind_speed + * @property Show\Field|Collection wind_direction + * @property Show\Field|Collection wind_degree + * @property Show\Field|Collection air_humidity + * @property Show\Field|Collection air_temperature + * @property Show\Field|Collection air_pressure + * @property Show\Field|Collection co2 + * @property Show\Field|Collection noise + * @property Show\Field|Collection illumination + * @property Show\Field|Collection daily_rainfall + * @property Show\Field|Collection pm25 + * @property Show\Field|Collection pm10 + * @property Show\Field|Collection monitored_at + * @property Show\Field|Collection wind_power + * @property Show\Field|Collection accumulated_rainfall + * @property Show\Field|Collection current_rainfall + * @property Show\Field|Collection moment_rainfall + * @property Show\Field|Collection email + * @property Show\Field|Collection token + * @property Show\Field|Collection tokenable_type + * @property Show\Field|Collection tokenable_id + * @property Show\Field|Collection abilities + * @property Show\Field|Collection last_used_at + * @property Show\Field|Collection expires_at + * @property Show\Field|Collection year + * @property Show\Field|Collection area + * @property Show\Field|Collection product_output + * @property Show\Field|Collection product_value + * @property Show\Field|Collection price + * @property Show\Field|Collection conductivity + * @property Show\Field|Collection humidity + * @property Show\Field|Collection temperature + * @property Show\Field|Collection n + * @property Show\Field|Collection p + * @property Show\Field|Collection k + * @property Show\Field|Collection email_verified_at + * @property Show\Field|Collection chlorine + * @property Show\Field|Collection oxygen + * @property Show\Field|Collection ph + * @property Show\Field|Collection turbidity + * + * @method Show\Field|Collection id(string $label = null) + * @method Show\Field|Collection name(string $label = null) + * @method Show\Field|Collection type(string $label = null) + * @method Show\Field|Collection version(string $label = null) + * @method Show\Field|Collection detail(string $label = null) + * @method Show\Field|Collection created_at(string $label = null) + * @method Show\Field|Collection updated_at(string $label = null) + * @method Show\Field|Collection is_enabled(string $label = null) + * @method Show\Field|Collection parent_id(string $label = null) + * @method Show\Field|Collection order(string $label = null) + * @method Show\Field|Collection icon(string $label = null) + * @method Show\Field|Collection uri(string $label = null) + * @method Show\Field|Collection extension(string $label = null) + * @method Show\Field|Collection permission_id(string $label = null) + * @method Show\Field|Collection menu_id(string $label = null) + * @method Show\Field|Collection slug(string $label = null) + * @method Show\Field|Collection http_method(string $label = null) + * @method Show\Field|Collection http_path(string $label = null) + * @method Show\Field|Collection role_id(string $label = null) + * @method Show\Field|Collection user_id(string $label = null) + * @method Show\Field|Collection value(string $label = null) + * @method Show\Field|Collection base_id(string $label = null) + * @method Show\Field|Collection username(string $label = null) + * @method Show\Field|Collection password(string $label = null) + * @method Show\Field|Collection avatar(string $label = null) + * @method Show\Field|Collection remember_token(string $label = null) + * @method Show\Field|Collection department(string $label = null) + * @method Show\Field|Collection phone(string $label = null) + * @method Show\Field|Collection status(string $label = null) + * @method Show\Field|Collection is_enable(string $label = null) + * @method Show\Field|Collection person(string $label = null) + * @method Show\Field|Collection address(string $label = null) + * @method Show\Field|Collection address_lat(string $label = null) + * @method Show\Field|Collection address_lng(string $label = null) + * @method Show\Field|Collection map(string $label = null) + * @method Show\Field|Collection areas(string $label = null) + * @method Show\Field|Collection workforce(string $label = null) + * @method Show\Field|Collection crop_id(string $label = null) + * @method Show\Field|Collection flow_name(string $label = null) + * @method Show\Field|Collection time_year(string $label = null) + * @method Show\Field|Collection sale(string $label = null) + * @method Show\Field|Collection created_by(string $label = null) + * @method Show\Field|Collection updated_by(string $label = null) + * @method Show\Field|Collection crops_cate_id(string $label = null) + * @method Show\Field|Collection crops_output(string $label = null) + * @method Show\Field|Collection yield(string $label = null) + * @method Show\Field|Collection cultivated(string $label = null) + * @method Show\Field|Collection output(string $label = null) + * @method Show\Field|Collection quarter(string $label = null) + * @method Show\Field|Collection category_id(string $label = null) + * @method Show\Field|Collection crop_type(string $label = null) + * @method Show\Field|Collection path(string $label = null) + * @method Show\Field|Collection is_end(string $label = null) + * @method Show\Field|Collection unit(string $label = null) + * @method Show\Field|Collection sort(string $label = null) + * @method Show\Field|Collection extends(string $label = null) + * @method Show\Field|Collection device_id(string $label = null) + * @method Show\Field|Collection lv(string $label = null) + * @method Show\Field|Collection content(string $label = null) + * @method Show\Field|Collection remarks(string $label = null) + * @method Show\Field|Collection linkos_device_id(string $label = null) + * @method Show\Field|Collection linkos_reported_at(string $label = null) + * @method Show\Field|Collection agricultural_base_id(string $label = null) + * @method Show\Field|Collection sn(string $label = null) + * @method Show\Field|Collection monitoring_point(string $label = null) + * @method Show\Field|Collection uuid(string $label = null) + * @method Show\Field|Collection connection(string $label = null) + * @method Show\Field|Collection queue(string $label = null) + * @method Show\Field|Collection payload(string $label = null) + * @method Show\Field|Collection exception(string $label = null) + * @method Show\Field|Collection failed_at(string $label = null) + * @method Show\Field|Collection is_recommend(string $label = null) + * @method Show\Field|Collection is_show(string $label = null) + * @method Show\Field|Collection key(string $label = null) + * @method Show\Field|Collection type_key(string $label = null) + * @method Show\Field|Collection level(string $label = null) + * @method Show\Field|Collection device_unit(string $label = null) + * @method Show\Field|Collection device_category(string $label = null) + * @method Show\Field|Collection data(string $label = null) + * @method Show\Field|Collection reported_at(string $label = null) + * @method Show\Field|Collection wind_speed(string $label = null) + * @method Show\Field|Collection wind_direction(string $label = null) + * @method Show\Field|Collection wind_degree(string $label = null) + * @method Show\Field|Collection air_humidity(string $label = null) + * @method Show\Field|Collection air_temperature(string $label = null) + * @method Show\Field|Collection air_pressure(string $label = null) + * @method Show\Field|Collection co2(string $label = null) + * @method Show\Field|Collection noise(string $label = null) + * @method Show\Field|Collection illumination(string $label = null) + * @method Show\Field|Collection daily_rainfall(string $label = null) + * @method Show\Field|Collection pm25(string $label = null) + * @method Show\Field|Collection pm10(string $label = null) + * @method Show\Field|Collection monitored_at(string $label = null) + * @method Show\Field|Collection wind_power(string $label = null) + * @method Show\Field|Collection accumulated_rainfall(string $label = null) + * @method Show\Field|Collection current_rainfall(string $label = null) + * @method Show\Field|Collection moment_rainfall(string $label = null) + * @method Show\Field|Collection email(string $label = null) + * @method Show\Field|Collection token(string $label = null) + * @method Show\Field|Collection tokenable_type(string $label = null) + * @method Show\Field|Collection tokenable_id(string $label = null) + * @method Show\Field|Collection abilities(string $label = null) + * @method Show\Field|Collection last_used_at(string $label = null) + * @method Show\Field|Collection expires_at(string $label = null) + * @method Show\Field|Collection year(string $label = null) + * @method Show\Field|Collection area(string $label = null) + * @method Show\Field|Collection product_output(string $label = null) + * @method Show\Field|Collection product_value(string $label = null) + * @method Show\Field|Collection price(string $label = null) + * @method Show\Field|Collection conductivity(string $label = null) + * @method Show\Field|Collection humidity(string $label = null) + * @method Show\Field|Collection temperature(string $label = null) + * @method Show\Field|Collection n(string $label = null) + * @method Show\Field|Collection p(string $label = null) + * @method Show\Field|Collection k(string $label = null) + * @method Show\Field|Collection email_verified_at(string $label = null) + * @method Show\Field|Collection chlorine(string $label = null) + * @method Show\Field|Collection oxygen(string $label = null) + * @method Show\Field|Collection ph(string $label = null) + * @method Show\Field|Collection turbidity(string $label = null) + */ + class Show {} + + /** + + */ + class Form {} + +} + +namespace Dcat\Admin\Grid { + /** + + */ + class Column {} + + /** + + */ + class Filter {} +} + +namespace Dcat\Admin\Show { + /** + + */ + class Field {} +} diff --git a/lang/zh_CN/friend-link.php b/lang/zh_CN/friend-link.php new file mode 100644 index 0000000..9b88993 --- /dev/null +++ b/lang/zh_CN/friend-link.php @@ -0,0 +1,17 @@ + [ + 'FriendLink' => 'FriendLink', + 'friend-link' => 'FriendLink', + ], + 'fields' => [ + 'name' => '名称', + 'type' => '类型', + 'content' => '内容', + 'sort' => '排序', + 'is_recommend' => '推荐', + 'is_show' => '显示', + ], + 'options' => [ + ], +]; diff --git a/routes/api.php b/routes/api.php index d631a28..c6cce47 100644 --- a/routes/api.php +++ b/routes/api.php @@ -46,6 +46,9 @@ Route::group(['middleware' => 'auth:sanctum'], function () { Route::put('device-warning-rules', [DeviceWarningController::class, 'updateRule']); //预警规则 Route::get('device-warning-logs', [DeviceWarningController::class, 'warningLog']); + //友情链接 + Route::apiResource('friend-links', FriendLinkController::class)->only(['index'])->names('friend_links'); + /**统计 **/ Route::get('crop-yield-quarter-statics', [CropYieldController::class, 'quarterStaticsChart']);//季度统计 Route::get('crop-yield-category-statics', [CropYieldController::class, 'categoryStaticsChart']);//行业统计产值