优化代码

pull/446/head
Karson 2023-07-10 14:30:50 +08:00
parent ad166f07eb
commit 033af96e1a
5 changed files with 7 additions and 7 deletions

View File

@ -1701,7 +1701,7 @@ EOD;
* @param array $fieldConfig
* @return string
*/
protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = [], $fieldConfig)
protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = [], $fieldConfig = [])
{
$lang = mb_ucfirst($field);
$formatter = '';

View File

@ -182,14 +182,14 @@ class Menu
} else {
$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) {
$hasChild = isset($v['sublist']) && $v['sublist'];
$data = array_intersect_key($v, $allow);
$data['ismenu'] = $data['ismenu'] ?? ($hasChild ? 1 : 0);
$data['icon'] = $data['icon'] ?? ($hasChild ? 'fa fa-list' : 'fa fa-circle-o');
$data['pid'] = $pid;
$data['status'] = 'normal';
$data['status'] = $data['status'] ?? 'normal';
if (!isset($oldMenu[$data['name']])) {
$menu = AuthRule::create($data);
} else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -276,8 +276,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
};
$(Table.config.checkboxtd, table).on("mousedown", function (e) {
//禁止鼠标右键事件
if (e.button === 2) {
//禁止鼠标右键事件和文本框
if (e.button === 2 || $(e.target).is("input")) {
return false;
}
posx = e.pageX;