Browse Source

添加租户分区

zhangyu 5 years ago
parent
commit
b6c3a736f9
2 changed files with 15 additions and 5 deletions
  1. 9 4
      src/components/business/handsontable.vue
  2. 6 1
      src/views/buildFamily.vue

+ 9 - 4
src/components/business/handsontable.vue

@@ -326,8 +326,11 @@ export default {
         infos: {}
       };
       for (let i = 0; i < change.length; i++) {
-        let arr = change[i][1].split(".");
-        seedData[arr[0]][arr[1]] = [{ value: change[i][3] != "" ? change[i][3] : null }];
+        let str = change[i][1];
+        let firstKey = str.slice(0, str.indexOf("."))
+        let lastKey = str.slice(str.indexOf(".") + 1, str.length)
+        // let arr = change[i][1].split(".");
+        seedData[firstKey][lastKey] = [{ value: change[i][3] != "" ? change[i][3] : null }];
       }
       this.createSpace(seedData);
     },
@@ -343,9 +346,11 @@ export default {
       };
       data.map((item, index) => {
         console.log(change[index][1]);
-        let arr = change[index][1].split(".");
+        // let arr = change[index][1].split(".");
+        let arrStr = change[index][1].slice(change[index][1].indexOf(".") + 1, change[index][1].length);
         let info = {};
-        info[arr[1]] = [{ value: change[index][3] != "" ? change[index][3] : null }];
+        // info[arr[1]] = [{ value: change[index][3] != "" ? change[index][3] : null }];
+        info[arrStr] = [{ value: change[index][3] != "" ? change[index][3] : null }];
         param.data.criterias.push({
           id: item.id,
           infos: info

+ 6 - 1
src/views/buildFamily.vue

@@ -549,7 +549,12 @@ export default {
             "name":"空调分区",
             "rel_type":"4",
             "code":"AirConditioningZone"
-        },
+          },
+          {
+            "name": "租户分区",
+            "rel_type": "10",
+            "code": "TenantZone",
+          }
         ]
             this.familySort();
           })