chuwu 6 年之前
父节点
当前提交
65a1ed05c1
共有 32 个文件被更改,包括 7113 次插入32 次删除
  1. 766 0
      src/components/business_space/dialogs/addDialog/businessDialog.vue
  2. 836 0
      src/components/business_space/dialogs/addDialog/dialogAssets.vue
  3. 955 0
      src/components/business_space/dialogs/addDialog/dialogDevice.vue
  4. 862 0
      src/components/business_space/dialogs/addDialog/dialogSystem.vue
  5. 344 0
      src/components/business_space/dialogs/changeRea.vue
  6. 200 0
      src/components/business_space/dialogs/detailsDialog.vue
  7. 143 0
      src/components/business_space/dialogs/facilityDialog.vue
  8. 140 0
      src/components/business_space/dialogs/influenceDialog.vue
  9. 50 0
      src/components/business_space/dialogs/list/filesDialog.vue
  10. 162 0
      src/components/business_space/dialogs/list/firm.vue
  11. 187 0
      src/components/business_space/dialogs/list/guaranteeDialog.vue
  12. 184 0
      src/components/business_space/dialogs/list/insurerDialog.vue
  13. 184 0
      src/components/business_space/dialogs/list/maintainerDialog.vue
  14. 88 0
      src/components/business_space/dialogs/list/paramDetails.vue
  15. 141 0
      src/components/business_space/dialogs/list/picDialog.vue
  16. 183 0
      src/components/business_space/dialogs/list/supplierDialog.vue
  17. 157 0
      src/components/business_space/dialogs/list/supplyDialog.vue
  18. 313 0
      src/components/business_space/dialogs/list/systemType.vue
  19. 62 0
      src/components/business_space/dialogs/list/uploadImgDialog.vue
  20. 163 0
      src/components/business_space/dialogs/noModelDialog.vue
  21. 57 0
      src/components/business_space/dialogs/notRelated.vue
  22. 1 0
      src/components/config_point/cut_string.vue
  23. 1 1
      src/components/config_point/find_keyword.vue
  24. 7 0
      src/fetch/point_http.js
  25. 5 2
      src/router/sagacloud.js
  26. 3 1
      src/store/index.js
  27. 29 0
      src/store/moudles/proMess.js
  28. 463 0
      src/utils/scan/tools.js
  29. 375 0
      src/views/business_space/admin/index.vue
  30. 36 20
      src/views/point/config_point/steps/step1.vue
  31. 16 8
      src/views/point/config_point/steps/step3.vue
  32. 0 0
      src/views/project_setting/collection_setting/index.vue

+ 766 - 0
src/components/business_space/dialogs/addDialog/businessDialog.vue

