Browse Source

修改inputmode 删除无用

haojianlong 4 years ago
parent
commit
6ead196dd9

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

@@ -1,502 +0,0 @@
-<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 { mapGetters, mapActions } from "vuex";
-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,
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"]),
-  },
-  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: 50,
-        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.projectId
-      }).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 == "M" ||
-          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: this.onlyRead ? false :{
-          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 10px;
-  font-size: 14px;
-  overflow: hidden;
-  margin-top: 10px;
-  .iconfont {
-    font-size: 12px;
-  }
-  .el-button {
-    // margin-right: 10px;
-  }
-}
-</style>

+ 0 - 770
src/components/dialogs/addDialog/businessDialog.vue

@@ -1,770 +0,0 @@
-<!--
-    上传文件的弹窗
--->
-
-<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"
-              >&nbsp;&nbsp;&nbsp;撤销&nbsp;&nbsp;&nbsp;</el-button>
-              <el-button
-                style="float:right;"
-                size="small"
-                @click="reset"
-                icon="iconfont icon-shuaxin"
-              >&nbsp;&nbsp;&nbsp;刷新&nbsp;&nbsp;&nbsp;</el-button>
-              <el-button style="float:right;" size="small" @click="addMain">增加</el-button>
-              <el-input
-                v-model="addNum"
-                placeholder="增加个数"
-                style="width:50px;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 { mapGetters, mapActions } from "vuex";
-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 []
-      }
-    }
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"]),
-  },
-  data() {
-    return {
-      width: "30%",
-      isFull: true,//dialog是否为全屏
-      title: "添加业务空间",
-      isCenter: true,
-      deviceType: {},
-      main: table(10),
-      mess: {},
-      headers: null,
-      page: {
-        size: 50,
-        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.projectId
-      }).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: this.onlyRead ? false :{
-          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>

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

@@ -1,848 +0,0 @@
-<!--
-    上传文件的弹窗
--->
-
-<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:50px;" 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: 50,
-        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("layout", [
-      "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.projectId
-      }).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.projectId
-          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.projectId,
-        UserId: this.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", "M"]
-      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: {
-            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: this.onlyRead ? false : {
-          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) {
-      console.log(keys, "keys", this.messKey.split("."), this.row, '22222222222222')
-      this.setDataToMain(keys[0], this.messKey.split("."), this.row)
-      tools.setItem(this.deviceType.code, this.main)
-    },
-
-    //设备图片弹窗改变事件
-    changePics(keys) {
-      console.log(keys, "keys", this.messKey.split("."), this.row, '22222222222222')
-      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>

+ 0 - 872
src/components/ledger/addDialog/dialogAssets.vue

@@ -1,872 +0,0 @@
-<!--
-    上传文件的弹窗
--->
-
-<template>
-  <div v-if="dialog.addDevice">
-    <router-view></router-view>
-    <router-link to="/system/list/addsystem"></router-link>
-    <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="float:right;overflow:hidden;">
-                <span>增加</span>
-                <el-input v-model="addNum" style="width:50px;" 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;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/ledger/lib/assets";
-import hansonTable from "@/components/ledger/lib/addDevice";
-import tools from "@/utils/scan/tools";
-
-import qrcode from "@/components/business_space/lib/qrcode";
-import firm from "@/components/business_space/dialogs/list/firm";
-import supplyDialog from "@/components/business_space/dialogs/list/supplyDialog";
-import supplierDialog from "@/components/business_space/dialogs/list/supplierDialog";
-import maintainerDialog from "@/components/business_space/dialogs/list/maintainerDialog";
-import insurerDialog from "@/components/business_space/dialogs/list/insurerDialog";
-import guaranteeDialog from "@/components/business_space/dialogs/list/guaranteeDialog";
-import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog";
-import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog";
-import picDialog from "@/components/business_space/dialogs/list/picDialog"
-
-
-import Handsontable from "handsontable-pro"
-    import 'handsontable-pro/dist/handsontable.full.css'
-    import zhCN from 'handsontable-pro/languages/zh-CN';
-//下拉插件
-// 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 {mapGetters, mapActions} from "vuex";
-import uuid from "@/utils/scan/uuid";
-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 []
-      }
-    }
-  },
-  computed: {
-        ...mapGetters("layout", [
-            "projectId",
-            "secret",
-            "userId"
-        ])
-    },
-  data() {
-    return {
-      width: "30%",
-      isFull: false,//dialog是否为全屏
-      title: "确定新增资产的类型",
-      isCenter: false,
-      deviceType: {},
-      main: table(1),
-      mess: {},
-      headers: null,
-      page: {
-        size: 50,
-        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
-    };
-  },
-  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.projectId
-      }).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.projectId
-          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.projectId,
-        UserId: this.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", "M"]
-      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: this.onlyRead ? false :{
-          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]]] : []) : []
-        }
-        console.log(this.imgsArr,'this.imgsArr')
-        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(".")[1], this.row)
-      tools.setItem(this.deviceType.code, this.main)
-    },
-
-    //上传图片弹窗触发事件
-    imgChange(keys) {
-    console.log(keys,'keys')
-      this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
-      tools.setItem(this.deviceType.code, this.main)
-      console.log(this.main,'this.main')
-    },
-
-    //设备图片弹窗改变事件
-    changePics(keys) {
-      this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
-      tools.setItem(this.deviceType.code, this.main)
-    },
-
-    //判断是否有值,有值赋值
-    // setDataToMain(data, key, row) {
-    //     console.log(data, key, row)
-    //   if (!!data && data != '--') {
-    //       console.log("data存在")
-    //     if (!!this.main[row].infos) {
-    //       //铭牌照片特殊处理
-    //       console.log("处理保存",key)
-    //       this.main[row][key[0]][key[1]] = data
-    //       console.log(this.main)
-    //     } else {
-    //         console.log("存储已保存")
-    //       this.main[row][key[0]] = {}
-    //       this.main[row][key[0]][key[1]] = data
-    //     }
-    //   } else {
-    //     this.main[row].infos[key] = ''
-    //   }
-    // },
-    //判断是否有值,有值赋值
-    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>

+ 0 - 510
src/components/ledger/lib/addDevice.vue

@@ -1,510 +0,0 @@
-<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/business_space/lib/qrcode";
-import firm from "@/components/business_space/dialogs/list/firm";
-import supplyDialog from "@/components/business_space/dialogs/list/supplyDialog";
-import supplierDialog from "@/components/business_space/dialogs/list/supplierDialog";
-import guaranteeDialog from "@/components/business_space/dialogs/list/guaranteeDialog";
-import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog";
-import Handsontable from "handsontable-pro"
-import 'handsontable-pro/dist/handsontable.full.css'
-import zhCN from 'handsontable-pro/languages/zh-CN';
-import {
-    mapGetters,
-    mapActions
-} from "vuex";
-export default {
-  props: {
-    deviceType: {
-      type: Object
-    }
-  },
-  components: {
-    qrcode, //二维码页面
-    firm, //
-    supplyDialog,
-    supplierDialog,
-    guaranteeDialog,
-    uploadFilesDialog,
-  },
-  computed: {
-        ...mapGetters("layout", [
-            "projectId",
-            "secret",
-            "userId"
-        ])
-    },
-  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: 50,
-        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.projectId
-      }).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: this.onlyRead ? false :{
-          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 10px;
-  font-size: 14px;
-  overflow: hidden;
-  margin-top: 10px;
-  .iconfont {
-    font-size: 12px;
-  }
-  .el-button {
-    // margin-right: 10px;
-  }
-}
-</style>

+ 0 - 40
src/components/ready/buildfloor/addBuild.vue

@@ -54,33 +54,6 @@
               collapse-tags>
               <el-option :key="op.name" :label="op.name" :value="op.code" v-for="op in item.options"></el-option>
             </el-select>
