...
|
...
|
@@ -101,41 +101,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin |
|
|
// {field: 'team_id', title: __('Team_id')},
|
|
|
{field: 'earn_score', title: __('Earn_score'),operate:false},
|
|
|
{field: 'unique', title: __('Unique'), operate:false},
|
|
|
{field: 'barcode_images', title: __('Barcode'),events: Table.api.events.image, formatter: Table.api.formatter.image, operate:false},
|
|
|
//{field: 'barcode_images', title: __('Barcode'),events: Table.api.events.image, formatter: Table.api.formatter.image, operate:false},
|
|
|
{field: 'rank', title: __('Rank'),operate: false},
|
|
|
// {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
// {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
|
|
buttons: [
|
|
|
{
|
|
|
name: 'click',
|
|
|
title: __('下载'),
|
|
|
text: __('下载'),
|
|
|
classname: 'btn btn-xs btn-info btn-click',
|
|
|
icon: 'fa fa-leaf',
|
|
|
// dropdown: '更多',//如果包含dropdown,将会以下拉列表的形式展示
|
|
|
click: function (e, data) {
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'get',
|
|
|
url: 'study/down',
|
|
|
data: {id: data.id},
|
|
|
success: function (res) {
|
|
|
if (res.code === 1) {
|
|
|
var domain = window.location.href.split(':')[0] + '://' + document.domain;
|
|
|
var url = domain + data.barcode;
|
|
|
var link = document.createElement('a');
|
|
|
link.setAttribute("download", data.name);
|
|
|
link.href = url;
|
|
|
link.click();
|
|
|
$(".btn-refresh").trigger("click");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
},
|
|
|
],
|
|
|
// buttons: [
|
|
|
// {
|
|
|
// name: 'click',
|
|
|
// title: __('下载'),
|
|
|
// text: __('下载'),
|
|
|
// classname: 'btn btn-xs btn-info btn-click',
|
|
|
// icon: 'fa fa-leaf',
|
|
|
// // dropdown: '更多',//如果包含dropdown,将会以下拉列表的形式展示
|
|
|
// click: function (e, data) {
|
|
|
//
|
|
|
// $.ajax({
|
|
|
// type: 'get',
|
|
|
// url: 'study/down',
|
|
|
// data: {id: data.id},
|
|
|
// success: function (res) {
|
|
|
// if (res.code === 1) {
|
|
|
// var domain = window.location.href.split(':')[0] + '://' + document.domain;
|
|
|
// var url = domain + data.barcode;
|
|
|
// var link = document.createElement('a');
|
|
|
// link.setAttribute("download", data.name);
|
|
|
// link.href = url;
|
|
|
// link.click();
|
|
|
// $(".btn-refresh").trigger("click");
|
|
|
// }
|
|
|
// }
|
|
|
// });
|
|
|
//
|
|
|
// }
|
|
|
// },
|
|
|
// ],
|
|
|
formatter: Table.api.formatter.operate}
|
|
|
]
|
|
|
]
|
...
|
...
|
|