Browse Source

新增报表菜单,优化页面双击单击提示

baiyanting 1 year ago
parent
commit
9076f5a346

+ 21 - 34
src/components/qushi/qushiDialog.vue

@@ -30,6 +30,7 @@
                   <el-date-picker
                     v-model="starttime"
                     type="datetime"
+                    :disabled-date="disabledDate"
                     placeholder="选择日期"
                     popper-class="date-select"
                     format="YYYY-MM-DD HH:mm:ss"
@@ -43,6 +44,7 @@
                   <el-date-picker
                     v-model="endtime"
                     type="datetime"
+                    :disabled-date="disabledDate2"
                     popper-class="date-select"
                     placeholder="选择日期"
                     format="YYYY-MM-DD HH:mm:ss"
@@ -140,37 +142,6 @@
             show-overflow-tooltip
           >
           </el-table-column>
-          <!-- <el-table-column
-            align="center"
-            prop="name"
-            label="指标名称"
-            width="500"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <el-table-column
-            align="center"
-            prop="tagName"
-            label="描述"
-            width="400"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <el-table-column
-            align="center"
-            prop="dateTime"
-            label="快照时间"
-            width="200"
-          >
-          </el-table-column>
-          <el-table-column align="center" prop="value" label="快照值">
-          </el-table-column>
-          <el-table-column align="center" prop="minvalue" label="最小值">
-          </el-table-column>
-          <el-table-column align="center" prop="maxvalue" label="最大值">
-          </el-table-column>
-          <el-table-column align="center" prop="avgvalue" label="平均值">
-          </el-table-column> -->
           <el-table-column
             prop="showy"
             label="操作"
@@ -391,6 +362,22 @@ export default {
     this.endtime = new Date();
   },
   methods: {
+    // 时间选择器第一个禁用
+    disabledDate(time) {
+      if (this.endtime) {
+        return time.getTime() > Date.parse(this.endtime);
+      } else {
+        return null;
+      }
+    },
+    // 时间选择器第二个禁用
+    disabledDate2(time) {
+      if (this.starttime) {
+        return time.getTime() < Date.parse(this.starttime);
+      } else {
+        return null;
+      }
+    },
     // 防止按钮频繁点击
     throttleSearch() {
       this.timerFlag = true;
@@ -859,9 +846,9 @@ export default {
     color: #b3b3b3;
     margin-left: 40px;
 
-    /deep/ .el-input__suffix {
-      right: -68px;
-    }
+    // /deep/ .el-input__suffix {
+    //   right: -68px;
+    // }
     /deep/ .el-input__prefix {
       left: 0;
     }

+ 44 - 23
src/router/index.js

@@ -748,7 +748,7 @@ export const asyncRoutes = [
               permissions: ["jn_ztfx_wxssl"],
             },
           },
-          
+
           {
             path: "MTBF",
             component: () =>
@@ -989,8 +989,8 @@ export const asyncRoutes = [
               icon: "",
               permissions: ["jn_gffx_ztsjfx"],
             },
-            },
-            {
+          },
+          {
             path: "powerHotAnalyse",
             component: () =>
               import(
@@ -1016,7 +1016,7 @@ export const asyncRoutes = [
               permissions: ["jn_gffx_glqxnh"],
             },
           },
-         
+
           {
             path: "lslfx",
             component: () =>
@@ -1055,7 +1055,7 @@ export const asyncRoutes = [
             },
           },
         ],
-        },
+      },
       //管控效率
       {
         path: "efficiency",
@@ -1464,37 +1464,58 @@ export const asyncRoutes = [
               permissions: ["jn_zdz_scrb"],
             },
           },
