Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
478dbe1531 | |
|
|
77a017298a |
|
|
@ -17,7 +17,7 @@ DB_PASSWORD=
|
|||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=public
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
|
|
|||
71
README.md
71
README.md
|
|
@ -1,5 +1,66 @@
|
|||
composer install
|
||||
php artisan g:k
|
||||
php artisan storage:link
|
||||
php artisan admin:install
|
||||
php artisan db:seed
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[WebReinvent](https://webreinvent.com/)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Jump24](https://jump24.co.uk)**
|
||||
- **[Redberry](https://redberry.international/laravel/)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
- **[byte5](https://byte5.de)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class Components extends BaseRenderer {
|
|||
* 2位小数输入框
|
||||
*/
|
||||
public function decimalControl($name ='decimal', $label = null){
|
||||
return amisMake()->NumberControl()
|
||||
return amisMake()->NumberControl()->size('sm')
|
||||
->name($name)->label($label ?? __('admin.components.decimal'))
|
||||
->kilobitSeparator(true)
|
||||
->percision(2)
|
||||
|
|
|
|||
|
|
@ -10,18 +10,16 @@ use Slowlyo\OwlAdmin\Controllers\AdminController;
|
|||
use App\Services\Admin\ArticleService;
|
||||
use App\Admin\Components;
|
||||
use App\Models\Keyword;
|
||||
use App\Traits\CustomActionTrait;
|
||||
|
||||
class ArticleController extends AdminController
|
||||
{
|
||||
use CustomActionTrait;
|
||||
protected string $serviceName = ArticleService::class;
|
||||
|
||||
public function list():Page
|
||||
{
|
||||
$crud = $this->baseCRUD()->tableLayout('fixed')
|
||||
->headerToolbar([
|
||||
$this->createTypeButton('drawer', 'xl'),
|
||||
$this->createButton(),
|
||||
...$this->baseHeaderToolBar(),
|
||||
])
|
||||
->filter($this->baseFilter()->body([
|
||||
|
|
@ -71,7 +69,7 @@ class ArticleController extends AdminController
|
|||
amis()->TableColumn('is_recommend', __('admin.articles.is_recommend'))->type('switch'),
|
||||
amis()->TableColumn('created_at', __('admin.created_at'))->type('datetime')->sortable(true),
|
||||
amis()->Operation()->label(__('admin.actions'))->buttons([
|
||||
$this->rowEditTypeButton('drawer', 'xl'),
|
||||
$this->rowEditButton(),
|
||||
$this->rowDeleteButton(),
|
||||
])
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class AuthController extends AdminAuthController
|
|||
return $this->response()->fail(__('admin.required', ['attribute' => __('admin.captcha')]));
|
||||
}
|
||||
|
||||
if (strtolower(cache()->pull($request->sys_captcha)) != strtolower($request->captcha)) {
|
||||
if (strtolower(admin_decode($request->sys_captcha)) != strtolower($request->captcha)) {
|
||||
return $this->response()->fail(__('admin.captcha_error'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace App\Admin\Controllers;
|
|||
|
||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||
use Slowlyo\OwlAdmin\Renderers\TableColumn;
|
||||
use Slowlyo\OwlAdmin\Renderers\TextControl;
|
||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||
use App\Services\Admin\KeywordService;
|
||||
|
|
@ -23,8 +22,7 @@ class KeywordController extends AdminController
|
|||
->footerToolbar([])
|
||||
//去掉分页-end
|
||||
->headerToolbar([
|
||||
$this->createButton(true),
|
||||
$this->exportAction(),
|
||||
$this->createButton(true, 'md'),
|
||||
amis('reload')->align('right'),
|
||||
amis('filter-toggler')->align('right'),
|
||||
])
|
||||
|
|
@ -39,15 +37,13 @@ class KeywordController extends AdminController
|
|||
))
|
||||
->columns([
|
||||
// TableColumn::make()->name('id')->label('ID')->sortable(true),
|
||||
TableColumn::make()->name('name')->label('名称'),
|
||||
TableColumn::make()->name('key')->label('KEY')->copyable(true),
|
||||
TableColumn::make()->name('value')->label('值'),
|
||||
TableColumn::make()->name('sort')->label('排序'),
|
||||
TableColumn::make()->name('created_at')->label('创建时间')->type('datetime')->sortable(true),
|
||||
amis()->TableColumn('name', __('admin.keywords.name')),
|
||||
amis()->TableColumn('key', __('admin.keywords.key'))->copyable(true),
|
||||
amis()->TableColumn('value', __('admin.keywords.value')),
|
||||
amis()->TableColumn('sort', __('admin.keywords.sort')),
|
||||
amis()->TableColumn('created_at', __('admin.created_at'))->type('datetime')->sortable(true),
|
||||
amisMake()->Operation()->label(__('admin.actions'))->buttons([
|
||||
//按钮权限示例;
|
||||
// amis()->action()->label('判断权限')->permission('keywords.custom', amis()->TextControl()->hidden()),
|
||||
$this->rowEditButton(true),
|
||||
$this->rowEditButton(true, 'md'),
|
||||
$this->rowDeleteButton(),
|
||||
]),
|
||||
]);
|
||||
|
|
@ -59,10 +55,10 @@ class KeywordController extends AdminController
|
|||
{
|
||||
return $this->baseForm()->body([
|
||||
Components::make()->parentControl(admin_url('api/keywords/tree-list')),
|
||||
TextControl::make()->name('name')->label('名称')->required(true),
|
||||
TextControl::make()->name('key')->label('KEY')->required(true),
|
||||
TextControl::make()->name('value')->label('值'),
|
||||
amisMake()->NumberControl()->name('sort')->value(0)->min()->label('排序'),
|
||||
amis()->TextControl('name', __('admin.keywords.name'))->required(true),
|
||||
amis()->TextControl('key', __('admin.keywords.key'))->required(true),
|
||||
amis()->TextControl('value', __('admin.keywords.value')),
|
||||
Components::make()->sortControl('sort', __('admin.keywords.sort')),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||
use App\Services\Admin\ProductCategoryService;
|
||||
use App\Admin\Components;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ProductCategoryController extends AdminController
|
||||
{
|
||||
protected string $serviceName = ProductCategoryService::class;
|
||||
|
||||
public function list(): Page
|
||||
{
|
||||
$crud = $this->baseCRUD()
|
||||
//去掉分页-start
|
||||
->loadDataOnce(true)
|
||||
->footerToolbar([])
|
||||
//去掉分页-end
|
||||
->headerToolbar([
|
||||
$this->createButton(true, 'md'),
|
||||
amis('reload')->align('right'),
|
||||
amis('filter-toggler')->align('right'),
|
||||
])
|
||||
->filter($this->baseFilter()->body([
|
||||
|
||||
]
|
||||
))
|
||||
->columns([
|
||||
amis()->TableColumn()->make()->name('id')->label('ID')->sortable(true),
|
||||
amis()->TableColumn('name', __('admin.product_categories.name')),
|
||||
amis()->TableColumn('key', __('admin.product_categories.key'))->copyable(true),
|
||||
amis()->TableColumn('cover', __('admin.product_categories.cover'))->type('image')->height('50px')->width('150px')->enlargeAble(true),
|
||||
amis()->TableColumn('is_enable', __('admin.product_categories.is_enable'))->type('switch'),
|
||||
amis()->TableColumn('is_show', __('admin.product_categories.is_show'))->type('switch'),
|
||||
amis()->TableColumn('is_recommend', __('admin.product_categories.is_recommend'))->type('switch'),
|
||||
amis()->TableColumn('created_at', __('admin.created_at'))->type('datetime')->sortable(true),
|
||||
amisMake()->Operation()->label(__('admin.actions'))->buttons([
|
||||
$this->rowEditButton(true, 'md'),
|
||||
$this->rowDeleteButton(),
|
||||
]),
|
||||
]);
|
||||
|
||||
return $this->baseList($crud);
|
||||
}
|
||||
|
||||
public function form(): Form
|
||||
{
|
||||
return $this->baseForm()->body([
|
||||
Components::make()->parentControl(admin_url('api/product_categories/tree-list')),
|
||||
amis()->TextControl('name', __('admin.product_categories.name'))->required(true),
|
||||
amis()->TextControl('key', __('admin.product_categories.key'))->required(true),
|
||||
Components::make()->cropImageControl('cover', __('admin.product_categories.cover')),
|
||||
Components::make()->sortControl('sort', __('admin.product_categories.sort')),
|
||||
amis()->SwitchControl('is_enable', __('admin.product_categories.is_enable'))->value(false),
|
||||
amis()->SwitchControl('is_show', __('admin.product_categories.is_show'))->value(false),
|
||||
amis()->SwitchControl('is_recommend', __('admin.product_categories.is_recommend'))->value(false),
|
||||
]);
|
||||
}
|
||||
|
||||
public function getTreeList(Request $request){
|
||||
return $this->service->getTree();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use Slowlyo\OwlAdmin\Admin;
|
||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||
use App\Services\Admin\ProductService;
|
||||
use App\Admin\Components;
|
||||
use App\Models\Keyword;
|
||||
|
||||
class ProductController extends AdminController
|
||||
{
|
||||
protected string $serviceName = ProductService::class;
|
||||
|
||||
public function list():Page
|
||||
{
|
||||
$crud = $this->baseCRUD()->tableLayout('fixed')
|
||||
->headerToolbar([
|
||||
$this->createButton(),
|
||||
...$this->baseHeaderToolBar(),
|
||||
])
|
||||
->filter($this->baseFilter()->body([
|
||||
amis()->GroupControl()->mode('horizontal')->body([
|
||||
amis()->TextControl('sku', __('admin.products.sku'))
|
||||
->placeholder(__('admin.products.sku')),
|
||||
amis()->TextControl('name', __('admin.products.name'))
|
||||
->placeholder(__('admin.products.name')),
|
||||
]),
|
||||
]))
|
||||
->columns([
|
||||
amis()->TableColumn('name', __('admin.products.name'))->width('300px'),
|
||||
amis()->TableColumn('sku', __('admin.sku'))->sortable(true),
|
||||
amis()->TableColumn('category.name', __('admin.products.category')),
|
||||
amis()->TableColumn('cover', __('admin.products.cover'))->type('image')->height('50px')->width('50px')->enlargeAble(true),
|
||||
amis()->TableColumn('is_sale', __('admin.products.is_sale'))->type('switch'),
|
||||
amis()->TableColumn('is_recommend', __('admin.products.is_recommend'))->type('switch'),
|
||||
amis()->Operation()->label(__('admin.actions'))->buttons([
|
||||
$this->rowEditButton(),
|
||||
$this->rowDeleteButton(),
|
||||
])
|
||||
]);
|
||||
|
||||
return $this->baseList($crud);
|
||||
}
|
||||
|
||||
public function form(): Form
|
||||
{
|
||||
return $this->baseForm()->panelClassName('px-0')->body([
|
||||
amis()->Tabs()->tabsMode('line')->tabs([
|
||||
//基础信息
|
||||
amis()->Tab()->title(__('admin.products.tab1'))->body([
|
||||
amis()->Grid()->columns([
|
||||
amis()->Wrapper()->body([
|
||||
amis()->TextControl('name', __('admin.products.name'))->required(true),
|
||||
Components::make()->parentControl(admin_url('api/product_categories/tree-list'), 'category_id', __('admin.products.category')),
|
||||
|
||||
amis()->TextControl('spu', __('admin.products.spu'))->description('*未填写则自动生成唯一spu'),
|
||||
amis()->TextareaControl('sub_title', __('admin.products.sub_title'))->minRows(5),
|
||||
|
||||
Components::make()->sortControl('virtual_sales', __('admin.products.virtual_sales')),
|
||||
Components::make()->sortControl('stocks', __('admin.products.stocks'))->description('*已销售过的商品无法直接编辑库存,需前往商品库存中操作。'),
|
||||
|
||||
Components::make()->decimalControl('price', __('admin.products.price')),
|
||||
|
||||
amis()->SwitchControl('is_sale', __('admin.products.is_sale'))->value(false),
|
||||
amis()->SwitchControl('is_show', __('admin.products.is_show'))->value(false),
|
||||
|
||||
])->md(4),
|
||||
amis()->Wrapper()->body([
|
||||
Components::make()->imageControl('photos', __('admin.products.photos'))->multiple(true)->draggable(true)->required(true),
|
||||
Components::make()->cropImageControl('cover', __('admin.products.cover'))->description('*若不选择上传,则默认为相册第一张'),
|
||||
|
||||
Components::make()->sortControl('sort', __('admin.products.sort')),
|
||||
|
||||
amis()->SwitchControl('is_recommend', __('admin.products.is_recommend'))->value(false),
|
||||
amis()->SwitchControl('is_hot', __('admin.products.is_hot'))->value(false),
|
||||
amis()->SwitchControl('is_new', __('admin.products.is_new'))->value(false),
|
||||
|
||||
])->md(8)
|
||||
]),
|
||||
]),
|
||||
//详情,信息
|
||||
amis()->Tab()->title(__('admin.products.tab2'))->body([
|
||||
//详情,基础信息,运费模板,属性标签,
|
||||
amis()->Grid()->columns([
|
||||
amis()->Wrapper()->body([
|
||||
Components::make()->keywordsTagControl('t_ids', __('admin.products.tags'), 'product_tag'),
|
||||
amis()->SelectControl('shipping_tmp_id', __('admin.products.shipping_tmp_id'))->required(true),
|
||||
amis()->InputKV()->name('base_info')->label('参数信息')->keyPlaceholder('属性')->valuePlaceholder('值'),
|
||||
])->md(4),
|
||||
amis()->Wrapper()->body([
|
||||
Components::make()->fuEditorControl('description', __('admin.products.description')),
|
||||
])->md(8),
|
||||
]),
|
||||
]),
|
||||
//多属性商品
|
||||
amis()->Tab()->title(__('admin.products.tab3'))->body([
|
||||
|
||||
])
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
public function detail(): Form
|
||||
{
|
||||
return $this->baseDetail()->body([]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,8 @@ Route::group([
|
|||
'prefix' => 'api',
|
||||
], function (Router $router) {
|
||||
$router->get('keywords/tree-list', '\App\Admin\Controllers\KeywordController@getTreeList')->name('api.keywords.tree-list');
|
||||
|
||||
$router->get('product_categories/tree-list', '\App\Admin\Controllers\ProductCategoryController@getTreeList')->name('api.product_categories.tree-list');
|
||||
});
|
||||
|
||||
$router->resource('index', \App\Admin\Controllers\HomeController::class);
|
||||
|
|
@ -32,6 +34,10 @@ Route::group([
|
|||
|
||||
$router->resource('ads', \App\Admin\Controllers\AdController::class);
|
||||
|
||||
$router->resource('product_categories', \App\Admin\Controllers\ProductCategoryController::class);
|
||||
|
||||
$router->resource('products', \App\Admin\Controllers\ProductController::class);
|
||||
|
||||
//修改上传
|
||||
$router->post('upload_file', [\App\Admin\Controllers\IndexController::class, 'uploadFile']);
|
||||
$router->post('upload_image', [\App\Admin\Controllers\IndexController::class, 'uploadImage']);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models\Filters;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
use App\Models\ProductCategory;
|
||||
|
||||
class ProductCategoryFilter extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
public function name($name)
|
||||
{
|
||||
return $this->where('name','like', '%'.$name.'%')
|
||||
->orWhere('key','like', '%'.$name.'%');
|
||||
}
|
||||
|
||||
public function parentName($parent_name)
|
||||
{
|
||||
if(request('has_owner', 1)){
|
||||
$this->where(function($q) use ($parent_name){
|
||||
$q->where('name','like', '%'.$parent_name.'%')
|
||||
->orWhere('key','like', '%'.$parent_name.'%');
|
||||
});
|
||||
}
|
||||
return $this->orWhere('path','like', '%-'.
|
||||
ProductCategory::where('name','like', '%'.$parent_name.'%')->orWhere('key','like', '%'.$parent_name.'%')->value('id')
|
||||
. '-%' ?? '');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models\Filters;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class ProductFilter extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
public function name($name)
|
||||
{
|
||||
return $this->where('name','like', '%'.$name.'%');
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use EloquentFilter\Filterable;
|
||||
use App\Admin\Components;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Keyword extends Model
|
||||
{
|
||||
|
|
@ -31,19 +30,12 @@ class Keyword extends Model
|
|||
$keyword->lv = 1;
|
||||
// 将 path 设为 -
|
||||
$keyword->path = '-';
|
||||
if(empty($keyword->key)){
|
||||
$keyword->key = Str::quickRandom($length = 16);
|
||||
}
|
||||
} else {
|
||||
// 将层级设为父类目的层级 + 1
|
||||
$keyword->lv = $keyword->parent->lv + 1;
|
||||
$keyword->lv = $keyword->parent->lv ++;
|
||||
$keyword->parent_key = $keyword->parent->key;
|
||||
// 将 path 值设为父类目的 path 追加父类目 ID 以及最后跟上一个 - 分隔符
|
||||
$keyword->path = $keyword->parent->path.$keyword->parent_id.'-';
|
||||
//当前key是否为空
|
||||
if(empty($keyword->key)){
|
||||
$keyword->key = $keyword->parent_key . '_' . (self::where('parent_key', $keyword->parent_key)->count() + 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use EloquentFilter\Filterable;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use Filterable;
|
||||
|
||||
protected function serializeDate(\DateTimeInterface $date)
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'sub_title', 'cover', 'photos', 'base_info', 'description',
|
||||
'spu', 'sku', 'parent_id', 'category_id', 't_ids',
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use EloquentFilter\Filterable;
|
||||
|
||||
class ProductCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use Filterable;
|
||||
|
||||
protected function serializeDate(\DateTimeInterface $date)
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'key', 'cover',
|
||||
'parent_id', 'parent_key', 'lv', 'path',
|
||||
'is_enable', 'is_show', 'is_recommend',
|
||||
'sort',
|
||||
];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
// 监听 Keyword 的创建事件,用于初始化 path 和 lv 字段值
|
||||
static::saving(function ($keyword) {
|
||||
// 如果创建的是一个根类目
|
||||
if (! $keyword->parent_id) {
|
||||
// 将层级设为 1
|
||||
$keyword->lv = 1;
|
||||
// 将 path 设为 -
|
||||
$keyword->path = '-';
|
||||
} else {
|
||||
// 将层级设为父类目的层级 + 1
|
||||
$keyword->lv = $keyword->parent->lv ++;
|
||||
$keyword->parent_key = $keyword->parent->key;
|
||||
// 将 path 值设为父类目的 path 追加父类目 ID 以及最后跟上一个 - 分隔符
|
||||
$keyword->path = $keyword->parent->path.$keyword->parent_id.'-';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(static::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(static::class, 'parent_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ class KeywordService extends BaseService
|
|||
$pid = Arr::get($data, 'parent_id');
|
||||
if ($pid != 0) {
|
||||
if ($this->parentIsChild($primaryKey, $pid)) {
|
||||
$this->setError('父级不允许设置为当前子权限');
|
||||
$this->setError('父级不允许设置为当前子级');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Admin;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use App\Models\ProductCategory;
|
||||
use App\Models\Filters\ProductCategoryFilter;
|
||||
use App\Traits\UploadTrait;
|
||||
|
||||
/**
|
||||
* @method ProductCategory getModel()
|
||||
* @method ProductCategory|\Illuminate\Database\Query\Builder query()
|
||||
*/
|
||||
class ProductCategoryService extends BaseService
|
||||
{
|
||||
protected string $modelName = ProductCategory::class;
|
||||
protected string $modelFilterName = ProductCategoryFilter::class;
|
||||
|
||||
use UploadTrait;
|
||||
|
||||
public function getTree()
|
||||
{
|
||||
$list = $this->query()->filter(request()->all(), $this->modelFilterName)->orderByDesc('sort')->get();
|
||||
$minNum = $list->min('parent_id');
|
||||
return !$list->isEmpty() ? array2tree($list->toArray(), $minNum) :[];
|
||||
}
|
||||
|
||||
public function parentIsChild($id, $pid): bool
|
||||
{
|
||||
$parent = $this->query()->find($pid);
|
||||
|
||||
do {
|
||||
if ($parent->parent_id == $id) {
|
||||
return true;
|
||||
}
|
||||
// 如果没有parent 则为顶级 退出循环
|
||||
$parent = $parent->parent;
|
||||
} while ($parent);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return ['items' => $this->getTree()];
|
||||
}
|
||||
|
||||
public function store($data): bool
|
||||
{
|
||||
if ($this->hasRepeated($data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$columns = $this->getTableColumns();
|
||||
|
||||
$model = $this->getModel();
|
||||
|
||||
$data['cover'] = $this->saveImage('cover', 'product_category/cover')[0] ?? '';
|
||||
foreach ($data as $k => $v) {
|
||||
if (!in_array($k, $columns)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$model->setAttribute($k, $v);
|
||||
}
|
||||
|
||||
return $model->save();
|
||||
}
|
||||
|
||||
public function update($primaryKey, $data): bool
|
||||
{
|
||||
if ($this->hasRepeated($data, $primaryKey)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$columns = $this->getTableColumns();
|
||||
|
||||
$pid = Arr::get($data, 'parent_id');
|
||||
if ($pid != 0) {
|
||||
if ($this->parentIsChild($primaryKey, $pid)) {
|
||||
$this->setError('父级不允许设置为当前子级');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$model = $this->query()->whereKey($primaryKey)->first();
|
||||
|
||||
if(isset($data['cover'])){
|
||||
$data['cover'] = $this->saveImage('cover', 'articles/cover')[0] ?? '';
|
||||
}
|
||||
foreach ($data as $k => $v) {
|
||||
if (!in_array($k, $columns)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$model->setAttribute($k, $v);
|
||||
}
|
||||
|
||||
return $model->save();
|
||||
}
|
||||
|
||||
|
||||
public function hasRepeated($data, $id = 0): bool
|
||||
{
|
||||
$query = $this->query()->when($id, fn($query) => $query->where('id', '<>', $id));
|
||||
|
||||
if (isset($data['key']) && (clone $query)->where('key', $data['key'])->exists()) {
|
||||
$this->setError('KEY重复');
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function delete(string $ids): mixed
|
||||
{
|
||||
$ids = explode(',', $ids);
|
||||
if(count($ids) == 1){
|
||||
$this->query()->where('path', 'like', '%-'.$ids[0].'-%')->delete();
|
||||
}
|
||||
|
||||
return $this->query()->whereIn('id', $ids)->delete();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Admin;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Models\Filters\ProductFilter;
|
||||
use App\Traits\UploadTrait;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
/**
|
||||
* @method Product getModel()
|
||||
* @method Product|\Illuminate\Database\Query\Builder query()
|
||||
*/
|
||||
class ProductService extends BaseService
|
||||
{
|
||||
use UploadTrait;
|
||||
|
||||
protected string $modelName = Product::class;
|
||||
|
||||
protected string $modelFilterName = ProductFilter::class;
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Slowlyo\OwlAdmin\Admin;
|
||||
use Slowlyo\OwlAdmin\Renderers\Drawer;
|
||||
use Slowlyo\OwlAdmin\Renderers\Dialog;
|
||||
use Slowlyo\OwlAdmin\Renderers\DrawerAction;
|
||||
use Slowlyo\OwlAdmin\Renderers\DialogAction;
|
||||
use Slowlyo\OwlAdmin\Renderers\LinkAction;
|
||||
|
||||
trait CustomActionTrait
|
||||
{
|
||||
/**
|
||||
* 新增按钮
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $size
|
||||
* @param string $width
|
||||
*
|
||||
* @return DialogAction|DrawerAction|LinkAction
|
||||
*/
|
||||
protected function createTypeButton(string $type = '', string $size = '', string $width = ''): DialogAction|DrawerAction|LinkAction
|
||||
{
|
||||
switch ($type) {
|
||||
case 'drawer':
|
||||
$form = $this->form(false)->api($this->getStorePath())->onEvent([]);
|
||||
|
||||
$drawer = Drawer::make()->title(__('admin.create'))->body($form)->closeOnOutside();
|
||||
if($width){
|
||||
$drawer->width($width);
|
||||
}else{
|
||||
$drawer->size($size);
|
||||
}
|
||||
$button = DrawerAction::make()->drawer($drawer);
|
||||
break;
|
||||
case 'dialog':
|
||||
$form = $this->form(false)->api($this->getStorePath())->onEvent([]);
|
||||
|
||||
$button = DialogAction::make()->dialog(
|
||||
Dialog::make()->title(__('admin.create'))->body($form)->size($size)
|
||||
);
|
||||
break;
|
||||
default:
|
||||
$button = LinkAction::make()->link($this->getCreatePath());
|
||||
break;
|
||||
}
|
||||
|
||||
return $button->label(__('admin.create'))->icon('fa fa-add')->level('primary');
|
||||
}
|
||||
|
||||
/**
|
||||
* 行编辑按钮
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $size
|
||||
* @param string $width
|
||||
*
|
||||
* @return DialogAction|DrawerAction|LinkAction
|
||||
*/
|
||||
protected function rowEditTypeButton(string $type = '', string $size = '', string $width = ''): DialogAction|DrawerAction|LinkAction
|
||||
{
|
||||
switch ($type) {
|
||||
case 'drawer':
|
||||
$form = $this->form(true)
|
||||
->api($this->getUpdatePath())
|
||||
->initApi($this->getEditGetDataPath())
|
||||
->redirect('')
|
||||
->onEvent([]);
|
||||
|
||||
$drawer = Drawer::make()->title(__('admin.edit'))->body($form)->closeOnOutside();
|
||||
|
||||
if($width){
|
||||
$drawer->width($width);
|
||||
}else{
|
||||
$drawer->size($size);
|
||||
}
|
||||
|
||||
$button = DrawerAction::make()->drawer($drawer);
|
||||
break;
|
||||
case 'dialog':
|
||||
$form = $this->form(true)
|
||||
->api($this->getUpdatePath())
|
||||
->initApi($this->getEditGetDataPath())
|
||||
->redirect('')
|
||||
->onEvent([]);
|
||||
|
||||
$button = DialogAction::make()->dialog(
|
||||
Dialog::make()->title(__('admin.edit'))->body($form)->size($size)
|
||||
);
|
||||
break;
|
||||
default:
|
||||
$button = LinkAction::make()->link($this->getEditPath());
|
||||
break;
|
||||
}
|
||||
|
||||
return $button->label(__('admin.edit'))->icon('fa-regular fa-pen-to-square')->level('link');
|
||||
}
|
||||
|
||||
/**
|
||||
* 行详情按钮
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $size
|
||||
* @param string $width
|
||||
*
|
||||
* @return DialogAction|DrawerAction|LinkAction
|
||||
*/
|
||||
protected function rowShowTypeButton(string $type = '', string $size = '', string $width = ''): DialogAction|DrawerAction|LinkAction
|
||||
{
|
||||
switch ($type) {
|
||||
case 'drawer':
|
||||
$drawer = Drawer::make()->title(__('admin.show'))->name('detail_info')->body($this->detail('$id'))->closeOnOutside();
|
||||
|
||||
if($width){
|
||||
$drawer->width($width);
|
||||
}else{
|
||||
$drawer->size($size);
|
||||
}
|
||||
//补充详情操作按钮扩展
|
||||
try{
|
||||
$actions = $this->detailActions();
|
||||
}catch(\BadMethodCallException $e){
|
||||
$actions = [];
|
||||
}
|
||||
$drawer->actions($actions);
|
||||
|
||||
$button = DrawerAction::make()->drawer($drawer);
|
||||
break;
|
||||
case 'dialog':
|
||||
//补充详情操作按钮扩展
|
||||
$dialog = Dialog::make()->title(__('admin.show'))->name('detail_info')->body($this->detail('$id'))->size($size);
|
||||
try{
|
||||
$actions = $this->detailActions();
|
||||
}catch(\BadMethodCallException $e){
|
||||
$actions = [];
|
||||
}
|
||||
$dialog->actions($actions);
|
||||
$button = DialogAction::make()->dialog($dialog);
|
||||
break;
|
||||
default:
|
||||
$button = LinkAction::make()->link($this->getShowPath());
|
||||
break;
|
||||
}
|
||||
|
||||
return $button->label(__('admin.show'))->icon('fa-regular fa-eye')->level('link');
|
||||
}
|
||||
}
|
||||
|
|
@ -11,8 +11,7 @@
|
|||
"laravel/framework": "^10.10",
|
||||
"laravel/sanctum": "^3.3",
|
||||
"laravel/tinker": "^2.8",
|
||||
"rap2hpoutre/fast-excel": "^5.4",
|
||||
"slowlyo/owl-admin": "^3.5",
|
||||
"slowlyo/owl-admin": "^3.0",
|
||||
"tucker-eric/eloquentfilter": "^3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "6ce90738fadc40a447dfead6b131ec62",
|
||||
"content-hash": "b2333ae7a977ba073ff6ef0f01f5de43",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aliyuncs/oss-sdk-php",
|
||||
|
|
@ -1994,79 +1994,6 @@
|
|||
],
|
||||
"time": "2023-02-08T01:06:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "openspout/openspout",
|
||||
"version": "v4.23.0",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/openspout/openspout/v4.23.0/openspout-openspout-v4.23.0.zip",
|
||||
"reference": "28f6a0e45acc3377f34c26cc3866e21f0447e0c8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-dom": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-filter": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-xmlreader": "*",
|
||||
"ext-zip": "*",
|
||||
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-zlib": "*",
|
||||
"friendsofphp/php-cs-fixer": "^3.46.0",
|
||||
"infection/infection": "^0.27.9",
|
||||
"phpbench/phpbench": "^1.2.15",
|
||||
"phpstan/phpstan": "^1.10.55",
|
||||
"phpstan/phpstan-phpunit": "^1.3.15",
|
||||
"phpstan/phpstan-strict-rules": "^1.5.2",
|
||||
"phpunit/phpunit": "^10.5.5"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)",
|
||||
"ext-mbstring": "To handle non UTF-8 CSV files (if \"iconv\" is not already installed)"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"OpenSpout\\": "src/"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Adrien Loison",
|
||||
"email": "adrien@box.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way",
|
||||
"homepage": "https://github.com/openspout/openspout",
|
||||
"keywords": [
|
||||
"OOXML",
|
||||
"csv",
|
||||
"excel",
|
||||
"memory",
|
||||
"odf",
|
||||
"ods",
|
||||
"office",
|
||||
"open",
|
||||
"php",
|
||||
"read",
|
||||
"scale",
|
||||
"spreadsheet",
|
||||
"stream",
|
||||
"write",
|
||||
"xlsx"
|
||||
],
|
||||
"time": "2024-01-09T09:30:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoption/phpoption",
|
||||
"version": "1.9.2",
|
||||
|
|
@ -2704,116 +2631,18 @@
|
|||
],
|
||||
"time": "2023-11-08T05:53:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "rap2hpoutre/fast-excel",
|
||||
"version": "v5.4.0",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/rap2hpoutre/fast-excel/v5.4.0/rap2hpoutre-fast-excel-v5.4.0.zip",
|
||||
"reference": "27c346ca2a4de448f856d0926b05d7e2511e43b8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
|
||||
"openspout/openspout": "^4.1.1",
|
||||
"php": "^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/database": "^6.20.12 || ^7.30.4 || ^8.24.0 || ^9.0 || ^10.0 || ^11.0",
|
||||
"phpunit/phpunit": "^9.5 || ^10.1",
|
||||
"squizlabs/php_codesniffer": "3.*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Rap2hpoutre\\FastExcel\\Providers\\FastExcelServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions/fastexcel.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Rap2hpoutre\\FastExcel\\": "src/"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "rap2h",
|
||||
"email": "raphaelht@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Fast Excel import/export for Laravel",
|
||||
"keywords": [
|
||||
"csv",
|
||||
"excel",
|
||||
"laravel",
|
||||
"xls",
|
||||
"xlsx"
|
||||
],
|
||||
"time": "2024-03-06T16:03:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "slowlyo/laravel-support",
|
||||
"version": "v0.0.1",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/slowlyo/laravel-support/v0.0.1/slowlyo-laravel-support-v0.0.1.zip",
|
||||
"reference": "8c6d3b2cb176518a8e0cc87eb35fcce93c72c49b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"laravel/framework": ">=8",
|
||||
"php": ">=7.4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Slowlyo\\Support\\SupportServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"./src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Slowlyo\\Support\\": "src/"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Slowlyo",
|
||||
"email": "slowlyo_email@qq.com"
|
||||
}
|
||||
],
|
||||
"description": "php/laravel部分代码封装",
|
||||
"time": "2024-02-22T09:48:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "slowlyo/owl-admin",
|
||||
"version": "v3.5.6",
|
||||
"version": "v3.0.8",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/slowlyo/owl-admin/v3.5.6/slowlyo-owl-admin-v3.5.6.zip",
|
||||
"reference": "29767ca4deebfcd3676dc055c750a185484ff77f",
|
||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/slowlyo/owl-admin/v3.0.8/slowlyo-owl-admin-v3.0.8.zip",
|
||||
"reference": "a678c5ade64521bd4ef8c1f61c7cd24b96a4f1b5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-gd": "*",
|
||||
"ext-zip": "*",
|
||||
"illuminate/support": ">=9",
|
||||
"php": ">=8.0",
|
||||
"slowlyo/laravel-support": "*"
|
||||
"illuminate/support": "~9|~10",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
|
@ -2839,20 +2668,20 @@
|
|||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "slowlyo",
|
||||
"email": "slowlyo_email@qq.com",
|
||||
"homepage": "https://github.com/slowlyo"
|
||||
"name": "Slowlyo",
|
||||
"email": "slowlyo_email@qq.com.com",
|
||||
"homepage": "https://gitee.com/slowlyo"
|
||||
}
|
||||
],
|
||||
"description": "基于 laravel、amis 开发的后台框架~",
|
||||
"homepage": "https://github.com/slowlyo/owl-admin",
|
||||
"keywords": [
|
||||
"OwlAdmin",
|
||||
"admin",
|
||||
"amis",
|
||||
"laravel",
|
||||
"owl-admin"
|
||||
"laravel"
|
||||
],
|
||||
"time": "2024-04-02T06:12:27+00:00"
|
||||
"time": "2023-12-01T14:59:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ return [
|
|||
'name' => 'Owl Admin',
|
||||
|
||||
// 应用 logo
|
||||
'logo' => '/admin-assets/logo.png',
|
||||
'logo' => '/admin/logo.png',
|
||||
|
||||
// 默认头像
|
||||
'default_avatar' => '/admin-assets/default-avatar.png',
|
||||
'default_avatar' => '/admin/default-avatar.png',
|
||||
|
||||
// 应用安装目录
|
||||
'directory' => app_path('Admin'),
|
||||
|
|
@ -30,27 +30,25 @@ return [
|
|||
|
||||
'auth' => [
|
||||
// 是否开启验证码
|
||||
'login_captcha' => env('ADMIN_LOGIN_CAPTCHA', true),
|
||||
'login_captcha' => env('ADMIN_LOGIN_CAPTCHA', true),
|
||||
// 是否开启认证
|
||||
'enable' => true,
|
||||
'enable' => true,
|
||||
// 是否开启鉴权
|
||||
'permission' => true,
|
||||
// token 有效期 (分钟), 为空则不会过期
|
||||
'token_expiration' => null,
|
||||
'guard' => 'admin',
|
||||
'guards' => [
|
||||
'permission' => true,
|
||||
'guard' => 'admin',
|
||||
'guards' => [
|
||||
'admin' => [
|
||||
'driver' => 'sanctum',
|
||||
'provider' => 'admin',
|
||||
],
|
||||
],
|
||||
'providers' => [
|
||||
'providers' => [
|
||||
'admin' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => \Slowlyo\OwlAdmin\Models\AdminUser::class,
|
||||
],
|
||||
],
|
||||
'except' => [
|
||||
'except' => [
|
||||
|
||||
],
|
||||
],
|
||||
|
|
@ -111,10 +109,6 @@ return [
|
|||
'footer' => '<a href="https://github.com/slowlyo/owl-admin" target="_blank">Owl Admin</a>',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'connection' => env('ADMIN_DB_CONNECTION') ?? env('DB_CONNECTION', 'mysql'),
|
||||
],
|
||||
|
||||
'models' => [
|
||||
'admin_user' => \Slowlyo\OwlAdmin\Models\AdminUser::class,
|
||||
'admin_role' => \Slowlyo\OwlAdmin\Models\AdminRole::class,
|
||||
|
|
@ -122,10 +116,6 @@ return [
|
|||
'admin_permission' => \Slowlyo\OwlAdmin\Models\AdminPermission::class,
|
||||
],
|
||||
|
||||
'modules_namespace' => 'AdminModules',
|
||||
|
||||
'modules_dir' => base_path('admin-modules'),
|
||||
|
||||
'modules' => [
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('product_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->comment('名称');
|
||||
$table->string('key')->nullable()->unique();
|
||||
$table->string('cover')->nullable()->comment('封面');
|
||||
|
||||
$table->unsignedBigInteger('parent_id')->default(0)->comment('上级ID');
|
||||
$table->string('parent_key')->nullable('上级key');
|
||||
$table->unsignedInteger('lv')->default(1)->comment('层级');
|
||||
$table->string('path')->default('-')->comment('所有的父级ID');
|
||||
|
||||
$table->unsignedTinyInteger('is_enable')->default(1)->comment('启用开关');
|
||||
$table->unsignedTinyInteger('is_show')->default(0)->comment('显示开关');
|
||||
$table->unsignedTinyInteger('is_recommend')->default(0)->comment('推荐开关');
|
||||
|
||||
$table->unsignedInteger('sort')->default(0)->comment('排序');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('product_categories');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->comment('名称');
|
||||
$table->string('spu')->nullable()->comment('spu');
|
||||
$table->string('sku')->nullable()->unique()->comment('sku');
|
||||
$table->unsignedBigInteger('parent_id')->nullable()->comment('父级');
|
||||
$table->unsignedBigInteger('category_id')->nullable()->comment('分类');
|
||||
$table->string('t_ids')->nullable()->comment('标签');
|
||||
|
||||
$table->text('sub_title')->nullable()->comment('副标题');
|
||||
$table->string('cover')->nullable()->comment('封面');
|
||||
$table->text('photos')->nullable()->comment('图片');
|
||||
$table->text('base_info')->nullable()->comment('基础信息');
|
||||
$table->text('description')->nullable()->comment('详情');
|
||||
|
||||
$table->text('attr_config')->nullable()->comment('属性');
|
||||
$table->text('attr_values')->nullable()->comment('属性值');//sku才有属性值
|
||||
|
||||
$table->unsignedInteger('virtual_sales')->default(0)->comment('虚拟销量');
|
||||
$table->unsignedInteger('sales')->default(0)->comment('销量');
|
||||
|
||||
$table->unsignedTinyInteger('is_sale')->default(0)->comment('上架开关');
|
||||
$table->unsignedTinyInteger('is_show')->default(0)->comment('显示开关');
|
||||
$table->unsignedTinyInteger('is_recommend')->default(0)->comment('推荐开关');
|
||||
$table->unsignedTinyInteger('is_hot')->default(0)->comment('热销开关');
|
||||
$table->unsignedTinyInteger('is_new')->default(0)->comment('上新开关');
|
||||
|
||||
$table->unsignedDecimal('sale_price', 10, 2)->default(0.00)->comment('售价');
|
||||
$table->unsignedBigInteger('shipping_tmp_id')->nullable()->comment('运费模板');
|
||||
$table->unsignedInteger('stocks')->default(0)->comment('库存');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('products');
|
||||
}
|
||||
};
|
||||
|
|
@ -30,12 +30,23 @@ class AdminMenuSeeder extends Seeder
|
|||
['title' => 'keywords', 'icon' => 'ph:codesandbox-logo-light', 'url' => '/system/keywords', 'order'=>6]
|
||||
],
|
||||
],
|
||||
['title' => 'web_content', 'icon' => 'ic:outline-collections-bookmark', 'url' => '', 'order'=>3,
|
||||
['title' => 'web_content', 'icon' => 'ic:outline-collections-bookmark', 'url' => '/web_content', 'order'=>3,
|
||||
'children' =>[
|
||||
['title'=>'articles', 'icon'=>'ic:outline-article','url'=>'/articles', 'order'=>1],
|
||||
['title'=>'ads', 'icon'=>'lets-icons:img-box','url'=>'/ads', 'order'=>2],
|
||||
]
|
||||
]
|
||||
],
|
||||
['title' => 'mall', 'icon' => 'uil:shop', 'url' => '/mall', 'order'=> 4,
|
||||
'children' => [
|
||||
['title'=>'product_categories', 'icon'=>'tabler:category-2', 'url'=>'/product_categories', 'order'=>1],
|
||||
['title'=>'products', 'icon'=>'ep:goods', 'url'=>'/products', 'order'=>2],
|
||||
['title'=>'shipping_tmps', 'icon'=>'streamline:shipping-truck', 'url'=>'/shipping_tmps', 'order'=>3],
|
||||
['title'=>'orders', 'icon'=>'icon-park-outline:transaction-order', 'url'=>'/orders', 'order'=>4],
|
||||
['title'=>'shipping_orders', 'icon'=>'akar-icons:shipping-box-02', 'url'=>'/shipping_orders', 'order'=>5],
|
||||
['title'=>'after_orders', 'icon'=>'material-symbols-light:inactive-order-outline-sharp', 'url'=>'/after_orders', 'order'=>6],
|
||||
['title'=>'product_stocks', 'icon'=>'material-symbols:warehouse-outline-rounded', 'url'=>'/product_stocks', 'order'=>7],
|
||||
]
|
||||
],
|
||||
];
|
||||
DB::table('admin_menus')->truncate();
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ return [
|
|||
'cancel' => 'Cancel',
|
||||
'please_login' => 'Please Login',
|
||||
'unauthorized' => 'Unauthorized',
|
||||
'user_disabled' => 'The user has been disabled',
|
||||
|
||||
'code_generators' => [
|
||||
'remark1' => 'For more parameters, please refer to',
|
||||
|
|
@ -131,10 +130,6 @@ return [
|
|||
'save_current_config' => 'Save Current Config',
|
||||
'input_config_name' => 'Please Input Config Name',
|
||||
'same_name_tips' => 'Configurations with the same name will be overwritten',
|
||||
'save_path_dir' => 'Primary application',
|
||||
'save_path_select' => 'Select Directory',
|
||||
'save_path_select_tips' => 'Project root directory or plugin root directory can be selected',
|
||||
'save_path_label_prefix' => 'Plugins -> ',
|
||||
],
|
||||
|
||||
'admin_users' => 'Admin Users',
|
||||
|
|
@ -147,7 +142,6 @@ return [
|
|||
'old_password_required' => 'Old Password Required',
|
||||
'old_password_error' => 'Old Password Error',
|
||||
'username_already_exists' => 'Username Already Exists',
|
||||
'cannot_delete' => 'The super administrator cannot be deleted',
|
||||
],
|
||||
|
||||
'admin_roles' => 'Admin Roles',
|
||||
|
|
@ -159,8 +153,6 @@ return [
|
|||
'name_already_exists' => 'Role Name Already Exists',
|
||||
'slug_already_exists' => 'Role Slug Already Exists',
|
||||
'set_permissions' => 'Set Permissions',
|
||||
'cannot_delete' => 'The super administrator cannot be deleted',
|
||||
'used' => 'You cannot delete a role that is in use',
|
||||
],
|
||||
|
||||
'admin_permissions' => 'Permissions',
|
||||
|
|
@ -185,11 +177,8 @@ return [
|
|||
'icon' => 'Icon',
|
||||
'icon_description' => 'Please refer to ',
|
||||
'url' => 'Url',
|
||||
'iframe' => 'Iframe',
|
||||
'iframe_description' => 'After opening, the page will be cached and will not be reloaded when reopened',
|
||||
'visible' => 'Visible',
|
||||
'type' => 'Type',
|
||||
'keep_alive' => 'KeepAlive',
|
||||
'api' => 'Page API',
|
||||
'api_description' => 'schemaApi, the api for page initialization requests, needs to be consistent with queryPath in Controller',
|
||||
'route' => 'Route',
|
||||
|
|
@ -205,7 +194,6 @@ return [
|
|||
'parent_id_not_allow' => 'The parent menu cannot be set to the current submenu',
|
||||
'component' => 'Component',
|
||||
'component_desc' => 'amis by default. Not a custom front-end page, please do not modify it',
|
||||
'url_exists' => 'menu path duplication',
|
||||
],
|
||||
|
||||
'extensions' => [
|
||||
|
|
@ -262,6 +250,6 @@ Backup important data before performing operations!!!<br>
|
|||
'selected_rows' => 'Selected Rows',
|
||||
'page_no_data' => 'Current page has no data',
|
||||
'selected_rows_no_data' => 'No data is selected',
|
||||
'please_install_laravel_excel' => 'Please install the package "rap2hpoutre/fast-excel" first',
|
||||
'please_install_laravel_excel' => 'Please install the package "maatwebsite/excel" first',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -60,7 +60,21 @@ return [
|
|||
'cancel' => '取消',
|
||||
'please_login' => '请先登录',
|
||||
'unauthorized' => '无权访问',
|
||||
'user_disabled' => '用户已被禁用',
|
||||
'id' => 'ID',
|
||||
|
||||
'components' => [
|
||||
'content' => '内容',
|
||||
'parent_select' => '父级',
|
||||
'order' => '排序',
|
||||
'decimal' => '金额',
|
||||
'status' => '状态',
|
||||
'status_map' => [
|
||||
'enabled' => '已启用',
|
||||
'disabled' => '已禁用',
|
||||
],
|
||||
'tag' => '标签',
|
||||
'files' => '文件'
|
||||
],
|
||||
|
||||
'code_generators' => [
|
||||
'remark1' => '额外参数请参考',
|
||||
|
|
@ -130,11 +144,7 @@ return [
|
|||
'fill' => '填充',
|
||||
'save_current_config' => '保存当前配置',
|
||||
'input_config_name' => '请填写配置名称',
|
||||
'same_name_tips' => '相同名称的配置将会被覆盖',
|
||||
'save_path_dir' => '主应用',
|
||||
'save_path_select' => '选择目录',
|
||||
'save_path_select_tips' => '可选择项目根目录或插件根目录',
|
||||
'save_path_label_prefix' => '插件 -> ',
|
||||
'same_name_tips' => '相同名称的配置将会被覆盖'
|
||||
],
|
||||
|
||||
'admin_users' => '管理员',
|
||||
|
|
@ -147,7 +157,8 @@ return [
|
|||
'old_password_required' => '请输入原密码',
|
||||
'old_password_error' => '原密码错误',
|
||||
'username_already_exists' => '用户名已存在',
|
||||
'cannot_delete' => '不可删除超级管理员',
|
||||
'lock' => '锁定',
|
||||
'edit_password' => '修改密码'
|
||||
],
|
||||
|
||||
'admin_roles' => '角色',
|
||||
|
|
@ -159,8 +170,6 @@ return [
|
|||
'name_already_exists' => '角色名称已存在',
|
||||
'slug_already_exists' => '角色标识已存在',
|
||||
'set_permissions' => '设置权限',
|
||||
'cannot_delete' => '不可删除超级管理员',
|
||||
'used' => '不可删除正在使用的角色',
|
||||
],
|
||||
|
||||
'admin_permissions' => '权限',
|
||||
|
|
@ -187,12 +196,9 @@ return [
|
|||
'url' => '链接',
|
||||
'visible' => '可见',
|
||||
'type' => '类型',
|
||||
'iframe' => 'Iframe',
|
||||
'iframe_description' => '开启后页面将缓存,重新打开时不会重新加载',
|
||||
'api' => '页面Api',
|
||||
'api_description' => 'schemaApi, 页面初始化请求的api, 需要与Controller中的queryPath一致',
|
||||
'route' => '路由',
|
||||
'keep_alive' => '缓存页面',
|
||||
'link' => '外链',
|
||||
'class_name' => '类名',
|
||||
'class_name_description' => '菜单的CSS类名, 一般用于自定义样式',
|
||||
|
|
@ -205,7 +211,6 @@ return [
|
|||
'parent_id_not_allow' => '父级菜单不允许设置为当前子菜单',
|
||||
'component' => '组件',
|
||||
'component_desc' => '默认为 amis , 非自定义前端页面请勿修改',
|
||||
'url_exists' => '菜单路径重复',
|
||||
],
|
||||
|
||||
'extensions' => [
|
||||
|
|
@ -265,6 +270,10 @@ return [
|
|||
'please_install_laravel_excel' => '请先安装 laravel-excel 扩展',
|
||||
],
|
||||
'keywords' => [
|
||||
'name' => '名称',
|
||||
'key' => 'KEY',
|
||||
'value' => '值',
|
||||
'sort' => '排序',
|
||||
'search_name' => '名称/KEY',
|
||||
'parent_keyword' => '父级关键字',
|
||||
],
|
||||
|
|
@ -302,5 +311,43 @@ return [
|
|||
'mini_id' => '小程序ID',
|
||||
'mini_link'=> '小程序路径'
|
||||
],
|
||||
],
|
||||
'product_categories' => [
|
||||
'name' => '名称',
|
||||
'key' => 'KEY',
|
||||
'cover'=>'分类图',
|
||||
'sort'=>'排序',
|
||||
'is_enable' => '启用',
|
||||
'is_show' => '展示',
|
||||
'is_recommend' => '推荐'
|
||||
],
|
||||
'products' => [
|
||||
'name' => '名称',
|
||||
'spu' => 'SPU',
|
||||
'sku' => 'SKU',
|
||||
'category' => '分类',
|
||||
'sub_title'=> '副标题',
|
||||
'cover' => '封面',
|
||||
'photos' => '相册',
|
||||
'base_info' => '基础信息',
|
||||
'description' => '详情',
|
||||
'price' => '售价',
|
||||
'virtual_sales' => '虚拟销量',
|
||||
'stocks' => '库存',
|
||||
'tags' => '标签',
|
||||
'shipping_tmp_id' => '运费模板',
|
||||
|
||||
'sort' => '排序',
|
||||
|
||||
'is_sale' => '上架',
|
||||
'is_show' => '展示',
|
||||
|
||||
'is_recommend' => '推荐',
|
||||
'is_hot' => '热销',
|
||||
'is_new' => '新品',
|
||||
|
||||
'tab1' => '基础信息',
|
||||
'tab2' => '详细信息',
|
||||
'tab3' => '规格属性',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -12,5 +12,13 @@ return [
|
|||
'keywords' => '数据字典',
|
||||
'web_content' => '内容管理',
|
||||
'articles' => '文章管理',
|
||||
'ads' => '广告管理',
|
||||
'ads' => '广告管理',
|
||||
'mall' => '商城管理',
|
||||
'product_categories'=> '商品分类',
|
||||
'products' => '商品管理',
|
||||
'shipping_tmps' => '运费模板',
|
||||
'orders' => '订单管理',
|
||||
'shipping_orders' => '发货管理',
|
||||
'after_orders' => '售后管理',
|
||||
'product_stocks' => '商品库存',
|
||||
];
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},s=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},t=[];s.forEach(function(e){t.push(e),t.push(e.toUpperCase()),t.push(o(e))});var i={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{n as conf,i as language};
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={comments:{lineComment:"#"}},t={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{e as conf,t as language};
|
||||
|
|
@ -1 +0,0 @@
|
|||
var e={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};export{e as conf,s as language};
|
||||
Binary file not shown.
|
|
@ -1,2 +0,0 @@
|
|||
var n=function(e){return"\\b"+e+"\\b"},t="[_a-zA-Z]",o="[_a-zA-Z0-9]",r=n(""+t+o+"*"),i=["targetScope","resource","module","param","var","output","for","in","if","existing"],a=["true","false","null"],s="[ \\t\\r\\n]",c="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
|
||||
`,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},l={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:i,namedLiterals:a,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:s},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:c,action:{token:"number"}},{regex:r,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};export{g as conf,l as language};
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
import{B as b,c as B,b as T,m as E,a as S,e as z,f as x,r as L,g as N}from"./index-C8YrUFHM.js";import"./tslib.es6-BDyQ-Jie.js";function r(t,n){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=n,this._projection=new BMap.MercatorProjection}r.prototype.type="bmap";r.prototype.dimensions=["lng","lat"];r.prototype.setZoom=function(t){this._zoom=t};r.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))};r.prototype.setMapOffset=function(t){this._mapOffset=t};r.prototype.getBMap=function(){return this._bmap};r.prototype.dataToPoint=function(t){var n=new BMap.Point(t[0],t[1]),e=this._bmap.pointToOverlayPixel(n),a=this._mapOffset;return[e.x-a[0],e.y-a[1]]};r.prototype.pointToData=function(t){var n=this._mapOffset;return t=this._bmap.overlayPixelToPoint({x:t[0]+n[0],y:t[1]+n[1]}),[t.lng,t.lat]};r.prototype.getViewRect=function(){var t=this._api;return new b(0,0,t.getWidth(),t.getHeight())};r.prototype.getRoamTransform=function(){return B()};r.prototype.prepareCustoms=function(){var t=this.getViewRect();return{coordSys:{type:"bmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:T(this.dataToPoint,this),size:T(V,this)}}};r.prototype.convertToPixel=function(t,n,e){return this.dataToPoint(e)};r.prototype.convertFromPixel=function(t,n,e){return this.pointToData(e)};function V(t,n){return n=n||[0,0],E([0,1],function(e){var a=n[e],o=t[e]/2,f=[],m=[];return f[e]=a-o,m[e]=a+o,f[1-e]=m[1-e]=n[1-e],Math.abs(this.dataToPoint(f)[e]-this.dataToPoint(m)[e])},this)}var _;r.dimensions=r.prototype.dimensions;function H(){function t(n){this._root=n}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(n){return n.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}r.create=function(t,n){var e,a=n.getDom();return t.eachComponent("bmap",function(o){var f=n.getZr().painter,m=f.getViewportRoot();if(typeof BMap>"u")throw new Error("BMap api is not loaded");if(_=_||H(),e)throw new Error("Only one bmap component can exist");var i;if(!o.__bmap){var p=a.querySelector(".ec-extension-bmap");p&&(m.style.left="0px",m.style.top="0px",a.removeChild(p)),p=document.createElement("div"),p.className="ec-extension-bmap",p.style.cssText="position:absolute;width:100%;height:100%",a.appendChild(p);var s=o.get("mapOptions");s&&(s=S(s),delete s.mapType),i=o.__bmap=new BMap.Map(p,s);var d=new _(m);i.addOverlay(d),f.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}i=o.__bmap;var l=o.get("center"),c=o.get("zoom");if(l&&c){var y=i.getCenter(),v=i.getZoom(),u=o.centerOrZoomChanged([y.lng,y.lat],v);if(u){var w=new BMap.Point(l[0],l[1]);i.centerAndZoom(w,c)}}e=new r(i,n),e.setMapOffset(o.__mapOffset||[0,0]),e.setZoom(c),e.setCenter(l),o.coordinateSystem=e}),t.eachSeries(function(o){o.get("coordinateSystem")==="bmap"&&(o.coordinateSystem=e)}),e&&[e]};function R(t,n){return t&&n&&t[0]===n[0]&&t[1]===n[1]}z({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,n){this.option.center=t,this.option.zoom=n},centerOrZoomChanged:function(t,n){var e=this.option;return!(R(t,e.center)&&n===e.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},mapOptions:{},roam:!1}});function Z(t){for(var n in t)if(t.hasOwnProperty(n))return!1;return!0}x({type:"bmap",render:function(t,n,e){var a=!0,o=t.getBMap(),f=e.getZr().painter.getViewportRoot(),m=t.coordinateSystem,i=function(w,D){if(!a){var O=f.parentNode.parentNode.parentNode,h=[-parseInt(O.style.left,10)||0,-parseInt(O.style.top,10)||0],g=f.style,C=h[0]+"px",P=h[1]+"px";g.left!==C&&(g.left=C),g.top!==P&&(g.top=P),m.setMapOffset(h),t.__mapOffset=h,e.dispatchAction({type:"bmapRoam",animation:{duration:0}})}};function p(){a||e.dispatchAction({type:"bmapRoam",animation:{duration:0}})}o.removeEventListener("moving",this._oldMoveHandler),o.removeEventListener("moveend",this._oldMoveHandler),o.removeEventListener("zoomend",this._oldZoomEndHandler),o.addEventListener("moving",i),o.addEventListener("moveend",i),o.addEventListener("zoomend",p),this._oldMoveHandler=i,this._oldZoomEndHandler=p;var s=t.get("roam");s&&s!=="scale"?o.enableDragging():o.disableDragging(),s&&s!=="move"?(o.enableScrollWheelZoom(),o.enableDoubleClickZoom(),o.enablePinchToZoom()):(o.disableScrollWheelZoom(),o.disableDoubleClickZoom(),o.disablePinchToZoom());var d=t.__mapStyle,l=t.get("mapStyle")||{},c=JSON.stringify(l);JSON.stringify(d)!==c&&(Z(l)||o.setMapStyle(S(l)),t.__mapStyle=JSON.parse(c));var y=t.__mapStyle2,v=t.get("mapStyleV2")||{},u=JSON.stringify(v);JSON.stringify(y)!==u&&(Z(v)||o.setMapStyleV2(S(v)),t.__mapStyle2=JSON.parse(u)),a=!1}});L("bmap",r);N({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,n){n.eachComponent("bmap",function(e){var a=e.getBMap(),o=a.getCenter();e.setCenterAndZoom([o.lng,o.lat],a.getZoom())})});var j="1.0.0";export{j as version};
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},o={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,o as language};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},r={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=><!~?&%|+\-*\/\^\.,\:]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@[a-zA-Z_]\w*/,"variable.predefined"],[/[a-zA-Z_]\w*/,{cases:{this:"variable.predefined","@keywords":{token:"keyword.$0"},"@default":""}}],[/[ \t\r\n]+/,""],[/###/,"comment","@comment"],[/#.*$/,"comment"],["///",{token:"regexp",next:"@hereregexp"}],[/^(\s*)(@regEx)/,["","regexp"]],[/(\()(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\,)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\=)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\:)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\[)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\!)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\&)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\|)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\?)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\{)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\;)(\s*)(@regEx)/,["","","regexp"]],[/}/,{cases:{"$S2==interpolatedstring":{token:"string",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/0[0-7]+(?!\d)/,"number.octal"],[/\d+/,"number"],[/[,.]/,"delimiter"],[/"""/,"string",'@herestring."""'],[/'''/,"string","@herestring.'''"],[/"/,{cases:{"@eos":"string","@default":{token:"string",next:'@string."'}}}],[/'/,{cases:{"@eos":"string","@default":{token:"string",next:"@string.'"}}}]],string:[[/[^"'\#\\]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\./,"string.escape.invalid"],[/#{/,{cases:{'$S2=="':{token:"string",next:"root.interpolatedstring"},"@default":"string"}}],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/#/,"string"]],herestring:[[/("""|''')/,{cases:{"$1==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/[^#\\'"]+/,"string"],[/['"]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/#{/,{token:"string.quote",next:"root.interpolatedstring"}],[/#/,"string"]],comment:[[/[^#]+/,"comment"],[/###/,"comment","@pop"],[/#/,"comment"]],hereregexp:[[/[^\\\/#]+/,"regexp"],[/\\./,"regexp"],[/#.*$/,"comment"],["///[igm]*",{token:"regexp",next:"@pop"}],[/\//,"regexp"]]}};export{e as conf,r as language};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},t={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@?[a-zA-Z_]\w*/,{cases:{"@namespaceFollows":{token:"keyword.$0",next:"@namespace"},"@keywords":{token:"keyword.$0",next:"@qualified"},"@default":{token:"identifier",next:"@qualified"}}}],{include:"@whitespace"},[/}/,{cases:{"$S2==interpolatedstring":{token:"string.quote",next:"@pop"},"$S2==litinterpstring":{token:"string.quote",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,t as language};
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var t={brackets:[],autoClosingPairs:[],surroundingPairs:[]},r={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/child-src/,"string.quote"],[/connect-src/,"string.quote"],[/default-src/,"string.quote"],[/font-src/,"string.quote"],[/frame-src/,"string.quote"],[/img-src/,"string.quote"],[/manifest-src/,"string.quote"],[/media-src/,"string.quote"],[/object-src/,"string.quote"],[/script-src/,"string.quote"],[/style-src/,"string.quote"],[/worker-src/,"string.quote"],[/base-uri/,"string.quote"],[/plugin-types/,"string.quote"],[/sandbox/,"string.quote"],[/disown-opener/,"string.quote"],[/form-action/,"string.quote"],[/frame-ancestors/,"string.quote"],[/report-uri/,"string.quote"],[/report-to/,"string.quote"],[/upgrade-insecure-requests/,"string.quote"],[/block-all-mixed-content/,"string.quote"],[/require-sri-for/,"string.quote"],[/reflected-xss/,"string.quote"],[/referrer/,"string.quote"],[/policy-uri/,"string.quote"],[/'self'/,"string.quote"],[/'unsafe-inline'/,"string.quote"],[/'unsafe-eval'/,"string.quote"],[/'strict-dynamic'/,"string.quote"],[/'unsafe-hashed-attributes'/,"string.quote"]]}};export{t as conf,r as language};
|
||||
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
|||
var e={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t={defaultToken:"",tokenPostfix:".css",ws:`[
|
||||
\r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r
|
||||
]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};export{e as conf,t as language};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:"(",close:")"},{open:'"',close:'"'},{open:"`",close:"`"}],folding:{markers:{start:/^\s*\s*#?region\b/,end:/^\s*\s*#?endregion\b/}}},n={defaultToken:"invalid",tokenPostfix:".dart",keywords:["abstract","dynamic","implements","show","as","else","import","static","assert","enum","in","super","async","export","interface","switch","await","extends","is","sync","break","external","library","this","case","factory","mixin","throw","catch","false","new","true","class","final","null","try","const","finally","on","typedef","continue","for","operator","var","covariant","Function","part","void","default","get","rethrow","while","deferred","hide","return","with","do","if","set","yield"],typeKeywords:["int","double","String","bool"],operators:["+","-","*","/","~/","%","++","--","==","!=",">","<",">=","<=","=","-=","/=","%=",">>=","^=","+=","*=","~/=","<<=","&=","!=","||","&&","&","|","^","~","<<",">>","!",">>>","??","?",":","|="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"type.identifier","@keywords":"keyword","@default":"identifier"}}],[/[A-Z_$][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/@[a-zA-Z]+/,"annotation"],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/\/.*$/,"comment.doc"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"\$]+/,"string"],[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"],[/\$\w+/,"identifier"]],string_single:[[/[^\\'\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"],[/\$\w+/,"identifier"]]}};export{e as conf,n as language};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o={defaultToken:"",tokenPostfix:".dockerfile",variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(ONBUILD)(\s+)/,["keyword",""]],[/(ENV)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,{token:"keyword",next:"@arguments"}]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/\\'$/,"","@popall"],[/\\'/,""],[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}};export{e as conf,o as language};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
var e={comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:"(",close:")",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}]},o={defaultToken:"",tokenPostfix:".flow",keywords:["import","require","export","forbid","native","if","else","cast","unsafe","switch","default"],types:["io","mutable","bool","int","double","string","flow","void","ref","true","false","with"],operators:["=",">","<","<=",">=","==","!","!=",":=","::=","&&","||","+","-","*","/","@","&","%",":","->","\\","$","??","^"],symbols:/[@$=><!~?:&|+\-*\\\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":"keyword","@types":"type","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"delimiter"],[/[<>](?!@symbols)/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}};export{e as conf,o as language};
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue