hfxc226 2 éve
szülő
commit
9c2b955fff

+ 16 - 0
src/api/remote/opc-log.js

@@ -81,6 +81,22 @@ export function queryRemoteOpcLog (parameter) {
   })
 }
 
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryRemoteOpcLogHisory (parameter) {
+  return axios({
+    url: '/remote/opc-logs/history?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * query list func
  * parameter: { }

+ 1 - 1
src/views/opc/Opc.vue

@@ -4,7 +4,7 @@
     <div class="icon" style="right:20px">
       <a-button type="primary" icon="appstore" size="large" @click="visibleRight=true" />
     </div>
-    <div v-if="dotList.length>0">
+    <div v-if="dotList !=null && dotList.length>0">
       <VueDragResize
         v-for="item in dotList"
         :key="item.id"

+ 6 - 7
src/views/opc/OpcInfo.vue

@@ -4,7 +4,7 @@
     <div class="icon" style="right:20px">
       <a-button type="primary" icon="appstore" size="large" @click="visibleRight=true" />
     </div>
-    <div v-if="dotList.length>0">
+    <div v-if="dotList !=null && dotList.length>0">
       <VueDragResize
         v-for="item in dotList"
         :key="item.id"
@@ -21,14 +21,14 @@
         @dragstop="resize">
         <a-tooltip>
           <template slot="title">
-            {{ item.result }}
+            {{ item.result + item.unit }}
           </template>
           <div class="info" @click="handleInfo(item)"> {{ item.result }}</div>
         </a-tooltip>
       </VueDragResize>
     </div>
     <a-drawer
-      title="点位配置"
+      title="点位列表"
       placement="right"
       :closable="false"
       :width="350"
@@ -76,7 +76,6 @@ export default {
   components: {
     VueDragResize,
     BaseChartInfo
-
   },
   data () {
     return {
@@ -140,9 +139,6 @@ export default {
       this.dotList[val].positionFlag = key
     },
     getOpcInfo () {
-      fetchSbPosition({ id: this.positionId }).then(res => {
-        this.imgUrl = res.data.opcImg
-      })
       queryRemoteOpc({ line: this.positionId })
         .then((res) => {
           this.dotList = res.data
@@ -152,6 +148,9 @@ export default {
         })
     },
     setTree (record = {}) {
+      fetchSbPosition({ id: this.positionId }).then(res => {
+        this.imgUrl = res.data.opcImg
+      })
       getSbPositionTree({ opcFlag: 1 }).then(res => {
         this.treeData = res.data
       })

+ 5 - 8
src/views/opc/modules/BaseChartInfo.vue

@@ -23,16 +23,13 @@
                 <a-form-item label="时间跨度" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
                   <a-select v-model="queryParam.searchType" style="width: 120px">
                     <a-select-option value="1">
-                      10分钟
+                      1小时
                     </a-select-option>
                     <a-select-option value="2">
-                      20分钟
+                      2小时
                     </a-select-option>
                     <a-select-option value="3">
-                      30分钟
-                    </a-select-option>
-                    <a-select-option value="4">
-                      60分钟
+                      3小时
                     </a-select-option>
                   </a-select>
                 </a-form-item>
@@ -55,7 +52,7 @@
 
 <script>
 import { Chart } from '@antv/g2'
-import { queryRemoteOpcLog } from '@/api/remote/opc-log'
+import { queryRemoteOpcLogHisory } from '@/api/remote/opc-log'
 
 export default {
   data () {
@@ -109,7 +106,7 @@ export default {
         this.$message.error('请选择时间跨度')
         return
       }
-      queryRemoteOpcLog(this.queryParam)
+      queryRemoteOpcLogHisory(this.queryParam)
         .then((res) => {
           if (res.data == null || res.data.length === 0) {
             this.$message.error('无数据')

+ 11 - 11
src/views/remote/opc-log/RemoteOpcLog.vue

@@ -37,7 +37,7 @@
               icon="download"
               @click="doExport">导出
             </a-button>
-<!--            <a-button
+            <!--            <a-button
               style="margin-left: 8px"
               type="primary"
               icon="download"
@@ -143,7 +143,7 @@ export default {
           title: '点位',
           dataIndex: 'positionNum'
         },
-        {
+        /* {
           title: '类型',
           dataIndex: 'type',
           customRender: (text, record, index) => {
@@ -161,7 +161,7 @@ export default {
         {
           title: '描述',
           dataIndex: 'description'
-        },
+        }, */
         {
           title: '年',
           dataIndex: 'year'
@@ -178,18 +178,18 @@ export default {
           title: '时',
           dataIndex: 'hour'
         },
+        /*  {
+           title: '实时数值',
+           dataIndex: 'result'
+         },
         {
-          title: '实时数值',
-          dataIndex: 'result'
-        },
-        {
-          title: '备注',
-          dataIndex: 'remark'
-        },
+           title: '备注',
+           dataIndex: 'remark'
+         },
         {
           title: '创建日期',
           dataIndex: 'createdTime'
-        },
+        }, */
         {
           title: '操作',
           key: 'action',