python学习
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
99
web/static/js/chart.js
Normal file
99
web/static/js/chart.js
Normal file
@@ -0,0 +1,99 @@
|
||||
;
|
||||
//画图通用组件,虽然估计很难统一,但是总要走出第一步了
|
||||
var charts_ops = {
|
||||
setOption:function(){
|
||||
Highcharts.setOptions({
|
||||
chart: {
|
||||
},
|
||||
exporting: {
|
||||
enabled: false
|
||||
},
|
||||
legend: {
|
||||
//enabled:false
|
||||
},
|
||||
credits:{
|
||||
enabled:false
|
||||
},
|
||||
colors:['#058DC7', '#50B432', '#ED561B', '#DDDF00',
|
||||
'#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4','#E93EFF'],
|
||||
title: '',
|
||||
xAxis: {
|
||||
tickWidth:0,
|
||||
lineWidth: 0,
|
||||
gridLineColor: '#eee',
|
||||
//gridLineWidth: 1,
|
||||
crosshair: {
|
||||
width: 1,
|
||||
color: '#ebebeb'
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#eee',
|
||||
gridLineWidth: 1,
|
||||
title: ''
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
pointPadding: 0.2,
|
||||
pointWidth: 20,
|
||||
borderWidth: 0
|
||||
},
|
||||
series: {
|
||||
marker: {
|
||||
enabled: false
|
||||
},
|
||||
},
|
||||
line: {
|
||||
lineWidth: 2,
|
||||
states: {
|
||||
hover: {
|
||||
lineWidth: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: '#404750',
|
||||
borderWidth: 0,
|
||||
shadow: false,
|
||||
headerFormat: '',
|
||||
footerFormat: '',
|
||||
shared: true,
|
||||
useHTML: true,
|
||||
style: {
|
||||
color: '#fff',
|
||||
padding: '5px'
|
||||
}
|
||||
},
|
||||
lang: {
|
||||
noData: "暂无数据"
|
||||
},
|
||||
noData: {
|
||||
style: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: '15px',
|
||||
color: '#303030'
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
drawLine:function( target ,data ){//画直线
|
||||
var chart = target.highcharts({
|
||||
chart: {
|
||||
type: 'spline'
|
||||
},
|
||||
xAxis: {
|
||||
categories: data.categories
|
||||
},
|
||||
series: data.series,
|
||||
legend: {
|
||||
enabled:true,
|
||||
align: 'right',
|
||||
verticalAlign: 'top',
|
||||
x: 0,
|
||||
y: -15
|
||||
}
|
||||
});
|
||||
return chart;
|
||||
}
|
||||
};
|
||||
@@ -139,7 +139,7 @@ var common_ops = {
|
||||
scrollTop: target.offset().top - 10
|
||||
}, 100);
|
||||
},
|
||||
buildUrl:function( path ,params ){
|
||||
buildUrl:function( path ,params ){
|
||||
var url = "" + path;
|
||||
var _paramUrl = "";
|
||||
if( params ){
|
||||
@@ -150,11 +150,11 @@ var common_ops = {
|
||||
}
|
||||
return url + _paramUrl;
|
||||
},
|
||||
buildPicUrl:function( img_key ){
|
||||
buildPicUrl:function( img_key ){
|
||||
var domain = $(".hidden_layout_wrap input[name=domain]").val();
|
||||
var prefix_url = $(".hidden_layout_wrap input[name=prefix_url]").val();
|
||||
return domain + prefix_url + img_key;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function() {
|
||||
|
||||
28
web/static/js/index/index.js
Normal file
28
web/static/js/index/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
;
|
||||
var dashboard_index_ops = {
|
||||
init:function(){
|
||||
this.drawChart();
|
||||
},
|
||||
drawChart:function(){
|
||||
charts_ops.setOption();
|
||||
$.ajax({
|
||||
url:common_ops.buildUrl("/chart/dashboard"),
|
||||
dataType:'json',
|
||||
success:function( res ){
|
||||
charts_ops.drawLine( $('#member_order'),res.data )
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url:common_ops.buildUrl("/chart/finance"),
|
||||
dataType:'json',
|
||||
success:function( res ){
|
||||
charts_ops.drawLine( $('#finance'),res.data )
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function(){
|
||||
dashboard_index_ops.init();
|
||||
});
|
||||
0
web/static/js/stat/index.js
Normal file
0
web/static/js/stat/index.js
Normal file
34
web/static/js/stat/member.js
Normal file
34
web/static/js/stat/member.js
Normal file
@@ -0,0 +1,34 @@
|
||||
;
|
||||
var stat_member_ops = {
|
||||
init:function(){
|
||||
this.eventBind();
|
||||
this.datetimepickerComponent();
|
||||
},
|
||||
eventBind:function(){
|
||||
$("#search_form_wrap .search").click( function(){
|
||||
$("#search_form_wrap").submit();
|
||||
});
|
||||
},
|
||||
datetimepickerComponent:function() {
|
||||
var that = this;
|
||||
$.datetimepicker.setLocale('zh');
|
||||
params = {
|
||||
scrollInput: false,
|
||||
scrollMonth: false,
|
||||
scrollTime: false,
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'zh',
|
||||
todayButton: true,//回到今天
|
||||
defaultSelect: true,
|
||||
defaultDate: new Date().Format('yyyy-MM-dd'),
|
||||
format: 'Y-m-d',//格式化显示
|
||||
timepicker: false
|
||||
};
|
||||
$('#search_form_wrap input[name=date_from]').datetimepicker(params);
|
||||
$('#search_form_wrap input[name=date_to]').datetimepicker(params);
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function(){
|
||||
stat_member_ops.init();
|
||||
});
|
||||
34
web/static/js/stat/product.js
Normal file
34
web/static/js/stat/product.js
Normal file
@@ -0,0 +1,34 @@
|
||||
;
|
||||
var stat_product_ops = {
|
||||
init:function(){
|
||||
this.eventBind();
|
||||
this.datetimepickerComponent();
|
||||
},
|
||||
eventBind:function(){
|
||||
$("#search_form_wrap .search").click( function(){
|
||||
$("#search_form_wrap").submit();
|
||||
});
|
||||
},
|
||||
datetimepickerComponent:function() {
|
||||
var that = this;
|
||||
$.datetimepicker.setLocale('zh');
|
||||
params = {
|
||||
scrollInput: false,
|
||||
scrollMonth: false,
|
||||
scrollTime: false,
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'zh',
|
||||
todayButton: true,//回到今天
|
||||
defaultSelect: true,
|
||||
defaultDate: new Date().Format('yyyy-MM-dd'),
|
||||
format: 'Y-m-d',//格式化显示
|
||||
timepicker: false
|
||||
};
|
||||
$('#search_form_wrap input[name=date_from]').datetimepicker(params);
|
||||
$('#search_form_wrap input[name=date_to]').datetimepicker(params);
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function(){
|
||||
stat_product_ops.init();
|
||||
});
|
||||
46
web/static/js/stat/share.js
Normal file
46
web/static/js/stat/share.js
Normal file
@@ -0,0 +1,46 @@
|
||||
;
|
||||
var stat_share_ops = {
|
||||
init:function(){
|
||||
this.eventBind();
|
||||
this.drawChart();
|
||||
this.datetimepickerComponent();
|
||||
},
|
||||
eventBind:function(){
|
||||
$("#search_form_wrap .search").click( function(){
|
||||
$("#search_form_wrap").submit();
|
||||
});
|
||||
},
|
||||
datetimepickerComponent:function(){
|
||||
var that = this;
|
||||
$.datetimepicker.setLocale('zh');
|
||||
params = {
|
||||
scrollInput: false,
|
||||
scrollMonth: false,
|
||||
scrollTime: false,
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'zh',
|
||||
todayButton: true,//回到今天
|
||||
defaultSelect: true,
|
||||
defaultDate: new Date().Format('yyyy-MM-dd'),
|
||||
format: 'Y-m-d',//格式化显示
|
||||
timepicker: false
|
||||
};
|
||||
$('#search_form_wrap input[name=date_from]').datetimepicker(params);
|
||||
$('#search_form_wrap input[name=date_to]').datetimepicker(params);
|
||||
|
||||
},
|
||||
drawChart:function(){
|
||||
charts_ops.setOption();
|
||||
$.ajax({
|
||||
url:common_ops.buildUrl("/chart/share"),
|
||||
dataType:'json',
|
||||
success:function( res ){
|
||||
charts_ops.drawLine( $('#container'),res.data )
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function(){
|
||||
stat_share_ops.init();
|
||||
});
|
||||
@@ -10,6 +10,7 @@ var user_login_ops = {
|
||||
common_ops.alert("正在处理!!请不要重复提交~~");
|
||||
return;
|
||||
}
|
||||
|
||||
var login_name = $(".login_wrap input[name=login_name]").val();
|
||||
var login_pwd = $(".login_wrap input[name=login_pwd]").val();
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user