Commit 69cbeee9 authored by 刘小敏's avatar 刘小敏

附件列表 图片点击查看大图

parent 45381fe9
...@@ -81,6 +81,19 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin ...@@ -81,6 +81,19 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
// 为表格绑定事件 // 为表格绑定事件
Table.api.bindevent(table); 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 () { $(document).on('click', '.btn-classify', function () {
var ids = Table.api.selectedids(table); var ids = Table.api.selectedids(table);
...@@ -200,6 +213,20 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin ...@@ -200,6 +213,20 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
// 为表格绑定事件 // 为表格绑定事件
Table.api.bindevent(table); 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) { require(['upload'], function (Upload) {
$("#toolbar .faupload").data("category", function (file) { $("#toolbar .faupload").data("category", function (file) {
var category = $("ul.nav-tabs[data-field='category'] li.active a").data("value"); 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 ...@@ -239,12 +266,27 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
api: { api: {
bindevent: function () { bindevent: function () {
Form.api.bindevent($("form[role=form]")); 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: { formatter: {
thumb: function (value, row, index) { thumb: function (value, row, index) {
var html = ''; var html = '';
if (row.mimetype.indexOf("image") > -1) { 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 { } 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>'; 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>';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment