Browse Source

设备相关接口修改

zhangyu 5 years ago
parent
commit
55c9e45ca2

+ 24 - 0
src/api/scan/request.js

@@ -939,6 +939,30 @@ export function updateProperty(param, success) {
     http.postJson(url, param, success)
 }
 
+//查询系统信息
+export function queryGeneralSys(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/query`;
+    http.postJson(url, param, success)
+}
+
+//更新系统信息
+export function updateGeneralSys(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/update`;
+    http.postJson(url, param, success)
+}
+
+//删除系统信息
+export function deleteGeneralSys(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/delete`;
+    http.postJson(url, param, success)
+}
+
+//创建系统信息
+export function createGeneralSys(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/create`;
+    http.postJson(url, param, success)
+}
+
 //动态数据关联-冲突选择确认
 export function dynamicClashConfirm(param, success) {
     let url = `${baseUrl}/pointconfig/dynamic/clashconfirm`;

+ 1 - 2
src/components/dialogs/changeRea.vue

@@ -101,7 +101,6 @@ export default {
     getFloor(relation) {
       let floor = !!relation ? relation.floor || "" : ""
       if (!!floor) {
-        console.log(floor)
         let floorName = ""
         this.floorList.map(item => {
           if (!!item.floors && item.floors.length) {
@@ -167,7 +166,7 @@ export default {
     //查询表数据
     getPropertyData() {
       let param = {
-        Filters: `EquipmentId isNull;Family="${this.category.assetType}"`,
+        Filters: `EquipID isNull;Family="${this.category.assetType}"`,
         PageNumber: this.page.currentPage,
         PageSize: this.page.size
       }

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

@@ -22,7 +22,7 @@
           <div>
             <div class="hanson-bar">
               <span>当前选择的设备族:{{deviceType.facility}}</span>
-              <div style="float:right;overflow:hidden;">
+              <div style="width:500px;float:right;overflow:hidden;">
                 <span>增加</span>
                 <el-input v-model="addNum" style="width:40px;" placeholder="增加个数" size="small"></el-input>
                 <span>个{{deviceType.facility}}</span>

+ 9 - 9
src/components/ledger/handsontables/assets.vue

@@ -3,9 +3,9 @@
     <div class="hanson-bar">
       <div style="float:right;overflow:hidden;">
         <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
-          <i v-show="!onlyRead" class="el-icon-fa  el-icon-fa-eye"></i>
+          <i v-show="!onlyRead" class="el-icon-fa  el-icon-fa-compass"></i>
         </span>
-        <span>当前筛选条件下共{{page.total || '--'}}资产</span>
+        <span>当前筛选条件下共{{page.total || '--'}}设备</span>
       </div>
       <el-select v-model="onlyRead" @change="getHeaderData(mess)" style="width:100px;margin-right:20px;vertical-align:bottom;">
         <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
@@ -15,7 +15,7 @@
       </el-select>
       <el-button size="small" style="width: 80px;" @click="addDevice" icon="iconfont icon-tianjia">添加资产</el-button>
       <el-button size="small" style="width: 80px;" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
-      <el-button size="small" style="width: 80px;" v-show="!onlyRead" @click="undo" icon="iconfont icon-undo">撤销</el-button>
+      <el-button v-show="!onlyRead" size="small" style="width: 80px;" @click="undo" icon="iconfont icon-undo">撤销</el-button>
     </div>
     <qrcode :qrcodeUrl="qrcodeUrl" :dialog="myDialog" :addBody="true" ref="qrcode"></qrcode>
     <firm ref="firm" :mess="mess" @changeFirm="firmChange" :dialog="myDialog"></firm>
@@ -753,12 +753,12 @@ export default {
     },
   },
   watch: {      
-    projectId(){
-        this.main = []
-        this.mess.deviceId = null
-        this.page.total = 0
-    },
-    showTypes: {
+      projectId(){
+          this.main = []
+          this.mess.deviceId = null
+          this.page.total = 0
+      },
+      showTypes: {
       handler(newName, oldName) {
         if (newName && newName[0] && newName[0].value) {
           this.showType = newName[0].value

File diff suppressed because it is too large
+ 0 - 1296
src/components/ledger/handsontables/copyassets.vue


+ 3 - 3
src/components/ledger/handsontables/device.vue

@@ -10,7 +10,7 @@
       <el-select v-model="onlyRead" @change="getHeaderData(mess)" style="width:100px;margin-right:20px;vertical-align:bottom;">
         <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
-      <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
+      <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button>
@@ -199,8 +199,8 @@ export default {
     ...mapGetters("layout", ["projectId", "secret", "userId"]),
     showTypes() {
       return this.onlyRead ?
-        [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
-        [{ value: "Visible", label: '只看采集信息' }, { value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }]
+        [{ value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }] :
+        [{ value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }, { value: "partInfo", label: '隐藏信息点' }]
     }
   },
   methods: {

File diff suppressed because it is too large
+ 241 - 719
src/components/ledger/handsontables/system.vue


+ 5 - 6
src/components/ledger/lib/system.vue

@@ -17,7 +17,6 @@
 <script>
 import {mapGetters} from 'vuex';
 import { getEqCode } from "@/api/scan/request";
-import tools from "@/utils/tools";
 export default {
   name: "getCode",
   props: {
@@ -40,8 +39,7 @@ export default {
         label: "facility"
       },
       falg: true,
-      content: [],
-      alloptions:[]
+      content: []
     };
   },
   created() {
@@ -64,12 +62,13 @@ export default {
           value = item
         }
       })
+      this.value = val
       this.$emit("change", value)
     },
     getData() {
       getEqCode().then(res => {
-        this.alloptions = this.changeArr(res.data.Content);
-        this.options = tools.deepCopy(this.alloptions);
+        console.log(res.data)
+        this.options = this.changeArr(res.data.Content);
         if (!!this.value && this.value.length) {
           let value = {}
           this.options.map(item => {
@@ -108,7 +107,7 @@ export default {
 
     //修改list
     changeList() {
-      this.options = this.alloptions.filter(item => {
+      this.options = this.options.filter(item => {
         if (this.content.indexOf(item.code) > -1) {
           return item
         }

+ 14 - 18
src/router/system.js

@@ -34,13 +34,12 @@ const OwnerManage = () =>
 
 /**  台账管理 */
 import systemLedger from '@/views/ledger/system/index'
-import dialogAssets from '@/views/ledger/system/addsystem'
+import addsystem from '@/views/ledger/system/addsystem'
 import facilityLedger from '@/views/ledger/facility/index'
 import partsLedger from '@/views/ledger/facility/parts/index'
 import partsmanageLedger from '@/views/ledger/facility/partsmanage/index'
 import addparts from '@/views/ledger/facility/partsmanage/addparts/index'
-import addevice from '@/views/ledger/facility/addevice/index'
-import addassets from '@/views/ledger/facility/addassets/index'
+import addevice from '@/views/ledger/facility/addfacility'
 import propertyLedger from '@/views/ledger/property/index'
 import dialogSystem from '@/views/ledger/property/addproperty'
 import cenotelist from '@/views/ledger/cenotelist/index' //竖井清单
@@ -161,12 +160,6 @@ export default [
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '设备清单' }] }
             },
             {
-                path: 'addevice',
-                name: 'addevice',
-                component: addevice,
-                meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '设备清单', path: '/ledger/facility' }, { label: '添加设备' }] }
-            },
-            {
                 path: 'parts',
                 name: 'partsLedger',
                 component: partsLedger,
@@ -184,6 +177,14 @@ export default [
                 component: addparts,
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '设备清单', path: '/ledger/facility' }, { label: '添加部件' }] },
             },
+            
+            {
+                path: 'addevice',
+                name: 'addevice',
+                component: addevice,
+                meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '设备清单', path: '/ledger/facility' }, { label: '添加设备' }] }
+            },
+
             {
                 path: 'property',
                 name: 'propertyLedger',
@@ -191,12 +192,6 @@ export default [
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '资产清单' }] }
             },
             {
-                path: 'addassets',
-                name: 'addassets',
-                component: addassets,
-                meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '资产清单', path: '/ledger/property' }, { label: '添加资产' }] }
-            },
-            {
                 path: 'property/addproperty',
                 name: 'dialogSystem',
                 component: dialogSystem,
@@ -341,9 +336,10 @@ export default [
                 meta: { keepAlive: false, breadcrumbs: [{ label: '系统管理', path: '/system/list' }, { label: '系统清单' }] }
             },
             {
-                path: '/system/list/addsystem',
-                name: 'dialogAssets',
-                component: dialogAssets,
+                path: 'addsystem',
+                name: 'addsystem',
+                component: addsystem,
+                meta: { keepAlive: false, breadcrumbs: [{ label: '系统管理', path: '/system/list' }, { label: '系统清单', path: '/system/list' }, { label: '添加系统' }] }
             },
         ]
     }

+ 12 - 4
src/utils/handsontable/fillterField.js

@@ -11,6 +11,14 @@ const data = {
   },
   tenant: { //租户
     onlyRead: [],
+    edit: []
+  },
+  shaft: { //竖井
+    onlyRead: [],
+    edit: []
+  },
+  parts: { //部件
+    onlyRead: [],
     edit: [
       "EquipID",
       "EquipName",
@@ -19,7 +27,7 @@ const data = {
       "BIMLocation"
     ]
   },
-  shaft: { //竖井
+  property:{ //资产
     onlyRead: [],
     edit: [
       "EquipID",
@@ -29,11 +37,11 @@ const data = {
       "BIMLocation"
     ]
   },
-  parts: { //部件
+  system:{ //系统
     onlyRead: [],
     edit: [
-      "EquipID",
-      "EquipName",
+      "SysID",
+      "SysName",
       "EquipQRCode",
       "BIMID",
       "BIMLocation"

+ 3 - 3
src/views/ledger/cenotelist/index.vue

@@ -13,7 +13,7 @@
           :value="item.value">
         </el-option>
       </el-select>
-      <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
+      <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option
           v-for="item in showTypes"
           :key="item.value"
@@ -122,8 +122,8 @@ export default {
     ]),
     showTypes () {
       return this.onlyRead?
-        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
-        [{value: "Visible", label: '只看采集信息'}, {value: "partInfo", label: '隐藏信息点'}, {value: "all", label: '全部'}]
+        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}]: 
+        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}, {value: "partInfo", label: '隐藏信息点'}]
     }
   },
   created() {

+ 0 - 705
src/views/ledger/facility/addevice/index.vue

@@ -1,705 +0,0 @@
-<template>
-  <div id="deviceList">
-    <el-row class="right">
-      <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
-        <i class="el-icon-fa  el-icon-fa-compass"></i>
-      </span>
-      <span style="float:left;">当前选择的设备类型:{{category.name}}</span>
-      <div style="width:200px;display:inline-block;text-align:left;color:gray;">
-        <span>隐藏自动填充的信息</span>
-        <el-checkbox v-model="showTypeFlag" @change="getTableHeader"></el-checkbox>
-      </div>
-      <span>增加</span>
-      <el-input v-model="addNum" style="width:40px;" size="small"></el-input>
-      <span>个{{category.name}}</span>
-      <el-button @click="handleAddTableRow">增加</el-button>
-    </el-row>
-    <div class="tableBox">
-      <div class="center middle_sty" style="flex:2;" v-show="tableData && !tableData.length">
-        <p>
-          <i class="iconwushuju iconfont"></i>
-          暂无数据
-        </p>
-      </div>
-      <div class="tableLeft" v-show="tableData && tableData.length">
-        <handson-table ref="table"></handson-table>
-      </div>
-    </div>
-    <el-row class="center">
-      <el-button type="primary" size="medium" @click="handleCreateTableData" class="create_button">创建设备</el-button>
-    </el-row>
-    <!-- 二维码弹窗 -->
-    <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
-    <!-- 型号弹窗 -->
-    <firm :mess="{deviceId: firmId}" ref="firm" @changeFirm="firmChange" :dialog="myDialog"></firm>
-    <!-- 供应商合同弹窗 -->
-    <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="myDialog"></supply-dialog>
-    <!-- 供应商弹窗 -->
-    <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
-    <guarantee-dialog :id="id" ref="guarantee" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
-    <upload-files-dialog :read="onlyRead ? true : false" ref="upload" @changeFile="fileChange" :keysArr="filesArr" :dialog="myDialog">
-    </upload-files-dialog>
-    <upload-img-dialog :read="onlyRead ? true : false" @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 :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
-    <system-type :infos="systemId" :graphyId="graphyId" :dialog="myDialog" :type="'edit'" @change="changeSystemType"></system-type>
-    <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
-  </div>
-</template>
-<script>
-import tools from "@/utils/scan/tools";
-import handsonUtils from "@/utils/hasontableUtils";
-import showTools from "@/utils/handsontable/notShow";
-import text from "@/utils/handsontable/mainText";
-import session from "@/framework/utils/storage";
-
-import handsonTable from "@/components/common/handsontable";
-import {
-  getDataDictionary,
-  createEquip,
-  createPropertyData,
-  getEquipBelongs,
-  getSpaceFloor
-} from "@/api/scan/request";
-import { mapGetters, mapActions } from "vuex";
-
-import qrcode from "@/components/ledger/lib/qrcode";
-import firm from "@/components/dialogs/list/firm";
-import supplyDialog from "@/components/dialogs/list/supplyDialog";
-import supplierDialog from "@/components/dialogs/list/supplierDialog";
-import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
-import insurerDialog from "@/components/dialogs/list/insurerDialog";
-import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
-import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
-import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
-import picDialog from "@/components/dialogs/list/picDialog";
-import systemType from "@/components/dialogs/list/systemType";
-export default {
-  components: {
-    qrcode, //二维码页面
-    firm, //品牌型号弹窗
-    supplyDialog,
-    supplierDialog,
-    maintainerDialog,
-    insurerDialog,
-    guaranteeDialog,
-    uploadFilesDialog,
-    uploadImgDialog,
-    picDialog,
-    systemType,
-    handsonTable
-  },
-  data() {
-    return {
-      addNum: 1,
-      onlyRead: false,
-      tableHeader: [],
-      tableData: session.get("deviceAddData")
-        ? session.get("deviceAddData").length
-          ? session.get("deviceAddData")
-          : [{ Checked: 1 }]
-        : [{ Checked: 1 }],
-      copyTableData: [],
-      category: "", //当前设备类
-      myDialog: {
-        qrcode: false, //二维码弹窗
-        firm: false, //厂商弹窗
-        supply: false, //选择供应合同
-        supplier: false, //供应商选择
-        guarantee: false, //选择保单
-        maintainer: false, //选择维修商
-        insurer: false, //选择保险公司
-        uploadFiles: false, //上传文件
-        uploadImgs: false, //上传单个图片
-        pic: false, //多个图片
-        addDevice: false,
-        systemType: false,
-        details: false, //详情页
-        changeRea: false,
-        lookPic: false //图片查看
-      },
-      qrcodeUrl: "", //二维码图片地址
-      filesArr: [], //保存临时的文件key
-      imgsArr: [], //临时保存的图片key数组
-      picsArr: [], //临时设备图片keys数组
-      systemId: null,
-      graphyId: null,
-      id: 0,
-      showTypeFlag: true,
-      EquipmentList: [],
-      firmId: "" //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
-    };
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"])
-  },
-  created() {
-    this.category = this.$route.query;
-    this.getBelongs();
-    this.getFloorData();
-    this.getTableHeader();
-  },
-  methods: {
-    //查询设备类对应的 族
-    getBelongs() {
-      let params = {
-        data: {
-          Filters: `EquipCode='${this.category.deviceId}'`,
-          PageNumber: 1,
-          PageSize: 50
-        }
-      }
-      getEquipBelongs(params, res => {
-        this.firmId = res.Content[0].Family;
-      })
-    },
-    //维护建筑
-    changeAssetsFalg() {
-      if (this.floorFlag) {
-        this.floorFlag = false
-      } else {
-        this.$confirm('<p>维护设备所在建筑楼层后,对后续数据影响较大,如业务空间中的所在关系or其他?暂未梳理明白……</p><p>后续要修改设备所属建筑楼层,只能通过模型中的待建模清单操作</p>', '提示', {
-          dangerouslyUseHTMLString: true,
-          confirmButtonText: '就要维护设备所属建筑楼层',
-          cancelButtonText: '暂时不搞了',
-          confirmButtonClass: 'confirmButtonClass',
-          cancelButtonClass: 'cancelButtonClass'
-        }).then(_ => {
-          this.floorFlag = true
-          this.getTableHeader()
-        }).catch(_ => {
-          this.$message("取消")
-        })
-      }
-    },
-    //获取楼层数据
-    getFloorData() {
-      let param = {
-        ProjId: this.projectId,
-        secret: this.secret
-      }
-      getSpaceFloor(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
-        } 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,
-          }
-        }
-      })
-    },
-    // 获取表头数据(初始化表格)
-    async getTableHeader() {
-      let params = {
-        data: {
-          PageNumber: 1,
-          PageSize: 500
-        },
-        type: this.category.deviceId
-      };
-      await getDataDictionary(params, res => {
-        this.tableHeader = res.Content;
-        this.initTable();
-      });
-    },
-    // 创建设备数据
-    async handleCreateTableData() {
-      let newData = this.tableData.filter(item => {
-        let keys = Object.keys(item);
-        keys.map(key => {
-          //将值为空字符串的属性删除
-          if (item[key] == "") {
-            delete item[key];
-          }
-        });
-        let newK = Object.keys(item)
-        if ((item.Checked && newK.length > 1) || (!item.Checked && newK.length)) {
-          return item;
-        }
-      });
-      if (!newData.length) {
-        this.$message("创建信息为空,请录入信息后再创建!");
-        return;
-      }
-      let flag = false;
-      newData.map(item => {
-        if (item.Checked && !item.EquipLocalName) {
-          flag = true;
-        }
-        // 处理建筑-楼层
-        if (item.flowBuild) {
-          item.BuildingId = item.flowBuild.split("-")[0]
-          item.FloorId = item.flowBuild.split("-")[1]
-        }
-        //处理管理的系统
-        if (item.LinkSystem && item.LinkSystem.length) {
-          item.SystemList = []
-          item.LinkSystem.map(t => {
-            item.SystemList.push(t.id)
-          })
-        }
-      })
-      if (flag) {
-        this.$message.info("存在设备的本地名称为空,请检查")
-        return;
-      }
-
-      for (let i = 0; i < newData.length; i++) {
-        let params = newData[i]
-        params.Family = this.firmId;
-        params.Category = this.category.deviceId;
-        if (newData[i].Checked) {//同时创建资产
-          await createPropertyData([params], async res => {
-            params.PropertyId = res.EntityList[0].EquipID
-            await createEquip([params], res => {
-              if (i == newData.length - 1) {
-                this.$router.push({
-                  path: "/ledger/facility",
-                  query: { deviceId: this.category.deviceId }
-                });
-                session.remove("deviceAddData")
-              }
-            })
-          })
-        } else {
-          await createEquip([params], res => {
-            if (i == newData.length - 1) {
-              this.$router.push({
-                path: "/ledger/facility",
-                query: { deviceId: this.category.deviceId }
-              });
-              session.remove("deviceAddData")
-            }
-          });
-        }
-      }
-    },
-    // 删除表格行
-    handleDeleteTableRow() {
-      this.$message.success("删除成功");
-      this.formaTableData();
-    },
-    // 添加行
-    handleAddTableRow() {
-      let addRowLength = this.addNum;
-      for (let i = 0; i < addRowLength; i++) {
-        this.tableData.push({ Checked: 1 });
-      }
-      this.initTable();
-      this.formaTableData();
-    },
-    //修改
-    handleUpdataTable(changeData, source) {
-      this.formaTableData();
-    },
-    //保存去掉空字段的新增数据
-    formaTableData() {
-      let newData = this.tableData.filter(item => {
-        let keys = Object.keys(item);
-        keys.map(key => {
-          //将值为空字符串的属性删除
-          if (item[key] == "") {
-            delete item[key];
-          }
-        });
-        if (keys.length && Object.keys(item).length) {
-          return item;
-        }
-      });
-      session.set("deviceAddData", newData);
-    },
-    //格式化表头显示的数据
-    formatHeaderData(list) {
-      let arr = tools.copyArr(list);
-      let showType = this.showTypeFlag?'partInfo':'all';
-      let data = showTools.headerTextFilter(arr, 'equipment', this.onlyRead, showType, true);
-      data.unshift("同时创建资产", "所属系统实例");
-      if (this.floorFlag) {
-        data.splice(1, 0, "所属建筑楼层")
-      }
-      return data;
-    },
-    formatHeaderType(list) {
-      //格式化表头头映射的数据
-      let arr = tools.copyArr(list);
-      let showType = this.showTypeFlag?'partInfo':'all';
-      let data = showTools.headerTypeFilter(arr, 'equipment', this.onlyRead, showType, true);
-      data.unshift({
-        type: "checkbox",
-        checkedTemplate: 1,
-        uncheckedTemplate: 0,
-        data: "Checked",
-        label: {
-          position: "after"
-        }
-      }, {
-          data: "LinkSystem",
-          renderer: text.systemList,
-          readOnly: true
-        });
-      if (this.floorFlag) {
-        data.splice(1, 0, {
-          data: "flowBuild",
-          renderer: tools.customDropdownRenderer,
-          editor: "chosen",
-          chosenOptions: {
-            // multiple: true,//多选
-            data: this.floorData
-          }
-        })
-      }
-      return data;
-    },
-    initTable() {
-      //实例化表格
-      let settings = {
-        data: this.tableData,
-        colHeaders: this.formatHeaderData(this.tableHeader),
-        columns: this.formatHeaderType(this.tableHeader),
-        rowHeights: 30,
-        maxRows: this.tableData.length,
-        contextMenu: {
-          items: {
-            remove_row: {
-              name: "删除设备"
-            }
-          }
-        },
-        // 事件
-        afterChange: this.handleUpdataTable, //修改后
-        afterFilter: this.trimmedRows, //排序前
-        afterRemoveRow: this.handleDeleteTableRow, //右键删除
-        afterOnCellMouseDown: this.handleTdClick //鼠标点击
-      };
-      this.$nextTick(() => {
-        this.tableExample = this.$refs.table.init(settings);
-      });
-    },
-    //去除数组中相同的元素
-    array_diff(a, b) {
-      for (var i = 0; i < b.length; i++) {
-        for (var j = 0; j < a.length; j++) {
-          if (a[j] == b[i]) {
-            a.splice(j, 1);
-            j = j - 1;
-          }
-        }
-      }
-      return a;
-    },
-    //选择型号修改
-    firmChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
-    },
-    supplyChange(data) {
-      let changeData = { id: data };
-      this.utilToKey("id", "id", changeData, "SupplierContractID");
-    },
-    //如果选择供应商之后
-    supplierChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
-    },
-    //保险合同
-    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");
-      }
-    },
-    //上传文件弹窗触发事件
-    fileChange(keys) {
-      this.setDataToMain(keys, this.messKey, this.row);
-    },
-    //上传图片弹窗触发事件
-    imgChange(keys) {
-      this.setDataToMain(keys, this.messKey, this.row);
-    },
-    //维修商变更
-    changeMaintainer(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
-    },
-    //保险商变更
-    changeInsurer(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPInsurerID", data.venderId)
-    },
-    //设备图片弹窗改变事件
-    changePics(keys) {
-      this.setDataToMain(keys, this.messKey, this.row);
-    },
-    //关联系统变更
-    changeSystemType(data) {
-      tools.setDataForKey(this.tableData[this.row], "LinkSystem", data)
-    },
-    //表格点击事件
-    handleTdClick(el, rowArr) {
-      //点击的是表头
-      if (rowArr.row < 0) {
-        return;
-      }
-      //被筛选过后的数组
-      let trimmedArr = this.trimmedRows();
-      //是否启用了排序
-      let isSort = this.tableExample.getPlugin("columnSorting").isSorted();
-      if (trimmedArr.length && isSort) {
-        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
-          .__arrayMap;
-        let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
-        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
-      } else if (isSort) {
-        //排序后的数组
-        let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper
-          .__arrayMap;
-        let infos = this.tableData[sortArr[rowArr.row]];
-        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
-      } else if (trimmedArr.length) {
-        let infos = this.tableData[trimmedArr[rowArr.row]];
-        this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
-      } else {
-        let infos = this.tableData[rowArr.row];
-        this.getInfors(infos, rowArr);
-      }
-    },
-    //获取被筛选掉的行号
-    trimmedRows() {
-      var plugin = this.tableExample.getPlugin("trimRows").trimmedRows;
-      let dataLength = this.tableData.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 || [];
-    },
-    getInfors(infos, row) {
-      let val = this.tableExample.colToProp(row.col);
-      switch (val) {
-        //操作
-        case 'caozuo':
-          // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
-          this.$message("开发中...")
-          break;
-        //设备二维码图片
-        case 'EquipQRCode':
-          this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
-          if (!!this.qrcodeUrl) {
-            this.myDialog.qrcode = true;
-          } else {
-            this.$message("此设备没有设备二维码");
-          }
-          break;
-        //关联系统
-        case 'linkSystem':
-          if (!this.onlyRead) {
-            this.systemList = this.tableData[row.row].LinkSystem || [];
-            this.myDialog.systemType = true;
-          }
-          break;
-        //关联资产
-        case 'LinkEquipLocalName':
-          if (this.linkNameFalg) {
-            this.myDialog.changeRea = true;
-          }
-          break;
-        //品牌型号弹窗
-        case 'DPManufacturerID':
-          if (!this.onlyRead) {
-            this.myDialog.firm = true;
-          }
-          break;
-        //供应商信息弹窗
-        case 'DPSupplierID':
-          if (!this.onlyRead) {
-            this.myDialog.supplier = true;
-          }
-          break;
-        //维修商信息弹窗
-        case 'DPMaintainerID':
-          if (!this.onlyRead) {
-            this.myDialog.maintainer = true;
-          }
-          break;
-        //保险公司信息
-        case 'DPInsurerID':
-          if (!this.onlyRead) {
-            this.myDialog.insurer = true;
-          }
-          break;
-        //供应合同编号
-        case 'LedgerParam.SupplyPurchase.SupplierContractID':
-          if (!this.onlyRead) {
-            let ContractIDflag = null;
-            let DPSdata = this.tableData[row.row].DPSupplierID;
-            if (DPSdata) {
-              ContractIDflag = DPSdata.split("-")[0];
-            }
-            if (!!ContractIDflag) {
-              this.id = ContractIDflag;
-              this.myDialog.supply = true;
-            } else {
-              this.$message("请先选择供应商");
-            }
-          }
-          break;
-        //保险单号
-        case 'LedgerParam.InsuranceDoc.InsuranceNum':
-          if (!this.onlyRead) {
-            let DPInsurerIDflag = null;
-            let DPIdata = this.tableData[row.row].DPInsurerID;
-            if (DPIdata) {
-              DPInsurerIDflag = DPIdata.split("-")[0];
-            }
-            if (!!DPInsurerIDflag) {
-              this.id = DPInsurerIDflag;
-              this.myDialog.guarantee = true;
-            } else {
-              this.$message("请先选择保险商");
-            }
-          }
-          break;
-        //保险文件--设备文档--安装质检报告
-        case 'LedgerParam.InsuranceDoc.InsuranceFile':
-        case 'LedgerParam.PhotoDoc.Archive':
-        case 'LedgerParam.Siteinstall.CheckReport':
-          let IPSdata = tools.dataForKey(this.tableData[row.row], val);
-          this.filesArr = IPSdata ? IPSdata : [];
-          this.myDialog.uploadFiles = true;
-          break;
-        //安装照片--安装图纸--设备铭牌照片--设备图纸
-        case 'LedgerParam.Siteinstall.InstallPic':
-        case 'LedgerParam.Siteinstall.InstallDrawing':
-        case 'LedgerParam.PhotoDoc.Nameplate':
-        case 'LedgerParam.PhotoDoc.Drawing':
-          let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
-          this.imgsArr = SSPPdata ? SSPPdata : [];
-          this.myDialog.uploadImgs = true;
-          break;
-        //设备照片
-        case 'LedgerParam.PhotoDoc.Pic':
-          let Pdata = tools.dataForKey(this.tableData[row.row], val);
-          this.picsArr = Pdata ? Pdata : [];
-          this.myDialog.pic = true;
-          break;
-        //包含的部件字段
-        case 'Count':
-          if (this.onlyRead) {
-            this.$router.push({ path: '/ledger/parts', query: { deviceId: infos.EquipID } });
-          } else {
-            this.$router.push({ path: '/ledger/partsmanage', query: { deviceId: infos.EquipID, typeId: this.mess.deviceId } });
-          }
-          break;
-        default:
-          break;
-      }
-      this.row = row.row;
-      this.messKey = val;
-    },
-    utilToKey(key, name, data, messName) {
-      if (key == name) {
-        this.setDataToMain(data[key], messName, this.row);
-      }
-    },
-    //判断是否有值,有值赋值
-    setDataToMain(data, key, row) {
-      if (!!data && data != "--") {
-        if (!!this.tableData[row]) {
-          //铭牌照片特殊处理
-          tools.setDataForKey(this.tableData[row], key, data)
-          // this.tableData[row][key] = data;
-        } else {
-          this.tableData[row] = {};
-          tools.setDataForKey(this.tableData[row], key, data)
-        }
-      } else {
-        tools.setDataForKey(this.tableData[row], key, "")
-      }
-    }
-  }
-};
-</script>
-<style lang="less" scoped>
-#deviceList {
-  overflow: hidden;
-  height: 100%;
-  background-color: #fff;
-  padding: 10px;
-  position: relative;
-  .right {
-    background: #fff;
-  }
-  .search-header {
-    overflow: hidden;
-    padding: 0 10px 10px 10px;
-    border-bottom: 1px solid #bcbcbc;
-  }
-  .tableBox {
-    display: flex;
-    height: calc(100% - 100px);
-    margin-top: 10px;
-    .tableLeft {
-      flex: 1;
-    }
-  }
-  .create_button {
-    margin-top: 10px;
-  }
-}
-</style>

