mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 02:52:49 +08:00
将js代码架构改为app下渲染;
This commit is contained in:
@@ -26,18 +26,18 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
homdPid: 99999999,
|
||||
treeIdName: 'id',
|
||||
treePidName: 'pid',
|
||||
url: ea.url(init.index_url),
|
||||
url: ua.url(init.index_url),
|
||||
elem: init.table_elem,
|
||||
id: init.table_render_id,
|
||||
toolbar: '#toolbar',
|
||||
page: false,
|
||||
skin: 'line',
|
||||
|
||||
// @todo 不直接使用ea.table.render(); 进行表格初始化, 需要使用 ea.table.formatCols(); 方法格式化`cols`列数据
|
||||
cols: ea.table.formatCols([[
|
||||
// @todo 不直接使用ua.table.render(); 进行表格初始化, 需要使用 ua.table.formatCols(); 方法格式化`cols`列数据
|
||||
cols: ua.table.formatCols([[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'title', sort: false, width: 250, title: '菜单名称', align: 'left' },
|
||||
{ field: 'icon', sort: false, width: 80, title: '图标', templet: ea.table.icon },
|
||||
{ field: 'icon', sort: false, width: 80, title: '图标', templet: ua.table.icon },
|
||||
{ field: 'href', sort: false, minWidth: 120, title: '菜单链接' },
|
||||
{
|
||||
field: 'is_home', sort: false,
|
||||
@@ -54,13 +54,13 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'status', sort: false, title: '状态', width: 85, templet: ea.table.switch },
|
||||
{ field: 'status', sort: false, title: '状态', width: 85, templet: ua.table.switch },
|
||||
{ field: 'sort', sort: false, width: 80, title: '排序', edit: 'text' },
|
||||
{
|
||||
width: 220,
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
templet: ea.table.tool,
|
||||
templet: ua.table.tool,
|
||||
operat: [
|
||||
[{
|
||||
text: '添加下级',
|
||||
@@ -94,7 +94,7 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
data: ['id', 'title'],
|
||||
_if(data) {
|
||||
|
||||
if (data.pid == ea.getDataBrage('menu_home_pid')) {
|
||||
if (data.pid == ua.getDataBrage('menu_home_pid')) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -126,15 +126,15 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
$('body').on('click', '[data-treetable-delete-item]', function () {
|
||||
var id = $(this).data('id');
|
||||
var url = $(this).attr('data-url');
|
||||
url = url != undefined ? ea.url(url) : window.location.href;
|
||||
ea.msg.confirm('确定删除?', function () {
|
||||
ea.request.post({
|
||||
url = url != undefined ? ua.url(url) : window.location.href;
|
||||
ua.msg.confirm('确定删除?', function () {
|
||||
ua.request.post({
|
||||
url: url,
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
}, function (res) {
|
||||
ea.msg.success(res.msg, function () {
|
||||
ua.msg.success(res.msg, function () {
|
||||
renderTable();
|
||||
});
|
||||
});
|
||||
@@ -146,25 +146,25 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
var tableId = $(this).attr('data-treetable-delete'),
|
||||
url = $(this).attr('data-url');
|
||||
tableId = tableId || init.table_render_id;
|
||||
url = url != undefined ? ea.url(url) : window.location.href;
|
||||
url = url != undefined ? ua.url(url) : window.location.href;
|
||||
var checkStatus = table.checkStatus(tableId),
|
||||
data = checkStatus.data;
|
||||
if (data.length <= 0) {
|
||||
ea.msg.error('请勾选需要删除的数据');
|
||||
ua.msg.error('请勾选需要删除的数据');
|
||||
return false;
|
||||
}
|
||||
var ids = [];
|
||||
$.each(data, function (i, v) {
|
||||
ids.push(v.id);
|
||||
});
|
||||
ea.msg.confirm('确定删除?', function () {
|
||||
ea.request.post({
|
||||
ua.msg.confirm('确定删除?', function () {
|
||||
ua.request.post({
|
||||
url: url,
|
||||
data: {
|
||||
id: ids
|
||||
},
|
||||
}, function (res) {
|
||||
ea.msg.success(res.msg, function () {
|
||||
ua.msg.success(res.msg, function () {
|
||||
renderTable();
|
||||
});
|
||||
});
|
||||
@@ -172,11 +172,11 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
return false;
|
||||
});
|
||||
|
||||
ea.table.listenSwitch({ filter: 'status', url: init.modify_url });
|
||||
ua.table.listenSwitch({ filter: 'status', url: init.modify_url });
|
||||
|
||||
ea.table.listenEdit(init, 'currentTable', init.table_render_id, false);
|
||||
ua.table.listenEdit(init, 'currentTable', init.table_render_id, false);
|
||||
|
||||
ea.listen();
|
||||
ua.listen();
|
||||
},
|
||||
add: function () {
|
||||
iconPickerFa.render({
|
||||
@@ -192,17 +192,17 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
});
|
||||
autocomplete.render({
|
||||
elem: $('#href')[0],
|
||||
url: ea.url('system.menu/getMenuTips'),
|
||||
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) {
|
||||
}
|
||||
});
|
||||
|
||||
ea.listen(function (data) {
|
||||
ua.listen(function (data) {
|
||||
return data;
|
||||
}, function (res) {
|
||||
ea.msg.success(res.msg, function () {
|
||||
ua.msg.success(res.msg, function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
parent.$('[data-treetable-refresh]').trigger("click");
|
||||
@@ -223,17 +223,17 @@ define(["jquery", "easy-admin", "treetable", "iconPickerFa", "autocomplete"], fu
|
||||
});
|
||||
autocomplete.render({
|
||||
elem: $('#href')[0],
|
||||
url: ea.url('system.menu/getMenuTips'),
|
||||
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) {
|
||||
}
|
||||
});
|
||||
|
||||
ea.listen(function (data) {
|
||||
ua.listen(function (data) {
|
||||
return data;
|
||||
}, function (res) {
|
||||
ea.msg.success(res.msg, function () {
|
||||
ua.msg.success(res.msg, function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
parent.$('[data-treetable-refresh]').trigger("click");
|
||||
|
||||
Reference in New Issue
Block a user