顶部操作栏目与列表里的操作扩展 #221
jasonup2020
started this conversation in
心得 or 技巧
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
把以下代码放到 Components.php 里进行方法调用
找到 List方法下的
$this->rowActions('dialog'), 改成以下的方式
$this->rowActions([
$this->rowActions('dialog'),
amis()->DropdownButton()->label('更多')->buttons([
Components::make()->operationExpansion("trackings/order_inspection_image/add-next", "md", "补拍", $addNextForm, 1),
Components::make()->operationExpansion(admin_url("trackings/order_inspection_image/send-email"), "md", "发邮件", $emailForm, 0),
])
])
$this->rowActions('dialog') ====等于====
$this->rowActions([
$this->rowShowButton(true),//查看按钮
$this->rowEditButton(true), // 编辑按钮
$this->rowDeleteButton(false), // 删除按钮
])
表头的 顶部操作栏目
把
->headerToolbar([
$this->createButton('dialog'),
...$this->baseHeaderToolBar()
])
改成
->headerToolbar([
$this->createButton('dialog'),
//导入按钮
Components::make()->importAction(url("template/trackin_order.xlsx"), admin_url('order_trackings/execl_import'), "批量导入", "fa fa-upload", ['backgroundColor' => '#6200ffff', 'color' => '#fff']),
...$this->baseHeaderToolBar()
])
`/**
*Components.php
Beta Was this translation helpful? Give feedback.
All reactions