Giter VIP home page Giter VIP logo

dcat-admin-demo's Introduction

Dcat Admin

本项目是Dcat Admin的DEMO源码,在线预览点击这里

仓库地址

安装

运行

composer install

安装完之后,复制一份.env.example文件并命名为.env,然后运行

php artisan key:generate

然后配置好数据库连接信息运行以下命令

这里会提示文件夹已存在,忽略即可。

php artisan admin:install

最后运行php artisan serve。然后打开http://localhost:8000/admin即可访问,账号admin,密码admin

dcat-admin-demo's People

Contributors

jqhph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dcat-admin-demo's Issues

编辑页面 一对多情况下

编辑/添加 页面 一对多情况下 新增一个多 并且多的参数值设置了required,js移除 点击提交表单 会提示 required

multipleSelectTable 在 select 的 when 条件中只能单选

$form->select('type')
...
->when(10, function (Form\NestedForm $form) {
    $form->selectTable('approvers')
        ->dialogWidth('50%') 
        ->from(UserTable::make(['company_id' => $this->company->id]));
})
->when(20, function (Form\NestedForm $form) {
    $form->multipleSelectTable('approvers')
        ->dialogWidth('50%') 
        ->from(UserTable::make(['company_id' => $this->company->id])); 
})

满足第一个条件时单选没有问题,满足第二个条件时仍然只能单选
调换顺序之后两个都可以多选

特定条件下,$form->table组件的 新增按钮失效

复现步骤
1、菜单进入一个列表页面 (带一个modal弹窗)例如:
$grid->column('slice_table', '绑定切片')->display('查看')
->modal(function (Grid\Displayers\Modal $modal) {
$modal->title('切片列表');
return BindSliceTable::make()->payload(['meeting_id' => $this->id]);
});

2、进入一个新的列表->点击新增按钮->弹窗异步表单 table组件例如
$this->table('library_set','初始导入题形',function (NestedForm $table){
$table->select('library_id','病理库')
->options(SliceLibraryModel::getOptWithSliceCount())->required();
$table->number('num','题目数量')
->attribute('min', 1)
->required();
});

这个时候,此table组件的新增按钮会失效,点击无效果,控制台无信息

关于树形表格查询和数据表格底部统计

树形表格查询

使用场景如下:
用户列表,有一个按钮可以以树形图形式展示这个用户下所有的团队成员。
用户的上下级关系如下:
image

ID为1的用户其parent_id=0,展示出来的关系是完整的,但当点击他的下级,如2、3时,弹出来的模态框就会提示无数据。

定义footer后,分页统计的footer不消失

$grid->footer(function ($collection) {
    $count = UserRepository::getUserTeamCount($this->userId);
    
    return "<div>团队总人数 : $count 人</div>";
});

辛苦了。:coffee:

使用反向代理后 form action 域名不正确

1.首先设置 laravel APP_URL=a.domain
2.在 AppServiceProvider boot 中添加 app('url')->forceRootUrl(env('APP_URL'));
3.在 a.domain 服务器将流量转到 admin ip
然后访问 a.domain/admin 后台中所有form action地址仍然是IP

表单联动出现错误

$form->select('province')->options(...)->load('city','/api/city');

出现 TypeError: Dcat.helpers.loadFields is not a function

是否可能支持多语言编辑?

目前观察好像只有后台操作界面多语
如果前台要双语就要自己另外写多语系编辑
另外我在测试编辑器editor指定语言包languageUrl()给js
似乎无作用
如果我想要做切换多语言编辑表单
在编辑器的部份换成对应的语言无法成功切换过去

Admin Routes Undefined after composer install

Generating optimized autoload files

post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
post-autoload-dump: @php artisan package:discover --ansi
Executing command (CWD): "C:\xampp\php\php.exe" -d allow_url_fopen="1" -d disable_functions="" -d memory_limit="1536M" artisan package:discover --ansi

In routes.php line 7:

Call to undefined method Dcat\Admin\Admin::routes()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

php8 error

hello auther:
building in php version:8.0.0
Problem 1
- Root composer.json requires php ^7.1.3 but your php version (8.0.0) does not satisfy that requirement.
Problem 2
- laravel/framework[v5.8.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.0.0) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, ..., 5.8.x-dev].

数据表格内关联字段的排序(orderBy)

Grid::make(new UserDevice(['userInfo', 'userDeviceStatusInfo']), function (Grid $grid) {...
grid数据表格声明了关联关系,但是内部使用关联字段的 orderBy 报错
$grid->model()->orderBy('userInfo.id', 'desc');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.