新增选择文件后回调

优化选择文件回调参数
pull/471/head
Karson 2024-07-25 15:25:37 +08:00
parent b6ae55ef1e
commit 3ee684875f
3 changed files with 7 additions and 4 deletions

View File

@ -167,7 +167,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
{
field: 'operate', title: __('Operate'), width: 85, events: {
'click .btn-chooseone': function (e, value, row, index) {
Fast.api.close({url: row.url, multiple: multiple});
Fast.api.close($.extend({multiple: multiple}, row));
},
}, formatter: function () {
return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';

View File

@ -295,6 +295,9 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
var url = Config.upload.fullmode ? Fast.api.cdnurl(data.url) : data.url;
$("#" + input_id).val(url).trigger("change").trigger("validate");
}
// 触发选择文件自定义事件
button.trigger("fa.event.selectedfile", data);
}
});
return false;

View File

@ -929,15 +929,15 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
buttons.push(tempButton[item.name]);
}
existBtn.push(item.name);
}
}
} else {
buttons.push(item);
}
}
});
defaultBtn.forEach(function (value, index) {
if (existBtn.indexOf(value) === -1) {
buttons.push(tempButton[value]);
}
}
});
return Table.api.buttonlink(this, buttons, value, row, index, 'operate');
}