Browse Source

Merge branch 'master' of http://39.106.8.246:3003/BDTP/adm-frontend

qule 3 years ago
parent
commit
2f3a6e93b7

+ 1 - 2
src/components/old-adm/business_space/lib/uploadFiles.vue

@@ -154,14 +154,13 @@ export default {
                 /* method */
                 "POST",
                 /* target url */
-                "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
+                window.__systemConf.baseServiceUrl + "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
                 /*, async, default to true */
               );
               //xhr.overrideMimeType("application/octet-stream");
               xhr.send(reader.result);
               xhr.onreadystatechange = function () {
                 if (xhr.readyState == 4) {
-                  console.log(xhr)
                   if (xhr.status == 200) {
                     let fileObject = {
                       key: key.split("=")[1],

+ 2 - 2
src/components/old-adm/business_space/lib/uploadImgs.vue

@@ -71,8 +71,8 @@ export default {
   data() {
     return {
       baseUrl: "",
-      imageGetUrl: "/image-service/common/image_get?systemId=dataPlatform",
-      imageUploadUrl: "/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true",
+      imageGetUrl: window.__systemConf.baseServiceUrl + "/image-service/common/image_get?systemId=dataPlatform",
+      imageUploadUrl: window.__systemConf.baseServiceUrl + "/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true",
       imagesArr: []
     };
   },

+ 213 - 0
src/components/old-adm/ready/buildfloor/drawGraphy/checkGraphy.vue

@@ -0,0 +1,213 @@
+<template>
+  <el-dialog id='checkGraphy' title='添加平面图' :visible.sync='checkGraphyVisible' width='500px' @close='handleClose'>
+    <div class='bodys'>
+      <el-cascader
+        :options='options'
+        :show-all-levels='false'
+        @change='handleChange'
+        @active-item-change='handleItemChange'
+        clearable
+        placeholder='请选择模型文件'
+        v-model='casVal'
+      ></el-cascader>
+    </div>
+    <span slot='footer' class='dialog-footer'>
+            <el-button @click='handleClose'>取 消</el-button>
+            <el-button type='primary' @click='bindGraphy'>确 定</el-button>
+        </span>
+  </el-dialog>
+</template>
+<script>
+import drawFloor from './drawFloor'
+import { mapGetters } from 'vuex'
+import FileController from '@/controller/old-adm/fileController'
+import ScanController from '@/controller/old-adm/ScanController'
+
+export default {
+  components: {
+    drawFloor,
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId']),
+  },
+  props: {
+    alreadyRelatedModel: {
+      default: [],
+    },
+  },
+  data() {
+    return {
+      casVal: [],
+      jsonKey: '', //map.josn
+      checkGraphyVisible: false,
+      options: [],
+      floor: {}, // 当前选中的楼层数据
+      modelIdToFloorId: {},
+      key: '',
+    }
+  },
+  methods: {
+    // 弹窗显示
+    showDialog(floor) {
+      this.floor = floor
+      this.checkGraphyVisible = true
+    },
+    // 关闭弹窗
+    handleClose() {
+      this.checkGraphyVisible = false
+      this.casVal = []
+      // this.$refs.drawFloorDialog.clearGraphy()
+    },
+    //上传图片
+    uploadAndSubmit(item) {
+      let file = item.file
+      console.log(file)
+      let reader = new FileReader()
+      let vm = this
+      let fileType = file.name.split('.')
+      let type = fileType[fileType.length - 1]
+      let uploadKey = file.uid
+      reader.onloadend = function () {
+        // 这个事件在读取结束后,无论成功或者失败都会触发
+        if (reader.error) {
+        } else {
+          // document.getElementById("bytesRead").textContent = file.size;
+          // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+          var xhr = new XMLHttpRequest()
+          xhr.open(
+            /* method */ 'POST',
+            /* target url */
+            '/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true&key=' + file.uid + '.' + type
+            /*, async, default to true */
+          )
+          //xhr.overrideMimeType("application/octet-stream");
+          xhr.send(reader.result)
+          xhr.onreadystatechange = function () {
+            if (xhr.readyState == 4) {
+              if (xhr.status == 200) {
+                vm.key = uploadKey + '.' + type
+                vm.jsonKey = ''
+                // vm.$refs.drawFloorDialog.initGraphy(vm.key, 3)
+                //vm.$emit("getKey", file.uid + '.' + type, vm.keyName);
+              }
+            }
+          }
+        }
+      }
+      reader.readAsArrayBuffer(file)
+    },
+    // 更新楼层 平面图文件
+    bindGraphy() {
+      if (!this.jsonKey && !this.key) {
+        this.$message.warning('请选择模型文件')
+        return
+      }
+      if (this.alreadyRelatedModel.indexOf(this.modelIdToFloorId[this.jsonKey]) > -1) {
+        this.$message.warning('此模型已关联该建筑下的楼层')
+        return
+      }
+      let pa = {
+        floorId: this.floor.FloorID,
+        buildingId: this.floor.BuildID,
+        cover: true,
+        currentModelId: this.floor.CurrentModelId
+      }
+      if (this.jsonKey) {
+        pa.id = this.modelIdToFloorId[this.jsonKey]
+        FileController.bindFloorModel(pa).then((res) => {
+          this.$message.success('更新成功')
+          this.handleClose()
+          this.$emit('refresh', this.jsonKey, pa)
+        })
+      }
+      if (this.key) {
+        let Param = {
+          content: [{ id: this.floor.FloorID, infos: { floorMap: this.key } }]
+        }
+        ScanController.manageUpdateFloor(Param).then((res) => {
+          this.$message.success('更新成功')
+          this.handleClose()
+          this.$emit('refresh', this.key)
+        })
+      }
+    },
+    // 点击多级联动
+    handleChange(val) {
+      // this.$refs.drawFloorDialog.initGraphy(val[1], 1)
+      this.jsonKey = val[1]
+      this.key = ''
+    },
+    // 通过id查询文件夹下模型文件
+    handleItemChange(val) {
+      let data = {
+        FolderId: val[0],
+        Status: '4',
+        ProjectId: this.projectId,
+      }
+      FileController.queryFloorList(data).then((res) => {
+        let tempArr = res.Content.map((t) => {
+          this.modelIdToFloorId[t.CurrentModelId] = t.Id
+          return {
+            value: t.CurrentModelId,
+            label: t.FloorName,
+          }
+        })
+        this.pushChild(this.options, tempArr, val[0])
+      })
+    },
+    // 将模型文件list填到相应的文件夹下
+    pushChild(options, arr, Code) {
+      options.map((option) => {
+        if (option.value == Code) {
+          option.children = arr
+        } else {
+          if (option.children) {
+            this.pushChild(option.children, arr, Code)
+          }
+        }
+      })
+    },
+    init() {
+      this.getDirectory()
+    },
+    // 获取文件夹
+    getDirectory() {
+      FileController.queryModel('').then((res) => {
+        this.options = res.Content.map((t) => {
+          return {
+            value: t.Id,
+            label: t.Name,
+            children: [],
+          }
+        })
+      })
+    },
+  },
+  created() {
+    this.init()
+  },
+  watch: {
+    projectId() {
+      this.init()
+    },
+  },
+}
+</script>
+<style lang="less">
+#checkGraphy {
+  .bodys {
+    .upload-demo {
+      display: inline-block;
+    }
+
+    .showBox {
+      box-sizing: border-box;
+      width: 100%;
+      height: 300px;
+      border: 1px #ccc solid;
+      padding: 10px;
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 297 - 0
src/components/old-adm/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -0,0 +1,297 @@
+<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-if="showTools">
+      <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @scale="scale"
+        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
+    </div>
+  </div>
+</template>
+
+<script>
+import { DivideFloorScene, FloorView, Opt } from "@saga-web/cad-engine/lib"
+import { SColor, SPoint } from "@saga-web/draw/lib";
+import canvasFun from "@/components/old-adm/business_space/newGraphy/canvasFun"
+import ScanController from "@/controller/old-adm/ScanController";
+import { EditLineItem } from "@saga-web/cad-engine"
+import { mapGetters } from "vuex";
+export default {
+  components: {
+    canvasFun
+  },
+  data() {
+    return {
+      drawMainScene: null,
+      view: null,
+      dataKey: '',
+      cadWidth: 800,
+      cadHeight: 600,
+      canvasLoading: false,
+      FloorID: '',
+      Outline: [],
+      floorData: {},
+      config: {
+        isEdit: false,
+        divide: true
+      },
+      shadeList: [],
+      type: 1, // 当前图展示类型
+      scaleItem: null, // 比例尺item
+      urlModelId: '', // url中传入的modelid
+    };
+  },
+  props: {
+    isEdit: {
+      default: false
+    },
+    showTools: {
+      default: false
+    },
+    id: {
+      default: 0
+    },
+    dialog: {
+      default: false
+    }
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "projects"]),
+    projectName() {
+      let projectObj = this.projects.find(item => {
+        return item.id == this.projectId
+      })
+      return projectObj ? projectObj.name ? projectObj.name : projectObj.id : this.projectId
+    }
+  },
+  created() {
+    this.FloorID = this.$route.query.FloorID;
+    this.urlModelId = this.$route.query.modelId
+    Opt.sceneMarkColor = new SColor('#00000080');
+    if (!this.dialog) {
+      this.init();
+    }
+  },
+  mounted() {
+    this.cadWidth = document.getElementById(`drawFloor${this.id}`).offsetWidth;
+    this.cadHeight = document.getElementById(`drawFloor${this.id}`).offsetHeight;
+  },
+  methods: {
+    //
+    init() {
+      this.getFloorData();
+    },
+    // 初始化canvas
+    initGraphy(Id, type) {
+      // type=1 => id:模型id
+      // type=2 => id:floormap
+      // type=3 => id:图片的key
+      let that = this;
+      that.type = type;
+      that.clearGraphy()
+      that.drawMainScene = new DivideFloorScene();
+      that.canvasLoading = true;
+      if (type == 1) {
+        that.drawMainScene.getFloorData(`${window.__systemConf.baseServiceUrl}/revit-algorithm/base-graph/query`, { ModelId: Id }).then(res => {
+          that.getGraphtSuc(res)
+        })
+      } else if(type==2){
+        that.drawMainScene.loadUrl(`${window.__systemConf.baseServiceUrl}/image-service/common/file_get?systemId=revit&key=${Id}`).then(res => {
+          that.getGraphtSuc(res)
+        })
+      }else if(type==3){
+        that.drawMainScene.loadImg(`${window.__systemConf.baseServiceUrl}/image-service/common/image_get?systemId=dataPlatform&key=${Id}`, res=>{
+          that.getGraphtSuc(res)
+        })
+      }
+    },
+    // 获取底图成功
+    getGraphtSuc(res) {
+      this.canvasLoading = false;
+      if (res == 'error') {
+        this.FloorMap = '';
+        console.log('数据解析异常');
+        return;
+      }
+      if (res.Result == 'failure') {
+        this.showTools = false;
+        this.$message.warning(res.Message);
+        return;
+      }
+      this.view.scene = this.drawMainScene;
+      this.view.fitSceneToView();
+      this.drawMainScene.isSpaceSelectable = false;
+
+      if (this.type == 3) {
+        this.addScaleItem(this.floorData.properties)
+        this.$emit('getGraphSuc');
+        if (this.floorData.infos && this.floorData.infos.FloorMapShift) {
+          const struct = JSON.parse(this.floorData.infos.FloorMapShift)
+          const x = struct.x;
+          const y = struct.y;
+          if (x != 0 || y != 0) {
+            this.drawMainScene.imgList[0].moveTo(x, y);
+          }
+        }
+      }
+
+      if (this.$refs.canvasFun) {
+        this.view.minScale = this.view.scale;
+        this.$refs.canvasFun.everyScale = this.view.scale;
+      }
+      if (this.floorData.outline && this.floorData.outline.length) {
+        let newArr = this.floorData.outline.map(t => {
+          return new SPoint(t.X, t.Y);
+        })
+        this.drawMainScene.addSceneMark(newArr);
+      }
+        this.$emit('handled', this.floorData.outline && this.floorData.outline.length > 0)
+    },
+    // 获取楼层数据
+    getFloorData() {
+      let pa = {
+        filters: `id='${this.FloorID}'`,
+        // 根据接口调整
+        // cascade: [{ name: 'floorOutline' }]
+      }
+      // 先用 floorQuery 级联 floorOutline  以后与 floorQueryOutline 一块使用
+      const temp = this.urlModelId && this.urlModelId.split('.')[1]
+      if (temp && (temp.toLowerCase() == 'png' || temp.toLowerCase() == 'jpg')) { //底图为图片且已经绑定过图片
+        ScanController.floorQueryAndSign(pa).then(res => {
+          this.floorData = res.content[0];
+          if (this.floorData.infos && this.floorData.infos.floorMap) {
+            let floorMap = this.floorData.infos.floorMap
+            this.initGraphy(floorMap, 3)
+          }
+        })
+      } else {
+        // floorQuery
+        ScanController.floorQueryOutline(pa).then(res => {
+          this.floorData = res.content[0];
+          if (this.floorData.infos && this.floorData.infos.floorMap) {
+            this.getOtherFloorOutLine();
+            let floorMap = this.floorData.infos.floorMap
+            this.initGraphy(floorMap, 2)
+          }
+        })
+      }
+    },
+    // 获取绑定该模型id的其他楼层轮廓线
+    getOtherFloorOutLine() {
+      let modelid = this.floorData.modelId;
+      if (modelid) {
+        let pa = {
+          filters: `modelId='${modelid}'`,
+          cascade: [{ name: 'building' }]
+        }
+        this.shadeList = [];
+        ScanController.floorQueryOutline(pa).then(res => {
+          const temp = res.content.map(t => {
+            if (t.id != this.FloorID) {
+              if ( t.outline && t.outline.length) {
+                let line = t.outline.map(item => {
+                  return new SPoint(item.X, item.Y);
+                })
+                this.shadeList.push(line);
+              }
+              return t
+            }
+          }).filter(item => item);
+          this.drawMainScene.addAllShade(this.shadeList);
+          this.$emit('changeSign', res.content.length > 1, temp);
+        });
+      }
+    },
+    // 添加比例尺item 当楼层图为图片类型时 回显比例尺
+    addScaleItem(data) {
+      this.scaleItem = new EditLineItem(null)
+      this.scaleItem.strokeColor = SColor.Red;
+      this.drawMainScene.addItem(this.scaleItem)
+      if (data && data.line && data.line.length == 2) {
+        this.scaleItem.line = data.line;
+        this.scaleItem.text = data.text;
+        // todo
+        this.scaleItem.pointChange();
+      }
+    },
+    // 清空平面图
+    clearGraphy() {
+      if (this.view) {
+        this.view.scene = null;
+        return
+      }
+      let id = `floorCanvas${this.id}`;
+      this.view = new FloorView(id)
+    },
+    // canvas 获取焦点
+    focus() {
+      document.getElementById(`floorCanvas${this.id}`).focus()
+    },
+    // 工具栏操作
+    // 适配底图到窗口
+    fit() {
+      this.view.fitSceneToView()
+    },
+    // 保存为png
+    savePng() {
+      this.view.saveImage(`${this.projectName}-${this.buildFloorName}.png`, 'png');
+    },
+    // 保存为svg
+    saveSvg() {
+      this.view.saveSceneSvg(`${this.projectName}-${this.buildFloorName}.svg`, 6400, 4800);
+    },
+    // 保存json
+    saveJson() {
+      this.view.saveFloorJson(`${this.projectName}-${this.buildFloorName}.json`)
+    },
+    // 切割划分
+    divide() {
+      this.drawMainScene.isMarking = true;
+    },
+    // 清除切割划分
+    clearDivide() {
+      this.drawMainScene.clearSceneMark()
+    },
+    // 吸附
+    changeAbsorb(isAbsorbing) {
+      this.drawMainScene.isAbsorbing = isAbsorbing;
+    },
+    // 缩放
+    scale(val) {
+      if (!this.view) {
+        return;
+      }
+      let scale = this.view.scale;
+      this.view.scaleByPoint(val / scale, this.cadWidth / 2, this.cadHeight / 2)
+    },
+  },
+  watch: {
+    "view.scale": {
+      handler(n) {
+        if (this.$refs.canvasFun) {
+          let s = n * 10 / this.view.minScale
+          this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s;
+        }
+      }
+    },
+    "isEdit": {
+      handler(n) {
+        this.config.isEdit = n;
+      }
+    }
+  }
+};
+</script>
+<style scoped lang="less">
+.drawFloor {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  .operate {
+    position: absolute;
+    left: 50%;
+    bottom: 20px;
+    transform: translateX(-50%);
+    z-index: 99;
+  }
+}
+</style>

+ 572 - 0
src/components/old-adm/ready/buildfloor/repetitionGraphy.vue

@@ -0,0 +1,572 @@
+<template>
+  <!-- 查看平面图页面 -->
+  <div id='repetitionGraphy'>
+    <div class='buttons'>
+      <el-button icon='el-icon-back' size='mini' @click='backRouter'></el-button>
+      <template v-if="!hasModel">
+        <el-upload class='upload-demo' action='string' :http-request='uploadAndSubmit' :show-file-list='false' v-if="step==-1" accept=".jpg,.png"
+          :before-upload="beforeUpload">
+          <el-button size="mini">{{hasGraph?'替换平面图图片':'上传平面图图片'}}</el-button>
+        </el-upload>
+        <el-button style='float:right;' size='mini' type='primary' v-if="step==0" @click="nextStep" :disabled="nextStepBtnDisable">下一步</el-button>
+        <el-button style='float:right;' size='mini' type='primary' v-if="step==1" @click="nextStep">保存</el-button>
+        <el-button style='float:right;' size='mini' v-if="step==1" @click="lastStep">上一步</el-button>
+      </template>
+      <template v-else>
+        <el-button v-if='!isEdit' size='mini' @click='changeGraphy'>{{hasGraph?'替换模型文件':'关联模型文件'}}</el-button>
+        <el-button v-if='(sign||otherSign)&&!isEdit' size='mini' @click='editGraphy'>编辑平面图</el-button>
+        <el-button v-if='isEdit' size='mini' @click='cancel'>取消</el-button>
+        <el-button v-if='isEdit' size='mini' @click='confirm' type='primary'>确认</el-button>
+        <span :title="repeatTextTips" class="repeatTips" v-if="repeatFloor.length">{{repeatTextTips}}</span>
+      </template>
+      <span style='float:right;' v-if='file.FolderName'>当前对应的模型文件:{{file.FolderName}} - {{file.FloorName}}</span>
+    </div>
+    <!-- 展示图片 -->
+    <div class='drawImg'>
+      <div style="width: 100%;height: 100%;position: relative;" v-if="hasGraph">
+        <drawFloor ref='drawFloor' :isEdit='isEdit' :showTools='true' :id='1' @changeSign='changeSign' @getGraphSuc="getGraphSuc" @handled="repeatHandled"></drawFloor>
+        <div class="stepContainer" v-if="step>-1">
+          <el-steps :active="step" align-center finish-status="success" process-status="process">
+            <el-step title="设定比例尺" :description="stepDes[0]"></el-step>
+            <el-step title="楼层对齐" :description="stepDes[1]"></el-step>
+          </el-steps>
+        </div>
+        <ul class="floorList" v-if="step==1">
+          <template v-if="floorList.length > 1">
+            <li style="border-bottom:1px solid #ccc;text-align: center;padding: 0">选择对齐楼层</li>
+            <li v-for="t in floorList" :key="t.id">
+              <el-radio v-model="floorRadio" :label="t" @change="changeFloor" :disabled="t.id == FloorID">{{t.localId || t.localName}}</el-radio>
+            </li>
+          </template>
+          <template v-else>
+            <li style="text-align: center;padding: 0">
+              暂无对齐楼层
+            </li>
+          </template>
+        </ul>
+      </div>
+      <div style="width: 100%;height: 100%" v-else>
+        <div class="center" style="padding-top: 300px">
+          <i class="icon-wushuju iconfont"></i>暂无平面图
+        </div>
+      </div>
+    </div>
+    <!-- 查看图片弹窗 -->
+    <checkGraphy ref='checkGraphy' @refresh='refresh' :alreadyRelatedModel='alreadyRelatedModel'></checkGraphy>
+    <!-- 设定比例尺弹窗 -->
+    <setScaleDialog ref="setScaleDialog" @textChange="scaleTextChange"></setScaleDialog>
+    <!-- 退出时弹窗提示 -->
+    <backTips ref='backTips' @back="runBack"></backTips>
+  </div>
+</template>
+<script>
+import drawFloor from './drawGraphy/drawFloor'
+import checkGraphy from './drawGraphy/checkGraphy' //查看图片
+import setScaleDialog from '@/components/old-adm/ready/components/setScaleDialog'
+import backTips from '@/components/old-adm/ready/components/backTips'
+
+import ScanController from '@/controller/old-adm/ScanController'
+import FileController from '@/controller/old-adm/fileController'
+import {SItemStatus, SImageShowType } from "@saga-web/cad-engine"
+import { SImageItem } from '@saga-web/graph/lib'
+import { SMathUtil } from "@saga-web/cad-engine/lib/utils/SMathUtil"
+export default {
+  components: {
+    drawFloor,
+    checkGraphy,
+    setScaleDialog,
+    backTips
+  },
+  data() {
+    return {
+      modelId: '', //
+      isEdit: false, // 是否编辑模式
+      FloorID: '',
+      file: {},
+      alreadyRelatedModel: [],
+      sign: false,
+      otherSign: false,
+      hasGraph: false, // 当前楼层是否有平面图
+      hasModel: false, // 项目中时候有模型文件
+      step: -1, // 当前处于第几步 同时为比例尺item判断是否创建的可编辑的依据;能否返回上页的依据
+      key: '', // 当楼层图为图片时图的key
+      stepDes: [
+        '请在图上点击两点绘制线段并标记实际长度',
+        '请移动图片与其他楼层对齐'
+      ], // 描述文字
+      floorList: [], // 当前建筑下所有楼层
+      floorRadio: '', // 当前选中的楼层对象
+      imgService: `${window.__systemConf.baseServiceUrl}/image-service/common/image_get?systemId=dataPlatform&key=`,
+      curImgItem: null, // 对齐的楼层图片
+      scaleItem: null, // 比例尺item
+      baseImgItem: null, // 当前楼层图的图片
+      nextStepBtnDisable: true, // 比例尺item创建标识
+      timeOut: true, // 保存按钮延时3秒可操作
+      repeatFloor: [], // 重复的楼层
+      handled: false,
+    }
+  },
+  created() {
+    this.modelId = this.$route.query.modelId
+    this.FloorID = this.$route.query.FloorID
+    this.BuildID = this.$route.query.BuildID
+    this.BuildName = this.$route.query.BuildName
+    this.FloorName = this.$route.query.FloorName
+    if (this.modelId != '') {
+      this.hasGraph = true;
+      const temp = this.modelId.split('.');
+      if (temp[1] && (temp[1].toLowerCase() == 'png' || temp[1].toLowerCase() == 'jpg')) {
+        // return
+      } else {
+        this.init()
+      }
+    } else {
+      this.init()
+    }
+    this.getCountModel()
+    this.$nextTick(() => {
+      this.$refs.drawFloor.buildFloorName = `${this.BuildName}-${this.FloorName}`
+    })
+  },
+  computed: {
+    repeatTextTips() {
+      let str = `当前楼层与${this.repeatFloor.join('、')}关联同一个平面图`
+      if (!this.handled) {
+        str += `,请通过「编辑平面图」划分当前楼层对应的平面图范围`
+      }
+      return str
+    }
+  },
+  mounted() { },
+  methods: {
+    init() {
+      this.getFloorData()
+    },
+    // 返回路由
+    backRouter() {
+      // 底图为图片  上传完图片后未保存
+      if (this.step > -1) {
+        this.$refs.backTips.showDialog();
+      } else {
+        this.runBack()
+      }
+    },
+    runBack() {
+      this.$router.push({ name: 'buildFloor', query: {buildingId: this.BuildID} })
+    },
+    // 替换模型文件
+    changeGraphy() {
+      this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID, CurrentModelId: this.currentModelId })
+    },
+    // 确认保存
+    confirm() {
+      let sceneMark = this.$refs.drawFloor.drawMainScene.sceneMark,
+        Outline = null
+      if (sceneMark) {
+        if (sceneMark.outLine.length < 3) {
+          this.$message.warning('请添加轮廓线')
+          return
+        }
+        if (!sceneMark.closeFlag) {
+          this.$message.warning('请按回车闭合轮廓线')
+          this.$refs.drawFloor.focus()
+          return
+        }
+        Outline = this.$refs.drawFloor.drawMainScene.sceneMark.outLine
+        Outline = Outline.map((t) => {
+          return {
+            X: t.x.toFixed(2),
+            Y: -t.y.toFixed(2),
+          }
+        })
+      }
+      let pa = {
+        content: [{ id: this.FloorID, outline: Outline }]
+      }
+      if (!Outline) {
+        pa.nullItems = ['outline']
+      }
+      ScanController.floorUpdateOutline(pa).then((res) => {
+        this.isEdit = false
+        this.$message.success('更新成功');
+        this.handled = !!Outline;
+      })
+    },
+    // 取消
+    cancel() {
+      this.isEdit = false
+      this.$refs.drawFloor.init()
+    },
+    // 编辑平面图
+    editGraphy() {
+      this.isEdit = true
+    },
+    // 替换模型文件成功
+    refresh(modelId,pa) {
+      this.modelId = modelId
+      this.hasGraph = true;
+      const temp = this.modelId.split('.');
+      if (temp[1]) {
+        if (temp[1].toLowerCase() != 'png' && temp[1].toLowerCase() != 'jpg') {
+          // do nothing
+        } else {
+          // do nothing
+        }
+      } else {
+        this.key = '';
+        if (pa && pa.id) {
+          this.getFileName(pa.id)
+          this.currentModelId = pa.id;
+        }
+        this.initFromModelId(this.modelId)
+      }
+    },
+    // 获取文件夹名称
+    getFileName(modelId) {
+      if (!modelId) return
+      let pa = {
+        Id: modelId,
+      }
+      FileController.getFileNameById(pa).then((res) => {
+        this.file = res
+      })
+    },
+    // 获取楼层
+    // 标识 无值:初始化进入 有值'next': 下一步进入
+    getFloorData(flag) {
+      let floorParam = {
+        pageSize: 1000,
+        filters: `buildingId='${this.BuildID}'`,
+        orders: 'floorSequenceID desc'
+      }
+      ScanController.floorQueryAndSign(floorParam).then((res) => {
+        this.floorList = res.content.filter(t => t.infos && t.infos.floorMap || t.id == this.FloorID);
+        // todo
+        if (flag && flag == 'next') {
+          this.floorRadio = this.floorList[0];
+          if (this.floorRadio.id != this.FloorID) {
+            this.loadOtherImg(this.floorRadio)
+          }
+        }
+        this.alreadyRelatedModel = res.content.map((t) => {
+          if (t.id != this.FloorID) return t.modelId
+          this.sign = t.Sign > 0
+          this.currentModelId = t.modelId;
+          t.modelId && this.getFileName(t.modelId)
+        }).filter((t) => t)
+      })
+    },
+    changeSign(flag, arr) {
+      this.otherSign = flag;
+      this.repeatFloor = arr.map(t => `${t.building.localName || t.building.name}-${t.localName || t.name}`)
+    },
+    // 统计项目下是否有模型文件
+    getCountModel() {
+      FileController.countModel({ Filters: "Status in [4]" }).then(res => {
+        this.hasModel = res.Count > 0
+      })
+    },
+    //上传图片
+    uploadAndSubmit(item) {
+      let file = item.file
+      let reader = new FileReader()
+      let vm = this
+      let fileType = file.name.split('.')
+      let type = fileType[fileType.length - 1]
+      let uploadKey = file.uid
+      reader.onloadend = function () {
+        // 这个事件在读取结束后,无论成功或者失败都会触发
+        if (reader.error) {
+        } else {
+          // document.getElementById("bytesRead").textContent = file.size;
+          // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+          var xhr = new XMLHttpRequest()
+          xhr.open(
+                    /* method */ 'POST',
+            /* target url */
+            '/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true&key=' + uploadKey + '.' + type
+            /*, async, default to true */
+          )
+          //xhr.overrideMimeType("application/octet-stream");
+          xhr.send(reader.result)
+          xhr.onreadystatechange = function () {
+            if (xhr.readyState == 4) {
+              if (xhr.status == 200) {
+                vm.key = uploadKey + '.' + type
+                // 将图片展示
+                vm.refresh(uploadKey + '.' + type)
+                // 设置步骤为第一步
+                vm.step = 0;
+                // watch中不会走到initGraph,所以手动触发
+                vm.$nextTick(() => {
+                  vm.initFromModelId(uploadKey + '.' + type)
+                })
+                // 设定保存按钮不可操作
+                this.timeOut = true;
+              }
+            }
+          }
+        }
+      }
+      reader.readAsArrayBuffer(file)
+    },
+    // 上传前判断
+    beforeUpload(file) {
+      // 拿到当前上传图片的name,判断其后缀名是否符合
+      let type = this.isImage(file.name);
+      if (!type) {
+        this.$message.error('仅支持png、jpg格式的图片');
+        return false
+      }
+      return true
+    },
+    // 封装一个判断图片文件后缀名的方法
+    isImage(fileName) {
+      if (typeof fileName !== 'string') return;
+      let name = fileName.toLowerCase();
+      return name.endsWith('.png') || name.endsWith('.jpg');
+    },
+    // 更新楼层key 为图片,同时更新比例尺
+    updateFloorKey() {
+      const scaleItem = this.$refs.drawFloor.scaleItem;
+      // 比例尺坐标处理,当底图被对齐操作后,需要跟随底图改变坐标
+      const line = scaleItem.line.map(t => {
+        return { x: t.x + this.baseImgItem.x, y: t.y + this.baseImgItem.y }
+      })
+      // 计算放缩比例
+      const proDis = SMathUtil.pointDistance(line[0].x, line[0].y, line[1].x, line[1].y)
+      const proText = scaleItem.text.substring(0, scaleItem.text.length - 3);
+      const proScale = proDis / proText;
+      let Param = {
+        content: [{
+          id: this.FloorID,
+          infos: {
+            floorMap: this.key,
+            floorMapRatio: proScale,
+            floorMapShift: JSON.stringify({ x: this.baseImgItem.x, y: this.baseImgItem.y })
+          },
+          properties: {
+            line: line,
+            text: scaleItem.text
+          }
+        }],
+      }
+      ScanController.manageUpdateFloor(Param).then((res) => {
+        this.$message.success('更新成功')
+        this.step = -1;
+        this.baseImgItem.globalAlpha = 1
+        this.baseImgItem.moveable = false;
+        scaleItem.show()
+        this.removeLast()
+        this.$refs.drawFloor.fit()
+      })
+    },
+    // 根据modelid初始化
+    initFromModelId(id) {
+      const temp = id.split('.')[1];
+      if (temp) {
+        if (temp.toLowerCase() == 'png' || temp.toLowerCase() == 'jpg') {
+          this.$refs.drawFloor.initGraphy(id, 3)
+        } else {
+          this.$refs.drawFloor.initGraphy(id, 2)
+        }
+      } else {
+        this.$refs.drawFloor.initGraphy(id, 1)
+      }
+    },
+    // 上一步
+    lastStep() {
+      this.step = 0;
+      this.$refs.drawFloor.scaleItem.show()
+      this.baseImgItem.globalAlpha = 1
+      this.baseImgItem.moveable = false;
+      this.removeLast()
+    },
+    // 下一步||保存
+    nextStep() {
+      this.baseImgItem = this.$refs.drawFloor.drawMainScene.imgList[0]
+      this.baseImgItem.globalAlpha = 0.5
+      this.baseImgItem.moveable = true;
+      // 下一步
+      if (this.step == 0) {
+        this.step = 1;
+        this.$refs.drawFloor.scaleItem.hide();
+        // 获取楼层列表
+        this.getFloorData('next')
+        // 延时3秒可操作性保存按钮
+        setTimeout(() => {
+          this.timeOut = false
+        }, 3000)
+      } else if (this.step == 1) {
+        // 保存
+        this.updateFloorKey();
+      }
+    },
+    // 加载图成功 仅在底图为图片时返回成功
+    getGraphSuc() {
+      const scaleItem = this.$refs.drawFloor.scaleItem
+      if (this.step == 0) {
+        scaleItem.status = SItemStatus.Create;
+        this.$refs.drawFloor.drawMainScene.grabItem = scaleItem;
+        scaleItem.connect('changText', this, this.changeText)
+        scaleItem.moveable = true;
+        this.clearScaleData(scaleItem);
+      } else if (this.step == -1) {
+        scaleItem.status = SItemStatus.Normal;
+      }
+    },
+    // 修改比例尺文字
+    changeText(t, e) {
+      this.$refs.setScaleDialog.showDialog(t)
+    },
+    // 文本修改
+    scaleTextChange(v) {
+      if (v > 0) {
+        this.nextStepBtnDisable = false
+      }
+    },
+    // 第二部楼层修改
+    changeFloor(v) {
+      // v->当前改为的楼层对象
+      this.removeLast();
+      this.loadOtherImg(v)
+    },
+    // 加载其他楼层图片
+    loadOtherImg(v) {
+      if (v.infos && v.infos.floorMap) {
+        const temp = this.modelId.split('.');
+        if (temp[1] && (temp[1].toLowerCase() == 'png' || temp[1].toLowerCase() == 'jpg')) {
+          const url = this.imgService + v.infos.floorMap
+          this.curImgItem = new SImageItem(null, url);
+          this.curImgItem.enabled = false;
+          this.curImgItem.showType = SImageShowType.AutoFit;
+          if (v.properties) {
+            try {
+              const point = JSON.parse(v.infos.floorMapShift)
+              // 计算两个比例尺差距
+              const scaleItem = this.$refs.drawFloor.scaleItem
+              this.curImgItem.zOrder = scaleItem.zOrder - 1;
+              const r = this.calScaleGap(v.properties, scaleItem);
+              if (r != 1) {
+                this.$message.warning('比例尺相差较大,可以返回上一步修改比例尺')
+              }
+              this.curImgItem.showType == SImageShowType.Full;
+              this.curImgItem.moveTo(point.x, point.y);
+            } catch (err) {
+              console.log(err);
+            }
+          }
+          this.$refs.drawFloor.drawMainScene.addItem(this.curImgItem);
+          this.$refs.drawFloor.fit()
+        }
+      }
+    },
+    // 清除上一张底图
+    removeLast() {
+      if (this.curImgItem) {
+        this.$refs.drawFloor.drawMainScene.removeItem(this.curImgItem);
+        this.curImgItem = null;
+        this.$refs.drawFloor.view.update()
+      }
+    },
+    // 清空比例尺数据
+    clearScaleData(scaleItem) {
+      scaleItem.line = [];
+      scaleItem.pointChange();
+      scaleItem.text = '0 mm';
+    },
+    // 计算两个比例尺差距
+    calScaleGap(pro, item) {
+      // pro -> 楼层的properties
+      // item -> 当前的比例尺item
+      let result = 1
+      if (pro.line.length && pro.text) {
+        try {
+          const proDis = SMathUtil.pointDistance(pro.line[0].x, pro.line[0].y, pro.line[1].x, pro.line[1].y)
+          const proText = pro.Text.substring(0, pro.text.length - 3);
+          const proScale = proDis / proText;
+          const itemDis = SMathUtil.pointDistance(item.line[0].x, item.line[0].y, item.line[1].x, item.line[1].y)
+          const itemText = item.text.substring(0, item.text.length - 3);
+          const itemScale = itemDis / itemText;
+          result = (proScale / itemScale).toFixed()
+        } catch (err) {
+          console.log(err);
+        }
+      }
+      return result;
+    },
+    // 是否处理过平面图重复
+    repeatHandled(flag) {
+      this.handled = flag;
+    }
+  },
+  watch: {
+    // modelId(n, o) {
+    //   if (o && n != o) {
+    //     if (n) {
+    //       // 替换的时候需要走
+    //       this.$nextTick(() => {
+    //         this.initFromModelId(n)
+    //       })
+    //     }
+    //   }
+    // },
+  },
+}
+</script>
+<style lang="less">
+#repetitionGraphy {
+  width: 100%;
+  height: 100%;
+  background: #fff;
+  position: relative;
+  padding: 10px;
+  box-sizing: border-box;
+  .repeatTips {
+    display: inline-block;
+    max-width: 800px;
+    font-size: 12px;
+    overflow: hidden;
+    line-height: 1;
+    margin-left: 10px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    color: red;
+  }
+  .drawImg {
+    width: 100%;
+    margin-top: 10px;
+    height: calc(100% - 40px);
+  }
+  .upload-demo {
+    display: inline-block;
+  }
+  .stepContainer {
+    width: 100%;
+    position: absolute;
+    top: 0;
+    left: 50%;
+    margin-left: -50%;
+    z-index: 9;
+    background-color: #fff;
+  }
+  .floorList {
+    position: absolute;
+    width: 100px;
+    max-height: 250px;
+    overflow-x: hidden;
+    overflow-y: auto;
+    left: 40px;
+    top: 200px;
+    z-index: 10;
+    background: #fff;
+    border: 1px solid #ccc;
+    li {
+      box-sizing: border-box;
+      padding: 0 10px;
+      width: 100%;
+    }
+  }
+}
+</style>

+ 0 - 1
src/components/old-adm/ready/components/addBuild.vue

@@ -205,7 +205,6 @@ export default {
       });
     },
     changeItem(val) {
-      console.log(val)
       let _key = Object.keys(val)[0] + '';
       this.form[_key] = val[_key];
 

+ 31 - 0
src/components/old-adm/ready/components/backTips.vue

@@ -0,0 +1,31 @@
+<template>
+  <el-dialog title="提示" :visible.sync="dialogVis" width="500px" id="tipsDialog" :close-on-click-modal='false'>
+    <el-row>
+      <div style="line-height:32px;">上传图片未保存,退出后上传图片将失效。是否确认退出?</div>
+    </el-row>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="dialogVis=false">取消</el-button>
+      <el-button size="small" type="primary" @click="confirm">确认</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      dialogVis: false,
+      scaleInput: '',
+      item: '', // 当前修改的item
+    }
+  },
+  methods: {
+    showDialog(v) {
+      this.dialogVis = true
+    },
+    confirm() {
+      this.dialogVis = false;
+      this.$emit('back');
+    }
+  }
+}
+</script>

