fastadmin 學習記錄

chaofu發表於2019-08-05
  1. 使用上傳外掛
    html
    <a href="javascript:;" class="btn btn-danger btn-stock-file" id="btn-stock-file" title="複製出來的匯入按鈕" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i>&nbsp;複製出來的匯入按鈕</a>\
    js
    require(['upload'], function (Upload) {
                    Upload.api.plupload($("#btn-stock-file"), function (data, ret) {
                        Fast.api.ajax({
                            url: '/admin/bluewhale/Attr/import',
                            data: {file: data.url},
                        }, function (data, ret) {
                            table1.bootstrapTable('refresh');
                        },function (data, ret) {
                            table1.bootstrapTable('refresh');
                        });
                    });
                });
本作品採用《CC 協議》,轉載必須註明作者和本文連結