添加友情链接

dev
vine_liutk 2022-11-02 11:56:54 +08:00
parent 651e0218d4
commit 98e797948d
11 changed files with 893 additions and 1 deletions

View File

@ -0,0 +1,132 @@
<?php
namespace App\Admin\Controllers;
use Carbon\Carbon;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Admin;
use App\Models\FriendLink;
use Dcat\Admin\Http\Controllers\AdminController;
class FriendLinkController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new FriendLink(), function (Grid $grid) {
// $grid->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');
});
}
}

View File

@ -1,7 +1,9 @@
<?php
use Dcat\Admin\Admin;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Admin;
/**
* Dcat-admin - admin builder based on Laravel.
@ -21,3 +23,50 @@ use Dcat\Admin\Form;
* Admin::css('/packages/prettydocs/css/styles.css');
* Admin::js('/packages/prettydocs/js/main.js');
*/
Form::extend('amap', Amap::class);
Form::extend('region', Region::class);
Grid::resolving(function (Grid $grid) {
$grid->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);

View File

@ -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');
});

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\Paginator;
use App\Models\FriendLink;
use Illuminate\Http\Request;
use App\Http\Resources\FriendLinkResource;
class FriendLinkController extends Controller
{
public function index(Request $request){
$query = FriendLink::filter($request->all());
$list = $query->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50));
return $this->json(FriendLinkResource::collection($list));
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class FriendLinkResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'type' => $this->type,
'content' => $this->content,
'sort' => $this->sort,
'created_at' => strtotime($this->created_at) ?? 0, //录入时间
];
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\ModelFilters;
use EloquentFilter\ModelFilter;
class FriendLinkFilter extends ModelFilter
{
public function name($name)
{
return $this->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);
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Models;
use Dcat\Admin\Admin;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\Model;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class FriendLink extends Model
{
use HasFactory, HasDateTimeFormatter, Filterable;
public const TYPE_LINK = 1; //链接
public const TYPE_VIDEO = 2; //视频
public const TYPE_ARTICLE = 3; //文章
protected $fillable = [
'name', 'type', 'content', 'sort', 'is_recommend', 'is_show'
];
public static function typeMap()
{
return [
self::TYPE_LINK => '链接',
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 "<span class='label' style='background: $background;'>{$name}</span>";
}
public function scopeSort($q){
return $q->orderBy('sort', 'desc')->orderBy('created_at', 'desc');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('friend_links', function (Blueprint $table) {
$table->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');
}
};

View File

@ -0,0 +1,529 @@
<?php
/**
* A helper file for Dcat Admin, to provide autocomplete information to your IDE
*
* This file should not be included in your code, only analyzed by your IDE!
*
* @author jqh <841324345@qq.com>
*/
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 {}
}

View File

@ -0,0 +1,17 @@
<?php
return [
'labels' => [
'FriendLink' => 'FriendLink',
'friend-link' => 'FriendLink',
],
'fields' => [
'name' => '名称',
'type' => '类型',
'content' => '内容',
'sort' => '排序',
'is_recommend' => '推荐',
'is_show' => '显示',
],
'options' => [
],
];

View File

@ -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']);//行业统计产值