shop.ShopCategory.Batch.js
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
webpackJsonp([15],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $ = __webpack_require__(1),
common = __webpack_require__(2);
$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>');
function batchExport(el, type) {
var loadModal = null;
return {
params: {
type: type,
__type: "batch-import"
},
onStart: function() {
loadModal = common.dialog.load();
$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", ""));
},
onComplete: function(response) {
console.log(response);
if (loadModal) {
loadModal.close();
}
if (response.code == 200) {
common.util.__tip(response.message, 'success');
} else {
$('#message').html('<pre><span class="red">' + response.message + '</span></pre>');
$('#message').parent().show();
}
$(el).parents('td').find('.file-name').text("请选择文件");
}
}
}
common.edit.ajaxfileupload('#shop-category-skn', batchExport('#shop-category-skn', 'categoryLinkProduct'));
/***/ }
]);