Browse Source

列表无图的时候,使用一个透明图片替代

李云龙 7 years ago
parent
commit
f2fda511a2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      public/assets/js/require-table.js

+ 2 - 0
public/assets/js/require-table.js

@@ -298,6 +298,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     return '<i class="' + value + '"></i> ' + value;
                 },
                 image: function (value, row, index) {
+                    value=value?value:'/assets/img/blank.gif';
                     var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center';
                     return '<img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" />';
                 },
@@ -306,6 +307,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     var arr = value.split(',');
                     var html = [];
                     $.each(arr, function (i, value) {
+                        value=value?value:'/assets/img/blank.gif';
                         html.push('<img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" />');
                     });
                     return html.join(' ');