mirror of https://gitee.com/karson/fastadmin.git
优化代码
parent
ad166f07eb
commit
033af96e1a
|
|
@ -1701,7 +1701,7 @@ EOD;
|
||||||
* @param array $fieldConfig
|
* @param array $fieldConfig
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = [], $fieldConfig)
|
protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = [], $fieldConfig = [])
|
||||||
{
|
{
|
||||||
$lang = mb_ucfirst($field);
|
$lang = mb_ucfirst($field);
|
||||||
$formatter = '';
|
$formatter = '';
|
||||||
|
|
|
||||||
|
|
@ -182,14 +182,14 @@ class Menu
|
||||||
} else {
|
} else {
|
||||||
$pid = $parent;
|
$pid = $parent;
|
||||||
}
|
}
|
||||||
$allow = array_flip(['file', 'name', 'title', 'url', 'icon', 'condition', 'remark', 'ismenu', 'menutype', 'extend', 'weigh']);
|
$allow = array_flip(['file', 'name', 'title', 'url', 'icon', 'condition', 'remark', 'ismenu', 'menutype', 'extend', 'weigh', 'status']);
|
||||||
foreach ($newMenu as $k => $v) {
|
foreach ($newMenu as $k => $v) {
|
||||||
$hasChild = isset($v['sublist']) && $v['sublist'];
|
$hasChild = isset($v['sublist']) && $v['sublist'];
|
||||||
$data = array_intersect_key($v, $allow);
|
$data = array_intersect_key($v, $allow);
|
||||||
$data['ismenu'] = $data['ismenu'] ?? ($hasChild ? 1 : 0);
|
$data['ismenu'] = $data['ismenu'] ?? ($hasChild ? 1 : 0);
|
||||||
$data['icon'] = $data['icon'] ?? ($hasChild ? 'fa fa-list' : 'fa fa-circle-o');
|
$data['icon'] = $data['icon'] ?? ($hasChild ? 'fa fa-list' : 'fa fa-circle-o');
|
||||||
$data['pid'] = $pid;
|
$data['pid'] = $pid;
|
||||||
$data['status'] = 'normal';
|
$data['status'] = $data['status'] ?? 'normal';
|
||||||
if (!isset($oldMenu[$data['name']])) {
|
if (!isset($oldMenu[$data['name']])) {
|
||||||
$menu = AuthRule::create($data);
|
$menu = AuthRule::create($data);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -276,8 +276,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
};
|
};
|
||||||
|
|
||||||
$(Table.config.checkboxtd, table).on("mousedown", function (e) {
|
$(Table.config.checkboxtd, table).on("mousedown", function (e) {
|
||||||
//禁止鼠标右键事件
|
//禁止鼠标右键事件和文本框
|
||||||
if (e.button === 2) {
|
if (e.button === 2 || $(e.target).is("input")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
posx = e.pageX;
|
posx = e.pageX;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue