|
@@ -267,31 +267,31 @@
|
|
// var daystr = dateUtils.formateDate(date, 'yyyy年MM月dd日');
|
|
// var daystr = dateUtils.formateDate(date, 'yyyy年MM月dd日');
|
|
var daystr = dateUtils.formateDate(date, 'yyyy-MM-dd');
|
|
var daystr = dateUtils.formateDate(date, 'yyyy-MM-dd');
|
|
this.today = daystr;
|
|
this.today = daystr;
|
|
- var str= '星期'+'日一二三四五六'.charAt(date.getDay());
|
|
|
|
- this.week = str;
|
|
|
|
- if(this.$t('mainStatistics.name')=='Name'){
|
|
|
|
- if(date.getDay()=='0'){
|
|
|
|
- this.week = "SUN";
|
|
|
|
- }
|
|
|
|
- if(date.getDay()=='1'){
|
|
|
|
- this.week = "MON";
|
|
|
|
- }
|
|
|
|
- if(date.getDay()=='2'){
|
|
|
|
- this.week = "TUE";
|
|
|
|
- }
|
|
|
|
- if(date.getDay()=='3'){
|
|
|
|
- this.week = "WED";
|
|
|
|
- }
|
|
|
|
- if(date.getDay()=='4'){
|
|
|
|
- this.week = "THU";
|
|
|
|
- }
|
|
|
|
- if(date.getDay()=='5'){
|
|
|
|
- this.week = "FRI";
|
|
|
|
- }
|
|
|
|
- if(date.getDay()=='6'){
|
|
|
|
- this.week = "SAT";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // var str= '星期'+'日一二三四五六'.charAt(date.getDay());
|
|
|
|
+ this.week = this.$t('mainStatistics.week'+date.getDay());
|
|
|
|
+ // if(this.$t('mainStatistics.name')=='Name'){
|
|
|
|
+ // if(date.getDay()=='0'){
|
|
|
|
+ // this.week = "SUN";
|
|
|
|
+ // }
|
|
|
|
+ // if(date.getDay()=='1'){
|
|
|
|
+ // this.week = "MON";
|
|
|
|
+ // }
|
|
|
|
+ // if(date.getDay()=='2'){
|
|
|
|
+ // this.week = "TUE";
|
|
|
|
+ // }
|
|
|
|
+ // if(date.getDay()=='3'){
|
|
|
|
+ // this.week = "WED";
|
|
|
|
+ // }
|
|
|
|
+ // if(date.getDay()=='4'){
|
|
|
|
+ // this.week = "THU";
|
|
|
|
+ // }
|
|
|
|
+ // if(date.getDay()=='5'){
|
|
|
|
+ // this.week = "FRI";
|
|
|
|
+ // }
|
|
|
|
+ // if(date.getDay()=='6'){
|
|
|
|
+ // this.week = "SAT";
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
initDateRang(day, chartType) {
|
|
initDateRang(day, chartType) {
|
|
const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
@@ -442,6 +442,32 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
initChart(canvasId, chartData) {
|
|
initChart(canvasId, chartData) {
|
|
|
|
+ console.log("chartData:{}",chartData)
|
|
|
|
+ if(this.$t('lang')!='zh'){
|
|
|
|
+ chartData.categories = chartData.categories.map(e => {
|
|
|
|
+ if(e.indexOf('点') >= 0){
|
|
|
|
+ return e.replace('点',this.$t('mainStatistics.oclock'));
|
|
|
|
+ }
|
|
|
|
+ if(e.indexOf('周') >= 0){
|
|
|
|
+ const weekNum = e.substring(e.length-1)=='日'?'0':e.substring(e.length-1);
|
|
|
|
+ return this.$t('mainStatistics.week'+weekNum);
|
|
|
|
+ }
|
|
|
|
+ if(e.indexOf('月') >= 0){
|
|
|
|
+ return e.replace('月',this.$t('mainStatistics.month'));
|
|
|
|
+ }
|
|
|
|
+ return e;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ chartData.series = chartData.series.map(e => {
|
|
|
|
+ if(e['name']=='销售个数'){
|
|
|
|
+ e['name']=this.$t('mainStatistics.saleNum');
|
|
|
|
+ }
|
|
|
|
+ if(e['name']=='销售额'){
|
|
|
|
+ e['name']=this.$t('mainStatistics.saleroom');
|
|
|
|
+ }
|
|
|
|
+ return e;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
return new uCharts({
|
|
return new uCharts({
|
|
$this: _self,
|
|
$this: _self,
|
|
canvasId: canvasId,
|
|
canvasId: canvasId,
|