@@ -0,0 +1,766 @@
+<!--
+    上传文件的弹窗
+-->
+
+<template>
+  <div v-show="dialog.addDevice">
+    <el-dialog
+      :title="title"
+      :center="isCenter"
+      :visible.sync="dialog.addDevice"
+      :width="width"
+      :fullscreen="isFull"
+    >
+      <div id="addDevice">
+        <div v-show="!isCenter">
+          <my-cascader @change="changeCader"></my-cascader>
+        </div>
+        <div v-if="isCenter">
+          <div>
+            <div class="hanson-bar" style="overflow:hidden;">
+              <el-button
+                style="float:right;"
+                size="small"
+                @click="undo"
+                icon="iconfont icon-undo"
+              >撤销</el-button>
+              <el-button
+                style="float:right;"
+                size="small"
+                @click="reset"
+                icon="iconfont icon-shuaxin"
+              >刷新</el-button>
+              <el-button style="float:right;" size="small" @click="addMain">增加</el-button>
+              <el-input
+                v-model="addNum"
+                placeholder="增加个数"
+                style="width:90px;float:right;"
+                size="small"
+              ></el-input>
+            </div>
+            <div v-show="main && main.length" id="myHandson" ref="myHandson"></div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="addSpace">添加业务空间</el-button>
+      </span>
+    </el-dialog>
+    <qrcode :dialog="myDialog" :addBody="true" ref="qrcode"></qrcode>
+    <firm ref="firm" :dialog="myDialog"></firm>
+    <supply-dialog ref="supply" :dialog="myDialog"></supply-dialog>
+    <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
+    <guarantee-dialog ref="guarantee" :dialog="myDialog"></guarantee-dialog>
+    <upload-files-dialog
+      ref="upload"
+      @changeFile="fileChange"
+      :keysArr="filesArr"
+      :dialog="myDialog"
+    ></upload-files-dialog>
+    <upload-img-dialog @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
+    <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
+    <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
+    <pic-dialog :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
+  </div>
+</template>
+<script>
+
+import myCascader from "@/components/lib/cascaders/assets";
+import hansonTable from "@/components/dialogHanson/addDevice";
+import { getSpaceHeader } from "@/api/request";
+import tools from "@/assets/js/tools";
+import qrcode from "@/components/lib/qrcode";
+import firm from "@/components/dialogs/list/firm";
+import supplyDialog from "@/components/dialogs/list/supplyDialog";
+import supplierDialog from "@/components/dialogs/list/supplierDialog";
+import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
+import insurerDialog from "@/components/dialogs/list/insurerDialog";
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
+import picDialog from "@/components/dialogs/list/picDialog"
+
+let table = function (num) {
+  let main = []
+  for (let i = 0; i < num; i++) {
+    main.push({})
+  }
+  return main
+}
+export default {
+  components: {
+    myCascader,
+    hansonTable,
+    qrcode, //二维码页面
+    firm, //
+    supplyDialog,
+    supplierDialog,
+    guaranteeDialog,
+    uploadFilesDialog,
+    maintainerDialog,
+    insurerDialog,
+    uploadImgDialog,
+    picDialog
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          addDevice: false
+        };
+      }
+    },
+    headerData: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      width: "30%",
+      isFull: true,//dialog是否为全屏
+      title: "添加业务空间",
+      isCenter: true,
+      deviceType: {},
+      main: table(10),
+      mess: {},
+      headers: null,
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 400,
+        currentPage: 1
+      },
+      id: null,
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        firm: false, //厂商弹窗
+        supply: false, //选择供应合同
+        supplier: false, //供应商选择
+        guarantee: false, //选择保单
+        maintainer: false, //选择维修商
+        insurer: false, //选择保险公司
+        uploadFiles: false,//上传文件
+        uploadImgs: false,//上传单个图片
+        pic: false, //多个图片
+      },
+      addNum: 1,//增加个数
+      row: null,//被修改的row
+      filesArr: [],//保存临时的文件key
+      messKey: null,
+      imgsArr: [],//临时保存的图片key数组
+      picsArr: [],//临时设备图片keys数组
+    };
+  },
+  created() {
+
+  },
+  mounted() {
+  },
+  methods: {
+    //增加个数
+    addMain() {
+      for (let i = 0; i < this.addNum; i++) {
+        this.main.push({})
+      }
+      this.hot.loadData(this.main)
+    },
+
+    //添加业务空间确定
+    addSpace() {
+      console.log(this.main)
+      let pushData = []
+      this.main.map(item => {
+        if (!!item.infos) {
+          for (let key in item.infos) {
+            if (!!item.infos[key]) {
+              pushData.push(item)
+            }
+          }
+        }
+      })
+      console.log(pushData)
+    },
+
+    //下一步
+    // step(val) {
+    //   if (!!val) {
+    //     this.isFull = true
+    //     this.isCenter = true
+    //     this.title = "添加资产"
+    //     this.getData()
+    //   } else {
+    //     this.isFull = false
+    //     this.isCenter = false
+    //   }
+    // },
+    //修改设备类型
+    changeCader(val) {
+      this.deviceType = val
+    },
+    //获取header的mess
+    getHeader(mess) {
+      this.mess = mess;
+    },
+
+    //获取主体内容
+    // getMain(floorMess) {
+    //   console.log(floorMess);
+    // },
+
+    //获取表头
+    getData() {
+      this.main = table(10)
+      getSpaceHeader({
+        code: "space",
+        ProjId: this.$route.query.projId
+      }).then(res => {
+        this.headers = res.data.Content;
+        if (!!this.hot) {
+          this.hot.destroy();
+          this.hot = null;
+        }
+        let data = tools.getItem(this.deviceType.code)
+        if (!!data) {
+          this.main = data
+        }
+        this.initHot();
+      });
+    },
+
+    //撤回
+    undo() {
+      this.hot.undo();
+    },
+
+    //刷新
+    reset() {
+      this.getData();
+    },
+
+    //添加设备
+    addDevice() {
+      console.log("addDevice")
+    },
+
+    /**
+     * 表头文案处理函数
+     * @param arr header数组数据
+     *
+     * @return 处理好的文案
+     */
+    delHeader(arr) {
+      let data = arr.map(item => {
+        if (
+          item.InputMode == "A1" ||
+          item.InputMode == "A2" ||
+          item.InputMode == "B1" ||
+          item.InputMode == "C5" ||
+          item.InputMode == "D1" ||
+          item.InputMode == "D2" ||
+          item.InputMode == "X" ||
+          item.InputMode == "L" ||
+          item.InputMode == "L1" ||
+          item.InputMode == "L2" ||
+          item.InputMode == "F1" ||
+          item.InputMode == "F2"
+        ) {
+          if (item.unit == "") {
+            return item.InfoPointName;
+          } else {
+            return item.InfoPointName + "(" + item.unit + ")";
+          }
+        } else {
+          return undefined;
+        }
+      });
+      data = data.filter(item => item);
+      //   data.unshift("同时创建资产", "所属建筑楼层", "所属系统实例");
+      return data;
+    },
+
+    /**
+     * 表头数据处理函数
+     * @param arr header数组数据
+     *
+     * @return 处理好的数据格式
+     */
+    getType(arr) {
+      let data = arr.map(item => {
+        //二维码
+        if (item.infoPointCode == "EquipQRCode") {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+        //厂商选择
+        if (item.infoPointCode == "Brand" || item.infoPointCode == "Specification") {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+        if (item.infoPointCode == "SupplierContractID") {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (item.infoPointCode == "InsuranceNum") {
+          //选择保单
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (item.infoPointCode == "InsuranceFile" || item.infoPointCode == "Archive") {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (
+          item.infoPointCode == "InstallLocation" ||
+          item.infoPointCode == "InstallPic" ||
+          item.infoPointCode == "InstallDrawing" ||
+          item.infoPointCode == "Nameplate" ||
+          item.infoPointCode == "Pic" ||
+          item.infoPointCode == "Drawing"
+        ) {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (
+          item.infoPointCode == "Maintainer" ||
+          item.infoPointCode == "Supplier" ||
+          item.infoPointCode == "Insurer" ||
+          item.infoPointCode == "InsurerContactor"
+        ) {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+        if (item.InputMode == "D1") {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.customDropdownRenderer,
+            editor: "chosen",
+            chosenOptions: {
+              // multiple: true,//多选
+              data: item.DataSource || ""
+            }
+          };
+        } else if (item.InputMode == "A1" || item.InputMode == "A2") {
+          return {
+            data: "infos." + item.infoPointCode,
+            type: "numeric",
+            numericFormat: {
+              pattern: "0,0.00"
+              // culture: 'de-DE' // use this for EUR (German),
+              // more cultures available on http://numbrojs.com/languages.html
+            }
+          };
+        } else if (item.InputMode == "C5") {
+          return {
+            data: "infos." + item.infoPointCode,
+            type: "date",
+            dateFormat: "YYYY-MM-DD",
+            correctFormat: true
+          };
+        } else if (
+          item.InputMode == "B1" ||
+          item.InputMode == "L" ||
+          item.InputMode == "L1" ||
+          item.InputMode == "L2"
+        ) {
+          return {
+            data: "infos." + item.infoPointCode
+          };
+        } else if (
+          item.InputMode == "X" ||
+          item.InputMode == "F2"
+          // item.InputMode == "L1" ||
+          // item.InputMode == "L2"
+        ) {
+          return {
+            data: "infos." + item.infoPointCode,
+            readOnly: true
+          };
+        } else if (item.InputMode == "D2") {
+          return {
+            data: "infos." + item.infoPointCode,
+            renderer: tools.customDropdownRenderer,
+            editor: "chosen",
+            chosenOptions: {
+              multiple: true, //多选
+              data: item.DataSource.Content || ""
+            }
+          };
+        } else {
+          return undefined;
+        }
+
+      });
+      //   data.unshift(
+      //     {
+      //       type: "checkbox",
+      //       checkedTemplate: 1,
+      //       uncheckedTemplate: 0,
+      //       data: "Checked",
+      //       label: {
+      //         position: "after",
+      //       }
+      //     },
+      //     {
+      //       data: "flowBuild",
+      //       renderer: tools.customDropdownRenderer,
+      //       editor: "chosen",
+      //       chosenOptions: {
+      //         // multiple: true,//多选
+      //         // data: item.DataSource.Content || ""
+      //       }
+      //     },
+      //     {
+      //       data: "system",
+      //       renderer: tools.customDropdownRenderer,
+      //       editor: "chosen",
+      //       chosenOptions: {
+      //         // multiple: true,//多选
+      //         // data: item.DataSource.Content || ""
+      //       }
+      //     }
+      //   );
+      data = data.filter(item => item);
+      return data;
+    },
+
+    //初始化插件
+    initHot() {
+      var container = document.getElementById("myHandson");
+      let winHeight = document.documentElement.clientHeight;
+      this.hot = new Handsontable(container, {
+        data: this.main,
+        colHeaders: this.delHeader(this.headers), //表头文案
+        columns: this.getType(this.headers), //数据显示格式
+        filters: true,
+        height: winHeight - 100 - 50 - 60,
+        columnSorting: true, //添加排序
+        sortIndicator: true, //添加排序
+        renderAllRows: true,
+        autoColumnSize: true,
+        language: "zh-CN",
+        manualColumnResize: true,
+        manualColumnMove: true,
+        dropdownMenu: [
+          "filter_by_condition",
+          "filter_by_value",
+          "filter_action_bar"
+        ],
+        contextMenu: {
+          items: {
+            remove_row: {
+              name: "删除该业务空间"
+            }
+          }
+        },
+        filters: true,
+        afterFilter: this.trimmedRows,
+        // 事件
+        afterChange: this.tdChange, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        beforeRemoveRow: this.romoveFm, //右键删除
+        afterOnCellMouseDown: this.eventClick //鼠标点击
+      });
+      let pro = document.getElementById("hot-display-license-info");
+      if (!!pro) {
+        pro.parentNode.removeChild(pro);
+      }
+      this.isLoading = false;
+    },
+
+    tdChange() {
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //表格中的点击
+    eventClick(el, rowArr) {
+      console.log(rowArr)
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      let filter = this.filtersArr;
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.hot.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.main[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.main[sortArr[rowArr.row]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (trimmedArr.length) {
+        let infos = this.main[trimmedArr[rowArr.row]];
+        this.getInfors(infos, trimmedArr[rowArr.row]);
+      } else {
+        let infos = this.main[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+
+    getInfors(infos, row) {
+      //其他的开始判断
+      let val = this.hot.colToProp(row.col);
+      if (val == "infos.EquipQRCode") {
+        this.myDialog.qrcode = true;
+        this.$refs.qrcode.getCanvas(1111);
+      }
+
+      if (val == "infos.Brand" || val == "infos.Specification") {
+        this.myDialog.firm = true;
+      }
+
+      if (val == "infos.SupplierContractID") {
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos) {
+            falg = this.main[row.row].infos.DPSupplierID
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.supply = true;
+        } else {
+          this.$message("请先选择供应商")
+        }
+      }
+
+      if (val == "infos.InsuranceNum") {
+        //选择保单
+        this.myDialog.guarantee = true;
+      }
+
+      if (val == "infos.InsuranceFile" || val == "infos.Archive") {
+        this.filesArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        this.myDialog.uploadFiles = true
+      }
+
+      if (
+        val == "infos.InstallLocation" ||
+        val == "infos.InstallPic" ||
+        val == "infos.InstallDrawing" ||
+        val == "infos.Nameplate" ||
+        val == "infos.Drawing"
+      ) {
+        if (val == "infos.Nameplate") {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]].key] : []) : []
+        } else {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        }
+        this.myDialog.uploadImgs = true
+      }
+
+      if (val == "infos.Pic") {
+        // console.log(this.main[row.row].infos[val.split(".")[1]], "this.main[row.row].infos[val.split")
+        this.picsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
+        console.log(this.picsArr)
+        this.myDialog.pic = true
+      }
+
+      if (
+        val == "infos.Supplier"
+      ) {
+        this.myDialog.supplier = true;
+      }
+
+      if (val == "infos.Maintainer") {
+        this.myDialog.maintainer = true;
+      }
+
+      if (
+        val == "infos.Insurer" ||
+        val == "infos.InsurerContactor") {
+        this.myDialog.insurer = true;
+      }
+      this.row = row.row
+      this.messKey = val
+      console.log(val, row);
+    },
+
+    //获取被筛选掉的行号
+    trimmedRows() {
+      // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
+      var plugin = this.hot.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.main.length;
+      let dataArr = new Array();
+      for (let i = 0; i < dataLength; i++) {
+        dataArr.push(i);
+      }
+      if (plugin.length <= 0) {
+        dataArr = undefined;
+      } else {
+        dataArr = this.array_diff(dataArr, plugin);
+      }
+      return dataArr || [];
+      // var DataArray = new Array();
+
+      // for (var i = 0; i < plugin.length; i++) {
+      //     // 通过行号获取数据
+      //     DataArray.push(this.hot.getSourceDataAtRow(plugin[i]));
+      // }
+    },
+
+    //判断是否为空行
+    isEmptyRow(instance, row) {
+      var rowData = instance.countRows();
+      for (var i = 0, ilen = rowData.length; i < ilen; i++) {
+        if (rowData[i] !== null) {
+          return false;
+        }
+      }
+      return true;
+    },
+
+    //如果选择供应商之后
+    supplierChange(data) {
+      console.log(data, "供应商")
+      for (let key in data) {
+        this.utilToKey(key, "name", data, "Supplier")
+        this.utilToKey(key, "email", data, "SupplierEmail")
+        this.utilToKey(key, "website", data, "SupplierWeb")
+        this.utilToKey(key, "phone", data, "SupplierPhone")
+        this.utilToKey(key, "fox", data, "SupplierFax")
+        this.utilToKey(key, "man", data, "SupplierContactor")
+        this.utilToKey(key, "venderId", data, "DPSupplierID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险商变更
+    changeInsurer(data) {
+      console.log(data, "保险商")
+      for (let key in data) {
+        this.utilToKey(key, "name", data, "Insurer")
+        this.utilToKey(key, "email", data, "InsurerEmail")
+        this.utilToKey(key, "website", data, "InsurerWeb")
+        this.utilToKey(key, "phone", data, "InsurerFax")
+        this.utilToKey(key, "man", data, "InsurerContactor")
+        this.utilToKey(key, "venderId", data, "DPInsurerID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //维修商变更
+    changeMaintainer(data) {
+      for (let key in data) {
+        this.utilToKey(key, "name", data, "Maintainer")
+        this.utilToKey(key, "email", data, "MaintainerEmail")
+        this.utilToKey(key, "website", data, "MaintainerWeb")
+        this.utilToKey(key, "phone", data, "MaintainerPhone")
+        this.utilToKey(key, "fox", data, "MaintainerFax")
+        this.utilToKey(key, "man", data, "MaintainerContactor")
+        this.utilToKey(key, "venderId", data, "DPMaintainerID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    utilToKey(key, name, data, messName) {
+      if (key == name) {
+        this.setDataToMain(data[key], messName, this.row)
+      }
+    },
+
+    //上传文件弹窗触发事件
+    fileChange(keys) {
+      this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //上传图片弹窗触发事件
+    imgChange(keys) {
+      this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //设备图片弹窗改变事件
+    changePics(keys) {
+      this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+      console.log("assets", keys)
+    },
+
+    //判断是否有值,有值赋值
+    setDataToMain(data, key, row) {
+      if (!!data && data != '--') {
+        if (!!this.main[row].infos) {
+          //铭牌照片特殊处理
+          if (key == 'Nameplate') {
+            this.main[row].infos[key] = {
+              "systemId": "dataPlatform",
+              "name": "铭牌照片",
+              "type": "image",
+              "key": data
+            }
+          } else {
+            this.main[row].infos[key] = data
+          }
+        } else {
+          this.main[row].infos = {}
+          if (key == 'Nameplate') {
+            this.main[row].infos[key] = {
+              "systemId": "dataPlatform",
+              "name": "铭牌照片",
+              "type": "image",
+              "key": data
+            }
+          } else {
+            this.main[row].infos[key] = data
+          }
+        }
+      } else {
+        this.main[row].infos[key] = ''
+      }
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler(newName, oldName) {
+        // this.getData()
+        console.log(this.dialog)
+        if (this.dialog.addDevice) {
+          this.getData()
+        }
+      },
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#addDevice {
+  overflow: hidden;
+}
+</style>

+ 836 - 0
src/components/business_space/dialogs/addDialog/dialogAssets.vue

@@ -0,0 +1,836 @@
+<!--
+    上传文件的弹窗
+-->
+
+<template>
+  <div v-if="dialog.addDevice">
+    <el-dialog
+      :title="title"
+      :center="isCenter"
+      :visible.sync="dialog.addDevice"
+      :width="width"
+      :fullscreen="isFull"
+    >
+      <div id="addDevice">
+        <div v-show="!isCenter">
+          <my-cascader ref="cascader" @change="changeCader"></my-cascader>
+        </div>
+        <div v-if="isCenter">
+          <div>
+            <div class="hanson-bar">
+              <span>当前选择的设备族:{{deviceType.facility}}</span>
+              <div style="width:350px;float:right;overflow:hidden;">
+                <span>增加</span>
+                <el-input v-model="addNum" style="width:40px;" placeholder="增加个数" size="small"></el-input>
+                <span>个{{deviceType.facility}}</span>
+                <el-button size="small" @click="addMain">增加</el-button>
+              </div>
+              <div
+                style="width:200px;color:gray;float:right;padding-top:7px;font-size:10px;"
+              >是否隐藏自动填充信息点:
+                <el-tooltip :content="'' + (isWatch ? '隐藏' : '不隐藏')" placement="top">
+                  <el-switch
+                    @change="changeWatch"
+                    v-model="isWatch"
+                    active-color="#13ce66"
+                    inactive-color="gray"
+                  ></el-switch>
+                </el-tooltip>
+              </div>
+            </div>
+            <div v-show="main && main.length" id="myHandson" ref="myHandson"></div>
+          </div>
+        </div>
+      </div>
+      <div v-show="!isCenter" slot="footer" class="dialog-footer">
+        <el-button>取 消</el-button>
+        <el-button type="primary" @click="step(1)">下 一 步</el-button>
+      </div>
+      <span v-show="isCenter" slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="createAssets">创建资产</el-button>
+      </span>
+    </el-dialog>
+    <qrcode :dialog="myDialog" :addBody="true" ref="qrcode"></qrcode>
+    <firm
+      :mess="{deviceId : deviceType.code}"
+      ref="firm"
+      @changeFirm="firmChange"
+      :dialog="myDialog"
+    ></firm>
+    <supply-dialog @change="supplyChange" :id="id" ref="supply" :dialog="myDialog"></supply-dialog>
+    <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
+    <guarantee-dialog ref="guarantee" :id="id" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
+    <upload-files-dialog
+      ref="upload"
+      @changeFile="fileChange"
+      :keysArr="filesArr"
+      :dialog="myDialog"
+    ></upload-files-dialog>
+    <upload-img-dialog @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
+    <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
+    <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
+    <pic-dialog :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
+  </div>
+</template>
+<script>
+
+import myCascader from "@/components/lib/cascaders/assets";
+import hansonTable from "@/components/dialogHanson/addDevice";
+import tools from "@/assets/js/tools";
+import qrcode from "@/components/lib/qrcode";
+import firm from "@/components/dialogs/list/firm";
+import supplyDialog from "@/components/dialogs/list/supplyDialog";
+import supplierDialog from "@/components/dialogs/list/supplierDialog";
+import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
+import insurerDialog from "@/components/dialogs/list/insurerDialog";
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
+import picDialog from "@/components/dialogs/list/picDialog"
+
+//下拉插件
+import "@/assets/js/chosen.jquery.min";
+import "@/assets/js/handsontable-chosen-editor";
+
+import text from "@/utils/hansontable/mainText"
+
+import showTools from "@/utils/hansontable/notShow"
+
+import uuid from "@/utils/uuid";
+
+import { getTableHeader, createProperty, getSpaceFloor, createAssetsList } from "@/api/request";
+let table = function (num) {
+  let main = []
+  for (let i = 0; i < num; i++) {
+    main.push({})
+  }
+  return main
+}
+export default {
+  components: {
+    myCascader,
+    hansonTable,
+    qrcode, //二维码页面
+    firm, //
+    supplyDialog,
+    supplierDialog,
+    guaranteeDialog,
+    uploadFilesDialog,
+    maintainerDialog,
+    insurerDialog,
+    uploadImgDialog,
+    picDialog
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          addDevice: false
+        };
+      }
+    },
+    assetType: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      width: "30%",
+      isFull: false,//dialog是否为全屏
+      title: "确定新增资产的类型",
+      isCenter: false,
+      deviceType: {},
+      main: table(1),
+      mess: {},
+      headers: null,
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 400,
+        currentPage: 1
+      },
+      id: 0,
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        firm: false, //厂商弹窗
+        supply: false, //选择供应合同
+        supplier: false, //供应商选择
+        guarantee: false, //选择保单
+        maintainer: false, //选择维修商
+        insurer: false, //选择保险公司
+        uploadFiles: false,//上传文件
+        uploadImgs: false,//上传单个图片
+        pic: false, //多个图片
+      },
+      addNum: 1,//增加个数
+      row: null,//被修改的row
+      filesArr: [],//保存临时的文件key
+      messKey: null,
+      imgsArr: [],//临时保存的图片key数组
+      picsArr: [],//临时设备图片keys数组
+      param: {
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      },
+      floorData: [],
+      isWatch: true,
+      ajaxResult: true
+    };
+  },
+  created() {
+    this.getFloorData()
+  },
+  mounted() { },
+  methods: {
+    //设置默认选中数据
+    setValue() {
+      this.$nextTick(_ => {
+        this.$refs.cascader.setValue(this.assetType)
+      })
+    },
+    //获取楼层数据
+    getFloorData() {
+      getSpaceFloor(this.param).then(res => {
+        if (res.data.Result == 'success') {
+          let data = this.changeArr(res.data.Content), floorData = []
+          data.map(item => {
+            if (!!item.children) {
+              item.children.unshift({
+                value: '',
+                label: "未明确楼层的设备"
+              })
+            }
+            return item
+          })
+          data.map(item => {
+            if (!!item.children && item.children.length) {
+              item.children.map(child => {
+                floorData.push({
+                  Code: item.value + "-" + child.value,
+                  Name: item.label + "-" + child.label
+                })
+              })
+            }
+          })
+          this.floorData = floorData
+          //   this.options = data
+        } else {
+          this.$message.error(res.data.ResultMsg)
+        }
+      }).catch(() => {
+        this.$message.error("请求出错")
+      })
+    },
+    //将数组转换成optiosn格式
+    changeArr(arr) {
+      return arr.map(item => {
+        if (item.floors && item.floors.length) {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: item.floors.map(i => {
+              return {
+                value: i.id,
+                label: i.infos.FloorLocalName || "未知",
+              }
+            })
+          }
+        } else {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: null,
+            isChilren: 1,
+          }
+        }
+      })
+    },
+
+    //增加个数
+    addMain() {
+      for (let i = 0; i < this.addNum; i++) {
+        this.main.push({})
+      }
+      if (!!this.hot) {
+        this.hot.destroy()
+      }
+      this.initHot()
+    },
+
+    //下一步
+    step(val) {
+      if (!!val) {
+        this.isFull = true
+        this.isCenter = true
+        this.title = "添加资产"
+        this.getData()
+      } else {
+        this.isFull = false
+        this.isCenter = false
+      }
+    },
+    //修改设备类型
+    changeCader(val) {
+      this.deviceType = val
+    },
+    //获取header的mess
+    getHeader(mess) {
+      this.mess = mess;
+    },
+
+    //获取主体内容
+    getMain(floorMess) {
+    },
+
+    //获取表头
+    getData() {
+      this.main = table(1)
+      getTableHeader({
+        code: this.deviceType.code,
+        ProjId: this.$route.query.projId
+      }).then(res => {
+        this.headers = res.data.Content;
+        if (!!this.hot) {
+          this.hot.destroy();
+          this.hot = null;
+        }
+        let data = tools.getItem(this.deviceType.code)
+        if (!!data) {
+          this.main = data
+        }
+        this.initHot();
+      });
+    },
+
+    changeWatch() {
+      this.getData()
+    },
+
+    //撤回
+    undo() {
+      this.hot.undo();
+    },
+
+    //刷新
+    reset() {
+      this.getData();
+    },
+
+    //添加设备
+    addDevice() {
+    },
+
+    //创建资产
+    createAssets() {
+      let data = []
+      let copyData = tools.copyArr(this.main)
+      let falg = false
+      copyData.map(item => {
+        if (!!item.infos) {
+          if (item.infos.EquipLocalName) {
+            item.family = this.deviceType.code
+            data.push(item)
+          } else {
+            falg = true
+          }
+        }
+      })
+      if (falg) {
+        this.$message.error("存在资产的本地名称为空,请检查")
+        return
+      }
+      let params = []
+      data.map(item => {
+        if (!!item.infos) {
+          let one = {}
+          if (!!item.flowBuild) {
+            one.BuildId = item.flowBuild.split("-")[0]
+            one.FloorId = item.flowBuild.split("-")[1] || null
+          }
+          one.Family = this.deviceType.code
+          one.FamilyName = this.deviceType.facility
+          one.Infos = item.infos
+          one.FmId = "Pe" + uuid(32, 16)
+          one.ProjId = this.$route.query.projId
+          one.FmName = item.infos.EquipLocalName || ""
+          one.X = 0
+          one.Y = 0
+          params.push(one)
+        }
+      })
+      params.map(item => {
+        for (let k in item.Infos) {
+          if (item.Infos[k] == "") {
+            item.Infos[k] = null
+          }
+        }
+      })
+      if (params.length) {
+        this.createJson(params)
+      } else {
+        this.$message.error("信息点不能为空")
+      }
+    },
+
+    //新建资产请求
+    async createJson(data) {
+      data.map(item => {
+        if (!!item.Infos.DPSupplierID) {
+          item.Infos.DPSupplierID = item.Infos.DPSupplierID.split("-")[0]
+        }
+        if (!!item.Infos.DPManufacturerID) {
+          item.Infos.DPManufacturerID = item.Infos.DPManufacturerID.split("-")[0]
+        }
+        if (!!item.Infos.DPInsurerID) {
+          item.Infos.DPInsurerID = item.Infos.DPInsurerID.split("-")[0]
+        }
+        if (!!item.Infos.DPMaintainerID) {
+          item.Infos.DPMaintainerID = item.Infos.DPMaintainerID.split("-")[0]
+        }
+        if (!!item.Infos.DPSpecificationID) {
+          item.Infos.DPSpecificationID = item.Infos.DPSpecificationID.split("-")[0]
+        }
+        for (let k in item.Infos) {
+          if (item.Infos[k] == "") {
+            item.Infos[k] = null
+          }
+        }
+        return item
+      })
+      this.ajaxResult = true
+      let param = {
+        FmList: data,
+        ProjId: this.$route.query.projId,
+        UserId: this.$route.query.userId
+      }
+      await this.createAssetId(param)
+    },
+
+    async createAssetId(param) {
+      await createAssetsList(param, res => {
+        console.log(res)
+        if (res.Result != "success") {
+          this.$message.error("请求错误")
+        } else {
+          tools.removeItem(this.deviceType.code)
+          this.$emit("close", this.deviceType)
+          this.dialog.addDevice = false
+        }
+      })
+    },
+
+    /**
+     * 表头文案处理函数
+     * @param list header数组数据
+     *
+     * @return 处理好的文案
+     */
+    delHeader(list) {
+      let arr = tools.copyArr(list)
+      // 如果不是只读状态,添加四大厂商选择
+      arr = showTools.arrToArr(arr)
+      let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2"]
+      readArr.push("Own")
+      let data = showTools.changeHeader(arr, readArr, false, this.isWatch, false, true)
+      data.unshift("所属建筑楼层");
+      console.log(data, "data")
+      return data;
+    },
+
+    /**
+     * 表头数据处理函数
+     * @param list header数组数据
+     *
+     * @return 处理好的数据格式
+     */
+    getType(list) {
+      let arr = tools.copyArr(list)
+      // 如果不是只读状态,添加四大厂商选择
+      if (!this.onlyRead) {
+        arr = showTools.arrToArr(arr)
+      }
+      let data = showTools.showTypes(arr, false, this.isWatch, false, true)
+      data.unshift(
+        {
+          data: "flowBuild",
+          renderer: tools.customDropdownRenderer,
+          editor: "chosen",
+          chosenOptions: {
+            // multiple: true,//多选
+            data: this.floorData
+          }
+        }
+      );
+      console.log("type", data)
+      return data;
+    },
+
+
+    //初始化插件
+    initHot() {
+      var container = document.getElementById("myHandson");
+      let winHeight = document.documentElement.clientHeight;
+      this.hot = new Handsontable(container, {
+        data: this.main,
+        colHeaders: this.delHeader(this.headers), //表头文案
+        columns: this.getType(this.headers), //数据显示格式
+        filters: true,
+        rowHeaders: true,
+        height: winHeight - 100 - 50 - 60,
+        columnSorting: true, //添加排序
+        sortIndicator: true, //添加排序
+        renderAllRows: true,
+        autoColumnSize: true,
+        language: "zh-CN",
+        maxRows: this.main.length,
+        manualColumnResize: true,
+        manualColumnMove: true,
+        dropdownMenu: [
+          "filter_by_condition",
+          "filter_by_value",
+          "filter_action_bar"
+        ],
+        contextMenu: {
+          items: {
+            remove_row: {
+              name: "删除该资产"
+            }
+          }
+        },
+        afterChange: this.tdChange, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        afterRemoveRow: this.romoveFm, //右键删除
+        afterOnCellMouseDown: this.eventClick //鼠标点击
+      });
+      let pro = document.getElementById("hot-display-license-info");
+      if (!!pro) {
+        pro.parentNode.removeChild(pro);
+      }
+      this.isLoading = false;
+    },
+
+    tdChange() {
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //表格中的点击
+    eventClick(el, rowArr) {
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      let filter = this.filtersArr;
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.hot.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.main[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.main[sortArr[rowArr.row]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (trimmedArr.length) {
+        let infos = this.main[trimmedArr[rowArr.row]];
+        this.getInfors(infos, trimmedArr[rowArr.row]);
+      } else {
+        let infos = this.main[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+
+    getInfors(infos, row) {
+      //其他的开始判断
+      let val = this.hot.colToProp(row.col);
+      if (val == "infos.EquipQRCode") {
+        this.myDialog.qrcode = true;
+        this.$refs.qrcode.getCanvas(1111);
+      }
+
+      if (val == "linkSystem") {
+        this.systemList = this.main[row.row].linkSystem || []
+        this.dialog.systemType = true
+      }
+
+      if (val == "infos.DPManufacturerID") {
+        this.myDialog.firm = true;
+      }
+
+      if (val == "infos.SupplierContractID") {
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos) {
+            falg = this.main[row.row].infos.DPSupplierID.split("-")[0]
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.supply = true;
+        } else {
+          this.$message("请先选择供应商")
+        }
+      }
+
+      if (val == "infos.InsuranceNum") {
+        //选择保单
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos) {
+            falg = this.main[row.row].infos.DPInsurerID.split("-")[0]
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.guarantee = true;
+        } else {
+          this.$message("请先选择保险商")
+        }
+      }
+
+      if (val == "infos.InsuranceFile" || val == "infos.Archive") {
+        this.filesArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        this.myDialog.uploadFiles = true
+      }
+
+      if (
+        val == "infos.InstallPic" ||
+        val == "infos.InstallDrawing" ||
+        val == "infos.Nameplate" ||
+        val == "infos.Drawing"
+      ) {
+        if (val == "infos.Nameplate") {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]].key] : []) : []
+        } else {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        }
+        this.myDialog.uploadImgs = true
+      }
+
+      if (val == "infos.Pic") {
+        this.picsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
+        this.myDialog.pic = true
+      }
+
+      if (
+        val == "infos.Supplier"
+      ) {
+        this.myDialog.supplier = true;
+      }
+
+      if (
+        val == "infos.DPSupplierID"
+      ) {
+        this.myDialog.supplier = true;
+      }
+
+      if (val == "infos.DPMaintainerID"
+      ) {
+        this.myDialog.maintainer = true;
+      }
+
+      if (
+        val == "infos.DPInsurerID"
+      ) {
+        this.myDialog.insurer = true;
+      }
+
+      if (val == "infos.Maintainer") {
+        this.myDialog.maintainer = true;
+      }
+
+      if (
+        val == "infos.Insurer" ||
+        val == "infos.InsurerContactor") {
+        this.myDialog.insurer = true;
+      }
+      this.row = row.row
+      this.messKey = val
+      console.log(val, row);
+    },
+
+    //获取被筛选掉的行号
+    trimmedRows() {
+      // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
+      var plugin = this.hot.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.main.length;
+      let dataArr = new Array();
+      for (let i = 0; i < dataLength; i++) {
+        dataArr.push(i);
+      }
+      if (plugin.length <= 0) {
+        dataArr = undefined;
+      } else {
+        dataArr = this.array_diff(dataArr, plugin);
+      }
+      return dataArr || [];
+      // var DataArray = new Array();
+
+      // for (var i = 0; i < plugin.length; i++) {
+      //     // 通过行号获取数据
+      //     DataArray.push(this.hot.getSourceDataAtRow(plugin[i]));
+      // }
+    },
+
+    //判断是否为空行
+    isEmptyRow(instance, row) {
+      var rowData = instance.countRows();
+      for (var i = 0, ilen = rowData.length; i < ilen; i++) {
+        if (rowData[i] !== null) {
+          return false;
+        }
+      }
+      return true;
+    },
+
+    //选择型号修改
+    firmChange(data) {
+      for (let key in data) {
+        // this.utilToKey(key, "brand", data, "Brand")
+        // this.utilToKey(key, "name", data, "Specification")
+        // this.utilToKey(key, "venderName", data, "Manufacturer")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name + "/" + data.brand
+          this.utilToKey(key, "venderId", data, "DPManufacturerID")
+        }
+        this.utilToKey(key, "specificationId", data, "DPSpecificationID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //如果选择供应商之后
+    supplierChange(data) {
+      for (let key in data) {
+        // this.utilToKey(key, "name", data, "Supplier")
+        // this.utilToKey(key, "email", data, "SupplierEmail")
+        // this.utilToKey(key, "website", data, "SupplierWeb")
+        // this.utilToKey(key, "phone", data, "SupplierPhone")
+        // this.utilToKey(key, "fox", data, "SupplierFax")
+        // this.utilToKey(key, "man", data, "SupplierContactor")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name
+          console.log(data)
+          this.utilToKey(key, "venderId", data, "DPSupplierID")
+        }
+        // this.utilToKey(key, "specificationId", data, "DPSpecificationID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //供应商合同
+    supplyChange(data) {
+      let changeData = { id: data }
+      this.utilToKey("id", "id", changeData, "SupplierContractID")
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险合同
+    guaranteeChange(data) {
+      for (let key in data) {
+        this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
+        if (key == "contractFile") {
+          if (!!data[key]) {
+            data[key] = [data[key]]
+          }
+        }
+        this.utilToKey(key, "contractFile", data, "InsuranceFile")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险商变更
+    changeInsurer(data) {
+      for (let key in data) {
+        // this.utilToKey(key, "name", data, "Insurer")
+        // this.utilToKey(key, "email", data, "InsurerEmail")
+        // this.utilToKey(key, "website", data, "InsurerWeb")
+        // this.utilToKey(key, "phone", data, "InsurerFax")
+        // this.utilToKey(key, "man", data, "InsurerContactor")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name
+          this.utilToKey(key, "venderId", data, "DPInsurerID")
+        }
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //维修商变更
+    changeMaintainer(data) {
+      for (let key in data) {
+        // this.utilToKey(key, "name", data, "Maintainer")
+        // this.utilToKey(key, "email", data, "MaintainerEmail")
+        // this.utilToKey(key, "website", data, "MaintainerWeb")
+        // this.utilToKey(key, "phone", data, "MaintainerPhone")
+        // this.utilToKey(key, "fox", data, "MaintainerFax")
+        // this.utilToKey(key, "man", data, "MaintainerContactor")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name
+          this.utilToKey(key, "venderId", data, "DPMaintainerID")
+        }
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    utilToKey(key, name, data, messName) {
+      if (key == name) {
+        this.setDataToMain(data[key], messName, this.row)
+      }
+    },
+
+    //上传文件弹窗触发事件
+    fileChange(keys) {
+      this.setDataToMain(keys[0], this.messKey.split("."), this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //上传图片弹窗触发事件
+    imgChange(keys) {
+      this.setDataToMain(keys[0], this.messKey.split("."), this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //设备图片弹窗改变事件
+    changePics(keys) {
+      this.setDataToMain(keys, this.messKey.split("."), this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //判断是否有值,有值赋值
+    setDataToMain(data, key, row) {
+      if (!!data && data != '--') {
+        if (!!this.main[row].infos) {
+          //铭牌照片特殊处理
+          this.main[row].infos[key] = data
+        } else {
+          this.main[row].infos = {}
+          this.main[row].infos[key] = data
+        }
+      } else {
+        this.main[row].infos[key] = ''
+      }
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.addDevice) {
+          this.setValue()
+        }
+      }
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#addDevice {
+  overflow: hidden;
+}
+</style>

+ 955 - 0
src/components/business_space/dialogs/addDialog/dialogDevice.vue

@@ -0,0 +1,955 @@
+<!--
+    上传文件的弹窗
+-->
+
+<template>
+  <div v-if="dialog.addDevice">
+    <el-dialog
+      :title="title"
+      :center="isCenter"
+      :visible.sync="dialog.addDevice"
+      :width="width"
+      :fullscreen="isFull"
+    >
+      <div id="addDevice">
+        <div v-show="!isCenter">
+          <my-cascader ref="cascader" @change="changeCader"></my-cascader>
+        </div>
+        <div v-show="isCenter">
+          <div>
+            <div class="hanson-bar">
+              <span
+                style="width:20px;float:left;display:block;height:20px;cursor: pointer;"
+                @click="changeAssetsFalg"
+              >
+                <i class="iconfont icon-xiaolian"></i>
+              </span>
+              <span>当前选择的设备族:{{deviceType.facility}}</span>
+              <!-- 增加 -->
+              <div style="width:360px;float:right;overflow:hidden;">
+                <span>增加</span>
+                <el-input v-model="addNum" style="width:40px;" placeholder="增加个数" size="small"></el-input>
+                <span>个{{deviceType.facility}}</span>
+                <el-button size="small" @click="addMain">增加</el-button>
+              </div>
+              <!-- switch -->
+              <div
+                style="width:200px;color:gray;float:right;padding-top:7px;font-size:10px;"
+              >是否隐藏自动填充信息点:
+                <el-tooltip :content="'' + (isWatch ? '隐藏' : '不隐藏')" placement="top">
+                  <el-switch
+                    @change="changeWatch"
+                    v-model="isWatch"
+                    active-color="#13ce66"
+                    inactive-color="gray"
+                  ></el-switch>
+                </el-tooltip>
+              </div>
+            </div>
+            <div v-show="main && main.length" id="myHandson" ref="myHandson"></div>
+          </div>
+        </div>
+      </div>
+      <div v-show="!isCenter" slot="footer" class="dialog-footer">
+        <el-button>取 消</el-button>
+        <el-button type="primary" @click="step(1)">下 一 步</el-button>
+      </div>
+      <span v-show="isCenter" slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="addDevice">创建设备</el-button>
+      </span>
+    </el-dialog>
+    <qrcode :dialog="myDialog" :addBody="true" ref="qrcode"></qrcode>
+    <firm
+      :mess="{deviceId : deviceType.assetType}"
+      ref="firm"
+      @changeFirm="firmChange"
+      :dialog="myDialog"
+    ></firm>
+    <supply-dialog @change="supplyChange" :id="id" ref="supply" :dialog="myDialog"></supply-dialog>
+    <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
+    <guarantee-dialog ref="guarantee" :id="id" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
+    <upload-files-dialog
+      ref="upload"
+      @changeFile="fileChange"
+      :keysArr="filesArr"
+      :dialog="myDialog"
+    ></upload-files-dialog>
+    <upload-img-dialog @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
+    <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
+    <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
+    <pic-dialog :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
+    <system-type
+      type="check"
+      :infos="''"
+      :list="systemList"
+      @change="setSystem"
+      :graphyId="graphyId"
+      :dialog="dialog"
+    ></system-type>
+  </div>
+</template>
+<script>
+
+import myCascader from "@/components/cascader";
+import hansonTable from "@/components/dialogHanson/addDevice";
+import { getTableHeader, getSpaceFloor, getEquipmentFamily, BatchCreateSome, createAssetsList, createSystem, EqToAssets, createRelation } from "@/api/request";
+import tools from "@/assets/js/tools";
+import showTools from "@/utils/hansontable/notShow"
+import text from "@/utils/hansontable/mainText"
+
+import qrcode from "@/components/lib/qrcode";
+import firm from "@/components/dialogs/list/firm";
+import supplyDialog from "@/components/dialogs/list/supplyDialog";
+import supplierDialog from "@/components/dialogs/list/supplierDialog";
+import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
+import insurerDialog from "@/components/dialogs/list/insurerDialog";
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
+import picDialog from "@/components/dialogs/list/picDialog"
+import systemType from "@/components/dialogs/list/systemType"
+
+
+//下拉插件
+import "@/assets/js/chosen.jquery.min";
+import "@/assets/js/handsontable-chosen-editor";
+
+import uuid from "@/utils/uuid";
+
+let table = function (num) {
+  let main = []
+  for (let i = 0; i < num; i++) {
+    main.push({ Checked: 1 })
+  }
+  return main
+}
+export default {
+  components: {
+    myCascader,
+    hansonTable,
+    qrcode, //二维码页面
+    firm, //
+    supplyDialog,
+    supplierDialog,
+    guaranteeDialog,
+    uploadFilesDialog,
+    maintainerDialog,
+    insurerDialog,
+    uploadImgDialog,
+    picDialog,
+    systemType
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          addDevice: false
+        };
+      }
+    },
+    graphyId: {
+      type: String
+    },
+    assetType: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      width: "30%",
+      isFull: false,//dialog是否为全屏
+      title: "确定新增设备的类型",
+      isCenter: false,
+      deviceType: {},
+      main: table(1),
+      mess: {},
+      headers: null,
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 400,
+        currentPage: 1
+      },
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        firm: false, //厂商弹窗
+        supply: false, //选择供应合同
+        supplier: false, //供应商选择
+        guarantee: false, //选择保单
+        maintainer: false, //选择维修商
+        insurer: false, //选择保险公司
+        uploadFiles: false,//上传文件
+        uploadImgs: false,//上传单个图片
+        pic: false, //多个图片
+        systemType: false,
+      },
+      addNum: 1,//增加个数
+      row: null,//被修改的row
+      filesArr: [],//保存临时的文件key
+      messKey: null,
+      imgsArr: [],//临时保存的图片key数组
+      picsArr: [],//临时设备图片keys数组
+      param: {
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      },
+      id: 0,
+      systemList: null,
+      isWatch: true,
+      EquipmentList: [],//资产族
+      floorFalg: false,
+    };
+  },
+  created() {
+    this.getFloorData()
+    this.getEquipmentFamilyList()
+  },
+  mounted() { },
+  methods: {
+    changeAssetsFalg() {
+      if (this.floorFalg) {
+        this.floorFalg = false
+      } else {
+        this.$confirm('<p>维护设备所在建筑楼层后,对后续数据影响较大,如业务空间中的所在关系or其他?暂未梳理明白……</p><p>后续要修改设备所属建筑楼层,只能通过模型中的待建模清单操作</p>', '提示', {
+          dangerouslyUseHTMLString: true,
+          confirmButtonText: '就要维护设备所属建筑楼层',
+          cancelButtonText: '暂时不搞了'
+        }).then(_ => {
+          this.floorFalg = true
+          this.getData()
+        }).catch(_ => {
+          this.$message("取消")
+        })
+      }
+    },
+    //获取资产族
+    getEquipmentFamilyList() {
+      getEquipmentFamily(res => {
+        this.EquipmentList = res.Content
+        console.log(this.EquipmentList, "EquipmentList")
+      })
+    },
+    //设置默认选中数据
+    setValue() {
+      this.$nextTick(_ => {
+        this.$refs.cascader.setValue(this.assetType)
+      })
+    },
+    //获取楼层数据
+    getFloorData() {
+      getSpaceFloor(this.param).then(res => {
+        if (res.data.Result == 'success') {
+          let data = this.changeArr(res.data.Content), floorData = []
+          data.map(item => {
+            if (!!item.children) {
+              item.children.unshift({
+                value: '',
+                label: "未明确楼层"
+              })
+            }
+            return item
+          })
+          data.map(item => {
+            if (!!item.children && item.children.length) {
+              item.children.map(child => {
+                floorData.push({
+                  Code: item.value + "-" + child.value,
+                  Name: item.label + "-" + child.label
+                })
+              })
+            }
+          })
+          this.floorData = floorData
+          console.log(this.floorData)
+        } else {
+          this.$message.error(res.data.ResultMsg)
+        }
+      }).catch(() => {
+        this.$message.error("请求出错")
+      })
+    },
+    //将数组转换成optiosn格式
+    changeArr(arr) {
+      return arr.map(item => {
+        if (item.floors && item.floors.length) {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: item.floors.map(i => {
+              return {
+                value: i.id,
+                label: i.infos.FloorLocalName || "未知",
+              }
+            })
+          }
+        } else {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: null,
+            isChilren: 1,
+          }
+        }
+      })
+    },
+    //增加个数
+    addMain() {
+      for (let i = 0; i < this.addNum; i++) {
+        this.main.push({
+          Checked: 1
+        })
+      }
+      if (!!this.hot) {
+        this.hot.destroy()
+      }
+      this.initHot()
+    },
+
+    //下一步
+    step(val) {
+      if (!!val) {
+        if (!!!this.deviceType.code) {
+          this.$message("请选择设备类别")
+          return
+        }
+        this.isFull = true
+        this.isCenter = true
+        this.title = "添加设备"
+        this.getData()
+      } else {
+        this.isFull = false
+        this.isCenter = false
+      }
+    },
+    //修改设备类型
+    changeCader(val) {
+      this.deviceType = val
+      this.EquipmentList.map(item => {
+        if (!!item.content && item.content.length) {
+          item.content.map(child => {
+            if (child.code == this.deviceType.code) {
+              this.deviceType.assetType = item.code
+              this.deviceType.assetName = item.name
+            }
+          })
+        }
+      })
+    },
+    //获取header的mess
+    getHeader(mess) {
+      this.mess = mess;
+    },
+
+    //获取表头
+    getData() {
+      this.main = table(1)
+      getTableHeader({
+        code: this.deviceType.code,
+        ProjId: this.$route.query.projId
+      }).then(res => {
+        this.headers = res.data.Content;
+        if (!!this.hot) {
+          this.hot.destroy();
+          this.hot = null;
+        }
+        let data = tools.getItem(this.deviceType.code)
+        if (!!data) {
+          this.main = data
+        }
+        this.initHot();
+      });
+    },
+
+    //添加设备
+    addDevice() {
+      let data = []
+      let copyData = tools.copyArr(this.main)
+      let falg = false
+      copyData.map(item => {
+        if (!!item.infos || !!item.relation) {
+          if (item.infos.EquipLocalName) {
+            item.equipment_category = this.deviceType.code
+            data.push(item)
+          } else {
+            falg = true
+          }
+        }
+      })
+      if (falg) {
+        this.$message.error("存在设备的本地名称为空,请检查")
+        return
+      }
+      data = data.map(item => {
+        if (!!item.infos) {
+          for (let key in item.infos) {
+            item.infos[key] = [{ "value": item.infos[key] != "" ? item.infos[key] : null }]
+          }
+        }
+        if (!!item.flowBuild) {
+          item.building_id = item.flowBuild.split("-")[0]
+          item.floor_id = item.flowBuild.split("-")[1] || null
+          //不存在floor字段去除floor
+          if (!item.floor_id) {
+            delete item.floor_id
+          }
+          delete item.flowBuild
+        }
+        return item
+      })
+      if (data.length) {
+        this.createJson(data)
+      } else {
+        this.$message.error("信息点不能为空")
+      }
+    },
+
+    //创建设备接口
+    async createJson(data) {
+      let param = {
+        data: { criterias: data },
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      }
+      param.data.criterias.map(item => {
+        if (!!item.infos.DPSupplierID && !!item.infos.DPSupplierID[0].value) {
+          item.infos.DPSupplierID[0].value = item.infos.DPSupplierID[0].value.split("-")[0]
+        }
+        if (!!item.infos.DPManufacturerID && !!item.infos.DPManufacturerID[0].value) {
+          item.infos.DPManufacturerID[0].value = item.infos.DPManufacturerID[0].value.split("-")[0]
+        }
+        if (!!item.infos.DPInsurerID && !!item.infos.DPInsurerID[0].value) {
+          item.infos.DPInsurerID[0].value = item.infos.DPInsurerID[0].value.split("-")[0]
+        }
+        if (!!item.infos.DPMaintainerID && !!item.infos.DPMaintainerID[0].value) {
+          item.infos.DPMaintainerID[0].value = item.infos.DPMaintainerID[0].value.split("-")[0]
+        }
+        if (!!item.infos.DPSpecificationID && !!item.infos.DPSpecificationID[0].value) {
+          item.infos.DPSpecificationID[0].value = item.infos.DPSpecificationID[0].value.split("-")[0]
+        }
+      })
+      BatchCreateSome(param, res => {
+        console.log(res)
+        this.createPost(param.data.criterias, res.Content)
+        this.dialog.addDevice = false
+        console.log(this.deviceType)
+        this.$emit("close", this.deviceType)
+        tools.removeItem(this.deviceType.code)
+      })
+    },
+
+    //c创建请求
+    async createPost(param, data) {
+      console.log(param, data)
+      let pushParam = {
+        data: { criterias: [] },
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      }
+      let list = []
+      data.map((item, index) => {
+        //linkSystem存在且长度不为0
+        if (!!param[index].linkSystem && param[index].linkSystem.length) {
+          param[index].linkSystem.map(child => {
+            let list = {
+              "from_id": child.id, //必填,object id
+              "to_id": item.id, //必填,object id
+              "graph_id": this.graphyId,                     //必填,图实例id
+              "rel_type": "1",
+            }
+            pushParam.data.criterias.push(list)
+          })
+        }
+
+        if (!!param[index].Checked) {
+          param[index].id = item.id
+          list.push(param[index])
+        }
+      })
+      await this.EqCreateAs(list)
+      await this.relationCreate(pushParam)
+    },
+
+    //根据设备id创建资产
+    async EqCreateAs(list) {
+      let param = {
+        FmList: [],
+        ProjId: this.$route.query.projId,
+        UserId: this.$route.query.userId
+      }
+      list.map(item => {
+        param.FmList.push({
+          EquipmentId: item.id,
+          FmId: "Pe" + uuid(32, 16),
+          FmName: item.EquipLocalName || "",
+          Family: this.deviceType.assetType,
+          FamilyName: this.deviceType.assetName,
+          ProjId: this.$route.query.projId,
+          Inofs: {
+            DPManufacturerID: item.infos.DPManufacturerID ? item.infos.DPManufacturerID[0].value : null,
+            DPSpecificationID: item.infos.DPSpecificationID ? item.infos.DPSpecificationID[0].value : null,
+            DPSupplierID: item.infos.DPSupplierID ? item.infos.DPSupplierID[0].value : null,
+            DPMaintainerID: item.infos.DPMaintainerID ? item.infos.DPMaintainerID[0].value : null,
+            DPInsurerID: item.infos.DPInsurerID ? item.infos.DPInsurerID[0].value : null,
+          }
+        })
+      })
+      await createAssetsList(param, res => {
+        return true
+      })
+    },
+
+    //创建关系
+    async relationCreate(param) {
+      await createRelation(param).then(res => {
+        if (res.data.Result == "success") {
+          return true
+        } else {
+          this.$message.error("请求失败:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求失败")
+      })
+    },
+
+    changeWatch() {
+      this.getData()
+    },
+
+    /**
+     * 表头文案处理函数
+     * @param list header数组数据
+     *
+     * @return 处理好的文案
+     */
+    delHeader(list) {
+      let arr = tools.copyArr(list)
+      // 如果不是只读状态,添加四大厂商选择
+      if (!this.onlyRead) {
+        arr = showTools.arrToArr(arr)
+      }
+      let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2"]
+      readArr.push("Own")
+      let data = showTools.changeHeader(arr, readArr, false, this.isWatch, true)
+      data.unshift("同时创建资产", "所属系统实例");
+      if (this.floorFalg) {
+        data.splice(1, 0, "所属建筑楼层")
+      }
+      return data;
+    },
+
+    /**
+     * 表头数据处理函数
+     * @param list header数组数据
+     *
+     * @return 处理好的数据格式
+     */
+    getType(list) {
+      let arr = tools.copyArr(list)
+      if (!this.onlyRead) {
+        arr = showTools.arrToArr(arr)
+      }
+      let data = showTools.showTypes(arr, this.onlyRead, this.isWatch, true)
+      data.unshift(
+        {
+          type: "checkbox",
+          checkedTemplate: 1,
+          uncheckedTemplate: 0,
+          data: "Checked",
+          label: {
+            position: "after",
+          }
+        },
+        {
+          data: "linkSystem",
+          renderer: text.systemList,
+          readOnly: true
+        }
+      );
+      if (this.floorFalg) {
+        data.splice(1, 0, {
+          data: "flowBuild",
+          renderer: tools.customDropdownRenderer,
+          editor: "chosen",
+          chosenOptions: {
+            // multiple: true,//多选
+            data: this.floorData
+          }
+        })
+      }
+      return data;
+    },
+    //初始化插件
+    initHot() {
+      var container = document.getElementById("myHandson");
+      let winHeight = document.documentElement.clientHeight;
+      console.log(this.delHeader(this.headers), this.getType(this.headers))
+      this.hot = new Handsontable(container, {
+        data: this.main,
+        colHeaders: this.delHeader(this.headers), //表头文案
+        columns: this.getType(this.headers), //数据显示格式
+        filters: true,
+        maxRows: this.main.length,
+        rowHeaders: true,
+        height: winHeight - 100 - 50 - 60,
+        columnSorting: true, //添加排序
+        sortIndicator: true, //添加排序
+        renderAllRows: true,
+        autoColumnSize: true,
+        language: "zh-CN",
+        manualColumnResize: true,
+        manualColumnMove: true,
+        dropdownMenu: [
+          "filter_by_condition",
+          "filter_by_value",
+          "filter_action_bar"
+        ],
+        contextMenu: {
+          items: {
+            remove_row: {
+              name: "删除该业务空间"
+            }
+          }
+        },
+        filters: true,
+        afterFilter: this.trimmedRows,
+        // 事件
+        afterChange: this.tdChange, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        beforeRemoveRow: this.romoveFm, //右键删除
+        afterOnCellMouseDown: this.eventClick //鼠标点击
+        // afterOnCellMouseUp: this.eventClick
+      });
+      let pro = document.getElementById("hot-display-license-info");
+      if (!!pro) {
+        pro.parentNode.removeChild(pro);
+      }
+      this.isLoading = false;
+    },
+
+    tdChange() {
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //表格中的点击
+    eventClick(el, rowArr) {
+      console.log(el, rowArr)
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      let filter = this.filtersArr;
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.hot.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.main[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.main[sortArr[rowArr.row]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (trimmedArr.length) {
+        let infos = this.main[trimmedArr[rowArr.row]];
+        this.getInfors(infos, trimmedArr[rowArr.row]);
+      } else {
+        let infos = this.main[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+
+    getInfors(infos, row) {
+      //其他的开始判断
+      let val = this.hot.colToProp(row.col);
+
+      if (val == "linkSystem") {
+        this.systemList = this.main[row.row].linkSystem || []
+        this.dialog.systemType = true
+      }
+
+      //   if (val == "infos.Brand" || val == "infos.Specification") {
+      //     this.myDialog.firm = true;
+      //   }
+      if (val == "infos.DPManufacturerID") {
+        this.myDialog.firm = true;
+      }
+
+      if (val == "infos.SupplierContractID") {
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos.DPSupplierID) {
+            falg = this.main[row.row].infos.DPSupplierID.split("-")[0]
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.supply = true;
+        } else {
+          this.$message("请先选择供应商")
+        }
+      }
+
+      if (val == "infos.InsuranceNum") {
+        //选择保单
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos.DPInsurerID) {
+            falg = this.main[row.row].infos.DPInsurerID.split("-")[0]
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.guarantee = true;
+        } else {
+          this.$message("请先选择保险商")
+        }
+      }
+
+      if (val == "infos.InsuranceFile" || val == "infos.Archive") {
+        this.filesArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        this.myDialog.uploadFiles = true
+      }
+
+      if (
+        val == "infos.InstallPic" ||
+        val == "infos.InstallDrawing" ||
+        val == "infos.Nameplate" ||
+        val == "infos.Drawing"
+      ) {
+        if (val == "infos.Nameplate") {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
+        } else {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
+        }
+        this.myDialog.uploadImgs = true
+      }
+
+      if (val == "infos.Pic") {
+        // console.log(this.main[row.row].infos[val.split(".")[1]], "this.main[row.row].infos[val.split")
+        this.picsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
+        this.myDialog.pic = true
+      }
+
+      if (
+        val == "infos.DPSupplierID"
+      ) {
+        if (!!this.main[row.row].Checked) {
+          this.myDialog.supplier = true;
+        } else {
+          this.$message("该信息点需勾选同步创建资产方可编辑")
+        }
+      }
+
+      if (val == "infos.DPMaintainerID"
+      ) {
+        if (!!this.main[row.row].Checked) {
+          this.myDialog.maintainer = true;
+        } else {
+          this.$message("该信息点需勾选同步创建资产方可编辑")
+        }
+      }
+
+      if (
+        val == "infos.DPInsurerID"
+
+      ) {
+        if (!!this.main[row.row].Checked) {
+          this.myDialog.insurer = true;
+        } else {
+
+          this.$message("该信息点需勾选同步创建资产方可编辑")
+        }
+      }
+      this.row = row.row
+      this.messKey = val
+      console.log(val, row);
+    },
+
+    //获取被筛选掉的行号
+    trimmedRows() {
+      // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
+      var plugin = this.hot.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.main.length;
+      let dataArr = new Array();
+      for (let i = 0; i < dataLength; i++) {
+        dataArr.push(i);
+      }
+      if (plugin.length <= 0) {
+        dataArr = undefined;
+      } else {
+        dataArr = this.array_diff(dataArr, plugin);
+      }
+      return dataArr || [];
+      // var DataArray = new Array();
+
+      // for (var i = 0; i < plugin.length; i++) {
+      //     // 通过行号获取数据
+      //     DataArray.push(this.hot.getSourceDataAtRow(plugin[i]));
+      // }
+    },
+
+    //判断是否为空行
+    isEmptyRow(instance, row) {
+      var rowData = instance.countRows();
+      for (var i = 0, ilen = rowData.length; i < ilen; i++) {
+        if (rowData[i] !== null) {
+          return false;
+        }
+      }
+      return true;
+    },
+    //选择型号修改
+    firmChange(data) {
+      for (let key in data) {
+        // this.utilToKey(key, "brand", data, "Brand")
+        // this.utilToKey(key, "name", data, "Specification")
+        // this.utilToKey(key, "venderName", data, "Manufacturer")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name + "/" + data.brand
+          this.utilToKey(key, "venderId", data, "DPManufacturerID")
+        }
+        this.utilToKey(key, "specificationId", data, "DPSpecificationID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //供应商合同
+    supplyChange(data) {
+      let changeData = { id: data }
+      this.utilToKey("id", "id", changeData, "SupplierContractID")
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险合同
+    guaranteeChange(data) {
+      console.log("保险合同发生改变", data)
+      for (let key in data) {
+        this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
+        this.utilToKey(key, "contractFile", data, "InsuranceFile")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //如果选择供应商之后
+    supplierChange(data) {
+      console.log("供应商", data)
+      for (let key in data) {
+        // this.utilToKey(key, "name", data, "Supplier")
+        // this.utilToKey(key, "email", data, "SupplierEmail")
+        // this.utilToKey(key, "website", data, "SupplierWeb")
+        // this.utilToKey(key, "phone", data, "SupplierPhone")
+        // this.utilToKey(key, "fox", data, "SupplierFax")
+        // this.utilToKey(key, "man", data, "SupplierContactor")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name
+          console.log(data)
+          this.utilToKey(key, "venderId", data, "DPSupplierID")
+        }
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险商变更
+    changeInsurer(data) {
+      for (let key in data) {
+        // this.utilToKey(key, "name", data, "Insurer")
+        // this.utilToKey(key, "email", data, "InsurerEmail")
+        // this.utilToKey(key, "website", data, "InsurerWeb")
+        // this.utilToKey(key, "phone", data, "InsurerFax")
+        // this.utilToKey(key, "man", data, "InsurerContactor")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name
+          this.utilToKey(key, "venderId", data, "DPInsurerID")
+        }
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //维修商变更
+    changeMaintainer(data) {
+      console.log(data, "data")
+      for (let key in data) {
+        // this.utilToKey(key, "name", data, "Maintainer")
+        // this.utilToKey(key, "email", data, "MaintainerEmail")
+        // this.utilToKey(key, "website", data, "MaintainerWeb")
+        // this.utilToKey(key, "phone", data, "MaintainerPhone")
+        // this.utilToKey(key, "fox", data, "MaintainerFax")
+        // this.utilToKey(key, "man", data, "MaintainerContactor")
+        if (key == "venderId") {
+          data[key] = data[key] + "-" + data.name
+          this.utilToKey(key, "venderId", data, "DPMaintainerID")
+        }
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    utilToKey(key, name, data, messName) {
+      if (key == name) {
+        this.setDataToMain(data[key], messName, this.row)
+      }
+    },
+
+    //上传文件弹窗触发事件
+    fileChange(keys) {
+      this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //上传图片弹窗触发事件
+    imgChange(keys) {
+      console.log(keys, "keys", this.messKey.split("."), this.row)
+      this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //设备图片弹窗改变事件
+    changePics(keys) {
+      this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //系统实例弹窗确定
+    setSystem(data) {
+      this.main[this.row].linkSystem = data
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //判断是否有值,有值赋值
+    setDataToMain(data, key, row) {
+      if (!!data && data != '--') {
+        if (!!this.main[row].infos) {
+          //铭牌照片特殊处理
+          this.main[row].infos[key] = data
+        } else {
+          this.main[row].infos = {}
+          this.main[row].infos[key] = data
+        }
+      } else {
+        this.main[row].infos[key] = ''
+      }
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.addDevice) {
+          this.setValue()
+        }
+      }
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#addDevice {
+  overflow: hidden;
+}
+</style>

+ 862 - 0
src/components/business_space/dialogs/addDialog/dialogSystem.vue

@@ -0,0 +1,862 @@
+<!--
+    上传文件的弹窗
+-->
+
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :center="isCenter"
+      :visible.sync="dialog.addDevice"
+      :width="width"
+      :fullscreen="isFull"
+      :before-close="close"
+    >
+      <div id="addDevice">
+        <div v-show="!isCenter">
+          <my-cascader ref="cascader" @change="changeCader"></my-cascader>
+        </div>
+        <div v-if="isCenter">
+          <div>
+            <div class="hanson-bar">
+              <span>当前选择的设备族:{{deviceType.facility}}</span>
+              <div style="width:500px;float:right;overflow:hidden;">
+                <span>增加</span>
+                <el-input v-model="addNum" style="width:40px;" placeholder="增加个数" size="small"></el-input>
+                <span>个{{deviceType.facility}}</span>
+                <el-button size="small" @click="addMain">增加</el-button>
+                <el-button size="small" @click="undo" icon="iconfont icon-undo">撤销</el-button>
+              </div>
+            </div>
+            <div v-show="main && main.length" id="myHandson" ref="myHandson"></div>
+          </div>
+        </div>
+      </div>
+      <div v-show="!isCenter" slot="footer" class="dialog-footer">
+        <el-button>取 消</el-button>
+        <el-button type="primary" @click="step(1)">下 一 步</el-button>
+      </div>
+      <span v-show="isCenter" slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="createAssets">创建系统</el-button>
+      </span>
+    </el-dialog>
+    <qrcode :dialog="myDialog" :addBody="true" ref="qrcode"></qrcode>
+    <firm ref="firm" :dialog="myDialog"></firm>
+    <supply-dialog @change="supplyChange" :id="id" ref="supply" :dialog="myDialog"></supply-dialog>
+    <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
+    <guarantee-dialog ref="guarantee" :id="id" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
+    <upload-files-dialog
+      ref="upload"
+      @changeFile="fileChange"
+      :keysArr="filesArr"
+      :dialog="myDialog"
+    ></upload-files-dialog>
+    <upload-img-dialog @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
+    <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="myDialog"></maintainer-dialog>
+    <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
+    <pic-dialog :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
+  </div>
+</template>
+<script>
+
+import myCascader from "@/components/lib/cascaders/system";
+import hansonTable from "@/components/dialogHanson/addDevice";
+import tools from "@/assets/js/tools";
+import qrcode from "@/components/lib/qrcode";
+import firm from "@/components/dialogs/list/firm";
+import supplyDialog from "@/components/dialogs/list/supplyDialog";
+import supplierDialog from "@/components/dialogs/list/supplierDialog";
+import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
+import insurerDialog from "@/components/dialogs/list/insurerDialog";
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
+import picDialog from "@/components/dialogs/list/picDialog"
+
+//下拉插件
+import "@/assets/js/chosen.jquery.min";
+import "@/assets/js/handsontable-chosen-editor";
+
+import { getTableHeader, BatchCreateSome, getSpaceFloor } from "@/api/request";
+let table = function (num) {
+  let main = []
+  for (let i = 0; i < num; i++) {
+    main.push({})
+  }
+  return main
+}
+export default {
+  components: {
+    myCascader,
+    hansonTable,
+    qrcode, //二维码页面
+    firm, //
+    supplyDialog,
+    supplierDialog,
+    guaranteeDialog,
+    uploadFilesDialog,
+    maintainerDialog,
+    insurerDialog,
+    uploadImgDialog,
+    picDialog
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          addDevice: false
+        };
+      }
+    },
+    assetType: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      width: "30%",
+      isFull: false,//dialog是否为全屏
+      title: "确定新增系统的类型",
+      isCenter: false,
+      deviceType: {},
+      main: table(1),
+      mess: {},
+      headers: null,
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 400,
+        currentPage: 1
+      },
+      id: 0,
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        firm: false, //厂商弹窗
+        supply: false, //选择供应合同
+        supplier: false, //供应商选择
+        guarantee: false, //选择保单
+        maintainer: false, //选择维修商
+        insurer: false, //选择保险公司
+        uploadFiles: false,//上传文件
+        uploadImgs: false,//上传单个图片
+        pic: false, //多个图片
+      },
+      addNum: 1,//增加个数
+      row: null,//被修改的row
+      filesArr: [],//保存临时的文件key
+      messKey: null,
+      imgsArr: [],//临时保存的图片key数组
+      picsArr: [],//临时设备图片keys数组
+      param: {
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      },
+      floorData: []
+    };
+  },
+  created() {
+    this.setValue()
+    this.getFloorData()
+  },
+  mounted() { },
+  methods: {
+    //设置默认选中数据
+    setValue() {
+      this.$nextTick(_ => {
+        this.$refs.cascader.setValue(this.assetType)
+      })
+    },
+    //关闭
+    close(done) {
+      this.$emit("close")
+      done()
+    },
+    //获取楼层数据
+    getFloorData() {
+      getSpaceFloor(this.param).then(res => {
+        if (res.data.Result == 'success') {
+          let data = this.changeArr(res.data.Content), floorData = []
+          data.map(item => {
+            floorData.push({
+              Code: item.value,
+              Name: item.label
+            })
+          })
+          this.floorData = floorData
+        } else {
+          this.$message.error(res.data.ResultMsg)
+        }
+      }).catch(() => {
+        this.$message.error("请求出错")
+      })
+    },
+    //将数组转换成optiosn格式
+    changeArr(arr) {
+      return arr.map(item => {
+        if (item.floors && item.floors.length) {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: item.floors.map(i => {
+              return {
+                value: i.id,
+                label: i.infos.FloorLocalName || "未知",
+              }
+            })
+          }
+        } else {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: null,
+            isChilren: 1,
+          }
+        }
+      })
+    },
+
+    //增加个数
+    addMain() {
+      for (let i = 0; i < this.addNum; i++) {
+        this.main.push({})
+      }
+      this.hot.loadData(this.main)
+    },
+
+    //下一步
+    step(val) {
+      if (!!val) {
+        this.isFull = true
+        this.isCenter = true
+        this.title = "添加系统"
+        this.getData()
+      } else {
+        this.isFull = false
+        this.isCenter = false
+      }
+    },
+    //修改设备类型
+    changeCader(val) {
+      this.deviceType = val
+    },
+    //获取header的mess
+    getHeader(mess) {
+      this.mess = mess;
+    },
+
+    //获取主体内容
+    getMain(floorMess) {
+    },
+
+    //获取表头
+    getData() {
+      this.main = table(1)
+      getTableHeader({
+        code: this.deviceType.code,
+        ProjId: this.$route.query.projId
+      }).then(res => {
+        this.headers = res.data.Content;
+        if (!!this.hot) {
+          this.hot.destroy();
+          this.hot = null;
+        }
+        let data = tools.getItem(this.deviceType.code)
+        if (!!data) {
+          this.main = data
+        }
+        this.initHot();
+      });
+    },
+
+    //撤回
+    undo() {
+      this.hot.undo();
+    },
+
+    //刷新
+    reset() {
+      this.getData();
+    },
+
+    //创建资产
+    createAssets() {
+      let data = []
+      let copyData = tools.copyArr(this.main)
+      copyData.map(item => {
+        if (!!item.infos || !!item.relation) {
+          item.equipment_category = this.deviceType.code
+          data.push(item)
+        }
+      })
+      data = data.map(item => {
+        if (!!item.infos) {
+          for (let key in item.infos) {
+            item.infos[key] = [{ "value": item.infos[key] != "" ? item.infos[key] : null }]
+          }
+        }
+        if (!!item.flowBuild) {
+          if (!!item.building_id) {
+          } else {
+            item.building_id = ""
+          }
+          item.building_id = item.flowBuild
+          delete item.flowBuild
+        }
+        return item
+      })
+      if (data.length) {
+        this.createJson(data)
+      } else {
+        this.$message.error("信息点不能为空")
+      }
+    },
+
+    //新建资产请求
+    async createJson(data) {
+      let param = {
+        data: { criterias: data },
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      }
+      console.log(param)
+      this.createPost(param)
+    },
+
+    async createPost(param) {
+      BatchCreateSome(param, res => {
+        // console.log("change")
+        this.$emit("close", this.deviceType)
+        tools.removeItem(this.deviceType.code)
+        this.dialog.addDevice = false
+        this.$message.success("创建成功")
+      })
+    },
+
+    /**
+     * 表头文案处理函数
+     * @param arr header数组数据
+     *
+     * @return 处理好的文案
+     */
+    delHeader(arr) {
+      let data = arr.map(item => {
+        if (
+          item.InputMode == "A1" ||
+          item.InputMode == "A2" ||
+          item.InputMode == "B1" ||
+          item.InputMode == "C5" ||
+          item.InputMode == "D1" ||
+          item.InputMode == "D2" ||
+          item.InputMode == "X" ||
+          item.InputMode == "L" ||
+          item.InputMode == "L1" ||
+          item.InputMode == "L2" ||
+          item.InputMode == "F1" ||
+          item.InputMode == "F2"
+        ) {
+          if (item.Unit == "") {
+            return item.InfoPointName;
+          } else {
+            return item.InfoPointName + "(" + item.Unit + ")";
+          }
+        } else {
+          return undefined;
+        }
+      });
+      data = data.filter(item => item);
+      data.unshift("所属建筑楼层");
+      return data;
+    },
+
+    /**
+     * 表头数据处理函数
+     * @param arr header数组数据
+     *
+     * @return 处理好的数据格式
+     */
+    getType(arr) {
+      let data = arr.map(item => {
+        //二维码
+        if (item.InfoPointCode == "EquipQRCode") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+        //厂商选择
+        if (item.InfoPointCode == "Brand" || item.InfoPointCode == "Specification") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+        if (item.InfoPointCode == "SupplierContractID") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (item.InfoPointCode == "InsuranceNum") {
+          //选择保单
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (item.InfoPointCode == "InsuranceFile" || item.InfoPointCode == "Archive") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (
+          item.InfoPointCode == "InstallLocation" ||
+          item.InfoPointCode == "InstallPic" ||
+          item.InfoPointCode == "InstallDrawing" ||
+          item.InfoPointCode == "Nameplate" ||
+          item.InfoPointCode == "Pic" ||
+          item.InfoPointCode == "Drawing"
+        ) {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+
+        if (
+          item.InfoPointCode == "Maintainer" ||
+          item.InfoPointCode == "Supplier" ||
+          item.InfoPointCode == "Insurer" ||
+          item.InfoPointCode == "InsurerContactor"
+        ) {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.lookDetails,
+            readOnly: true
+          }
+        }
+        if (item.InputMode == "D1") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.customDropdownRenderer,
+            editor: "chosen",
+            chosenOptions: {
+              // multiple: true,//多选
+              data: item.DataSource.Content || ""
+            }
+          };
+        } else if (item.InputMode == "A1" || item.InputMode == "A2") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            type: "numeric",
+            numericFormat: {
+              pattern: "0,0.00"
+              // culture: 'de-DE' // use this for EUR (German),
+              // more cultures available on http://numbrojs.com/languages.html
+            }
+          };
+        } else if (item.InputMode == "C5") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            type: "date",
+            dateFormat: "YYYY-MM-DD",
+            correctFormat: true
+          };
+        } else if (
+          item.InputMode == "B1" ||
+          item.InputMode == "L" ||
+          item.InputMode == "L1" ||
+          item.InputMode == "L2"
+        ) {
+          return {
+            data: "infos." + item.InfoPointCode
+          };
+        } else if (
+          item.InputMode == "X" ||
+          item.InputMode == "F2"
+          // item.InputMode == "L1" ||
+          // item.InputMode == "L2"
+        ) {
+          return {
+            data: "infos." + item.InfoPointCode,
+            readOnly: true
+          };
+        } else if (item.InputMode == "D2") {
+          return {
+            data: "infos." + item.InfoPointCode,
+            renderer: tools.customDropdownRenderer,
+            editor: "chosen",
+            chosenOptions: {
+              multiple: true, //多选
+              data: item.DataSource.Content || ""
+            }
+          };
+        } else {
+          return undefined;
+        }
+
+      });
+      data.unshift(
+        {
+          data: "flowBuild",
+          renderer: tools.customDropdownRenderer,
+          editor: "chosen",
+          chosenOptions: {
+            // multiple: true,//多选
+            data: this.floorData
+          }
+        }
+      );
+      data = data.filter(item => item);
+      return data;
+    },
+
+
+    //初始化插件
+    initHot() {
+      var container = document.getElementById("myHandson");
+      let winHeight = document.documentElement.clientHeight;
+      this.hot = new Handsontable(container, {
+        data: this.main,
+        colHeaders: this.delHeader(this.headers), //表头文案
+        columns: this.getType(this.headers), //数据显示格式
+        filters: true,
+        height: winHeight - 100 - 50 - 60,
+        columnSorting: true, //添加排序
+        sortIndicator: true, //添加排序
+        renderAllRows: true,
+        autoColumnSize: true,
+        language: "zh-CN",
+        manualColumnResize: true,
+        manualColumnMove: true,
+        dropdownMenu: [
+          "filter_by_condition",
+          "filter_by_value",
+          "filter_action_bar"
+        ],
+        contextMenu: {
+          items: {
+            remove_row: {
+              name: "删除该资产"
+            }
+          }
+        },
+        afterChange: this.tdChange, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        afterRemoveRow: this.romoveFm, //右键删除
+        afterOnCellMouseDown: this.eventClick //鼠标点击
+      });
+      let pro = document.getElementById("hot-display-license-info");
+      if (!!pro) {
+        pro.parentNode.removeChild(pro);
+      }
+      this.isLoading = false;
+    },
+
+    tdChange() {
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //表格中的点击
+    eventClick(el, rowArr) {
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      let filter = this.filtersArr;
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.hot.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.main[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.main[sortArr[rowArr.row]];
+        this.getInfors(infos, sortArr[rowArr.row]);
+      } else if (trimmedArr.length) {
+        let infos = this.main[trimmedArr[rowArr.row]];
+        this.getInfors(infos, trimmedArr[rowArr.row]);
+      } else {
+        let infos = this.main[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+
+    getInfors(infos, row) {
+      //其他的开始判断
+      let val = this.hot.colToProp(row.col);
+      if (val == "infos.EquipQRCode") {
+        this.myDialog.qrcode = true;
+        this.$refs.qrcode.getCanvas(1111);
+      }
+
+      if (val == "infos.Brand" || val == "infos.Specification") {
+        this.myDialog.firm = true;
+      }
+
+      if (val == "infos.SupplierContractID") {
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos) {
+            falg = this.main[row.row].infos.DPSupplierID
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.supply = true;
+        } else {
+          this.$message("请先选择供应商")
+        }
+      }
+
+      if (val == "infos.InsuranceNum") {
+        //选择保单
+        let falg = null
+        if (!!this.main[row.row].infos) {
+          if (!!this.main[row.row].infos) {
+            falg = this.main[row.row].infos.DPInsurerID
+          }
+        }
+        if (!!falg) {
+          this.id = falg
+          this.myDialog.guarantee = true;
+        } else {
+          this.$message("请先选择保险商")
+        }
+      }
+
+      if (val == "infos.InsuranceFile" || val == "infos.Archive") {
+        this.filesArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        this.myDialog.uploadFiles = true
+      }
+
+      if (
+        val == "infos.InstallLocation" ||
+        val == "infos.InstallPic" ||
+        val == "infos.InstallDrawing" ||
+        val == "infos.Nameplate" ||
+        val == "infos.Drawing"
+      ) {
+        if (val == "infos.Nameplate") {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]].key] : []) : []
+        } else {
+          this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? [this.main[row.row].infos[val.split(".")[1]]] : []) : []
+        }
+        this.myDialog.uploadImgs = true
+      }
+
+      if (val == "infos.Pic") {
+        // console.log(this.main[row.row].infos[val.split(".")[1]], "this.main[row.row].infos[val.split")
+        this.picsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
+        console.log(this.picsArr)
+        this.myDialog.pic = true
+      }
+
+      if (
+        val == "infos.Supplier"
+      ) {
+        this.myDialog.supplier = true;
+      }
+
+      if (val == "infos.Maintainer") {
+        this.myDialog.maintainer = true;
+      }
+
+      if (
+        val == "infos.Insurer" ||
+        val == "infos.InsurerContactor") {
+        this.myDialog.insurer = true;
+      }
+      this.row = row.row
+      this.messKey = val
+      console.log(val, row);
+    },
+
+    //获取被筛选掉的行号
+    trimmedRows() {
+      // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
+      var plugin = this.hot.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.main.length;
+      let dataArr = new Array();
+      for (let i = 0; i < dataLength; i++) {
+        dataArr.push(i);
+      }
+      if (plugin.length <= 0) {
+        dataArr = undefined;
+      } else {
+        dataArr = this.array_diff(dataArr, plugin);
+      }
+      return dataArr || [];
+      // var DataArray = new Array();
+
+      // for (var i = 0; i < plugin.length; i++) {
+      //     // 通过行号获取数据
+      //     DataArray.push(this.hot.getSourceDataAtRow(plugin[i]));
+      // }
+    },
+
+    //判断是否为空行
+    isEmptyRow(instance, row) {
+      var rowData = instance.countRows();
+      for (var i = 0, ilen = rowData.length; i < ilen; i++) {
+        if (rowData[i] !== null) {
+          return false;
+        }
+      }
+      return true;
+    },
+
+    //如果选择供应商之后
+    supplierChange(data) {
+      console.log(data, "供应商")
+      for (let key in data) {
+        this.utilToKey(key, "name", data, "Supplier")
+        this.utilToKey(key, "email", data, "SupplierEmail")
+        this.utilToKey(key, "website", data, "SupplierWeb")
+        this.utilToKey(key, "phone", data, "SupplierPhone")
+        this.utilToKey(key, "fox", data, "SupplierFax")
+        this.utilToKey(key, "man", data, "SupplierContactor")
+        this.utilToKey(key, "venderId", data, "DPSupplierID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //供应商合同
+    supplyChange(data) {
+      let changeData = { id: data }
+      this.utilToKey("id", "id", changeData, "SupplierContractID")
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险合同
+    guaranteeChange(data) {
+      console.log("保险合同发生改变", data)
+      for (let key in data) {
+        this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
+        this.utilToKey(key, "contractFile", data, "InsuranceFile")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //保险商变更
+    changeInsurer(data) {
+      console.log(data, "保险商")
+      for (let key in data) {
+        this.utilToKey(key, "name", data, "Insurer")
+        this.utilToKey(key, "email", data, "InsurerEmail")
+        this.utilToKey(key, "website", data, "InsurerWeb")
+        this.utilToKey(key, "phone", data, "InsurerFax")
+        this.utilToKey(key, "man", data, "InsurerContactor")
+        this.utilToKey(key, "venderId", data, "DPInsurerID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //维修商变更
+    changeMaintainer(data) {
+      for (let key in data) {
+        this.utilToKey(key, "name", data, "Maintainer")
+        this.utilToKey(key, "email", data, "MaintainerEmail")
+        this.utilToKey(key, "website", data, "MaintainerWeb")
+        this.utilToKey(key, "phone", data, "MaintainerPhone")
+        this.utilToKey(key, "fox", data, "MaintainerFax")
+        this.utilToKey(key, "man", data, "MaintainerContactor")
+        this.utilToKey(key, "venderId", data, "DPMaintainerID")
+      }
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    utilToKey(key, name, data, messName) {
+      if (key == name) {
+        this.setDataToMain(data[key], messName, this.row)
+      }
+    },
+
+    //上传文件弹窗触发事件
+    fileChange(keys) {
+      this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //上传图片弹窗触发事件
+    imgChange(keys) {
+      this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+    },
+
+    //设备图片弹窗改变事件
+    changePics(keys) {
+      this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
+      tools.setItem(this.deviceType.code, this.main)
+      console.log("assets", keys)
+    },
+
+    //判断是否有值,有值赋值
+    setDataToMain(data, key, row) {
+      if (!!data && data != '--') {
+        if (!!this.main[row].infos) {
+          //铭牌照片特殊处理
+          if (key == 'Nameplate') {
+            this.main[row].infos[key] = {
+              "systemId": "dataPlatform",
+              "name": "铭牌照片",
+              "type": "image",
+              "key": data
+            }
+          } else {
+            this.main[row].infos[key] = data
+          }
+        } else {
+          this.main[row].infos = {}
+          if (key == 'Nameplate') {
+            this.main[row].infos[key] = {
+              "systemId": "dataPlatform",
+              "name": "铭牌照片",
+              "type": "image",
+              "key": data
+            }
+          } else {
+            this.main[row].infos[key] = data
+          }
+        }
+      } else {
+        this.main[row].infos[key] = ''
+      }
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        console.log("changed")
+        if (this.dialog.addDevice) {
+          this.setValue()
+        }
+      }
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#addDevice {
+  overflow: hidden;
+}
+</style>

+ 344 - 0
src/components/business_space/dialogs/changeRea.vue

@@ -0,0 +1,344 @@
+<!--
+    changeRea 厂商
+-->
+<template>
+  <el-dialog title="关联资产" :visible.sync="dialog.changeRea" width="800px">
+    <div>
+      <div id="changeRea">
+        <div class="title-search" style="margin-bottom: 10px;">
+          <el-input
+            placeholder="输入名称查询"
+            v-model="search"
+            size="small"
+            style="width:300px;"
+            clearable
+          ></el-input>
+          <el-button @click="getData" size="small">查找</el-button>
+        </div>
+        <div>
+          <floor-cascader @change="changeFloor"></floor-cascader>
+        </div>
+        <el-radio-group v-model="radio" style="width:100%;">
+          <el-table :data="tableData" style="width: 100%" height="300px">
+            <el-table-column label="资产名称">
+              <template slot-scope="scope">
+                <el-radio
+                  v-model="radio"
+                  :label="scope.row.id"
+                >{{scope.row.infos.EquipLocalName || scope.row.infos.EquipName}}</el-radio>
+              </template>
+            </el-table-column>
+            <el-table-column label="本地编码">
+              <template
+                slot-scope="scope"
+              >{{scope.row.infos.EquipLocalID || scope.row.infos.EquipID}}</template>
+            </el-table-column>
+            <el-table-column prop="name" label="所在楼层">
+              <template slot-scope="scope">{{getFloor(scope.row.relation)}}</template>
+            </el-table-column>
+            <el-table-column label="设备族">
+              <template slot-scope="scope">{{getFramily(scope.row.family)}}</template>
+            </el-table-column>
+            <el-table-column label="安装位置">
+              <template slot-scope="scope">{{scope.row.infos.InstallLocation || "--"}}</template>
+            </el-table-column>
+          </el-table>
+        </el-radio-group>
+        <my-pagination :page="page" @change="changed" style="margin-top:10px;"></my-pagination>
+        <div class="footer">
+          <el-button
+            type="primary"
+            @click="clickTrue"
+            style="display:block;margin: 10px auto 0;"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+    <param-details :isLoad="isLoad" :data="data"></param-details>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import paramDetails from "@/components/dialogs/list/paramDetails"
+import { getBillPropList, getEquipmentFamily, getSpaceFloor, getBussines, upDateTableMain } from "@/api/request"
+import floorCascader from "@/components/lib/floorCascader";
+
+export default {
+  components: {
+    myPagination,
+    paramDetails,
+    floorCascader
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          changeRea: true
+        };
+      }
+    },
+    category: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      tableData: [
+      ],
+      data: {},
+      isLoad: {
+        paramShow: false
+      },
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      },
+      mess: {},
+      codeListCode: [],
+      floorList: []
+    };
+  },
+  created() {
+    this.getCode()
+  },
+  mounted() { },
+  methods: {
+    getFloor(relation) {
+      let floor = !!relation ? relation.floor || "" : ""
+      if (!!floor) {
+        console.log(floor)
+        let floorName = ""
+        this.floorList.map(item => {
+          if (!!item.floors && item.floors.length) {
+            item.floors.map(child => {
+              if (child.id == floor) {
+                floorName = child.infos.FloorLocalName || child.infos.FloorName
+              }
+            })
+          }
+        })
+        return floorName
+      } else {
+        return "--"
+      }
+    },
+
+    clickTrue() {
+      if (!!this.radio) {
+        let param = {
+          UserId: this.$route.query.userId,
+          ProjId: this.$route.query.projId
+        }
+        let paramList = [{
+          EquipmentId: this.category.id,
+          FmId: this.radio
+        }]
+        console.log(param, paramList)
+        upDateTableMain(param, paramList).then(res => {
+          this.$emit("close")
+          this.dialog.changeRea = false
+        })
+        // upDateTableMain(param, res => {
+        // })
+      } else {
+        this.$message("请先选择资产")
+      }
+    },
+
+    getFramily(code) {
+      console.log(code)
+      let name = ""
+      this.codeListCode.map(item => {
+        if (item.code == code) {
+          name = item.name
+        }
+      })
+      return name || "--"
+    },
+    getCode() {
+      getEquipmentFamily(res => {
+        this.codeListCode = res.Content
+        this.getFloorList()
+      })
+    },
+    getFloorList() {
+      let param = {
+        secret: this.$route.query.secret,
+        ProjId: this.$route.query.projId
+      }
+      getSpaceFloor(param).then(res => {
+        if (res.data.Result == "success") {
+          this.floorList = res.data.Content
+        } else {
+          this.$message.error("请求错误:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求错误")
+      })
+    },
+    changeFloor(val) {
+      this.mess = {
+        buildId: val[0] || "",
+        floorId: val[1] || ""
+      }
+      this.getData()
+      console.log(val)
+    },
+    changed() {
+      this.getData()
+    },
+    //查询技术参数
+    lookParam(data) {
+      this.data = data
+      this.isLoad.paramShow = true
+    },
+    getChange() {
+      if (!!this.radio) {
+        this.$emit("changechangeRea", this.radio)
+        this.dialog.changeRea = false
+      } else {
+        this.$message("请选择型号")
+      }
+    },
+    searchKey() {
+      this.changePage()
+    },
+    changePage() {
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      this.getData()
+    },
+    getData() {
+      //   let param = {
+      //     data: {
+      //       "limit": {        // 分页查询, 选填.
+      //         "skip": this.page.size * (this.page.currentPage - 1),  // 跳过多少数据
+      //         "count": this.page.size   // 查询跳过300条数据之后的50条 (默认按照创建时间从大-->小排序)
+      //       },
+      //       filter: {
+      //         EquipLocalName: this.search
+      //       },
+      //       "criteria": {
+      //         "id": "",  // 选填, 默认值是Pj****, 即查询项目下的所有设备
+      //         "family": ["XXX"]         // 必填, 要查询的类型, 只能是设备类型
+      //       }
+      //     },
+      //     secret: this.$route.query.secret,
+      //     ProjId: this.$route.query.projId
+      //   }
+      //   if (this.mess.buildId == "all") {
+      //     param.data.criteria.id = this.mess.ProjId
+      //   } else if (this.mess.buildId == "noKnow") {
+      //     param.data.criteria.id = this.mess.ProjId
+      //     param.data.directOnly = true
+      //   } else if (this.mess.floorId == "noKnow") {
+      //     param.data.criteria.id = this.mess.buildId
+      //     param.data.directOnly = true
+      //   } else if (this.mess.floorId && this.mess.floorId != "all") {
+      //     param.data.criteria.id = this.mess.floorId
+      //   } else if (this.mess.floorId == 'all') {
+      //     param.data.criteria.id = this.mess.buildId
+      //   } else {
+      //     param.data.criteria.id = this.$route.query.projId
+      //   }
+      //   console.log("category", this.category)
+      //   param.data.criteria.family = [this.getType(this.category.category)]
+      //   getBillPropList(param, res => {
+      //     console.log(res)
+      //     this.tableData = res.Content
+      //     this.page.total = res.Count
+      //   })
+      let param = {
+        data: {
+          filter: {
+            EquipLocalName: this.search
+          },
+          directOnly: false,
+          criteria: {
+            id: "",
+            graphType: "Pe2Eq",
+            side: -1,
+            type: ""
+          }
+        },
+        secret: this.$route.query.secret,
+        ProjId: this.$route.query.projId
+      }
+      if (this.mess.buildId == "all") {
+        param.data.criteria.id = this.mess.ProjId
+      } else if (this.mess.buildId == "noKnow") {
+        param.data.criteria.id = this.mess.ProjId
+        param.data.directOnly = true
+      } else if (this.mess.floorId == "noKnow") {
+        param.data.criteria.id = this.mess.buildId
+        param.data.directOnly = true
+      } else if (this.mess.floorId && this.mess.floorId != "all") {
+        param.data.criteria.id = this.mess.floorId
+      } else if (this.mess.floorId == 'all') {
+        param.data.criteria.id = this.mess.buildId
+      } else {
+        param.data.criteria.id = this.$route.query.projId
+      }
+      param.data.criteria.type = [this.getType(this.category.category)]
+      console.log(param)
+      getBussines(param).then(res => {
+        this.tableData = res.data.Content
+        console.log(this.tableData, "this.tableData")
+        this.page.total = res.data.Count
+      })
+    },
+
+    getType(code) {
+      console.log(code, "code")
+      console.log(code.substring(2, 6))
+      let system = code.substring(2, 6), myCode = ""
+      this.codeListCode.map(item => {
+        if (!!item.content && item.content.length) {
+          item.content.map(child => {
+            if (child.code == system) {
+              myCode = item.code
+            }
+          })
+        }
+      })
+      console.log(myCode)
+      return myCode
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.changeRea) {
+          this.changePage()
+          this.radio = ""
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#changeRea {
+  .el-table thead {
+    tr {
+      th {
+        background-color: #f5f7fa;
+      }
+    }
+  }
+}
+</style>

+ 200 - 0
src/components/business_space/dialogs/detailsDialog.vue

@@ -0,0 +1,200 @@
+<template>
+  <el-dialog :visible.sync="isShow.details" :width="width">
+    <span slot="title">
+      <span v-show="step == 1">{{title}}</span>
+      <span v-show="step == 1" style="float:right;margin-right:40px;">
+        <el-button class="saga-padding0" @click="step = 3" type="text">编辑信息</el-button>
+        <!-- <el-button class="saga-padding0" @click="addMyEquip" type="text">添加设备</el-button> -->
+        <el-dropdown @command="addMyEquip" trigger="click">
+          <span class="el-dropdown-link" style="color: #409EFF">添加设备</span>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="EquipinSpace">空间内的设备</el-dropdown-item>
+            <el-dropdown-item command="EquipforSpace">服务于空间的设备</el-dropdown-item>
+            <el-dropdown-item command="EquipXSpace">其他关系的设备</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-button class="saga-padding0" @click="delSpace" type="text">删除该业务空间</el-button>
+      </span>
+      <span v-show="step == 2 || step == 3">
+        <el-button type="text" @click="goBack" icon="el-icon-arrow-left"></el-button>
+      </span>
+    </span>
+    <div id="detailsDialog" v-show="step == 1">
+      <p class="influence-p">{{list.name}}</p>
+      <el-tabs type="border-card">
+        <el-tab-pane label="空间详情">
+          <div class="saga-details">
+            <iframe height="400px" v-if="isShow.details" width="100%" :src="iframeSrc"></iframe>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane label="与空间相关联的设备">
+          <div>
+            <equip-table ref="myEquip"></equip-table>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+    <div v-show="step == 2">
+      <add-equip :activeTabType="activeTabType" ref="addEquip"></add-equip>
+    </div>
+    <div id="detailsDialog" v-if="step == 3">
+      <iframe v-if="step == 3" height="400px" width="100%" :src="iframeSrc2"></iframe>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import Vue from "vue"
+import {
+  Dropdown,
+  DropdownMenu,
+  DropdownItem} from "element-ui"
+Vue.use(Dropdown)
+Vue.use(DropdownMenu)
+Vue.use(DropdownItem)
+
+import { delManySpace } from "@/api/request";
+import equipTable from "@/components/table/equipTable";
+import addEquip from "@/components/table/addEquip";
+
+export default {
+  components: {
+    equipTable,
+    addEquip
+  },
+  props: {
+    width: {
+      type: String,
+      default: "70%"
+    },
+    title: {
+      type: String,
+      default: "头部信息"
+    },
+    isShow: {
+      type: Object
+    },
+    param: {
+      type: Object
+    },
+    activeTabType: {
+      type: Object,
+      default: function () {
+        return {
+          "code": "GeneralZone",
+          "name": "默认分区",
+          "rel_type": "99"
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      step: 1,
+      data: null,
+      proj: null,
+      activeName: "1",
+      list: {},
+      iframeSrc: "",
+      iframeSrc2: "",
+      buildMess: ""
+    };
+  },
+  created() { },
+  methods: {
+    handleClick() { },
+    getData(list, buildMess) {
+      this.step = 1;
+      this.list = list;
+      this.buildMess = buildMess;
+      this.$nextTick(() => {
+        this.$refs.myEquip.getData(list, this.activeTabType);
+      });
+      let perjectId = this.$route.query.projId,
+        secret = this.$route.query.secret;
+      this.iframeSrc =
+        process.env.BASE_URL +
+        ":8889/#/details?perjectId=" +
+        perjectId +
+        "&secret=" +
+        secret +
+        "&FmId=" +
+        list.id +
+        "&type=0&code=" + this.activeTabType.code;
+      this.iframeSrc2 =
+        process.env.BASE_URL +
+        ":8889/#/changeMess?perjectId=" +
+        perjectId +
+        "&secret=" +
+        secret +
+        "&id=" +
+        list.id +
+        "&type=" + this.activeTabType.code;
+    },
+    addMyEquip(str) {
+      this.step = 2;
+      this.$nextTick(() => {
+        console.log(this.activeTabType)
+        this.$refs.addEquip.getData(this.list, this.buildMess, str, this.activeTabType);
+      });
+    },
+    goBack() {
+      this.step = 1;
+      this.$refs.myEquip.getData(this.list, this.activeTabType);
+    },
+    delSpace() {
+      this.$confirm("此操作将永久删除该业务空间, 是否继续?", "删除", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          let param = {
+            ProjId: this.$route.query.projId,
+            secret: this.$route.query.secret,
+            data: {
+              criteria: {
+                ids: [this.list.id]
+              }
+            }
+          };
+          delManySpace(param)
+            .then(res => {
+              if (res.data.Result == "success") {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!"
+                });
+                this.$emit("del");
+              } else {
+                this.$message.error(res.data.ResultMsg);
+              }
+            })
+            .catch(() => {
+              this.$message.error("请求发生错误");
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除"
+          });
+        });
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#detailsDialog {
+  .el-tabs__content {
+    max-height: 400px;
+  }
+  .influence-p {
+    height: 40px;
+    line-height: 40px;
+    font-size: 17px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 143 - 0
src/components/business_space/dialogs/facilityDialog.vue

@@ -0,0 +1,143 @@
+<template>
+  <el-dialog :visible.sync="isShow.facility" :width="width">
+    <span slot="title">
+      <span v-show="step == 1">业务空间详情</span>
+      <!-- <span v-show="step == 1" @click="addMyEquip" style="float: right; margin-right: 40px;">
+        <el-button class="saga-padding0" type="text">添加设备</el-button>
+      </span>-->
+      <span v-show="step == 1" style="float: right; margin-right: 40px;">
+        <el-dropdown @command="addMyEquip" trigger="click">
+          <span class="el-dropdown-link" style="color: #409EFF">添加设备</span>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="EquipinSpace">空间内的设备</el-dropdown-item>
+            <el-dropdown-item command="EquipforSpace">服务于空间的设备</el-dropdown-item>
+            <el-dropdown-item command="EquipXSpace">其他关系的设备</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </span>
+      <span v-show="step == 2">
+        <el-button class="saga-padding0" @click="goBack" type="text" icon="el-icon-arrow-left"></el-button>
+      </span>
+    </span>
+    <div id="detailsDialog" v-show="step == 1">
+      <p class="influence-p">{{data.infos.RoomLocalName || data.infos.RoomName || '--'}}</p>
+      <equip-table :activeTabType="activeTabType" ref="myEquip" :param="myDia"></equip-table>
+    </div>
+    <div v-show="step == 2">
+      <add-equip ref="addEquip"></add-equip>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import Vue from "vue"
+import {
+  Dropdown,
+  DropdownMenu,
+  DropdownItem} from "element-ui"
+Vue.use(Dropdown)
+Vue.use(DropdownMenu)
+Vue.use(DropdownItem)
+import equipTable from "@/components/table/equipTable";
+import addEquip from "@/components/table/addEquip";
+
+export default {
+  components: {
+    equipTable,
+    addEquip
+  },
+  props: {
+    width: {
+      type: String,
+      default: "60%"
+    },
+    title: {
+      type: String,
+      default: "头部信息"
+    },
+    isShow: {
+      type: Object
+    },
+    param: {
+      type: Object
+    },
+    activeTabType: {
+      type: Object,
+      default: function () {
+        return {
+          "code": "GeneralZone",
+          "name": "默认分区",
+          "rel_type": "99"
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      step: 1,
+      data: { infos: {} },
+      proj: null,
+      activeName: "1",
+      myDia: {
+        id: 'Sp11010800034c251365d66111e8bf0a15b159c8e729',
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      },
+      buildMess: {},
+    };
+  },
+  created() { },
+  methods: {
+    handleClick() { },
+    getData(data, buildMess) {
+      this.data = data
+      this.buildMess = buildMess
+      console.log(this.data)
+      this.step = 1
+      this.$nextTick(() => {
+        this.$refs.myEquip.getData(this.data, this.activeTabType)
+      })
+    },
+    goBack() {
+      this.step = 1
+      this.$refs.myEquip.getData(this.data, this.activeTabType)
+    },
+    delSpace() {
+      this.$confirm('此操作将永久删除该业务空间, 是否继续?', '删除', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$message({
+          type: 'success',
+          message: '删除成功!'
+        });
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    addMyEquip(str) {
+      console.log(this.data, this.buildMess)
+      this.step = 2
+      this.$refs.addEquip.getData(this.data, this.buildMess, str, this.activeTabType)
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#detailsDialog {
+  .el-tabs__content {
+    max-height: 400px;
+  }
+  .influence-p {
+    height: 40px;
+    line-height: 40px;
+    font-size: 17px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 140 - 0
src/components/business_space/dialogs/influenceDialog.vue

@@ -0,0 +1,140 @@
+<template>
+    <el-dialog
+    :visible.sync="isShow.influence"
+    :center="true"
+    :width="width">
+    <span slot="title">{{title}}</span>
+    <div id="influenceDialog">
+        <p class="influence-p">受元空间变化影响,部分业务空间需重新划分</p>
+        <el-tabs type="border-card">
+          <el-tab-pane v-for="(item,index) in tabsList" v-if="index == 0">
+            <span slot="label">{{item.name}}</span>
+            <p style="line-height:30px;font-size:20px;margin-bottom: 20px;">受影响的业务空间</p>
+            <div v-for="i in mess">
+              <p style="line-height:20px;margin-left:10px;">{{i.RoomLocalName || '--'}} - {{i.RoomLocalID || '--'}}</p>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+    </div>
+    <span slot="footer" class="dialog-footer center">
+        <el-button type="primary" @click="confirm">我知道了</el-button>
+    </span>
+    </el-dialog>
+</template>
+<script>
+import { getAllMess, deleteNotice } from "@/api/request";
+export default {
+  props: {
+    width: {
+      type: String,
+      default: "40%"
+    },
+    title: {
+      type: String,
+      default: "提示"
+    },
+    isShow: {
+      type: Object
+    },
+    param: {
+      type: Object
+    },
+    tabsList: {
+      type: Array,
+      default: []
+    }
+  },
+  data() {
+    return {
+      data: null,
+      proj: null,
+      activeName: "1",
+      allMess: [], //所有提示
+      mess: [], //实际提示
+      build: {}
+    };
+  },
+  created() {
+    this.getAllMess();
+  },
+  methods: {
+    //我知道了
+    confirm() {
+      let ids = [];
+      if (!!this.allMess[this.build.code]) {
+        this.allMess[this.build.code].map(item => {
+          ids.push(item.RoomID);
+        });
+      }
+      let param = {
+        data: {
+          ids: ids
+        },
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      };
+      deleteNotice(param)
+        .then(res => {
+          if (res.data.Result == "success") {
+            this.isShow.influence = false;
+          } else {
+            this.$message.error(res.data.ResultMsg);
+          }
+        })
+        .catch(() => {
+          this.$message.error("请求失败");
+        });
+    },
+    getData(build) {
+      this.build = build;
+      this.mess = this.allMess[build.code];
+    },
+    getAllMess() {
+      getAllMess({
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      })
+        .then(res => {
+          if (res.data.Result == "success") {
+            // this.allMess = res.data.Content
+            this.changeMsg(res.data.Content);
+            console.log(this.allMess);
+          } else {
+            this.$message.error(res.data.ResultMsg);
+          }
+        })
+        .catch(() => {
+          this.$message.error("请求错误");
+        });
+    },
+
+    //获取楼层信息
+    changeMsg(arr) {
+      arr.map(item => {
+        if (!!this.allMess[item.location.floor]) {
+          this.allMess[item.location.floor].push(item.infos);
+        } else {
+          this.allMess[item.location.floor] = [];
+          this.allMess[item.location.floor].push(item.infos);
+        }
+      });
+    },
+    handleClick() {}
+  }
+};
+</script>
+
+<style lang="less">
+#influenceDialog {
+  .el-tabs__content {
+    max-height: 200px;
+    overflow-y: auto;
+  }
+  .influence-p {
+    height: 40px;
+    line-height: 40px;
+    font-size: 17px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 50 - 0
src/components/business_space/dialogs/list/filesDialog.vue

@@ -0,0 +1,50 @@
+<!--
+    上传文件的弹窗
+-->
+
+<template>
+  <el-dialog title="上传文件" :visible.sync="dialog.uploadFiles" width="30%">
+    <upload-files :readOnly="read" :keysArr="keysArr" @change="changeItem" max="2"></upload-files>
+  </el-dialog>
+</template>
+<script>
+import uploadFiles from "@/components/lib/uploadFiles";
+export default {
+  components: {
+    uploadFiles
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          uploadFiles: false
+        };
+      }
+    },
+    keysArr: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    },
+    read: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {};
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    changeItem(file) {
+      console.log(file)
+      this.$emit("changeFile", file)
+    }
+  },
+};
+</script>
+<style>
+</style>

+ 162 - 0
src/components/business_space/dialogs/list/firm.vue

@@ -0,0 +1,162 @@
+<!--
+    firm 厂商
+-->
+<template>
+  <el-dialog title="选择型号" :visible.sync="dialog.firm" width="600px">
+    <div>
+      <div id="firm">
+        <div class="title-search" style="margin-bottom: 10px;">
+          <el-input
+            placeholder="输入厂家名称、品牌名、型号进行查找"
+            v-model="search"
+            size="small"
+            style="width:400px;"
+            clearable
+          ></el-input>
+          <el-button @click="searchKey" size="small">查找</el-button>
+        </div>
+        <el-radio-group v-model="radio" style="width:100%;">
+          <el-table :data="tableData" style="width: 100%" height="300px">
+            <el-table-column label="生产厂家">
+              <template slot-scope="scope">
+                <el-radio v-model="radio" :label="scope.row">{{scope.row.venderName || "--"}}</el-radio>
+              </template>
+            </el-table-column>
+            <el-table-column prop="brand" label="品牌"></el-table-column>
+            <el-table-column prop="name" label="型号"></el-table-column>
+            <el-table-column label="技术参数">
+              <template slot-scope="scope">
+                <el-button type="text" @click="lookParam(scope.row)">技术参数</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-radio-group>
+        <my-pagination :page="page" @change="changed" style="margin-top:10px;"></my-pagination>
+        <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E;">
+          找不到想要的型号? 赶快去
+          <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
+        </p>
+        <div class="footer">
+          <el-button
+            type="primary"
+            @click="getChange"
+            style="display:block;margin: 10px auto 0;"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+    <param-details :isLoad="isLoad" :data="data"></param-details>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import paramDetails from "@/components/dialogs/list/paramDetails"
+import { getSpecList } from "@/api/request"
+
+export default {
+  components: {
+    myPagination,
+    paramDetails
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          firm: false
+        };
+      }
+    },
+    mess: {
+      type: [Object, String]
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      tableData: [
+      ],
+      data: {},
+      isLoad: {
+        paramShow: false
+      },
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      },
+    };
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    changed() {
+      this.getData()
+    },
+    //查询技术参数
+    lookParam(data) {
+      this.data = data
+      this.isLoad.paramShow = true
+    },
+    getChange() {
+      if (!!this.radio) {
+        this.$emit("changeFirm", this.radio)
+        this.dialog.firm = false
+      } else {
+        this.$message("请选择型号")
+      }
+    },
+    searchKey() {
+      this.changePage()
+    },
+    changePage() {
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      this.getData()
+    },
+    getData() {
+      getSpecList({
+        limit: {
+          skip: this.page.size * (this.page.currentPage - 1),
+          count: this.page.size
+        },
+        eqFamily: this.mess.deviceId,
+        name: this.search
+      }, res => {
+        this.page.total = res.totalCount
+        this.tableData = res.content
+        console.log(this.tableData)
+      })
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.firm) {
+          console.log(this.mess)
+          this.changePage()
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#firm {
+  .el-table thead {
+    tr {
+      th {
+        background-color: #f5f7fa;
+      }
+    }
+  }
+}
+</style>

+ 187 - 0
src/components/business_space/dialogs/list/guaranteeDialog.vue

@@ -0,0 +1,187 @@
+<!--
+    guarantee 保单选择
+-->
+
+<!--
+    guarantee 供应合同选择
+-->
+<template>
+  <el-dialog title="选择保单" :visible.sync="dialog.guarantee" width="600px">
+    <el-tabs type="border-card">
+      <el-tab-pane>
+        <span slot="label">选择保单</span>
+        <div id="firm">
+          <el-radio-group v-model="radio" style="width:100%;">
+            <el-table :data="tableData" style="width: 100%" height="300px">
+              <el-table-column label="保单号">
+                <template slot-scope="scope">
+                  <el-radio v-model="radio" :label="scope.row">{{scope.row.insuranceNo}}</el-radio>
+                </template>
+              </el-table-column>
+              <el-table-column label="下载">
+                <template slot-scope="scope">
+                  <el-button type="text">下载</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-radio-group>
+          <my-pagination :page="page" style="margin-top:10px;"></my-pagination>
+          <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E;">
+            保单信息有错误? 赶快去
+            <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
+          </p>
+          <div class="footer">
+            <el-button
+              type="primary"
+              @click="getSelect"
+              style="display:block;margin: 10px auto 0;"
+            >确 定</el-button>
+          </div>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane>
+        <span slot="label">新建保单</span>
+        <el-form label-width="80px" :rules="rules" :model="formData" ref="ruleForm">
+          <el-form-item label="保单号:" prop="name">
+            <el-input v-model="formData.name"></el-input>
+          </el-form-item>
+          <el-form-item label="保险文件">
+            <upload-files @change="changeFiles" ref="files" :keysArr="keysArr" :max="max"></upload-files>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
+            <el-button @click="resetForm('ruleForm')">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import uploadFiles from '@/components/lib/uploadFiles'
+import { getListForGuarantee, createGuarantee } from "@/api/request"
+import tools from "@/assets/js/tools"
+export default {
+  components: {
+    myPagination,
+    uploadFiles
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          guarantee: true
+        };
+      }
+    },
+    id: {
+      type: [Number, String],
+      default: 0
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      formData: {
+        name: ""
+      },
+      rules: {
+        name: { required: true, message: '请输入保单号', trigger: 'blur' },
+      },
+      tableData: [],
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 400,
+        currentPage: 1
+      },
+      keysArr: [],
+      max: 1,
+      allData: []
+    };
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.createGree()
+        } else {
+          return false;
+        }
+      });
+    },
+    changeFiles(val) {
+      this.keysArr = val
+    },
+    resetForm() {
+      this.$refs.ruleForm.resetFields();
+    },
+    //新建保单
+    createGree() {
+      let param = {
+        data: {
+          venderId: this.id,
+          insuranceNo: this.formData.name,
+          projectId: this.$route.query.projId,
+          contractFile: this.keysArr[0]
+        }
+      }
+      let _this = this
+      createGuarantee(param, res => {
+        _this.$emit("change", param.data)
+        _this.dialog.guarantee = false
+      })
+    },
+    getList() {
+      this.radio = ""
+      let _this = this
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      if (!!this.id) {
+        let param = {
+          data: {
+            projectId: this.$route.query.projId,
+            venderId: this.id
+          }
+        }
+        getListForGuarantee(param, res => {
+          _this.$refs.ruleForm.resetFields()
+          _this.$refs.files.resetFile()
+          _this.allData = res.content || []
+          _this.page.total = _this.allData.length
+          //   //分页
+          _this.pageChange()
+        })
+      }
+    },
+
+    getSelect() {
+      this.$emit("change", this.radio)
+      this.dialog.guarantee = false
+    },
+    pageChange() {
+      this.tableData = tools.pagination(this.page.currentPage, this.page.size, this.allData)
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function (val) {
+        if (this.dialog.guarantee) {
+          this.getList()
+        }
+      }
+    }
+  }
+
+};
+</script>

+ 184 - 0
src/components/business_space/dialogs/list/insurerDialog.vue

@@ -0,0 +1,184 @@
+<!--
+    maintenance 选择供应商
+
+-->
+<template>
+  <el-dialog title="选择型号" :visible.sync="dialog.insurer" width="1000px">
+    <div>
+      <div id="firm">
+        <div class="title-search" style="margin-bottom: 10px;">
+          <el-input
+            placeholder="输入厂家名称进行查找"
+            v-model="search"
+            size="small"
+            style="width:400px;"
+            clearable
+          ></el-input>
+          <el-button size="small" @click="filterSearch">查找</el-button>
+        </div>
+        <el-radio-group v-model="radio" style="width:100%;">
+          <el-table ref="maintenance" :data="tableData" style="width: 100%" height="300px">
+            <el-table-column label="供应商名称">
+              <template slot-scope="scope">
+                <el-tooltip :content="scope.row.name" placement="top">
+                  <el-radio v-model="radio" :label="scope.row">{{scope.row.name}}</el-radio>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column prop="website" label="网址"></el-table-column>
+            <el-table-column prop="man" label="联系人"></el-table-column>
+            <el-table-column prop="phone" label="联系电话"></el-table-column>
+            <el-table-column prop="faxes" label="传真"></el-table-column>
+            <el-table-column prop="email" label="电子邮件"></el-table-column>
+          </el-table>
+        </el-radio-group>
+        <my-pagination :page="page" @change="changePage" style="margin-top:10px;"></my-pagination>
+        <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E;">
+          找不到想要的型号? 赶快去
+          <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
+        </p>
+        <div class="footer">
+          <el-button
+            type="primary"
+            @click="getChange"
+            style="display:block;margin: 10px auto 0;"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import { getLib } from "@/api/request"
+import tools from "@/assets/js/tools"
+
+export default {
+  components: {
+    myPagination
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          insurer: true
+        };
+      }
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      tableData: [],
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      },
+      projectId: this.$route.query.projId,
+    };
+  },
+  created() {
+    // this.getData()
+  },
+  mounted() { },
+  methods: {
+    //过滤
+    filterSearch() {
+      this.tableData = this.allData.map(item => {
+        if (item.name.indexOf(this.search) != -1) {
+          return item
+        } else {
+          return undefined
+        }
+      }).filter(cb => cb)
+    },
+    getData() {
+      console.log("insurer")
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      getLib({ "type": ["insurance"] }).then(res => {
+        if (res.data.result == "success") {
+          let data = res.data.content.insurance.map(item => {
+            if (item.contacts && item.contacts.length) {
+              item.contacts.map(child => {
+                if (child.projectId == this.projectId) {
+                  item.phone = child.phone
+                  item.man = child.name
+                  item.fox = child.fox
+                  item.email = child.email
+                }
+                return child
+              })
+            }
+            if (!item.man) {
+              item.man = "--"
+              item.phone = "--"
+              item.fox = "--"
+              item.email = "--"
+            }
+            return item
+          })
+          this.allData = tools.deepCopy(data)
+          this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
+          this.page.total = data.length
+        } else {
+          this.$message.error("请求失败:" + res.data.resultMsg)
+        }
+      })
+    },
+
+    //分页改变
+    changePage() {
+      this.pagination(this.page.currentPage, this.page.size, this.allData)
+    },
+
+    //发生修改
+    getChange() {
+      if (!!this.radio) {
+        this.$emit("changeInsurer", this.radio)
+        this.dialog.insurer = false
+      } else {
+        this.$message("请选择一个生产厂商")
+      }
+    },
+
+    //分页事件
+    pagination(pageNo, pageSize, array) {
+      let offset = (pageNo - 1) * pageSize;
+      return offset + pageSize >= array.length
+        ? array.slice(offset, array.length)
+        : array.slice(offset, offset + pageSize);
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.insurer) {
+          this.getData()
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#firm {
+  .el-table thead {
+    tr {
+      th {
+        background-color: #f5f7fa;
+      }
+    }
+  }
+}
+</style>

+ 184 - 0
src/components/business_space/dialogs/list/maintainerDialog.vue

@@ -0,0 +1,184 @@
+<!--
+    maintenance 选择供应商
+
+-->
+<template>
+  <el-dialog title="选择维修商" :visible.sync="dialog.maintainer" width="1000px">
+    <div>
+      <div id="firm">
+        <div class="title-search" style="margin-bottom: 10px;">
+          <el-input
+            placeholder="输入厂家名称进行查找"
+            v-model="search"
+            size="small"
+            style="width:400px;"
+            clearable
+          ></el-input>
+          <el-button size="small" @click="filterSearch">查找</el-button>
+        </div>
+        <el-radio-group v-model="radio" style="width:100%;">
+          <el-table ref="maintenance" :data="tableData" style="width: 100%" height="300px">
+            <el-table-column label="维修商名称">
+              <template slot-scope="scope">
+                <el-tooltip :content="scope.row.name" placement="top">
+                  <el-radio v-model="radio" :label="scope.row">{{scope.row.name}}</el-radio>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column prop="website" label="网址"></el-table-column>
+            <el-table-column prop="man" label="联系人"></el-table-column>
+            <el-table-column prop="phone" label="联系电话"></el-table-column>
+            <el-table-column prop="faxes" label="传真"></el-table-column>
+            <el-table-column prop="email" label="电子邮件"></el-table-column>
+          </el-table>
+        </el-radio-group>
+        <my-pagination :page="page" @change="changePage" style="margin-top:10px;"></my-pagination>
+        <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E;">
+          找不到想要的维修商? 赶快去
+          <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
+        </p>
+        <div class="footer">
+          <el-button
+            type="primary"
+            @click="getChange"
+            style="display:block;margin: 10px auto 0;"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import { getLib } from "@/api/request"
+import tools from "@/assets/js/tools"
+
+export default {
+  components: {
+    myPagination
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          maintainer: true
+        };
+      }
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      tableData: [],
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      },
+      projectId: this.$route.query.projId,
+    };
+  },
+  created() {
+    // this.getData()
+  },
+  mounted() { },
+  methods: {
+    //过滤
+    filterSearch() {
+      this.tableData = this.allData.map(item => {
+        if (item.name.indexOf(this.search) != -1) {
+          return item
+        } else {
+          return undefined
+        }
+      }).filter(cb => cb)
+    },
+    getData() {
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      getLib({ "type": ["maintenance"] }).then(res => {
+        if (res.data.result == "success") {
+          let data = res.data.content.maintenance.map(item => {
+            if (item.contacts && item.contacts.length) {
+              item.contacts.map(child => {
+                if (child.projectId == this.projectId) {
+                  item.phone = child.phone
+                  item.man = child.name
+                  item.fox = child.fox
+                  item.email = child.email
+                }
+                return child
+              })
+            }
+            if (!item.man) {
+              item.man = "--"
+              item.phone = "--"
+              item.fox = "--"
+              item.email = "--"
+            }
+            return item
+          })
+          this.allData = tools.deepCopy(data)
+          this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
+          this.page.total = data.length
+        } else {
+          this.$message.error("请求失败:" + res.data.resultMsg)
+        }
+      })
+    },
+
+    //分页改变
+    changePage() {
+      this.pagination(this.page.currentPage, this.page.size, this.allData)
+    },
+
+    //发生修改
+    getChange() {
+      if (!!this.radio) {
+        console.log(this.radio, "radio")
+        this.$emit("changeMaintainer", this.radio)
+        this.dialog.maintainer = false
+      } else {
+        this.$message("请选择一个生产厂商")
+      }
+    },
+
+    //分页事件
+    pagination(pageNo, pageSize, array) {
+      let offset = (pageNo - 1) * pageSize;
+      return offset + pageSize >= array.length
+        ? array.slice(offset, array.length)
+        : array.slice(offset, offset + pageSize);
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.maintainer) {
+          this.getData()
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#firm {
+  .el-table thead {
+    tr {
+      th {
+        background-color: #f5f7fa;
+      }
+    }
+  }
+}
+</style>

+ 88 - 0
src/components/business_space/dialogs/list/paramDetails.vue

@@ -0,0 +1,88 @@
+<template>
+  <el-dialog width="400px" title="型号参数" :visible.sync="isLoad.paramShow" append-to-body>
+    <h3 class="lag-h3">当前型号: {{data.brand || "--"}} - {{data.name || "--"}}</h3>
+    <div style="max-height: 400px;overflow-y:auto;">
+      <p
+        class="saga-poent"
+        v-for="item in labelArr"
+        v-if="!!data.infos && data.infos[item.infoPointCode]"
+      >{{item.infoPointName}}:{{data.infos ? data.infos[item.infoPointCode] || "--" : "--"}}</p>
+    </div>
+  </el-dialog>
+</template>
+<script>
+
+import { getSpaceHeader } from "@/api/request"
+
+export default {
+  props: {
+    isLoad: {
+      type: Object,
+      default: function () {
+        return {
+          paramShow: false
+        }
+      }
+    },
+    data: {
+      type: Object,
+      default: function () {
+        return {
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      labelArr: []
+    }
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    getData() {
+      let param = {
+        ProjId: this.$route.query.projId,
+        code: this.data.eqFamily
+      }
+      getSpaceHeader(param).then(res => {
+        if (res.data.Result == "success") {
+          this.labelArr = res.data.Content.map(item => {
+            if (item.firstTag == "台账信息") {
+              return item
+            } else {
+              return undefined
+            }
+          }).filter(d => d)
+        } else {
+          this.$message.error("请求失败:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求失败")
+      })
+    }
+  },
+  watch: {
+    isLoad: {
+      deep: true,
+      handler: function () {
+        if (this.isLoad.paramShow) {
+          this.getData()
+        }
+      }
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+.lag-h3 {
+  height: 35px;
+  line-height: 35px;
+  font-size: 20px;
+  font-weight: 500;
+  margin-bottom: 8px;
+}
+.saga-poent {
+  line-height: 28px;
+}
+</style>

+ 141 - 0
src/components/business_space/dialogs/list/picDialog.vue

@@ -0,0 +1,141 @@
+<!--
+    上传图片的弹窗
+-->
+
+<template>
+  <el-dialog title="上传图片" :visible.sync="dialog.pic" width="40%">
+    <div style="max-height:500px;overflow-y:auto;">
+      <div>
+        <h3>设备图片</h3>
+        <upload-imgs :readOnly="read" :keysArr="picArrs" @change="imageItem" max="6"></upload-imgs>
+      </div>
+      <div>
+        <h3>视频</h3>
+        <upload-imgs
+          :accept="'video/*'"
+          type="video"
+          :keysArr="videoArr"
+          @change="videoItem"
+          :videoPicArr="videoPicArr"
+          max="2"
+          :readOnly="read"
+        ></upload-imgs>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import uploadImgs from "@/components/lib/uploadImgsName";
+import tools from "@/assets/js/tools"
+export default {
+  components: {
+    uploadImgs
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          pic: true
+        };
+      }
+    },
+    keysArr: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    },
+    read: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      picArrs: [],
+      panoramaArr: [],
+      videoArr: [],
+      videoPicArr: [],
+      changeKeys: []
+    };
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    imageItem(images) {
+      this.picArrs = images
+      this.change()
+    },
+
+    panoramaItem(images) {
+      this.panoramaArr = images
+      this.change()
+    },
+
+    videoItem(videos, pe, pics) {
+      this.videoArr = videos
+      this.videoPicArr = pics
+      this.change()
+    },
+
+    change() {
+      //   let picsArr = this.getArr(this.picArrs, "设备图片", "image")
+      //   let videos = this.getArr(this.videoArr, "视频", "video")
+      //   let videoPics = this.getArr(this.videoPicArr, "视频资料", "image_video")
+      //   let panoramas = this.getArr(this.panoramaArr, "全景照片", "panorama")
+      let picsArr = this.picArrs
+      let videos = this.videoArr
+      let videoPics = this.videoPicArr
+      let panoramas = this.panoramaArr
+      this.changeKeys = picsArr.concat(videos).concat(videoPics).concat(panoramas)
+      console.log(this.changeKeys)
+      this.$emit("change", this.changeKeys)
+    },
+
+    getArr(arr, name, type) {
+      return arr.map(item => {
+        return { "systemId": "dataPlatform", "name": name, "type": type, "key": item }
+      })
+    },
+
+    //将父组件传来的数据进行分组
+    fatherTochild() {
+      this.panoramaArr = []
+      this.videoArr = []
+      this.videoPicArr = []
+      this.picArrs = []
+      if (this.keysArr instanceof Array) {
+        this.keysArr.map(item => {
+          if (item.type == 'panorama') {
+            this.panoramaArr.push(item)
+          } else if (item.type == "video") {
+            this.videoArr.push(item)
+          } else if (item.type == 'image_video') {
+            this.videoPicArr.push(item)
+          } else {
+            this.picArrs.push(item)
+          }
+        })
+      } else {
+        this.panoramaArr = []
+        this.videoArr = []
+        this.videoPicArr = []
+        this.picArrs = []
+      }
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.pic) {
+          this.fatherTochild()
+        }
+      }
+    }
+  }
+};
+</script>
+<style>
+</style>

+ 183 - 0
src/components/business_space/dialogs/list/supplierDialog.vue

@@ -0,0 +1,183 @@
+<!--
+    supplier 选择供应商
+
+-->
+<template>
+  <el-dialog title="选择型号" :visible.sync="dialog.supplier" width="1000px">
+    <div>
+      <div id="firm">
+        <div class="title-search" style="margin-bottom: 10px;">
+          <el-input
+            placeholder="输入厂家名称进行查找"
+            v-model="search"
+            size="small"
+            style="width:400px;"
+            clearable
+          ></el-input>
+          <el-button size="small" @click="filterSearch">查找</el-button>
+        </div>
+        <el-radio-group v-model="radio" style="width:100%;">
+          <el-table ref="supplier" :data="tableData" style="width: 100%" height="300px">
+            <el-table-column label="供应商名称">
+              <template slot-scope="scope">
+                <el-tooltip :content="scope.row.name" placement="top">
+                  <el-radio v-model="radio" :label="scope.row">{{scope.row.name}}</el-radio>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column prop="website" label="网址"></el-table-column>
+            <el-table-column prop="man" label="联系人"></el-table-column>
+            <el-table-column prop="phone" label="联系电话"></el-table-column>
+            <el-table-column prop="faxes" label="传真"></el-table-column>
+            <el-table-column prop="email" label="电子邮件"></el-table-column>
+          </el-table>
+        </el-radio-group>
+        <my-pagination :page="page" @change="changePage" style="margin-top:10px;"></my-pagination>
+        <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E;">
+          找不到想要的型号? 赶快去
+          <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
+        </p>
+        <div class="footer">
+          <el-button
+            type="primary"
+            @click="getChange"
+            style="display:block;margin: 10px auto 0;"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import { getLib } from "@/api/request"
+import tools from "@/assets/js/tools"
+
+export default {
+  components: {
+    myPagination
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          supplier: true
+        };
+      }
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      tableData: [],
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      },
+      projectId: this.$route.query.projId,
+    };
+  },
+  created() {
+    // this.getData()
+  },
+  mounted() { },
+  methods: {
+    //过滤
+    filterSearch() {
+      this.tableData = this.allData.map(item => {
+        if (item.name.indexOf(this.search) != -1) {
+          return item
+        } else {
+          return undefined
+        }
+      }).filter(cb => cb)
+    },
+    getData() {
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      getLib({ "type": ["supplier"] }).then(res => {
+        if (res.data.result == "success") {
+          let data = res.data.content.supplier.map(item => {
+            if (item.contacts && item.contacts.length) {
+              item.contacts.map(child => {
+                if (child.projectId == this.projectId) {
+                  item.phone = child.phone
+                  item.man = child.name
+                  item.fox = child.fox
+                  item.email = child.email
+                }
+                return child
+              })
+            }
+            if (!item.man) {
+              item.man = "--"
+              item.phone = "--"
+              item.fox = "--"
+              item.email = "--"
+            }
+            return item
+          })
+          this.allData = tools.deepCopy(data)
+          this.tableData = this.pagination(this.page.currentPage, this.page.size, this.allData)
+          this.page.total = data.length
+        } else {
+          this.$message.error("请求失败:" + res.data.resultMsg)
+        }
+      })
+    },
+
+    //分页改变
+    changePage() {
+      this.pagination(this.page.currentPage, this.page.size, this.allData)
+    },
+
+    //发生修改
+    getChange() {
+      if (!!this.radio) {
+        this.$emit("changeSupplier", this.radio)
+        this.dialog.supplier = false
+      } else {
+        this.$message("请选择一个生产厂商")
+      }
+    },
+
+    //分页事件
+    pagination(pageNo, pageSize, array) {
+      let offset = (pageNo - 1) * pageSize;
+      return offset + pageSize >= array.length
+        ? array.slice(offset, array.length)
+        : array.slice(offset, offset + pageSize);
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.supplier) {
+          this.getData()
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#firm {
+  .el-table thead {
+    tr {
+      th {
+        background-color: #f5f7fa;
+      }
+    }
+  }
+}
+</style>

+ 157 - 0
src/components/business_space/dialogs/list/supplyDialog.vue

@@ -0,0 +1,157 @@
+<!--
+    supply 供应合同选择
+-->
+<template>
+  <el-dialog title="选择供应合同" :visible.sync="dialog.supply" width="600px">
+    <el-tabs type="border-card">
+      <el-tab-pane>
+        <span slot="label">选择供应合同</span>
+        <div id="firm">
+          <el-radio-group v-model="radio" style="width:100%;">
+            <el-table :data="tableData" style="width: 100%" height="300px">
+              <el-table-column label="合同编号">
+                <template slot-scope="scope">
+                  <el-radio v-model="radio" :label="scope.row">{{scope.row}}</el-radio>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-radio-group>
+          <my-pagination @change="pageChange" :page="page" style="margin-top:10px;"></my-pagination>
+          <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E;">
+            保单信息有错误? 赶快去
+            <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
+          </p>
+          <div class="footer">
+            <el-button
+              type="primary"
+              style="display:block;margin: 10px auto 0;"
+              @click="setData"
+            >确 定</el-button>
+          </div>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane>
+        <span slot="label">新建供应合同</span>
+        <el-form label-width="80px" :rules="rules" :model="formData" ref="ruleForm">
+          <el-form-item label="供应合同" prop="name">
+            <el-input v-model="formData.name"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
+            <el-button @click="resetForm('ruleForm')">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import { getListForSupplier } from "@/api/request"
+import tools from "@/assets/js/tools"
+
+export default {
+  components: {
+    myPagination
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          supply: true
+        };
+      }
+    },
+    id: {
+      type: [Number, String],
+      default: 0
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      radio: "",
+      formData: {
+        name: ""
+      },
+      rules: {
+        name: { required: true, message: '请输入保单号', trigger: 'blur' },
+      },
+      tableData: [],
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      },
+      allData: []
+    };
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    submitForm(formName) {
+      let _this = this
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          _this.$emit("change", this.formData.name)
+          this.dialog.supply = false
+        } else {
+          return false;
+        }
+      });
+    },
+    resetForm() {
+      this.$refs.ruleForm.resetFields();
+    },
+
+    setData() {
+      this.$emit("change", this.radio)
+      this.dialog.supply = false
+    },
+
+    //获取列表
+    getList() {
+      this.radio = ""
+      let _this = this
+      this.page = {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 0,
+        currentPage: 1
+      }
+      if (!!this.id) {
+        let param = {
+          data: {
+            projectId: this.$route.query.projId,
+            venderId: this.id
+          },
+          ProjId: this.$route.query.projId,
+          secret: this.$route.query.secret,
+        }
+        getListForSupplier(param, res => {
+          _this.$refs.ruleForm.resetFields()
+          _this.allData = res.contractId || []
+          _this.page.total = _this.allData.length
+          //分页
+          _this.pageChange()
+        })
+      }
+    },
+    pageChange() {
+      this.tableData = tools.pagination(this.page.currentPage, this.page.size, this.allData)
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function (val) {
+        if (this.dialog.supply) {
+          this.getList()
+        }
+      }
+    }
+  }
+};
+</script>

+ 313 - 0
src/components/business_space/dialogs/list/systemType.vue

@@ -0,0 +1,313 @@
+<!--
+    systemType 设备所属类型
+-->
+<template>
+  <el-dialog title="所属系统实例" :visible.sync="dialog.systemType" width="600px">
+    <div>
+      <div id="systemType">
+        <div class="title-search" style="margin-bottom: 10px;" v-if="type != 'read' ">
+          <el-input
+            placeholder="输入名称或编码进行查询"
+            v-model="search"
+            size="small"
+            style="width:400px;"
+            clearable
+          ></el-input>
+          <el-button size="small" @click="searchChecked">查找</el-button>
+        </div>
+        <el-table
+          :data="tableData"
+          @selection-change="handleSelectionChange"
+          style="width: 100%"
+          height="400px"
+          ref="multipleTable"
+        >
+          <el-table-column
+            v-if="type != 'read' "
+            type="selection"
+            :reserve-selection="true"
+            :disabled="true"
+            width="55"
+          ></el-table-column>
+          <el-table-column label="系统名称">
+            <template slot-scope="scope">{{scope.row.infos.SysLocalName || scope.row.infos.SysName}}</template>
+          </el-table-column>
+          <el-table-column label="本地编码">
+            <template slot-scope="scope">{{scope.row.infos.SysLocalID || '--'}}</template>
+          </el-table-column>
+          <el-table-column label="专业">
+            <template slot-scope="scope">{{getName(scope.row.category)}}</template>
+          </el-table-column>
+          <el-table-column label="详情">
+            <template slot-scope="scope">
+              <el-button @click="lookDeatils(scope.row)" type="text">详情</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="footer" v-if="type != 'read' ">
+          <el-button
+            type="primary"
+            @click="getChange"
+            style="display:block;margin: 10px auto 0;"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+    <el-dialog
+      title="系统详情"
+      :visible.sync="iframeShow"
+      v-if="iframeShow"
+      width="500px"
+      append-to-body
+    >
+      <iframe
+        id="google_ads_frame2"
+        name="google_ads_frame2"
+        frameborder="0"
+        :src="iframeSrc"
+        marginwidth="0"
+        marginheight="0"
+        vspace="0"
+        hspace="0"
+        style="width:100%;height:500px;"
+        allowtransparency="true"
+        scrolling="no"
+        allowfullscreen="true"
+      ></iframe>
+    </el-dialog>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/lib/myPagination";
+import { getLib, getAllbusiness, getEqCode, getRelation } from "@/api/request"
+import tools from "@/assets/js/tools"
+
+export default {
+  components: {
+    myPagination
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          systemType: true
+        };
+      }
+    },
+    graphyId: {
+      type: String,
+      default: ""
+    },
+    infos: {
+      type: String,
+      default: ""
+    },
+    type: {
+      type: String,
+      default: "read"
+    },
+    //默认值
+    list: {
+      type: [Array]
+    }
+  },
+  data() {
+    return {
+      search: "", //搜索文案
+      tableData: [
+      ],
+      systemList: [],
+      allData: [],
+      multipleSelection: [],
+      changeData: [],
+      iframeSrc: "",
+      iframeShow: false
+    };
+  },
+  created() {
+  },
+  mounted() { },
+  methods: {
+    searchChecked() {
+      let data = []
+      this.allData.map(item => {
+        if (item.category.indexOf(this.search) > -1 || (item.infos.SysLocalName && item.infos.SysLocalName.indexOf(this.search) > -1)) {
+          data.push(item)
+        }
+      })
+      this.tableData = data
+      this.changeData = this.multipleSelection
+    },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      if (this.changeData.length) {
+        this.multipleSelection = this.changeData
+        this.changeData = []
+      }
+    },
+
+    //设置默认
+    toggleSelection(rows) {
+      if (rows) {
+        rows.forEach(row => {
+          this.$refs.multipleTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.multipleTable.clearSelection();
+      }
+    },
+
+    getChange() {
+      if (this.multipleSelection.length >= 2) {
+        this.$confirm("确定关联多个系统?").then(_ => {
+          this.$emit("change", this.multipleSelection)
+          this.dialog.systemType = false
+        }).catch(_ => {
+        })
+      } else {
+        this.$emit("change", this.multipleSelection)
+        this.dialog.systemType = false
+      }
+    },
+
+    getName(code) {
+      if (!!code) {
+        let codeC = code.substring(0, 2), name = ""
+        this.systemList.map(item => {
+          if (item.code == codeC) {
+            name = item.class
+          }
+        })
+        return name
+      } else {
+        return "--"
+      }
+    },
+
+    //获取设备族
+    getEquipmentFamily() {
+      getEqCode().then(res => {
+        if (res.data.Result == "success") {
+          this.systemList = res.data.Content
+          this.getData()
+        } else {
+          this.$message.error("请求错误" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求错误")
+      })
+    },
+
+    getData() {
+      let param = param = {
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret,
+        data: {
+          criteria: {
+            type: ["Sy"]
+          }
+        }
+      }
+      getAllbusiness(param).then(res => {
+        if (res.data.Result == "success") {
+          if (this.type == "read" && !!this.infos) {
+            this.getRelation(res.data.Content)
+          } else {
+            this.allData = res.data.Content
+            this.tableData = res.data.Content
+            console.log(this.$refs, "refs", this.list, "list", this.graphyId, "graphy")
+            this.$refs.multipleTable.clearSelection();
+            this.getSelected(this.list, this.allData)
+          }
+        } else {
+          this.$message.error("请求错误:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求错误")
+      })
+    },
+
+    //查询id对应系统
+    getRelation(table) {
+      getRelation({
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret,
+        criterias: {
+          criteria: {
+            "to_id": this.infos,
+            "graph_id": this.graphyId
+          }
+        }
+      }).then(Response => {
+        let data = Response.data.Content
+        if (Response.data.Result == "success") {
+          if (table && table.length && data && data.length) {
+            let lastData = tools.getSameItems(table, "id", data, "from_id")
+            console.log(lastData)
+            this.tableData = lastData
+          } else {
+            this.tableData = []
+          }
+        } else {
+          this.$message.error("请求错误" + Response.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求错误")
+      })
+    },
+
+    //设置默认选中项
+    getSelected(list, all) {
+      let map = []
+      if (all && all.length && list && list.length) {
+        all.map((item, index) => {
+          list.map(child => {
+            if (item.id == child.id) {
+              this.$refs.multipleTable.toggleRowSelection(item)
+            }
+          })
+        })
+      }
+    },
+
+    //点击详情
+    lookDeatils(infos) {
+      this.iframeSrc =
+        process.env.BASE_URL +
+        ":8889/#/details?perjectId=" +
+        this.$route.query.projId +
+        "&secret=" +
+        this.$route.query.secret +
+        "&FmId=" +
+        infos.id +
+        "&type=1&code=" +
+        infos.category.substring(2, 4);
+      this.iframeShow = true;
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.systemType) {
+          this.getEquipmentFamily()
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#systemType {
+  .el-table thead {
+    tr {
+      th {
+        background-color: #f5f7fa;
+      }
+    }
+  }
+}
+</style>

+ 62 - 0
src/components/business_space/dialogs/list/uploadImgDialog.vue

@@ -0,0 +1,62 @@
+<!--
+    上传图片的弹窗
+-->
+
+<template>
+  <el-dialog title="上传图片" :visible.sync="dialog.uploadImgs" width="460px">
+    <upload-imgs :readOnly="read" :keysArr="deepcopy(keysArr)" @change="changeItem" max="2"></upload-imgs>
+  </el-dialog>
+</template>
+<script>
+import uploadImgs from "@/components/lib/uploadImgsName";
+export default {
+  components: {
+    uploadImgs
+  },
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          uploadImgs: true
+        };
+      }
+    },
+    keysArr: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    },
+    read: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {};
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    deepcopy(obj) {
+      //   var out = [],
+      //     i = 0,
+      //     len = obj.length;
+      //   for (; i < len; i++) {
+      //     if (obj[i] instanceof Array) {
+      //       out[i] = this.deepcopy(obj[i]);
+      //     } else out[i] = obj[i];
+      //   }
+      console.log(obj, "out")
+      return obj;
+    },
+    changeItem(file) {
+      console.log(file, "changed")
+      this.$emit("changeFile", file)
+    }
+  },
+};
+</script>
+<style>
+</style>

+ 163 - 0
src/components/business_space/dialogs/noModelDialog.vue

@@ -0,0 +1,163 @@
+<template>
+    <el-dialog
+        :visible.sync="isShow.dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+        :width="width"
+    >
+        <span slot="title">{{title}}</span>
+        <!-- <slot name="body"></slot> -->
+        <el-tree :props="treeArr" :data="data" @node-click="floorClick" :highlight-current="true"></el-tree>
+        <span slot="footer" class="dialog-footer my">
+            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" @click="confirm">确 定</el-button>
+        </span>
+    </el-dialog>
+</template>
+
+<script>
+import {
+    getBuildSelect, //根据项目ID获得建筑列表
+    getSpaceFloor //根据建筑id获取楼层id
+} from "@/api/scan/request";
+
+import tools from '@/utils/scan/tools'
+
+import {
+    mapGetters,
+    mapActions
+} from "vuex";
+export default {
+    props: {
+        width: {
+            type: String,
+            default: "40%"
+        },
+        title: {
+            type: String,
+            default: "头部信息"
+        },
+        isShow: {
+            type: Object
+        },
+        param: {
+            type: Object
+        }
+    },
+    computed: {
+        ...mapGetters("peojMess", [
+            "projectId",
+            "secret",
+            "userId"
+        ])
+    },
+    data() {
+        return {
+            treeArr: {
+                label: "name", //label的名字
+                children: "children", //如果有下一级children和isLeaf存在
+            },
+            data: null,
+            proj: null,
+            mess: null
+        };
+    },
+    created() {
+        this.getNodes()
+    },
+    methods: {
+        //确定
+        confirm() {
+            if (!!this.mess) {
+                this.isShow.dialogVisible = false;
+                this.$emit("close", this.mess);
+            } else {
+                this.$message("请选择楼层");
+            }
+        },
+        //取消
+        close() {
+            if (!!this.mess) {
+                this.isShow.dialogVisible = false;
+            } else {
+                this.$message("请选择楼层");
+            }
+        },
+        changeArr(arr) {
+            return arr.map(item => {
+                if (item.floors && item.floors.length) {
+                    return {
+                        code: item.id,
+                        name: item.infos.BuildLocalName,
+                        children: item.floors.map(i => {
+                            return {
+                                code: i.id,
+                                name: (i.infos.FloorLocalName || i.infos.FloorName || "未知") + this.myMess(i),
+                                map: i.infos.FloorMap || null,
+                                affected: i.affected,
+                                isChilren: 2,
+                                buildCode: item.id,
+                                buildName: item.infos.BuildLocalName,
+                                shunxu: i.infos.FloorSequenceID || 0
+                            }
+                        })
+                    }
+                } else {
+                    return {
+                        code: item.id,
+                        name: item.infos.BuildLocalName,
+                        children: null,
+                        isChilren: 1,
+                    }
+                }
+            })
+        },
+
+        myMess(i) {
+            if (i.affected) {
+                return "(该业务空间受元空间变化影响)"
+            } else {
+                if (i.infos.FloorMap) {
+                    return ''
+                } else {
+                    return "(请初始化平面图)"
+                }
+            }
+        },
+        //点击节点懒加载
+        getNodes() {
+            let param = {
+                ProjId: this.projectId,
+                UserId: this.UserId,
+                secret: this.secret
+            };
+            getSpaceFloor(param).then(res => {
+                if (res.data.Result == 'success') {
+                    let data = this.changeArr(res.data.Content).map(item => {
+                        if (item.children && item.children.length) {
+                            item.children = tools.sortArr(item.children, "shunxu", false)
+                        }
+                        return item
+                    })
+                    this.data = data
+                } else {
+                    this.$message.error(res.data.ResultMsg)
+                }
+            }).catch(() => {
+                this.$message.error("请求出错")
+            })
+        },
+
+        //子节点被点击
+        floorClick(data) {
+            if (data.isChilren == 2) {
+                this.mess = data
+            } else { }
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 57 - 0
src/components/business_space/dialogs/notRelated.vue

@@ -0,0 +1,57 @@
+<template>
+  <el-dialog :visible.sync="isShow.notRelated" :width="width">
+    <span slot="title">{{title}}</span>
+    <business-table
+      ref="business"
+      @createSuccess="createSuccess"
+      :type="list[0].id ? 'relevance' : 'no'"
+    ></business-table>
+  </el-dialog>
+</template>
+
+<script>
+import businessTable from "@/components/table/businessTable";
+
+export default {
+  components: {
+    businessTable
+  },
+  props: {
+    width: {
+      type: String,
+      default: "45%"
+    },
+    title: {
+      type: String,
+      default: "未关联元空间的业务空间"
+    },
+    isShow: {
+      type: Object
+    },
+    param: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      list: [{}]
+    };
+  },
+  created() { },
+  mounted() { },
+  methods: {
+    getIdList(list, build, graphy, code) {
+      this.list = list;
+      console.log(this.list)
+      this.$nextTick(() => {
+        this.$refs.business.getData(list, build, graphy, code);
+      });
+    },
+    createSuccess() {
+      this.$emit("createSuccess")
+    }
+  }
+};
+</script>
+<style>
+</style>

+ 1 - 0
src/components/config_point/cut_string.vue

@@ -2,6 +2,7 @@
     <div class="flex">
         <template v-for="(item,index) in stringArr">
           <span
+            :key="index"
             @click="checkItem(item,index)"
             :class="{'bg': (arr.indexOf(index) > -1)} "
             class="cut-string saga-border pointer border-hover"

+ 1 - 1
src/components/config_point/find_keyword.vue

@@ -21,7 +21,7 @@
                 <div v-else class="center">暂无数据</div>
             </div>
             <div class="right-view saga-border">
-                <div class="find-tags" v-for="tag in tagList">
+                <div class="find-tags" v-for="(tag,index) in tagList" :key="index">
                     <el-tag :key="type == 'type' ? tag.EquipmentType : tag.EquipmentParameter" @click="changeName(type == 'type' ? tag.EquipmentType : tag.EquipmentParameter)" @close="closeTag(type == 'type' ? tag.EquipmentType : tag.EquipmentParameter)" closable>
                         {{type == 'type' ? (tag.EquipmentType + "(" + tag.PointCount + ")") : (tag.EquipmentParameter + "(" + tag.PointCount + ")")}}
                     </el-tag>

+ 7 - 0
src/fetch/point_http.js

@@ -55,6 +55,7 @@ export function queryLocaltionFlag(param, success) {
     return post(`${point}/location-flag/query`, data, success)
 }
 
+
 /**  --------------任何点位接口必传一个type---------------------   */
 //查询point list
 export function queryPoint(param, success) {
@@ -62,6 +63,12 @@ export function queryPoint(param, success) {
     return post(`${point}/point/${param.type}/query`, data, success)
 }
 
+//查询点位对应关系
+export function queryPointRela(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/point-relation`, data, success)
+}
+
 //更新point
 export function updatePoint(param, success) {
     let data = param.data,

+ 5 - 2
src/router/sagacloud.js

@@ -10,7 +10,10 @@ import editDataSouce from '@/views/point/config_point/edit_origin'
 import pointSteps from '@/views/point/config_point/steps'
 
 /**项目化配置 */
-import collectsetting from "@/views/project_setting/collection_setting"
+import collectsetting from "@/views/project_setting/collection_setting/index"
+
+/** 业务空间 */
+import spacelist from "@/views/business_space/admin"
 
 export default [
     { path: '/auth', name: 'Auth', component: Auth },
@@ -89,7 +92,7 @@ export default [
         component: LayoutMain,
         children: [
             { path: '', name: 'Dasboard', component: Dasboard },
-            { path: 'spacelist', name: 'Dasboard', component: Dasboard }
+            { path: 'spacelist', name: 'spacelist', component: spacelist }
         ]
     },
     //竖井管理

+ 3 - 1
src/store/index.js

@@ -3,6 +3,7 @@ import Vuex from 'vuex'
 import storage from '@/utils/storage'
 import layout from '@/framework/layout/layout-store'
 import project from "./moudles/project"
+import peojMess from "./moudles/proMess"
 Vue.use(Vuex)
 console.log(project, 'project')
 const KEY_LAST_ROUTE = 'last_route'
@@ -36,6 +37,7 @@ export default new Vuex.Store({
     actions: {},
     modules: {
         layout,
-        project
+        project,
+        peojMess
     }
 })

+ 29 - 0
src/store/moudles/proMess.js

@@ -0,0 +1,29 @@
+const project_mess = {
+    namespaced: true,
+    state: {
+        projectId: "Pj4201050001", //项目id
+        secret: "saga123456", //数据源id
+        userId: "test", //数据源类型
+    },
+    mutations: {
+        set_project(state, val) {
+            state.projectId = val
+        },
+        set_secret(state, val) {
+            state.secret = val
+        },
+        set_userId(state, val) {
+            state.userId = val
+        }
+    },
+    actions: {
+
+    },
+    getters: {
+        projectId: state => state.projectId,
+        userId: state => state.userId,
+        secret: state => state.secret
+    }
+}
+
+export default project_mess

+ 463 - 0
src/utils/scan/tools.js

@@ -0,0 +1,463 @@
+const tools = {}
+
+let arrX = []
+let arrY = []
+
+tools.getPointDetails = (arr) => {
+        arr.map(item => {
+            if (item.PointList && item.PointList.length) {
+                item.PointList.map(em => {
+                    arrX.push(em.X)
+                    arrY.push(em.Y)
+                })
+            }
+        })
+    }
+    /**
+     * 
+     * @param {*} obj 将point标签的x,y进行比对
+     * @return object 返回数组,其中包括最大值最小值X,Y 
+     */
+tools.getPoint = function(obj) {
+    arrX = []
+    arrY = []
+    for (let i in obj) {
+        tools.getPointDetails(obj[i])
+    }
+    let maxX = Math.max.apply(null, arrX)
+    let minX = Math.min.apply(null, arrX)
+    let maxY = Math.max.apply(null, arrY)
+    let minY = Math.min.apply(null, arrY)
+    let data = {
+        maxX,
+        minX,
+        maxY,
+        minY
+    }
+    return data
+}
+
+/**
+ * 
+ * @param {*} array  比较数组1
+ * @param {*} array2 比较数组2
+ * 
+ * 返回两个数组中不同的元素
+ */
+tools.compareArr = function(array, array2) {
+    var arr3 = [];
+    for (key in array) {
+        var stra = array[key];
+        var count = 0;
+        for (var j = 0; j < array2.length; j++) {
+            var strb = array2[j];
+            if (stra == strb) {
+                count++;
+            }
+        }
+        if (count === 0) { //表示数组1的这个值没有重复的,放到arr3列表中  
+            arr3.push(stra);
+        }
+    }
+    return arr3;
+}
+
+/**
+ * 
+ * @param {*} arr 需要改变的数组
+ * @param {*} k   其中Y值需要变换的倍数
+ * @param {*} name arr中的key值
+ * 
+ * 返回arr map 后arr[mapIndex]name * k 的数组
+ */
+tools.changeMap = function(arr, k, name) {
+    let data = arr.map(items => {
+        if (items[name] && items[name].length) {
+            items[name].map(children => {
+                if (Array.isArray(children)) {
+                    return children.map(res => {
+                        res.Y = res.Y * k
+                        return res
+                    })
+                } else {
+                    children.Y = children.Y * k
+                    return children
+                }
+            })
+        }
+    })
+    return data
+}
+
+tools.getMouseCanvas = function(view, e) {
+    let bbox = view.canvasView.getBoundingClientRect();
+    let x = e.clientX - bbox.left,
+        y = e.clientY - bbox.top;
+    return view.mapToScene({
+        x: x,
+        y: y
+    });
+}
+
+/**
+ * 
+ * @param {*} view graphy class
+ * @param {*} e    mouse元素e
+ */
+tools.mouseInElement = function(view, e, type) {
+    let mouse = tools.getMouseCanvas(view, e),
+        falg = false,
+        items = view.scene.root.children,
+        i = 0,
+        t = type || 3;
+    for (; i < items.length; i++) {
+        if (items[i].type == t) {
+            if (items[i].contains(mouse)) {
+                falg = true
+                break
+            }
+        }
+    }
+    return {
+        falg,
+        item: items[i] || [],
+        index: i
+    }
+}
+
+/**
+ * 
+ * @param {graphy中的所有children} items 
+ * @param {类型} type 
+ * @param {list} codes 
+ * @param {item中的code} code 
+ */
+tools.clear = function(items, type, codes, code) {
+    let indexArr = [];
+    if (items && items.length) {
+        let i = 0;
+        for (i; i < items.length; i++) {
+            let j = 0;
+            for (j; j < codes.length; j++) {
+                if (items[i][type] = type && items[i][code] == codes[j][code]) {
+                    indexArr.push(i)
+                }
+            }
+        }
+    }
+    return indexArr
+}
+
+tools.getText = function(arr, name) {
+    let text = '';
+    if (arr && arr.length) {
+        arr.map(item => {
+            text += (!!text ? '、' : '') + item[name]
+        })
+    }
+    return text
+}
+
+tools.cutString = function(string, num, text) {
+    return string.substring(0, num) + '...' + text
+}
+
+tools.deepCopy = function(obj) {
+    var out = [],
+        i = 0,
+        len = obj.length;
+    for (; i < len; i++) {
+        if (obj[i] instanceof Array) {
+            out[i] = tools.deepCopy(obj[i]);
+        } else out[i] = obj[i];
+    }
+    return out;
+}
+
+tools.copyArr = (source) => {
+    if (!source || typeof source !== 'object') {
+        throw new Error('error arguments', 'shallowClone');
+    }
+    var targetObj = source.constructor === Array ? [] : {};
+    for (var keys in source) {
+        if (source.hasOwnProperty(keys)) {
+            if (source[keys] && typeof source[keys] === 'object') {
+                targetObj[keys] = source[keys].constructor === Array ? [] : {};
+                targetObj[keys] = tools.copyArr(source[keys]);
+            } else {
+                targetObj[keys] = source[keys];
+            }
+        }
+    }
+    return targetObj;
+}
+
+tools.deepCopyObj = function(v) {
+    var o = v.constructor === Array ? [] : {};
+    for (var key in v) {
+        o[key] = typeof v[key] === 'Object' ? tools.deepCopyObj(v[key]) : v[key];
+    }
+
+    return o;
+}
+
+tools.deepClone = (obj) => {
+    var proto = Object.getPrototypeOf(obj);
+    return Object.assign({}, Object.create(proto), obj);
+}
+
+//hansontable插件的修改
+tools.customDropdownRenderer = function(
+    instance,
+    td,
+    row,
+    col,
+    prop,
+    value,
+    cellProperties
+) {
+    var selectedId;
+    var optionsList = cellProperties.chosenOptions.data;
+    if (
+        typeof optionsList === "undefined" ||
+        typeof optionsList.length === "undefined" ||
+        !optionsList.length
+    ) {
+        Handsontable.renderers.TextRenderer(
+            instance,
+            td,
+            row,
+            col,
+            prop,
+            value,
+            cellProperties
+        );
+        return td;
+    }
+    var values = (value + "").split(",");
+    value = [];
+    for (var index = 0; index < optionsList.length; index++) {
+        if (optionsList[index].content && optionsList[index].content.length) {
+            for (let i = 0; i < optionsList[index].content.length; i++) {
+                if (
+                    optionsList[index].content[i] &&
+                    optionsList[index].content[i].length
+                ) {
+                    for (let j = 0; j < optionsList[index].content[i].length; j++) {
+                        if (
+                            values.indexOf(
+                                optionsList[index].content[i].content[j].Code + ""
+                            ) > -1
+                        ) {
+                            selectedId = optionsList[index].content[i].content[j].Code;
+                            value.push(optionsList[index].content[i].content[j].Name);
+                        }
+                    }
+                } else {
+                    if (
+                        values.indexOf(optionsList[index].content[i].Code + "") > -1
+                    ) {
+                        selectedId = optionsList[index].content[i].Code;
+                        value.push(optionsList[index].content[i].Name);
+                    }
+                }
+            }
+        } else {
+            if (values.indexOf(optionsList[index].Code + "") > -1) {
+                selectedId = optionsList[index].Code;
+                value.push(optionsList[index].Name);
+            }
+        }
+    }
+    value = value.join(", ");
+    Handsontable.renderers.TextRenderer(
+        instance,
+        td,
+        row,
+        col,
+        prop,
+        value,
+        cellProperties
+    );
+    return td;
+}
+
+
+//hansontable插件查看详情
+tools.lookDetails = function(instance, td, row, col, prop, value, cellProperties) {
+    td.style.color = "#409EFF";
+    td.style.cursor = "pointer";
+    if (!!value) {
+        if (typeof(value) == 'object') {
+            td.innerHTML = "已有值,查看";
+        } else {
+            td.innerHTML = value
+        }
+    } else {
+        td.innerHTML = "查看详情";
+    }
+    return td;
+}
+
+//是否关联
+tools.hasRelation = function(instance, td, row, col, prop, value, cellProperties) {
+    if (value) {
+        td.innerHTML = "已关联";
+    } else {
+        td.innerHTML = "未关联";
+    }
+    return td;
+}
+
+tools.num = function(instance, td, row, col, prop, value, cellProperties) {
+    td.style.color = "#409EFF";
+    td.style.cursor = "pointer";
+    td.innerHTML = value;
+    return td;
+}
+
+tools.setItem = (key, value) => {
+    if (typeof value == 'string') {
+        localStorage.setItem(key, value);
+    } else {
+        localStorage.setItem(key, JSON.stringify(value));
+    }
+}
+
+tools.getItem = (key) => {
+    const re = /^\[|\{|\}|\]$/g //判断字符中是否有[]{}
+    let getIt = localStorage.getItem(key)
+    if (re.test(getIt)) {
+        return JSON.parse(getIt)
+    } else {
+        return getIt
+    }
+}
+
+tools.removeItem = (key) => {
+    localStorage.removeItem(key)
+}
+
+//取两个数组的差值
+tools.differenceArr = (a, b) => {
+    return a.concat(b).filter(v => !a.includes(v) || !b.includes(v))
+}
+
+//取两个数组的相同值
+tools.sameArr = (a, b) => {
+    return a.filter(v => b.includes(v))
+}
+
+tools.sortArr = (arr, key, sequence) => {
+    function compare(property) {
+        return function(a, b) {
+            var value1 = a[property];
+            var value2 = b[property];
+            if (sequence) {
+                return value1 - value2;
+            } else {
+                return value2 - value1
+            }
+        }
+    }
+
+    return arr.sort(compare(key))
+}
+
+tools.pagination = (pageNo, pageSize, array) => {
+    let offset = (pageNo - 1) * pageSize;
+    return offset + pageSize >= array.length ?
+        array.slice(offset, array.length) :
+        array.slice(offset, offset + pageSize);
+}
+
+tools.getSameItems = (arr1, key1, arr2, key2) => {
+    let data = []
+    arr1.map(item => {
+        arr2.map(child => {
+            if (item[key1] == child[key2]) {
+                data.push(item)
+            }
+        })
+    })
+    return data
+}
+
+tools.isIn = (x, y, json) => {
+    let nCross = 0,
+        point = typeof(x) == 'object' ? [x.x, x.y] : [x, y],
+        APoints = json,
+        length = APoints.length,
+        p1, p2, i, xinters;
+    p1 = APoints[0];
+    for (i = 1; i <= length; i++) {
+        p2 = APoints[i % length];
+        if (
+            point[0] > Math.min(p1[0], p2[0]) &&
+            point[0] <= Math.max(p1[0], p2[0])
+        ) {
+            if (point[1] <= Math.max(p1[1], p2[1])) {
+                if (p1[0] != p2[0]) {
+                    //计算位置信息
+                    xinters = (point[0] - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1];
+                    if (p1[1] == p2[1] || point[1] <= xinters) {
+                        nCross++
+                    }
+                }
+            }
+        }
+        p1 = p2;
+    }
+    if (nCross % 2 == 0) {
+        return false
+    } else {
+        return true
+    }
+
+}
+
+tools.arrayUnique = (arr, name) => {
+    var hash = {};
+    return arr.reduce(function(item, next) {
+        hash[next[name]] ? '' : hash[next[name]] = true && item.push(next);
+        return item;
+    }, []);
+}
+
+tools.dateAddYear = function(date, yearCount) {
+    var tempDate = dateToDate(date);
+    var count = parseInt(yearCount);
+    var oldYear = tempDate.getFullYear();
+    var oldMonth = tempDate.getMonth();
+    var oldDate = tempDate.getDate();
+    var newYear = oldYear + count;
+    var newDate = new Date(newYear, oldMonth, oldDate);
+    //防止月份数不一致,进行微调
+    while (newDate.getMonth() != oldMonth) {
+        oldDate--;
+        newDate = new Date(newYear, oldMonth, oldDate);
+    }
+    var month = newDate.getMonth() + 1;
+    var day = newDate.getDate();
+    month = (month.toString().length == 1) ? ("0" + month) : month;
+    day = (day.toString().length == 1) ? ("0" + day) : day;
+
+    var result = newDate.getFullYear() + '-' + month + '-' + day; //当前日期
+
+    return result;
+}
+
+function dateToDate(date) {
+    var sDate = new Date();
+    if (typeof date == 'object' && typeof new Date().getMonth == "function") {
+        sDate = date;
+    } else if (typeof date == "string") {
+        var arr = date.split('-');
+        if (arr.length == 3) {
+            sDate = new Date(arr[0] + '-' + arr[1] + '-' + arr[2]);
+        }
+    }
+    return sDate;
+}
+
+export default tools

+ 375 - 0
src/views/business_space/admin/index.vue

@@ -0,0 +1,375 @@
+<!--
+  revit业务空间
+ -->
+<template>
+    <div id="businessSpace">
+        <!------------------------    头部弹窗,选择楼层信息     -------------->
+        <no-model-dialog :param="param" title="选择要进行空间管理的楼层" :isShow="floor" @close="close"></no-model-dialog>
+        <!-- <influence-dialog ref="influence" :param="param" :tabsList="tabsList" title="受元空间变化影响的业务空间" :isShow="floor"></influence-dialog> -->
+        <!-- <details-dialog ref="details" @del="delSuccess" :param="param" :tabsList="tabsList" title="业务空间详情" :isShow="floor" :activeTabType="activeTabType"></details-dialog> -->
+        <!-- <not-related ref="notRelated" @createSuccess="createSuccess" :isShow="floor"></not-related> -->
+        <!-- <facility-dialog ref="facility" :activeTabType="activeTabType" :isShow="floor"></facility-dialog> -->
+        <!--------- 页面头部   -------------->
+        <div class="saga-title">
+            <div class="saga-build-mess">
+                <p>
+                    <i class="iconfont icon-jianzhu"></i> {{buildMess.buildName}} - {{buildMess.name}}
+                </p>
+                <el-button class="saga-btn" type="text" @click="changeShow">切换楼层</el-button>
+            </div>
+            <div class="saga-build-tab">
+                <div class="tab-main" @click="tabList(1)" :class="isMyTab == 1 ? 'tab-active' : ''">
+                    <i class="iconfont icon-tupian"></i>
+                    <span>平面图</span>
+                </div>
+                <div class="tab-main" @click="tabList(2)" :class="isMyTab == 2 ? 'tab-active' : ''">
+                    <i class="iconfont icon-liebiao"></i>
+                    <span>列表</span>
+                </div>
+            </div>
+        </div>
+        <div v-show="isMyTab == 1" class="saga-business-sapce-main">
+            <el-tabs v-model="activeName" @tab-click="tab1Click">
+                <template v-for="(item,index) in tabsList">
+              <el-tab-pane :name="item.code" :key="index" :disabled="item.code > 3">
+                <span slot="label">{{item.name}}</span>
+                <!-- <graphy
+                  @getSp="checkSpace"
+                  @dimension="checkSpace"
+                  @businessDetails="getBuinessDetails"
+                  :ref="'graphy' + item.code"
+                  :canvasId="item.code"
+                ></graphy> -->
+              </el-tab-pane>
+            </template>
+                </el-tabs>
+                <!-- <space-graphy @dimension="checkSpace" :tabsList="tabsList" ref="graphy" :param="param"></space-graphy> -->
+                </div>
+                <div v-show="isMyTab == 2" class="saga-business-sapce-main">
+                <el-tabs v-model="activeName" @tab-click="handleClick">
+            <template v-for="(item,index) in tabsList">
+                <el-tab-pane :name="item.code" :key="index" :disabled="item.code > 3">
+                    <span slot="label">{{item.name}}</span>
+                    <!-- <handsontable-main @lookEqu="lookEqu" :ref="'handsontable' + item.code" :id="'handsontable' + item.code" :param="param"></handsontable-main> -->
+                </el-tab-pane>
+            </template>
+      </el-tabs>
+      <!-- <space-handsontable :tabsList="tabsList" ref="spaceTable" :param="param"></space-handsontable> -->
+    </div>
+  </div>
+</template>
+
+<script>
+    import noModelDialog from "@/components/business_space/dialogs/noModelDialog";
+    // import influenceDialog from "@/components/business_space/dialogs/influenceDialog";
+    // import detailsDialog from "@/components/business_space/dialogs/detailsDialog";
+    // import notRelated from "@/components/business_space/dialogs/notRelated";
+    // import facilityDialog from "@/components/business_space/dialogs/facilityDialog";
+    // import spaceHandsontable from "@/components/business_space/business/spaceHandsontable";
+    // import graphy from "@/components/business_space/graphy/business";
+    // import handsontableMain from "@/components/business_space/business/handsontable";
+    import {
+        getTableHeader,
+        getAllbusiness,
+        getBussTypes
+    } from "@/api/scan/request";
+    import {
+        mapGetters,
+        mapActions
+    } from "vuex";
+    export default {
+        components: {
+            noModelDialog,
+            // spaceHandsontable,
+            // influenceDialog,
+            // detailsDialog,
+            // notRelated,
+            // graphy,
+            // handsontableMain,
+            // facilityDialog
+        },
+        computed: {
+            ...mapGetters("peojMess", [
+                "projectId",
+                "secret",
+                "userId"
+            ])
+        },
+        data() {
+            return {
+                floor: {
+                    dialogVisible: true, //选择楼层弹窗
+                    influence: false, //受影响的业务空间弹窗
+                    details: false, //详情弹窗
+                    notRelated: false,
+                    facility: false
+                },
+                param: {
+                    ProjId: this.projectId, //项目id
+                    UserId: this.userId, //用户id
+                    secret: this.secret
+                },
+                buildMess: {
+                    name: "--",
+                    code: "Fl110108000327d8f006c39f49feb40e24a7ef223232",
+                    map: "Fl110108000327d8f006c39f49feb40e24a7ef223232181009102258bim.json",
+                    isChild: true,
+                    buildName: "--",
+                    buildCode: "Bd11010800032251ebd43a3e430385cf679e90015385"
+                },
+                isMyTab: 1,
+                activeName: "GeneralZone",
+                tabsList: [],
+                activeTabType: {
+                    "code": "GeneralZone",
+                    "name": "默认分区",
+                    "rel_type": "99"
+                }
+            };
+        },
+        created() {
+            this.getTypes()
+        },
+        mounted() {},
+        methods: {
+            //获取tabs的列表
+            getTypes() {
+                getBussTypes(res => {
+                    let arr = [{
+                            "code": "GeneralZone",
+                            "name": "默认分区",
+                            "rel_type": "99"
+                        },
+                        {
+                            "name": "供电分区",
+                            "rel_type": "1",
+                            "code": "PowerSupplyZone"
+                        },
+                        {
+                            "name": "照明分区",
+                            "rel_type": "2",
+                            "code": "LightingZone"
+                        },
+                        {
+                            "name": "空调分区",
+                            "rel_type": "4",
+                            "code": "AirConditioningZone"
+                        },
+                    ]
+                    this.tabsList = arr
+                    // console.log(res)
+                    // this.tabsList = res.Content
+                })
+            },
+            checkSpace(list, build, graphyId) {
+                this.floor.notRelated = true;
+                this.$refs.notRelated.getIdList(list, build, graphyId, this.activeTabType);
+                this.$refs["graphy" + this.activeName][0].getHasSpace();
+            },
+            changeShow() {
+                this.floor.dialogVisible = true;
+            },
+            //成功关联平面图
+            createSuccess() {
+                this.$refs["graphy" + this.activeName][0].getHasSpace();
+                this.$refs["graphy" + this.activeName][0].clearDimension();
+                this.floor.notRelated = false;
+            },
+            //成功删除业务空间
+            delSuccess() {
+                this.floor.details = false;
+                this.$refs["graphy" + this.activeName][0].getHasSpace();
+                this.$refs["graphy" + this.activeName][0].clearDimension();
+            },
+            close(data) {
+                this.buildMess = data;
+                if (this.buildMess.affected) {
+                    this.floor.influence = true;
+                    this.$nextTick(() => {
+                        this.$refs.influence.getData(this.buildMess);
+                    });
+                }
+                if (!this.buildMess.map) {
+                    this.isMyTab = 2;
+                }
+                if (this.isMyTab == 2) {
+                    this.initTabs(this.buildMess);
+                } else {
+                    let data = this.getItemForType()
+                    this.$refs["graphy" + this.activeName][0].getData(this.buildMess.map, this.buildMess, this.activeTabType);
+                }
+            },
+            //查看业务空间详情
+            getBuinessDetails(list) {
+                this.floor.details = true;
+                this.$refs.details.getData(list, this.buildMess);
+            },
+            lookEqu(infos) {
+                this.floor.facility = true;
+                this.$refs.facility.getData(infos, this.buildMess);
+            },
+            tabList(num) {
+                console.log(this.$refs)
+                this.isMyTab = num;
+                if (num == 2) {
+                    this.initTabs(this.buildMess);
+                } else {
+                    let data = this.getItemForType()
+                    this.$refs["graphy" + this.activeName][0].getData(this.buildMess.map, this.buildMess, this.activeTabType);
+                }
+            },
+            //获取初始化信息点
+            initMessage() {
+                getTableHeader({
+                    code: this.activeTabType.code,
+                    ProjId: this.param.ProjId
+                }).then(res => {
+                    console.log(res)
+                    if (res.data.Result == "success") {
+                        console.log(res);
+                        let refFlag = "handsontable" + this.activeName;
+                        this.$refs[refFlag][0].getHeader(res.data.Content, this.activeTabType);
+                        //   for (let i = 0; i < this.tabsList.length; i++) {
+                        //   }
+                        this.getTableMain();
+                    } else {
+                        this.$message.error("请求错误");
+                    }
+                });
+            },
+            getItemForType() {
+                let data = {}
+                this.tabsList.map(item => {
+                    if (item.code == this.activeName) {
+                        data = item
+                    }
+                })
+                return data
+            },
+            tab1Click() {
+                this.activeTabType = this.getItemForType()
+                this.$refs["graphy" + this.activeName][0].getData(this.buildMess.map, this.buildMess, this.activeTabType);
+            },
+            /**
+             * tab标签被点击触发后的函数
+             * @param tab   tab实例
+             * @param event tab的dom
+             *
+             */
+            handleClick(tab, event) {
+                this.activeTabType = this.getItemForType()
+                this.initMessage();
+            },
+            /**
+             * 选择楼层后初始化tabs
+             * 由父级页面调用
+             *
+             * @param  floorParam  父级传入的楼层信息
+             */
+            initTabs(floorParam) {
+                // this.floor = floorParam;
+                this.initMessage();
+            },
+            getTableMain() {
+                let refFlag = "handsontable" + this.activeName;
+                this.$nextTick(() => {
+                    this.$refs[refFlag][0].getData(this.buildMess);
+                });
+                //   for (let i = 0; i < this.tabsList.length; i++) {
+                //     if (i == 0) {
+                //     }
+                //   }
+            }
+        },
+        watch: {
+            floor: {
+                deep: true,
+                handler: function() {
+                    if (this.floor.notRelated) {
+                        this.$refs["graphy" + this.activeName][0].clearDimension();
+                    }
+                }
+            }
+        }
+    };
+</script>
+
+<style lang="less">
+    #businessSpace {
+        .el-dialog__body {
+            max-height: 600px;
+            overflow-y: auto;
+        }
+        .el-tabs__nav-scroll {
+            padding-left: 10px;
+        }
+        .saga-title {
+            height: 40px;
+            background-color: #d7d7d7;
+            font-size: 14px;
+            line-height: 40px;
+            position: relative;
+            width: 100%;
+            .saga-build-mess {
+                position: absolute;
+                left: 10px;
+                width: 500px;
+                i {
+                    padding-right: 5px;
+                }
+                p {
+                    float: left;
+                }
+                .saga-btn {
+                    float: left;
+                    height: 40px;
+                    line-height: 40px;
+                    padding: 0 10px;
+                }
+            }
+            .saga-build-tab {
+                position: absolute;
+                left: 50%;
+                transform: translateX(-50%);
+                .tab-main {
+                    float: left;
+                    width: 120px;
+                    padding: 0 5px;
+                    margin: 5px 0;
+                    border: 1px solid #ccc;
+                    background-color: #fff;
+                    height: 30px;
+                    box-sizing: border-box;
+                    text-align: center;
+                    cursor: pointer;
+                    overflow: hidden;
+                    i {
+                        font-size: 18px;
+                        padding-right: 10px;
+                        float: left;
+                        line-height: 30px;
+                        margin-left: 10px;
+                    }
+                    span {
+                        line-height: 30px;
+                        float: left;
+                    }
+                }
+                .tab-active {
+                    background-color: #409eff;
+                    color: #fff;
+                }
+            }
+        }
+        .saga-business-sapce-main {
+            position: absolute;
+            width: 100%;
+            top: 40px;
+            left: 0;
+            right: 0;
+            bottom: 0;
+            overflow: hidden;
+            overflow-y: auto;
+        }
+    }
+</style>

+ 36 - 20
src/views/point/config_point/steps/step1.vue

@@ -9,7 +9,8 @@
             <el-checkbox v-model="checked">只显示使用的原始点位</el-checkbox>
         </div>
         <div id="handsontableSteps1">
-            <handsontable-component ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
+            <handsontable-component v-if="!!allData.length" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
+            <div v-else class="center">暂无数据</div>
         </div>
         <own-dialog :width="'580px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
             <localtion-falg :renderData="renderData"></localtion-falg>
@@ -42,7 +43,8 @@
                 hot: null,
                 changeFlag: true, //是否发生修改
                 localtionDialog: false,
-                renderData: {}
+                renderData: {},
+                allData: []
             }
         },
         computed: {
@@ -77,19 +79,21 @@
                 }
             },
             addRow() {
-                let data = this.hot.getSourceData()
-                data.unshift({})
-                this.hot.loadData(data)
-                this.hot.updateSettings({
-                    maxRows: data.length
-                })
-                console.log(data, this.hot, "data")
+                if(!!this.allData.length){
+                    let data = this.hot.getSourceData()
+                    data.unshift({})
+                    this.hot.loadData(data)
+                    this.hot.updateSettings({
+                        maxRows: data.length
+                    }) 
+                }else{
+                    this.allData = [{}]
+                    this.createHot()
+                }
             },
             getData() {
-                let header, width, param, settings
-                header = getHeaderSetting(this.protocolType)
                 // width = (document.getElementById("app").clientWidth - 50) / header.length
-                param = {
+                let param = {
                     type: this.protocolType,
                     data: {
                         Filters: {
@@ -101,14 +105,26 @@
                 }
                 queryPoint(param, res => {
                     console.log(res)
-                    settings = {
-                        data: res.Content,
-                        colHeaders: changeHeader(header),
-                        columns: showTypes(header),
-                        // colWidths: width,
-                        rowHeights: 30,
-                        maxRows: res.Content.length
-                    }
+                    this.allData = res.Content || []
+                    this.createHot()
+                })
+            },
+            //创建实例
+            createHot(){
+                let header, width, settings
+                header = getHeaderSetting(this.protocolType)
+                settings = {
+                    data: this.allData,
+                    colHeaders: changeHeader(header),
+                    columns: showTypes(header),
+                    // colWidths: width,
+                    rowHeights: 30,
+                    maxRows: this.allData.length
+                }
+                if(!this.allData.length){
+                    return false
+                }
+                this.$nextTick( _ => {
                     this.hot = this.$refs.handsontable.init(settings)
                     console.log(this.hot)
                 })

+ 16 - 8
src/views/point/config_point/steps/step3.vue

@@ -32,7 +32,7 @@
     import dialogMain from "@/components/config_point/step3_point/dialog_main"
     import stepsMain from "@/components/config_point/step3_point/steps3_main"
     import {
-        queryPoint
+        queryPointRela
     } from "@/fetch/point_http"
     import step3Edit from '@/components/config_point/step3_edit/index'
     export default {
@@ -104,19 +104,27 @@
                 param = {
                     type: this.protocolType,
                     data: {
-                        Filters: {
-                            DatasourceId: this.datasourceId,
-                        },
+                        DataSourceId: this.datasourceId,
                         "PageNumber": 1,
                         "PageSize": 50,
                     }
                 }
-                queryPoint(param, res => {
-                    console.log(res)
+                queryPointRela(param, res => {
+                    let content = res.Content.map(item => {
+                        if(item.RelationList.length){
+                            item.Point.DataRuleType = item.RelationList[0].DataRuleType
+                            item.Point.PhysicalRelated = item.RelationList[0].EquipmentType + '-' + item.RelationList[0].InfomationPoint
+                        }
+                        return item
+                    })
                     settings = {
-                        data: res.Content,
+                        data: content,
                         colHeaders: changeHeader(headerArr),
-                        columns: showTypes(headerArr),
+                        columns: showTypes(headerArr).map(item => {
+                            item.readOnly = true
+                            item.data = 'Point.' + item.data
+                            return item
+                        }),
                         colWidths: width,
                         rowHeights: 30,
                         maxRows: res.Content.length

src/views/project_setting/collection_setting.vue → src/views/project_setting/collection_setting/index.vue