操作

操作

  • 批处理操作
  • 除编辑外的扩展功能按钮

批量处理数据能够带来更多的便利,扩展功能按钮是自定义数据提交模式,在当前框架无法处理一些问题时可采用扩展功能实现。

示例效果:路径/ht/oper

数据设置

<?php
return [
    'type' => 'sql',
    'method' => 'list',
    'config' => [
        'table' => 'oper'
    ],
];

列表设置

<?php
return [
    'field' => [
        'id' => ['width' => 50,'fixed' => true],
        'title' => ['width' => 50, 'edit' => true],
        'price' => ['width' => 50, 'edit' => true],
        'status' => ['width' => 50],
        'remark' => ['width' => 50, 'edit' => true],
        'from' => ['width' => 50, 'edit' => true],
    ],
    'handle' => [
        'title' => ['batch' => true], // 当为true时,等价于 'batch' => '编辑',// 批处理放到"编辑"按钮中
        'price' => ['batch' => '状态'], // 批处理放到"状态"按钮中
        'status' => ['status' => true, 'batch' => '状态'],// 批处理放到"状态"按钮中
        'remark' => ['batch' => '编辑'], // 批处理放到"编辑"按钮中
        'from' => ['batch' => '编辑'],// 批处理放到"编辑"按钮中
    ],

    'batch' => [
        'update' => '更新' // 只产生一个按钮,功能自己开发
    ],

    'oper' => [
        'url_1' => [
            'name' => '日志',
            'url' => 'log', // URL路径
            'key' => 'sql_id' // 传递键值字符
        ],
        'url_2' => [
            'name' => '复制',
            'url' => 'copy',
            'key' => 'copy_id',
            'ismax' => false, // 是否全屏
            'confirm' => true // 是否是确定取消模式
        ]
    ],

    'handleinfo' => [
        'ismax' => true
    ],
    'is' => [
        'add' => true,
        'delete' => true
    ]
];

JS设置

$(function () {
    $(".js_batch_update").click(function () {
        alert("你点击了更新按钮!");
    });
});

设置文件/html/www/demo/admin/ht/oper/log/tpl.blade.php内容如下

<div>日志页面</div>
{!! !dump($_GET) !!}

设置文件/html/www/demo/admin/ht/oper/copy/_init.php内容如下

<?php
return function (){
    EXITJSON(0, "复制错误:" . json_encode($_GET, true));
};

编辑功能快捷键介绍

  • 唤起切换键:alt
  • 向左选择:按住shift不放 + tab键
  • 向右选择:tab键
  • 向上选择:按住shift不放 + enter键
  • 向下选择:enter键

关闭弹窗

批量操作效果

功能操作效果

表数据

上一篇:其他控件
下一篇:调用API数据
简介 开始使用 配置汇总 登录页面 APCU缓存 主题设置 模块 列表 编辑 模块样例 数据验证 下拉选择 树形选择 JSON存储 文本编辑器 文件图片上传 时间和区间 其他控件 操作 调用API数据 文件夹菜单