-
-            <!--            <el-date-picker-->
-            <!--              v-else-if="item.dataType == 'DATETIME'"-->
-            <!--              v-model="form[item.Path]"-->
-            <!--              type="daterange"-->
-            <!--              value-format="yyyy-MM-dd"-->
-            <!--              range-separator="至"-->
-            <!--              start-placeholder="开始日期"-->
-            <!--              end-placeholder="结束日期"/>-->
-
-            <!--            <el-cascader-->
-            <!--              v-else-if="item.inputMode == 'D1L'"-->
-            <!--              placeholder="请选择"-->
-            <!--              :options="item.options"-->
-            <!--              v-model="form[item.Path]"-->
-            <!--              :props="item.props"-->
-            <!--              filterable-->
-            <!--              :show-all-levels="false"-->
-            <!--              clearable-->
-            <!--              style="width: 200px"/>-->
-
-            <!--            <el-input-->
-            <!--              v-else-if="item.inputMode == 'L'||item.inputMode == 'L1'||item.inputMode == 'L2'||item.inputMode == 'M'"-->
-            <!--              v-model="form[item.Path]">-->
-            <!--              <template slot="append" v-if="item.Unit">{{ item.Unit }}</template>-->
-            <!--            </el-input>-->
-
             <el-date-picker
               v-else-if="item.dataType == 'DATETIME'"
               v-model="form[item.Path]"
