Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Jun 7, 2024
1 parent 2da61b7 commit 8937cca
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 110 deletions.
6 changes: 6 additions & 0 deletions resources/assets/js/layui-extend/lake-admin/lakeTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ layui.define(['table', 'element', 'layer', 'form', 'notice'], function(exports)
}
}
});
}).error(function() {
layer.msg("请求失败");
});
});
} else {
Expand All @@ -375,6 +377,8 @@ layui.define(['table', 'element', 'layer', 'form', 'notice'], function(exports)
}
}
});
}).error(function() {
layer.msg("请求失败");
});
};
return false;
Expand Down Expand Up @@ -413,6 +417,8 @@ layui.define(['table', 'element', 'layer', 'form', 'notice'], function(exports)
}
}, 1500);
}
}).error(function() {
layer.msg("请求失败");
});
}

Expand Down
4 changes: 2 additions & 2 deletions resources/config/laket.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
'admin' => [
"name" => "LaketAdmin",
"name_mini" => "Laket",
"version" => "1.2.5",
"release" => "1.2.5.20240607",
"version" => "1.2.6",
"release" => "1.2.6.20240607",
],

// 登录
Expand Down
12 changes: 8 additions & 4 deletions resources/views/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="layui-inline">
<select name="field" class="lake-admin-search-field">
<option value="">全部类型</option>
<option value="name">登录名</option>
<option value="name">账号</option>
<option value="email">邮箱</option>
<option value="nickname">昵称</option>
</select>
Expand All @@ -20,9 +20,6 @@
<div class="layui-inline">
<a class="layui-btn lake-admin-search-btn" data-type="search">搜索</a>
</div>
<div class="layui-inline">
<a class="layui-btn" href="{:laket_route('admin.admin.index')}">查看全部</a>
</div>
</form>
</blockquote>