-          {
-            path: "gjyrbb",
-            name: "gjyrbb",
-            component: () => import("@/views/report/stationReport/rbb"),
-            meta: {
-              title: "日报表",
-              icon: "",
-              permissions: ["jn_zdz_rbb"],
-            },
-          },
+        //   {
+        //     path: "gjyrbb",
+        //     name: "gjyrbb",
+        //     component: () => import("@/views/report/stationReport/rbb"),
+        //     meta: {
+        //       title: "日报表",
+        //       icon: "",
+        //       permissions: ["jn_zdz_rbb"],
+        //     },
+        //   },
 
           {
-            path: "fdczzdy",
-            name: "fdczzdy",
-            component: () => import("@/views/report/stationReport/fdczzdy"),
+            path: "fczybb",
+            name: "fczybb",
+            component: () => import("@/views/report/stationReport/fczybb"),
             meta: {
-              title: "风电场站自定义",
+              title: "风场自由报表",
               icon: "",
               permissions: ["jn_zdz_fdcz"],
             },
           },
           {
-            path: "fdxmzdy",
-            name: "fdxmzdy",
-            component: () => import("@/views/report/stationReport/fdxmzdy"),
+            path: "xmzybb",
+            name: "xmzybb",
+            component: () => import("@/views/report/stationReport/xmzybb"),
             meta: {
-              title: "风电项目自定义",
+              title: "项目自由报表",
               icon: "",
               permissions: ["jn_zdz_fdxm"],
             },
           },
