|
|
|
@@ -16,29 +16,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
|
|
|
|
|
var table = $("#table");
|
|
|
|
|
|
|
|
|
|
// 从后端获取颜色映射
|
|
|
|
|
// 从后端获取颜色和生肖映射
|
|
|
|
|
Controller.api.loadColorMap(function () {
|
|
|
|
|
table.bootstrapTable({
|
|
|
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
|
|
pk: 'expect',
|
|
|
|
|
sortName: 'expect',
|
|
|
|
|
columns: [
|
|
|
|
|
[
|
|
|
|
|
{checkbox: true},
|
|
|
|
|
{field: 'expect', title: __('Expect')},
|
|
|
|
|
{field: 'num1', title: __('Num1'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num2', title: __('Num2'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num3', title: __('Num3'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num4', title: __('Num4'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num5', title: __('Num5'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num6', title: __('Num6'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num7', title: __('Num7'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'openTime', title: __('OpenTime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
|
|
Controller.api.loadAnimalMap(function () {
|
|
|
|
|
table.bootstrapTable({
|
|
|
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
|
|
pk: 'expect',
|
|
|
|
|
sortName: 'expect',
|
|
|
|
|
columns: [
|
|
|
|
|
[
|
|
|
|
|
{checkbox: true},
|
|
|
|
|
{field: 'expect', title: __('Expect')},
|
|
|
|
|
{field: 'num1', title: __('Num1'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num2', title: __('Num2'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num3', title: __('Num3'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num4', title: __('Num4'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num5', title: __('Num5'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num6', title: __('Num6'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'num7', title: __('Num7'), formatter: Controller.api.formatter.numBall},
|
|
|
|
|
{field: 'openTime', title: __('OpenTime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Table.api.bindevent(table);
|
|
|
|
|
Table.api.bindevent(table);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 遗漏号码按钮事件
|
|
|
|
@@ -55,6 +57,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
api: {
|
|
|
|
|
colorMap: {},
|
|
|
|
|
colorMapLoaded: false,
|
|
|
|
|
animalMap: {},
|
|
|
|
|
animalMapLoaded: false,
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从后端加载颜色映射并缓存
|
|
|
|
@@ -78,6 +82,35 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从后端加载生肖映射并缓存
|
|
|
|
|
*/
|
|
|
|
|
loadAnimalMap: function (callback) {
|
|
|
|
|
if (Controller.api.animalMapLoaded) {
|
|
|
|
|
callback();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: 'num/getAnimalMap',
|
|
|
|
|
type: 'GET',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (ret) {
|
|
|
|
|
if (ret.code == 1) {
|
|
|
|
|
Controller.api.animalMap = ret.msg;
|
|
|
|
|
}
|
|
|
|
|
Controller.api.animalMapLoaded = true;
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据数字从映射表中获取生肖
|
|
|
|
|
*/
|
|
|
|
|
getAnimalByNum: function (num) {
|
|
|
|
|
return Controller.api.animalMap[num] || '';
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据数字从映射表中获取颜色
|
|
|
|
|
*/
|
|
|
|
@@ -96,7 +129,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
if (value === null || value === undefined || value === '') return '';
|
|
|
|
|
var num = parseInt(value);
|
|
|
|
|
var color = Controller.api.getColorByNum(num);
|
|
|
|
|
return '<span class="num-ball" style="display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;border-radius:50%;color:#fff;background-color:' + color + ';font-weight:bold;">' + value + '</span>';
|
|
|
|
|
var animal = Controller.api.getAnimalByNum(num);
|
|
|
|
|
var html = '<div style="text-align:center;">' +
|
|
|
|
|
'<span class="num-ball" style="display:inline-block;width:32px;height:32px;line-height:32px;text-align:center;border-radius:50%;color:#fff;background-color:' + color + ';font-weight:bold;">' + value + '</span>';
|
|
|
|
|
if (animal) {
|
|
|
|
|
html += '<div style="font-size:10px;color:#666;line-height:1.2;">' + animal + '</div>';
|
|
|
|
|
}
|
|
|
|
|
html += '</div>';
|
|
|
|
|
return html;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -197,6 +237,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
var container = $('<div style="display:flex;flex-wrap:wrap;gap:12px;"></div>');
|
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
var color = Controller.api.getColorByNum(data[i].num);
|
|
|
|
|
var animal = Controller.api.getAnimalByNum(data[i].num);
|
|
|
|
|
var $item = $('<div style="text-align:center;"></div>');
|
|
|
|
|
var $ball = $('<span class="num-ball"></span>').css({
|
|
|
|
|
'display': 'inline-block',
|
|
|
|
@@ -210,10 +251,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
'font-weight': 'bold',
|
|
|
|
|
'font-size': '18px'
|
|
|
|
|
}).text(data[i].num);
|
|
|
|
|
var $label = $('<div style="margin-top:5px;font-size:12px;color:#666;"></div>').text(
|
|
|
|
|
var $content = $('<div></div>').append($ball);
|
|
|
|
|
if (animal) {
|
|
|
|
|
$content.append($('<div style="margin-top:3px;font-size:11px;color:#666;line-height:1.2;"></div>').text(animal));
|
|
|
|
|
}
|
|
|
|
|
$content.append($('<div style="margin-top:3px;font-size:12px;color:#666;"></div>').text(
|
|
|
|
|
__('Missing') + ' ' + data[i].omit + ' ' + __('periods')
|
|
|
|
|
);
|
|
|
|
|
$item.append($ball).append($label);
|
|
|
|
|
));
|
|
|
|
|
$item.append($content);
|
|
|
|
|
container.append($item);
|
|
|
|
|
}
|
|
|
|
|
$('#missing-result', layero).html('').append(container);
|
|
|
|
|