Browse Source

Merge branch 'msg-sever' of http://39.106.8.246:3003/web/ibms into msg-sever

LXXXY 5 years ago
parent
commit
883f4c072d

+ 1 - 8
config/index.js

@@ -94,14 +94,7 @@ module.exports = {
                 pathRewrite: {
                     "^/modelapi": "/"
                 }
-            },
-            '/messageapi': {
-                target: 'http://192.168.20.153:8080',
-                changeOrigin: true,
-                pathRewrite: {
-                    "^/messageapi": "/"
-                }
-            },
+            }
         },
 
         // Various Dev Server settings

+ 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.345"
+        "@saga-web/cad-engine": "2.0.366"
     },
     "devDependencies": {
         "ajv": "^6.9.1",

+ 47 - 36
src/api/data_admin/buildTaskApi.js

@@ -8,97 +8,108 @@ const baseUrl = '/api';
  * 
  */
 export function queryTaskCount(param, success) {
-  let url = `${baseUrl}/datacenter/scan-task-base/count`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/scan-task-base/count`;
+    http.postJson(url, param, success)
 }
 
 /*************************模型任务接口****************************/
 //创建模型任务
 export function createModelTask(param, success) {
-  let url = `${baseUrl}/datacenter/model-scan-task/create`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/create`;
+    http.postJson(url, param, success)
 }
 //根据id删除模型任务
 export function deleteModelTask(param, success) {
-  let url = `${baseUrl}/datacenter/model-scan-task/delete`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/delete`;
+    http.postJson(url, param, success)
 }
 //查询模型任务
 export function queryModelTask(param, success) {
-  let url = `${baseUrl}/datacenter/model-scan-task/page-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/page-query`;
+    http.postJson(url, param, success)
 }
 //更新模型任务
 export function updateModelTask(param, success) {
-  let url = `${baseUrl}/datacenter/model-scan-task/update`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/update`;
+    http.postJson(url, param, success)
 }
 //查询设备分类
 export function queryModelCategory(param, success) {
-  let url = `${baseUrl}/datacenter/model-scan-task/model-category-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/model-category-query`;
+    http.postJson(url, param, success)
 }
 //查询模型文件夹和文件
 export function queryModelFile(param, success) {
-  let url = `${baseUrl}/datacenter/model-scan-task/model-file-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/model-file-query`;
+    http.postJson(url, param, success)
 }
 
 /*************************设备台账任务接口****************************/
 //创建设备台账任务
 export function createDeviceTask(param, success) {
-  let url = `${baseUrl}/datacenter/equip-scan-task/create`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/equip-scan-task/create`;
+    http.postJson(url, param, success)
 }
 //根据id删除设备台账任务
 export function deleteDeviceTask(param, success) {
-  let url = `${baseUrl}/datacenter/equip-scan-task/delete`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/equip-scan-task/delete`;
+    http.postJson(url, param, success)
 }
 //查询设备台账任务
 export function queryDeviceTask(param, success) {
-  let url = `${baseUrl}/datacenter/equip-scan-task/page-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/equip-scan-task/page-query`;
+    http.postJson(url, param, success)
 }
 //更新设备台账任务
 export function updateDeviceTask(param, success) {
-  let url = `${baseUrl}/datacenter/equip-scan-task/update`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/equip-scan-task/update`;
+    http.postJson(url, param, success)
 }
 //查询设备分类
 export function queryDeviceCategory(param, success) {
-  let url = `${baseUrl}/datacenter/equip-scan-task/equip-category-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/equip-scan-task/equip-category-query`;
+    http.postJson(url, param, success)
+}
+//查询:根据模型空间ID查询设备信息
+export function queryModelDiglog(param, success) {
+    // let query = ''
+    // listId.map(item => {
+    //     query += `listId=${item}&`
+    // })
+    // let url = `${baseUrl}/datacenter/model-scan-task/equip-query?${query}`;
+    // http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/model-scan-task/equip-query`;
+    http.postJson(url, param, success)
 }
 
 /*************************资产台账任务接口****************************/
 //统计数量
 export function countAssetsTask(param, success) {
-  let url = `${baseUrl}/datacenter/property-scan-task/count`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/property-scan-task/count`;
+    http.postJson(url, param, success)
 }
 //创建设备台账任务
 export function createAssetsTask(param, success) {
-  let url = `${baseUrl}/datacenter/property-scan-task/create`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/property-scan-task/create`;
+    http.postJson(url, param, success)
 }
 //根据id删除设备台账任务
 export function deleteAssetsTask(param, success) {
-  let url = `${baseUrl}/datacenter/property-scan-task/delete`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/property-scan-task/delete`;
+    http.postJson(url, param, success)
 }
 //查询设备台账任务
 export function queryAssetsTask(param, success) {
-  let url = `${baseUrl}/datacenter/property-scan-task/page-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/property-scan-task/page-query`;
+    http.postJson(url, param, success)
 }
 //更新设备台账任务
 export function updateAssetsTask(param, success) {
-  let url = `${baseUrl}/datacenter/property-scan-task/update`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/property-scan-task/update`;
+    http.postJson(url, param, success)
 }
 //查询设备族
 export function queryAssetsFamily(param, success) {
-  let url = `${baseUrl}/datacenter/property-scan-task/property-category-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/datacenter/property-scan-task/property-category-query`;
+    http.postJson(url, param, success)
 }

+ 13 - 13
src/api/msgsever.js

@@ -1,5 +1,5 @@
 import http from './scan/httpUtil'
-const baseUrl = '/messageapi';
+const baseUrl = '/api';
 
 /*************************消息中心接口****************************/
 
@@ -8,8 +8,8 @@ const baseUrl = '/messageapi';
  * info: 查询总数量不传参数,查询 已读Read = true,未读 Read = false
  */
 export function messgeCount(param, success) {
-  let url = `${baseUrl}/message-center/message/count`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/message-center/message/count`;
+    http.postJson(url, param, success)
 }
 
 /**
@@ -17,24 +17,24 @@ export function messgeCount(param, success) {
  * info: 消息类型:提示(Info)、警告(Warning)、错误(Error)、成功(Success)
  */
 export function messgeCreate(param, success) {
-  let url = `${baseUrl}/message-center/message/create`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/message-center/message/create`;
+    http.postJson(url, param, success)
 }
 
 /**
  * title: 删除消息
  */
 export function messgeDelete(param, success) {
-  let url = `${baseUrl}/message-center/message/delete`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/message-center/message/delete`;
+    http.postJson(url, param, success)
 }
 
 /**
  * title: 查询消息列表
  */
 export function messgeQuery(param, success) {
-  let url = `${baseUrl}/message-center/message/page-query`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/message-center/message/page-query`;
+    http.postJson(url, param, success)
 }
 
 /**
@@ -42,8 +42,8 @@ export function messgeQuery(param, success) {
  * info: 是否读过:未读(f)、已读(t)
  */
 export function messgeUpdate(param, success) {
-  let url = `${baseUrl}/message-center/message/update`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/message-center/message/update`;
+    http.postJson(url, param, success)
 }
 
 /**
@@ -51,6 +51,6 @@ export function messgeUpdate(param, success) {
  * info: 已读Read = true,*UserId
  */
 export function messgeUpdateState(param, success) {
-  let url = `${baseUrl}/message-center/message/update-state`;
-  http.postJson(url, param, success)
+    let url = `${baseUrl}/message-center/message/update-state`;
+    http.postJson(url, param, success)
 }

+ 1 - 1
src/api/scan/httpUtil.js

@@ -45,7 +45,7 @@ export default {
         let ProjectId = storage.get("global_project_selected")
         let userName = storage.get("user_name")
         let vm = this;
-        fetch({ url: url, method: 'post', data: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName} }).then((response) => {
+        fetch({ url: url, method: 'post', params: data.paramsQuery || null, data: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName} }).then((response) => {
             successResponse(vm, response, success, failed)
         }).catch(error => {
             errorResponse(vm, error, err);

+ 6 - 0
src/components/business_space/business/handsontable.vue

@@ -162,6 +162,9 @@ export default {
         });
         if (this.main && this.main.length && this.main[0].RoomID) {
           this.copyMain = tools.deepCopy(this.main);
+          if (this.onlyRead) {
+            this.getBatch(this.main)
+          }
         }
         this.isLoading = false
         this.getMain()
@@ -481,6 +484,9 @@ export default {
       });
       if (param.data.criterias.length) {
         BeatchQueryParam(param, res => {
+          if (!this.onlyRead) {
+            return false
+          }
           this.main = data.map(item => {
             res.Content.map(child => {
               if (item.RoomID == child.id) {

+ 22 - 8
src/components/business_space/newGraphy/canvasFun.vue

@@ -1,21 +1,25 @@
 <template>
-  <el-row id="canvas-actions-box" :class="{'isEdit':isEdit}">
+  <el-row id="canvas-actions-box" :class="{'isEdit':config.isEdit}">
     <!-- <div :class="{'active':active=='move'}">
       <i class="iconfont icon-move" @click="moveCanvas"></i>
     </div> -->
+    <div v-if="config.isEdit&&config.groupSelect" :class="{'active':active=='groupSelect'}">
+      <i class="iconfont icon-shuxingxuanze" @click="groupSelect"></i>
+    </div>
     <div>
       <i class="iconfont icon-maximize" @click="fitToWindow"></i>
     </div>
-    <div>
+    <div v-if="!config.isEdit">
       <el-dropdown size="mini" placement="top-start" @command="handleCommand">
         <i class="el-icon-download" style="font-size:20px;color:#fff;"></i>
         <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>
-    <div v-if="isEdit" :class="{'active':active=='divide'}">
+    <div v-if="config.isEdit&&config.divide" :class="{'active':active=='divide'}">
       <el-dropdown size="mini" placement="top-start" @command="handleDivideCommand" :hide-on-click="false">
         <i class="iconfont icon-edit1" @click="divide"></i>
         <el-dropdown-menu slot='dropdown'>
@@ -25,13 +29,13 @@
         </el-dropdown-menu>
       </el-dropdown>
     </div>
-    <div v-if="isEdit">
+    <div v-if="config.isEdit&&config.divide">
       <i class="iconfont icon-Erase" @click="clearDivide"></i>
     </div>
-    <div v-if="isEdit">
+    <div v-if="config.isEdit">
       <i class="iconfont icon-Cancel" @click="undo"></i>
     </div>
-    <div v-if="isEdit">
+    <div v-if="config.isEdit">
       <i class="iconfont icon-Anti-cancel" @click="redo"></i>
     </div>
     <div>
@@ -57,8 +61,13 @@ export default {
     }
   },
   props: {
-    isEdit: {
-      default: false
+    config: {
+      type: Object,
+      default: {
+        isEdit: false,
+        divide: true,
+        groupSelect: false
+      }
     }
   },
   computed: {
@@ -70,6 +79,11 @@ export default {
     //   this.active = this.active != "move" ? "move" : '';
     //   this.$emit('move', this.active == 'move');
     // },
+    //
+    groupSelect() {
+      this.active = 'groupSelect';
+      this.$emit('groupSelect');
+    },
     // 适配大小
     fitToWindow() {
       this.$emit('fit');

+ 147 - 74
src/components/business_space/newGraphy/graphy.vue

@@ -49,6 +49,11 @@
             <el-button plain @click="cancelGraphy">取 消</el-button>
             <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
           </div>
+          <!-- 批量创建所选业务空间 -->
+          <div v-show="type==5">
+            <el-button type="primary" @click="groupCreateZone">批量创建所选业务空间</el-button>
+            <el-button plain @click="cancelGraphy">取 消</el-button>
+          </div>
         </div>
         <div style="position: absolute;right: 0;">
           <el-button type="text" @click="lookUnrelatBSpace(false)">未关联平面图的业务空间 {{num}} 条</el-button>
@@ -56,8 +61,8 @@
       </el-row>
       <!-- 底部操作按钮 -->
       <el-row class="canvas-actions-box">
-        <canvasFun @move="moveCanvas" @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo"
-          @redo="redo" @scale="scale" :isEdit="isEdit" ref="canvasFun"></canvasFun>
+        <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" @saveJson="saveJson"></canvasFun>
       </el-row>
     </div>
     <!--  -->
@@ -130,7 +135,11 @@ export default {
       FloorObj: {}, //楼层对象
       FloorMap: '', //楼层底图
       tab: {},
-      isEdit: false,
+      config: {
+        isEdit: false,
+        divide: true,
+        groupSelect: true
+      },
       canvasLoading: false,
       view: null,
       scene: null,
@@ -178,6 +187,11 @@ export default {
         // 业务空间
         this.getBusinessSpace();
       }
+      this.config = {
+        isEdit: false,
+        divide: true,
+        groupSelect: true
+      }
       // 获取当前楼层的元空间
       this.getFloorISpace();
       // 查询未关联业务空间的元空间
@@ -223,6 +237,7 @@ export default {
       this.scene.clearZoneSelection();
       // 选中当前
       zone.selected = true;
+      this.curZoneItem = zone;
       this.type = 2;
       this.view.fitSelectedToView();
     },
@@ -333,18 +348,26 @@ export default {
     },
     // canvas点击事件
     canvasClick(item, event) {
-      if (this.type == 4) {
+      console.log(item)
+      console.log(event)
+      if (this.type == 4) {//重新划分
+
+      } else if (this.type == 5) {//批量
 
       } else {
         if (item instanceof SpaceItem && item.selectable) {
+          if (this.type == 2) {
+            this.scene.clearZoneSelection();
+          }
           this.type = 3;
           this.curZoneItem = {};
-          this.scene.isZoneSelectable = false;
         }
         if (item instanceof ZoneItem && item.selectable) {
+          if (this.type == 3) {
+            this.scene.clearSpaceSelection();
+          }
           this.type = 2;
           this.curZoneItem = item;
-          this.scene.isSpaceSelectable = false;
           this.scene.clearZoneSelection();
           item.selected = true;
         }
@@ -353,6 +376,11 @@ export default {
     // 编辑平面图
     editGraphy() {
       this.type = 3;
+      this.config.isEdit = true;
+      this.config.groupSelect = false;
+      this.config.divide = true;
+      // 设置业务空间不可选
+      this.scene.isZoneSelectable = false
     },
     // 查看未关联的业务空间--flag--查看-or-选择
     lookUnrelatBSpace(flag) {
@@ -377,7 +405,17 @@ export default {
       if (this.groupCreateType == 1) {
         this.groupCreateBSpace()
       } else if (this.groupCreateType == 2) {
-
+        this.type = 5;
+        this.config.isEdit = true;
+        this.config.groupSelect = true;
+        this.config.divide = false;
+        this.groupCreateDialogVis = false;
+        // 清空选中空间
+        this.scene.clearSpaceSelection();
+        // 设置空间可选
+        this.scene.isSpaceSelectable = true;
+        // 设置业务空间不可选
+        this.scene.isZoneSelectable = false;
       }
     },
     // 批量创建业务空间
@@ -412,34 +450,9 @@ export default {
           type: "warning"
         }
         ).then(() => {
-          let pa = {
-            zone: this.tab.code,
-            data: {
-              Content: Spaces
-            }
-          }
+          this.groupCreateDialogVis = false;
           this.canvasLoading = true;
-          createZone(pa, res => {
-            res.EntityList.map(t => {
-              Spaces = Spaces.map(item => {
-                if (t.RoomLocalName == item.RoomLocalName) {
-                  item.SpaceId = t.RoomID
-                }
-                return item;
-              })
-            })
-            let param = {
-              data: {
-                Content: Spaces
-              },
-              type: this.tab.code
-            }
-            groupCreRelaZoneAndISp(param, res => {
-              this.$message.success('创建成功')
-              this.canvasLoading = false;
-              this.init(2)
-            })
-          })
+          this.groupCreateBSP(Spaces)
         }).catch(() => {
           this.$message({
             type: "info",
@@ -478,38 +491,21 @@ export default {
       zoneObj.RoomLocalName = val;
       zoneObj.BuildingId = this.buildFloor[0];
       zoneObj.FloorId = this.buildFloor[1];
-      let pa = {
-        zone: this.tab.code,
-        data: {
-          Content: [zoneObj]
-        }
-      }
-      createZone(pa, res => {
-        this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
-      })
+      this.createSingleBSP(zoneObj, IspaceIdList)
     },
     // 从未关联平面图的业务空间中选择--按钮返回关联信号
     createFromUnrelated(BSP) {
       BSP.Outline = [];
       BSP.Height = 0;
-      let arr = this.scene.getSelectedSpaces();
+      let arr = this.scene.getSelectedSpaces(), IspaceIdList = [];
       arr.map(t => {
         BSP.Outline.push(t.data.OutLine);
+        IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
         if (t.Height && (BSP.Height == 0 || t.Height < BSP.Height)) {
           BSP.Height = t.Height;
         }
       })
-      let pa = {
-        zone: BSP.ObjectType,
-        data: {
-          Content: [BSP],
-          Projection: ['Outline']
-        }
-      }
-      updateZone(pa, res => {
-        this.$message.success('更新成功');
-        this.init(2);
-      })
+      this.updateBSPOutline(BSP, IspaceIdList)
     },
     // 编辑空间详情
     editeSpaceDetail() {
@@ -527,7 +523,8 @@ export default {
       // 设置空间可选
       this.scene.isSpaceSelectable = true;
       // 将已关联的设置不可选,并将当前选的隐藏
-      this.scene.changeSelectZone(this.curZoneItem);
+      this.scene.isZoneSelectable = false;
+      this.curZoneItem.visible = false;
     },
     // 重新划分--保存
     saveRefactorBSP() {
@@ -545,16 +542,27 @@ export default {
       if (!zoneObj.Outline.length) {
         zoneObj.Outline = null;
       }
-      let pa = {
-        zone: this.tab.code,
-        data: {
-          Content: [zoneObj],
-          Projection: ['Outline']
-        },
-      }
-      updateZone(pa, res => {
-        this.relationInBSPandISP(zoneObj.RoomID, IspaceIdList)
+      this.updateBSPOutline(zoneObj, IspaceIdList)
+    },
+    // 批量创建所选业务空间
+    groupCreateZone() {
+      let arr = this.scene.getSelectedSpaces();
+      let spaces = arr.map(t => {
+        return {
+          IspaceId: this.BIMIDToSID[t.data.SourceId],
+          RoomLocalName: t.data.Name,
+          Outline: [t.data.OutLine],
+          BuildingId: this.buildFloor[0],
+          FloorId: this.buildFloor[1],
+          Height: t.data.Height || 0
+        }
       })
+      if (spaces.length) {
+        this.canvasLoading = true;
+        this.groupCreateBSP(spaces)
+      } else {
+        this.$message.warning('未选择空间');
+      }
     },
     // 更新业务空间和元空间的关系
     relationInBSPandISP(SpaceId, IspaceIdList) {
@@ -567,6 +575,65 @@ export default {
         this.init(2);
       })
     },
+    // 批量更新业务空间和元空间的关系
+    groupCreRelaZoneAndISp(Spaces) {
+      let param = {
+        data: {
+          Content: Spaces
+        },
+        type: this.tab.code
+      }
+      groupCreRelaZoneAndISp(param, res => {
+        this.$message.success('创建成功')
+        this.canvasLoading = false;
+        this.init(2)
+      })
+    },
+    // 批量创建
+    groupCreateBSP(spaces) {
+      let pa = {
+        zone: this.tab.code,
+        data: {
+          Content: spaces
+        }
+      }
+      createZone(pa, res => {
+        res.EntityList.map(t => {
+          spaces = spaces.map(item => {
+            if (t.RoomLocalName == item.RoomLocalName) {
+              item.SpaceId = t.RoomID
+            }
+            return item;
+          })
+        })
+        this.groupCreRelaZoneAndISp(spaces)
+      })
+    },
+    // 单个创建
+    createSingleBSP(space, IspaceIdList) {
+      let pa = {
+        zone: this.tab.code,
+        data: {
+          Content: [space]
+        }
+      }
+      createZone(pa, res => {
+        this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
+      })
+    },
+    // 更新业务空间区域
+    updateBSPOutline(zoneObj, IspaceIdList) {
+      let pa = {
+        zone: this.tab.code,
+        data: {
+          Content: [zoneObj],
+          Projection: ['Outline']
+        },
+      }
+      updateZone(pa, res => {
+        this.relationInBSPandISP(zoneObj.RoomID, IspaceIdList)
+      })
+    },
     // 查询未关联平面图的业务空间(项目下+当前分区)
     getBSPunrelaISP() {
       let pa = {
@@ -592,15 +659,13 @@ export default {
       this.view = new FloorView('floorCanvas')
     },
     // 工具栏操作
-    // 移动底图
-    moveCanvas(move) {
-      // todo
-      let canvas = document.getElementById(`floorCanvas`);
-      if (move) {
-        canvas.style.cursor = 'move';
-      } else {
-        canvas.style.cursor = 'default';
-      }
+    // 吸附
+    changeAbsorb(isAbsorbing) {
+      this.scene.isAbsorbing = isAbsorbing;
+    },
+    // 框选
+    groupSelect() {
+      this.scene.isRectSelection = true;
     },
     // 适配底图到窗口
     fit() {
@@ -614,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;

+ 2 - 2
src/components/business_space/newGraphy/unRelateBSP.vue

@@ -138,9 +138,9 @@ export default {
         }
       }
       if (this.floor[0] == 'isNull') {
-        pa.data.Filters += `BuildingId isNull`
+        pa.data.Filters += `;BuildingId isNull`
       } else if (this.floor[0] && this.floor[0] != 'all') {
-        pa.data.Filters += `BuildingId='${this.floor[0]}'`
+        pa.data.Filters += `;BuildingId='${this.floor[0]}'`
       }
       if (this.floor[1] == 'isNull') {
         pa.data.Filters += `;FloorId isNull`

+ 42 - 30
src/components/data_admin/buildTask/dialog/addTaskDialog.vue

@@ -5,9 +5,15 @@
         <el-switch v-model="ruleForm.isVerification"></el-switch>
       </el-form-item>
       <el-form-item label="任务类型" prop="taskType">
-        <div><el-radio v-model="ruleForm.taskType" label="model">现场验证模型</el-radio></div>
-        <div><el-radio v-model="ruleForm.taskType" label="device">现场验证设备台账</el-radio></div>
-        <div><el-radio v-model="ruleForm.taskType" label="assets">现场验证资产台账</el-radio></div>
+        <div>
+          <el-radio v-model="ruleForm.taskType" label="model">现场验证模型</el-radio>
+        </div>
+        <div>
+          <el-radio v-model="ruleForm.taskType" label="device">现场验证设备台账</el-radio>
+        </div>
+        <div>
+          <el-radio v-model="ruleForm.taskType" label="assets">现场验证资产台账</el-radio>
+        </div>
       </el-form-item>
     </el-form>
     <!-- <el-row>
@@ -18,21 +24,19 @@
       <div><el-radio v-model="ruleForm.taskType" label="model">现场验证模型</el-radio></div>
       <div><el-radio v-model="ruleForm.taskType" label="device">现场验证设备台账</el-radio></div>
       <div><el-radio v-model="ruleForm.taskType" label="assets">现场验证资产台账</el-radio></div>
-    </el-row> -->
+    </el-row>-->
     <span slot="footer" class="dialog-footer">
-				<el-button type="primary" @click="$emit('update:addTaskDialog',false)">取  消</el-button>
-				<el-button type="primary" @click="toAddTask()">确  认</el-button>
-			</span>
+      <el-button type="primary" @click="$emit('update:addTaskDialog',false)">取 消</el-button>
+      <el-button type="primary" @click="toAddTask()">确 认</el-button>
+    </span>
   </el-dialog>
 </template>
 
 <script>
-import {  } from "@/api/scan/request";
+import {} from "@/api/scan/request";
 import { mapGetters } from "vuex";
 export default {
-  components: {
-    
-  },
+  components: {},
   computed: {
     ...mapGetters("layout", ["projectId"])
   },
@@ -41,45 +45,53 @@ export default {
       title: "添加验证任务",
       dialogVisible: false,
       ruleForm: {
-        isVerification: false,
-        taskType: ''
+        isVerification: true,
+        taskType: ""
       },
       rules: {
         taskType: [
-          { required: true, message: '请选择任务类型', trigger: 'change' }
+          { required: true, message: "请选择任务类型", trigger: "change" }
         ]
       }
     };
   },
+  created() {},
   props: {
-    addTaskDialog: Boolean //是否显示弹窗
-  },
-  created() { 
-    
+    addTaskDialog: Boolean, //是否显示弹窗
+    newTaskTypes: Array
   },
   methods: {
     toAddTask() {
-      this.$refs.ruleForm.validate((valid) => {
+      this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          if (this.ruleForm.taskType == 'model') {
-            this.$router.push({ path: '/floor/addModelTask', query: this.ruleForm });
-          } else if (this.ruleForm.taskType == 'device') {
-            this.$router.push({ path: '/floor/addDeviceTask', query: this.ruleForm });
-          } else if (this.ruleForm.taskType == 'assets') {
-            this.$router.push({ path: '/floor/addAssetsTask', query: this.ruleForm });
+          this.ruleForm.newTaskTypes = this.newTaskTypes;
+          if (this.ruleForm.taskType == "model") {
+            this.$router.push({
+              path: "/floor/addModelTask",
+              query: this.ruleForm
+            });
+          } else if (this.ruleForm.taskType == "device") {
+            this.$router.push({
+              path: "/floor/addDeviceTask",
+              query: this.ruleForm
+            });
+          } else if (this.ruleForm.taskType == "assets") {
+            this.$router.push({
+              path: "/floor/addAssetsTask",
+              query: this.ruleForm
+            });
           }
         } else {
-          console.log('error submit!!');
+          console.log("error submit!!");
           return false;
         }
-      })
+      });
     },
     handleClose() {
-      this.$emit('update:addTaskDialog',this.dialogVisible)
-    },
+      this.$emit("update:addTaskDialog", this.dialogVisible);
+    }
   }
 };
 </script>
 <style lang="less" scoped>
-
 </style>

+ 69 - 64
src/components/data_admin/buildTask/dialog/modelTaskDialog.vue

@@ -7,7 +7,8 @@
         <el-table-column type="expand">
           <template slot-scope="props">
             <p v-if="props.row.ComponentCount && props.row.ComponentCount.length" style="color:#99a9bf;line-height:32px;font-size:14px;">包含的部件:</p>
-            <el-form label-position="left" label-width="auto" inline class="demo-table-expand" v-if="props.row.ComponentCount && props.row.ComponentCount.length">
+            <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>
@@ -48,11 +49,10 @@
 
 <script>
 import { queryEquip } from "@/api/scan/request"
-import { createModelTask } from "@/api/data_admin/buildTaskApi"
+import { createModelTask, queryModelDiglog } from "@/api/data_admin/buildTaskApi"
 import { mapGetters } from "vuex"
 export default {
   components: {
-    
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
@@ -82,9 +82,12 @@ export default {
   },
   props: {
     dialogVisible: Boolean,//是否显示弹窗
-    params: Object //模型和设备的信息
+    params: Object, //模型和设备的信息
+    newTaskTypes: Array
+  },
+  created() {
+
   },
-  created() { },
   methods: {
     getTableData() {
       let params = {
@@ -95,15 +98,15 @@ export default {
           },
           {
             Name: "component",
-            Cascade: [{Name: "equipCategory"}]
+            Cascade: [{ Name: "equipCategory" }]
           },
           {
             Name: "building",
-            Projection: [ "BuildLocalName", "BuildName", "BuildID" ]
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
           },
           {
             Name: "floor",
-            Projection: [ "FloorLocalName", "FloorName", "FloorID" ]
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
           }
         ],
         Filters: `ProjectId='${this.projectId}'`,
@@ -112,55 +115,57 @@ export default {
         PageSize: this.page.pageSize
       }
 
-      if(this.params.spaceList && this.params.spaceList.length){
-        //通过平面图区域查询(接口未支持)
-      } else {
-        params.Filters += `;ModelId='${this.params.CurrentModelId}'`
-      }
-
-      if(this.params.isVerification){
+      if (this.params.isVerification) {
         params.Filters += `;TaskState isNull`
       }
 
-      if(this.params.device){
+      if (this.params.device) {
         params.Filters += `;Category='${this.params.category}'`
       }
 
-      queryEquip(params, res => {
-        this.tableData = res.Content.map(item => {
-          if(item.Component && item.Component.length){
-            item.ComponentCount = []
-            item.Component.map(parts => {
-              if(parts.EquipCategory && parts.EquipCategory.EquipCode && parts.EquipCategory.EquipName){
-                let index = item.ComponentCount.findIndex(c => {return c.code == parts.EquipCategory.EquipCode})
-                if(index != -1){
-                  item.ComponentCount[index].count++
-                } else {
-                  item.ComponentCount.push({
-                    name: parts.EquipCategory.EquipName,
-                    code: parts.EquipCategory.EquipCode,
-                    count: 1
-                  })
+      if (this.params.spaceList && this.params.spaceList.length) {
+        //通过平面图区域查询(接口未支持)paramsQuery:{listId:[]}
+        let IdList = this.params.spaceList
+        queryModelDiglog(IdList, res => {})
+      } else {
+        params.Filters += `;ModelId='${this.params.CurrentModelId}'`
+        queryEquip(params, res => {
+          this.tableData = res.Content.map(item => {
+            if (item.Component && item.Component.length) {
+              item.ComponentCount = []
+              item.Component.map(parts => {
+                if (parts.EquipCategory && parts.EquipCategory.EquipCode && parts.EquipCategory.EquipName) {
+                  let index = item.ComponentCount.findIndex(c => { return c.code == parts.EquipCategory.EquipCode })
+                  if (index != -1) {
+                    item.ComponentCount[index].count++
+                  } else {
+                    item.ComponentCount.push({
+                      name: parts.EquipCategory.EquipName,
+                      code: parts.EquipCategory.EquipCode,
+                      count: 1
+                    })
+                  }
                 }
-              }
-            })
-          }
-          item.FolderName = this.params.modelFolderName
-          item.FolderId = this.params.modelFolderId
-          item.FileName = this.params.modelFileName
-          item.FileId = this.params.CurrentModelId
-          item.SchemeId = "1"
-          return item
+              })
+            }
+            item.FolderName = this.params.modelFolderName
+            item.FolderId = this.params.modelFolderId
+            item.FileName = this.params.modelFileName
+            item.FileId = this.params.CurrentModelId
+            item.SchemeId = "1"
+            return item
+          })
+          this.page.total = res.Total
         })
-        this.page.total = res.Total
-      })
+      }
+
     },
     //选中项修改
     handleSelectionChange(val) {
       this.selections = val;
     },
     savaRelation() {
-      if(this.selections.length){
+      if (this.selections.length) {
         let list = this.selections.map((item) => {
           return {
             EquipId: item.EquipID,
@@ -174,11 +179,11 @@ export default {
           Content: list
         }
         createModelTask(params, res => {
-          this.$emit('update:dialogVisible',false)
+          this.$emit('update:dialogVisible', false)
           this.$message.success('创建成功!')
-          this.$router.push({name:'buildTask'})//跳转回首页
+          this.$router.push({ name: 'buildTask', query: { newTaskTypes: this.newTaskTypes } })//跳转回首页
         })
-      }else {
+      } else {
         this.$message('请选择要创建的任务!')
       }
     },
@@ -193,13 +198,13 @@ export default {
       this.page.pageNumber = pageNo;
       this.getTableData();
     },
-    handleClose(){//关闭弹窗
-      this.$emit('update:dialogVisible',false);
+    handleClose() {//关闭弹窗
+      this.$emit('update:dialogVisible', false);
     }
   },
   watch: {
-    dialogVisible(newData,oldData){
-      if(newData){
+    dialogVisible(newData, oldData) {
+      if (newData) {
         this.tableData = []
         this.page.pageNumber = 1
         this.getTableData()
@@ -218,7 +223,7 @@ export default {
   }
   .table-box {
     height: 370px;
-    .fr{
+    .fr {
       margin-top: 10px;
     }
   }
@@ -226,17 +231,17 @@ export default {
 </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%;
-  }
+.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%;
+}
 </style>

+ 85 - 32
src/components/data_admin/buildTask/draw/drawModel.vue

@@ -1,18 +1,20 @@
 <template>
   <div :id="`drawFloor${id}`" class="drawFloor" v-loading="canvasLoading">
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
+    <div class="operate" v-show="showTools">
+      <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @scale="scale" :config="config" ref="canvasFun"></canvasFun>
+    </div>
   </div>
 </template>
 
 <script>
-import { SGraphyView } from "@sybotan-web/graphy/lib";
-import { DivideFloorScene } from "cad-engine"
+import { DivideFloorScene, FloorView } from "@saga-web/cad-engine/lib"
 import { SColor, SPoint } from "@sybotan-web/draw/lib";
 import canvasFun from "@/components/business_space/newGraphy/canvasFun"
 import { floorQuery } from "@/api/scan/request";
 export default {
   components: {
-    
+    canvasFun
   },
   data() {
     return {
@@ -25,15 +27,26 @@ export default {
       modelId: '',
       FloorID: '',
       Outline: [],
+      buttonContent: "",
+      showTools: false,
+      config: {
+        isEdit: false
+      }
     };
   },
   props: {
+    isEdit: {
+      default: false
+    },
     id: {
       default: 0
     },
+    dialog: {
+      default: false
+    },
     CurrentModelId: String
   },
-  created() {},
+  created() { },
   mounted() {
     this.cadWidth = document.getElementById(`drawFloor${this.id}`).offsetWidth;
     this.cadHeight = document.getElementById(`drawFloor${this.id}`).offsetHeight;
@@ -42,26 +55,11 @@ export default {
     initGraphy(ModelId) {
       this.modelId = ModelId;
       this.clearGraphy()
-      this.scene = new DivideFloorScene();
+      this.drawMainScene = new DivideFloorScene();
       this.canvasLoading = true;
-      this.scene.getFloorData('/modelapi/base-graph/query', { ModelId: ModelId }).then(res => {
-        let Elements = res.EntityList[0].Elements;
-        let flag = false;
-        for (let key in Elements) {
-          if (Elements[key].length > 0) {
-            flag = true;
-          }
-        }
-        if (flag) {
-          this.view.scene = this.scene
-          this.view.fitSceneToView();
-          this.canvasLoading = false;
-          this.view.maxScale = this.view.scale * 10;
-          this.view.minScale = this.view.scale;
-          this.scene.click(this, this.canvasClick);
-        } else {
-          this.canvasLoading = false;
-        }
+      this.drawMainScene.getFloorData('/modelapi/base-graph/query', { ModelId: ModelId }).then(res => {
+        console.log(this)
+        this.getGraphtSuc(res);
       })
     },
     getFloorData() {
@@ -75,10 +73,10 @@ export default {
         this.drawMainScene.addSceneMark(newArr)
       })
     },
-    getSelectedSpaces(){//获取选中区域
-      if(this.view && this.view.scene){
-        let list =  this.view.scene.getSelectedSpaces();
-        if(list.length){
+    getSelectedSpaces() {//获取选中区域
+      if (this.view && this.view.scene) {
+        let list = this.view.scene.getSelectedSpaces();
+        if (list.length) {
           return list
         } else {
           return []
@@ -94,20 +92,75 @@ export default {
         return
       }
       let id = `floorCanvas${this.id}`;
-      this.view = new SGraphyView(id)
+      this.view = new FloorView(id)
+    },
+    canvasClick(item, eventObj) {//点击平面图事件 
+      this.$emit("changeButtonContent",this.drawMainScene.getSelectedSpaces().length?"通过模型空间创建":"通过模型创建") 
+    },
+    getGraphtSuc(res) {
+      this.showTools = true;
+      this.canvasLoading = false;
+      if (res.Result == 'failure') {
+        this.showTools = false;
+        this.$message.warning(res.Message);
+        return;
+      }
+      this.view.scene = this.drawMainScene;
+      this.view.fitSceneToView();
+      this.drawMainScene.click(this, this.canvasClick);
+
+      if (this.$refs.canvasFun) {
+        this.view.maxScale = this.view.scale * 10;
+        this.view.minScale = this.view.scale;
+        this.$refs.canvasFun.everyScale = this.view.scale;
+      }
     },
-    canvasClick(item,eventObj){//点击平面图事件
-      
+    // canvas 获取焦点
+    focus() {
+      document.getElementById(`floorCanvas${this.id}`).focus()
+    },
+    // 工具栏操作
+    // 适配底图到窗口
+    fit() {
+      this.view.fitSceneToView()
+    },
+    // 保存为png
+    savePng() {
+      this.view.saveImage(`${this.floor}.png`, 'png');
+    },
+    // 保存为svg
+    saveSvg() {
+      this.view.saveSceneSvg(`${this.floor}.svg`, 6400, 4800);
+    },
+    // 缩放
+    scale(val) {
+      if (!this.view) {
+        return;
+      }
+      let scale = this.view.scale;
+      this.view.scaleByPoint(val / scale, this.cadWidth / 2, this.cadHeight / 2);
     }
   },
   watch: {
     CurrentModelId: {
-      handler(newName, oldName){
-        if(newName){
+      handler(newName, oldName) {
+        if (newName) {
           this.initGraphy(newName)
         }
       },
       immediate: true,
+    },
+    "view.scale": {
+      handler(n) {
+        if (this.$refs.canvasFun) {
+          this.$refs.canvasFun.sliderVal = n * 10 / this.view.minScale;
+        }
+      }
+    },
+    "isEdit": {
+      handler(n) {
+        this.config.isEdit = n;
+      }
     }
   }
 };

+ 1 - 1
src/components/data_admin/buildTask/table/deviceTable.vue

@@ -213,7 +213,7 @@ export default {
   watch: {
     paramsData: {
       handler(newName, oldName) {
-        this.page.pageNumber = 1
+        // this.page.pageNumber = 1
         this.getTableData()
       },
       immediate: true,

+ 1 - 1
src/components/data_admin/buildTask/table/modelTable.vue

@@ -16,7 +16,7 @@
         </el-table-column>
         <el-table-column prop="EquipLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
         <el-table-column prop="EquipCategory.EquipName" :label="`${inSpaceType}类型`" show-overflow-tooltip min-width="80"></el-table-column>
-        <el-table-column prop="BIMID" label="BIM ID" show-overflow-tooltip min-width="190"></el-table-column>
+        <el-table-column prop="BIMID" label="BIM ID" show-overflow-tooltip min-width="220"></el-table-column>
         <el-table-column prop="TaskState" label="任务执行情况" show-overflow-tooltip min-width="60"></el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
           <template slot-scope="scope">

+ 1 - 1
src/views/data_admin/buildTask/addTask/addAssetsTask.vue

@@ -211,7 +211,7 @@ export default {
       }
       createAssetsTask(param, res => {
         this.$message.success("创建成功!")
-        this.$router.push({ name: "buildTask" })
+        this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
       })
     }
   }

+ 11 - 8
src/views/data_admin/buildTask/addTask/addDeviceTask.vue

@@ -23,15 +23,17 @@
               </el-form>
             </template>
           </el-table-column>
-          <el-table-column label="所属建筑楼层" width="200">
-            <template slot-scope="scope">
+          <el-table-column label="所属建筑楼层" width="200"></el-table-column>
+          <el-table-column prop="EquipLocalName" label="设备本地名称" show-overflow-tooltip>
+             <template slot-scope="scope">
               <div>
-                {{scope.row.Building?scope.row.Building.BuildLocalName?scope.row.Building.BuildLocalName:'':''}} -
-                {{scope.row.Floor?scope.row.Floor.FloorLocalName?scope.row.Floor.FloorLocalName:'':''}}
+                {{scope.row.EquipLocalName}}
+                <el-badge v-if="scope.row.Component&&scope.row.Component.length?true:false" 
+                  :value="scope.row.Component&&scope.row.Component.length?scope.row.Component.length:0" class="item" type="warning">
+                </el-badge>
               </div>
-          </template>
+            </template>
           </el-table-column>
-          <el-table-column prop="EquipLocalName" label="设备本地名称" show-overflow-tooltip></el-table-column>
           <el-table-column prop="EquipLocalID" label="设备本地编码" show-overflow-tooltip width="200"></el-table-column>
           <el-table-column prop="EquipCategory.EquipName" label="设备类"></el-table-column>
           <el-table-column prop="LedgerParam.Siteinstall.InstallLocation" label="安装位置"></el-table-column>
@@ -109,6 +111,7 @@ export default {
   },
   created() {
     this.params = this.$route.query
+    console.log(this.params)
   },
   mounted() {
     this.getTableData()
@@ -228,7 +231,6 @@ export default {
       } else if (this.params.floorId && this.params.floorId != "all") {
         params.Filters += `;FloorId='${this.params.floorId}'`
       }
-
       return params
     },
     //选择的设备或部件
@@ -256,7 +258,8 @@ export default {
       }
       createDeviceTask(param, res => {
         this.$message.success("创建成功!")
-        this.$router.push({ name: "buildTask" })
+        console.log(this.$route.query.newTaskTypes,1234567)
+        this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
       })
     }
   }

+ 11 - 4
src/views/data_admin/buildTask/addTask/addModelTask.vue

@@ -4,7 +4,7 @@
       <el-button style="float:left;margin-right:20px;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
       <model-folder ref="modelFolder" @change="handleChangeModelFolder" style="margin-right:10px;"></model-folder>
       <my-cascader :isWidth="false" ref="cascader" @change="changeDevice"></my-cascader>
-      <el-button style="float:right;margin-top:1px;" @click="handleClickCreate">创建所选</el-button>
+      <el-button style="float:right;margin-top:1px;" @click="handleClickCreate">{{buttonContent}}</el-button>
     </div>
     <el-row>
       <div class="l-list">
@@ -18,10 +18,10 @@
         </div>
       </div>
       <div class="r-model">
-        <draw-model ref="drawModel" :id="1" :CurrentModelId="CurrentModelId"></draw-model>
+        <draw-model ref="drawModel" :id="1" :CurrentModelId="CurrentModelId" @changeButtonContent="changeButtonContent"></draw-model>
       </div>
     </el-row>
-    <modelTask-dialog :dialogVisible.sync="dialogVisible" :params="params"></modelTask-dialog>
+    <modelTask-dialog :dialogVisible.sync="dialogVisible" :params="params" :newTaskTypes="newTaskTypes"></modelTask-dialog>
   </div>
 </template>
 
@@ -50,7 +50,9 @@ export default {
       modelFileList: [],
       CurrentModelId: '',//模型文件id
       device: '',//设备类别
-      spaceList: []//选中的空间
+      spaceList: [],//选中的空间
+      newTaskTypes: [],
+      buttonContent: "通过模型创建",// 按钮文案
     };
   },
   computed: {
@@ -93,6 +95,7 @@ export default {
       } else {
         this.resetSelected()
       }
+      console.log("handleChangeModelFolder")
     },
     resetSelected(){
       this.modelFileList = []
@@ -112,6 +115,7 @@ export default {
       this.CurrentModelId = file.CurrentModelId
       this.modelFolderId = file.FolderId
       this.modelFileName = file.FloorName
+      this.newTaskTypes = this.$route.query.newTaskTypes
     },
     changeDevice(val){//切换设备类别
       this.device = val.code
@@ -125,6 +129,9 @@ export default {
         return item.data.SourceId
       })
       this.dialogVisible = true
+    },
+    changeButtonContent(val){// 通过判断是否选中模型空间调整文案
+      this.buttonContent = val;
     }
   },
   watch: {

+ 9 - 5
src/views/data_admin/buildTask/index.vue

@@ -21,7 +21,7 @@
 			<tear-table v-else-if="taskType == 'tear'"></tear-table>
 			<replace-table v-else-if="taskType == 'replace'"></replace-table>
 		</div>
-		<add-task :addTaskDialog.sync="addTaskDialog"></add-task>
+		<add-task :addTaskDialog.sync="addTaskDialog" :newTaskTypes="newTaskTypes"></add-task>
 	</div>
 </template>
 
@@ -94,14 +94,18 @@ export default {
 			deviceCategory: '',//设备-设备类型
 			family: '',//设备族
 			buildfloor: ['all'],//建筑楼层
-			taskTypes: ['verification','model'],
+			taskTypes: [],
 			addTaskDialog: false, //是否显示添加任务弹窗
+			newTaskTypes:''
     }
-  },
-  mounted() { },
+	},
+	created(){
+		this.$route.query.newTaskTypes?this.newTaskTypes = this.$route.query.newTaskTypes:this.newTaskTypes = ['verification','model']
+		this.taskTypes = this.newTaskTypes
+	},
   methods: {
 		handleChangeTask(val){//切换任务类型
-			
+			this.newTaskTypes = val
 		},
 		handleChangeModel(val) {//修改模型文件
 			if(val[1]){

+ 2 - 1
src/views/ledger/spacelist/index.vue

@@ -374,7 +374,8 @@ export default {
   .spaceTypes {
     .types {
       float: left;
-      width: calc(100% - 200px);
+      width: 100%;
+      // width: calc(100% - 200px);
     }
     .groupAdd {
       float: left;

+ 8 - 1
src/views/model/file/index.vue

@@ -20,7 +20,9 @@
             </div>
           </div>
           <div class="folder-list">
-            <div class="head">模型文件夹</div>
+            <div class="head">建筑模型文件夹
+              <span>(建议按建筑模型进行命名)</span>
+            </div>
             <ul class="lists">
               <el-scrollbar style="height:100%;">
                 <li @click="openFolder(index,item)" v-for="(item,index) in navigationModel" :key="index"
@@ -595,6 +597,11 @@ export default {
       justify-content: left;
       align-items: center;
       font-weight: bold;
+      span{
+        font-weight: normal;
+        font-size: 12px;
+        color: #606266;
+      }
     }
     .lists {
       width: 100%;

+ 15 - 2
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" :isEdit="isEdit" ref="canvasFun"></canvasFun>
+        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
     </div>
   </div>
 </template>
@@ -29,7 +29,11 @@ export default {
       modelId: '',
       FloorID: '',
       Outline: [],
-      floorData: {}
+      floorData: {},
+      config: {
+        isEdit: false,
+        divide: true
+      }
     };
   },
   props: {
@@ -154,6 +158,10 @@ export default {
     changeAbsorb(isAbsorbing) {
       this.drawMainScene.isAbsorbing = isAbsorbing;
     },
+    // 保存json
+    saveJson() {
+      this.view.saveFloorJson(`${this.floor}.json`)
+    },
     // 撤销
     undo() {
 
@@ -176,6 +184,11 @@ export default {
           this.$refs.canvasFun.sliderVal = n * 10 / this.view.minScale;
         }
       }
+    },
+    "isEdit": {
+      handler(n) {
+        this.config.isEdit = n;
+      }
     }
   }
 };