+
+          //   {
+          //     path: "fdczzdy",
+          //     name: "fdczzdy",
+          //     component: () => import("@/views/report/stationReport/fdczzdy"),
+          //     meta: {
+          //       title: "风电场站自定义",
+          //       icon: "",
+          //       permissions: ["jn_zdz_fdcz"],
+          //     },
+          //   },
+          //   {
+          //     path: "fdxmzdy",
+          //     name: "fdxmzdy",
+          //     component: () => import("@/views/report/stationReport/fdxmzdy"),
+          //     meta: {
+          //       title: "风电项目自定义",
+          //       icon: "",
+          //       permissions: ["jn_zdz_fdxm"],
+          //     },
+          //   },
         ],
       },
       {

+ 28 - 0
src/views/report/stationReport/fczybb/index.vue

@@ -0,0 +1,28 @@
+<template>
+  <div style="height:100%">
+    <iframe :src="url" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
+  </div>
+</template>
+<script>
+export default {
+  data(){
+    return {
+      url: "http://10.81.3.155:8083/bi/ebipro/easyolap.do?action=edit&resid=EANA$2$8$1$cf794177cf764f258f8105c6d3b03f3c$7cf4ccc30f914f0b8925e2234780402e&id=admin&pw=admin&showmenu=false&showparams=true&calcnow=true"
+    }
+  }
+}
+</script>
+<style lang="less" scope>
+@titleGray: #9ca5ab;
+@rowGray: #606769;
+@darkBack: #536268;
+.knowledge-2 {
+  .el-select {
+    width: 200px;
+  }
+  .el-input {
+    width: 200px;
+  }
+}
+</style>
+

+ 28 - 0
src/views/report/stationReport/xmzybb/index.vue

@@ -0,0 +1,28 @@
+<template>
+  <div style="height:100%">
+    <iframe :src="url" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
+  </div>
+</template>
+<script>
+export default {
+  data(){
+    return {
+      url: "http://10.81.3.155:8083/bi/ebipro/easyolap.do?action=edit&resid=EANA$2$8$1$cf794177cf764f258f8105c6d3b03f3c$7cf4ccc30f914f0b8925e2234780402e&id=admin&pw=admin&showmenu=false&showparams=true&calcnow=true"
+    }
+  }
+}
+</script>
+<style lang="less" scope>
+@titleGray: #9ca5ab;
+@rowGray: #606769;
+@darkBack: #536268;
+.knowledge-2 {
+  .el-select {
+    width: 200px;
+  }
+  .el-input {
+    width: 200px;
+  }
+}
+</style>
+

+ 0 - 452
src/views/sisView/index.vue

@@ -1,452 +0,0 @@
-<template>
-  <div class="sisViewBox">
-    <div class="viewItem">
-      <clock :width="330" :height="300" />
-      <div class="viewTitle">综<br /><br />合<br /><br />参<br /><br />数</div>
-      <div class="contentBox" style="height: 300px">
-        <div class="contentItem">
-          <div class="itemName size5">装机容量</div>
-          <div class="itemNum">{{ items.zjrl }}</div>
-          <div class="itemUnit">MW</div>
-          <div class="itemName size6">安全天数</div>
-          <div class="itemNum">{{ items.aqts }}</div>
-          <div class="itemUnit">天</div>
-          <div class="itemName size5">总功率</div>
-          <div class="itemNum">{{ items.zgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName size5">日发电量</div>
-          <div class="itemNum">{{ items.rfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName size6">年利用小时</div>
-          <div class="itemNum">{{ items.nlyxs }}</div>
-          <div class="itemUnit">小时</div>
-          <div class="itemName size5">年发电量</div>
-          <div class="itemNum">{{ items.nfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName size5">上网电量</div>
-          <div class="itemNum">{{ items.swdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName size6">月利用小时</div>
-          <div class="itemNum">{{ items.ylyxs }}</div>
-          <div class="itemUnit">小时</div>
-          <div class="itemName size5">月发电量</div>
-          <div class="itemNum">{{ items.yfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">复位及时率</div>
-          <div class="itemNum">{{ items.fwjsl }}</div>
-          <div class="itemUnit">%</div>
-          <div class="itemName size6">年计划电量</div>
-          <div class="itemNum">{{ items.njhdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName size5">年完成率</div>
-          <div class="itemNum">{{ items.nwcl }}</div>
-          <div class="itemUnit">%</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">转换及时率</div>
-          <div class="itemNum">{{ items.zhjsl }}</div>
-          <div class="itemUnit">%</div>
-          <div class="itemName size6">月计划电量</div>
-          <div class="itemNum">{{ items.yjhdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName size5">月完成率</div>
-          <div class="itemNum">{{ items.ywcl }}</div>
-          <div class="itemUnit">%</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">消缺及时率</div>
-          <div class="itemNum">{{ items.xqjsl }}</div>
-          <div class="itemUnit">%</div>
-          <div class="itemName">综合厂用电率</div>
-          <div class="itemNum">{{ items.zhcydl }}</div>
-          <div class="itemUnit">%</div>
-          <div class="itemName size5">月M&nbsp;T&nbsp;B&nbsp;F</div>
-          <div class="itemNum">{{ items.ymtbf }}</div>
-          <div class="itemUnit">小时</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">风能利用率</div>
-          <div class="itemNum">{{ items.fnlyl }}</div>
-          <div class="itemUnit">%</div>
-          <div class="itemName">设备可利用率</div>
-          <div class="itemNum">{{ items.sbklyl }}</div>
-          <div class="itemUnit">%</div>
-          <div class="itemName size5">月可靠性</div>
-          <div class="itemNum">{{ items.ykkx }}</div>
-          <div class="itemUnit">%</div>
-        </div>
-      </div>
-    </div>
-    <div class="viewItem">
-      <div class="viewTitle">风<br /><br />电<br /><br />参<br /><br />数</div>
-      <div class="contentBox">
-        <div class="contentItem">
-          <div class="itemName">装机容量</div>
-          <div class="itemNum">{{ items.fdzjrl }}</div>
-          <div class="itemUnit">MW</div>
-          <div class="itemName">实时风速</div>
-          <div class="itemNum">{{ items.fdssfs }}</div>
-          <div class="itemUnit">m/s</div>
-          <div class="itemName">月发电量</div>
-          <div class="itemNum">{{ items.fdyfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">年发电量</div>
-          <div class="itemNum">{{ items.fdnfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">日发电量</div>
-          <div class="itemNum">{{ items.fdrfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">实时功率</div>
-          <div class="itemNum">{{ items.fdssgl }}</div>
-          <div class="itemUnit">MW</div>
-          <div class="itemName">利用小时</div>
-          <div class="itemNum">{{ items.fdylyxs }}</div>
-          <div class="itemUnit">小时(月)</div>
-          <div class="itemName">利用小时</div>
-          <div class="itemNum">{{ items.fdnlyxs }}</div>
-          <div class="itemUnit">小时(年)</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">上网电量</div>
-          <div class="itemNum">{{ items.fdswdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">总欠发</div>
-          <div class="itemNum">{{ items.fdzqf }}</div>
-          <div class="itemUnit">万kWh</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">牛发电量</div>
-          <div class="itemNum">{{ items.nssfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">牛欠发</div>
-          <div class="itemNum">{{ items.nssqf }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">牛风速</div>
-          <div class="itemNum">{{ items.nssfs }}</div>
-          <div class="itemUnit">m/s</div>
-          <div class="itemName">牛功率</div>
-          <div class="itemNum">{{ items.nssgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">麻发电量</div>
-          <div class="itemNum">{{ items.mhsfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">麻欠发</div>
-          <div class="itemNum">{{ items.mhsqf }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">麻风速</div>
-          <div class="itemNum">{{ items.mhsfs }}</div>
-          <div class="itemUnit">m/s</div>
-          <div class="itemName">麻功率</div>
-          <div class="itemNum">{{ items.mhsgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">青发电量</div>
-          <div class="itemNum">{{ items.qsfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">青欠发</div>
-          <div class="itemNum">{{ items.qsqf }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">青风速</div>
-          <div class="itemNum">{{ items.qsfs }}</div>
-          <div class="itemUnit">m/s</div>
-          <div class="itemName">青功率</div>
-          <div class="itemNum">{{ items.qsgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">石发电量</div>
-          <div class="itemNum">{{ items.sbqfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">石欠发</div>
-          <div class="itemNum">{{ items.sbqqf }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">石风速</div>
-          <div class="itemNum">{{ items.sbqfs }}</div>
-          <div class="itemUnit">m/s</div>
-          <div class="itemName">石功率</div>
-          <div class="itemNum">{{ items.sbqgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">香发电量</div>
-          <div class="itemNum">{{ items.xsfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">香欠发</div>
-          <div class="itemNum">{{ items.xsqf }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">香风速</div>
-          <div class="itemNum">{{ items.xsfs }}</div>
-          <div class="itemUnit">m/s</div>
-          <div class="itemName">香功率</div>
-          <div class="itemNum">{{ items.xsgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-      </div>
-    </div>
-    <div class="viewItem">
-      <div class="viewTitle">光<br /><br />伏<br /><br />参<br /><br />数</div>
-      <div class="contentBox">
-        <div class="contentItem">
-          <div class="itemName">装机容量</div>
-          <div class="itemNum">{{ items.gfzjrl }}</div>
-          <div class="itemUnit">MW</div>
-          <div class="itemName">日照强度</div>
-          <div class="itemNum">{{ items.gfrzqd }}</div>
-          <div class="itemUnit">W/㎡</div>
-          <div class="itemName">实时功率</div>
-          <div class="itemNum">{{ items.gfssgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">日发电量</div>
-          <div class="itemNum">{{ items.gfrfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">月发电量</div>
-          <div class="itemNum">{{ items.gfyfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">年发电量</div>
-          <div class="itemNum">{{ items.gfnfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">上网电量</div>
-          <div class="itemNum">{{ items.gfswdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">利用小时</div>
-          <div class="itemNum">{{ items.gfylyxs }}</div>
-          <div class="itemUnit">小时(月)</div>
-          <div class="itemName">利用小时</div>
-          <div class="itemNum">{{ items.gfnlyxs }}</div>
-          <div class="itemUnit">小时(年)</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">武发电量</div>
-          <div class="itemNum">{{ items.dwkfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">武日强度</div>
-          <div class="itemNum">{{ items.dwkrzqd }}</div>
-          <div class="itemUnit">W/㎡</div>
-          <div class="itemName">武功率</div>
-          <div class="itemNum">{{ items.dwkgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">平发电量</div>
-          <div class="itemNum">{{ items.plfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">平日强度</div>
-          <div class="itemNum">{{ items.plrzqd }}</div>
-          <div class="itemUnit">W/㎡</div>
-          <div class="itemName">平功率</div>
-          <div class="itemNum">{{ items.plgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">宣发电量</div>
-          <div class="itemNum">{{ items.xhfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">宣日强度</div>
-          <div class="itemNum">{{ items.xhrzqd }}</div>
-          <div class="itemUnit">W/㎡</div>
-          <div class="itemName">宣功率</div>
-          <div class="itemNum">{{ items.xhgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">马发电量</div>
-          <div class="itemNum">{{ items.mchfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">马日强度</div>
-          <div class="itemNum">{{ items.mchrzqd }}</div>
-          <div class="itemUnit">W/㎡</div>
-          <div class="itemName">马功率</div>
-          <div class="itemNum">{{ items.mchgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-        <div class="contentItem">
-          <div class="itemName">海发电量</div>
-          <div class="itemNum">{{ items.hzjfdl }}</div>
-          <div class="itemUnit">万kWh</div>
-          <div class="itemName">海日强度</div>
-          <div class="itemNum">{{ items.hzjrzqd }}</div>
-          <div class="itemUnit">W/㎡</div>
-          <div class="itemName">海功率</div>
-          <div class="itemNum">{{ items.hzjgl }}</div>
-          <div class="itemUnit">MW</div>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import $ from "jquery";
-import clock from "@com/other/clock/index.vue";
-export default {
-  // 名称
-  name: "sisView",
-
-  // 使用组件
-  components: {
-    clock,
-  },
-
-  // 数据
-  data() {
-    return {
-      items: {},
-      timmer: null,
-    };
-  },
-
-  // 函数
-  methods: {
-    resetViewTitleHeight() {
-      let viewTitle = $(".viewTitle");
-      for (let i = 0; i < viewTitle.length; i++) {
-        viewTitle
-          .eq(i)
-          .css("height", viewTitle.eq(i).parent(".viewItem").css("height"));
-      }
-    },
-
-    viewAjax() {
-      let that = this;
-      that.API.requestData({
-        method: "GET",
-        subUrl: "http://10.155.32.4:8034/bigscreen/list",
-        success(res) {
-          let keys = Object.keys(res.data);
-          let items = res.data;
-          keys.forEach((ele) => {
-            if (items[ele].toFixed(2).split(".")[1] == "00") {
-              items[ele] = items[ele].toFixed(2).split(".")[0];
-            } else {
-              items[ele] = items[ele].toFixed(2);
-            }
-          });
-          that.items = items;
-        },
-      });
-    },
-  },
-
-  created() {
-    this.viewAjax();
-    this.timmer = setInterval(() => {
-      this.viewAjax();
-    }, 6000);
-  },
-
-  mounted() {
-    this.resetViewTitleHeight();
-  },
-
-  unmounted() {
-    clearInterval(this.timmer);
-    this.timmer = null;
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.sisViewBox {
-  width: 1881px;
-  height: 100%;
-  display: flex;
-  justify-content: flex-start;
-  align-items: flex-start;
-  flex-direction: column;
-
-  .viewItem {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    margin: 15px 0 0 0;
-
-    &:first-child {
-      margin: 0;
-	  .contentItem {
-		  .itemNum {
-			width: 157px !important;
-		  }
-	  }
-    }
-
-    .viewTitle {
-      font-family: Arial, Helvetica, sans-serif;
-      width: 30px;
-      padding: 10px 40px;
-      font-size: 29px;
-      font-weight: 700;
-      color: #ff0;
-      text-decoration: none;
-      display: flex;
-      justify-content: center;
-      align-items: center;
-      flex-wrap: wrap;
-      background-color: rgb(0, 52, 102);
-      margin-right: 10px;
-    }
-
-    .contentBox {
-      display: flex;
-      justify-content: space-around;
-      align-items: flex-start;
-      flex-direction: column;
-      font-family: Georgia, "Times New Roman", Times, serif;
-      font-size: 29px;
-
-      .contentItem {
-        display: flex;
-        justify-content: flex-start;
-        align-items: center;
-        padding: 2px 0;
-
-        .size5 {
-          width: 165px;
-        }
-
-        .size6 {
-          width: 195px;
-        }
-
-        .itemName {
-          min-width: 136px;
-          padding: 0 10px;
-          text-align: justify;
-          text-align-last: justify;
-        }
-
-        .itemNum {
-          font-family: Arial, Helvetica, sans-serif;
-          color: red;
-          width: 187px;
-          margin-left: 15px;
-        }
-
-        .itemUnit {
-          font-family: Arial, Helvetica, sans-serif;
-          font-size: 18px;
-          color: #0f0;
-          width: 110px;
-          text-align: left;
-          height: 100%;
-          vertical-align: middle;
-        }
-      }
-    }
-  }
-}
-</style>

+ 18 - 0
src/views/stateMonitor/alarmCenter/commonAlarm/index.vue

@@ -83,6 +83,7 @@
           开始日期:
           <el-date-picker
             v-model="begin"
+            :disabled-date="disabledDate"
             type="datetime"
             value-format="YYYY-MM-DD HH:mm:ss"
             placeholder="选择日期"
@@ -95,6 +96,7 @@
           结束日期:
           <el-date-picker
             v-model="end"
+            :disabled-date="disabledDate2"
             type="datetime"
             value-format="YYYY-MM-DD HH:mm:ss"
             placeholder="选择日期"
@@ -243,6 +245,22 @@ export default {
         return "高级";
       }
     },
+    // 时间选择器第一个禁用
+    disabledDate(time) {
+      if (this.end) {
+        return time.getTime() > Date.parse(this.end);
+      } else {
+        return null;
+      }
+    },
+    // 时间选择器第二个禁用
+    disabledDate2(time) {
+      if (this.begin) {
+        return time.getTime() < Date.parse(this.begin);
+      } else {
+        return null;
+      }
+    },
     GetWpOptions(flag) {
       this.routeFlag = flag;
       getWpList({ type: 0 }).then(({ data }) => {

+ 18 - 0
src/views/stateMonitor/powerPredictMatrix/index.vue

@@ -55,6 +55,7 @@
                 v-model="beginDate"
                 type="date"
                 size="mini"
+                :disabled-date="disabledDate"
                 placeholder="选择日期"
                 popper-class="date-select"
                 value-format="YYYY-MM-DD"
@@ -69,6 +70,7 @@
                 v-model="endDate"
                 size="mini"
                 type="date"
+                :disabled-date="disabledDate2"
                 popper-class="date-select"
                 placeholder="选择日期"
                 value-format="YYYY-MM-DD"
@@ -160,6 +162,22 @@ export default {
     this.timer = null;
   },
   methods: {
+    // 时间选择器第一个禁用
+    disabledDate(time) {
+      if (this.endDate) {
+        return time.getTime() > Date.parse(this.endDate);
+      } else {
+        return null;
+      }
+    },
+    // 时间选择器第二个禁用
+    disabledDate2(time) {
+      if (this.beginDate) {
+        return time.getTime() < Date.parse(this.beginDate);
+      } else {
+        return null;
+      }
+    },
     firstRender(tab) {
       this.activeTab = tab;
       clearInterval(this.timer);