提交 0185a4bb 编写于 作者: 孙建华

add: 菜单列表页排序值行内编辑

上级 55ef4dcc
......@@ -44,7 +44,7 @@
<th lay-data="{field:'parentName'}">上级菜单</th>
<th lay-data="{field:'route'}">路由</th>
<th lay-data="{field:'url'}">URL</th>
<th lay-data="{field:'order', sort: true}">排序</th>
<th lay-data="{field:'order', sort: true, edit: true}">排序</th>
<th lay-data="{field:'statusText', sort: true}">状态</th>
<th lay-data="{field:'created_at'}">添加时间</th>
<th lay-data="{field:'updated_at'}">更新时间</th>
......@@ -98,6 +98,23 @@
close: '%>'
});
var table = layui.table;
table.on('edit(test)', function(obj){ //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值"
$.ajax({
url: '{{ route('admin::menu.batch') }}',
method: 'post',
dataType: 'json',
data: {params: obj.value, ids: [obj.data.id], 'type': 'order'},
success: function (result) {
if (result.code !== 0) {
layer.msg(result.msg, {shift: 3});
return false;
}
layer.msg(result.msg, {icon: 1});
}
});
});
var laydate = layui.laydate;
laydate.render({
elem: '#created_at',
......
......@@ -35,7 +35,6 @@ class EntityControllerTest extends TestCase
public function testEntityCanBeCreated()
{
$data = ['name' => '测试', 'table_name' => 'tests'];
$response = $this->actingAs($this->user, 'admin')
->post('/admin/entities', $data);
......
......@@ -3,7 +3,6 @@
namespace Tests\Feature\Admin;
use App\Model\Admin\AdminUser;
use App\Model\Admin\EntityField;
use App\Repository\Admin\EntityRepository;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册