ソースを参照

Merge branch 'master' of http://39.106.184.70:3000/ctop/adsp-vue

zhuxinbo 5 年 前
コミット
1f4209ae76
2 ファイル変更20 行追加12 行削除
  1. 9 4
      src/components/DatePicker.vue
  2. 11 8
      src/views/modules/Statistics/newHome.vue

+ 9 - 4
src/components/DatePicker.vue

@@ -2,8 +2,8 @@
   <!-- 组件使用时 需要传入属性 openOptions:true|false 控制是否打开
     left :string|0  left为侧边的按钮的定位 0 表示不改变 或者传入字符串 如-100px 表示css中left:-100px
   -->
-  <div class="datePicker" v-clickoutside="handleClose">
-    <a-range-picker
+  <div class="datePicker" >
+    <a-range-picker v-clickoutside="handleClose"
       v-model="dateValue"
       style="width:250px;height:150px"
       :open="openOptions"
@@ -139,8 +139,13 @@ export default {
       this.$parent.type = val.value
       this.$parent.dateValue = val.dateValue
     },
-    handleClose() {
-      this.$parent.opendateClose()
+    handleClose(e) {
+        console.log(e)
+        if(!e.target.nodeType){
+            this.$parent.opendateClose()
+        }
+            // this.$parent.opendateClose()
+      
     },
     disabledDate(current) {
       // console.log(current)

+ 11 - 8
src/views/modules/Statistics/newHome.vue

@@ -289,13 +289,6 @@ let sectionOption={
             data:  [],
             color:'#8A2BE2'
         },
-        // {
-        //     name: '',
-        //     type: 'line',
-        //     // smooth: true,
-        //     data:  [],
-        //     color:'rgba(0,0,0,0)'
-        // }
     ]
 }
 
@@ -434,7 +427,17 @@ export default {
             })
         }
     },
-    
+    dateValue: {
+    handler(newName, oldName) {
+        this.sectionHttp({
+            type:this.type,
+            startDate:this.dateValue[0].format('YYYY-MM-DD'),
+            endDate:this.dateValue[1].format('YYYY-MM-DD')
+            })
+    },
+    immediate: true,
+    deep: true
+  }
   },
   methods: {
     //获取echart的值