Przeglądaj źródła

Merge branch 'msg-sever' of git.sagacloud.cn:web/ibms into msg-sever

zhangyu 5 lat temu
rodzic
commit
9e4d659805

+ 1 - 1
package.json

@@ -28,7 +28,7 @@
         "@saga-web/base": "2.1.9",
         "@saga-web/draw": "2.1.58",
         "@saga-web/graphy": "2.1.30",
-        "@saga-web/cad-engine": "2.0.358"
+        "@saga-web/cad-engine": "2.0.366"
     },
     "devDependencies": {
         "ajv": "^6.9.1",

+ 1 - 0
src/components/business_space/newGraphy/canvasFun.vue

@@ -15,6 +15,7 @@
         <el-dropdown-menu slot='dropdown'>
           <el-dropdown-item command="savePng">保存为png</el-dropdown-item>
           <el-dropdown-item command="saveSvg">保存为svg</el-dropdown-item>
+          <el-dropdown-item command="saveJson">保存为Json</el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
     </div>

+ 9 - 1
src/components/business_space/newGraphy/graphy.vue

@@ -62,7 +62,7 @@
       <!-- 底部操作按钮 -->
       <el-row class="canvas-actions-box">
         <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo"
-          @changeAbsorb="changeAbsorb" @scale="scale" @groupSelect="groupSelect" :config="config" ref="canvasFun"></canvasFun>
+          @changeAbsorb="changeAbsorb" @scale="scale" @groupSelect="groupSelect" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
       </el-row>
     </div>
     <!--  -->
@@ -679,6 +679,14 @@ export default {
     saveSvg() {
       this.view.saveSceneSvg(`${this.buildFloor[1]}.svg`, 6400, 4800);
     },
+    // 保存为svg
+    saveSvg() {
+      this.view.saveSceneSvg(`${this.buildFloor[1]}.svg`, 6400, 4800);
+    },
+    // 保存json
+    saveJson() {
+      this.view.saveFloorJson(`${this.buildFloor[1]}.json`)
+    },
     // 切割划分
     divide() {
       this.scene.isMarking = true;

+ 11 - 2
src/framework/components/messagesever/index.vue

@@ -36,7 +36,7 @@
         </div>
         <div class="notice_operate">
           <!-- <div class="readAll">全部标为已读</div> -->
-          <div class="seeAll">查看全部<i class="iconfont icon-right"></i></div>
+          <div class="seeAll" @click="allDetails">查看全部<i class="iconfont icon-right"></i></div>
         </div>
       </div>
     </transition>
@@ -66,6 +66,9 @@ import { MQTT_SERVICE, MQTT_USERNAME, MQTT_PASSWORD } from './mqSetting'
 import { messgeCount, messgeQuery, messgeUpdateState } from '@/api/msgsever'
 
 export default {
+  components:{
+    
+  },
   data() {
     return {
       client: Stomp.client(MQTT_SERVICE),
@@ -84,7 +87,8 @@ export default {
         "Error": "msg-icon el-icon-error error-color",
         "Warning": "msg-icon el-icon-warning warning-color",
         "Info": "msg-icon el-icon-info info-color",
-      }
+      },
+      showTools: false
     }
   },
   created () {
@@ -190,6 +194,11 @@ export default {
     },
     handleClickSendMessage() {//发送消息
       this.send('/topic/datacenter.broadcast',this.sendMessage)
+    },
+    allDetails(){
+      console.log(493498384938)
+      this.noticeListShow = false;
+      this.$router.push({path:"/message/allDetails"});
     }
   }
 }

+ 172 - 0
src/framework/components/messagesever/msgAllDetails.vue

@@ -0,0 +1,172 @@
+<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>
+            <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"
+          :total="page.total">
+        </el-pagination> -->
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+import { messgeCount, messgeQuery, messgeUpdateState } 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
+      },
+      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', '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
+      }
+      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>
+
+<style scoped lang='less'>
+.box {
+  .condition {
+    padding: 10px;
+    display: flex;
+    height: 100%;
+    flex-direction: column;
+    border: 1px solid #dfe6ec;
+    background: #fff;
+    .main{
+      margin-top: 10px;
+    }
+  }
+}
+</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;
+  }
+</style>

+ 20 - 0
src/router/system.js

