Commit 62ff1131 by 罗承锋

Merge remote-tracking branch 'origin/master'

parents 95c7ea5e 5402564e
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
<a-col :span="24"> <a-col :span="24">
<a-card size="small" class="card-margin" title="访问统计量"> <a-card size="small" class="card-margin" title="访问统计量">
<div slot="extra"> <div slot="extra">
<a-range-picker :defaultValue="defaultValue" @change="onChange" :disabled-date="disabledDate" format="YYYY-MM-DD"/> <!-- //:defaultValue="[startTime, endTime]" defaultValue-->
<a-range-picker :defaultValue="[params.startTime, params.endTime]" @change="onChange" :disabled-date="disabledDate" format="YYYY-MM-DD"/>
<a-select v-model="type" class="type-style"> <a-select v-model="type" class="type-style">
<a-select-option value="hour">小时</a-select-option> <a-select-option value="hour">小时</a-select-option>
<a-select-option value="day"></a-select-option> <a-select-option value="day"></a-select-option>
...@@ -47,10 +48,10 @@ ...@@ -47,10 +48,10 @@
</div> </div>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12" class="echarts-box"> <a-col :span="12" class="echarts-box">
<pv ref="pv"></pv> <pv ref="pv" :pvState="params"></pv>
</a-col> </a-col>
<a-col :span="12" class="echarts-box"> <a-col :span="12" class="echarts-box">
<uv ref="uv"></uv> <uv ref="uv" :uvState="params"></uv>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
...@@ -73,9 +74,16 @@ export default { ...@@ -73,9 +74,16 @@ export default {
data() { data() {
return { return {
type: 'hour',
dateString: [], dateString: [],
defaultValue: [], defaultValue: [],
type: 'hour',
params:{
startTime:moment().startOf('day').subtract(6, 'days'),//开始时间
endTime:moment().endOf('day'),//结束时间
},
startTime01:"",//标准时间转为yyyy-MM-dd
endTime01:"",//标准时间转为yyyy-MM-dd
info: { info: {
deptName: '', deptName: '',
phone: '', phone: '',
...@@ -96,8 +104,9 @@ export default { ...@@ -96,8 +104,9 @@ export default {
}, },
watch : { watch : {
type: function(value) { type: function(value) {
this.$refs.pv.getEchartsData(this.dateString[0], this.dateString[1], value); this.type=value;
this.$refs.uv.getEchartsData(this.dateString[0], this.dateString[1], value); this.$refs.pv.getEchartsData(this.startTime01, this.endTime01, value);
this.$refs.uv.getEchartsData(this.startTime01, this.endTime01, value);
}, },
}, },
mounted() { mounted() {
...@@ -108,11 +117,15 @@ export default { ...@@ -108,11 +117,15 @@ export default {
this.allOrders = res.data.allOrders; this.allOrders = res.data.allOrders;
this.completeOrders = res.data.completeOrders; this.completeOrders = res.data.completeOrders;
}); });
this.$refs.pv.getEchartsData(this.startTime01, this.endTime01, this.type);
this.defaultValue[0] = moment(); this.$refs.uv.getEchartsData(this.startTime01, this.endTime01, this.type);
this.defaultValue[1] = moment().subtract(7, 'days'); },
beforeUpdate(){
}, },
methods: { methods: {
formDate(){
},
// 转化率 // 转化率
getTransfer() { getTransfer() {
...@@ -121,15 +134,19 @@ export default { ...@@ -121,15 +134,19 @@ export default {
return current && current > moment().endOf('day'); return current && current > moment().endOf('day');
}, },
onChange(date, dateString) { onChange(date, dateString) {
this.dateString[0] = dateString[0]; this.params.startTime = dateString[0];
this.dateString[1] = dateString[1]; this.params.endTime = dateString[1];
this.$refs.pv.getEchartsData(dateString[0], dateString[1], this.type); this.$refs.pv.getEchartsData(dateString[0], dateString[1],this.type);
this.$refs.uv.getEchartsData(dateString[0], dateString[1], this.type); this.$refs.uv.getEchartsData(dateString[0], dateString[1],this.type);
} }
}, },
//初始化 //初始化
created() { created() {
} let s = new Date(this.params.startTime._d);
this.startTime01=s.getFullYear() + '-' + (s.getMonth() + 1) + '-' + s.getDate()
let e = new Date(this.params.endTime._d);
this.endTime01=e.getFullYear() + '-' + (e.getMonth() + 1) + '-' + e.getDate()
},
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
......
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