Przeglądaj źródła

消息通知加级联、工具栏加json

yangjunjing 5 lat temu
rodzic
commit
85bf9d97bb

+ 4 - 1
src/components/data_admin/buildTask/draw/drawModel.vue

@@ -2,7 +2,7 @@
   <div :id="`drawFloor${id}`" class="drawFloor" v-loading="canvasLoading">
   <div :id="`drawFloor${id}`" class="drawFloor" v-loading="canvasLoading">
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
     <div class="operate" v-show="showTools">
     <div class="operate" v-show="showTools">
-      <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @scale="scale" :config="config" ref="canvasFun"></canvasFun>
+      <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @scale="scale" @saveJson="saveJson" :config="config" ref="canvasFun"></canvasFun>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -132,6 +132,9 @@ export default {
     saveSvg() {
     saveSvg() {
       this.view.saveSceneSvg(`${this.floor}.svg`, 6400, 4800);
       this.view.saveSceneSvg(`${this.floor}.svg`, 6400, 4800);
     },
     },
+    saveJson() {
+      this.view.saveFloorJson(`${this.floor}.json`)
+    },
     // 缩放
     // 缩放
     scale(val) {
     scale(val) {
       if (!this.view) {
       if (!this.view) {

+ 211 - 205
src/framework/components/messagesever/index.vue

@@ -12,7 +12,9 @@
     <transition name="el-fade-in-linear">
     <transition name="el-fade-in-linear">
       <div v-show="noticeListShow" @click.stop="" class="noticeBox">
       <div v-show="noticeListShow" @click.stop="" class="noticeBox">
         <ul class="noticeTab">
         <ul class="noticeTab">
-          <li class="noticeTab_item">消息通知<!-- <span class="unread_num">1</span> --></li>
+          <li class="noticeTab_item">消息通知
+            <!-- <span class="unread_num">1</span> -->
+          </li>
         </ul>
         </ul>
         <div class="noticeList_scroll">
         <div class="noticeList_scroll">
           <el-scrollbar style="height:100%;">
           <el-scrollbar style="height:100%;">
@@ -24,10 +26,10 @@
                     <p><span>{{`【${moduleMap[item.Module]?moduleMap[item.Module]:item.Module}】 `}}</span>{{item.Title?item.Title:""}}</p>
                     <p><span>{{`【${moduleMap[item.Module]?moduleMap[item.Module]:item.Module}】 `}}</span>{{item.Title?item.Title:""}}</p>
                   </div>
                   </div>
                   <div class="noticeItem_time">{{item.CreateTime}}
                   <div class="noticeItem_time">{{item.CreateTime}}
-                    <el-link v-for="(btn, index) in item.Content.ButtonList?item.Content.ButtonList:[]" style="float:right;font-size:12px;margin-left:5px;" type="primary"
-                    :key="index"
-                    :href="`/image-service/common/file_get?systemId=revit&key=${btn.Url}`"
-                    :download="btn.FileName?btn.FileName:''">{{btn.Name?btn.Name:""}}</el-link>
+                    <el-link v-for="(btn, index) in item.Content.ButtonList?item.Content.ButtonList:[]"
+                      style="float:right;font-size:12px;margin-left:5px;" type="primary" :key="index"
+                      :href="`/image-service/common/file_get?systemId=revit&key=${btn.Url}`" :download="btn.FileName?btn.FileName:''">
+                      {{btn.Name?btn.Name:""}}</el-link>
                   </div>
                   </div>
                 </div>
                 </div>
               </li>
               </li>
@@ -66,8 +68,8 @@ import { MQTT_SERVICE, MQTT_USERNAME, MQTT_PASSWORD } from './mqSetting'
 import { messgeCount, messgeQuery, messgeUpdateState } from '@/api/msgsever'
 import { messgeCount, messgeQuery, messgeUpdateState } from '@/api/msgsever'
 
 
 export default {
 export default {
-  components:{
-    
+  components: {
+
   },
   },
   data() {
   data() {
     return {
     return {
@@ -91,7 +93,7 @@ export default {
       showTools: false
       showTools: false
     }
     }
   },
   },
-  created () {
+  created() {
     this.connect()
     this.connect()
   },
   },
   mounted() {
   mounted() {
@@ -104,9 +106,14 @@ export default {
   computed: {
   computed: {
     ...mapGetters('layout', ['userInfo', 'projectId', 'projects', 'userId'])
     ...mapGetters('layout', ['userInfo', 'projectId', 'projects', 'userId'])
   },
   },
-  methods:{
-    getMessageList(){//获取消息列表(最新10条)
+  methods: {
+    getMessageList() {//获取消息列表(最新10条)
       let params = {
       let params = {
+        Cascade: [
+          {
+            Name: "project"
+          }
+        ],
         Filters: `UserId='${this.userId}'`,
         Filters: `UserId='${this.userId}'`,
         Orders: "CreateTime desc, Id asc",
         Orders: "CreateTime desc, Id asc",
         PageNumber: 1,
         PageNumber: 1,
@@ -116,7 +123,7 @@ export default {
         this.messageList = res.Content
         this.messageList = res.Content
       })
       })
     },
     },
-    getUnreadCount(){//获取未读消息的数量
+    getUnreadCount() {//获取未读消息的数量
       let params = {
       let params = {
         Filters: `Read=false;UserId='${this.userId}'`
         Filters: `Read=false;UserId='${this.userId}'`
       }
       }
@@ -124,17 +131,17 @@ export default {
         this.unreadNum = res.Count
         this.unreadNum = res.Count
       })
       })
     },
     },
-    setAllRead(){//将当前角色消息全部置为已读
-      if(this.userId){
-        messgeUpdateState({Read:true,UserId:this.userId}, res => {this.unreadNum = 0})
+    setAllRead() {//将当前角色消息全部置为已读
+      if (this.userId) {
+        messgeUpdateState({ Read: true, UserId: this.userId }, res => { this.unreadNum = 0 })
       }
       }
     },
     },
-    handleClose(e){//关闭消息列表
+    handleClose(e) {//关闭消息列表
       this.noticeListShow = false
       this.noticeListShow = false
     },
     },
     handleClickRead() {//点击消息铃铛
     handleClickRead() {//点击消息铃铛
-      this.noticeListShow?this.noticeListShow=false:this.noticeListShow=true
-      if(this.noticeListShow){
+      this.noticeListShow ? this.noticeListShow = false : this.noticeListShow = true
+      if (this.noticeListShow) {
         this.setAllRead()//将当前角色消息全部置为已读
         this.setAllRead()//将当前角色消息全部置为已读
       }
       }
     },
     },
@@ -174,7 +181,7 @@ export default {
     },
     },
     //断开连接
     //断开连接
     disconnect() {
     disconnect() {
-      this.client.disconnect(function() {
+      this.client.disconnect(function () {
         console.log("连接已断开!");
         console.log("连接已断开!");
       })
       })
     },
     },
@@ -182,7 +189,7 @@ export default {
     send(destination, message, headers = {}) {
     send(destination, message, headers = {}) {
       this.client.send(destination, headers, JSON.stringify(message))
       this.client.send(destination, headers, JSON.stringify(message))
     },
     },
-    
+
     handleClickConnectMQ() {//连接MQ
     handleClickConnectMQ() {//连接MQ
       this.connect()
       this.connect()
     },
     },
@@ -193,218 +200,217 @@ export default {
       this.unsubscribe()
       this.unsubscribe()
     },
     },
     handleClickSendMessage() {//发送消息
     handleClickSendMessage() {//发送消息
-      this.send('/topic/datacenter.broadcast',this.sendMessage)
+      this.send('/topic/datacenter.broadcast', this.sendMessage)
     },
     },
-    allDetails(){
-      console.log(493498384938)
+    allDetails() {
       this.noticeListShow = false;
       this.noticeListShow = false;
-      this.$router.push({path:"/message/allDetails"});
+      this.$router.push({ path: "/message/allDetails" });
     }
     }
   }
   }
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-  .notification-box{
-    width: 100%;
-    height: 100%;
-    position: relative;
-    padding: 16px 10px 10px;
-    box-sizing: border-box;
-    color: #79869a;
-    cursor: pointer;
-    .noticeBox{
-      position: absolute;
-      top: 50px;
-      left: 50%;
-      margin-left: -220px;
-      cursor: auto;
-      z-index: 1000;
+.notification-box {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  padding: 16px 10px 10px;
+  box-sizing: border-box;
+  color: #79869a;
+  cursor: pointer;
+  .noticeBox {
+    position: absolute;
+    top: 50px;
+    left: 50%;
+    margin-left: -220px;
+    cursor: auto;
+    z-index: 1000;
+    text-align: left;
+    width: 272px;
+    height: 362px;
+    box-shadow: 0 1px 6px 0 #ccc;
+    color: #333;
+    background: #fff;
+    overflow: visible !important;
+  }
+  .noticeBox::before {
+    content: "";
+    border: solid 7px transparent;
+    border-bottom-color: #fff;
+    display: block;
+    position: absolute;
+    width: 2px;
+    top: -14px;
+    left: 50%;
+    margin-left: 77px;
+    z-index: 0;
+  }
+  .noticeTab {
+    padding: 8px 16px 0;
+    z-index: 10;
+    height: 32px;
+    zoom: 1;
+    box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset;
+    .noticeTab_item {
+      float: left;
+      position: relative;
+      width: 240px;
+      height: 32px;
+      line-height: 32px;
+      padding: 0;
+      margin-right: 0;
+      font-weight: 700;
       text-align: left;
       text-align: left;
-      width: 272px;
-      height: 362px;
-      box-shadow: 0 1px 6px 0 #ccc;
-      color: #333;
-      background: #fff;
-      overflow: visible!important;
+      cursor: pointer;
+      -webkit-transition: all 0.2s ease-in-out;
+      -o-transition: all 0.2s ease-in-out;
+      transition: all 0.2s ease-in-out;
+      .unread_num {
+        display: inline-block;
+        color: #fff;
+        background-color: #5182e4;
+        height: 14px;
+        padding: 0 2px;
+        line-height: 14px;
+        text-align: center;
+        border-radius: 2px;
+        font-size: 12px;
+        padding: 0 3px;
+        font-family: Arial;
+        -webkit-transform: scale(0.85);
+        -ms-transform: scale(0.85);
+        -o-transform: scale(0.85);
+        transform: scale(0.85);
+      }
     }
     }
-    .noticeBox::before {
-      content: '';
-      border: solid 7px transparent;
-      border-bottom-color: #fff;
-      display: block;
-      position: absolute;
-      width: 2px;
-      top: -14px;
-      left: 50%;
-      margin-left: 77px;
-      z-index: 0;
+    .active {
+      box-shadow: 0 -2px 0 0 #5182e4 inset;
     }
     }
-    .noticeTab {
-      padding: 8px 16px 0;
-      z-index: 10;
-      height: 32px;
+  }
+  .noticeList_scroll {
+    height: 282px;
+    /deep/ .el-scrollbar__wrap {
+      overflow-x: hidden;
+    }
+    .noticeList_item {
+      width: 100%;
+      height: auto;
+      position: relative;
+      cursor: pointer;
+      box-sizing: border-box;
+      padding: 12px 16px;
+      -webkit-transition: all 0.2s ease-in-out;
+      -o-transition: all 0.2s ease-in-out;
+      transition: all 0.2s ease-in-out;
       zoom: 1;
       zoom: 1;
-      box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset;
-      .noticeTab_item {
+      .noticeItem_box {
         float: left;
         float: left;
         position: relative;
         position: relative;
-        width: 240px;
-        height: 32px;
-        line-height: 32px;
-        padding: 0;
-        margin-right: 0;
-        font-weight: 700;
-        text-align: left;
-        cursor: pointer;
-        -webkit-transition: all 0.2s ease-in-out;
-        -o-transition: all 0.2s ease-in-out;
-        transition: all 0.2s ease-in-out;
-        .unread_num {
-          display: inline-block;
-          color: #fff;
-          background-color: #5182E4;
-          height: 14px;
-          padding: 0 2px;
-          line-height: 14px;
-          text-align: center;
-          border-radius: 2px;
-          font-size: 12px;
-          padding: 0 3px;
-          font-family: Arial;
-          -webkit-transform: scale(0.85);
-          -ms-transform: scale(0.85);
-          -o-transform: scale(0.85);
-          transform: scale(0.85);
-        }
-      }
-      .active {
-        box-shadow: 0 -2px 0 0 #5182E4 inset;
-      }
-    }
-    .noticeList_scroll {
-      height: 282px;
-      /deep/ .el-scrollbar__wrap {
-        overflow-x: hidden;
-      }
-      .noticeList_item {
         width: 100%;
         width: 100%;
-        height: auto;
-        position: relative;
-        cursor: pointer;
-        box-sizing: border-box;
-        padding: 12px 16px;
-        -webkit-transition: all 0.2s ease-in-out;
-        -o-transition: all 0.2s ease-in-out;
-        transition: all 0.2s ease-in-out;
-        zoom: 1;
-        .noticeItem_box {
-          float: left;
+        .noticeItem_text {
+          color: rgba(10, 18, 32, 0.87);
+          font-weight: 700;
+          padding-left: 18px;
+          text-indent: -6px;
           position: relative;
           position: relative;
-          width: 100%;
-          .noticeItem_text {
-            color: rgba(10, 18, 32, 0.87);
-            font-weight: 700;
-            padding-left: 18px;
-            text-indent: -6px;
-            position: relative;
-            font-size: 12px;
-            line-height: 17px;
-            -webkit-transition: all 0.2s ease-in-out;
-            -o-transition: all 0.2s ease-in-out;
-            transition: all 0.2s ease-in-out;
-            .msg-icon{
-              position: absolute;
-              top: 2.5px;
-              left: 6px;
-            }
-            p {
-              word-break: break-all;
-            }
+          font-size: 12px;
+          line-height: 17px;
+          -webkit-transition: all 0.2s ease-in-out;
+          -o-transition: all 0.2s ease-in-out;
+          transition: all 0.2s ease-in-out;
+          .msg-icon {
+            position: absolute;
+            top: 2.5px;
+            left: 6px;
           }
           }
-          .noticeItem_time {
-            font-size: 12px;
-            height: 19px;
-            line-height: 19px;
-            color: rgba(10, 18, 32, 0.46);
-            margin-top: 4px;
-            padding-left: 18px;
+          p {
+            word-break: break-all;
           }
           }
         }
         }
-      }
-      .noticeList_item:hover {
-        background-color: #F5F7F7;
-      }
-      .noticeList_item:after {
-        content: "";
-        display: block;
-        height: 0;
-        clear:both;
-        visibility: hidden;
-      }
-      .noticeList_item:before {
-        position: absolute;
-        right: 0;
-        bottom: 0;
-        left: 0;
-        height: 1px;
-        padding: 0 16px;
-        background-color: #ebebeb;
-        content: "";
-        background-clip: content-box;
+        .noticeItem_time {
+          font-size: 12px;
+          height: 19px;
+          line-height: 19px;
+          color: rgba(10, 18, 32, 0.46);
+          margin-top: 4px;
+          padding-left: 18px;
+        }
       }
       }
     }
     }
-    .notice_operate {
-      height: 40px;
-      line-height: 20px;
-      padding: 10px 16px;
-      box-sizing: border-box;
-      background-color: rgba(242, 243, 245, 0.48);
-      box-shadow: inset 0 1px 0 0 rgba(10, 18, 32, 0.06);
-      zoom: 1;
-      .readAll {
-        float: left;
-        cursor: pointer;
-        -webkit-transition: all 0.2s ease-in-out;
-        -o-transition: all 0.2s ease-in-out;
-        transition: all 0.2s ease-in-out;
-      }
-      .readAll:hover {
-        text-decoration: underline;
-      }
-      .seeAll {
-        float: right;
-        color: #5182e4;
-        cursor: pointer;
-        font-weight: 700;
-      }
-      .seeAll:hover {
-        text-decoration: underline;
-      }
+    .noticeList_item:hover {
+      background-color: #f5f7f7;
     }
     }
-    .el-icon-message-solid{
-      font-size: 22px;
+    .noticeList_item:after {
+      content: "";
+      display: block;
+      height: 0;
+      clear: both;
+      visibility: hidden;
     }
     }
-    /deep/ .el-badge__content{
-      height: 16px;
-      line-height: 16px;
-      border: 1px solid transparent;
+    .noticeList_item:before {
+      position: absolute;
+      right: 0;
+      bottom: 0;
+      left: 0;
+      height: 1px;
+      padding: 0 16px;
+      background-color: #ebebeb;
+      content: "";
+      background-clip: content-box;
     }
     }
   }
   }
-  .notification-box:hover{
-    color: #d3d8e2;
-    background-color: #3f4f62;
-  }
-  .success-color{
-    color: #67C23A;
-  }
-  .error-color{
-    color: #F56C6C;
+  .notice_operate {
+    height: 40px;
+    line-height: 20px;
+    padding: 10px 16px;
+    box-sizing: border-box;
+    background-color: rgba(242, 243, 245, 0.48);
+    box-shadow: inset 0 1px 0 0 rgba(10, 18, 32, 0.06);
+    zoom: 1;
+    .readAll {
+      float: left;
+      cursor: pointer;
+      -webkit-transition: all 0.2s ease-in-out;
+      -o-transition: all 0.2s ease-in-out;
+      transition: all 0.2s ease-in-out;
+    }
+    .readAll:hover {
+      text-decoration: underline;
+    }
+    .seeAll {
+      float: right;
+      color: #5182e4;
+      cursor: pointer;
+      font-weight: 700;
+    }
+    .seeAll:hover {
+      text-decoration: underline;
+    }
   }
   }
-  .warning-color{
-    color: #E6A23C;
+  .el-icon-message-solid {
+    font-size: 22px;
   }
   }
-  .info-color{
-    color: #909399;
+  /deep/ .el-badge__content {
+    height: 16px;
+    line-height: 16px;
+    border: 1px solid transparent;
   }
   }
+}
+.notification-box:hover {
+  color: #d3d8e2;
+  background-color: #3f4f62;
+}
+.success-color {
+  color: #67c23a;
+}
+.error-color {
+  color: #f56c6c;
+}
+.warning-color {
+  color: #e6a23c;
+}
+.info-color {
+  color: #909399;
+}
 </style>
 </style>

+ 164 - 144
src/framework/components/messagesever/msgAllDetails.vue

@@ -1,131 +1,137 @@
-<template>
-  <div class="box">
-    <div class="condition">
-      <div class="main" :style="tableData && tableData.length?'height: calc(100% - 96px);':'height: calc(100% - 46px);'">
-        <!-- <el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%" :header-cell-style="headerStyle"> -->
-        <el-table ref="multipleTable" v-loading='loading' stripe :header-cell-style="headerStyle" :data="tableData">
-          <el-table-column type="selection" width="55"></el-table-column>
-          <el-table-column prop="messageModule" label="模块" width="200"></el-table-column>
-          <el-table-column prop="messageContent" label="消息内容" width="600"></el-table-column>
-          <el-table-column prop="messageTime" label="消息时间">
-          </el-table-column>
-          <el-table-column label="消息类型">
-            <template slot-scope="scope">
-       <i :class="iconClassMap[scope.row.messageType]?iconClassMap[scope.row.messageType]:'msg-icon el-icon-info info-color'"></i>
-      </template>
-            
-          </el-table-column>
+  <template>
+    <div class="box">
+      <div class="condition">
+        <div class="main" :style="tableData && tableData.length?'height: calc(100% - 50px);':'height: calc(100% - 46px);'">
+          <el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%" :header-cell-style="headerStyle"
+            @expand-change="changeMessageState">
+            <el-table-column type="selection" width="55"></el-table-column>
+            <el-table-column width="25">
+              <template slot-scope="scope">
+                <el-badge class="item" type="warning" is-dot v-if="!scope.row.Read"></el-badge>
+              </template>
+            </el-table-column>
+            <el-table-column prop="Title" label="标题内容" width="600"></el-table-column>
+            <el-table-column label="模块" width="200">
+              <template slot-scope="scope">
+                {{ moduleMap[scope.row.Module] }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="CreateTime" label="消息时间">
+            </el-table-column>
+            <el-table-column label="消息类型">
+              <template slot-scope="scope">
+                <div>
+                  <span>{{ scope.row.Type }}</span>
+                  <i :class="iconClassMap[scope.row.Type]?iconClassMap[scope.row.Type]:'msg-icon el-icon-info info-color'"></i>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column type="expand">
             <el-table-column type="expand">
-            <!-- <template slot-scope="props">
-              <el-form label-position="left" label-width="auto" inline class="demo-table-expand" v-if="props.row.ComponentCount && props.row.ComponentCount.length">
-                <el-form-item v-for="item in props.row.ComponentCount?props.row.ComponentCount:[]" :key="item.code" :label="`${item.name}:`">
-                  <span>{{ item.count }}</span>
-                </el-form-item>
-              </el-form>
-            </template> -->
-          </el-table-column>
-          <template slot="empty">
-            <div style="height: 60%;transform: translateY(50%);">
-              <i class="icon-wushuju iconfont"></i>
-              数据暂无
-            </div>
-          </template>
-        </el-table>
-      </div>
-      <div class=footer>
-        <el-pagination class="right">
-        </el-pagination>
-        <!-- <el-pagination
-          class="right"
-          v-show="tableData && tableData.length"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="page.pageNumber"
-          :page-sizes="page.pageSizes"
-          :page-size="page.pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
+              <template slot-scope="scope">
+                <p>{{ scope.row.Content.Message }}</p>
+                <el-link is-underline="false" v-for="(btn, index) in scope.row.Content.ButtonList" style="float:left;font-size:12px;color:white;width:"
+                  :key="index" :href="`/image-service/common/file_get?systemId=revit&key=${btn.Url}`" :download="btn.FileName?btn.FileName:''">
+                  {{btn.Name}}
+                </el-link>
+              </template>
+            </el-table-column>
+            <template slot="empty">
+              <div style="height: 60%;transform: translateY(50%);">
+                <i class="icon-wushuju iconfont"></i>
+                数据暂无
+              </div>
+            </template>
+          </el-table>
+        </div>
+        <el-pagination class="right" v-show="tableData && tableData.length" @size-change="handleSizeChange" @current-change="handleCurrentChange"
+          :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
           :total="page.total">
           :total="page.total">
-        </el-pagination> -->
+        </el-pagination>
       </div>
       </div>
     </div>
     </div>
-  </div>
-</template>
+  </template>
 
 
-<script>
-import { mapGetters } from 'vuex'
-import { messgeCount, messgeQuery, messgeUpdateState } from '@/api/msgsever'
-import Bus from '@/utils/bus.js'
+  <script>
+  import { mapGetters } from 'vuex'
+  import { messgeCount, messgeQuery, messgeUpdateState, messgeUpdate } from '@/api/msgsever'
+  import Bus from '@/utils/bus.js'
 
 
-export default {
-  data() {
-    return {
-      tableData:[],
-      loading: false,
-      page: {
-        pageSize: 50,
-        pageSizes: [10, 20, 50, 100],
-        pageNumber: 1,
-        total: 0
+  export default {
+    data() {
+      return {
+        tableData: [],
+        loading: false,
+        page: {
+          pageSize: 50,
+          pageSizes: [10, 20, 50, 100],
+          pageNumber: 1,
+          total: 0
+        },
+        headerStyle: {
+          backgroundColor: '#e1e4e5',
+          color: '#2b2b2b',
+          lineHeight: '30px'
+        }, // 列表样式
+        moduleMap: {//消息模块映射
+          "Model": "模型文件管理"
+        },
+        iconClassMap: { //消息类型图标映射
+          "Success": "msg-icon el-icon-success success-color",
+          "Error": "msg-icon el-icon-error error-color",
+          "Warning": "msg-icon el-icon-warning warning-color",
+          "Info": "msg-icon el-icon-info info-color",
+        }
+      }
+    },
+    computed: {
+      ...mapGetters('layout', ['userInfo', 'projects', 'userId'])
+    },
+    mounted() {
+      this.getTableData()
+    },
+    methods: {
+      getTableData() {
+        let params = this.formatFilter();
+        this.loading = true;
+        messgeQuery(params, res => {
+          this.tableData = res.Content.map(item => { return item })
+          this.page.total = res.Content.length;
+        })
+        this.loading = false;
       },
       },
-      headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
-      }, // 列表样式
-      moduleMap: {//消息模块映射
-        "Model": "模型文件管理"
+      formatFilter() {
+        let params = {
+          Cascade: [
+            {
+              Name: "project"
+            }
+          ],
+          Filters: `UserId='${this.userId}'`,
+          Orders: "CreateTime desc, Id asc",
+          pageNumber: this.page.pageNumber,
+          pageSize: this.page.pageSize
+        }
+        return params;
       },
       },
-      iconClassMap: { //消息类型图标映射
-        "Success": "msg-icon el-icon-success success-color",
-        "Error": "msg-icon el-icon-error error-color",
-        "Warning": "msg-icon el-icon-warning warning-color",
-        "Info": "msg-icon el-icon-info info-color",
-      }
-    }
-  },
-  computed: {
-    ...mapGetters('layout', ['userInfo', 'projectId', 'projects', 'userId'])
-  },
-  created() {
-
-  },
-  mounted() {
-    this.getMessageList()//获取消息列表
-    Bus.$on('messageListUpdate', message => {
-      this.getMessageList()
-    })
-  },
-  watch: {
-    projectId() {
-      this.page.pageNumber = 1
-      this.multipleSelection = []
-    }
-  },
-  methods: {
-    getMessageList(){//获取消息列表
-      let params = {
-        Filters: `UserId='${this.userId}'`,
-        Orders: "CreateTime desc, Id asc",
-        PageNumber: 1,
-        PageSize: 50
+      handleSizeChange(val) {
+        this.page.pageSize = val;
+        this.getTableData();
+      },
+      handleCurrentChange(val) {
+        this.page.pageNumber = val;
+        this.getTableData();
+      },
+      changeMessageState(val) {
+        val.Read = true;
+        let params = {
+          Content: [...val],
+          Projection: ["Read"]
+        };
+        messgeUpdate(params);// 展开更新为已读状态
       }
       }
-      messgeQuery(params, res => {
-        this.messageList = res.Content
-        this.messageList.map((item)=>{
-          console.log(item,234232)
-          this.tableData.push({
-            messageModule: this.moduleMap[item.Module],// 模块
-            messageTime: item.CreateTime,// 时间
-            messageType: item.Type,// 类型
-            messageContent: item.Title,// title
-            messageButton: item.ButtonList?item.ButtonList.Name:''// 按钮
-          })
-        })
-      })
     }
     }
-  }
-};
-</script>
+  };
+  </script>
 
 
 <style scoped lang='less'>
 <style scoped lang='less'>
 .box {
 .box {
@@ -136,37 +142,51 @@ export default {
     flex-direction: column;
     flex-direction: column;
     border: 1px solid #dfe6ec;
     border: 1px solid #dfe6ec;
     background: #fff;
     background: #fff;
-    .main{
+    .main {
       margin-top: 10px;
       margin-top: 10px;
     }
     }
   }
   }
 }
 }
+.el-badge.item {
+  height: 10px;
+}
+.el-table__expanded-cell {
+  p {
+    margin-left: 40px;
+  }
+}
+.el-link {
+  margin: 40px 0 0 40px;
+  background: #409eff;
+  border-radius: 3px;
+  padding: 3px 15px;
+}
 </style>
 </style>
 
 
 <style>
 <style>
-  .demo-table-expand {
-    font-size: 0;
-  }
-  .demo-table-expand label {
-    width: 90px;
-    color: #99a9bf;
-  }
-  .demo-table-expand .el-form-item {
-    margin-right: 0;
-    margin-bottom: 0;
-    margin-left: 120px;
-    width: 100%;
-  }
-    .success-color{
-    color: #67C23A;
-  }
-  .error-color{
-    color: #F56C6C;
-  }
-  .warning-color{
-    color: #E6A23C;
-  }
-  .info-color{
-    color: #909399;
-  }
+.demo-table-expand {
+  font-size: 0;
+}
+.demo-table-expand label {
+  width: 90px;
+  color: #99a9bf;
+}
+.demo-table-expand .el-form-item {
+  margin-right: 0;
+  margin-bottom: 0;
+  margin-left: 120px;
+  width: 100%;
+}
+.success-color {
+  color: #67c23a;
+}
+.error-color {
+  color: #f56c6c;
+}
+.warning-color {
+  color: #e6a23c;
+}
+.info-color {
+  color: #909399;
+}
 </style>
 </style>

+ 0 - 2
src/views/data_admin/buildTask/addTask/addDeviceTask.vue

@@ -244,7 +244,6 @@ export default {
     },
     },
     //切换页数
     //切换页数
     handleCurrentChange(val) {
     handleCurrentChange(val) {
-      this.page.pageNumber = 1
       this.page.pageNumber = val
       this.page.pageNumber = val
       this.getTableData()
       this.getTableData()
     },
     },
@@ -258,7 +257,6 @@ export default {
       }
       }
       createDeviceTask(param, res => {
       createDeviceTask(param, res => {
         this.$message.success("创建成功!")
         this.$message.success("创建成功!")
-        console.log(this.$route.query.newTaskTypes,1234567)
         this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
         this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
       })
       })
     }
     }