Explorar el Código

Merge branch 'master' of http://152.136.206.27:3000/dongjh/guan_client

dongjh hace 1 año
padre
commit
983fdbd38b

+ 24 - 18
src/views/modules_guAn/visualization/index.vue

@@ -16,16 +16,16 @@
       <div class="left-container">
         <div class="left-top-con">
           <!-- 左上 -->
-          <yuzhi-curve :data="dataAll"></yuzhi-curve>
+          <yuzhi-curve :data="curveData"></yuzhi-curve>
         </div>
         <div class="left-center-con">
           <!-- 左中 -->
-          <real-time-curve :data="dataAll"></real-time-curve>
+          <real-time-curve :data="curveData"></real-time-curve>
         </div>
         <div class="left-bottom-con">
           <!-- 左下 -->
           <!-- <test-information></test-information> -->
-          <full-curve :data="dataAll"></full-curve>
+          <full-curve :data="curveData"></full-curve>
         </div>
       </div>
       <!-- 中间部分 -->
@@ -34,15 +34,15 @@
         <div class="important">
           <!-- 顶部信息+3D -->
           <alarm-modal-list ref="alarmList"></alarm-modal-list>
-          <info-3D :data="dataAll"></info-3D>
+          <info-3D :data="eqRealData"></info-3D>
         </div>
         <div class="centen-bottom-con u-flex-jab">
           <!-- 中下 -->
           <div class="center-bottom-left">
-            <running-state :data="dataAll"></running-state>
+            <running-state :data="eqRealData"></running-state>
           </div>
           <div class="center-bottom-right">
-            <equipment-info :data="dataAll"></equipment-info>
+            <equipment-info :data="eqRealData" :alarmData="newAlarmData"></equipment-info>
           </div>
         </div>
       </div>
@@ -50,15 +50,15 @@
       <div class="right-container">
         <div class="right-top-con">
           <!-- 右上 -->
-          <mode-info :data="dataAll"></mode-info>
+          <mode-info :data="eqRealData"></mode-info>
         </div>
         <div class="right-center-con">
           <!-- 右中 -->
-          <test-status-info :data="dataAll"></test-status-info>
+          <test-status-info :data="eqRealData"></test-status-info>
         </div>
         <div class="right-bottom-con">
           <!-- 右下 -->
-          <surveillance-video :data="dataAll"></surveillance-video>
+          <surveillance-video :data="eqRealData"></surveillance-video>
         </div>
       </div>
     </div>
@@ -70,7 +70,7 @@ import AlarmModalList from "./modules/AlarmModalList.vue";
 import YuzhiCurve from './modules/YuzhiCurve.vue'
 import RealTimeCurve from './modules/RealTimeCurve.vue'
 import FullCurve from './modules/FullCurve.vue'
-import Info3D from './modules/3DInfo.vue'
+import Info3D from './modules/info3D.vue'
 import RunningState from './modules/RunningState.vue'
 import EquipmentInfo from './modules/EquipmentInfo.vue'
 import ModeInfo from './modules/ModeInfo.vue'
