Browse Source

Merge branch 'master' of http://39.106.8.246:3003/web/ibms

# Conflicts:
#	src/components/data_admin/buildData/style.less
#	src/views/data_admin/buildData/index.vue
chuwu 6 years ago
parent
commit
2c7f61e55c
48 changed files with 8126 additions and 67 deletions
  1. 3 3
      src/components/business_space/dialogs/changeRea.vue
  2. 1 1
      src/components/business_space/lib/lookImages.vue
  3. 1 1
      src/components/business_space/lib/qrcode.vue
  4. 1 1
      src/components/business_space/lib/uploadFiles.vue
  5. 12 4
      src/components/data_admin/buildData/style.less
  6. 496 0
      src/components/dialogHanson/addDevice.vue
  7. 766 0
      src/components/dialogs/addDialog/businessDialog.vue
  8. 848 0
      src/components/dialogs/addDialog/dialogAssets.vue
  9. 964 0
      src/components/dialogs/addDialog/dialogDevice.vue
  10. 871 0
      src/components/dialogs/addDialog/dialogSystem.vue
  11. 351 0
      src/components/dialogs/changeRea.vue
  12. 200 0
      src/components/dialogs/detailsDialog.vue
  13. 143 0
      src/components/dialogs/facilityDialog.vue
  14. 140 0
      src/components/dialogs/influenceDialog.vue
  15. 50 0
      src/components/dialogs/list/filesDialog.vue
  16. 162 0
      src/components/dialogs/list/firm.vue
  17. 187 0
      src/components/dialogs/list/guaranteeDialog.vue
  18. 184 0
      src/components/dialogs/list/insurerDialog.vue
  19. 184 0
      src/components/dialogs/list/maintainerDialog.vue
  20. 88 0
      src/components/dialogs/list/paramDetails.vue
  21. 141 0
      src/components/dialogs/list/picDialog.vue
  22. 183 0
      src/components/dialogs/list/supplierDialog.vue
  23. 157 0
      src/components/dialogs/list/supplyDialog.vue
  24. 313 0
      src/components/dialogs/list/systemType.vue
  25. 62 0
      src/components/dialogs/list/uploadImgDialog.vue
  26. 161 0
      src/components/dialogs/noModelDialog.vue
  27. 57 0
      src/components/dialogs/notRelated.vue
  28. 3 7
      src/components/ledger/addDialog/dialogAssets.vue
  29. 8 6
      src/components/ledger/addDialog/dialogDevice.vue
  30. 8 8
      src/components/ledger/addDialog/dialogSystem.vue
  31. 19 12
      src/components/ledger/handsontables/device.vue
  32. 75 0
      src/components/ledger/lib/detailsDia.vue
  33. 315 0
      src/components/ledger/lib/formInput.vue
  34. 58 0
      src/components/ledger/lib/myPagination.vue
  35. 57 0
      src/components/ledger/lib/qrcode.vue
  36. 207 0
      src/components/ledger/lib/uploadFiles.vue
  37. 321 0
      src/components/ledger/lib/uploadImgs.vue
  38. 70 0
      src/utils/hasontableUtils.js
  39. 31 0
      src/utils/uuid.js
  40. 12 0
      src/views/data_admin/buildData/index.vue
  41. 1 1
      src/views/data_admin/buildGraphy/graphyCanvas.vue
  42. 14 5
      src/views/data_admin/buildGraphy/lib/floorCascader.vue
  43. 2 2
      src/views/data_admin/buildGraphy/lib/lookImages.vue
  44. 2 2
      src/views/data_admin/buildGraphy/lib/qrcode.vue
  45. 2 2
      src/views/data_admin/buildGraphy/lib/uploadFiles.vue
  46. 1 1
      src/views/data_admin/buildGraphy/lib/uploadImgs.vue
  47. 3 3
      src/views/data_admin/buildGraphy/lib/uploadImgsName.vue
  48. 191 8
      src/views/ledger/facility/index.vue

+ 3 - 3
src/components/business_space/dialogs/changeRea.vue

@@ -58,10 +58,10 @@
   </el-dialog>
 </template>
 <script>
-import myPagination from "@/components/lib/myPagination";
+import myPagination from "@/components/ledger/lib/myPagination";
 import paramDetails from "@/components/dialogs/list/paramDetails"