src/views/ledger/facility/addassets/index.vue → src/views/ledger/facility/addfacility.vue


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

@@ -10,7 +10,7 @@
         <span>只看要采集的信息</span>
         <el-checkbox v-model="allMess" @change="getTableHeader"></el-checkbox>
       </div> -->
-      <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
+      <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value">
         </el-option>
       </el-select>

+ 9 - 6
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -2,7 +2,11 @@
   <div id="deviceList">
     <el-row class="left">
       <span style="float:right;">当前选择的部件类型:{{category.Name}}</span>
-      <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
+      <!-- <div style="width:200px;display:inline-block;text-align:left;color:gray;">
+        <span>隐藏自动填充的信息</span>
+        <el-checkbox v-model="isWatch" @change="getTableHeader"></el-checkbox>
+      </div> -->
+      <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value">
         </el-option>
       </el-select>
@@ -94,10 +98,9 @@ export default {
           : [{ Checked: 1 }]
         : [{ Checked: 1 }],
       showTypes: [
-        {value: "partInfo", label: '隐藏信息点'},
-        {value: "Visible", label: '只看采集信息'},
-        {value: "all", label: '全部'}
-
+        { value: "partInfo", label: '隐藏信息点' },
+        { value: "all", label: '全部' },
+        { value: "Visible", label: '只看采集信息' }
       ],
       showType: "partInfo",
       copyTableData: [],
@@ -206,7 +209,7 @@ export default {
 
         await createPart([params], async res => {
           if (newData[i].Checked) {//同时创建资产
-            params.EquipID = res.EntityList[0].EquipID
+            params.EquipId = res.EntityList[0].EquipID
             await createPropertyData([params], res => { })
           }
           this.$router.push({

+ 6 - 8
src/views/ledger/facility/partsmanage/index.vue

@@ -10,7 +10,7 @@
         <span>隐藏自动填充的信息</span>
         <el-checkbox v-model="allMess" @change="getTableHeader"></el-checkbox>
       </div> -->
-      <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
+      <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value">
         </el-option>
       </el-select>
@@ -109,8 +109,8 @@ export default {
       onlyRead: false,
       showTypes: [
         { value: "partInfo", label: '隐藏信息点' },
-        { value: "Visible", label: '只看采集信息' },
-        { value: "all", label: '全部' }
+        { value: "all", label: '全部' },
+        { value: "Visible", label: '只看采集信息' }
       ],
       showType: "partInfo",
       tableHeader: [],
@@ -386,9 +386,8 @@ export default {
           readOnly: true
         },
         {
-          data: "LinkEquipLocalName",
-          readOnly: true,
-          renderer: tools.LinkEquipLocalName
+          data: "PropertyLocalName",
+          readOnly: true
         }
       );
       return data;
@@ -540,7 +539,6 @@ export default {
       this.row = row.row;
       this.messKey = val;
       let val = this.tableExample.colToProp(row.col);
-      console.log(val)
       switch (val) {
         //操作
         case 'caozuo':
@@ -565,7 +563,7 @@ export default {
           }
           break;
         //关联资产
-        case 'LinkEquipLocalName':
+        case 'PropertyLocalName':
           if (this.linkNameFalg) {
             this.myDialog.changeRea = true;
           }

+ 513 - 8
src/views/ledger/system/addsystem.vue

@@ -1,13 +1,518 @@
 <template>
-    <div>33333333333333</div>
+  <div id="deviceList">
+    <el-row class="right"> 
+      <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
+        <i class="el-icon-fa  el-icon-fa-compass"></i>
+      </span>
+      <span style="float:left;">当前选择的系统类型:{{category.name}}</span>
+      <div style="width:200px;display:inline-block;text-align:left;color:gray;">
+        <span>隐藏自动填充的信息</span>
+        <el-checkbox v-model="showTypeFlag" @change="getTableHeader"></el-checkbox>
+      </div>
+      <span>增加</span>
+      <el-input v-model="addNum" style="width:40px;" size="small"></el-input>
+      <span>个{{category.name}}</span>
+      <el-button @click="handleAddTableRow">增加</el-button>
+    </el-row>
+    <div class="tableBox">
+      <div class="center middle_sty" style="flex:2;" v-show="tableData && !tableData.length">
+        <p>
+          <i class="iconwushuju iconfont"></i>
+          暂无数据
+        </p>
+      </div>
+      <div class="tableLeft" v-show="tableData && tableData.length">
+        <handson-table ref="table"></handson-table>
+      </div>
+    </div>
+    <el-row class="center">
+      <el-button type="primary" size="medium" @click="handleCreateTableData" class="create_button">创建系统</el-button>
+    </el-row>
+  </div>
 </template>
-
 <script>
-export default {
-    
-}
-</script>
+import tools from "@/utils/scan/tools";
+import handsonUtils from "@/utils/hasontableUtils";
+import showTools from "@/utils/handsontable/notShow";
+import text from "@/utils/handsontable/mainText";
+import session from "@/framework/utils/storage";
 
-<style>
+import handsonTable from "@/components/common/handsontable";
+import {
+  getDataDictionary,
+  createGeneralSys,
+  getSpaceFloor
+} from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 
-</style>
+import qrcode from "@/components/ledger/lib/qrcode";
+export default {
+  components: {
+    handsonTable
+  },
+  data() {
+    return {
+      addNum: 1,
+      onlyRead: false,
+      tableHeader: [],
+      tableData: session.get("systemAddData")
+        ? session.get("systemAddData").length
+          ? session.get("systemAddData")
+          : [{}]
+        : [{}],
+      copyTableData: [],
+      category: "", //当前设备类
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        firm: false, //厂商弹窗
+        supply: false, //选择供应合同
+        supplier: false, //供应商选择
+        guarantee: false, //选择保单
+        maintainer: false, //选择维修商
+        insurer: false, //选择保险公司
+        uploadFiles: false, //上传文件
+        uploadImgs: false, //上传单个图片
+        pic: false, //多个图片
+        addDevice: false,
+        systemType: false,
+        details: false, //详情页
+        changeRea: false,
+        lookPic: false //图片查看
+      },
+      qrcodeUrl: "", //二维码图片地址
+      filesArr: [], //保存临时的文件key
+      imgsArr: [], //临时保存的图片key数组
+      picsArr: [], //临时设备图片keys数组
+      systemId: null,
+      graphyId: null,
+      id: 0,
+      showTypeFlag: true,
+      EquipmentList: [],
+    };
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"])
+  },
+  created() {
+    this.category = this.$route.query;
+    this.getFloorData();
+    this.getTableHeader();
+  },
+  methods: {
+    //维护建筑
+    changeAssetsFalg() {
+      if (this.floorFlag) {
+        this.floorFlag = false
+      } else {
+        this.$confirm('<p>维护设备所在建筑楼层后,对后续数据影响较大,如业务空间中的所在关系or其他?暂未梳理明白……</p><p>后续要修改设备所属建筑楼层,只能通过模型中的待建模清单操作</p>', '提示', {
+          dangerouslyUseHTMLString: true,
+          confirmButtonText: '就要维护设备所属建筑楼层',
+          cancelButtonText: '暂时不搞了',
+          confirmButtonClass: 'confirmButtonClass',
+          cancelButtonClass: 'cancelButtonClass'
+        }).then(_ => {
+          this.floorFlag = true
+          this.getTableHeader()
+        }).catch(_ => {
+          this.$message("取消")
+        })
+      }
+    },
+    //获取楼层数据
+    getFloorData() {
+      let param = {
+        ProjId: this.projectId,
+        secret: this.secret
+      }
+      getSpaceFloor(param).then(res => {
+        if (res.data.Result == 'success') {
+          let data = this.changeArr(res.data.Content), floorData = []
+          data.map(item => {
+            floorData.push({
+              Code: item.value,
+              Name: item.label
+            })
+          })
+          this.floorData = floorData
+          this.floorData = floorData
+        } else {
+          this.$message.error(res.data.ResultMsg)
+        }
+      }).catch(() => {
+        this.$message.error("请求出错")
+      })
+    },
+    //将数组转换成optiosn格式
+    changeArr(arr) {
+      return arr.map(item => {
+        if (item.floors && item.floors.length) {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: item.floors.map(i => {
+              return {
+                value: i.id,
+                label: i.infos.FloorLocalName || "未知",
+              }
+            })
+          }
+        } else {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: null,
+            isChilren: 1,
+          }
+        }
+      })
+    },
+    // 获取表头数据(初始化表格)
+    async getTableHeader() {
+      let params = {
+        data: {
+          PageNumber: 1,
+          PageSize: 500
+        },
+        type: this.category.deviceId
+      };
+      await getDataDictionary(params, res => {
+        this.tableHeader = res.Content;
+        this.initTable();
+      });
+    },
+    // 创建设备数据
+    async handleCreateTableData() {
+      let newData = this.tableData.filter(item => {
+        let keys = Object.keys(item);
+        keys.map(key => {
+          //将值为空字符串的属性删除
+          if (item[key] == "") {
+            delete item[key];
+          }
+        });
+        let newK = Object.keys(item)
+        if (newK.length) {
+          return item;
+        }
+      });
+      if (!newData.length) {
+        this.$message("创建信息为空,请录入信息后再创建!");
+        return;
+      }
+      let flag = false;
+      newData.map(item => {
+        if (!item.SysLocalName) {
+          flag = true;
+        }
+        // 处理建筑
+        if (item.flowBuild) {
+          item.BuildingId = item.flowBuild
+        }
+        item.Category = this.category.deviceId
+      })
+      if (flag) {
+        this.$message.info("存在系统的本地名称为空,请检查")
+        return;
+      }
+      createGeneralSys(newData, res => {
+        this.$router.push({
+          path: "/system/list",
+          query: { deviceId: this.category.deviceId }
+        });
+        session.remove("systemAddData")
+      })
+    },
+    // 删除表格行
+    handleDeleteTableRow() {
+      this.$message.success("删除成功");
+      this.formaTableData();
+    },
+    // 添加行
+    handleAddTableRow() {
+      let addRowLength = this.addNum;
+      for (let i = 0; i < addRowLength; i++) {
+        this.tableData.push({});
+      }
+      this.initTable();
+      this.formaTableData();
+    },
+    //修改
+    handleUpdataTable(changeData, source) {
+      this.formaTableData();
+    },
+    //保存去掉空字段的新增数据
+    formaTableData() {
+      let newData = this.tableData.filter(item => {
+        let keys = Object.keys(item);
+        keys.map(key => {
+          //将值为空字符串的属性删除
+          if (item[key] == "") {
+            delete item[key];
+          }
+        });
+        if (keys.length && Object.keys(item).length) {
+          return item;
+        }
+      });
+      session.set("systemAddData", newData);
+    },
+    //格式化表头显示的数据
+    formatHeaderData(list) {
+      let arr = tools.copyArr(list);
+      let showType = this.showTypeFlag ? 'partInfo' : 'all';
+      let data = showTools.headerTextFilter(arr, 'system', this.onlyRead, showType);
+      data.unshift("所属建筑");
+      return data;
+    },
+    formatHeaderType(list) {
+      //格式化表头头映射的数据
+      let arr = tools.copyArr(list);
+      let showType = this.showTypeFlag ? 'partInfo' : 'all';
+      let data = showTools.headerTypeFilter(arr, 'system', this.onlyRead, showType);
+      data.unshift({
+        data: "flowBuild",
+        renderer: tools.customDropdownRenderer,
+        editor: "chosen",
+        chosenOptions: {
+          // multiple: true,//多选
+          data: this.floorData
+        }
+      });
+      return data;
+    },
+    initTable() {
+      //实例化表格
+      let settings = {
+        data: this.tableData,
+        colHeaders: this.formatHeaderData(this.tableHeader),
+        columns: this.formatHeaderType(this.tableHeader),
+        rowHeights: 30,
+        maxRows: this.tableData.length,
+        contextMenu: {
+          items: {
+            remove_row: {
+              name: "删除设备"
+            }
+          }
+        },
+        // 事件
+        afterChange: this.handleUpdataTable, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        afterRemoveRow: this.handleDeleteTableRow, //右键删除
+        afterOnCellMouseDown: this.handleTdClick //鼠标点击
+      };
+      this.$nextTick(() => {
+        this.tableExample = this.$refs.table.init(settings);
+      });
+    },
+    //去除数组中相同的元素
+    array_diff(a, b) {
+      for (var i = 0; i < b.length; i++) {
+        for (var j = 0; j < a.length; j++) {
+          if (a[j] == b[i]) {
+            a.splice(j, 1);
+            j = j - 1;
+          }
+        }
+      }
+      return a;
+    },
+    //表格点击事件
+    handleTdClick(el, rowArr) {
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.tableExample.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.tableData[sortArr[rowArr.row]];
+        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
+      } else if (trimmedArr.length) {
+        let infos = this.tableData[trimmedArr[rowArr.row]];
+        this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
+      } else {
+        let infos = this.tableData[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+    //获取被筛选掉的行号
+    trimmedRows() {
+      var plugin = this.tableExample.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.tableData.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 || [];
+    },
+    getInfors(infos, row) {
+      let val = this.tableExample.colToProp(row.col);
+      console.log(val)
+      switch (val) {
+        //操作
+        case 'caozuo':
+          // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
+          this.$message("开发中...")
+          break;
+        //设备二维码图片
+        case 'EquipQRCode':
+          this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
+          if (!!this.qrcodeUrl) {
+            this.myDialog.qrcode = true;
+          } else {
+            this.$message("此设备没有设备二维码");
+          }
+          break;
+        //关联系统
+        case 'linkSystem':
+          if (!this.onlyRead) {
+            this.systemList = this.tableData[row.row].LinkSystem || [];
+            this.myDialog.systemType = true;
+          }
+          break;
+        //关联资产
+        case 'LinkEquipLocalName':
+          if (this.linkNameFalg) {
+            this.myDialog.changeRea = true;
+          }
+          break;
+        //品牌型号弹窗
+        case 'DPManufacturerID':
+          if (!this.onlyRead) {
+            this.myDialog.firm = true;
+          }
+          break;
+        //供应商信息弹窗
+        case 'DPSupplierID':
+          if (!this.onlyRead) {
+            this.myDialog.supplier = true;
+          }
+          break;
+        //维修商信息弹窗
+        case 'DPMaintainerID':
+          if (!this.onlyRead) {
+            this.myDialog.maintainer = true;
+          }
+          break;
+        //保险公司信息
+        case 'DPInsurerID':
+          if (!this.onlyRead) {
+            this.myDialog.insurer = true;
+          }
+          break;
+        //供应合同编号
+        case 'LedgerParam.SupplyPurchase.SupplierContractID':
+          if (!this.onlyRead) {
+            let ContractIDflag = null;
+            let DPSdata = this.tableData[row.row].DPSupplierID;
+            if (DPSdata) {
+              ContractIDflag = DPSdata.split("-")[0];
+            }
+            if (!!ContractIDflag) {
+              this.id = ContractIDflag;
+              this.myDialog.supply = true;
+            } else {
+              this.$message("请先选择供应商");
+            }
+          }
+          break;
+        //保险单号
+        case 'LedgerParam.InsuranceDoc.InsuranceNum':
+          if (!this.onlyRead) {
+            let DPInsurerIDflag = null;
+            let DPIdata = this.tableData[row.row].DPInsurerID;
+            if (DPIdata) {
+              DPInsurerIDflag = DPIdata.split("-")[0];
+            }
+            if (!!DPInsurerIDflag) {
+              this.id = DPInsurerIDflag;
+              this.myDialog.guarantee = true;
+            } else {
+              this.$message("请先选择保险商");
+            }
+          }
+          break;
+        //保险文件--设备文档--安装质检报告
+        case 'LedgerParam.InsuranceDoc.InsuranceFile':
+        case 'LedgerParam.PhotoDoc.Archive':
+        case 'LedgerParam.Siteinstall.CheckReport':
+          let IPSdata = tools.dataForKey(this.tableData[row.row], val);
+          this.filesArr = IPSdata ? IPSdata : [];
+          this.myDialog.uploadFiles = true;
+          break;
+        //安装照片--安装图纸--设备铭牌照片--设备图纸
+        case 'LedgerParam.Siteinstall.InstallPic':
+        case 'LedgerParam.Siteinstall.InstallDrawing':
+        case 'LedgerParam.PhotoDoc.Nameplate':
+        case 'LedgerParam.PhotoDoc.Drawing':
+          let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
+          this.imgsArr = SSPPdata ? SSPPdata : [];
+          this.myDialog.uploadImgs = true;
+          break;
+        //设备照片
+        case 'LedgerParam.PhotoDoc.Pic':
+          let Pdata = tools.dataForKey(this.tableData[row.row], val);
+          this.picsArr = Pdata ? Pdata : [];
+          this.myDialog.pic = true;
+          break;
+        //包含的部件字段
+        case 'Count':
+          if (this.onlyRead) {
+            this.$router.push({ path: '/ledger/parts', query: { deviceId: infos.EquipID } });
+          } else {
+            this.$router.push({ path: '/ledger/partsmanage', query: { deviceId: infos.EquipID, typeId: this.mess.deviceId } });
+          }
+          break;
+        default:
+          break;
+      }
+      this.row = row.row;
+      this.messKey = val;
+    },
+  }
+};
+</script>
+<style lang="less" scoped>
+#deviceList {
+  overflow: hidden;
+  height: 100%;
+  background-color: #fff;
+  padding: 10px;
+  position: relative;
+  .right {
+    background: #fff;
+  }
+  .search-header {
+    overflow: hidden;
+    padding: 0 10px 10px 10px;
+    border-bottom: 1px solid #bcbcbc;
+  }
+  .tableBox {
+    display: flex;
+    height: calc(100% - 100px);
+    margin-top: 10px;
+    .tableLeft {
+      flex: 1;
+    }
+  }
+  .create_button {
+    margin-top: 10px;
+  }
+}
+</style>

+ 31 - 25
src/views/ledger/system/index.vue

@@ -21,13 +21,13 @@ import myCascader from "@/components/ledger/lib/system";
 import hansonTable from "@/components/ledger/handsontables/system";
 import tableTransfers from "@/components/ledger/tableTransfers";
 import {
-    mapGetters,
-    mapActions
+  mapGetters,
+  mapActions
 } from "vuex";
 import { getAllbusiness, getFamilyList, getSpaceName } from "@/api/scan/request"
 import Handsontable from "handsontable-pro"
-    import 'handsontable-pro/dist/handsontable.full.css'
-    import zhCN from 'handsontable-pro/languages/zh-CN';
+import 'handsontable-pro/dist/handsontable.full.css'
+import zhCN from 'handsontable-pro/languages/zh-CN';
 
 export default {
   components: {
@@ -58,22 +58,25 @@ export default {
     };
   },
   computed: {
-        ...mapGetters("layout", [
-            "projectId",
-            "secret",
-            "userId"
-        ])
-    },
+    ...mapGetters("layout", ["projectId", "secret", "userId"])
+  },
   created() {
-      this.param.ProjId = this.projectId
-      this.param.secret = this.secret
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
     this.getProjName()
+
+    let deviceId = this.$route.query.deviceId;
+    if (deviceId) {
+      this.$nextTick(() => {
+        this.$refs.cascader.changeVal([deviceId])
+      })
+    }
   },
-    watch: {
+  watch: {
     projectId() {
-        this.param.ProjId = this.projectId
-        this.param.secret = this.secret
-        this.getProjName()
+      this.param.ProjId = this.projectId
+      this.param.secret = this.secret
+      this.getProjName()
     }
   },
   methods: {
@@ -102,15 +105,16 @@ export default {
       }
       getFamilyList(param, res => {
         if (this.$refs.cascader) {
-              this.$refs.cascader.pushData(res.Content)
-          }
+          this.$refs.cascader.pushData(res.Content)
+        }
       })
     },
     close(val) {
       this.getProjName()
+      console.log(val)
       if (!!val && !!val.code) {
-          if(this.$refs.cascader)
-        this.$refs.cascader.changeVal([val.code])
+        if (this.$refs.cascader)
+          this.$refs.cascader.changeVal([val.code])
       }
     },
 
@@ -138,6 +142,7 @@ export default {
 
     //修改楼层
     changeFloor(value) {
+      console.log(this.param);
       if (value[0]) {
         this.param.buildId = value[0]
       }
@@ -147,8 +152,8 @@ export default {
         this.param.floorId = null
       }
       if (!!this.param.deviceId) {
-          if(this.$refs.tableMain)
-        this.$refs.tableMain.getHeaderData(this.param);
+        if (this.$refs.tableMain)
+          this.$refs.tableMain.getHeaderData(this.param);
       } else {
         return;
       }
@@ -156,10 +161,11 @@ export default {
 
     //修改设备族
     changeDevice(value) {
+      console.log(value)
       this.param.deviceId = value.code
       if (!!value) {
-          if(this.$refs.tableMain)
-        this.$refs.tableMain.getHeaderData(this.param);
+        if (this.$refs.tableMain)
+          this.$refs.tableMain.getHeaderData(this.param);
       } else {
         return;
       }
@@ -186,7 +192,7 @@ export default {
   }
   .search-header {
     overflow: hidden;
-    padding:0 10px 10px 10px;
+    padding: 0 10px 10px 10px;
     border-bottom: 1px solid #bcbcbc;
   }
 }

+ 3 - 3
src/views/rent/rentlist/index.vue

@@ -13,7 +13,7 @@
           :value="item.value">
         </el-option>
       </el-select>
-      <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
+      <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
         <el-option
           v-for="item in showTypes"
           :key="item.value"
@@ -122,8 +122,8 @@ export default {
     ]),
     showTypes () {
       return this.onlyRead?
-        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
-        [{value: "Visible", label: '只看采集信息'}, {value: "partInfo", label: '隐藏信息点'}, {value: "all", label: '全部'}]
+        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}]: 
+        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}, {value: "partInfo", label: '隐藏信息点'}]
     }
   },
   created() {