正在显示
2 个修改的文件
包含
22 行增加
和
2 行删除
@@ -1327,6 +1327,9 @@ EOD; | @@ -1327,6 +1327,9 @@ EOD; | ||
1327 | if (in_array($datatype, ['set'])) { | 1327 | if (in_array($datatype, ['set'])) { |
1328 | $html .= ", operate:'FIND_IN_SET'"; | 1328 | $html .= ", operate:'FIND_IN_SET'"; |
1329 | } | 1329 | } |
1330 | + if (in_array($formatter, ['image','images'])) { | ||
1331 | + $html .= ", events: Table.api.events.image"; | ||
1332 | + } | ||
1330 | if ($itemArr && !$formatter) { | 1333 | if ($itemArr && !$formatter) { |
1331 | $formatter = 'normal'; | 1334 | $formatter = 'normal'; |
1332 | } | 1335 | } |
@@ -366,6 +366,23 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | @@ -366,6 +366,23 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | ||
366 | } | 366 | } |
367 | ); | 367 | ); |
368 | } | 368 | } |
369 | + },//单元格图片预览 | ||
370 | + image: { | ||
371 | + 'click .img-center': function (e, value, row, index) { | ||
372 | + data = []; | ||
373 | + value= value.split(","); | ||
374 | + $.each(value, function (index, value) { | ||
375 | + data.push({ | ||
376 | + src: Fast.api.cdnurl(value), | ||
377 | + }); | ||
378 | + }); | ||
379 | + layer.photos({ | ||
380 | + photos: { | ||
381 | + "data": data | ||
382 | + }, | ||
383 | + anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数) | ||
384 | + }); | ||
385 | + }, | ||
369 | } | 386 | } |
370 | }, | 387 | }, |
371 | // 单元格数据格式化 | 388 | // 单元格数据格式化 |
@@ -381,7 +398,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | @@ -381,7 +398,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | ||
381 | image: function (value, row, index) { | 398 | image: function (value, row, index) { |
382 | value = value ? value : '/assets/img/blank.gif'; | 399 | value = value ? value : '/assets/img/blank.gif'; |
383 | var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; | 400 | var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; |
384 | - return '<a href="' + Fast.api.cdnurl(value) + '" target="_blank"><img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" /></a>'; | 401 | + return '<a href="javascript:void(0)" target="_blank"><img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" /></a>'; |
385 | }, | 402 | }, |
386 | images: function (value, row, index) { | 403 | images: function (value, row, index) { |
387 | value = value === null ? '' : value.toString(); | 404 | value = value === null ? '' : value.toString(); |
@@ -390,7 +407,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | @@ -390,7 +407,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | ||
390 | var html = []; | 407 | var html = []; |
391 | $.each(arr, function (i, value) { | 408 | $.each(arr, function (i, value) { |
392 | value = value ? value : '/assets/img/blank.gif'; | 409 | value = value ? value : '/assets/img/blank.gif'; |
393 | - html.push('<a href="' + Fast.api.cdnurl(value) + '" target="_blank"><img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" /></a>'); | 410 | + html.push('<a href="javascript:void(0)" target="_blank"><img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" /></a>'); |
394 | }); | 411 | }); |
395 | return html.join(' '); | 412 | return html.join(' '); |
396 | }, | 413 | }, |
-
请 注册 或 登录 后发表评论