切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
7 years ago
提交
50e91c53bb48e3ac1c19e29b2bc8664c7796d927
1 个父辈
2f2c003f
新增btn-ajax操作成功后自动刷新表格的功能
表格buttons新增refresh参数 修复btn-ajax回调函数在多次调用时的BUG 修复在启用dataLimit时关联查询时的BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
26 行增加
和
14 行删除
application/common/controller/Backend.php
public/assets/js/backend.js
public/assets/js/require-backend.min.js
public/assets/js/require-table.js
application/common/controller/Backend.php
查看文件 @
50e91c5
...
...
@@ -170,9 +170,9 @@ class Backend extends Controller
'fastadmin'
=>
Config
::
get
(
'fastadmin'
),
'referer'
=>
Session
::
get
(
"referer"
)
];
Config
::
set
(
'upload'
,
array_merge
(
Config
::
get
(
'upload'
),
$upload
));
// 配置信息后
Hook
::
listen
(
"config_init"
,
$config
);
//加载当前控制器语言包
...
...
@@ -232,16 +232,14 @@ class Backend extends Controller
{
if
(
!
empty
(
$this
->
model
))
{
$class
=
get_class
(
$this
->
model
);
$name
=
basename
(
str_replace
(
'\\'
,
'/'
,
$class
));
$tableName
=
$this
->
model
->
getQuery
()
->
getTable
(
$name
)
.
"."
;
$tableName
=
$this
->
model
->
getQuery
()
->
getTable
()
.
"."
;
}
$sort
=
stripos
(
$sort
,
"."
)
===
false
?
$tableName
.
$sort
:
$sort
;
}
$adminIds
=
$this
->
getDataLimitAdminIds
();
if
(
is_array
(
$adminIds
))
{
$where
[]
=
[
$this
->
dataLimitField
,
'in'
,
$adminIds
];
$where
[]
=
[
$t
ableName
.
$t
his
->
dataLimitField
,
'in'
,
$adminIds
];
}
if
(
$search
)
{
...
...
@@ -363,6 +361,10 @@ class Backend extends Controller
{
return
null
;
}
if
(
$this
->
auth
->
isSuperAdmin
())
{
return
null
;
}
$adminIds
=
[];
if
(
in_array
(
$this
->
dataLimit
,
[
'auth'
,
'personal'
]))
{
...
...
public/assets/js/backend.js
查看文件 @
50e91c5
...
...
@@ -112,7 +112,7 @@ define(['fast', 'moment'], function (Fast, Moment) {
//点击包含.btn-dialog的元素时弹出dialog
$
(
document
).
on
(
'click'
,
'.btn-dialog,.dialogit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
(
that
).
data
()
||
{}
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{})
;
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
columnIndex
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
var
tableOptions
=
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'getOptions'
);
if
(
tableOptions
)
{
...
...
@@ -135,7 +135,7 @@ define(['fast', 'moment'], function (Fast, Moment) {
//点击包含.btn-addtabs的元素时新增选项卡
$
(
document
).
on
(
'click'
,
'.btn-addtabs,.addtabsit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
(
that
).
data
()
||
{}
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{})
;
if
(
typeof
options
.
confirm
!==
'undefined'
)
{
Layer
.
confirm
(
options
.
confirm
,
function
(
index
)
{
Backend
.
api
.
addtabs
(
Backend
.
api
.
replaceids
(
that
,
$
(
that
).
attr
(
'href'
)),
$
(
that
).
attr
(
"title"
));
...
...
@@ -150,7 +150,7 @@ define(['fast', 'moment'], function (Fast, Moment) {
//点击包含.btn-ajax的元素时发送Ajax请求
$
(
document
).
on
(
'click'
,
'.btn-ajax,.ajaxit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
(
that
).
data
()
||
{}
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{})
;
if
(
typeof
options
.
url
===
'undefined'
&&
$
(
that
).
attr
(
"href"
))
{
options
.
url
=
$
(
that
).
attr
(
"href"
);
}
...
...
@@ -171,6 +171,10 @@ define(['fast', 'moment'], function (Fast, Moment) {
}
}
}
//如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新
if
(
!
success
&&
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
refresh
!==
'undefined'
&&
options
.
refresh
)
{
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'refresh'
);
}
if
(
typeof
options
.
confirm
!==
'undefined'
)
{
Layer
.
confirm
(
options
.
confirm
,
function
(
index
)
{
Backend
.
api
.
ajax
(
options
,
success
,
error
);
...
...
public/assets/js/require-backend.min.js
查看文件 @
50e91c5
...
...
@@ -6910,7 +6910,7 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
//点击包含.btn-dialog的元素时弹出dialog
$
(
document
).
on
(
'click'
,
'.btn-dialog,.dialogit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
(
that
).
data
()
||
{}
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{})
;
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
columnIndex
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
var
tableOptions
=
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'getOptions'
);
if
(
tableOptions
)
{
...
...
@@ -6933,7 +6933,7 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
//点击包含.btn-addtabs的元素时新增选项卡
$
(
document
).
on
(
'click'
,
'.btn-addtabs,.addtabsit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
(
that
).
data
()
||
{}
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{})
;
if
(
typeof
options
.
confirm
!==
'undefined'
)
{
Layer
.
confirm
(
options
.
confirm
,
function
(
index
)
{
Backend
.
api
.
addtabs
(
Backend
.
api
.
replaceids
(
that
,
$
(
that
).
attr
(
'href'
)),
$
(
that
).
attr
(
"title"
));
...
...
@@ -6948,7 +6948,7 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
//点击包含.btn-ajax的元素时发送Ajax请求
$
(
document
).
on
(
'click'
,
'.btn-ajax,.ajaxit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
(
that
).
data
()
||
{}
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{})
;
if
(
typeof
options
.
url
===
'undefined'
&&
$
(
that
).
attr
(
"href"
))
{
options
.
url
=
$
(
that
).
attr
(
"href"
);
}
...
...
@@ -6969,6 +6969,10 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
}
}
}
//如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新
if
(
!
success
&&
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
refresh
!==
'undefined'
&&
options
.
refresh
)
{
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'refresh'
);
}
if
(
typeof
options
.
confirm
!==
'undefined'
)
{
Layer
.
confirm
(
options
.
confirm
,
function
(
index
)
{
Backend
.
api
.
ajax
(
options
,
success
,
error
);
...
...
@@ -10005,9 +10009,10 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
icon
=
j
.
icon
?
j
.
icon
:
''
;
text
=
j
.
text
?
j
.
text
:
''
;
title
=
j
.
title
?
j
.
title
:
text
;
refresh
=
j
.
refresh
?
'data-refresh="'
+
j
.
refresh
+
'"'
:
''
;
confirm
=
j
.
confirm
?
'data-confirm="'
+
j
.
confirm
+
'"'
:
''
;
extend
=
j
.
extend
?
j
.
extend
:
''
;
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-column-index="'
+
columnIndex
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
(
refresh
?
refresh
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-column-index="'
+
columnIndex
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
}
});
return
html
.
join
(
' '
);
...
...
public/assets/js/require-table.js
查看文件 @
50e91c5
...
...
@@ -436,9 +436,10 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
icon
=
j
.
icon
?
j
.
icon
:
''
;
text
=
j
.
text
?
j
.
text
:
''
;
title
=
j
.
title
?
j
.
title
:
text
;
refresh
=
j
.
refresh
?
'data-refresh="'
+
j
.
refresh
+
'"'
:
''
;
confirm
=
j
.
confirm
?
'data-confirm="'
+
j
.
confirm
+
'"'
:
''
;
extend
=
j
.
extend
?
j
.
extend
:
''
;
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-column-index="'
+
columnIndex
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
(
refresh
?
refresh
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-column-index="'
+
columnIndex
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
}
});
return
html
.
join
(
' '
);
...
...
请
注册
或
登录
后发表评论