mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 10:32:48 +08:00
将js代码架构改为app下渲染;
This commit is contained in:
13
app/admin/view/system/quick/_common.js
Normal file
13
app/admin/view/system/quick/_common.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var iconPickerFa = layui.iconPickerFa,
|
||||
autocomplete = layui.autocomplete;
|
||||
|
||||
var init = {
|
||||
table_elem: '#currentTable',
|
||||
table_render_id: 'currentTableRenderId',
|
||||
index_url: 'system.quick/index',
|
||||
add_url: 'system.quick/add',
|
||||
edit_url: 'system.quick/edit',
|
||||
delete_url: 'system.quick/delete',
|
||||
export_url: 'system.quick/export',
|
||||
modify_url: 'system.quick/modify',
|
||||
};
|
||||
23
app/admin/view/system/quick/add.js
Normal file
23
app/admin/view/system/quick/add.js
Normal file
@@ -0,0 +1,23 @@
|
||||
$(function () {
|
||||
iconPickerFa.render({
|
||||
elem: '#icon',
|
||||
url: PATH_CONFIG.iconLess,
|
||||
limit: 12,
|
||||
click: function (data) {
|
||||
$('#icon').val('fa ' + data.icon);
|
||||
},
|
||||
success: function (d) {
|
||||
console.log(d);
|
||||
}
|
||||
});
|
||||
autocomplete.render({
|
||||
elem: $('#href')[0],
|
||||
url: ua.url('system.menu/getMenuTips'),
|
||||
template_val: '{{d.node}}',
|
||||
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
||||
onselect: function (resp) {
|
||||
}
|
||||
});
|
||||
|
||||
ua.listen();
|
||||
});
|
||||
23
app/admin/view/system/quick/edit.js
Normal file
23
app/admin/view/system/quick/edit.js
Normal file
@@ -0,0 +1,23 @@
|
||||
$(function () {
|
||||
iconPickerFa.render({
|
||||
elem: '#icon',
|
||||
url: PATH_CONFIG.iconLess,
|
||||
limit: 12,
|
||||
click: function (data) {
|
||||
$('#icon').val('fa ' + data.icon);
|
||||
},
|
||||
success: function (d) {
|
||||
console.log(d);
|
||||
}
|
||||
});
|
||||
autocomplete.render({
|
||||
elem: $('#href')[0],
|
||||
url: ua.url('system.menu/getMenuTips'),
|
||||
template_val: '{{d.node}}',
|
||||
template_txt: '{{d.node}} <span class=\'layui-badge layui-bg-gray\'>{{d.title}}</span>',
|
||||
onselect: function (resp) {
|
||||
}
|
||||
});
|
||||
|
||||
ua.listen();
|
||||
});
|
||||
20
app/admin/view/system/quick/index.js
Normal file
20
app/admin/view/system/quick/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
$(function () {
|
||||
|
||||
ua.table.render({
|
||||
init: init,
|
||||
cols: [[
|
||||
{type: "checkbox"},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'sort', width: 80, title: '排序', edit: 'text'},
|
||||
{field: 'title', minWidth: 80, title: '权限名称'},
|
||||
{field: 'icon', width: 80, title: '图标', templet: ua.table.icon},
|
||||
{field: 'href', minWidth: 120, title: '快捷链接'},
|
||||
{field: 'remark', minWidth: 80, title: '备注信息'},
|
||||
{field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ua.table.switch},
|
||||
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
|
||||
{width: 250, title: '操作', templet: ua.table.tool, operat: ['edit', 'delete']}
|
||||
]],
|
||||
});
|
||||
|
||||
ua.listen();
|
||||
});
|
||||
Reference in New Issue
Block a user