+ 4 - 3
src/components/old-adm/ready/components/formItems.vue

@@ -10,7 +10,7 @@
     >
       <div
         v-for="item in InforsList"
-        :key="item.infoPointCode"
+        :key="item.id"
         style="width: 50%; display: inline-block"
       >
         <el-form-item
@@ -111,8 +111,8 @@
             v-else-if="item.dataType == 'ENUM'"
           >
             <el-option
-              v-for="op in item.options"
-              :key="op.code"
+              v-for="(op, index) in item.options"
+              :key="index"
               :label="op.name"
               :value="op.code"
             ></el-option>
@@ -204,6 +204,7 @@ export default {
           }
         }).filter(_c=>{return !!_c;});
         this.InforsList = arr;
+        console.log('[ arr ] >', arr)
       });
     },
     submitForm(call) {

+ 57 - 0
src/components/old-adm/ready/components/setScaleDialog.vue

@@ -0,0 +1,57 @@
+<template>
+  <el-dialog title="设定比例尺" :visible.sync="dialogVis" width="500px" id="scaleDialog" :close-on-click-modal='false'>
+    <el-row>
+      <div style="line-height:32px;">设定比例尺长度 : </div>
+      <div style="width:70%">
+        <el-input-number v-model="scaleInput" controls-position="right" :min="0"></el-input-number> mm
+      </div>
+    </el-row>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="dialogVis=false">取消</el-button>
+      <el-button size="small" type="primary" @click="confirm">确认</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      dialogVis: false,
+      scaleInput: '',
+      item: '', // 当前修改的item
+    }
+  },
+  methods: {
+    showDialog(v) {
+      this.dialogVis = true
+      this.item = v;
+      this.scaleInput = v.text.substring(0, v.text.length - 3);
+    },
+    confirm() {
+      this.item.text = this.scaleInput + ' mm';
+      this.item.update()
+      this.$emit('textChange', this.scaleInput)
+      this.dialogVis = false
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+#scaleDialog {
+  .el-row{
+    height: 50px;
+    max-height: 200px;
+    overflow-y: auto;
+    overflow-x: hidden;
+  }
+  .el-row > div {
+    float: left;
+  }
+  .el-row > div + div {
+    margin-left: 10px;
+  }
+  /deep/ .el-input__inner {
+    vertical-align: baseline;
+  }
+}
+</style>

+ 161 - 81
src/controller/old-adm/ScanController.ts

@@ -29,9 +29,12 @@ class ScanController {
     *@return {*}
   */
   static async BeatchQueryParam(params, fn) {
-    let data = params.data
-    const res = await ScanController.http.postRequest(`/rwd/iot/data/current?projectId=${params.projectId}&groupCode=${params.groupCode}&appId=${params.appId}`, data)
-    return fn ? fn(res) : res
+    let data = params.data;
+    const res = await ScanController.http.postRequest(
+      `/rwd/iot/data/current?projectId=${params.projectId}&groupCode=${params.groupCode}&appId=${params.appId}`,
+      data
+    );
+    return fn ? fn(res) : res;
   }
   /** 
 
@@ -42,7 +45,10 @@ class ScanController {
   *@return {*}
   */
   static async countPartsDie(params) {
-    const res = await ScanController.http.postRequest('/equip-component/equip-query/count', params)
+    const res = await ScanController.http.postRequest(
+      "/equip-component/equip-query/count",
+      params
+    );
   }
   /**
 
@@ -53,7 +59,10 @@ class ScanController {
   *@return {*}
   */
   static async createPropertys(params) {
-    return await ScanController.http.postRequest('/equip-component/equip-query/creat-propertys', params)
+    return await ScanController.http.postRequest(
+      "/equip-component/equip-query/creat-propertys",
+      params
+    );
   }
   /**
 
@@ -63,9 +72,12 @@ class ScanController {
 
   *@return {*}
   */
-    static async deleteProperty(params) {
-      return await ScanController.http.postRequest('/datacenter/object/property/delete', params)
-    }
+  static async deleteProperty(params) {
+    return await ScanController.http.postRequest(
+      "/datacenter/object/property/delete",
+      params
+    );
+  }
   /**
 
   *@description: 查询资产 同时关联设备信息
@@ -74,41 +86,56 @@ class ScanController {
 
   *@return {*}
   */
-    static async propertyLinkEq(params) {
-      return await ScanController.http.postRequest('/equip-component/property/property-query', params)
-    }
+  static async propertyLinkEq(params) {
+    return await ScanController.http.postRequest(
+      "/equip-component/property/property-query",
+      params
+    );
+  }
   /** 
   @description: 修改资产的附件功能
   @param {*}
   @return {*}
   */
-    static async propertyUpdate(params) {
-      return await ScanController.http.postRequest('/equip-component/property/update', params)
-    }
+  static async propertyUpdate(params) {
+    return await ScanController.http.postRequest(
+      "/equip-component/property/update",
+      params
+    );
+  }
   /**
-  *@description: 查询资产
-  *@param {*}
-  *@return {*}
-  */
-    static async queryProperty(params) {
-      return await ScanController.http.postRequest('/datacenter/object/property/query', params)
-    }
+   *@description: 查询资产
+   *@param {*}
+   *@return {*}
+   */
+  static async queryProperty(params) {
+    return await ScanController.http.postRequest(
+      "/datacenter/object/property/query",
+      params
+    );
+  }
   /**
-  *@description: 更新资产信息
-  *@param {*}
-  *@return {*}
-  */
-    static async updateProperty(params) {
-      return await ScanController.http.postRequest('/datacenter/object/property/update', params)
-    }
+   *@description: 更新资产信息
+   *@param {*}
+   *@return {*}
+   */
+  static async updateProperty(params) {
+    return await ScanController.http.postRequest(
+      "/datacenter/object/property/update",
+      params
+    );
+  }
   /**
-    *@description: 删除系统信息
-    *@param {*}
-    *@return {*}
-  */
-    static async deleteGeneralSys(params) {
-      return await ScanController.http.postRequest('/datacenter/object/general-system/delete', params)
-    }
+   *@description: 删除系统信息
+   *@param {*}
+   *@return {*}
+   */
+  static async deleteGeneralSys(params) {
+    return await ScanController.http.postRequest(
+      "/datacenter/object/general-system/delete",
+      params
+    );
+  }
   /**
 
   *@description: 更新系统信息
@@ -116,7 +143,10 @@ class ScanController {
   *@return {*}
   */
   static async updateGeneralSys(params) {
-    return await ScanController.http.postRequest('/datacenter/object/general-system/update', params)
+    return await ScanController.http.postRequest(
+      "/datacenter/object/general-system/update",
+      params
+    );
   }
   /**
   @description: 创建资产所需(Family族id3位编码)-根据设备类型(4位编码)或部件类型(6位编码)查询,!!设备与设备族的关系
@@ -124,7 +154,10 @@ class ScanController {
   @return {*}
   */
   static async getEquipBelongs(params) {
-    return await ScanController.http.postRequest('/datacenter/dict/family/query', params)
+    return await ScanController.http.postRequest(
+      "/datacenter/dict/family/query",
+      params
+    );
   }
 
   /**
@@ -132,56 +165,74 @@ class ScanController {
   @param {*}
   @return {*}
   */
-    static async buildingQuery(params) {
-      return await ScanController.http.postRequest('/datacenter/object/building/query', params)
-    }
-    /**
+  static async buildingQuery(params) {
+    return await ScanController.http.postRequest(
+      "/datacenter/object/building/query",
+      params
+    );
+  }
+  /**
   @description: 关系-竖井所在建筑
   @param {*}
   @return {*}
   */
-    static async shaftLinkBuild(params) {
-      return await ScanController.http.postRequest('/datacenter/rel/sh-in-bd/link-bd', params)
-    }
-    /** 
-  *@description: 查询系统信息 - 建筑楼层 - 系统一对多
-  *@param {*} params
-  *@return {*}
-  */
+  static async shaftLinkBuild(params) {
+    return await ScanController.http.postRequest(
+      "/datacenter/rel/sh-in-bd/link-bd",
+      params
+    );
+  }
+  /**
+   *@description: 查询系统信息 - 建筑楼层 - 系统一对多
+   *@param {*} params
+   *@return {*}
+   */
   static async querySysLinkBuild(params, fn) {
-    let url = '/datacenter/object/general-system/query-new';
+    let url = "/datacenter/object/general-system/query-new";
     if (params.buildingId) {
-      url += `?buildingId=${params.buildingId}`
+      url += `?buildingId=${params.buildingId}`;
     }
     if (params.floorId) {
-      url += `&floorId=${params.floorId}`
+      url += `&floorId=${params.floorId}`;
     }
     const res = await ScanController.http.postRequest(url, params);
-    return fn ? fn(res) : res
+    return fn ? fn(res) : res;
   }
   static async countGeneralSys(params: any, fn: any) {
-    const res = await ScanController.http.postRequest('/datacenter/object/general-system/count', params)
-    return fn ? fn(res) : res
+    const res = await ScanController.http.postRequest(
+      "/datacenter/object/general-system/count",
+      params
+    );
+    return fn ? fn(res) : res;
   }
   /**
-  *@description: 获取楼层信息
-  *@param {*}
-  *@return {*}
-  */
+   *@description: 获取楼层信息
+   *@param {*}
+   *@return {*}
+   */
   static async getFloorMsgByFloorID(params?: any) {
-    return await ScanController.http.postRequest('/datacenter/object/floor/query', params)
+    return await ScanController.http.postRequest(
+      "/datacenter/object/floor/query",
+      params
+    );
   }
   /**
-    *@description: //设备清单 - 查询系统关联专业 - 查询系统信息 - 查询系统所属专业类型
-    *@param {*}
-    *@return {*}
-  */ 
+   *@description: //设备清单 - 查询系统关联专业 - 查询系统信息 - 查询系统所属专业类型
+   *@param {*}
+   *@return {*}
+   */
   static async queryLinkSys(params) {
-    return await ScanController.http.postRequest('/datacenter/object/general-system/query', params)
+    return await ScanController.http.postRequest(
+      "/datacenter/object/general-system/query",
+      params
+    );
   }
   static async getAllProject(params, fn) {
-    const res = await ScanController.http.postRequest('/datacenter/object/project/query/obj', params)
-    return fn ? fn(res) : res
+    const res = await ScanController.http.postRequest(
+      "/datacenter/object/project/query/obj",
+      params
+    );
+    return fn ? fn(res) : res;
   }
 
   /**
@@ -189,28 +240,40 @@ class ScanController {
    * @param {*} params
    * @param {*} fn
    * @return {*}
-   */  
+   */
   static async sysRelateBuild(params, fn) {
-    const res = await ScanController.http.postRequest('/datacenter/rel/sy-in-bd/link-bd', params);
-    return fn ? fn(res) : res
+    const res = await ScanController.http.postRequest(
+      "/datacenter/rel/sy-in-bd/link-bd",
+      params
+    );
+    return fn ? fn(res) : res;
   }
   /**
    * @description: 创建系统所在建筑关系,系统一对多,覆盖
    * @param {*} params
    * @param {*} fn
    * @return {*}
-   */  
+   */
   static async sysRelateFloor(params, fn) {
-    const res = await ScanController.http.postRequest('/datacenter/rel/sy-in-fl/link-fl', params);
-    return fn ? fn(res) : res
+    const res = await ScanController.http.postRequest(
+      "/datacenter/rel/sy-in-fl/link-fl",
+      params
+    );
+    return fn ? fn(res) : res;
   }
   static async getEquipInSys(params, fn) {
-    const res = await ScanController.http.postRequest(`/equip-component/equip-query/sys-equip`, params)
-    return fn ? fn(res) : res
+    const res = await ScanController.http.postRequest(
+      `/equip-component/equip-query/sys-equip`,
+      params
+    );
+    return fn ? fn(res) : res;
   }
   static async sysLinkEquip(params, fn) {
-    const res = await ScanController.http.postRequest(`/datacenter/rel/sy-in-eq/link-sy-eq`, params)
-    return fn ? fn(res) : res
+    const res = await ScanController.http.postRequest(
+      `/datacenter/rel/sy-in-eq/link-sy-eq`,
+      params
+    );
+    return fn ? fn(res) : res;
   }
   /**
    * 设备清单 - 更新设备
@@ -228,7 +291,7 @@ class ScanController {
       datacenter_pre + "/sy-in-eq/unlinks-sy-eq",
       params
     );
-    return fn ? fn(res) : res
+    return fn ? fn(res) : res;
   }
   static async zoneQuery() {}
   static async TypePartsDie() {}
@@ -296,7 +359,7 @@ class ScanController {
    */
   static async deleteBuildInfo(params) {
     return await this.http.postRequest(
-      floor_pre + "/building/single/delete",
+      object_pre + "/building/single/delete",
       params
     );
   }
@@ -327,7 +390,24 @@ class ScanController {
       params
     );
   }
+  /**
+   * 建筑楼层管理-修改楼层
+   */
+  static async manageUpdateFloor(params) {
+    return await this.http.postRequest(floor_pre + "/update", params);
+  }
+  /**
+   * 楼层接口-----更新楼层轮廓
+   */
+  static async floorUpdateOutline(params) {
+    return await this.http.postRequest(floor_pre + "/update-outline", params);
+  }
+  /**
+   * 楼层接口-----查询楼层轮廓
+   */
+  static async floorQueryOutline(params) {
+    return await this.http.postRequest(floor_pre + "/query-outline", params);
+  }
 }
 
-
-export default ScanController;
+export default ScanController;

+ 26 - 13
src/controller/old-adm/dicController.ts

@@ -1,4 +1,5 @@
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
+import { dict_pre } from "./preTypes";
 class Dic {
   static http = new baseHttpUtils();
 
@@ -6,32 +7,44 @@ class Dic {
    * @description: all - 查询数据字典 --列表表头 api/dict
    * @param {*} params
    * @return {*}
-   */  
+   */
   static async getDataDictionary(params, fn) {
     const res = await Dic.http.postRequest(`/datacenter/dict/query`, params);
-    return fn ? fn(res) : res
+    return fn ? fn(res) : res;
   }
 
   /**
    * @description: 统计-根据条件统计返回信息点
    * @param {*} params
    * @return {*}
-   */  
+   */
   static async deliveredInfos(params, fn) {
-    const res = await Dic.http.postRequest('/equip-component/dict/delivered/infos', params)
-    return fn ? fn(res) : res
+    const res = await Dic.http.postRequest(
+      "/equip-component/dict/delivered/infos",
+      params
+    );
+    return fn ? fn(res) : res;
   }
-  static async getEquipLkSys() {}
-  
   /**
-  *  @description: 头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
-  *  @param {*}
-  *  @return {*}
-  */
+   * 字典-项目下已有的设备类型带系统
+   * @param params
+   * @returns
+   */
+  static async getEquipLkSys(params) {
+    return await Dic.http.postRequest(
+      dict_pre + "/system/equip/category",
+      params
+    );
+  }
+
+  /**
+   *  @description: 头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
+   *  @param {*}
+   *  @return {*}
+   */
   static async queryPhysicsAllType(params) {
-    return await Dic.http.postRequest('/datacenter/dict/category', params)
+    return await Dic.http.postRequest("/datacenter/dict/category", params);
   }
-  
 }
 
 export default Dic;

+ 79 - 0
src/controller/old-adm/fileController.ts

@@ -0,0 +1,79 @@
+import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
+import { model_pre } from "./preTypes";
+class FileController {
+  static http = new baseHttpUtils();
+
+  /**
+   * 根据模型id 获取模型文件夹及文件名
+   * @param params
+   * @returns
+   */
+  static async getFileNameById(params) {
+    return await this.http.postRequest(
+      model_pre + "/model-folder/get-name",
+      params
+    );
+  }
+  /**
+   * 根据条件查询统计数量
+   * @param params
+   * @returns
+   */
+  static async countModel(params) {
+    return await this.http.postRequest(model_pre + "/model-file/count", params);
+  }
+  /**
+   * 楼层与平面图绑定
+   * @param params
+   * @returns
+   */
+  static async bindFloorModel(params) {
+    return await this.http.postRequest(model_pre + "/model-file/bind", params);
+  }
+  /**
+   * 查询模型文件夹下的所有模型文件
+   * @param params
+   * @returns
+   */
+  static async queryFloorList(data) {
+    let Filters = `FolderId='${data.FolderId}'`;
+    if (data.FloorName) {
+      Filters = `FolderId='${data.FolderId}';FloorName='${data.FloorName}';ProjectId='${data.ProjectId}'`;
+    }
+    if (data.Status) {
+      Filters += `;Status in [${data.Status}]`;
+    }
+    let params = {
+      Filters: Filters,
+      PageNumber: 1,
+      PageSize: 500,
+    };
+    return await this.http.postRequest(
+      model_pre + "/model-file/query-list",
+      params
+    );
+  }
+  /**
+   * 查询模型文件夹
+   * @param params
+   * @returns
+   */
+  static async queryModel(Name) {
+    let data = null;
+    if (Name) {
+      // 单个查询
+      data = {
+        Filters: `Name='${Name}'`,
+        Orders: "Name asc",
+      };
+    } else {
+      // 多个查询
+      data = {
+        Orders: "Name asc",
+      };
+    }
+    return await this.http.postRequest(model_pre + "/model-folder/query", data);
+  }
+}
+
+export default FileController;

+ 2 - 0
src/controller/old-adm/preTypes.ts

@@ -10,3 +10,5 @@ export const equipcomponentdic_pre = `${equipcomponent_pre}/dict`;
 export const graphhic_pre = `${datacenter_pre}/graphic`;
 
 export const floor_pre = `${object_pre}/floor`;
+
+export const model_pre = "/revit-algorithm";

+ 8 - 0
src/router/system.js

@@ -12,6 +12,8 @@ import facilityLedger from "@/components/old-adm/ledger/facility/index";
 import systemLedger from '@/components/old-adm/ledger/system/index';
 import batchPointAssets from '@/components/old-adm/ledger/facility/batchPoint' //批量维护设备位置
 import buildFloor from '@/components/old-adm/ready/buildfloor/index'
+import repetitionGraphy from '@/components/old-adm/ready/buildfloor/repetitionGraphy'
+
 
 // 全部关系总览
 import overView from '@/components/old-adm/relation/overview'
@@ -46,6 +48,12 @@ export default [
         meta: {keepAlive: false, breadcrumbs: [{label: '建筑楼层管理'}]}
       },
       {
+        path: 'repetitionGraphy',
+        name: 'repetitionGraphy',
+        component: repetitionGraphy,
+        meta: {keepAlive: false, breadcrumbs: [{label: '建筑楼层管理', path: '/ready/buildfloor'}, {label: '平面图维护'}]}
+      },
+      {
         path: "/ledger/facility",
         name: "facilityLedger",
         component: facilityLedger,