@@ -100,8 +100,10 @@ export default {
   },
   data () {
     return {
-      dataAll: [],
+      eqRealData: [],
+      curveData: [],
       websock: null,
+      newAlarmData: null
     }
   },
   destroyed () {
@@ -121,7 +123,7 @@ export default {
       getAction(`/datacoll/webaccess/getWATagValue`).then(res=>{
         console.log(res)
         if(res.success){
-          this.dataAll = res.result
+          this.eqRealData = res.result
         }
       })
 
@@ -139,12 +141,12 @@ export default {
       // const wsuri = `ws://192.168.2.247:8866/websocket/${userId}`
       // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
       var userId = store.getters.userInfo.id;
-      var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
+      var wsuri = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
       // var wsuri = 'ws://192.168.2.247:8866/websocket';
       // console.log(wsuri);
       //update-begin-author:taoyan date:2022-4-22 for:  v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
       let token = Vue.ls.get(ACCESS_TOKEN)
-      this.websock = new WebSocket(url, [token]);
+      this.websock = new WebSocket(wsuri, [token]);
       // this.websock = new WebSocket(wsuri, [token]);
       // 新建一个webstock对象
       // this.websock = new WebSocket(wsuri)
@@ -155,15 +157,19 @@ export default {
     },
     // 数据接收
     websocketonmessage (e) {
-      console.log(e)
+      console.log("-----接收消息-------",e);
       const redata = JSON.parse(e.data)
+      console.log(redata);
       // 接收数据之后操作
-
+      this.eqRealData = redata['设备实时值']
+      this.curveData = redata['设备历史值']
+      this.newAlarmData = redata['最新一条报警信息']
     },
     // websocket连接后发送数据(send发送)
     websocketonopen () {
-      let actions = {} // 请根据实际项目需要进行修改
-      this.websocketsend(JSON.stringify(actions))
+      console.log("WebSocket连接成功");
+      // let actions = {} // 请根据实际项目需要进行修改
+      // this.websocketsend()
     },
     // 数据发送
     websocketsend (d) {

+ 285 - 108
src/views/modules_guAn/visualization/modules/AlarmModalList.vue

@@ -3,20 +3,39 @@
     <a-modal
       v-model="visible"
       title="故障警告"
-      @ok="handleOk"
       :footer="null"
-      width="60%">
+      width="46%">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
+          <a-row :gutter="24">
+            <a-col :lg="18" :md="12">
+              <a-form-item label="账号">
+                <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
+                <j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>
+              </a-form-item>
+            </a-col>
+            <a-col :lg="6" :md="12">
+              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              </span>
+            </a-col>
+
+          </a-row>
+        </a-form>
+      </div>
+
       <a-table
         ref="table"
         size="middle"
-        :scroll="{x:true}"
         bordered
         :rowKey="(record, index) => { return index }"
         :columns="columns"
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        class="j-table-force-nowrap">
+        class="j-table-force-nowrap alarm-list-table">
+        <!-- :scroll="{x:true}" -->
         <template>
           <div>
             
@@ -28,114 +47,272 @@
 </template>
 
 <script>
-export default {
-  name: '',
-  data () {
-    return {
-      visible: false,
-      columns: [
-        {
-          title: '序号',
-          dataIndex: '',
-          key: 'rowIndex',
-          width: 60,
-          align: "center",
-          customRender: function (t,r,index) {
-            return parseInt(index)+1;
-          }
-        },
-        {
-          title: '测点名称',
-          align: "center",
-          dataIndex: 'Name',
-        },
-        {
-          title: '警报时间',
-          align: "center",
-          dataIndex: 'Time',
-        },
-        {
-          title: '警报等级',
-          align: "center",
-          dataIndex: 'AlarmPriority',
-        },
-        {
-          title: '警报确认状态',
-          align: "center",
-          dataIndex: 'AckStatus',
-        },
-        {
-          title: '警报群组',
-          align: "center",
-          dataIndex: 'AlarmGroup',
-        },
-        {
-          title: '警报值',
-          align: "center",
-          dataIndex: 'AlarmValue',
-        },
-        {
-          title: '警报设定值',
-          align: "center",
-          dataIndex: 'AlarmLimit',
-        },
-        {
-          title: '警报种类',
-          align: "center",
-          dataIndex: 'AlarmType',
+ import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+ import { getAction } from '@/api/manage'
+  export default {
+    name: '',
+    mixins: [JeecgListMixin],
+    data () {
+      return {
+        visible: false,
+        queryParam: {},
+        columns: [
+          {
+            title: '',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 40,
+            align: "center",
+            customRender: function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title: '报警时间',
+            align: "center",
+            dataIndex: 'Time',
+            customRender: (text, record) => {
+              return {
+                children: text,
+                attrs: {
+                  style: 'color: #d7cc3a',
+                },
+              };
+            },
+          },
+          {
+            title: '故障描述',
+            align: "center",
+            dataIndex: 'Desc',
+            customRender: (text, record) => {
+              return {
+                children: text,
+                attrs: {
+                  style: 'color: #d7cc3a',
+                },
+              };
+            },
+          },
+          {
+            title: '恢复时间',
+            align: "center",
+            dataIndex: 'updateTime',
+            customRender: (text, record) => {
+              return {
+                children: text,
+                attrs: {
+                  style: 'color: #2da873',
+                },
+              };
+            },
+          },
+        ],
+        dataSource: [
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+          {
+            createTime1: '2023-12-28 13:25:22',
+            createTime2: '2023-12-28 13:25:22',
+            createTime3: '2023-12-28 13:25:22',
+          },
+        ],
+        url: {
+          list: "/datacoll/webaccess/getAlarmLog",
+          // exportXlsUrl: "/sys/user/exportXls",
         },
-        {
-          title: '监控节点名称',
-          align: "center",
-          dataIndex: 'NodeName',
-        },
-        {
-          title: '警报锁定',
-          align: "center",
-          dataIndex: 'Locked',
-        },
-      ],
-      dataSource: [
-        {
-          name: 'John Brown',
-          age: 32,
-          address: 'New York No. 1 Lake Park',
-          tags: ['nice', 'developer'],
-        },
-        {
-          name: 'Jim Green',
-          age: 42,
-          address: 'London No. 1 Lake Park',
-          tags: ['loser'],
-        },
-        {
-          key: '3',
-          name: 'Joe Black',
-          age: 32,
-          address: 'Sidney No. 1 Lake Park',
-          tags: ['cool', 'teacher'],
-        },
-      ],
-    }
-  },
-  created () {
-  },
-  mounted () {
-  },
-  methods: {
-    handleOk(e) {
-      console.log(e);
-      this.visible = false;
+      }
+    },
+    created () {
     },
+    mounted () {
+    },
+    methods: {
+      loadData(arg) {
+        if(!this.url.list){
+          this.$message.error("请设置url.list属性!")
+          return
+        }
+        //加载数据 若传入参数1则加载第一页的内容
+        if (arg === 1) {
+          this.ipagination.current = 1;
+        }
+        var params = this.getQueryParams();//查询条件
+        this.loading = true;
+        getAction(this.url.list, params).then((res) => {
+          if (res.success) {
+            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+            // this.dataSource = [];
+            this.dataSource = res.result.AlarmTagList;
+            if(res.result.total)
+            {
+              this.ipagination.total = res.result.total;
+            }else{
+              this.ipagination.total = 0;
+            }
+            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+          }else{
+            this.$message.warning(res.message)
+          }
+        }).finally(() => {
+          this.loading = false
+        })
+      },
+    }
   }
-}
 </script>
 
-<!-- <style scoped>
-</style> -->
+<style scoped>
+  @import '~@/assets/less/uStyle.less';
+</style>
 <style lang="less" scoped>
-// @import '~@/assets/less/uStyle.less';
-.alarm-list{
-  
-}
+  .alarm-list{
+  }
+  // 弹窗样式
+  .ant-modal-root{
+    /deep/ .ant-modal-title{
+      color: #fff !important;
+    }
+    /deep/ .ant-modal-header {
+      border-bottom-color: #295085;
+    }
+    /deep/ .ant-modal-close{
+      i{
+        color: #fff !important;
+      }
+    }
+    /deep/ .ant-modal-content{
+      width: 100%;
+      height: calc(100% - 26px);
+      border: 1px solid #000;
+      border-width: 8px 0 0 6px;
+      /* 变相设置边距 */
+      border-image: url('~@/assets/visualization/moduleBdBg.png') 4 4 fill;
+      border-image-repeat: stretch;
+      position: relative;
+      background-color: rgba(15, 57, 91, .4);
+      .ant-modal-header{
+        background-color: transparent;
+      }
+    }
+  }
+  // 表单
+  .ant-form{
+    /deep/ .ant-form-item-label{
+      label{
+        color: #fff !important;
+      }
+    }
+    /deep/ .ant-input{
+      background: rgba(6,23,48,.5);
+      color: #fff;
+    }
+    /deep/ .ant-btn-primary{
+      background: transparent;
+      // background: #0b2243d9;
+      // border-color: #fff;
+    }
+  }
+  // 表格样式
+  .alarm-list-table{
+    /deep/ .ant-table-placeholder{
+      background-color: transparent;
+      border: none;
+      // border-color: #044b90 !important;
+    }
+    /deep/ .ant-table-bordered .ant-table-thead > tr > th{
+      border-color: #044b90 !important;
+    }
+    /deep/.ant-table-bordered .ant-table-tbody > tr > td{
+      border-color: #044b90 !important;
+      padding: 6px !important;
+    } 
+    /deep/ .ant-table-bordered .ant-table-body > table{
+      border-color: #044b90 !important;
+    }
+    /deep/ .ant-table-content{
+      background: rgba(2,8,20, .5);
+      // background: rgba(15, 57, 91, .5);
+      color: #fff;
+    }
+    /deep/ .ant-table-thead > tr > th{
+      background: transparent;
+      color: #fff;
+    }
+  }
+  // 分页样式
+  /deep/ .ant-pagination{
+    color: #fff !important;
+    // 箭头
+    .ant-pagination-prev a, .ant-pagination-next a{
+      color: #fff;
+    }
+    /deep/ .ant-pagination-disabled a{
+      color: #fff;
+    }
+    // 页数
+    .ant-pagination-item{
+      a{
+        color: #fff;
+      }
+    }
+    .ant-pagination-item-active{
+      background: #05162f;
+      border-color: transparent;
+      a{
+        color: #fff;
+      }
+    }
+    /deep/ .ant-pagination-options-quick-jumper{
+      input{
+        background: #05162f !important;
+        color: #fff !important;
+      }
+    }
+    // 每页选择
+    .ant-select-selection{
+      background: #05162f;
+      color: #fff;
+      border-color: transparent;
+    }
+    // .ant-select-dropdown{
+    //   background: #05162f;
+    //   border-color: transparent;
+    //   .ant-select-dropdown-menu-item{
+    //     color: #fff;
+    //   }
+    // }
+  }
 </style>

+ 29 - 6
src/views/modules_guAn/visualization/modules/EquipmentInfo.vue

@@ -34,7 +34,7 @@
         <div>20W/㎡</div>
       </div> -->
       <!-- <div style="height: 32%;display: flex; justify-content: center; align-items: center; font-size: 39px;">程序运行</div> -->
-      <div style="height: 32%;display: flex; justify-content: center; align-items: center; font-size: 39px;">{{runStatus == 1 ? '程序运行': '定值运行'}}</div>
+      <div style="height: 32%;display: flex; justify-content: center; align-items: center; font-size: 36px;">{{runStatus == 1 ? '程序运行': '定值运行'}}</div>
       <div style="height: 36%; display: flex; flex-direction: row;">
         <!-- 左 -->
         <div class="le" style="margin: 0 0.1% 0 2.4%;">
@@ -78,8 +78,8 @@
       </div>
       <div style="height: 22%; margin-top: 2%;">
         <div class="bo">
-          <div style="width: 35%; padding-left: 2%">2023-12-28</div>
-          <div style="width: 65%;">C1压机排气温度低</div>
+          <div style="width: 35%; padding-left: 2%">{{alarmTime}}</div>
+          <div style="width: 65%;">{{ information }}</div>
         </div>
       </div>
     </div>
@@ -95,7 +95,15 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
+    },
+    alarmData: {
+      type: Array,
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {
@@ -133,18 +141,31 @@ export default {
       // 起始湿度
       startH: '',
       // 运行方式设定
-      runStatus: ''
+      runStatus: '',
+      // 报警信息
+      alarm: [],
+      alarmTime: '',
+      information: ''
     }
   },
   watch: {
     data: {
       handler(newValue, oldValue){
-        console.log(77,newValue, oldValue)
+        // console.log(77,newValue, oldValue)
         this.dataList = newValue
         this.getList()
       },
       immediate: true,
       deep: true
+    },
+    alarmData: {
+      handler(newValue, oldValue){
+        this.alarm = newValue
+        // console.log(7788,this.alarm)
+        this.getList()
+      },
+      immediate: true,
+      deep: true
     }
   },
   created () {
@@ -176,6 +197,8 @@ export default {
           this.runStatus = this.dataList[i].Value
         }
       }
+      this.information = this.alarm[0].Name
+      this.alarmTime = this.alarm[0].Time
     }
   }
 }

+ 3 - 1
src/views/modules_guAn/visualization/modules/FullCurve.vue

@@ -19,7 +19,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {

+ 4 - 2
src/views/modules_guAn/visualization/modules/ModeInfo.vue

@@ -79,7 +79,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {
@@ -156,7 +158,7 @@ export default {
         if (this.dataList[i].Name == '温度设定值') {
           this.targetT = this.dataList[i].Value
         }
-        if (this.dataList[i].Name == '斜率设定') {
+        if (this.dataList[i].Name == '定值温度斜率值') {
           this.slopeT = this.dataList[i].Value
         }
         if (this.dataList[i].Name == '起始温度值') {

+ 3 - 1
src/views/modules_guAn/visualization/modules/RealTimeCurve.vue

@@ -18,7 +18,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {

+ 3 - 1
src/views/modules_guAn/visualization/modules/RunningState.vue

@@ -141,7 +141,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {

+ 3 - 1
src/views/modules_guAn/visualization/modules/TestStatusInfo.vue

@@ -25,7 +25,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {

+ 3 - 1
src/views/modules_guAn/visualization/modules/YuzhiCurve.vue

@@ -18,7 +18,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {

+ 3 - 1
src/views/modules_guAn/visualization/modules/3DInfo.vue

@@ -23,7 +23,9 @@ export default {
   props: {
     data: {
       type: Array,
-      default: []
+      default: function(){
+        return [] // 使用工厂函数返回默认值
+      }
     }
   },
   data () {