添加广告位包
parent
ebd56dc4e8
commit
108510f835
|
|
@ -0,0 +1,3 @@
|
|||
# Dcat Admin Extension
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "peidikeji/banner",
|
||||
"alias": "banner",
|
||||
"description": "Description...",
|
||||
"type": "library",
|
||||
"keywords": ["dcat-admin", "extension"],
|
||||
"homepage": "https://github.com/peidikeji/banner",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "your name",
|
||||
"email": "your email"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Peidikeji\\Banner\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"dcat-admin": "Peidikeji\\Banner\\BannerServiceProvider",
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Peidikeji\\Banner\\BannerServiceProvider"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
.extension-demo {
|
||||
font-size: 1.3rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
(function (w, $) {
|
||||
function ExtensionDemo(options) {
|
||||
this.options = $.extend({
|
||||
$el: $('.demo'),
|
||||
}, options);
|
||||
|
||||
this.init(this.options);
|
||||
}
|
||||
|
||||
ExtensionDemo.prototype = {
|
||||
init: function (options) {
|
||||
options.$el.on('click', function () {
|
||||
Dcat.success($(this).text());
|
||||
});
|
||||
|
||||
console.log('Done.');
|
||||
},
|
||||
};
|
||||
|
||||
$.fn.extensionDemo = function (options) {
|
||||
options = options || {};
|
||||
options.$el = $(this);
|
||||
|
||||
return new ExtensionDemo(options);
|
||||
};
|
||||
})(window, jQuery);
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
return [];
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
return [];
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'BannerAd' => '广告位管理',
|
||||
'banner-ads'=> '广告位管理',
|
||||
],
|
||||
'fields' => [
|
||||
'name' => '名称',
|
||||
'key' => 'key',
|
||||
'width' => '宽度',
|
||||
'height' => '高度',
|
||||
'is_enable' => '启用',
|
||||
'remarks' => '备注',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'Banner' => '广告图管理',
|
||||
'banners' => '广告图管理',
|
||||
],
|
||||
'fields' => [
|
||||
'ad_id'=>'广告位',
|
||||
'name'=>'名称',
|
||||
'path'=>'内容',
|
||||
'sort'=>'排序',
|
||||
'is_enable'=>'启用',
|
||||
'remarks'=> '备注',
|
||||
'ext'=>'扩展字段'
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<div class="extension-demo">
|
||||
Welcome to dcat-admin !
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.extension-demo {
|
||||
color: @primary;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script require="@Peidikeji.Banner">
|
||||
$('.extension-demo').extensionDemo();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class BannerAdFilter extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relationMethod => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function q($v)
|
||||
{
|
||||
$this->where(function ($q) use ($v) {
|
||||
$q->where('key', 'like', '%'.$v.'%')->orWhere('name', 'like', '%'.$v.'%');
|
||||
});
|
||||
}
|
||||
|
||||
public function key($v)
|
||||
{
|
||||
$this->where('key', $v);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class BannerFilter extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relationMethod => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function q($v)
|
||||
{
|
||||
$this->where(function ($q) use ($v) {
|
||||
$q->where('key', 'like', '%'.$v.'%')->orWhere('name', 'like', '%'.$v.'%');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner;
|
||||
|
||||
use Dcat\Admin\Extend\ServiceProvider;
|
||||
use Dcat\Admin\Admin;
|
||||
|
||||
class BannerServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner\Http\Controllers;
|
||||
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Admin;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Peidikeji\Banner\Models\Banner;
|
||||
use Peidikeji\Banner\Models\BannerAd;
|
||||
use Dcat\Admin\Grid\Column as GridColumn;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
|
||||
class BannerAdController extends AdminController
|
||||
{
|
||||
protected $translation = 'peidikeji.banner::banner-ad';
|
||||
|
||||
public function list(Request $request)
|
||||
{
|
||||
$query = BannerAd::filter($request->all());
|
||||
|
||||
$query->select(['id', 'name as text', 'width', 'height']);
|
||||
|
||||
if ($request->filled('_paginate')) {
|
||||
$list = $query->paginate();
|
||||
} else {
|
||||
$list = $query->get();
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
protected function grid()
|
||||
{
|
||||
return Grid::make(new BannerAd(), function ($grid) {
|
||||
$grid->disableRowSelector();
|
||||
|
||||
$grid->column('name');
|
||||
$grid->column('key');
|
||||
$grid->column('width');
|
||||
$grid->column('height');
|
||||
$grid->column('is_enable')->if(function(){
|
||||
return !config('admin.permission.enable') || Admin::user()->can('dcat.admin.banner_ads.edit');
|
||||
})->then(function (GridColumn $column) {
|
||||
$column->switch();
|
||||
})->else(function (GridColumn $column) {
|
||||
$column->bool();
|
||||
});
|
||||
$grid->column('remarks');
|
||||
$grid->disableCreateButton(!(!config('admin.permission.enable') || Admin::user()->can('dcat.admin.banner_ads.create')));
|
||||
$grid->enableDialogCreate();
|
||||
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableView();
|
||||
$actions->disableEdit();
|
||||
$actions->quickEdit(!config('admin.permission.enable') || Admin::user()->can('dcat.admin.banner_ads.edit'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new BannerAd(), function (Form $form) {
|
||||
$form->text('name')->required();
|
||||
$form->text('key')->required()->rules([Rule::unique((new BannerAd())->getTable())]);
|
||||
$form->number('width')->min(0);
|
||||
$form->number('height')->min(0);
|
||||
$form->switch('is_enable');
|
||||
$form->text('remarks');
|
||||
});
|
||||
}
|
||||
|
||||
public function destroy($id){
|
||||
//如果该广告位下还有内容,则一起删除
|
||||
Banner::where([
|
||||
'ad_id' => $id
|
||||
])->delete();
|
||||
|
||||
return parent::destroy($id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner\Http\Controllers;
|
||||
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Admin;
|
||||
use Illuminate\Http\Request;
|
||||
use Peidikeji\Banner\Models\Banner;
|
||||
use Peidikeji\Banner\Models\BannerAd;
|
||||
use Dcat\Admin\Grid\Column as GridColumn;
|
||||
use Peidikeji\Banner\Resources\BannerResource;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
|
||||
class BannerController extends AdminController
|
||||
{
|
||||
protected $translation = 'peidikeji.banner::banner';
|
||||
|
||||
public function json(Request $request)
|
||||
{
|
||||
$keys = (array) $request->input('keys');
|
||||
|
||||
if (empty($keys)) {
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
|
||||
$ads = BannerAd::with([
|
||||
'banners' => function ($query) {
|
||||
$query->enable()->latest('sort');
|
||||
},
|
||||
])->enable()->whereIn('key', $keys)->get();
|
||||
|
||||
$mapAds = $ads->mapWithKeys(function ($item) use ($request) {
|
||||
return [
|
||||
$item->key => BannerResource::collection($item->banners)->resolve($request),
|
||||
];
|
||||
});
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (! $mapAds->has($key)) {
|
||||
$mapAds->put($key, []);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json($mapAds);
|
||||
}
|
||||
|
||||
protected function grid()
|
||||
{
|
||||
return Grid::make(new Banner(), function ($grid) {
|
||||
$grid->disableRowSelector();
|
||||
$grid->column('name');
|
||||
$grid->column('path')->image(100);
|
||||
$grid->column('sort');
|
||||
$grid->column('is_enable')->if(function(){
|
||||
return !config('admin.permission.enable') || Admin::user()->can('dcat.admin.banners.edit');
|
||||
})->then(function (GridColumn $column) {
|
||||
$column->switch();
|
||||
})->else(function (GridColumn $column) {
|
||||
$column->bool();
|
||||
});
|
||||
$grid->column('remarks');
|
||||
|
||||
$grid->setDialogFormDimensions('50%', '70%');
|
||||
$grid->disableCreateButton(!(!config('admin.permission.enable') || Admin::user()->can('dcat.admin.banners.create')));
|
||||
$grid->enableDialogCreate();
|
||||
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableView();
|
||||
$actions->disableEdit();
|
||||
$actions->quickEdit(!config('admin.permission.enable') || Admin::user()->can('dcat.admin.banners.edit'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected function form(){
|
||||
return Form::make(new Banner(), function (Form $form) {
|
||||
$form->select('ad_id')
|
||||
->options('api/banner-ads')
|
||||
->required();
|
||||
$form->text('name');
|
||||
$form->image('path')
|
||||
->uniqueName()
|
||||
->move('banner')
|
||||
->saveFullUrl()
|
||||
->autoSave(false)
|
||||
->autoUpload()
|
||||
->removable(false)//禁止用户从页面点击删除服务器上的文件,可以实现图片覆盖上传效果
|
||||
->retainable()
|
||||
->required()->help('建议尺寸:');
|
||||
Admin::script(
|
||||
<<<JS
|
||||
$('body').on('select2:select', 'select.field_ad_id', function(e){
|
||||
let url_path = '/admin/api/banner-ads?id=' + e.params.data.id
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
url: url_path,
|
||||
success: function(result){
|
||||
//异步渲染提示尺寸;
|
||||
let cicun = '未设置';
|
||||
if(result[0]){
|
||||
if(result[0].width || result[0].height){
|
||||
cicun = result[0].width + '*' + result[0].height;
|
||||
}
|
||||
}
|
||||
$('input[name=path]').parent().find('span.help-block').html('<i class="fa feather icon-help-circle"></i> 建议尺寸:'+ cicun);
|
||||
}
|
||||
});
|
||||
});
|
||||
JS);
|
||||
$form->number('sort')
|
||||
->min(0)
|
||||
->help('数值越大, 越靠前');
|
||||
// $form->embeds('ext', function (EmbeddedForm $form) {
|
||||
// $form->select('type', '类型')->options(Target::options());
|
||||
// $form->text('value', '地址');
|
||||
// // $form->switch('auth', '登录认证');
|
||||
// });
|
||||
$form->switch('is_enable');
|
||||
$form->text('remarks');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class BannerResource 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,
|
||||
'path' => $this->path,
|
||||
'ext' => $this->ext,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
use Peidikeji\Banner\Http\Controllers;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('api/banner-ads', [Controllers\BannerAdController::class, 'list'])->name('api.banner_ads');
|
||||
|
||||
Route::resource('banner-ads', Controllers\BannerAdController::class)->names('banner_ads');
|
||||
Route::resource('banners', Controllers\BannerController::class);
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['middleware' => 'api', 'prefix' => 'api'], function () {
|
||||
Route::get('banners', [BannerController::class, 'json']);
|
||||
});
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner\Models;
|
||||
|
||||
use EloquentFilter\Filterable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Banner extends Model
|
||||
{
|
||||
use HasFactory, HasDateTimeFormatter, Filterable;
|
||||
|
||||
protected $fillable = ['ad_id', 'path', 'name', 'sort', 'is_enable', 'ext', 'remarks'];
|
||||
|
||||
public function ad()
|
||||
{
|
||||
return $this->belongsTo(BannerAd::class, 'ad_id');
|
||||
}
|
||||
|
||||
public function scopeEnable($query){
|
||||
return $query->where('is_enable', 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner\Models;
|
||||
|
||||
use EloquentFilter\Filterable;
|
||||
use Peidikeji\Banner\BannerAdFilter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class BannerAd extends Model
|
||||
{
|
||||
use HasFactory, HasDateTimeFormatter, Filterable;
|
||||
|
||||
protected $fillable = ['name', 'key', 'width', 'height', 'is_enable', 'remarks'];
|
||||
|
||||
public function modelFilter()
|
||||
{
|
||||
return BannerAdFilter::class;
|
||||
}
|
||||
|
||||
public function banners()
|
||||
{
|
||||
return $this->hasMany(Banner::class, 'ad_id');
|
||||
}
|
||||
|
||||
public function scopeEnable($query){
|
||||
return $query->where('is_enable', 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace Peidikeji\Banner;
|
||||
|
||||
use Dcat\Admin\Extend\Setting as Form;
|
||||
|
||||
class Setting extends Form
|
||||
{
|
||||
public function form()
|
||||
{
|
||||
$this->text('key1')->required();
|
||||
$this->text('key2')->required();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBannerTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasTable('banner_ads')) {
|
||||
Schema::create('banner_ads', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->comment('名称');
|
||||
$table->string('key')->unique()->comment('key');
|
||||
$table->unsignedInteger('width')->nullable()->comment('宽');
|
||||
$table->unsignedInteger('height')->nullable()->comment('高');
|
||||
$table->unsignedTinyInteger('is_enable')->default(1)->comment('可用状态');
|
||||
$table->string('remarks')->nullable()->comment('备注');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('banners')) {
|
||||
Schema::create('banners', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('ad_id')->comment('位置ID');
|
||||
$table->string('path')->comment('地址');
|
||||
$table->string('name')->nullable()->comment('名称');
|
||||
$table->unsignedInteger('sort')->comment('排序');
|
||||
$table->unsignedTinyInteger('is_enable')->default(1)->comment('可用状态');
|
||||
$table->text('ext')->nullable()->comment('扩展字段,可用于跳转配置等');
|
||||
$table->string('remarks')->nullable()->comment('备注');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('banners');
|
||||
Schema::dropIfExists('banner_ads');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'1.0.0' => [
|
||||
'初始化广告管理插件',
|
||||
'CreateBannerTable.php',
|
||||
],
|
||||
];
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 celaraze
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
# Dcat Plus
|
||||
|
||||
为 DcatAdmin 后台添加增强配置的功能。修改过程利用 DcatAdmin 自带的 `admin_setting()` 方法实现,不会硬编码修改任何 config 文件或者 .env 文件。
|
||||
|
||||
## 安装方式
|
||||
|
||||
最新支持 Dcat Admin 2.0.24beta
|
||||
|
||||
`composer require celaraze/dcat-extension-plus`
|
||||
|
||||
或者在后台扩展中,直接上传本插件的 `.zip` 文件即可。
|
||||
|
||||
### 使用
|
||||
|
||||
在菜单 `扩展` 中启用扩展后,会自动添加名为 `增强配置` 的菜单。
|
||||
|
||||
### 功能
|
||||
|
||||
- 站点标题
|
||||
|
||||
- 站点 LOGO
|
||||
|
||||
- 站点微缩 LOGO
|
||||
|
||||
- 站点静态资源 URL
|
||||
|
||||
- 调试模式
|
||||
|
||||
- 语言切换
|
||||
|
||||
- 移除底部授权
|
||||
|
||||
- 主题色切换
|
||||
|
||||
- 菜单样式切换(默认、分离、水平)
|
||||
|
||||
- 表单行操作按钮固定最右
|
||||
|
||||
- 快速创建选项:表单可用 `selectCreate()` 字段类型,是 `select` 字段的增强,支持在右侧添加快速创建选项的按钮,异步添加值。
|
||||
|
||||
```PHP
|
||||
$form->selectCreate('department','部门')
|
||||
->options(Department::class)
|
||||
->ajax('/api/departments') // 必须使用 api 方式取选项列表,格式同 select 字段的使用方法
|
||||
->url('/departments/create') // 异步打开的页面,这里是部门创建的页面 url
|
||||
->required();
|
||||
```
|
||||
|
||||
- 表单详情扩展字段类型:`video`,视频,传入参数和 `image` 相同。
|
||||
|
||||
`$show->field('name')->video()`
|
||||
|
||||
## 开源协议
|
||||
|
||||
Dcat Plus 遵循 MIT 开源协议。
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"name": "celaraze/dcat-extension-plus",
|
||||
"description": "增强 DcatAdmin 的使用体验。",
|
||||
"alias": "Dcat 增强工具",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"dcat-admin",
|
||||
"extension"
|
||||
],
|
||||
"homepage": "https://github.com/celaraze/dcat-extension-plus",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Celaraze",
|
||||
"email": "celaraze@qq.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3.0",
|
||||
"dcat/laravel-admin": "~2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Celaraze\\DcatPlus\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"dcat-admin": "Celaraze\\DcatPlus\\ServiceProvider",
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Celaraze\\DcatPlus\\ServiceProvider"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.9 KiB |
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
return [
|
||||
'site_url' => '站点域名',
|
||||
'site_title' => '站点标题',
|
||||
'site_logo_text' => 'LOGO(文字)',
|
||||
'site_logo' => 'LOGO',
|
||||
'site_logo_mini' => 'LOGO(微缩)',
|
||||
'site_debug' => '调试模式',
|
||||
'footer_remove' => '移除底部授权',
|
||||
'select_create' => '快速创建选项',
|
||||
'theme_color' => '主题色',
|
||||
'sidebar_style' => '菜单样式',
|
||||
'site_lang' => '语言',
|
||||
'grid_row_actions_right' => '表单行操作按钮最右'
|
||||
];
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'dcat_plus' => '增强配置'
|
||||
];
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<div class="{{$viewClass['form-group']}}">
|
||||
|
||||
<div class="{{ $viewClass['label'] }} control-label">
|
||||
<span>{!! $label !!}</span>
|
||||
</div>
|
||||
|
||||
<div class="{{$viewClass['field']}}">
|
||||
|
||||
<div class="input-group">
|
||||
@include('admin::form.error')
|
||||
|
||||
<input type="hidden" name="{{$name}}"/>
|
||||
|
||||
<select class="form-control {{$class}}" style="width: 100%;" name="{{$name}}" {!! $attributes !!} >
|
||||
<option value=""></option>
|
||||
@if($groups)
|
||||
@foreach($groups as $group)
|
||||
<optgroup label="{{ $group['label'] }}">
|
||||
@foreach($group['options'] as $select => $option)
|
||||
<option value="{{$select}}" {{ $select == $value ?'selected':'' }}>{{$option}}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach($options as $select => $option)
|
||||
<option
|
||||
value="{{$select}}" {{ Dcat\Admin\Support\Helper::equal($select, $value) ?'selected':'' }}>{{$option}}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
<div class="input-group-append">
|
||||
{!! $createDialog !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('admin::form.help-block')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('admin::form.select-script')
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Celaraze\DcatPlus\Extensions\Form;
|
||||
|
||||
|
||||
use Celaraze\DcatPlus\Support;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Form\Field\Select;
|
||||
use Dcat\Admin\Support\Helper;
|
||||
|
||||
class SelectCreate extends Select
|
||||
{
|
||||
protected $view = 'celaraze.dcat-extension-plus::select_create';
|
||||
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->addDefaultConfig([
|
||||
'allowClear' => true,
|
||||
'placeholder' => [
|
||||
'id' => '',
|
||||
'text' => $this->placeholder(),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->formatOptions();
|
||||
|
||||
$this->addVariables([
|
||||
'options' => $this->options,
|
||||
'groups' => $this->groups,
|
||||
'configs' => $this->config,
|
||||
'cascadeScript' => $this->getCascadeScript(),
|
||||
'createDialog' => $this->build()
|
||||
]);
|
||||
|
||||
$this->attribute('data-value', implode(',', Helper::array($this->value())));
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
|
||||
protected function build(): string
|
||||
{
|
||||
Form::dialog(Support::trans('main.select_create'))
|
||||
->click('.create-form')
|
||||
->url($this->url)
|
||||
->width('1200px')
|
||||
->height('800px');
|
||||
|
||||
$text = Support::trans('main.select_create');
|
||||
|
||||
return "<span class='btn btn-primary create-form' data-url='$this->url'> $text </span>";
|
||||
}
|
||||
|
||||
public function url($url): SelectCreate
|
||||
{
|
||||
$this->url = $url;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Extensions\Show;
|
||||
|
||||
use Dcat\Admin\Show\AbstractField;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Video extends AbstractField
|
||||
{
|
||||
public function render($server = '', $width = 200, $height = 200)
|
||||
{
|
||||
$items = json_decode($this->value, true);
|
||||
$return = '';
|
||||
foreach ($items as $item) {
|
||||
if (url()->isValidUrl($item)) {
|
||||
$src = $item;
|
||||
} elseif ($server) {
|
||||
$src = rtrim($server, '/') . '/' . ltrim($item, '/');
|
||||
} else {
|
||||
$disk = config('admin.upload.disk');
|
||||
|
||||
if (config("filesystems.disks.{$disk}")) {
|
||||
$src = Storage::disk($disk)->url($item);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
$return .= "<video src='$src' autoplay loop style='max-width:{$width}px;max-height:{$height}px'></video> ";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Forms;
|
||||
|
||||
use Celaraze\DcatPlus\Support;
|
||||
use Dcat\Admin\Widgets\Form;
|
||||
|
||||
class DcatPlusSiteForm extends Form
|
||||
{
|
||||
/**
|
||||
* Handle the form request.
|
||||
*
|
||||
* @param array $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(array $input)
|
||||
{
|
||||
admin_setting($input);
|
||||
return $this
|
||||
->response()
|
||||
->success('站点配置更新成功!')
|
||||
->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a form here.
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$this->url('site_url', Support::trans('main.site_url'))
|
||||
->help('站点域名决定了静态资源(头像、图片等)的显示路径,可以包含端口号,例如 http://chemex.it:8000 。')
|
||||
->default(admin_setting('site_url'));
|
||||
$this->text('site_title', Support::trans('main.site_title'))
|
||||
->default(admin_setting('site_title'));
|
||||
$this->text('site_logo_text', Support::trans('main.site_logo_text'))
|
||||
->help('文本LOGO显示的优先度低于图片,当没有上传图片作为LOGO时,此项将生效。')
|
||||
->default(admin_setting('site_logo_text'));
|
||||
$this->image('site_logo', Support::trans('main.site_logo'))
|
||||
->autoUpload()
|
||||
->uniqueName()
|
||||
->default(admin_setting('site_logo'));
|
||||
$this->image('site_logo_mini', Support::trans('main.site_logo_mini'))
|
||||
->autoUpload()
|
||||
->uniqueName()
|
||||
->default(admin_setting('site_logo_mini'));
|
||||
$this->switch('site_debug', Support::trans('main.site_debug'))
|
||||
->help('开启 debug 模式后将会显示异常捕获信息,关闭则只返回 500 状态码。')
|
||||
->default(admin_setting('site_debug'));
|
||||
$this->radio('site_lang', Support::trans('main.site_lang'))
|
||||
->options([
|
||||
'zh_CN' => '中文(简体)',
|
||||
'en' => 'English'
|
||||
])
|
||||
->default(admin_setting('site_lang'));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Forms;
|
||||
|
||||
use Celaraze\DcatPlus\ServiceProvider;
|
||||
use Celaraze\DcatPlus\Support;
|
||||
use Dcat\Admin\Widgets\Form;
|
||||
|
||||
class DcatPlusUIForm extends Form
|
||||
{
|
||||
/**
|
||||
* Handle the form request.
|
||||
*
|
||||
* @param array $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(array $input)
|
||||
{
|
||||
admin_setting($input);
|
||||
return $this
|
||||
->response()
|
||||
->success('站点配置更新成功!')
|
||||
->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a form here.
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$this->switch('footer_remove', Support::trans('main.footer_remove'))
|
||||
->default(admin_setting('footer_remove'));
|
||||
$defaultColors = [
|
||||
'default' => '墨蓝',
|
||||
'blue' => '蓝',
|
||||
'blue-light' => '亮蓝',
|
||||
'green' => '墨绿',
|
||||
];
|
||||
foreach (explode(",", ServiceProvider::setting('additional_theme_colors')) as $value) {
|
||||
if (!empty($value)) {
|
||||
[$k, $v] = explode(":", $value);
|
||||
$defaultColors[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$this->radio('theme_color', Support::trans('main.theme_color'))
|
||||
->options($defaultColors)
|
||||
->default(admin_setting('theme_color'));
|
||||
$this->radio('sidebar_style', Support::trans('main.sidebar_style'))
|
||||
->options([
|
||||
'default' => '默认',
|
||||
'sidebar-separate' => '菜单分离',
|
||||
'horizontal_menu' => '水平菜单'
|
||||
])
|
||||
->default(admin_setting('sidebar_style'));
|
||||
$this->switch('grid_row_actions_right', Support::trans('main.grid_row_actions_right'))
|
||||
->help('启用后表格行操作按钮将永远贴着最右侧。')
|
||||
->default(admin_setting('grid_row_actions_right'));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Http\Controllers;
|
||||
|
||||
use Celaraze\DcatPlus\Forms\DcatPlusSiteForm;
|
||||
use Dcat\Admin\Layout\Content;
|
||||
use Dcat\Admin\Layout\Row;
|
||||
use Dcat\Admin\Widgets\Tab;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class DcatPlusSiteController extends Controller
|
||||
{
|
||||
public function index(Content $content): Content
|
||||
{
|
||||
return $content->header('增强配置')
|
||||
->description('提供了一些对站点增强的配置')
|
||||
->body(function (Row $row) {
|
||||
$tab = new Tab();
|
||||
$tab->add('站点配置', new DcatPlusSiteForm(), true);
|
||||
$tab->addLink('UI优化', admin_route('dcat-plus.ui.index'));
|
||||
$row->column(12, $tab->withCard());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Http\Controllers;
|
||||
|
||||
use Celaraze\DcatPlus\Forms\DcatPlusUIForm;
|
||||
use Dcat\Admin\Layout\Content;
|
||||
use Dcat\Admin\Layout\Row;
|
||||
use Dcat\Admin\Widgets\Tab;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class DcatPlusUIController extends Controller
|
||||
{
|
||||
public function index(Content $content): Content
|
||||
{
|
||||
return $content->header('增强配置')
|
||||
->description('提供了一些对站点增强的配置')
|
||||
->body(function (Row $row) {
|
||||
$tab = new Tab();
|
||||
$tab->addLink('站点配置', admin_route('dcat-plus.site.index'));
|
||||
$tab->add('UI优化', new DcatPlusUIForm(), true);
|
||||
$row->column(12, $tab->withCard());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Class AfterInjectDcatPlus
|
||||
* @package Celaraze\DcatPlus\Http\Middleware
|
||||
*/
|
||||
class AfterInjectDcatPlus
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Class BeforeInjectDcatPlus
|
||||
* @package Celaraze\DcatPlus\Http\Middleware
|
||||
*/
|
||||
class BeforeInjectDcatPlus
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus\Http\Middleware;
|
||||
|
||||
use Celaraze\DcatPlus\Support;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MiddleInjectDcatPlus
|
||||
{
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$support = new Support();
|
||||
$support->initConfig();
|
||||
$support->gridRowActionsRight();
|
||||
$support->injectFields();
|
||||
$support->footerRemove();
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Celaraze\DcatPlus\Http\Controllers\DcatPlusSiteController;
|
||||
use Celaraze\DcatPlus\Http\Controllers\DcatPlusUIController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
||||
|
||||
Route::get('/dcat-plus/site', [DcatPlusSiteController::class, 'index'])
|
||||
->name('dcat-plus.site.index');
|
||||
|
||||
Route::get('/dcat-plus/ui', [DcatPlusUIController::class, 'index'])
|
||||
->name('dcat-plus.ui.index');
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus;
|
||||
|
||||
use Celaraze\DcatPlus\Http\Middleware\AfterInjectDcatPlus;
|
||||
use Celaraze\DcatPlus\Http\Middleware\BeforeInjectDcatPlus;
|
||||
use Celaraze\DcatPlus\Http\Middleware\MiddleInjectDcatPlus;
|
||||
use Dcat\Admin\Extend\ServiceProvider as BaseServiceProvider;
|
||||
|
||||
/**
|
||||
* Class ServiceProvider
|
||||
* @package Celaraze\DcatPlus
|
||||
*/
|
||||
class ServiceProvider extends BaseServiceProvider
|
||||
{
|
||||
protected $middleware = [
|
||||
'before' => [
|
||||
BeforeInjectDcatPlus::class,
|
||||
],
|
||||
'middle' => [
|
||||
MiddleInjectDcatPlus::class,
|
||||
],
|
||||
'after' => [
|
||||
AfterInjectDcatPlus::class,
|
||||
]
|
||||
];
|
||||
protected $menu = [
|
||||
[
|
||||
'title' => 'Dcat Plus',
|
||||
'uri' => 'dcat-plus/site',
|
||||
'icon' => 'feather icon-settings'
|
||||
]
|
||||
];
|
||||
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function settingForm()
|
||||
{
|
||||
return new Setting($this);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Celaraze\DcatPlus;
|
||||
|
||||
use Dcat\Admin\Extend\Setting as Form;
|
||||
|
||||
class Setting extends Form
|
||||
{
|
||||
public function form()
|
||||
{
|
||||
$this->text('additional_theme_colors', 'Additional Theme Colors')
|
||||
->help("cssname1:Title1,cssname2:Title2");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Celaraze\DcatPlus;
|
||||
|
||||
|
||||
use App\Admin\Extensions\Form\SelectCreate;
|
||||
use Celaraze\DcatPlus\Extensions\Show\Video;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Show;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Support
|
||||
{
|
||||
/**
|
||||
* 快速翻译(为了缩短代码量)
|
||||
* @param $string
|
||||
* @return array|string|null
|
||||
*/
|
||||
public static function trans($string)
|
||||
{
|
||||
return ServiceProvider::trans($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化配置注入
|
||||
*/
|
||||
public function initConfig()
|
||||
{
|
||||
/**
|
||||
* 处理站点LOGO自定义
|
||||
*/
|
||||
if (empty(admin_setting('site_logo'))) {
|
||||
$logo = admin_setting('site_logo_text');
|
||||
} else {
|
||||
$logo = Storage::disk(config('admin.upload.disk'))->url(admin_setting('site_logo'));
|
||||
$logo = "<img src='$logo'>";
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理站点LOGO-MINI自定义
|
||||
*/
|
||||
if (empty(admin_setting('site_logo_mini'))) {
|
||||
$logo_mini = admin_setting('site_logo_text');
|
||||
} else {
|
||||
$logo_mini = Storage::disk(config('admin.upload.disk'))->url(admin_setting('site_logo_mini'));
|
||||
$logo_mini = "<img src='$logo_mini'>";
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理站点名称
|
||||
*/
|
||||
$horizontal_menu = false;
|
||||
if (empty(admin_setting('site_url'))) {
|
||||
$site_url = 'http://localhost';
|
||||
} else {
|
||||
$site_url = admin_setting('site_url');
|
||||
}
|
||||
|
||||
if (empty(admin_setting('site_debug'))) {
|
||||
$site_debug = true;
|
||||
} else {
|
||||
$site_debug = admin_setting('site_debug');
|
||||
}
|
||||
|
||||
if (empty(admin_setting('theme_color'))) {
|
||||
$theme_color = 'blue-light';
|
||||
} else {
|
||||
$theme_color = admin_setting('theme_color');
|
||||
}
|
||||
if (empty(admin_setting('sidebar_style'))) {
|
||||
$sidebar_style = 'default';
|
||||
} else {
|
||||
$sidebar_style = admin_setting('sidebar_style');
|
||||
if ($sidebar_style == 'horizontal_menu') {
|
||||
$horizontal_menu = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复写admin站点配置
|
||||
*/
|
||||
config([
|
||||
'app.url' => $site_url,
|
||||
'app.debug' => (bool)$site_debug,
|
||||
'app.locale' => admin_setting('site_lang', config('app.locale')),
|
||||
'app.fallback_locale' => admin_setting('site_lang', config('app.fallback_locale')),
|
||||
|
||||
'admin.title' => admin_setting('site_title'),
|
||||
'admin.logo' => $logo,
|
||||
'admin.logo-mini' => $logo_mini,
|
||||
'admin.layout.color' => $theme_color,
|
||||
'admin.layout.body_class' => $sidebar_style,
|
||||
'admin.layout.horizontal_menu' => $horizontal_menu
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注入字段.
|
||||
*/
|
||||
public function injectFields()
|
||||
{
|
||||
Form::extend('selectCreate', SelectCreate::class);
|
||||
Show\Field::extend('video', Video::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部授权移除.
|
||||
*/
|
||||
public function footerRemove()
|
||||
{
|
||||
if (admin_setting('footer_remove')) {
|
||||
Admin::style(
|
||||
<<<'CSS'
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
CSS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 行操作按钮最右.
|
||||
*/
|
||||
public function gridRowActionsRight()
|
||||
{
|
||||
if (admin_setting('grid_row_actions_right')) {
|
||||
Admin::style(
|
||||
<<<CSS
|
||||
.grid__actions__{
|
||||
width: 20%;
|
||||
text-align: right;
|
||||
}
|
||||
CSS
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'1.0.0' => [
|
||||
'原始版本发布',
|
||||
],
|
||||
'1.0.1' => [
|
||||
'增加调试模式开关 & 侧栏子菜单缩进增加',
|
||||
],
|
||||
'1.0.2' => [
|
||||
'扩展表单字段 selectCreate 为 select 字段的升级版,支持快速创建。',
|
||||
],
|
||||
'1.0.3' => [
|
||||
'增加扩展图标和别名。',
|
||||
],
|
||||
'1.0.4' => [
|
||||
'增加表单提交预处理过滤,防止XSS攻击。',
|
||||
],
|
||||
'1.0.5' => [
|
||||
'优化表单提交预处理过滤,不再依赖第三方包。',
|
||||
],
|
||||
'1.0.6' => [
|
||||
'selectCreate组件的颜色改为主题色。',
|
||||
'UI增加表格行操作按钮紧贴最右侧。'
|
||||
],
|
||||
'1.0.7' => [
|
||||
'支持DcatAdmin 2.0.18beta。',
|
||||
'暂时移除侧栏菜单子菜单缩进(不兼容)。',
|
||||
'增加水平菜单选项。',
|
||||
'原先的头部块状显示改为边距优化'
|
||||
],
|
||||
'1.0.8' => [
|
||||
'提供了自定义颜色的支持入口',
|
||||
],
|
||||
'1.0.9' => [
|
||||
'移除HTML、JS过滤',
|
||||
'移除部分UI优化'
|
||||
],
|
||||
'1.1.0' => [
|
||||
'修复debug配置无效的问题',
|
||||
'自动注入扩展字段',
|
||||
'移除了一些无用的配置'
|
||||
],
|
||||
'1.1.1' => [
|
||||
'增加详情页视频扩展字段',
|
||||
],
|
||||
];
|
||||
Loading…
Reference in New Issue