-import { getBillPropList, getEquipmentFamily, getSpaceFloor, getBussines, upDateTableMain } from "@/api/request"
-import floorCascader from "@/components/lib/floorCascader";
+import { getBillPropList, getEquipmentFamily, getSpaceFloor, getBussines, upDateTableMain } from "@/api/scan/request"
+import floorCascader from "@/components/ledger/lib/floorCascader";
 
 export default {
   components: {

+ 1 - 1
src/components/business_space/lib/lookImages.vue

@@ -53,7 +53,7 @@
   </el-dialog>
 </template>
 <script>
-import uploadImgs from "@/components/lib/uploadImgsName";
+import uploadImgs from "@/components/ledger/lib/uploadImgsName";
 import tools from "@/utils/scan/tools"
 export default {
   components: {

+ 1 - 1
src/components/business_space/lib/qrcode.vue

@@ -10,7 +10,7 @@
       <div id="qrcode">
         <img
           style="width:200px;height:200px;margin:auto;display:block;"
-          :src="'image-service/common/file_get/'+ qrcodeUrl +'?systemId=dataPlatform'"
+          :src="'/image-service/common/file_get/'+ qrcodeUrl +'?systemId=dataPlatform'"
           alt="二维码"
         >
       </div>

+ 1 - 1
src/components/business_space/lib/uploadFiles.vue

@@ -92,7 +92,7 @@ export default {
     //点击下载
     download(key) {
       console.log(key)
-      window.open("/img/image-service/common/file_get/" + key + "?systemId=dataPlatform")
+      window.open("/image-service/common/file_get/" + key + "?systemId=dataPlatform")
     },
 
     //删除图片

+ 12 - 4
src/components/data_admin/buildData/style.less

@@ -73,7 +73,7 @@
       width: 100%;
       overflow: hidden;
       top: 3.1rem;
-      z-index: 500;
+      z-index: 100;
       background-color: #fff;
     }
     .build_label {
@@ -111,15 +111,18 @@
           height: 100%;
         }
         .swiper-wrapper{
-          height: 92%;
+          height: 100%;
         }
         .active_swiper{
+          width: 100%;
           height: 100%;
         }
         .swiper-slide {
           background: #fff;
           border: 1px solid #333;
           height: 100%;
+          display: inline-block;
+          float: left;
           h3 {
             font-size: 1.2rem;
             font-weight: bold;
@@ -178,6 +181,7 @@
     }
     .label_show {
       height: 3rem;
+      margin-top: 30px;
       .label_btn {
         width: 15rem;
         height: 3rem;
@@ -198,7 +202,7 @@
     .build_operate {
       height: 3rem;
       line-height: 3rem;
-      margin-top: 3rem;
+      margin-top: 6rem;
       .build_msg {
         float: right;
         font-size: 12px;
@@ -245,6 +249,10 @@
     .build_table {
       flex: 1;
       overflow-y: hidden;
+      height: 484px;
+      .el-tabs{
+        height:480px;
+      }
       .data_page {
         position: absolute;
         width: 100%;
@@ -292,7 +300,7 @@
         left: 0;
       }
       .turn_right {
-        right: 0;
+        right: 117px;
       }
       .pic_view {
         width: 100%;

+ 496 - 0
src/components/dialogHanson/addDevice.vue

@@ -0,0 +1,496 @@
+<template>
+  <div>
+    <div class="hanson-bar">
+      <span>当前选择的设备类型:{{deviceType.facility}}</span>
+      <el-button size="small" @click="undo" icon="iconfont icon-undo">撤销</el-button>
+      <el-button size="small" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
+    </div>
+    <qrcode :dialog="dialog" :addBody="true" ref="qrcode"></qrcode>
+    <firm :dialog="dialog"></firm>
+    <supply-dialog :dialog="dialog"></supply-dialog>
+    <supplier-dialog :dialog="dialog"></supplier-dialog>
+    <guarantee-dialog :dialog="dialog"></guarantee-dialog>
+    <upload-files-dialog :dialog="dialog"></upload-files-dialog>
+    <div v-show="main && main.length" id="myHandson" ref="myHandson"></div>
+  </div>
+</template>
+<script>
+import { getSpaceHeader } from "@/api/scan/request";
+import tools from "@/utils/scan/tools";
+import qrcode from "@/components/ledger/lib/qrcode";
+import firm from "@/components/dialogs/list/firm";
+import supplyDialog from "@/components/dialogs/list/supplyDialog";
+import supplierDialog from "@/components/dialogs/list/supplierDialog";
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
+
+export default {
+  props: {
+    deviceType: {
+      type: Object
+    }
+  },
+  components: {
+    qrcode, //二维码页面
+    firm, //
+    supplyDialog,
+    supplierDialog,
+    guaranteeDialog,
+    uploadFilesDialog,
+  },
+  data() {
+    let table = function (num) {
+      let main = []
+      for (let i = 0; i < num; i++) {
+        main.push({})
+      }
+      return main
+    }
+    return {
+      main: table(20),
+      mess: {},
+      headers: null,
+      page: {
+        size: 10,
+        sizes: [10, 30, 50, 100, 150, 200],
+        total: 400,
+        currentPage: 1
+      },
+      dialog: {
+        qrcode: false, //二维码弹窗
+        firm: false, //厂商弹窗
+        supply: false, //选择供应合同
+        supplier: false, //供应商选择
+        guarantee: false //选择保单
+      }
+    };
+  },
+  created() {
+  },
+  mounted() { },
+  methods: {
+
+    //获取header的mess
+    getHeader(mess) {
+      this.mess = mess;
+      console.log(this.mess);
+    },
+
+    //获取主体内容
+    getMain(floorMess) {
+      console.log(floorMess);
+    },
+
+    //获取表头
+    getData() {
+      getSpaceHeader({
+        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;
+        }
+        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.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(
+        {
+          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: "删除该业务空间"
+            }
+          }
+        },
+        // 事件
+        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;
+    },
+
+    //表格中的点击
+    eventClick(el, rowArr) {
+      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, rowArr);
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+        let infos = this.main[sortArr[rowArr.row]];
+        this.getInfors(infos, rowArr);
+      } else if (trimmedArr.length) {
+        let infos = this.main[trimmedArr[rowArr.row]];
+        this.getInfors(infos, rowArr);
+      } else {
+        let infos = this.main[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+
+    getInfors(infos, row) {
+      //点击的是表头
+      if (row.row < 0) {
+        return;
+      }
+      //其他的开始判断
+      let val = this.hot.colToProp(row.col);
+      if (val == "infos.EquipQRCode") {
+        this.dialog.qrcode = true;
+        this.$refs.qrcode.getCanvas(1111);
+      }
+
+      if (val == "infos.Brand" || val == "infos.Specification") {
+        this.dialog.firm = true;
+      }
+
+      if (val == "infos.SupplierContractID") {
+        this.dialog.supply = true;
+      }
+
+      if (val == "infos.InsuranceNum") {
+        //选择保单
+        this.dialog.guarantee = true;
+      }
+
+      if (val == "infos.InsuranceFile" || val == "infos.Archive") {
+        alert("上传文件");
+      }
+
+      if (
+        val == "infos.InstallLocation" ||
+        val == "infos.InstallPic" ||
+        val == "infos.InstallDrawing" ||
+        val == "infos.Nameplate" ||
+        val == "infos.Pic" ||
+        val == "infos.Drawing"
+      ) {
+        alert("上传图片");
+      }
+
+      if (
+        val == "infos.Maintainer" ||
+        val == "infos.Supplier" ||
+        val == "infos.Insurer" ||
+        val == "infos.InsurerContactor"
+      ) {
+        this.dialog.supplier = true;
+      }
+      console.log(val);
+    },
+
+    //获取被筛选掉的行号
+    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;
+    }
+  },
+  watch: {
+    deviceType: {
+      handler(newName, oldName) {
+        this.getData()
+      },
+      immediate: true
+    }
+  }
+};
+</script>
+<style lang="less">
+.hanson-bar {
+  height: 40px;
+  padding: 5px;
+  font-size: 16px;
+  overflow: hidden;
+  .iconfont {
+    font-size: 12px;
+  }
+  .el-button {
+    margin-right: 10px;
+  }
+}
+</style>

+ 766 - 0
src/components/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/scan/request";
+import tools from "@/utils/scan/tools";
+import qrcode from "@/components/ledger/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>

+ 848 - 0
src/components/dialogs/addDialog/dialogAssets.vue

@@ -0,0 +1,848 @@
+<!--
+    上传文件的弹窗
+-->
+
+<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 "@/utils/scan/tools";
+import qrcode from "@/components/ledger/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/handsontable/mainText"
+
+import showTools from "@/utils/handsontable/notShow"
+
+import uuid from "@/utils/uuid";
+import {
+    mapGetters,
+    mapActions
+} from "vuex";
+import { getTableHeader, createProperty, getSpaceFloor, createAssetsList } from "@/api/scan/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: "",
+        secret: ""
+      },
+      floorData: [],
+      isWatch: true,
+      ajaxResult: true
+    };
+  },
+   computed: {
+      ...mapGetters("peojMess", [
+          "projectId",
+          "secret",
+          "userId"
+      ])
+  },
+  created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
+    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>

+ 964 - 0
src/components/dialogs/addDialog/dialogDevice.vue

@@ -0,0 +1,964 @@
+<!--
+    上传文件的弹窗
+-->
+
+<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/ledger/lib/cascader";
+import hansonTable from "@/components/dialogHanson/addDevice";
+import { getTableHeader, getSpaceFloor, getEquipmentFamily, BatchCreateSome, createAssetsList, createSystem, EqToAssets, createRelation } from "@/api/scan/request";
+import tools from "@/utils/scan/tools";
+import showTools from "@/utils/handsontable/notShow"
+import text from "@/utils/handsontable/mainText"
+
+import qrcode from "@/components/ledger/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";
+import {mapGetters, mapActions} from "vuex";
+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: "",
+        secret: ""
+      },
+      id: 0,
+      systemList: null,
+      isWatch: true,
+      EquipmentList: [],//资产族
+      floorFalg: false,
+    };
+  },
+  computed: {
+      ...mapGetters("peojMess", [
+          "projectId",
+          "secret",
+          "userId"
+      ])
+  },
+  created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
+    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>

+ 871 - 0
src/components/dialogs/addDialog/dialogSystem.vue

@@ -0,0 +1,871 @@
+<!--
+    上传文件的弹窗
+-->
+
+<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 "@/utils/scan/tools";
+import qrcode from "@/components/ledger/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 {mapGetters, mapActions} from "vuex";
+import { getTableHeader, BatchCreateSome, getSpaceFloor } from "@/api/scan/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: "",
+        secret: ""
+      },
+      floorData: []
+    };
+  },
+  computed: {
+      ...mapGetters("peojMess", [
+          "projectId",
+          "secret",
+          "userId"
+      ])
+  },
+  created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
+    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>

+ 351 - 0
src/components/dialogs/changeRea.vue

@@ -0,0 +1,351 @@
+<!--
+    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/ledger/lib/myPagination";
+import paramDetails from "@/components/dialogs/list/paramDetails"
+import { getBillPropList, getEquipmentFamily, getSpaceFloor, getBussines, upDateTableMain } from "@/api/scan/request"
+import floorCascader from "@/components/ledger/lib/floorCascader";
+import {mapGetters, mapActions} from "vuex";
+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()
+  },
+  computed: {
+      ...mapGetters("peojMess", [
+          "projectId",
+          "secret",
+          "userId"
+      ])
+  },
+  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.userId,
+          ProjId: this.projectId
+        }
+        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.secret,
+        ProjId: this.projectId
+      }
+      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/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/scan/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/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/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/scan/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/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/ledger/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/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/ledger/lib/myPagination";
+import paramDetails from "@/components/dialogs/list/paramDetails"
+import { getSpecList } from "@/api/scan/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/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/ledger/lib/myPagination";
+import uploadFiles from '@/components/ledger/lib/uploadFiles'
+import { getListForGuarantee, createGuarantee } from "@/api/scan/request"
+import tools from "@/utils/scan/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/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/ledger/lib/myPagination";
+import { getLib } from "@/api/scan/request"
+import tools from "@/utils/scan/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/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/ledger/lib/myPagination";
+import { getLib } from "@/api/scan/request"
+import tools from "@/utils/scan/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/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/scan/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/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/ledger/lib/uploadImgsName";
+import tools from "@/utils/scan/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/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/ledger/lib/myPagination";
+import { getLib } from "@/api/scan/request"
+import tools from "@/utils/scan/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/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/ledger/lib/myPagination";
+import { getListForSupplier } from "@/api/scan/request"
+import tools from "@/utils/scan/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/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/ledger/lib/myPagination";
+import { getLib, getAllbusiness, getEqCode, getRelation } from "@/api/scan/request"
+import tools from "@/utils/scan/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/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/ledger/lib/uploadImgs";
+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>

