Commit efd35854 authored by agping's avatar agping

业绩对比 样式优化

parent 20da2f31
...@@ -250,4 +250,26 @@ export default { ...@@ -250,4 +250,26 @@ export default {
var s = year+"-"+(mon<10?('0'+mon):mon)+"-"+"01" var s = year+"-"+(mon<10?('0'+mon):mon)+"-"+"01"
return s; return s;
}, },
//获取前n天的时间
getBeforeDate(n){
var d = new Date();
var year = d.getFullYear();
var mon=d.getMonth()+1;
var day=d.getDate();
if(day <= n){
if(mon>1) {
mon=mon-1;
}
else {
year = year-1;
mon = 12;
}
}
d.setDate(d.getDate()-n);
year = d.getFullYear();
mon=d.getMonth()+1;
day=d.getDate();
var s = year+"-"+(mon<10?('0'+mon):mon)+"-"+(day<10?('0'+day):day)
return s;
}
}; };
\ No newline at end of file
...@@ -40,12 +40,11 @@ ...@@ -40,12 +40,11 @@
<td>人数</td> <td>人数</td>
</tr> </tr>
<tr class="main-con" v-for="(item2,index) in item.value"> <tr class="main-con" v-for="(item2,index) in item.value">
<!--<td>{{(item2.real_performance_time).replace(/-/g, '.')}}</td>--> <td v-html='processingCharacter(item2.real_performance_time)' style="line-height: .32rem;height: .88rem;vertical-align: middle;"></td>
<td>{{(item2.real_performance_time)}}</td> <td style="vertical-align: middle;height: .88rem;line-height: .88rem;">{{item2.real_performance}}</td>
<td>{{item2.real_performance}}</td> <td v-html='processingCharacter(item2.performance_time)' style="line-height: .32rem;height: .88rem;vertical-align: middle;"></td>
<td>{{(item2.performance_time)}}</td> <td style="vertical-align: middle;">{{item2.performance}}</td>
<td>{{item2.performance}}</td> <td style="vertical-align: middle;">{{item2.people_num}}</td>
<td>{{item2.people_num}}</td>
</tr> </tr>
</div> </div>
</table> </table>
...@@ -83,10 +82,10 @@ ...@@ -83,10 +82,10 @@
}, },
birthday0:"", //出生日期 birthday0:"", //出生日期
birthday1:"", //出生日期 birthday1:"", //出生日期
birthday2:"01", //出生日期 birthday2:"01", //默认第一天时间
birthday3:"01", //出生日期 birthday3:"01", //默认当天时间
birthday4:"01", //出生日期 birthday4:"01", //默认第一天时间
birthday5:"01", //出生日期 birthday5:"01", //默认当天时间
type:1, type:1,
startDate: new Date('2019-01'), startDate: new Date('2019-01'),
dataList:[], dataList:[],
...@@ -95,8 +94,10 @@ ...@@ -95,8 +94,10 @@
}, },
created() { created() {
let _this = this; let _this = this;
_this.birthday0 = _this.common.getMonthDate(1).substr(0,_this.common.getMonthDate(1).length-3); _this.birthday3 = _this.common.getBeforeDate(0).substr(8,9);//默认当天时间
_this.birthday1 = _this.common.getMonthDate(1).substr(0,_this.common.getMonthDate(1).length-3); _this.birthday5 = _this.common.getBeforeDate(0).substr(8,9);//默认当天时间
_this.birthday0 = _this.common.getMonthDate(60).substr(0,_this.common.getMonthDate(1).length-3);//默认前3个月
_this.birthday1 = _this.common.getMonthDate(1).substr(0,_this.common.getMonthDate(1).length-3);//默认本月
_this.common.duringRequest({ _this.common.duringRequest({
'urlStr': '/index/performanceStatistics', 'urlStr': '/index/performanceStatistics',
startAction() { startAction() {
...@@ -229,6 +230,12 @@ ...@@ -229,6 +230,12 @@
d = d < 10 ? ('0' + d) : d d = d < 10 ? ('0' + d) : d
return d return d
}, },
// 处理字符
processingCharacter(r) {
r = r.replace('至', '<br/>至 ');
return r;
},
}, },
computed: { computed: {
...@@ -244,6 +251,7 @@ ...@@ -244,6 +251,7 @@
border:1px solid rgba(216,216,216,1); border:1px solid rgba(216,216,216,1);
height: .6rem; height: .6rem;
line-height: .6rem; line-height: .6rem;
} }
.con{ .con{
background: #fff; background: #fff;
...@@ -262,7 +270,8 @@ ...@@ -262,7 +270,8 @@
} }
.main-con td{ .main-con td{
color:#333333; color:#333333;
font-size: .2rem; font-size: .22rem;
font-weight: 600;
} }
.main-con td:nth-of-type(1),.main-con td:nth-of-type(3){ .main-con td:nth-of-type(1),.main-con td:nth-of-type(3){
/*width: 2.6rem;*/ /*width: 2.6rem;*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment