hfxc226 hace 2 años
padre
commit
205c1de304
Se han modificado 3 ficheros con 30 adiciones y 13 borrados
  1. 16 0
      src/api/remote/opc.js
  2. 2 2
      src/views/opc/Opc.vue
  3. 12 11
      src/views/opc/OpcInfo.vue

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

@@ -123,6 +123,22 @@ export function queryRemoteOpc (parameter) {
   })
 }
 
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryRemoteOpcFromRedis (parameter) {
+  return axios({
+    url: '/remote/opcs/redis?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * update func
  * parameter: { }

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

@@ -255,9 +255,9 @@ export default {
   position: relative;
 }
 .info{
-  font-size: 13px;
+  font-size: 14px;
   font-weight: bold;
-  color: rgba(127, 125, 119, 0.27);
+  color: black;
   // transform: scale(0.5);
 }
 .icon{

+ 12 - 11
src/views/opc/OpcInfo.vue

@@ -23,11 +23,11 @@
               {{ item.description }}
             </template>
             <div class="info" @click="handleInfo(item)" @click.right.prevent="handleView(item)">
-              <span :style="{'color':item.warnFirstColor}" v-if="(+item.result)<=item.warnFirst&&item.warnFirst!==null">{{ item.result + item.unit }}</span>
-              <span :style="{'color':item.warnSecondColor}" v-else-if="item.warnFirst<(+item.result)&&(+item.result)<item.warnSecond">{{ item.result + item.unit }}</span>
-              <span :style="{'color':item.warnThirdColor}" v-else-if="item.warnThird<(+item.result)&&(+item.result)<item.warnFour">{{ item.result + item.unit }}</span>
-              <span :style="{'color':item.warnFourColor}" v-else-if="(+item.result)>=item.warnFour&&item.warnFirst!==null">{{ item.result + item.unit }}</span>
-              <span v-else>{{ item.result + item.unit }}</span>
+              <span :style="{'color':item.warnFirstColor}" v-if="(+item.result)<=item.warnFirst&&item.warnFirst!==null">{{ item.result }}</span>
+              <span :style="{'color':item.warnSecondColor}" v-else-if="item.warnFirst<(+item.result)&&(+item.result)<item.warnSecond">{{ item.result }}</span>
+              <span :style="{'color':item.warnThirdColor}" v-else-if="item.warnThird<(+item.result)&&(+item.result)<item.warnFour">{{ item.result }}</span>
+              <span :style="{'color':item.warnFourColor}" v-else-if="(+item.result)>=item.warnFour&&item.warnFirst!==null">{{ item.result }}</span>
+              <span v-else>{{ item.result }}</span>
             </div>
           </a-tooltip>
         </VueDragResize>
@@ -102,8 +102,9 @@
 <script>
 import VueDragResize from 'vue-drag-resize'
 import { getSbPositionTree, fetchSbPosition, querySbPosition } from '@/api/sb/position'
-import { queryRemoteOpc, updateRemoteOpc,
-  fetchRemoteOpc
+import {
+  queryRemoteOpc, updateRemoteOpc,
+  fetchRemoteOpc, queryRemoteOpcFromRedis
 } from '@/api/remote/opc'
 import Detail from '@/views/remote/opc/modules/Detail.vue'
 import BaseChartInfo from './modules/BaseChartInfo.vue'
@@ -186,13 +187,13 @@ export default {
     },
     getOpcInfo (positionId) {
       this.positionId = positionId
-      queryRemoteOpc({ line: this.positionId })
+      queryRemoteOpcFromRedis({ line: this.positionId })
         .then((res) => {
           this.dotList = res.data
           this.dotList.forEach(item => {
             item.isActive = false
             if (item.result == null) {
-              item.result = '-'
+              item.result = ''
             }
           })
         })
@@ -229,9 +230,9 @@ export default {
   position: relative;
 }
 .info{
-  font-size: 13px;
+  font-size: 14px;
   font-weight: bold;
-  color: rgba(127, 125, 119, 0.27);
+  color: black;
   padding:0 2px;
   // transform: scale(0.5);
 }