+ 161 - 0
src/components/dialogs/noModelDialog.vue

@@ -0,0 +1,161 @@
+<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 {mapGetters, mapActions} from "vuex";
+import tools from '@/utils/scan/tools'
+export default {
+    props: {
+        width: {
+            type: String,
+            default: "40%"
+        },
+        title: {
+            type: String,
+            default: "头部信息"
+        },
+        isShow: {
+            type: Object
+        },
+        param: {
+            type: Object
+        }
+    },
+    data() {
+        return {
+            treeArr: {
+                label: "name", //label的名字
+                children: "children", //如果有下一级children和isLeaf存在
+            },
+            data: null,
+            proj: null,
+            mess: null
+        };
+    },
+    created() {
+        this.param.ProjId = this.projectId
+        this.param.secret = this.secret
+        this.param.UserId = this.userId
+        this.getNodes()
+    },
+    computed: {
+        ...mapGetters("peojMess", [
+            "projectId",
+            "secret",
+            "userId"
+        ])
+    },
+    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.param.ProjId,
+                UserId: this.param.UserId,
+                secret: this.param.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="less" scoped>
+</style>

+ 57 - 0
src/components/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>

+ 3 - 7
src/components/ledger/addDialog/dialogAssets.vue

@@ -99,12 +99,8 @@ import Handsontable from "handsontable-pro"
 import text from "@/utils/handsontable/mainText"
 
 import showTools from "@/utils/handsontable/notShow"
-
+import {mapGetters, mapActions} from "vuex";
 import uuid from "@/utils/scan/uuid";
-import {
-    mapGetters,
-    mapActions
-} from "vuex";
 import { getTableHeader, createProperty, getSpaceFloor, createAssetsList } from "@/api/scan/request";
 let table = function (num) {
   let main = []
@@ -196,8 +192,8 @@ export default {
     };
   },
   created() {
-      this.param.ProjId = this.projectId
-      this.param.secret = this.secret
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
     this.getFloorData()
   },
   mounted() { },

+ 8 - 6
src/components/ledger/addDialog/dialogDevice.vue

@@ -94,10 +94,10 @@ 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 "@/utils/scan/tools";
-import showTools from "@/utils/hansontable/notShow"
-import text from "@/utils/hansontable/mainText"
+import showTools from "@/utils/handsontable/notShow"
+import text from "@/utils/handsontable/mainText"
 
-import qrcode from "@/components/lib/qrcode";
+import qrcode from "@/components/ledger/lib/qrcode";
 import firm from "@/components/dialogs/list/firm";
 import supplyDialog from "@/components/dialogs/list/supplyDialog";
 import supplierDialog from "@/components/dialogs/list/supplierDialog";
@@ -115,7 +115,7 @@ import "@/assets/js/chosen.jquery.min";
 import "@/assets/js/handsontable-chosen-editor";
 
 import uuid from "@/utils/uuid";
-
+import {mapGetters, mapActions} from "vuex";
 let table = function (num) {
   let main = []
   for (let i = 0; i < num; i++) {
@@ -194,8 +194,8 @@ export default {
       imgsArr: [],//临时保存的图片key数组
       picsArr: [],//临时设备图片keys数组
       param: {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: "",
+        secret: ""
       },
       id: 0,
       systemList: null,
@@ -205,6 +205,8 @@ export default {
     };
   },
   created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
     this.getFloorData()
     this.getEquipmentFamilyList()
   },

+ 8 - 8
src/components/ledger/addDialog/dialogSystem.vue

@@ -128,12 +128,12 @@ export default {
     }
   },
   computed: {
-        ...mapGetters("peojMess", [
-            "projectId",
-            "secret",
-            "userId"
-        ])
-    },
+      ...mapGetters("peojMess", [
+          "projectId",
+          "secret",
+          "userId"
+      ])
+  },
   data() {
     return {
       width: "30%",
@@ -177,8 +177,8 @@ export default {
     };
   },
   created() {
-      this.param.ProjId = this.projectId
-      this.param.secret = this.secret
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
     this.setValue()
     this.getFloorData()
   },

+ 19 - 12
src/components/ledger/handsontables/device.vue

@@ -98,15 +98,15 @@
   </div>
 </template>
 <script>
-import { getTableHeader, getSpaceFloor, getEquipmentFamily, getBillEquipList, BeatchQueryParam, delBatchList, updateBusiness } from "@/api/request";
+import { getTableHeader, getSpaceFloor, getEquipmentFamily, getBillEquipList, BeatchQueryParam, delBatchList, updateBusiness } from "@/api/scan/request";
 
 
-import tools from "@/assets/js/tools";
+import tools from "@/utils/scan/tools";
 import handsonUtils from "@/utils/hasontableUtils"
-import showTools from "@/utils/hansontable/notShow"
-import text from "@/utils/hansontable/mainText"
+import showTools from "@/utils/handsontable/notShow"
+import text from "@/utils/handsontable/mainText"
 
-import qrcode from "@/components/lib/qrcode";
+import qrcode from "@/components/ledger/lib/qrcode";
 import firm from "@/components/dialogs/list/firm";
 import supplyDialog from "@/components/dialogs/list/supplyDialog";
 import supplierDialog from "@/components/dialogs/list/supplierDialog";
@@ -117,16 +117,16 @@ 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 myPagination from "@/components/lib/myPagination";
+import myPagination from "@/components/ledger/lib/myPagination";
 import dialogAssets from "@/components/dialogs/addDialog/dialogDevice";
-import detailsDialog from "@/components/lib/detailsDia"
+import detailsDialog from "@/components/ledger/lib/detailsDia"
 import changeRea from "@/components/dialogs/changeRea"
 //图片查看
-import lookPic from "@/components/lib/lookImages"
+import lookPic from "@/components/ledger/lib/lookImages"
 //下拉插件
 import "@/assets/js/chosen.jquery.min";
 import "@/assets/js/handsontable-chosen-editor";
-
+import {mapGetters, mapActions} from "vuex";
 export default {
   props: ["myParam"],
   components: {
@@ -180,7 +180,7 @@ export default {
       messKey: null,
       imgsArr: [],//临时保存的图片key数组
       picsArr: [],//临时设备图片keys数组
-      projId: this.$route.query.projId,
+      projId: "",
       copyMain: null,
       graphyId: null,
       systemId: null,
@@ -204,12 +204,19 @@ export default {
     this.getFloorData()
   },
   mounted() { },
+  computed: {
+    ...mapGetters("peojMess", [
+        "projectId",
+        "secret",
+        "userId"
+    ])
+  },
   methods: {
     //获取楼层数据
     getFloorData() {
       let param = {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       }
       getSpaceFloor(param).then(res => {
         if (res.data.Result == 'success') {

+ 75 - 0
src/components/ledger/lib/detailsDia.vue

@@ -0,0 +1,75 @@
+<template>
+  <el-dialog
+    :title="title"
+    append-to-body
+    class="iframe"
+    :visible.sync="dialog.details"
+    width="500px"
+  >
+    <iframe
+      id="google_ads_frame2"
+      name="google_ads_frame2"
+      frameborder="0"
+      width="100%"
+      height="600px"
+      :src="iframeSrc"
+      marginwidth="0"
+      marginheight="0"
+      vspace="0"
+      hspace="0"
+      allowtransparency="true"
+      scrolling="no"
+      allowfullscreen="true"
+    ></iframe>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  props: {
+    iframeSrc: {
+      type: String,
+      default: ""
+    },
+    title: {
+      type: String,
+      default: "详情"
+    },
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          details: false
+        }
+      }
+    },
+    setData: {
+      type: [Array, String],
+      default: function () {
+        return []
+      }
+    }
+  },
+  methods: {
+    setMess() {
+      this.$nextTick(_ => {
+        let iframe = document.getElementById("google_ads_frame2")
+        iframe.onload = () => {
+          iframe.contentWindow.postMessage(this.setData, "*")
+        }
+      })
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.details) {
+          this.setMess()
+        }
+      }
+    }
+  }
+}
+</script>
+

+ 315 - 0
src/components/ledger/lib/formInput.vue

@@ -0,0 +1,315 @@
+<!--
+A1	手工填写-单个-数字-无单位
+A2	手工填写-单个-数字-有单位
+A3	手工填写-多个-数字-无单位
+A4	手工填写-多个-数字-有单位
+A5	手工填写-单个-数字范围-无单位
+A6	手工填写-单个-数字范围-有单位
+A7	手工填写-多个-数字范围-无单位
+A8	手工填写-多个-数字范围-有单位
+B1	手工填写-单个-文本
+B2	手工填写-多个-文本
+C1	手工填写-单个-日期时间值
+C2	手工填写-单个-日期时间段
+C3	手工填写-多个-日期时间值
+C4	手工填写-多个-日期时间段
+C5	手工填写-单个-日期值
+C6	手工填写-单个-日期段
+C7	手工填写-多个-日期值
+C8	手工填写-多个-日期段
+C9	手工填写-单个-时间值
+C10	手工填写-单个-时间段
+C11	手工填写-多个-时间值
+C12	手工填写-多个-时间段
+D1	字典选择-单个-单选
+D2	字典选择-单个-多选
+D3	字典选择-多个-单选
+D4	字典选择-多个-多选
+E1	字典布尔选择-单个
+E2	字典布尔选择-多个
+F1	上传-单个文件 -->
+
+<template>
+  <el-form
+    :label-position="'right'"
+    :labelWidth="width + 'px'"
+    :model="formLabelAlign"
+    ref="form"
+    @submit.native.prevent
+  >
+    <el-form-item :label="label" :rules="isRule ? { required: true, message: '不能为空'} : {}">
+      <!-- 普通输入类型 -->
+      <el-input
+        size="small"
+        v-if="!isShow && (type == 'default' || type == 'B1')"
+        v-model="formLabelAlign.name"
+        style="width: 9rem;"
+        @change="onSubmit"
+        @keyup.enter.native="onSubmit"
+      >
+        <template slot="append" v-if="unit">{{unit}}</template>
+      </el-input>
+      <el-input
+        type="number"
+        v-if="!isShow && (type == 'A1' || type == 'A2')"
+        v-model="formLabelAlign.name"
+        style="width: 9rem;"
+        @change="onSubmit"
+        @keyup.enter.native="onSubmit"
+      >
+        <template slot="append" v-if="unit">{{unit}}</template>
+      </el-input>
+      <!-- date类型 -->
+      <el-date-picker
+        v-if="!isShow && (type == 'year' || type == 'C5')"
+        v-model="formLabelAlign.name"
+        type="date"
+        value-format="yyyy-MM-dd"
+        @change="onSubmit"
+        :clearable="false"
+        placeholder="选择日期"
+      ></el-date-picker>
+      <!-- 级联选择 -->
+      <el-cascader
+        v-if="!isShow && (type == 'cascader' || type == 'D1')"
+        :options="typeArr"
+        v-model="formLabelAlign.name"
+        @change="onSubmit"
+        :props="props"
+      ></el-cascader>
+      <!-- 日期到分 -->
+      <el-date-picker
+        v-if="!isShow && type == 'C1'"
+        v-model="formLabelAlign.name"
+        type="datetime"
+        value-format="yyyy-MM-dd HH:MM"
+        @change="onSubmit"
+        :clearable="false"
+        placeholder="选择日期"
+      ></el-date-picker>
+      <!-- 输入文本框 -->
+      <el-input
+        v-if="!isShow && type == 'B2'"
+        type="textarea"
+        :rows="2"
+        @change="onSubmit"
+        @keyup.enter.native="onSubmit"
+        placeholder="请输入内容"
+        v-model="formLabelAlign.name"
+      ></el-input>
+      <!-- 日期 -->
+      <el-date-picker
+        v-if="!isShow && type == 'C6'"
+        v-model="formLabelAlign.name"
+        type="datetimerange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        value-format="yyyy-MM-dd HH:MM"
+        @change="onSubmit"
+        :clearable="false"
+        placeholder="选择日期"
+      ></el-date-picker>
+      <!-- 点击确定 -->
+      <i
+        v-if="!isShow  && (type == 'default' || type == 'B1')"
+        class="el-input__icon el-icon-check hover"
+        @click="onSubmit"
+      ></i>
+      <!-- 显示基本内容 -->
+      <span v-if="isShow" @click="changeItem" class="hover">
+        {{ filterArr(formLabelAlign.name) }} {{unit}}
+        <i class="el-icon-edit" v-if="type != 'X'"></i>
+      </span>
+      <slot name="mess"></slot>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+export default {
+  name: "ownerInput",
+  props: {
+    type: {
+      type: String,
+      default: "default"
+    }, //类型
+    value: [String, Number, Array], //value值
+    label: String, //label值,从父级传入
+    isRule: Boolean, //是否需要规则
+    keys: [String, Number], //
+    typeArr: [Array, String], //当其为级联或者下拉时传入
+    unit: {
+      //单位
+      type: String,
+      default: ""
+    },
+    width: {
+      type: Number,
+      default: 100
+    }
+  },
+
+  data() {
+    return {
+      formLabelAlign: {
+        name: ""
+      },
+      key: "",
+      isShow: true,
+      props: {
+        label: "name",
+        value: "code",
+        children: "content"
+      } //修改默认数据格式
+    };
+  },
+
+  methods: {
+    //点击确定或者url
+    onSubmit() {
+      if (this.formLabelAlign.name == "" || this.formLabelAlign.name == []) {
+        this.$message.error("请确定值不为空");
+      } else {
+        this.isShow = true;
+        if (this.type == 'cascader' || this.type == 'D1') {
+          let data = this.formLabelAlign.name
+          this.$emit("change", data[data.length - 1], this.keys);
+        } else {
+          this.$emit("change", this.formLabelAlign.name, this.keys);
+        }
+      }
+    },
+
+    //点击文案出现输入
+    changeItem() {
+      if (this.type == "X") {
+        this.$message('该信息点不支持编辑')
+        return;
+      } else {
+        this.isShow = false;
+      }
+    },
+
+    //对数组中的空数组去除
+    toMyNeed(arr) {
+      return arr.map(res => {
+        let param = {};
+        if (res.content && res.content.length != 0) {
+          param.content = this.toMyNeed(res.content);
+        }
+        param.name = res.name;
+        param.code = res.code;
+        return param;
+      });
+    },
+
+    //获取级联选中的值
+    getCascaderObj(val, opt) {
+      let data = this.getMyVal(val, opt, 'name')
+      data.length > 1 ? data = data.join('/') : data = data.join('')
+      return data
+    },
+
+    getMyVal(val, content, code) {
+      let data = []
+      if (content && content.length) {
+        for (let i = 0; i < content.length; i++) {
+          if (content[i].code == val) {
+            data.push(content[i][code])
+            break
+          } else {
+            if (content[i].content && content.length) {
+              for (let j = 0; j < content[i].content.length; j++) {
+                if (content[i].content[j].code == val) {
+                  data.push(content[i][code])
+                  data.push(content[i].content[j][code])
+                  break
+                } else {
+                  if (content[i].content[j].content && content[i].content[j].content.length) {
+                    for (let k = 0; k < content[i].content[j].content.length; k++) {
+                      if (content[i].content[j].content[k].code == val) {
+                        data.push(content[i][code])
+                        data.push(content[i].content[j][code])
+                        data.push(content[i].content[j].content[k][code])
+                        break
+                      } else {
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+      if (!data.length) {
+        data = null
+      }
+      return data
+    },
+
+    getMap(val, opt) {
+      return opt.map(function (value, index, array) {
+        for (var itm of opt) {
+          if (itm.code == value.code) {
+            opt = itm.content;
+            return itm;
+          }
+        }
+        return null;
+      });
+    },
+
+    //数组过滤
+    filterArr(val) {
+      let value = ""; //最后输出的文案
+      let isNeedType = this.type == 'cascader' || this.type == 'D1'
+      if (this.type == 'C6') {
+        value = value != "" ? val[0] + '至' + val[1] : "--"
+      } else if (this.type == 'cascader' || this.type == 'D1') {
+        if (val && val.length) {
+          value = this.getCascaderObj(val[val.length - 1], this.typeArr, 'name') || "--";
+        }
+      } else {
+        value = val || "--";
+      }
+      return value;
+    }
+  },
+
+  created() {
+    if (typeof (this.typeArr) == Object) {
+      this.typeArr = this.toMyNeed(this.typeArr)
+    }
+    if (this.type == 'cascader' || this.type == 'D1') {
+      if (this.value == '' || this.value == undefined) {
+        this.formLabelAlign.name = []
+      } else {
+        this.formLabelAlign.name = this.getMyVal(this.value, this.typeArr, 'code');
+      }
+    } else {
+      this.formLabelAlign.name = this.value;
+    }
+    this.key = this.label;
+  },
+
+  watch: {
+    label() { }
+  }
+};
+</script>
+
+<style lang="less">
+.hover:hover {
+  cursor: pointer;
+  color: #409eff;
+}
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+  -webkit-appearance: none;
+}
+input[type="number"] {
+  -moz-appearance: textfield;
+}
+</style>

+ 58 - 0
src/components/ledger/lib/myPagination.vue

@@ -0,0 +1,58 @@
+<!--
+    props:{
+        size: 当前页的页数,
+        sizes: 下拉的条数,
+        total: 总条数,
+        currentPage: 当前页
+    }
+    @change 发生改变
+-->
+<template>
+    <div class="block">
+        <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page.sync="page.currentPage"
+        :page-sizes="page.sizes"
+        :page-size="page.size"
+        :small="true"
+        :layout=" isSmall ? 'total, sizes, prev, pager, next, jumper' : 'prev, pager, next'"
+        :total="page.total">
+        </el-pagination>
+    </div>
+</template>
+<script>
+export default {
+  name: "pagination",
+  props: {
+    page: {
+      type: Object
+    },
+    isSmall:{
+      type:Boolean,
+      default: true
+    }
+  },
+  methods: {
+    //当前条数发生改变
+    handleSizeChange(val) {
+      this.page.size = val;
+      this.change()
+    },
+    //当前页发生改变
+    handleCurrentChange(val) {
+      this.page.currentPage = val;
+      this.change()
+    },
+    //发生改变
+    change() {
+      this.$emit("change");
+    }
+  }
+};
+</script>
+<style>
+.block{
+  margin-top: 5px;
+}
+</style>

+ 57 - 0
src/components/ledger/lib/qrcode.vue

@@ -0,0 +1,57 @@
+<template>
+  <el-dialog
+    title="二维码"
+    v-if="dialog.qrcode"
+    custom-class="custom-dialog"
+    :visible.sync="dialog.qrcode"
+    width="300px"
+  >
+    <div>
+      <div id="qrcode">
+        <img
+          style="width:200px;height:200px;margin:auto;display:block;"
+          :src="'img/image-service/common/file_get/'+ qrcodeUrl +'?systemId=dataPlatform'"
+          alt="二维码"
+        >
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// import { qrcanvas } from "qrcanvas";
+export default {
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          qrcode: false
+        };
+      }
+    },
+    qrcodeUrl: {
+      default: ""
+    }
+  },
+  data() {
+    return {};
+  },
+  created() { },
+  mounted() {
+  },
+  methods: {
+    // getCanvas(id) {
+    //     let canvas = qrcanvas({
+    //         cellSize: 8,
+    //         data: 'http://service.sagacloud.cn/qrcode/' + 'Pea3a31168a30d4056acda3a56e557940b'
+    //     });
+    //     canvas.style.margin = "auto"
+    //     canvas.style.display = "block"
+    //     this.$nextTick(() => {
+    //         document.getElementById("qrcode").innerHTML = null;
+    //         document.getElementById("qrcode").appendChild(canvas);
+    //     });
+    // }
+  }
+};
+</script>

+ 207 - 0
src/components/ledger/lib/uploadFiles.vue

@@ -0,0 +1,207 @@
+<!--
+  上传组件
+  type: 类型,默认image
+  identify: key值,通过val获取
+  disabled: 是否可用
+  index: 父组件的下标
+  imageIndex: 图片下标
+  isShow: 图片的显示
+ -->
+<template>
+  <div id="saga-upload">
+    <div id="uploadFile">
+      <div v-if="item && filesArr.length" v-for="(item,index) in filesArr">
+        <el-button type="text" @click="download(item)">{{delFile(item)}}</el-button>
+        <i
+          v-if="!readOnly"
+          class="el-icon-close delete-icon"
+          style="margin-left:10px; cursor:pointer"
+          @click="deleteFile(index,item)"
+        ></i>
+      </div>
+      <el-upload
+        v-if="filesArr.length < max"
+        class="upload-file"
+        action
+        :http-request="uploadAndSubmit"
+        :show-file-list="false"
+        drag
+      >
+        <el-button size="small" type="primary" v-if="!readOnly">点击上传</el-button>
+        <div slot="tip" class="el-upload__tip" v-if="!readOnly">请上传文件</div>
+      </el-upload>
+    </div>
+  </div>
+</template>
+
+<script>
+import tools from "@/utils/scan/tools";
+export default {
+  props: {
+    keysArr: {
+      type: [Array, String],
+      default: function () {
+        return []
+      }
+    },
+    readOnly: {
+      type: Boolean,
+      default: false
+    },
+    max: {
+      type: [Number, String],
+      default: 6
+    },
+    defined: null
+  },
+  data() {
+    return {
+      filesArr: []
+    };
+  },
+  created() {
+    let type = typeof (this.keysArr)
+    this.fileFalg()
+  },
+  methods: {
+    //判断是否为空
+    fileFalg() {
+      let type = typeof (this.keysArr)
+      console.log(this.keysArr, "keysAee")
+      if (type == 'string') {
+        this.filesArr = [this.keysArr]
+      } else {
+        this.filesArr = tools.deepCopy(this.keysArr)
+      }
+
+      if (!this.keysArr) {
+        this.filesArr = []
+      }
+    },
+    //处理地址
+    delFile(name) {
+      console.log(name, "name")
+      return name.length > 20 ? name.substring(0, 20) + "..." : ""
+    },
+
+    resetFile() {
+      this.filesArr = []
+    },
+
+
+    //点击下载
+    download(key) {
+      console.log(key)
+      window.open("/img/image-service/common/file_get/" + key + "?systemId=dataPlatform")
+    },
+
+    //删除图片
+    deleteFile(i, key) {
+      this.filesArr.splice(i, 1);
+      this.$emit("change", this.filesArr, this.defined);
+    },
+
+    //上传
+    uploadAndSubmit(item) {
+      // var form = document.forms["demoForm"];
+
+      // if (form["file"].files.length > 0) {
+      // 寻找表单域中的 <input type="file" ... /> 标签
+      // var file = form["file"].files[0];
+
+      let file = item.file;
+      // try sending
+      let reader = new FileReader();
+
+      let vm = this;
+
+      let fileType = file.name.split(".");
+      let type = fileType[fileType.length - 1];
+      let key = "&key=" + fileType[0] + file.uid + "." + type
+
+      reader.onloadstart = function () {
+        // 这个事件在读取开始时触发
+      };
+      reader.onprogress = function (p) {
+        // 这个事件在读取进行中定时触发
+      };
+
+      reader.onload = function () {
+        // 这个事件在读取成功结束后触发
+      };
+      reader.onloadend = function () {
+        // 这个事件在读取结束后,无论成功或者失败都会触发
+        if (reader.error) {
+        } else {
+          // document.getElementById("bytesRead").textContent = file.size;
+          // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+          var xhr = new XMLHttpRequest();
+          xhr.open(
+            /* method */
+            "POST",
+            /* target url */
+            "/img/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
+            /*, async, default to true */
+          );
+          //xhr.overrideMimeType("application/octet-stream");
+          xhr.send(reader.result);
+          xhr.onreadystatechange = function () {
+            if (xhr.readyState == 4) {
+              console.log(xhr)
+              if (xhr.status == 200) {
+                vm.filesArr.push(
+                  key.split("=")[1]
+                );
+                console.log(vm.filesArr)
+                vm.$emit("change", vm.filesArr, vm.defined);
+              } else {
+                this.$message.error(res.data.ResultMsg)
+              }
+            }
+          };
+        }
+      };
+      reader.readAsArrayBuffer(file);
+    }
+  },
+  watch: {
+    keysArr: function (val) {
+      this.fileFalg()
+    }
+  }
+};
+</script>
+
+<style lang="less">
+#saga-upload {
+  .dill-image {
+    position: absolute;
+    right: 0px;
+    top: 0px;
+    font-size: 20px;
+  }
+  .el-upload-dragger {
+    width: 180px;
+    height: 180px;
+  }
+  img {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    width: 100%;
+    height: 100%;
+  }
+  #uploadFile {
+    .upload-file {
+      overflow: hidden;
+      .el-upload-dragger {
+        width: inherit;
+        height: inherit;
+        border: none;
+      }
+    }
+  }
+}
+</style>

+ 321 - 0
src/components/ledger/lib/uploadImgs.vue

@@ -0,0 +1,321 @@
+<!--
+    @param keysArr 承接数组
+    @param readOnly  删除按钮是否显示,上传是否显示
+    @param max     上传最大数限制
+    @click change  承接数组发生变化时触发函数
+-->
+<template>
+  <div id="sagaUploads">
+    <div class="saga-upload-images">
+      <div v-if="type != 'video'" class="point-image" v-for="(item,index) in imagesArr">
+        <i v-if="!readOnly" class="el-icon-delete" @click="delImage(index,item)"></i>
+        <img :src="imageGetUrl + '&key=' +item" alt v-load>
+      </div>
+      <div v-if="type == 'video'" class="point-image" v-for="(item,index) in imagesArr">
+        <i v-if="!readOnly" class="el-icon-delete" @click="delImage(index,item)"></i>
+        <video
+          width="100%"
+          height="100%;"
+          :src="imageGetUrl + '&key=' +item"
+          controls="controls"
+        >您的浏览器不支持 video 标签。</video>
+      </div>
+      <div v-if="!readOnly && imagesArr.length < max" style="float:left;">
+        <el-upload
+          class="avatar-uploader"
+          :http-request="uploadAndSubmit"
+          :show-file-list="false"
+          :accept="accept"
+          action
+          drag
+          style="position: relation"
+        >
+          <i class="el-icon-plus avatar-uploader-icon"></i>
+        </el-upload>
+        <video style="display:none;" id="video" controls/>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import tools from "@/utils/scan/tools";
+export default {
+  props: {
+    keysArr: {
+      type: [Array, String]
+    },
+    readOnly: {
+      type: Boolean,
+      default: false
+    },
+    max: {
+      type: [Number, String],
+      default: 6
+    },
+    accept: {
+      type: String,
+      default: "image/*"
+    },
+    type: {
+      type: String,
+      default: "image"
+    },
+    defined: null,
+    videoPicArr: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      baseUrl: "",
+      imageGetUrl: "/img/image-service/common/image_get?systemId=dataPlatform",
+      imageUploadUrl: "/img/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true",
+      imagesArr: []
+    };
+  },
+  created() {
+    this.imageFalg();
+  },
+  methods: {
+    //判断是否为空
+    imageFalg() {
+      let type = typeof this.keysArr;
+      console.log(this.keysArr)
+      if (type == "string") {
+        this.imagesArr = [this.keysArr];
+      } else {
+        this.imagesArr = tools.deepCopy(this.keysArr);
+      }
+
+      if (!this.keysArr) {
+        this.imagesArr = [];
+      }
+    },
+
+    //删除图片
+    delImage(i, key) {
+      if (this.type == "video") {
+        this.videoPicArr = this.videoPicArr.map(item => {
+          if (item.substring(0, item.length - 3) == this.imagesArr[i].substring(0, this.imagesArr[i].length - 3)) {
+            return undefined
+          } else {
+            return item
+          }
+        }).filter(p => p)
+      }
+      this.imagesArr.splice(i, 1);
+      this.$emit("change", this.imagesArr, this.defined, this.videoPicArr);
+    },
+
+    //上传
+    uploadAndSubmit(item, key) {
+      // var form = document.forms["demoForm"];
+
+      // if (form["file"].files.length > 0) {
+      // 寻找表单域中的 <input type="file" ... /> 标签
+      // var file = form["file"].files[0];
+
+      console.log("lalala", item)
+      let file = item.file;
+      // try sending
+      let reader = new FileReader();
+
+      let vm = this;
+
+      let fileType = file.name.split(".");
+      let type = fileType[fileType.length - 1];
+
+      let uploadKey = file.uid
+      if (!!key) {
+        uploadKey = key
+      }
+
+      reader.onloadstart = function () {
+        // 这个事件在读取开始时触发
+      };
+      reader.onprogress = function (p) {
+        // 这个事件在读取进行中定时触发
+      };
+
+      reader.onload = function () {
+        // 这个事件在读取成功结束后触发
+      };
+      reader.onloadend = function () {
+        // 这个事件在读取结束后,无论成功或者失败都会触发
+        if (reader.error) {
+        } else {
+          // document.getElementById("bytesRead").textContent = file.size;
+          // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+          var xhr = new XMLHttpRequest();
+          xhr.open(
+            /* method */
+            "POST",
+            /* target url */
+            vm.imageUploadUrl + "&key=" + uploadKey + "." + type
+            /*, async, default to true */
+          );
+          //xhr.overrideMimeType("application/octet-stream");
+          xhr.send(reader.result);
+          xhr.onreadystatechange = function () {
+            if (xhr.readyState == 4) {
+              if (xhr.status == 200) {
+                if (vm.type == 'image') {
+                  vm.imagesArr.push(
+                    uploadKey + "." + type
+                  );
+                }
+                if (type == 'mp4') {
+                  vm.imagesArr.push(
+                    uploadKey + "." + type
+                  );
+                  vm.creatImg(vm.imageGetUrl + "&key=" + uploadKey + "." + type, uploadKey)
+                }
+                console.log(vm.type, type)
+                if (vm.type == "video" && type == "png") {
+                  console.log("触发时评上传图片回调")
+                  vm.videoPicArr.push(uploadKey + "." + type)
+                }
+                vm.$emit("change", vm.imagesArr, vm.defined, vm.videoPicArr);
+              }
+            }
+          };
+        }
+      };
+      reader.readAsArrayBuffer(file);
+    },
+    dataURLtoBlob: function (dataURI, type) {
+      var binary = atob(dataURI.split(',')[1]);
+      var array = [];
+      for (var i = 0; i < binary.length; i++) {
+        array.push(binary.charCodeAt(i));
+      }
+      return new Blob([new Uint8Array(array)], { type: type });
+    },
+
+    creatImg(reader, key) {
+      var videoDom = document.getElementById('video');
+      videoDom.src = reader;
+      let vm = this
+      videoDom.onloadeddata = function () {
+        // 这里可以打印视频时长
+        // 这里取得视频封面
+        var canvas = document.createElement('canvas');
+        canvas.width = 300;
+        canvas.height = 300 * this.videoHeight / this.videoWidth;
+        canvas.getContext('2d').drawImage(this, 0, 0, canvas.width, canvas.height);
+        //将canvas的base64位图片转换成图片png的file
+        var blob = vm.dataURLtoBlob(canvas.toDataURL('image/png'), "image/png")
+        //将其转换成file对象
+        var file = new File([blob], "video_image.png", { type: "image/png", lastModified: Date.now() })//blob转file
+        vm.uploadAndSubmit({ file: file }, key)
+      }
+    },
+  },
+  watch: {
+    keysArr: function (val) {
+      this.imageFalg();
+    }
+  },
+  //自定义指令
+  directives: {
+    load: function (el) {
+      let imgDom = document.createElement("img");
+      imgDom.style.position = "absolute";
+      imgDom.style.top = "-999px";
+      imgDom.style.opacity = 0;
+      imgDom.src = el.src;
+      el.src = "";
+      imgDom.onload = () => {
+        let width = imgDom.width;
+        let height = imgDom.height;
+        if (width > height) {
+          el.style.height = "100%";
+          el.style.width = "auto";
+          el.style.position = "absolute";
+          el.style.left = "50%";
+          el.style.top = "0";
+          el.style.transform = "translateX(-50%)";
+          el.style.webkitTransform = "translateX(-50%) translateY(0)";
+          el.style.MozTransform = "translateX(-50%) translateY(0)";
+          el.style.msTransform = "translateX(-50%) translateY(0)";
+          el.style.OTransform = "translateX(-50%) translateY(0)";
+        } else if (width < height) {
+          el.src = imgDom.src;
+          el.style.width = "100%";
+          el.style.height = "auto";
+          el.style.position = "absolute";
+          el.style.top = "50%";
+          el.style.left = "0";
+          el.style.transform = "translateY(-50%) translateX(0)";
+          el.style.webkitTransform = "translateY(-50%) translateX(0)";
+          el.style.MozTransform = "translateY(-50%) translateX(0)";
+          el.style.msTransform = "translateY(-50%) translateX(0)";
+          el.style.OTransform = "translateY(-50%) translateX(0)";
+        } else {
+          el.style.width = "100%";
+          el.style.height = "100%";
+          el.style.position = "absolute";
+          el.style.top = "0";
+          el.style.left = "0";
+          el.style.transform = "translateY(0) translateX(0)";
+          el.style.webkitTransform = "translateY(0) translateX(0)";
+          el.style.MozTransform = "translateY(0) translateX(0)";
+          el.style.msTransform = "translateY(0) translateX(0)";
+          el.style.OTransform = "translateY(0) translateX(0)";
+        }
+        el.src = imgDom.src;
+      };
+    }
+  }
+};
+</script>
+<style lang="less">
+#sagaUploads {
+  overflow: hidden;
+  .avatar-uploader {
+    height: 180px;
+    width: 180px;
+    overflow: hidden;
+    .el-upload {
+      width: 180px;
+      height: 180px;
+      .el-upload-dragger {
+        width: 180px;
+        height: 180px;
+        .el-icon-plus {
+          display: block;
+          width: 20px;
+          height: 20px;
+          font-size: 20px;
+          margin: 80px;
+        }
+      }
+    }
+  }
+  .point-image {
+    width: 180px;
+    height: 180px;
+    float: left;
+    position: relative;
+    margin-right: 10px;
+    margin-bottom: 10px;
+    border: 1px solid #ccc;
+    overflow: hidden;
+    image {
+      z-index: 11;
+    }
+    i {
+      position: absolute;
+      bottom: 10px;
+      right: 10px;
+      background-color: #fff;
+      padding: 5px;
+      cursor: pointer;
+      z-index: 66;
+    }
+  }
+}
+</style>

+ 70 - 0
src/utils/hasontableUtils.js

@@ -0,0 +1,70 @@
+const handsonUtils = {
+    /**
+     * 获取被排序后的数组
+     *
+     * @param changeData 发生改变的数据
+     * @param source     数组
+     *
+     * @return array     经过排序后或者经过搜索后的数组
+     */
+    getParam: function(changeData, source, hot, trimmedArr) {
+        let param = "";
+        //被筛选过后的数组
+        // let trimmedArr = this.trimmedRows();
+        //是否启用了排序
+        let isSort = hot.getPlugin("columnSorting").isSorted();
+        if (trimmedArr.length && isSort) {
+            //排序后的数组
+            let sortArr = hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+            param = changeData.map(item => {
+                return hot.getSourceDataAtRow(trimmedArr[sortArr[item[0]]]);
+            });
+        } else if (isSort) {
+            //排序后的数组
+            let sortArr = hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+            param = changeData.map(item => {
+                return hot.getSourceDataAtRow(sortArr[item[0]]);
+            });
+        } else if (trimmedArr.length) {
+            param = changeData.map(item => {
+                return hot.getSourceDataAtRow(trimmedArr[item[0]]);
+            });
+        } else {
+            param = changeData.map(item => {
+                return hot.getSourceDataAtRow(item[0]);
+            });
+        }
+        return param;
+    },
+
+    /**
+     * 
+     * @param {handsontable修改参数} changeData 
+     * @param {*} source 
+     * @param {handsontabele实例} hot 
+     * @param {排序数组} trimmedArr
+     * 
+     * @return 修改数值的前一个对象 
+     */
+    getUnshiftParam: function(changeData, source, hot, trimmedArr) {
+        //是否启用了排序
+        let isSort = hot.getPlugin("columnSorting").isSorted();
+        if (trimmedArr.length && isSort) {
+            //排序后的数组
+            let sortArr = hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+            return hot.getSourceDataAtRow(trimmedArr[sortArr[changeData[0][0] - 1]])
+        } else if (isSort) {
+            //排序后的数组
+            let sortArr = hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
+            return hot.getSourceDataAtRow(sortArr[changeData[0][0] - 1])
+        } else if (trimmedArr.length) {
+            //进行了筛选
+            return hot.getSourceDataAtRow(trimmedArr[changeData[0][0] - 1])
+        } else {
+            //没有进行排序和筛选
+            return hot.getSourceDataAtRow(changeData[0][0] - 1);
+        }
+    },
+}
+
+export default handsonUtils

+ 31 - 0
src/utils/uuid.js

@@ -0,0 +1,31 @@
+function uuid(len, radix) {
+    var chars = '0123456789abcdef'.split('');
+    var uuid = [],
+        i;
+    radix = radix || chars.length;
+
+    if (len) {
+        // Compact form
+        for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
+    } else {
+        // rfc4122, version 4 form
+        var r;
+
+        // rfc4122 requires these characters
+        uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
+        uuid[14] = '4';
+
+        // Fill in random data.  At i==19 set the high bits of clock sequence as
+        // per rfc4122, sec. 4.1.5
+        for (i = 0; i < 36; i++) {
+            if (!uuid[i]) {
+                r = 0 | Math.random() * 16;
+                uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
+            }
+        }
+    }
+
+    return uuid.join('');
+}
+
+export default uuid

+ 12 - 0
src/views/data_admin/buildData/index.vue

@@ -263,9 +263,15 @@
                     <div v-if="item.type == 'video'" style="width:100%;height:100%;">
                       <video
                         style="width:100%;height:100%;"
+<<<<<<< HEAD
                         :src="'image-service/common/file_get/'+ item.key + '?systemId=dataPlatform'"
                         controls
                         :poster="'image-service/common/image_get?systemId=dataPlatform&key='+ delVideo(item.key) +'&width=200'"
+=======
+                        :src="'/image-service/common/file_get/'+ item.key + '?systemId=dataPlatform'"
+                        controls
+                        :poster="'/image-service/common/image_get?systemId=dataPlatform&key='+ delVideo(item.key) +'&width=200'"
+>>>>>>> 0b3fe5f67feb014201756c0d8520ffb3557fef6b
                       ></video>
                     </div>
                     <img
@@ -513,9 +519,15 @@
                     <li v-for="item in imgList.video" style="border: 1px solid #ccc;">
                       <video
                         style="width:100%;height:100%;"
+<<<<<<< HEAD
                         :src="'image-service/common/file_get/'+ item.key + '?systemId=dataPlatform'"
                         controls
                         :poster="'image-service/common/image_get?systemId=dataPlatform&key='+ delVideo(item.key) +'&width=200'"
+=======
+                        :src="'/image-service/common/file_get/'+ item.key + '?systemId=dataPlatform'"
+                        controls
+                        :poster="'/image-service/common/image_get?systemId=dataPlatform&key='+ delVideo(item.key) +'&width=200'"
+>>>>>>> 0b3fe5f67feb014201756c0d8520ffb3557fef6b
                       ></video>
                     </li>
                   </ul>

+ 1 - 1
src/views/data_admin/buildGraphy/graphyCanvas.vue

@@ -246,7 +246,7 @@ export default {
     getJson(jsonId) {
       axios({
         method: 'get',
-        url: "/img/image-service/common/file_get/" + jsonId + "?systemId=revit",
+        url: "/image-service/common/file_get/" + jsonId + "?systemId=revit",
         data: {},
         responseType: 'blob',
         // contentType: "charset=utf-8"

+ 14 - 5
src/views/data_admin/buildGraphy/lib/floorCascader.vue

@@ -15,7 +15,7 @@
 <script>
 
 import { getSpaceFloor } from '@/api/request'
-
+import {mapGetters, mapActions} from "vuex";
 export default {
   props: {
     isWidth: {
@@ -32,15 +32,24 @@ export default {
       options: [
       ],
       param: {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
-      },
-      value: ['all']
+        ProjId: "",
+        secret:"",
+        value: ['all']
+      }
     };
   },
   created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
     this.getData()
   },
+  computed: {
+    ...mapGetters("peojMess", [
+        "projectId",
+        "secret",
+        "userId"
+    ])
+   },
   mounted() { },
   methods: {
     //获取数据

+ 2 - 2
src/views/data_admin/buildGraphy/lib/lookImages.vue

@@ -52,8 +52,8 @@
   </el-dialog>
 </template>
 <script>
-import uploadImgs from "@/components/lib/uploadImgsName";
-import tools from "@/assets/js/tools"
+import uploadImgs from "@/components/ledger/lib/uploadImgsName";
+import tools from "@/utils/scan/tools"
 export default {
   components: {
     uploadImgs

+ 2 - 2
src/views/data_admin/buildGraphy/lib/qrcode.vue

@@ -10,7 +10,7 @@
       <div id="qrcode">
         <img
           style="width:200px;height:200px;margin:auto;display:block;"
-          :src="'img/image-service/common/file_get/'+ qrcodeUrl +'?systemId=dataPlatform'"
+          :src="'/image-service/common/file_get/'+ qrcodeUrl +'?systemId=dataPlatform'"
           alt="二维码"
         >
       </div>
@@ -18,7 +18,7 @@
   </el-dialog>
 </template>
 <script>
-import { qrcanvas } from "qrcanvas";
+// import { qrcanvas } from "qrcanvas";
 export default {
   props: {
     dialog: {

+ 2 - 2
src/views/data_admin/buildGraphy/lib/uploadFiles.vue

@@ -35,7 +35,7 @@
 </template>
 
 <script>
-import tools from "@/assets/js/tools";
+import tools from "@/utils/scan/tools";
 export default {
   props: {
     keysArr: {
@@ -92,7 +92,7 @@ export default {
     //点击下载
     download(key) {
       console.log(key)
-      window.open("/img/image-service/common/file_get/" + key + "?systemId=dataPlatform")
+      window.open("/image-service/common/file_get/" + key + "?systemId=dataPlatform")
     },
 
     //删除图片

+ 1 - 1
src/views/data_admin/buildGraphy/lib/uploadImgs.vue

@@ -38,7 +38,7 @@
   </div>
 </template>
 <script>
-import tools from "@/assets/js/tools";
+import tools from "@/utils/scan/tools";
 export default {
   props: {
     keysArr: {

+ 3 - 3
src/views/data_admin/buildGraphy/lib/uploadImgsName.vue

@@ -45,9 +45,9 @@
   </div>
 </template>
 <script>
-import tools from "@/assets/js/tools";
-import formInput from "@/components/lib/formInput"
-import detailsDialog from "@/components/lib/detailsDia"
+import tools from "@/utils/scan/tools";
+import formInput from "@/components/ledger/lib/formInput"
+import detailsDialog from "@/components/ledger/lib/detailsDia"
 
 export default {
   components: {

+ 191 - 8
src/views/ledger/facility/index.vue

@@ -1,15 +1,198 @@
 <template>
-    <div>
-        设备
+    <div id="deviceList">
+    <saga-title :mess="mess"></saga-title>
+    <div class="table-main">
+      <div class="search-header">
+        <floor-cascader @change="changeFloor"></floor-cascader>
+        <my-cascader ref="cascader" @change="changeDevice"></my-cascader>
+      </div>
+      <hanson-table @close="close" :graphyId="graphyId" ref="tableMain"></hanson-table>
     </div>
+    <!-- <table-transfers></table-transfers> -->
+  </div>
 </template>
 <script>
+import sagaTitle from "@/components/ledger/lib/title";
+import floorCascader from "@/components/ledger/lib/floorCascader";
+import myCascader from "@/components/ledger/lib/cascader";
+import hansonTable from "@/components/ledger/handsontables/device";
+import tableTransfers from "@/components/ledger/tableTransfers";
+import { getNumber, getFamilyList, getSpaceName, getGraphyId, getEquipmentFamily } from "@/api/scan/request"
+import {
+    mapGetters,
+    mapActions
+} from "vuex";
 export default {
-    data(){ return {}},
-    created(){},
-    mounted(){},
-    methods:{}
-}
+  components: {
+    sagaTitle,
+    floorCascader,
+    myCascader,
+    hansonTable,
+    tableTransfers
+  },
+  data() {
+    return {
+      mess: {
+        perjectName: "",
+        name: [
+          {
+            key: "设备",
+            num: 0
+          },
+          {
+            key: "资产",
+            num: 0
+          }
+        ]
+      },
+      param: {
+        buildId: "",
+        floorId: "",
+        deviceId: "",
+        ProjId: "",
+        secret: ""
+      },
+      assetGroupList: [],
+      graphyId: null
+    };
+  },
+  computed: {
+        ...mapGetters("peojMess", [
+            "projectId",
+            "secret",
+            "userId"
+        ])
+  },
+  created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
+    this.getProjName()
+  },
+  mounted() { },
+  methods: {
+    getProjName() {
+      let param = {
+        list: [{ id: this.param.ProjId }],
+        perjectId: this.param.ProjId,
+        secret: this.param.secret,
+      }
+      getSpaceName(param).then(res => {
+        if (res.data.Result == "success") {
+          this.mess.perjectName = res.data.Content[0].infos.ProjLocalName
+          this.getEqCode()
+        } else {
+          this.$message.error("请求失败:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求失败")
+      })
+    },
+    close(val) {
+      this.getEqCode()
+      console.log(val)
+      this.$refs.cascader.changeVal([val.code])
+      //   this.$refs.tableMain.getHeaderData(this.param);
+    },
+    getEqCode() {
+      getEquipmentFamily(res => {
+        this.assetGroupList = res.Content
+        this.getGraphyId()
+      })
+    },
+    getFamilyList() {
+      let param = {
+        ProjId: this.param.ProjId,
+        secret: this.param.secret,
+        data: { type: "Eq" }
+      }
+      getFamilyList(param, res => {
+        this.$refs.cascader.pushData(res.Content)
+      })
+    },
+    //获取header的list
+    getNumber() {
+      let param = {
+        ProjId: this.param.ProjId,
+        secret: this.param.secret,
+        data: { type: "Eq" }
+      }
+      getNumber(param, res => {
+        console.log(res)
+        this.mess.name[0].num = res.content.count
+        this.mess.name[1].num = res.content.bindingCount
+        this.getFamilyList()
+      })
+    },
+
+    getGraphyId() {
+      let param = {
+        ProjId: this.param.ProjId,
+        secret: this.param.secret,
+        type: "SystemEquip"
+      }
+      getGraphyId(param).then(res => {
+        if (res.data.Result == "success") {
+          this.graphyId = res.data.graph_id
+          this.$refs.tableMain.setGraphyId(this.graphyId, this.assetGroupList);
+          this.getNumber()
+        } else {
+          this.$message.error("请求错误:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求错误")
+      })
+    },
+    //修改楼层
+    changeFloor(value) {
+      if (value[0]) {
+        this.param.buildId = value[0]
+      }
+      if (value[1]) {
+        this.param.floorId = value[1]
+      } else {
+        this.param.floorId = null
+      }
+      if (!!this.param.deviceId) {
+        this.$refs.tableMain.getHeaderData(this.param);
+      } else {
+        return;
+      }
+    },
+
+    //修改设备族
+    changeDevice(value) {
+      this.param.deviceId = value.code
+      this.param.name = value.facility
+      if (!!value) {
+        this.$refs.tableMain.getHeaderData(this.param);
+      } else {
+        return;
+      }
+
+    }
+  }
+};
 </script>
-<style>
+<style lang="less" scoped>
+#deviceList {
+  overflow: hidden;
+  height: 100%;
+  background-color: #f6f6f6;
+  .table-main {
+    position: absolute;
+    top: 140px;
+    bottom: 10px;
+    left: 10px;
+    right: 10px;
+    background-color: #fff;
+    border: 1px solid #ccc;
+    border-radius: 5px;
+    padding: 10px;
+  }
+  .search-header {
+    overflow: hidden;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #bcbcbc;
+  }
+}
 </style>