ソースを参照

优化上传图片后预览事件

Karson 4 年 前
コミット
e097ae2429

ファイルの差分が大きいため隠しています
+ 1 - 1
public/assets/css/backend.min.css


ファイルの差分が大きいため隠しています
+ 1 - 1
public/assets/css/frontend.min.css


ファイルの差分が大きいため隠しています
+ 15307 - 17
public/assets/js/require-backend.min.js


ファイルの差分が大きいため隠しています
+ 14915 - 17
public/assets/js/require-frontend.min.js


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

@@ -254,8 +254,9 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                 var exportDataType = options.exportDataType;
                 // 处理选中筛选框后按钮的状态统一变更
                 table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table post-body.bs.table', function (e) {
-                    var allIds = table.bootstrapTable("getData").map(function (item) {
-                        return item[options.pk];
+                    var allIds = [];
+                    $.each(table.bootstrapTable("getData"), function (i, item) {
+                        allIds.push(typeof item[options.pk] != 'undefined' ? item[options.pk] : '');
                     });
                     var selectedIds = Table.api.selectedids(table, true),
                         selectedData = Table.api.selecteddata(table, true);

+ 3 - 1
public/assets/js/require-upload.js

@@ -344,10 +344,12 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
                                     }
                                     var suffix = /[\.]?([a-zA-Z0-9]+)$/.exec(j);
                                     suffix = suffix ? suffix[1] : 'file';
-                                    var data = {url: j, fullurl: Fast.api.cdnurl(j), data: $(that).data(), key: i, index: i, value: (json && typeof json[i] !== 'undefined' ? json[i] : null), suffix: suffix};
+                                    var value = (json && typeof json[i] !== 'undefined' ? json[i] : null);
+                                    var data = {url: j, fullurl: Fast.api.cdnurl(j), data: $(that).data(), key: i, index: i, value: value, row: value, suffix: suffix};
                                     var html = tpl ? Template(tpl, data) : Template.render(Upload.config.previewtpl, data);
                                     $("#" + preview_id).append(html);
                                 });
+                                refresh($("#" + preview_id).data("name"));
                             });
                             $("#" + input_id).trigger("change");
                         }