mirror of https://gitee.com/karson/fastadmin.git
parent
e8fa069fe9
commit
bb97452fe1
|
|
@ -90,9 +90,9 @@ class Install extends Command
|
||||||
$this->request = Request::instance();
|
$this->request = Request::instance();
|
||||||
|
|
||||||
define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);
|
define('INSTALL_PATH', APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS);
|
||||||
$langSet = $this->request->langset();
|
$langSet = strtolower($this->request->langset());
|
||||||
if ($langSet === 'zh-cn') {
|
if (!$langSet || in_array($langSet, ['zh-cn', 'zh-hans-cn'])) {
|
||||||
Lang::load(INSTALL_PATH . $langSet . '.php');
|
Lang::load(INSTALL_PATH . 'zh-cn.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$installLockFile = INSTALL_PATH . "install.lock";
|
$installLockFile = INSTALL_PATH . "install.lock";
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
|
||||||
field: 'ismenu',
|
field: 'ismenu',
|
||||||
title: __('Ismenu'),
|
title: __('Ismenu'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
table: table,
|
||||||
formatter: Table.api.formatter.toggle
|
formatter: Table.api.formatter.toggle
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -83,6 +84,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
|
||||||
});
|
});
|
||||||
//点击切换/排序/删除操作后刷新左侧菜单
|
//点击切换/排序/删除操作后刷新左侧菜单
|
||||||
$(".btn-change[data-id],.btn-delone,.btn-dragsort").data("success", function (data, ret) {
|
$(".btn-change[data-id],.btn-delone,.btn-dragsort").data("success", function (data, ret) {
|
||||||
|
if ($(this).hasClass("btn-change")) {
|
||||||
|
var index = $(this).data("index");
|
||||||
|
var row = Table.api.getrowbyindex(table, index);
|
||||||
|
row.ismenu = $("i.fa.text-gray", this).length > 0 ? 1 : 0;
|
||||||
|
table.bootstrapTable("updateRow", {index: index, row: row});
|
||||||
|
} else if ($(this).hasClass("btn-delone")) {
|
||||||
|
if ($(this).closest("tr[data-index]").find("a.btn-node-sub.disabled").length > 0) {
|
||||||
|
$(this).closest("tr[data-index]").remove();
|
||||||
|
} else {
|
||||||
|
table.bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
} else if ($(this).hasClass("btn-dragsort")) {
|
||||||
|
table.bootstrapTable('refresh');
|
||||||
|
}
|
||||||
Fast.api.refreshmenu();
|
Fast.api.refreshmenu();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -454,16 +454,16 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
});
|
});
|
||||||
table.on("click", "[data-id].btn-change", function (e) {
|
table.on("click", "[data-id].btn-change", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var switcher = $.proxy(function () {
|
var changer = $.proxy(function () {
|
||||||
Table.api.multi($(this).data("action") ? $(this).data("action") : '', [$(this).data("id")], table, this);
|
Table.api.multi($(this).data("action") ? $(this).data("action") : '', [$(this).data("id")], table, this);
|
||||||
}, this);
|
}, this);
|
||||||
if (typeof $(this).data("confirm") !== 'undefined') {
|
if (typeof $(this).data("confirm") !== 'undefined') {
|
||||||
Layer.confirm($(this).data("confirm"), function (index) {
|
Layer.confirm($(this).data("confirm"), function (index) {
|
||||||
switcher();
|
changer();
|
||||||
Layer.close(index);
|
Layer.close(index);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
switcher();
|
changer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.on("click", "[data-id].btn-edit", function (e) {
|
table.on("click", "[data-id].btn-edit", function (e) {
|
||||||
|
|
@ -652,8 +652,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
if (typeof this.disable !== "undefined") {
|
if (typeof this.disable !== "undefined") {
|
||||||
disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable;
|
disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable;
|
||||||
}
|
}
|
||||||
return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='"
|
return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled no-padding' : '') + "' data-index='" + index + "' data-id='"
|
||||||
+ row[pk] + "' " + (url ? "data-url='" + url + "'" : "") + (confirm ? "data-confirm='" + confirm + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on " + (value == yes ? 'text-' + color : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
|
+ row[pk] + "' " + (url ? "data-url='" + url + "'" : "") + (confirm ? "data-confirm='" + confirm + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on text-success text-" + color + " " + (value == yes ? '' : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
|
||||||
},
|
},
|
||||||
url: function (value, row, index) {
|
url: function (value, row, index) {
|
||||||
value = value === null ? '' : value.toString();
|
value = value === null ? '' : value.toString();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue