Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
69cbeee9
Commit
69cbeee9
authored
Jun 15, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件列表 图片点击查看大图
parent
45381fe9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
attachment.js
public/assets/js/backend/general/attachment.js
+43
-1
No files found.
public/assets/js/backend/general/attachment.js
View file @
69cbeee9
...
...
@@ -81,6 +81,19 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
// 为表格绑定事件
Table
.
api
.
bindevent
(
table
);
// 点击图片弹窗显示大图
$
(
document
).
on
(
'click'
,
'.img-preview'
,
function
()
{
var
url
=
$
(
this
).
data
(
"url"
);
Layer
.
open
({
type
:
1
,
title
:
false
,
closeBtn
:
1
,
shadeClose
:
true
,
area
:
[
'auto'
,
'auto'
],
content
:
'<img src="'
+
url
+
'" style="max-width:90vw;max-height:90vh;" />'
});
});
// 附件归类
$
(
document
).
on
(
'click'
,
'.btn-classify'
,
function
()
{
var
ids
=
Table
.
api
.
selectedids
(
table
);
...
...
@@ -200,6 +213,20 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
// 为表格绑定事件
Table
.
api
.
bindevent
(
table
);
// 点击图片弹窗显示大图
$
(
document
).
on
(
'click'
,
'.img-preview'
,
function
()
{
var
url
=
$
(
this
).
data
(
"url"
);
Layer
.
open
({
type
:
1
,
title
:
false
,
closeBtn
:
1
,
shadeClose
:
true
,
area
:
[
'auto'
,
'auto'
],
content
:
'<img src="'
+
url
+
'" style="max-width:90vw;max-height:90vh;" />'
});
});
require
([
'upload'
],
function
(
Upload
)
{
$
(
"#toolbar .faupload"
).
data
(
"category"
,
function
(
file
)
{
var
category
=
$
(
"ul.nav-tabs[data-field='category'] li.active a"
).
data
(
"value"
);
...
...
@@ -239,12 +266,27 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
api
:
{
bindevent
:
function
()
{
Form
.
api
.
bindevent
(
$
(
"form[role=form]"
));
// 点击图片弹窗显示大图
$
(
document
).
on
(
'click'
,
'.img-preview'
,
function
()
{
var
url
=
$
(
this
).
data
(
"url"
);
console
.
log
(
'url:'
+
url
);
Layer
.
open
({
type
:
1
,
title
:
false
,
closeBtn
:
1
,
shadeClose
:
true
,
area
:
[
'auto'
,
'auto'
],
content
:
'<img src="'
+
url
+
'" style="max-width:90vw;max-height:90vh;" />'
});
});
},
formatter
:
{
thumb
:
function
(
value
,
row
,
index
)
{
var
html
=
''
;
if
(
row
.
mimetype
.
indexOf
(
"image"
)
>
-
1
)
{
html
=
'<
a href="'
+
row
.
fullurl
+
'" target="_blank"><img src="'
+
row
.
fullurl
+
row
.
thumb_style
+
'" alt="" style="max-height:60px;max-width:120px"></a
>'
;
html
=
'<
span class="img-preview" data-url="'
+
row
.
fullurl
+
'" style="cursor:pointer;"><img src="'
+
row
.
fullurl
+
row
.
thumb_style
+
'" alt="" style="max-height:60px;max-width:120px;"></span
>'
;
}
else
{
html
=
'<a href="'
+
row
.
fullurl
+
'" target="_blank"><img src="'
+
Fast
.
api
.
fixurl
(
"ajax/icon"
)
+
"?suffix="
+
row
.
imagetype
+
'" alt="" style="max-height:90px;max-width:120px"></a>'
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment