فهرست منبع

历史数据请求参数修改 详情页修改

bobo04052021@163.com 2 هفته پیش
والد
کامیت
f148050828
3فایلهای تغییر یافته به همراه97 افزوده شده و 104 حذف شده
  1. 1 1
      api/api.js
  2. 94 69
      pages/history/history.vue
  3. 2 34
      pages/home/detail/autodoor/autodoor.vue

+ 1 - 1
api/api.js

@@ -147,7 +147,7 @@ const apiService = {
     return http.get(url);
   },
   getDeviceHistory2(params) {
-    const url = buildURL("/monitor/history/getHistoryData", params);
+    const url = buildURL("/modelreq/monitor/history/getHistoryData", params);
     return http.get(url);
   },
   //获取操作历史

+ 94 - 69
pages/history/history.vue

@@ -122,78 +122,94 @@
                 </u-col>
               </u-row>
               <view
-                class="datacard"
-                v-for="(showitem, index) in deviceShowList"
-                :key="index"
-                v-show="showitem.appShow == 1"
+                style="
+                  display: flex;
+                  flex-wrap: wrap;
+                  justify-content: space-between;
+                "
               >
                 <view
-                  :class="TabCur"
-                  style="
-                    padding-top: 10rpx;
-                    padding-bottom: 10rpx;
-                    display: flex;
-                    flex-direction: column;
-                    align-items: center;
-                    height: 100%;
-                  "
+                  class="datacard"
+                  v-for="(showitem, index) in deviceShowList"
+                  :key="index"
+                  v-show="showitem.appShow == 1"
                 >
                   <view
-                    v-if="
-                      showitem.datatype == 1 &&
-                      showitem.monitorcode == 'doorUse'
-                    "
-                    class="demo-layout bg-purple-light"
-                    style="
-                      margin-top: 10rpx;
-                      color: #3787fe;
-                      font-size: 30rpx;
-                      margin-top: 20rpx;
-                    "
-                  >
-                    {{
-                      item[showitem.monitorcode] == "2"
-                        ? "行人"
-                        : item[showitem.monitorcode] == "1"
-                        ? "行车"
-                        : "-"
-                    }}
-                  </view>
-                  <view
-                    v-else-if="showitem.datatype == 1"
-                    class="demo-layout bg-purple-light"
+                    :class="TabCur"
                     style="
-                      margin-top: 10rpx;
-                      color: #3787fe;
-                      font-size: 30rpx;
-                      margin-top: 20rpx;
+                      padding-top: 10rpx;
+                      padding-bottom: 10rpx;
+                      display: flex;
+                      flex-direction: column;
+                      align-items: center;
+                      height: 100%;
                     "
                   >
-                    {{
-                      item[showitem.monitorcode] == null ||
-                      item[showitem.monitorcode] == ""
-                        ? "-"
-                        : item[showitem.monitorcode]
-                    }}
-                  </view>
-                  <view
-                    v-else-if="showitem.datatype == 2"
-                    class="demo-layout bg-purple-light"
-                    style="color: #3787fe; font-size: 30rpx; margin-top: 20rpx"
-                  >
-                    {{
-                      item[showitem.monitorcode] == null ||
-                      item[showitem.monitorcode] == ""
-                        ? "-"
-                        : item[showitem.monitorcode]
-                    }}
-                  </view>
+                    <view
+                      v-if="
+                        showitem.datatype == 1 &&
+                        showitem.monitorcode == 'doorUse'
+                      "
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 10rpx;
+                        color: #3787fe;
+                        font-size: 30rpx;
+                        margin-top: 20rpx;
+                      "
+                    >
+                      {{
+                        item[showitem.monitorcode] == "2"
+                          ? "行人"
+                          : item[showitem.monitorcode] == "1"
+                          ? "行车"
+                          : "-"
+                      }}
+                    </view>
+                    <view
+                      v-else-if="showitem.datatype == 1"
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 10rpx;
+                        color: #3787fe;
+                        font-size: 30rpx;
+                        margin-top: 20rpx;
+                      "
+                    >
+                      {{
+                        item[showitem.monitorcode] == null ||
+                        item[showitem.monitorcode] == ""
+                          ? "-"
+                          : item[showitem.monitorcode]
+                      }}
+                    </view>
+                    <view
+                      v-else-if="showitem.datatype == 2"
+                      class="demo-layout bg-purple-light"
+                      style="
+                        color: #3787fe;
+                        font-size: 30rpx;
+                        margin-top: 20rpx;
+                      "
+                    >
+                      {{
+                        item[showitem.monitorcode] == null ||
+                        item[showitem.monitorcode] == ""
+                          ? "-"
+                          : item[showitem.monitorcode]
+                      }}
+                    </view>
 
-                  <view
-                    class="demo-layout bg-purple-light"
-                    style="margin-top: 20rpx; color: #677799; margin-top: 20rpx"
-                  >
-                    {{ showitem.des }}
+                    <view
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 20rpx;
+                        color: #677799;
+                        margin-top: 20rpx;
+                      "
+                    >
+                      {{ showitem.des }}
+                    </view>
                   </view>
                 </view>
               </view>
@@ -252,40 +268,49 @@ export default {
           {
             label: "1秒",
             value: "1",
+            value1: "1s",
           },
           {
             label: "5秒",
             value: "2",
+            value1: "5s",
           },
           {
             label: "10秒",
             value: "3",
+            value1: "10s",
           },
           {
             label: "30秒",
             value: "4",
+            value1: "30s",
           },
           {
             label: "1分钟",
             value: "5",
+            value1: "1m",
           },
           {
             label: "10分钟",
             value: "6",
+            value1: "10m",
           },
           {
             label: "30分钟",
             value: "7",
+            value1: "30m",
           },
           {
             label: "1小时",
             value: "8",
+            value1: "1h",
           },
         ],
       ],
       deviceID: "", //设备ID
       //deviceType: "", //设备类型
       skip: 8, //时间间隔
+      interval: "1h", //时间间隔
       dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
       historyData: [], //历史数据
       deviceShowList: [],
@@ -401,19 +426,21 @@ export default {
     //选择间隔时间
     selectSkipTime(e) {
       this.skip = e.value[0].value;
+      this.interval = e.value[0].value1;
       this.lable = e.value[0].label;
       this.show = false;
     },
     //查询历史数据 getDeviceHistory
     checkHistory() {
       if (this.stationType !== "redis") {
+        console.log(this.stationType, "stationType");
         this.getHistoryData();
       } else {
         this.getHistoryData2();
       }
     },
     // 查询历史数据
-    async getHistoryData() {
+    getHistoryData() {
       const params = {
         ttime_begin: this.StartTime,
         ttime_end: this.EndTime,
@@ -427,7 +454,6 @@ export default {
         api
           .getDeviceHistory(params)
           .then((response) => {
-            debugger;
             if (response.data.code == 200) {
               const infolist = response.data.result;
               this.historyData = infolist.datalist.records;
@@ -458,12 +484,12 @@ export default {
           });
       });
     },
-    async getHistoryData2() {
+    getHistoryData2() {
       const params = {
         startTime: this.StartTime,
         endTIme: this.EndTime,
         deviceId: this.deviceID,
-        interval: this.skip,
+        interval: this.interval,
         isEmployee: true,
         pageSize: 10,
         strtype: this.TabCur,
@@ -472,7 +498,6 @@ export default {
         api
           .getDeviceHistory2(params)
           .then((response) => {
-            debugger;
             if (response.data.code == 200) {
               const infolist = response.data.result;
               this.historyData = infolist.records;

+ 2 - 34
pages/home/detail/autodoor/autodoor.vue

@@ -220,38 +220,6 @@
                     {{ item.des }}
                   </view>
                 </div>
-                <!-- <div
-                  class="right-content"
-                  :style="{
-                    backgroundImage:
-                      item.monitorcode === 'frontRearDP' ||
-                      item.monitorcode === 'frontRearDifference'
-                        ? 'url(\'../../../../static/model/Pa.png\')'
-                        : item.monitorcode === 'sourcePressure'
-                        ? 'url(\'../../../../static/model/MPa.png\')'
-                        : item.monitorcode === 'frontGateOpen'
-                        ? 'url(\'../../../../static/model/doorNet.png\')'
-                        : item.monitorcode === 'rearGateOpen'
-                        ? 'url(\'../../../../static/model/doorNet.png\')'
-                        : item.monitorcode === 'midGateOpen'
-                        ? 'url(\'../../../../static/model/doorNet.png\')'
-                        : item.monitorcode === 'warnFlag'
-                        ? 'url(\'../../../../static/model/9432.png\')'
-                        : item.monitorcode === 'netStatus'
-                        ? 'url(\'../../../../static/model/9431.png\')'
-                        : item.monitorcode === 'm3'
-                        ? 'url(\'../../../../static/model/windM3.png\')'
-                        : item.monitorcode === 'fsectarea'
-                        ? 'url(\'../../../../static/model/duanArea.png\')'
-                        : item.monitorcode === 'incipientWindSpeed1' ||
-                          item.monitorcode === 'incipientWindSpeed2' ||
-                          item.monitorcode === 'incipientWindSpeed3' ||
-                          item.monitorcode === 'va'
-                        ? 'url(\'../../../../static/model/fengsu.png\')'
-                        : 'url(\'\')',
-                    backgroundSize: '100% 100%',
-                  }"
-                ></div> -->
               </div>
             </div>
           </div>
@@ -433,7 +401,7 @@
             <div>主机</div>
             <div
               class="itemback"
-              v-for="(item, index) in showColum[TabCur + '_monitor_left']"
+              v-for="(item, index) in showColum[TabCur + '_monitor_right']"
               :key="index"
               v-show="item.appShow == 1"
             >
@@ -519,7 +487,7 @@
             <div>备机</div>
             <div
               class="itemback"
-              v-for="(item, index) in showColum[TabCur + '_monitor_left']"
+              v-for="(item, index) in showColum[TabCur + '_monitor_right']"
               :key="index"
               v-show="item.appShow == 1"
             >