表头工具栏,主要用来实现某些快捷操作需求,你可以根据自己的需要添加不同的链接按钮或表格操作按钮,支持下拉展示等。
| 参数 | 类型 | 必须 | 默认 | 说明 |
| —- | —- | —- | —- | —- | | title | String | Y | | 按钮文本信息 | | url | String | N | | 链接地址 | | class | String | N | | 样式定义 | | attrs | Array | N | | 扩展属性(js用) | | children | Array | N | | 下拉菜单参数同上 |
attrs配置
class为hisi-iframe
| 参数 | 类型 | 必须 | 默认 | 说明 |
|---|---|---|---|---|
| width | String | N | 80% | 弹窗宽度,支持%和px |
| height | String | N | 80% | 弹窗高度,支持%和px |
| idSync | bool | N | false | 是否同步表格已选中的id,选择是将会把选中的id以GET方式携带至URL上,后端可通过request()->get(‘id/a’)方式获取。 |
| title | String | N | 弹窗标题 |
示例代码:
$assign['buildTable']['toolbar'] = [['title' => '添加','url' => url('add'),'class' => 'hisi-iframe','attrs' => ['data-options' => ['width' => '800px'],],],['title' => '状态设置','children' => [['title' => '设置为待审','url' => url('setAudit', ['val' => 0]),],['title' => '设置为已审','url' => url('setAudit', ['val' => 1]),],],],];
渲染效果:

class为hisi-ajax
| 参数 | 类型 | 必须 | 默认 | 说明 |
|---|---|---|---|---|
| refresh | String | N | yes | ajax请求成功后,是否自动刷新当前页面,是:yes,否:no |
| confirm | String | N | 询问内容,在发起ajax请求前执行,示例:你确定要提交吗? |
示例代码:
$assign['buildTable']['toolbar'] = [['title' => '备份数据库','url' => url('backup'),'class' => 'hisi-ajax','attrs' => ['confirm' => '你确定要执行此操作吗?'],],];
渲染效果:

class为hisi-table-ajax
hisi-table-ajax 必须配合表格的checkbox使用,主要通过ajax批量提交表格数据(勾选的数据ID)至后台处理。
| 参数 | 类型 | 必须 | 默认 | 说明 |
|---|---|---|---|---|
| refresh | String | N | yes | ajax请求成功后,是否自动刷新当前页面,是:yes,否:no |
| confirm | String | N | 询问内容,在发起ajax请求前执行,示例:你确定要提交吗? |
示例代码:
$assign['buildTable']['toolbar'] = [['title' => '备份数据库','url' => url('backup'),'class' => 'hisi-table-ajax','attrs' => ['data-options' => ['confirm' => '你确定要执行此操作吗?'],],],];
渲染效果:

