소스 검색

添加系统所属建筑楼层

haojianlong 5 년 전
부모
커밋
92081a495d
2개의 변경된 파일44개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 0
      src/components/ledger/handsontables/system.vue
  2. 33 1
      src/utils/handsontable/mainText.js

+ 11 - 0
src/components/ledger/handsontables/system.vue

@@ -76,6 +76,7 @@ import dialogAssets from "@/components/ledger/addDialog/dialogSystem"
 import detailsDialog from "@/components/business_space/lib/detailsDia"
 import systemRelevance from "@/components/ledger/tableTransfers"
 import Handsontable from "handsontable-pro"
+import text from "@/utils/handsontable/mainText"
 import 'handsontable-pro/dist/handsontable.full.css'
 
 import { mapGetters } from "vuex";
@@ -264,6 +265,9 @@ export default {
       let arr = tools.copyArr(list)
       let data = showTools.headerTextFilter(arr, 'system', this.onlyRead, this.showType)
       data.unshift("操作", "关联设备数量");
+      if (this.showType == "all") {
+        data.splice(3, 0, "所属建筑楼层")
+      }
       return data;
     },
     //格式化表内容
@@ -287,6 +291,13 @@ export default {
           item.readOnly = true
         })
       }
+      if (this.showType == "all") {
+        data.splice(3, 0, {
+          data: "sysInBuildFloor",
+          renderer: text.sysInBuildFloor,
+          readOnly: this.onlyRead
+        })
+      }
       return data;
     },
     //获取动态参数

+ 33 - 1
src/utils/handsontable/mainText.js

@@ -95,7 +95,39 @@ const text = {
         td.style.cursor = "pointer";
         td.innerHTML = "查看二维码"
         return td
-    }
+    },
+
+    //系统所属建筑楼层
+    sysInBuildFloor: (instance, td, row, col, prop, value, cellProperties) => {
+        td.style.color = "#409EFF";
+        td.style.cursor = "pointer";
+        if (value instanceof Array && value.length > 0) {
+            if (value.length == 1) {
+                td.innerHTML = !!value[0].infos ? (value[0].infos.SysLocalName || value[0].infos.SysName) : (value[0].SysLocalName || value[0].SysName)
+            } else {
+                let text = ""
+                for (let i = 0; i < value.length; i++) {
+                    if (!!value[i].SysLocalName || !!value[i].SysName) {
+                        if (i == value.length) {
+                            text += value[i].SysLocalName || value[i].SysName
+                        } else {
+                            text = value[i].SysLocalName || value[i].SysName + "、" + text
+                        }
+                    } else {
+                        if (i == value.length) {
+                            text += value[i].infos.SysLocalName || value[i].infos.SysName
+                        } else {
+                            text = value[i].infos.SysLocalName || value[i].infos.SysName + "、" + text
+                        }
+                    }
+                }
+                td.innerHTML = text.substring(0, 40) + "..."
+            }
+        } else {
+            td.innerHTML = "无所属建筑楼层"
+        }
+        return td;
+    },
 }
 
 export default text