@@ -222,19 +195,6 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.buildDisabled = true
-          // for (let key in this.buildMessage) {
-          //   let arr = this.buildMessage[key];
-          //   if (Array.isArray(arr)) {
-          //     let list = arr.filter(i => i.inputMode == 'D2' || i.inputMode == 'C6');
-          //     list.forEach(j => {
-          //       if (this.form.hasOwnProperty(j.Path)) {
-          //         if (Array.isArray(this.form[j.Path])) {
-          //           this.form[j.Path] = this.form[j.Path].join(',');
-          //         }
-          //       }
-          //     })
-          //   }
-          // }
           this.$emit('handleBuild', this.form)
           setTimeout(() => {
             this.buildDisabled = false

+ 1 - 18
src/components/ready/buildfloor/formItems.vue

@@ -59,24 +59,7 @@
           <el-select v-model="form[item.path]" placeholder="请选择" v-else-if="item.dataType == 'ENUM'">
             <el-option v-for="op in item.options" :key="op.code" :label="op.name" :value="op.code"></el-option>
           </el-select>
-
-          <!--          <el-cascader-->
-          <!--            v-else-if="item.inputMode == 'D1L'"-->
-          <!--            placeholder="请选择"-->
-          <!--            :options="item.options"-->
-          <!--            v-model="form[item.path]"-->
-          <!--            :props="item.props"-->
-          <!--            filterable-->
-          <!--            :show-all-levels="false"-->
-          <!--            clearable-->
-          <!--            style="width: 200px"/>-->
-
-          <!--                    <el-input-->
-          <!--                      v-else-if="item.inputMode == 'L'||item.inputMode == 'L1'||item.inputMode == 'L2'||item.inputMode == 'M'"-->
-          <!--                      v-model="form[item.path]">-->
-          <!--                      <template slot="append" v-if="item.unit">{{ item.unit }}</template>-->
-          <!--                    </el-input>-->
-          <el-input v-model="form[item.path]" v-else :placeholder="item.inputMode?'':'字典无输入类型'"></el-input>
+          <el-input v-model="form[item.path]" v-else :placeholder="item.dataType?'':'字典无输入类型'"></el-input>
         </el-form-item>
       </div>
     </el-form>

+ 4 - 8
src/views/ledger/cenotelist/index.vue

@@ -103,11 +103,12 @@ export default {
       },
       inputMap: {
         flowBuild: {
-          inputMode: 'D1',
           editable: true,
           code: "flowBuild",
           name: "建筑楼层",
-          path: "flowBuild"
+          path: "flowBuild",
+          category: 'STATIC',
+          dataType: "ENUM"
         }
       }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框
@@ -494,12 +495,7 @@ export default {
         data: []
       };
       this.tableHeader.map(head => {
-        if (
-          head.inputMode == "L" ||
-          head.inputMode == "L1" ||
-          head.inputMode == "L2" ||
-          head.inputMode == "M"
-        ) {
+        if (head.category != 'STATIC') {
           data.map(item => {
             let cur = tools.dataForKey(item, head.path);
             if (cur) {

+ 0 - 617
src/views/ledger/facility/details/index_old.vue

@@ -1,617 +0,0 @@
-<template>
-  <div class="tableDisplay">
-    <div class="header">
-      <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
-      <span :title="`${name} - ${code}`" class="details-title"><b>{{ name }} - {{ code }}</b></span>
-    </div>
-    <div class="content">
-      <div class="content-left">
-        <div class="content-keyPoint">
-          <exhibitionCrux :exhibitionCrux="exhibitionCrux" :type="type" @cruxSuccess="cruxSuccess"/>
-        </div>
-        <div class="content-showType">
-          <selectRadio
-            :selectRadio="selectRadio"
-            @changeRadio="changeRadio"
-          />
-        </div>
-        <div class="content-point">
-          <div class="content-point-left">
-            <el-scrollbar style="height:100%;">
-              <div>
-                <exhibitionBaseInformation :exhibitionBaseInformation="exhibitionBaseInformation"/>
-              </div>
-            </el-scrollbar>
-          </div>
-          <div class="content-point-right">
-            <el-scrollbar style="height:100%;">
-              <div>
-                <exhibitionEnergy :exhibitionEnergy="exhibitionEnergy"/>
-              </div>
-            </el-scrollbar>
-          </div>
-        </div>
-      </div>
-      <div class="content-right">
-        <div class="content-repair">
-          <exhibitionMaintain :exhibitionMaintain="exhibitionMaintain"/>
-        </div>
-        <div class="content-media">
-          <el-scrollbar style="height:100%;">
-            <div>
-              <exhibitionImage :exhibitionImage="exhibitionImage" v-show="isShowImage"/>
-              <exhibitionVideo :exhibitionVideo="exhibitionVideo" v-show="isShowVideo"/>
-              <exhibitionFile :exhibitionFile="exhibitionFile" v-show="isShowFile"/>
-            </div>
-          </el-scrollbar>
-        </div>
-      </div>
-    </div>
-    <div class="footer">
-      <el-select size="mini" style="float:right;margin:7px 30px 0 0" v-model="id" @change="handleChangeExample"
-                 placeholder="请选择">
-        <el-option
-          v-for="item in list"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value">
-        </el-option>
-      </el-select>
-    </div>
-  </div>
-</template>
-
-<script>
-import exhibitionBaseInformation from "@/components/ledger/details/detail/exhibitionBaseInformation";
-import exhibitionFile from "@/components/ledger/details/detail/exhibitionFile";
-import exhibitionImage from "@/components/ledger/details/detail/exhibitionImage";
-import exhibitionVideo from "@/components/ledger/details/detail/exhibitionVideo";
-import exhibitionCrux from "@/components/ledger/details/detail/exhibitionCrux";
-import exhibitionEnergy from "@/components/ledger/details/detail/exhibitionEnergy";
-import exhibitionMaintain from "@/components/ledger/details/detail/exhibitionMaintain";
-import selectRadio from "@/components/ledger/details/detail/selectRadio";
-import tools from "@/utils/scan/tools"
-import { BeatchQueryParam } from "@/api/scan/request";
-import { getDataDictionary } from "@/api/dict";
-import { queryEquip } from "@/api/object/equip";
-import { mapGetters } from "vuex";
-
-export default {
-  name: "deviceDetails",
-  components: {
-    exhibitionBaseInformation,
-    exhibitionFile,
-    exhibitionVideo,
-    exhibitionImage,
-    exhibitionMaintain,
-    selectRadio,
-    exhibitionCrux,
-    exhibitionEnergy
-  },
-  created() {
-    this.id = this.$route.query.equipId;
-    this.name = this.$route.query.equipName;
-    this.code = this.$route.query.equipCode;
-    this.type = this.$route.query.type;
-    this.list = this.$route.query.data;
-    this.getData();
-    console.log(this.$route.query)
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"])
-  },
-  data() {
-    return {
-      id: '', //当前设备id
-      name: '', //当前设备本地名称
-      code: '', //当前设备的本地编码
-      type: '', //设备类型
-      list: [], //设备列表
-      pointData: [], //信息点数据
-      exampleData: {}, //实例数据
-      currentRadio: '',//当前选中的select
-      criterias: [], //动态参数
-      selectRadio: {
-        information: '设备信息点',
-        initRadio: '1',
-        radioList: [
-          {
-            value: '显示需采集信息点',
-            label: '1'
-          },
-          {
-            value: '显示有值信息点',
-            label: '2'
-          },
-          {
-            value: '显示全部信息点',
-            label: '3'
-          }
-        ]
-      },
-      exhibitionBaseInformation: {
-        information: {}
-      },
-      exhibitionEnergy: {
-        title: '能耗信息',
-        firstName: '',
-        dynamic: [],
-      },
-      exhibitionMaintain: {
-        title: '维修/维保记录'
-      },
-      exhibitionFile: {
-        title: '文件',
-        list: {}
-      },
-      exhibitionCrux: {
-        title: '关键信息点:',
-        cruxArray: [],
-        allMessage: [],//全部信息点
-      },
-      exhibitionImage: {
-        title: '图片',
-        list: {},
-        arr: []
-      },
-      exhibitionVideo: {
-        title: '视频',
-        list: []
-      },
-      instance: {},//实例信息处理
-      isShowImage: true,
-      isShowVideo: true,
-      isShowFile: true,
-    }
-  },
-  methods: {
-    deepCopy(obj) {
-      return JSON.parse(JSON.stringify(obj))
-    },
-    cruxSuccess() {
-      this.getData()
-    },
-    // 获取表头和实例数据(动态数据在组件中获取,在此格式化请求参数)
-    getData() {
-      let params1 = {
-        orders: "sort asc",
-        pageNumber: 1,
-        PageSize: 1000,
-        type: this.type
-      }, params2 = {
-        filters: `id='${this.id}'`,
-      };
-      let promise1 = new Promise((resolve, reject) => {
-        getDataDictionary(params1, res => {
-          resolve(res)
-        })
-      })
-      let promise2 = new Promise((resolve, reject) => {
-        queryEquip(params2, res => {
-          resolve(res)
-        })
-      })
-      Promise.all([promise1, promise2]).then(values => {
-        this.pointData = values[0].content;
-        this.exampleData = values[1].content[0];
-        this.name = this.exampleData.localName ? this.exampleData.localName : this.exampleData.name ? this.exampleData.name : '';
-        this.code = this.exampleData.localId ? this.exampleData.localId : '';
-        let obj = this.deepCopy(values[1].content[0]);
-        obj = tools.flattenKeys(obj);
-        for (let key in obj) {
-          if (Array.isArray(obj[key]) && !obj[key].length) {
-            delete obj[key]
-          }
-        }
-        this.instance = obj;
-        this.handleRadios(1)
-        this.handleEnclosure() //处理图片视频文件信息
-        this.pointData.forEach(item => {
-          if (item.inputMode == "L" || item.inputMode == "L1" || item.inputMode == "L2" || item.inputMode == "M") {
-            let cur = tools.dataForKey(this.exampleData, item.path);
-            if (cur) {
-              this.criterias.push({
-                id: this.exampleData.id,
-                code: item.code
-              })
-
-            }
-          }
-        })
-
-        let params = { //获取动态参数
-          secret: this.secret,
-          ProjId: this.projectId,
-          data: {
-            criterias: this.criterias
-          }
-        }
-        if (this.criterias.length) {
-          BeatchQueryParam(params, res => {
-            res.Content && res.Content.map(child => {
-              this.pointData.forEach(head => {
-                if (head.code == child.code) {
-                  this.exhibitionEnergy.firstName = head.firstName
-                  this.exhibitionEnergy.dynamic.push({
-                    FirstName: head.firstName,
-                    InfoPointCode: head.code,
-                    InfoPointName: head.name,
-                    Path: head.path,
-                    value: child.value,
-                    data: child.data || '--',
-                    receivetime: child.receivetime || '',
-                    error: child.error || '',
-                    Unit: head.unit || ''
-                  })
-                }
-              })
-            });
-          })
-        }
-
-      })
-    },
-    handleEnclosure() {
-      //图片文件处理,脱离radio控制
-      let isList = this.pointData
-      let isArr = []
-      isList.map(j => {
-        if (this.instance.hasOwnProperty(j.path)) {
-          j.value = this.instance[j.path]
-          return j
-        }
-      })
-      isArr = isList.filter(k => k.value)
-      this.handlePicList(isArr)
-      this.handleFileList(isArr)
-    },
-    handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
-      let arr = []
-      //关键信息点
-      this.exhibitionCrux.cruxArray = this.pointData.filter(i => i.keyWord)
-      this.exhibitionCrux.cruxArray.map(i => {
-        if (this.instance.hasOwnProperty(i.path)) {
-          return {
-            ...i,
-            value: this.instance[i.path]
-          }
-        }
-      })
-
-      if (val == 1) { //需采集信息
-        arr = this.pointData.filter(i => i.visible)
-        // //  图片和的处理
-        // this.handlePicList(arr)
-        // //  文件处理
-        // this.handleFileList(arr)
-
-      } else if (val == 2) { //有值信息点
-        let list = this.pointData
-        list.map(j => {
-          if (this.instance.hasOwnProperty(j.path)) {
-            return {
-              ...j,
-              value: this.instance[j.path]
-            }
-          }
-        })
-        arr = list.filter(k => k.value)
-        // this.handlePicList(arr, 2)
-        // this.handleFileList(arr, 2)
-
-      } else { //全部信息点
-        arr = this.pointData
-        // this.handlePicList(arr)
-        // this.handleFileList(arr)
-      }
-      this.displayData(arr)
-    },
-    handlePicList(arr) {
-      let picObject = {}
-      //处理数据格式
-      arr.map(i => {
-        if (i.inputMode == 'F2') {
-          switch (i.path) {
-            case 'LedgerParam.PhotoDoc.Drawing':
-            case 'LedgerParam.Siteinstall.InstallPic':
-            case 'LedgerParam.Siteinstall.InstallDrawing':
-            case 'LedgerParam.PhotoDoc.Nameplate':
-            case 'LedgerParam.PhotoDoc.Pic':
-              if (this.instance.hasOwnProperty(i.path)) {
-                i.PicList = this.instance[i.path]
-              }
-              if (picObject[i.name]) {
-
-              } else {
-                picObject[i.name] = []
-              }
-              picObject[i.name].push({
-                ...i,
-              })
-              break;
-
-          }
-        }
-
-      })
-      //展示图片
-      this.exhibitionImage.list = picObject
-      let isArray = [] //获取图片数组
-      for (let i in picObject) {
-        if (Array.isArray(picObject[i])) {
-          let list = picObject[i]
-          list.forEach(i => {
-            if (i.PicList) {
-              isArray.push(...i.PicList)
-            }
-          })
-        }
-      }
-      this.exhibitionImage.arr = isArray
-      let video = isArray.filter(i => i.Type != 'image' && i.type != 'image')
-      this.exhibitionVideo.list = video
-      //判断是否显示图片组件
-      this.isShowImage = isArray.length ? true : false
-      //判断是否显示video组件
-      this.isShowVideo = video.length ? true : false
-
-    },
-    handleFileList(arr) {
-      let picObject = {}
-      //处理数据格式
-      arr.map(i => {
-        if (i.InputMode == 'F2') {
-          switch (i.Path) {
-            case 'LedgerParam.InsuranceDoc.InsuranceFile':
-            case 'LedgerParam.PhotoDoc.Archive':
-            case 'LedgerParam.Siteinstall.CheckReport':
-              if (this.instance.hasOwnProperty(i.Path)) {
-                i.fileList = this.instance[i.Path]
-              }
-              if (picObject[i.InfoPointName]) {
-
-              } else {
-                picObject[i.InfoPointName] = []
-              }
-              picObject[i.InfoPointName].push({
-                ...i,
-              })
-              break
-          }
-        }
-      })
-      //展示文件
-      this.exhibitionFile.list = picObject
-      let isArray = [] //获取文件数组
-      for (let i in picObject) {
-        if (Array.isArray(picObject[i])) {
-          let list = picObject[i]
-          list.forEach(i => {
-            if (i.fileList) {
-              isArray.push(...i.fileList)
-            }
-          })
-        }
-      }
-      //判断是否显示文件组件
-      this.isShowFile = isArray.length ? true : false
-
-    },
-    changeRadio(val) { //1,需采集,2,有值,3,全部
-      this.handleRadios(val)
-      this.currentRadio = val
-    },
-    formatDate(str) {
-      if (str) {
-        if (str.includes('-')) {
-          return str
-        } else {
-          if (str.length > 8) {
-            return str.substr(0, 4) + "-" + str.substr(4, 2) + "-" + str.substr(6, 2) + " " + str.substr(8, 2) + ":" + str.substr(10, 2) + ":" + str.substr(12, 2)
-          } else {
-            return str.substr(0, 4) + "-" + str.substr(4, 2) + "-" + str.substr(6, 2) + " " + str.substr(8, 2)
-          }
-        }
-      } else {
-        return '--'
-      }
-    },
-    displayData(arr) {//对数据进行处理传给组件展示
-      const result = {}
-      arr.forEach(i => {
-        if (this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
-          i.value = this.instance[i.Path]
-        }
-        if (i.InputMode == 'C5') {
-          if (this.instance.hasOwnProperty(i.Path)) {
-            let time = this.instance[i.Path]
-            i.value = this.formatDate(time)
-          }
-        }
-        if (i.DataSource && i.DataSource.length) {
-          let source = JSON.parse(i.DataSource)
-          //判断输入类型
-          if (i.InputMode == 'D1L') {
-            let d1l = tools.formatDataSource(i.DataSource)
-            d1l.forEach(k => {
-              if (k.Code == this.instance[i.Path]) {
-                i.value = k.Name
-              }
-            })
-          } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
-            if (this.instance.hasOwnProperty(i.Path)) {
-              if (!Array.isArray(this.instance[i.Path])) {
-                let transArray = this.instance[i.Path].split(',')
-                i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
-              }
-            }
-          }
-          source.forEach(j => {
-            if (j.Code == this.instance[i.Path]) {
-              console.log(j.Name)
-              i.value = j.Name
-            }
-          })
-        }
-        switch (i.InputMode) {
-          case "L":
-          case "L1":
-          case "L2":
-          case "M":
-            break;
-          default:
-            if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
-              result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`].paths.push({
-                Path: i.Path,
-                InfoPointName: i.InfoPointName,
-                InfoPointCode: i.InfoPointCode,
-                Value: i.value,
-                Visible: i.Visible,
-                KeyWord: i.KeyWord,
-                InputMode: i.InputMode
-              })
-            } else {
-              result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`] = {
-                paths: [{
-                  Path: i.Path,
-                  InfoPointName: i.InfoPointName,
-                  InfoPointCode: i.InfoPointCode,
-                  Value: i.value,
-                  Visible: i.Visible,
-                  KeyWord: i.KeyWord,
-                  InputMode: i.InputMode
-                }]
-              }
-            }
-
-        }
-
-
-      })
-      this.exhibitionBaseInformation.information = result
-      this.exhibitionCrux.allMessage = result
-    },
-    goBack() {
-      this.$router.push({
-        name: "facilityLedger",
-        params: {
-          deviceId: this.type
-        }
-      })
-    },
-    // 切换实例
-    handleChangeExample() {
-      this.selectRadio.initRadio = '1'
-      this.getData();
-      this.exhibitionEnergy.dynamic = []
-    },
-  },
-  watch: {
-    projectId() {
-      this.$router.push({ path: "/ledger/facility" })
-    }
-  }
-}
-</script>
-
-<style scoped lang="less">
-@bgc: #fff;
-.tableDisplay {
-  .header {
-    padding-bottom: 10px;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-
-    .details-title {
-      color: #333;
-      font-size: 16px;
-      margin-left: 20px;
-      line-height: 32px;
-      cursor: pointer;
-    }
-  }
-
-  .content {
-    display: flex;
-    flex-direction: row;
-    box-sizing: border-box;
-    height: calc(100% - 95px);
-
-    .content-left {
-      display: flex;
-      flex-direction: column;
-      flex: 1;
-
-      .content-keyPoint {
-        border: 1px solid #ccc;
-        box-sizing: border-box;
-        height: 100px;
-        margin-bottom: 10px;
-        overflow: hidden;
-        background: @bgc;
-      }
-
-      .content-showType {
-        height: 50px;
-        border: 1px solid #ccc;
-        border-bottom: none;
-        box-sizing: border-box;
-        background: @bgc;
-      }
-
-      .content-point {
-        display: flex;
-        flex-direction: row;
-        height: calc(100% - 160px);
-        border: 1px solid #ccc;
-        box-sizing: border-box;
-        background: @bgc;
-
-        .content-point-left {
-          flex: 1;
-        }
-
-        .content-point-right {
-          width: 300px;
-          border-left: 1px solid #ccc;
-        }
-      }
-    }
-
-    .content-right {
-      width: 400px;
-      margin-left: 10px;
-
-      .content-repair {
-        height: 50px;
-        line-height: 50px;
-        margin-bottom: 10px;
-        border: 1px solid #ccc;
-        background: @bgc;
-        box-sizing: border-box;
-      }
-
-      .content-media {
-        height: calc(100% - 60px);
-        background: @bgc;
-        border: 1px solid #ccc;
-        box-sizing: border-box;
-      }
-    }
-  }
-
-  .footer {
-    margin-top: 5px;
-    height: 45px;
-    background-color: #fff;
-    box-sizing: border-box;
-    border: 1px solid #ccc;
-  }
-}
-
-/deep/ .el-scrollbar__wrap {
-  overflow-x: hidden;
-}
-
-</style>

+ 1 - 6
src/views/ledger/facility/parts/index.vue

@@ -483,12 +483,7 @@ export default {
         data: []
       };
       this.tableHeader.map(head => {
-        if (
-          head.inputMode == "L" ||
-          head.inputMode == "L1" ||
-          head.inputMode == "L2" ||
-          head.inputMode == "M"
-        ) {
+        if (head.category != 'STATIC') {
           data.map(item => {
             let cur = tools.dataForKey(item, head.path);
             if (cur) {

+ 3 - 2
src/views/ledger/facility/partsmanage/index.vue

@@ -149,11 +149,12 @@ export default {
       copyTableData: [],
       inputMap: {
         flowBuild: {
-          inputMode: 'D1',
           editable: true,
           code: "flowBuild",
           name: "建筑楼层",
-          path: "flowBuild"
+          path: "flowBuild",
+          category: 'STATIC',
+          dataType: "ENUM"
         }
       }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框

+ 4 - 8
src/views/ledger/rentlist/index.vue

@@ -116,11 +116,12 @@ export default {
       },
       inputMap: {
         FloorId: {
-          inputMode: 'B1',
           editable: true,
           code: "FloorId",
           name: "所属楼层",
-          path: "FloorId"
+          path: "FloorId",
+          category: 'STATIC',
+          dataType: "STRING"
         }
       }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框
@@ -525,12 +526,7 @@ export default {
         data: []
       }
       this.tableHeader.map(head => {
-        if (
-          head.inputMode == "L" ||
-          head.inputMode == "L1" ||
-          head.inputMode == "L2" ||
-          head.inputMode == "M"
-        ) {
+        if (head.category != 'STATIC') {
           data.map(item => {
             let cur = tools.dataForKey(item, head.path);
             if (cur) {

+ 3 - 2
src/views/ledger/spacelist/spaceadd/index.vue

@@ -93,11 +93,12 @@ export default {
       },
       inputMap: {
         flowBuild: {
-          inputMode: 'D1',
           editable: true,
           code: "flowBuild",
           name: "建筑楼层",
-          path: "flowBuild"
+          path: "flowBuild",
+          category: 'STATIC',
+          dataType: "ENUM"
         }
       }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框

+ 0 - 3
src/views/ready/buildfloor/index.vue

@@ -226,8 +226,6 @@ export default {
         list.map(item => {
           console.table(item.category, item.dataType)
           const category = ['ENUM', 'MENUM', 'BOOLEAN']
-          // if ((item.inputMode === 'D1' || item.inputMode === 'D2' || item.inputMode === 'E2' || item.inputMode === 'D1L') && item.dataSource) {
-          // item.options = JSON.parse(item.dataSource)
           if (item.category == 'STATIC' && item.dataType.includes(category) && item.dataSource) {
             item.options = item.dataSource
             item.props = {
@@ -248,7 +246,6 @@ export default {
               Visible: item.visible,
               UnDisabled: item.unDisabled,
               SecondName: item.secondName ? item.secondName : "",
-              inputMode: item.inputMode,
               options: item.dataSource,
               props: item.props,
               Unit: item.unit,