显示
$(function() {
$("#category").fix({
float : 'left',
//minStatue : true,
skin : 'green',
durationTime :false,
spacingw:20,
spacingh:240,
set_scrollsidebar:'.right_grading',
});
});
$(function() {
$("#Statistic_pie").fix({
float : 'top',
//minStatue : true,
skin : 'green',
durationTime :false,
spacingw:0,
spacingh:0,
close_btn:'.top_close_btn',
show_btn:'.top_show_btn',
side_list:'.Statistics',
close_btn_width:80,
side_title:'.Statistic_title',
});
});
/*用户-查看*/
function member_show(title,url,id,w,h){
layer_show(title,url+'#?='+id,w,h);
}
/*用户-停用*/
function member_stop(obj,id){
layer.confirm('确认要停用吗?',function(index){
$(obj).parents("tr").find(".td-manage").prepend('');
$(obj).parents("tr").find(".td-status").html('已停用');
$(obj).remove();
layer.msg('已停用!',{icon: 5,time:1000});
});
}
/*用户-启用*/
function member_start(obj,id){
layer.confirm('确认要启用吗?',function(index){
$(obj).parents("tr").find(".td-manage").prepend('');
$(obj).parents("tr").find(".td-status").html('已启用');
$(obj).remove();
layer.msg('已启用!',{icon: 6,time:1000});
});
}
//初始化宽度、高度
$(".widget-box").height($(window).height());
$(".page_right_style").width($(window).width()-220);
//$(".table_menu_list").width($(window).width()-240);
//当文档窗口发生改变时 触发
$(window).resize(function(){
$(".widget-box").height($(window).height());
$(".page_right_style").width($(window).width()-220);
//$(".table_menu_list").width($(window).width()-240);
})
/**************/
require.config({
paths: {
echarts: './assets/dist'
}
});
require(
[
'echarts',
'echarts/theme/macarons',
'echarts/chart/pie', // 按需加载所需图表,如需动态类型切换功能,别忘了同时加载相应图表
'echarts/chart/funnel'
],
function (ec,theme) {
var myChart = ec.init(document.getElementById('Statistics'),theme);
option = {
title : {
text: '用户等级统计',
subtext: '实时更新最新等级',
x:'center'
},
tooltip : {
trigger: 'item',
formatter: "{a}
{b} : {c} ({d}%)"
},
legend: {
x : 'center',
y : 'bottom',
data:['普通用户','铁牌用户','铜牌用户','银牌用户','金牌用户','钻石用户','蓝钻用户','红钻用户']
},
toolbox: {
show : true,
feature : {
mark : {show: false},
dataView : {show: false, readOnly: true},
magicType : {
show: true,
type: ['pie', 'funnel'],
option: {
funnel: {
x: '25%',
width: '50%',
funnelAlign: 'left',
max: 6200
}
}
},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
series : [
{
name:'品牌数量',
type:'pie',
radius : '55%',
center: ['50%', '60%'],
data:[
{value:1200, name:'普通用户'},
{value:1100, name:'铁牌用户'},
{value:1300, name:'铜牌用户'},
{value:1000, name:'银牌用户'},
{value:980, name:'金牌用户'},
{value:850, name:'钻石用户'},
{value:550, name:'蓝钻用户'},
{value:220, name:'红钻用户'},
]
}
]
};
myChart.setOption(option);
}
);
$(function($) {
var oTable1 = $('#sample-table').dataTable( {
"aaSorting": [[ 1, "desc" ]],//默认第几个排序
"bStateSave": true,//状态保存
"aoColumnDefs": [
//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
{"orderable":false,"aTargets":[0,2,3,4,5,6,7,9]}// 制定列不参与排序
] } );
$('table th input:checkbox').on('click' , function(){
var that = this;
$(this).closest('table').find('tr > td:first-child input:checkbox')
.each(function(){
this.checked = that.checked;
$(this).closest('tr').toggleClass('selected');
});
});
$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
function tooltip_placement(context, source) {
var $source = $(source);
var $parent = $source.closest('table')
var off1 = $parent.offset();
var w1 = $parent.width();
var off2 = $source.offset();
var w2 = $source.width();
if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
return 'left';
}
});
一键复制
编辑
Web IDE
原始数据
按行查看
历史