@@ -1,4 +1,5 @@
 import LayoutMain from '@/framework/layout/Main'
+import MsgAllDetails from "@/framework/components/messagesever/msgAllDetails"
 
 import Login from '@/framework/layout/Login'
 import Dasboard from '@/views/dasboard'
@@ -67,6 +68,7 @@ import dataReport from '@/views/ledger/report'
 import auth from '@/views/system/auth'
 import noUser from '@/views/system/nouser'
 import spaceDetail from '@/views/ledger/spacelist/spaceDetail'
+import relatedSpace from '@/views/ledger/cenotelist/relatedSpace'
 
 /**  关系维护并计算 */
 import maintain from '@/views/relation/maintain'
@@ -87,7 +89,20 @@ export default [
     //{ path: '/login', name: 'Login', component: Login },
     { path: '/auth', name: 'auth', component: auth },
     { path: '/noUser', name: 'noUser', component: noUser },
+    // {
+    //     path: '/msgAllDetails',
+    //     name: 'LayoutMain',
+    //     component: MsgAllDetails,
+    // },
     // 业务空间数据导入工具
+    {
+        path: '/message',
+        name: 'LayoutMain',
+        component: LayoutMain,
+        children: [
+            { path: 'allDetails', name: "allDetails", component: MsgAllDetails, meta: { keepAlive: false, breadcrumbs: [{ label: '消息中心' }] } }
+        ]
+    },
     { path: '/dataUtil', name: 'dataUtil', component: LayoutMain, children: [{ path: 'index', component: dataUtil }] },
     // 平台管理
     {
@@ -359,6 +374,11 @@ export default [
                 name: 'cenoteDetail',
                 component: cenoteDetail,
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '竖井台账', path: '/ledger/cenotelist' }, { label: '竖井关系详情' }] }
+            }, {
+                path: 'relatedSpace',
+                name: 'relatedSpace',
+                component: relatedSpace,
+                meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '竖井台账', path: '/ledger/cenotelist' }, { label: '竖井关联的元空间' }] }
             },
             {
                 path: 'rentlist',

+ 5 - 27
src/views/ledger/cenotelist/index.vue

@@ -25,24 +25,6 @@
       <div class="tableLeft" v-show="tableData && tableData.length">
         <handson-table ref="table"></handson-table>
       </div>
-      <div class="tableRight">
-        <div v-show="isTableRightShow">
-          <div class="table_right_box"><span class="iconfont close_right" @click="handleCloseRight">&#xe66b;</span></div>
-          <h5>管理需要关联的元空间</h5>
-          <p style="margin-bottom: 10px;">以下为关联的元空间id</p>
-          <el-input
-            type="textarea"
-            :autosize="{ minRows: 6, maxRows: 10}"
-            :disabled="onlyRead"
-            placeholder="请输入元空间id,以“,”分割"
-            v-model="spaceList">
-          </el-input>
-          <el-row class="right" v-show="!onlyRead">
-            <el-button @click="handleCloseRight">取消</el-button>
-            <el-button @click="saveSpaceList" type="primary">保存</el-button>
-          </el-row>
-        </div>
-      </div>
     </div>
     <el-pagination
       class="right"
@@ -75,7 +57,6 @@ import tools from "@/utils/scan/tools"
 import handsonUtils from "@/utils/hasontableUtils"
 import showTools from "@/utils/handsontable/notShow"
 import text from "@/utils/handsontable/mainText"
-
 import cenoteType from "@/components/ledger/lib/cenoteType";
 import handsonTable from "@/components/common/handsontable";
 import { getDataDictionary, getCenoteTableData, updataCenoteTableData, deleteCenoteTableData, saveCenoteRelateSpace, BeatchQueryParam } from "@/api/scan/request"
@@ -89,7 +70,6 @@ export default {
     return {
       cenoteId: "",//竖井类型id
       shaftId: "",//要操作的竖井id
-      isTableRightShow: false,
       spaceList: "",
       options: [{
         value: true,
@@ -297,11 +277,6 @@ export default {
       this.cenoteId = value.Id
       this.getTableHeader()
     },
-    //关闭右侧关联元空间输入按钮
-    handleCloseRight() {
-      this.isTableRightShow = false
-      this.spaceList = ""
-    },
     //切换每页显示多少条数据
     handleSizeChange(val) {
       this.page.pageSize = val
@@ -372,8 +347,11 @@ export default {
       this.shaftId = infos.ShaftID //要操作的数据id
       //点击关联的元空间
       if (val === "SpaceCount") {
-        this.spaceList = infos.SpaceList
-        this.isTableRightShow = true
+        infos.onlyRead = this.onlyRead;
+        this.$router.push({
+          path:'/ledger/relatedSpace',
+          query:{infos: infos}
+        })
         return false
       } else if (val === "OtheRelations") {
         this.$router.push({

+ 173 - 0
src/views/ledger/cenotelist/relatedSpace.vue

@@ -0,0 +1,173 @@
+<template>
+  <div id="relatedSpace">
+    <div class="condition">
+      <div class="header">
+        <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
+        <span style="float:left;">{{ cenoteObj.ShaftLocalName || cenoteObj.ShaftName || '' }}</span>
+        <div class="edit-tool" v-if="!cenoteObj.onlyRead">
+          <el-button v-if="isMyTab == 2" size="small" style="float:right">添加</el-button>
+          <div v-else>
+            <el-button v-show="!isEdit" @click="isEdit = true" size="small" style="float:right">编辑</el-button>
+            <el-button v-show="isEdit" size="small" style="float:right">保存</el-button>
+            <el-button v-show="isEdit" size="small" @click="isEdit = false" style="float:right">取消</el-button>
+          </div>
+        </div>
+        <space-select @change="changeSpace"></space-select>
+      </div>
+      <div class="saga-build-tab">
+        <el-radio-group v-model="isMyTab" @change="changeRadio" style="width: 136px;">
+          <el-radio-button label="1">平面图</el-radio-button>
+          <el-radio-button label="2" class="space-own-radio" style="width: 68px;">列表</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div v-show="isMyTab == 1" class="data-item">
+        <el-select v-model="floor" placeholder="请选择楼层" >
+          <el-option v-for="item in floorList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+        </el-select>
+      </div>
+      <div v-show="isMyTab == 2" class="data-item">
+        <related-spaceList :space="space" ref="spacelist"></related-spaceList>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import spaceSelect from "@/components/ledger/lib/spaceSelect";
+import relatedSpaceList from "@/views/ledger/cenotelist/relatedSpaceList"
+export default {
+  data() {
+    return {
+      isMyTab: 1,//默认平面图
+      isEdit: false,//是否正在编辑
+      floor:'',//楼层
+      floorList:[],
+      space:'',//当前业务空间
+    }
+  },
+  computed: {
+    cenoteObj() {
+      return this.$route.query.infos;
+    }
+  },
+  props: {
+    showIt: Boolean
+  },
+  components: {
+    spaceSelect,
+    relatedSpaceList
+  },
+  created() {
+    this.load();
+  },
+  methods: {
+    //更改业务空间类型
+    changeSpace(val) {
+      this.space = val;
+      this.load();
+    },
+    //加载数据
+    load() {
+      if(this.isMyTab == 1){
+
+      }
+      else{
+        this.$refs.spacelist.getSpaceList();
+      }
+    },
+    //更换列表或平面图
+    changeRadio(val) {
+      this.isMyTab = val;
+      this.load();
+    },
+    //返回
+    goBack() {
+      this.$router.push({
+        name: 'cenotelist'
+      })
+    }
+  },
+  watch: {
+
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.condition {
+  position: relative;
+  padding: 10px 10px;
+  display: flex;
+  height: calc(100% - 22px);
+  flex-direction: column;
+  border: 1px solid #dfe6ec;
+  background: #fff;
+  .header {
+    padding-bottom: 10px;
+    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
+    span {
+      line-height: 33px;
+      margin-left: 15px;
+    }
+    /deep/ .buildFloor {
+      line-height: 32px;
+    }
+  }
+  .spaceTypes {
+    .types {
+      float: left;
+      width: calc(100% - 200px);
+      /deep/ .el-tabs__item.is-top {
+        border-top: 2px solid transparent;
+        &.is-active {
+          border-top: 2px solid #409eff;
+        }
+      }
+    }
+    .deleBtn {
+      float: left;
+      width: 200px;
+      text-align: right;
+      height: 40px;
+      border-bottom: 1px solid #e4e7ed;
+    }
+  }
+}
+.saga-build-tab {
+  position: absolute;
+  left: 50%;
+  transform: translateX(-50%);
+  .tab-main {
+    float: left;
+    width: 120px;
+    padding: 0 5px;
+    margin: 5px 0;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    height: 30px;
+    box-sizing: border-box;
+    text-align: center;
+    cursor: pointer;
+    overflow: hidden;
+    i {
+      font-size: 18px;
+      padding-right: 10px;
+      float: left;
+      line-height: 30px;
+      margin-left: 10px;
+    }
+    span {
+      line-height: 30px;
+      float: left;
+    }
+  }
+  .tab-active {
+    background-color: #409eff;
+    color: #fff;
+  }
+}
+.data-item {
+  height: calc(100% - 44px);
+  padding: 10px 0px;
+}
+</style>

+ 79 - 0
src/views/ledger/cenotelist/relatedSpaceList.vue

@@ -0,0 +1,79 @@
+<template>
+  <div id="relatedSpaceList" style="height:100%;">
+    <div class="query">
+      <el-input v-model="keyword" placeholder="请输入关键词" @keyup.enter.native="getSpaceList" style="width:240px;">
+        <i slot="suffix" class="el-input__icon el-icon-search" @click="getSpaceList"></i>
+      </el-input>
+      <span style="padding-left:40px;">所属建筑楼层</span>
+      <el-select v-model="floor" placeholder="请选择楼层" @change="getSpaceList">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+        </el-option>
+      </el-select>
+    </div>
+    <div class="table-area" style="height:calc(100% - 52px)">
+      <el-scrollbar style="height:calc(100% - 40px);">
+        <el-table :data="tableData" style="width: 100%;height:100%;" v-loading="loading" :header-cell-style="headerStyle">
+          <el-table-column prop='MeterFunc' label='业务空间建筑楼层' show-overflow-tooltip min-width="200" header-align='center' align="center">
+          </el-table-column>
+          <el-table-column prop='MeterFunc' label='业务空间类型' show-overflow-tooltip min-width="200" header-align='center' align="center">
+          </el-table-column>
+          <el-table-column prop='MeterFunc' label='业务空间本地名称' show-overflow-tooltip min-width="200" header-align='center' align="center">
+          </el-table-column>
+          <el-table-column prop='MeterFunc' label='业务空间本地编码' show-overflow-tooltip min-width="200" header-align='center' align="center">
+          </el-table-column>
+          <el-table-column prop='' label='操作' show-overflow-tooltip min-width="90" header-align='center' align='center'>
+            <template slot-scope="scope">
+              <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-scrollbar>
+      <!-- 分页 -->
+      <el-pagination @size-change="getSpaceList" @current-change="getSpaceList" :current-page="currentPage" :page-sizes="pageSizes"
+        :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="tableData.length" style="float:right;">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      //表格头样式
+      headerStyle: {
+        backgroundColor: '#e1e4e5',
+        color: '#2b2b2b',
+        lineHeight: '30px'
+      },
+      pageSizes: [10, 20, 50, 100],
+      pageSize: 50,
+      currentPage: 1,
+      keyword: '',//关键词
+      floor: '',//当前楼层
+      options: [],//楼层
+      tableData: [],//表格数据
+      loading: false,//加载
+    }
+  },
+  methods: {
+    getSpaceList() {
+      console.log(111)
+    },
+  },
+  props: {
+    space: '',//空间id
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.query {
+  padding: 10px 0px;
+}
+#relatedSpaceList {
+  /deep/ .el-scrollbar__wrap {
+    overflow-x: hidden;
+  }
+}
+</style>

+ 5 - 1
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -3,7 +3,7 @@
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
     <div class="operate" v-if="showTools">
       <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo" @scale="scale"
-        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun"></canvasFun>
+        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
     </div>
   </div>
 </template>
@@ -158,6 +158,10 @@ export default {
     changeAbsorb(isAbsorbing) {
       this.drawMainScene.isAbsorbing = isAbsorbing;
     },
+    // 保存json
+    saveJson() {
+      this.view.saveFloorJson(`${this.floor}.json`)
+    },
     // 撤销
     undo() {