Expand Down Expand Up @@ -85,6 +82,13 @@
toolbar: '#toolbarDemo',
url: '{:laket_route("admin.admin.index-data")}',
method: 'get',
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cols: [
[
{ field: 'name', width: 120, title: '账号', templet: '#nameTpl' },
Expand Down
10 changes: 7 additions & 3 deletions resources/views/attachment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<div class="layui-inline">
<a class="layui-btn search_btn" data-type="reload">搜索</a>
</div>
<div class="layui-inline">
<a class="layui-btn" href="{:laket_route('admin.attachment.index')}">查看全部</a>
</div>
</form>
</blockquote>

Expand Down Expand Up @@ -71,6 +68,13 @@
toolbar: '#toolbarTop',
url: '{:laket_route("admin.attachment.index-data")}',
method: 'get',
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cols: [
[
{ type: 'checkbox', fixed: 'left' },
Expand Down
7 changes: 7 additions & 0 deletions resources/views/auth-group/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
toolbar: '#toolbarTop',
url: '{:laket_route("admin.auth-group.all-data")}',
method: 'get',
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cols: [
[
{ field: 'listorder', align: 'center', width: 70, title: '排序', edit: 'text' },
Expand Down
7 changes: 7 additions & 0 deletions resources/views/auth-group/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
toolbar: '#toolbarTop',
url: '{:laket_route("admin.auth-group.index-data")}',
method: 'get',
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cols: [
[
{ field: 'listorder', align: 'center', width: 70, title: '排序', edit: 'text' },
Expand Down
7 changes: 7 additions & 0 deletions resources/views/auth-rule/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
toolbar: '#toolbar',
url: '{:laket_route("admin.auth-rule.all-data")}',
method: 'get',
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cols: [
[
{ field: 'listorder', align: 'center', width: 80, title: '排序', edit: 'text' },
Expand Down
7 changes: 7 additions & 0 deletions resources/views/auth-rule/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
idField: 'id',
url: "{:laket_route('admin.auth-rule.index-data')}",
method: 'get',
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cellMinWidth: 100,
treeId: 'id', //树形id字段名称
treeUpId: 'parentid', //树形父id字段名称
Expand Down
39 changes: 13 additions & 26 deletions resources/views/flash/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
<div class="layui-inline">
<a class="layui-btn laket-admin-search-btn" data-type="search">搜索</a>
</div>
<div class="layui-inline">
<a href="javascript:;" class="layui-btn laket-admin-search-all-btn">查看全部</a>
</div>
</form>
</blockquote>

Expand All @@ -73,12 +70,12 @@

<script type="text/html" id="nameTpl">
{{# if(d.homepage){ }}
<a href="{{ d.homepage }}" target="_blank" title="点击查看主页">
<i class="iconfont icon-lianjie"></i>
</a>
<a href="{{ d.homepage }}" target="_blank" title="点击查看主页">
<i class="iconfont icon-lianjie"></i>
</a>
{{# } }}

{{ d.name }}
<span>{{ d.name }}</span>
</script>

<script type="text/html" id="titleTpl">
Expand Down Expand Up @@ -130,7 +127,7 @@
{{# if (d.settinglist.length > 0) { }}
<a class="layui-btn layui-btn-xs layui-iframe"
href='{:laket_route("admin.flash.setting")}?name={{ d.name }}'
title="设置"
title="插件设置"
>设置</a>
{{# } }}

Expand Down Expand Up @@ -171,6 +168,13 @@
url: '{:laket_route("admin.flash.index-data")}',
method: 'get',
page: 10,
parseData: function(res) {
return {
"code": res.code == 1 ? 0 : 1,
"count": res.data.count,
"data": res.data.list,
};
},
cols: [
[
{ field: 'listorder', align: 'center', width: 60, title: '排序', edit: 'text' },
Expand Down Expand Up @@ -244,23 +248,6 @@
})
});

// 搜索
$(".laket-admin-search-all-btn").on("click", function() {
$(".laket-admin-search-field").val('');
$(".laket-admin-search-val").val('');
layui.form.render('select');

table.reload("table", {
page: {
curr: 1
},
where: {
search_field: '',
keyword: '',
}
})
});

// 监听单元格编辑
table.on('edit(table)', function(obj) {
var value = obj.value,
Expand Down
2 changes: 1 addition & 1 deletion resources/views/flash/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{block name="main"}
<div class="layui-card">
<div class="layui-card-header layui-bg-cyan">设置</div>
<div class="layui-card-header layui-bg-cyan">插件设置</div>
<div class="layui-card-body">
<div class="layui-tab">
<div class="layui-tab-content lake-admin-tab-content">
Expand Down
8 changes: 3 additions & 5 deletions src/Controller/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ public function indexData()
$total = AdminModel::where($map)
->count();

$result = [
"code" => 0,
return $this->success('获取成功', '', [
"count" => $total,
"data" => $list
];
return $this->json($result);
"list" => $list,
]);
}

/**
Expand Down
8 changes: 3 additions & 5 deletions src/Controller/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ public function indexData()
->order('create_time desc')
->count();

$result = [
"code" => 0,
return $this->success('获取成功', '', [
"count" => $total,
"data" => $list,
];
return $this->json($result);
"list" => $list,
]);
}

/**
Expand Down
19 changes: 7 additions & 12 deletions src/Controller/AuthGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ public function indexData()
$list = $tree->buildArray(0);
$list = $tree->buildFormatList($list, 'title');

$result = [
"code" => 0,
return $this->success('获取成功', '', [
"count" => $total,
"data" => $list,
];

return $this->json($result);
"list" => $list
]);
}

/**
Expand All @@ -76,19 +73,17 @@ public function allData()
$map[] = [$searchField, 'like', "%$keyword%"];
}

$data = AuthGroupModel::where($map)
$list = AuthGroupModel::where($map)
->page($page, $limit)
->order('listorder DESC, add_time ASC')
->select()
->toArray();
$total = AuthGroupModel::where($map)->count();

$result = [
"code" => 0,
return $this->success('获取成功', '', [
"count" => $total,
"data" => $data,
];
return $this->json($result);
"list" => $list,
]);
}

/**
Expand Down
22 changes: 9 additions & 13 deletions src/Controller/AuthRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ public function indexData()

$Tree = make(Tree::class);
$menuTree = $Tree->withData($result)->buildArray(0);
$menus = $Tree->buildFormatList($menuTree, 'title');
$total = count($menus);
$list = $Tree->buildFormatList($menuTree, 'title');
$total = count($list);

$result = [
"code" => 0,
return $this->success('获取成功', '', [
"count" => $total,
"data" => $menus
];
return $this->json($result);
"list" => $list,
]);
}

/**
Expand All @@ -72,19 +70,17 @@ public function allData()
$map[] = [$searchField, 'like', "%$keyword%"];
}

$data = AuthRuleModel::where($map)
$list = AuthRuleModel::where($map)
->page($page, $limit)
->order('slug ASC, url ASC, id ASC')
->select()
->toArray();
$total = AuthRuleModel::where($map)->count();

$result = [
"code" => 0,
return $this->success('获取成功', '', [
"count" => $total,
"data" => $data,
];
return $this->json($result);
"list" => $list,
]);
}

/**
Expand Down
Loading

0 comments on commit 8937cca

Please sign in to comment.