ソースを参照

Merge branch 'spaceup' of http://39.106.8.246:3003/web/ibms into spaceup

haojianlong 5 年 前
コミット
2a3b15ebab
63 ファイル変更1157 行追加331 行削除
  1. 2 1
      build/webpack.dev.conf.js
  2. 2 1
      build/webpack.prod.conf.js
  3. 0 1
      config/dev.env.js
  4. 4 5
      config/prod.env.js
  5. 3 1
      package.json
  6. 4 2
      src/api/scan/httpUtil.js
  7. 7 1
      src/api/scan/request.js
  8. 59 2
      src/components/business_space/business/handsontable.vue
  9. 5 1
      src/components/business_space/dialogs/addDialog/businessDialog.vue
  10. 4 2
      src/components/business_space/dialogs/detailsDialog.vue
  11. 4 1
      src/components/business_space/dialogs/list/guaranteeDialog.vue
  12. 5 2
      src/components/business_space/dialogs/list/insurerDialog.vue
  13. 5 2
      src/components/business_space/dialogs/list/maintainerDialog.vue
  14. 5 1
      src/components/business_space/dialogs/list/paramDetails.vue
  15. 5 2
      src/components/business_space/dialogs/list/supplierDialog.vue
  16. 7 3
      src/components/business_space/dialogs/list/supplyDialog.vue
  17. 10 6
      src/components/business_space/dialogs/list/systemType.vue
  18. 9 6
      src/components/business_space/graphy/business.vue
  19. 6 2
      src/components/business_space/lib/floorCascader.vue
  20. 3 2
      src/components/business_space/table/businessTable.vue
  21. 6 2
      src/components/data_admin/buildFamily.vue
  22. 5 1
      src/components/dialogHanson/addDevice.vue
  23. 5 1
      src/components/dialogs/addDialog/businessDialog.vue
  24. 3 6
      src/components/dialogs/addDialog/dialogAssets.vue
  25. 3 3
      src/components/dialogs/addDialog/dialogSystem.vue
  26. 8 4
      src/components/dialogs/detailsDialog.vue
  27. 6 2
      src/components/dialogs/facilityDialog.vue
  28. 8 4
      src/components/dialogs/influenceDialog.vue
  29. 1 1
      src/components/dialogs/list/guaranteeDialog.vue
  30. 5 2
      src/components/dialogs/list/insurerDialog.vue
  31. 5 2
      src/components/dialogs/list/maintainerDialog.vue
  32. 5 1
      src/components/dialogs/list/paramDetails.vue
  33. 5 2
      src/components/dialogs/list/supplierDialog.vue
  34. 4 6
      src/components/dialogs/list/systemType.vue
  35. 6 3
      src/components/ledger/addDialog/dialogDevice.vue
  36. 20 17
      src/components/ledger/handsontables/assets.vue
  37. 10 7
      src/components/ledger/handsontables/device.vue
  38. 57 44
      src/components/ledger/handsontables/system.vue
  39. 62 28
      src/components/ledger/lib/assets.vue
  40. 7 4
      src/components/ledger/lib/cascader.vue
  41. 7 2
      src/components/ledger/lib/floorCascader.vue
  42. 9 6
      src/components/ledger/lib/partsDieList.vue
  43. 6 3
      src/components/ledger/lib/system.vue
  44. 19 16
      src/components/ledger/tableTransfers.vue
  45. 1 1
      src/components/model/file/modelLog.vue
  46. 209 0
      src/data/mapTable.js
  47. 6 3
      src/framework/layout/PageHeader.vue
  48. 30 0
      src/framework/layout/layout-store.js
  49. 4 2
      src/router/system.js
  50. 103 0
      src/utils/JOSNToExcel.js
  51. 11 4
      src/utils/handsontable/buildFloorData.js
  52. 1 1
      src/views/data_admin/buildGraphy/lib/uploadImg.vue
  53. 11 9
      src/views/ledger/cenotelist/index.vue
  54. 5 5
      src/views/ledger/facility/index.vue
  55. 10 6
      src/views/ledger/facility/partsmanage/index.vue
  56. 20 4
      src/views/ledger/property/addpropertys.vue
  57. 7 35
      src/views/ledger/property/index.vue
  58. 11 9
      src/views/ledger/rentlist/index.vue
  59. 286 27
      src/views/ledger/report/index.vue
  60. 2 2
      src/views/ledger/system/index.vue
  61. 17 11
      src/views/point/dynamicdata/index.vue
  62. 2 1
      src/views/system/auth/index.vue
  63. BIN
      static/favicon.ico

+ 2 - 1
build/webpack.dev.conf.js

@@ -51,7 +51,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
         new HtmlWebpackPlugin({
             filename: 'index.html',
             template: 'index.html',
-            inject: true
+            inject: true,
+            favicon: path.resolve(__dirname, '../static/favicon.ico')
         }),
         // copy custom static assets
         new CopyWebpackPlugin([

+ 2 - 1
build/webpack.prod.conf.js

@@ -72,7 +72,8 @@ const webpackConfig = merge(baseWebpackConfig, {
                 // https://github.com/kangax/html-minifier#options-quick-reference
             },
             // necessary to consistently work with multiple chunks via CommonsChunkPlugin
-            chunksSortMode: 'dependency'
+            chunksSortMode: 'dependency',
+            favicon: path.resolve(__dirname, '../static/favicon.ico')
         }),
         // keep module.id stable when vendor modules does not change
         new webpack.HashedModuleIdsPlugin(),

+ 0 - 1
config/dev.env.js

@@ -6,7 +6,6 @@ module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
     BASE_URL: '"http://192.168.20.215"', //测试iframe地址
     SSO_SERVER: '"http://192.168.20.102:8080"' //(新)测试环境
-    // SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
     // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
     // BASE_URL: '"http://mbi.sagacloud.cn"' //线上iframe地址
 })

+ 4 - 5
config/prod.env.js

@@ -1,9 +1,8 @@
 'use strict'
 module.exports = {
     NODE_ENV: '"production"',
-    BASE_URL: '"http://192.168.20.215"', //测试iframe地址
-    SSO_SERVER: '"http://192.168.20.102:8080"' //(新)测试环境
-    // SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
-    // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-    // SSO_SERVER: '"http://sso.sagacloud.cn"'  //正式环境
+    // BASE_URL: '"http://192.168.20.215"', //测试iframe地址
+    // SSO_SERVER: '"http://192.168.20.102:8080"' //(新)测试环境
+    BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+    SSO_SERVER: '"http://sso.sagacloud.cn"'  //正式环境
 }

+ 3 - 1
package.json

@@ -41,6 +41,7 @@
         "css-loader": "^0.28.0",
         "extract-text-webpack-plugin": "^3.0.0",
         "file-loader": "^1.1.4",
+        "file-saver": "^2.0.2",
         "friendly-errors-webpack-plugin": "^1.6.1",
         "html-webpack-plugin": "^2.30.1",
         "less": "^3.9.0",
@@ -66,7 +67,8 @@
         "webpack": "^3.6.0",
         "webpack-bundle-analyzer": "^2.9.0",
         "webpack-dev-server": "^2.9.1",
-        "webpack-merge": "^4.1.0"
+        "webpack-merge": "^4.1.0",
+        "xlsx": "^0.15.1"
     },
     "engines": {
         "node": ">= 6.0.0",

+ 4 - 2
src/api/scan/httpUtil.js

@@ -33,8 +33,9 @@ function errorResponse(vm, response, err) {
 export default {
     getJson: function(url, data, success, failed, err) {
         let ProjectId = storage.get("global_project_selected")
+        let userName = storage.get("user_name")
         let vm = this;
-        fetch({ url: url, method: 'get', params: data, headers: {'ProjectId': ProjectId}}).then((response) => {
+        fetch({ url: url, method: 'get', params: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName}}).then((response) => {
             successResponse(vm, response, success, failed)
         }).catch(error => {
             errorResponse(vm, error, err);
@@ -42,8 +43,9 @@ export default {
     },
     postJson: function(url, data, success, failed, err) {
         let ProjectId = storage.get("global_project_selected")
+        let userName = storage.get("user_name")
         let vm = this;
-        fetch({ url: url, method: 'post', data: data, headers: {'ProjectId': ProjectId} }).then((response) => {
+        fetch({ url: url, method: 'post', data: data, headers: {'ProjectId': ProjectId, 'Comming': 'adm' ,'Account': userName} }).then((response) => {
             successResponse(vm, response, success, failed)
         }).catch(error => {
             errorResponse(vm, error, err);

+ 7 - 1
src/api/scan/request.js

@@ -921,7 +921,13 @@ export function equipLinkSys(param, success) {
 
 //设备清单 - 设备关联系统 系统1-n   
 export function sysLinkEquip(param, success) {
-    let url = `${baseUrl}/datacenter/sy-in-eq/link-eq`;
+    let url = `${baseUrl}/datacenter/sy-in-eq/link-sy-eq`;
+    http.postJson(url, param, success)
+} 
+
+//设备清单 - 根据对象删除系统和设备的关系
+export function sysUnlinkEquip(param, success) {
+    let url = `${baseUrl}/datacenter/sy-in-eq/unlinks-sy-eq`;
     http.postJson(url, param, success)
 }
 

+ 59 - 2
src/components/business_space/business/handsontable.vue

@@ -41,7 +41,7 @@ import Handsontable from "handsontable-pro"
 import 'handsontable-pro/dist/handsontable.full.css'
 import zhCN from 'handsontable-pro/languages/zh-CN';
 import qrcode from "@/components/ledger/lib/qrcode";
-import { queryZone, updateZone, deleteZone, createZone } from "@/api/scan/request";
+import { queryZone, updateZone, deleteZone, createZone, BeatchQueryParam } from "@/api/scan/request";
 import { mapGetters, mapActions } from "vuex";
 export default {
   props: {
@@ -343,7 +343,7 @@ export default {
       })
       //生成对应修改数据
       data.map((item, index) => {
-        param.data.Projection.map(value => {
+        keyList.map(value => {
           let itemData = tools.dataForKey(item, value)
           tools.setDataForKey(item, value, itemData == "" ? null : itemData)
         })
@@ -386,6 +386,63 @@ export default {
       }
       return a;
     },
+    //获取动态参数
+    getBatch(data) {
+      let param = {
+        secret: this.secret,
+        ProjId: this.projectId,
+        data: {
+          criterias: []
+        }
+      };
+      this.headers.map(head => {
+        if (
+          head.InputMode == "L" ||
+          head.InputMode == "L1" ||
+          head.InputMode == "L2" ||
+          head.InputMode == "M"
+        ) {
+          data.map(item => {
+            let cur = tools.dataForKey(item, head.Path);
+            if (cur) {
+              param.data.criterias.push({
+                id: item.RoomID,
+                code: head.InfoPointCode
+              });
+            }
+          });
+        }
+      });
+      if (param.data.criterias.length) {
+        BeatchQueryParam(param, res => {
+          this.main = data.map(item => {
+            res.Content.map(child => {
+              if (item.RoomID == child.id) {
+                if (child.data || child.data == 0) {
+                  this.headers.map(head => {
+                    if (head.InfoPointCode == child.code) {
+                      tools.setDataForKey(item, head.Path, child.data);
+                    }
+                  });
+                } else {
+                  this.headers.map(head => {
+                    if (head.InfoPointCode == child.code) {
+                      tools.setDataForKey(
+                        item,
+                        head.Path,
+                        child.error ? "表号功能号格式错误" : "表号功能号不存在"
+                      );
+                    }
+                  });
+                }
+              }
+            });
+            return item;
+          });
+          this.hot.loadData(this.main);
+        });
+      }
+    },
     /**
      * 表头文案处理函数
      * @param list header数组数据

+ 5 - 1
src/components/business_space/dialogs/addDialog/businessDialog.vue

@@ -68,6 +68,7 @@
 import myCascader from "@/components/business_space/lib/cascaders/assets";
 // import hansonTable from "@/components/business_space/dialogHanson/addDevice";
 import { getSpaceHeader } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 import tools from "@/utils/tools";
 import qrcode from "@/components/business_space/lib/qrcode";
 import firm from "@/components/business_space/dialogs/list/firm";
@@ -118,6 +119,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       width: "30%",
@@ -216,7 +220,7 @@ export default {
       this.main = table(10)
       getSpaceHeader({
         code: "space",
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {

+ 4 - 2
src/components/business_space/dialogs/detailsDialog.vue

@@ -156,8 +156,10 @@
                             data: [{RoomID: this.list.id}]
                         }
                         deleteZone(param, res => {
-                            this.$message({ type: "success",  message: "删除成功!" })
-                            this.$emit("del")
+                            if (res.Result == 'success') {
+                                this.$message({ type: "success",  message: "删除成功!" })
+                                this.$emit("del")
+                            }
                         })
                     })
                     .catch(() => {

+ 4 - 1
src/components/business_space/dialogs/list/guaranteeDialog.vue

@@ -84,6 +84,9 @@ export default {
       default: 0
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -130,7 +133,7 @@ export default {
         data: {
           venderId: this.id,
           insuranceNo: this.formData.name,
-          projectId: this.$route.query.projId,
+          projectId: this.projectId,
           contractFile: this.keysArr[0]
         }
       }

+ 5 - 2
src/components/business_space/dialogs/list/insurerDialog.vue

@@ -52,6 +52,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -69,6 +70,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -79,8 +83,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 2
src/components/business_space/dialogs/list/maintainerDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
+import { mapGetters } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 1
src/components/business_space/dialogs/list/paramDetails.vue

@@ -13,6 +13,7 @@
 <script>
 
 import { getSpaceHeader } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex"
 
 export default {
   props: {
@@ -32,6 +33,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       labelArr: []
@@ -42,7 +46,7 @@ export default {
   methods: {
     getData() {
       let param = {
-        ProjId: this.$route.query.projId,
+        ProjId: this.projectId,
         code: this.data.eqFamily
       }
       getSpaceHeader(param).then(res => {

+ 5 - 2
src/components/business_space/dialogs/list/supplierDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 7 - 3
src/components/business_space/dialogs/list/supplyDialog.vue

@@ -49,6 +49,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getListForSupplier } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -70,6 +71,9 @@ export default {
       default: 0
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -126,11 +130,11 @@ export default {
       if (!!this.id) {
         let param = {
           data: {
-            projectId: this.$route.query.projId,
+            projectId: this.projectId,
             venderId: this.id
           },
-          ProjId: this.$route.query.projId,
-          secret: this.$route.query.secret,
+          ProjId: this.projectId,
+          secret: this.secret,
         }
         getListForSupplier(param, res => {
           _this.$refs.ruleForm.resetFields()

+ 10 - 6
src/components/business_space/dialogs/list/systemType.vue

@@ -79,6 +79,7 @@
 </template>
 <script>
 import myPagination from "@/components/common/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getLib, getAllbusiness, getEqCode, getRelation } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -112,6 +113,9 @@ export default {
       type: [Array]
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -202,8 +206,8 @@ export default {
 
     getData() {
       let param = param = {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret,
+        ProjId: this.projectId,
+        secret: this.secret,
         data: {
           criteria: {
             type: ["Sy"]
@@ -232,8 +236,8 @@ export default {
     //查询id对应系统
     getRelation(table) {
       getRelation({
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret,
+        ProjId: this.projectId,
+        secret: this.secret,
         criterias: {
           criteria: {
             "to_id": this.infos,
@@ -277,9 +281,9 @@ export default {
       this.iframeSrc =
         process.env.BASE_URL +
         ":8889/#/details?perjectId=" +
-        this.$route.query.projId +
+        this.projectId +
         "&secret=" +
-        this.$route.query.secret +
+        this.secret +
         "&FmId=" +
         infos.id +
         "&type=1&code=" +

+ 9 - 6
src/components/business_space/graphy/business.vue

@@ -540,8 +540,9 @@
                             this.$message.error(res.data.ResultMsg);
                         }
                     })
-                    .catch(() => {
-                        this.$message.error("请求出错");
+                    .catch((err) => {
+                        console.log(err)
+                        // this.$message.error("请求出错");
                     });
             },
             //创建实例
@@ -889,8 +890,9 @@
                             this.$message.error(res.data.ResultMsg);
                         }
                     })
-                    .catch(() => {
-                        this.$message.error("请求出错");
+                    .catch((err) => {
+                        console.log(err)
+                        // this.$message.error("请求出错");
                     });
             },
             getPathToCanvas(id) {
@@ -1232,8 +1234,9 @@
                             this.loading.errorNum++;
                         }
                     })
-                    .catch(() => {
-                        this.$message.error("请求出错");
+                    .catch((err) => {
+                        console.log(err)
+                        // this.$message.error("请求出错");
                         this.loading.errorNum++;
                     });
             },

+ 6 - 2
src/components/business_space/lib/floorCascader.vue

@@ -15,6 +15,7 @@
 <script>
 
 import { getSpaceFloor } from '@/api/request'
+import { mapGetters, mapActions } from "vuex";
 
 export default {
   props: {
@@ -27,13 +28,16 @@ export default {
       default: "yes"
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       options: [
       ],
       param: {
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       },
       value: ['all']
     };

+ 3 - 2
src/components/business_space/table/businessTable.vue

@@ -145,8 +145,9 @@ export default {
             this.$message.error(res.data.ResultMsg);
           }
         })
-        .catch(() => {
-          this.$message.error("请求出错");
+        .catch((err) => {
+          console.log(err)
+          // this.$message.error("请求出错");
         });
     },
     /**

+ 6 - 2
src/components/data_admin/buildFamily.vue

@@ -76,6 +76,7 @@
 
 <script>
 import buildInput from "@/components/input";
+import { mapGetters, mapActions } from "vuex";
 import {
   getAllFamily, //获取所有设备族
   getTableHeader, //点击时后去右侧的数据
@@ -88,6 +89,9 @@ export default {
   components: {
     "build-input": buildInput
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       value: "property",
@@ -112,8 +116,8 @@ export default {
       ajaxMsg: "",
       code: '',
       letterArr: [], //出现的a-z字符
-      UserId: this.$route.query.userId, //用户id
-      ProjId: this.$route.query.projId, //项目id
+      UserId: this.userId, //用户id
+      ProjId: this.projectId, //项目id
       labelKey: [], // 右侧主体数据承接数组
       searchArr: [], // 搜索后的数据
       searchVal: "", //搜索内容

+ 5 - 1
src/components/dialogHanson/addDevice.vue

@@ -16,6 +16,7 @@
 </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";
@@ -38,6 +39,9 @@ export default {
     guaranteeDialog,
     uploadFilesDialog,
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     let table = function (num) {
       let main = []
@@ -85,7 +89,7 @@ export default {
     getData() {
       getSpaceHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {

+ 5 - 1
src/components/dialogs/addDialog/businessDialog.vue

@@ -68,6 +68,7 @@
 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";
@@ -118,6 +119,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       width: "30%",
@@ -216,7 +220,7 @@ export default {
       this.main = table(10)
       getSpaceHeader({
         code: "space",
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {

+ 3 - 6
src/components/dialogs/addDialog/dialogAssets.vue

@@ -97,10 +97,7 @@ import text from "@/utils/handsontable/mainText"
 import showTools from "@/utils/handsontable/notShow"
 
 import uuid from "@/utils/uuid";
-import {
-    mapGetters,
-    mapActions
-} from "vuex";
+import { mapGetters, mapActions } from "vuex";
 import { getTableHeader, createProperty, getSpaceFloor, createAssetsList } from "@/api/scan/request";
 let table = function (num) {
   let main = []
@@ -303,7 +300,7 @@ export default {
       this.main = table(1)
       getTableHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {
@@ -367,7 +364,7 @@ export default {
           one.FamilyName = this.deviceType.facility
           one.Infos = item.infos
           one.FmId = "Pe" + uuid(32, 16)
-          one.ProjId = this.$route.query.projId
+          one.ProjId = this.projectId
           one.FmName = item.infos.EquipLocalName || ""
           one.X = 0
           one.Y = 0

+ 3 - 3
src/components/dialogs/addDialog/dialogSystem.vue

@@ -266,7 +266,7 @@ export default {
       this.main = table(1)
       getTableHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {
@@ -328,8 +328,8 @@ export default {
     async createJson(data) {
       let param = {
         data: { criterias: data },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       }
       console.log(param)
       this.createPost(param)

+ 8 - 4
src/components/dialogs/detailsDialog.vue

@@ -54,6 +54,7 @@ Vue.use(DropdownMenu)
 Vue.use(DropdownItem)
 
 import { delManySpace } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 import equipTable from "@/components/table/equipTable";
 import addEquip from "@/components/table/addEquip";
 
@@ -88,6 +89,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       step: 1,
@@ -110,8 +114,8 @@ export default {
       this.$nextTick(() => {
         this.$refs.myEquip.getData(list, this.activeTabType);
       });
-      let perjectId = this.$route.query.projId,
-        secret = this.$route.query.secret;
+      let perjectId = this.projectId,
+        secret = this.secret;
       this.iframeSrc =
         process.env.BASE_URL +
         ":8889/#/details?perjectId=" +
@@ -150,8 +154,8 @@ export default {
       })
         .then(() => {
           let param = {
-            ProjId: this.$route.query.projId,
-            secret: this.$route.query.secret,
+            ProjId: this.projectId,
+            secret: this.secret,
             data: {
               criteria: {
                 ids: [this.list.id]

+ 6 - 2
src/components/dialogs/facilityDialog.vue

@@ -40,6 +40,7 @@ Vue.use(DropdownMenu)
 Vue.use(DropdownItem)
 import equipTable from "@/components/table/equipTable";
 import addEquip from "@/components/table/addEquip";
+import { mapGetters, mapActions } from "vuex";
 
 export default {
   components: {
@@ -72,6 +73,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       step: 1,
@@ -80,8 +84,8 @@ export default {
       activeName: "1",
       myDia: {
         id: 'Sp11010800034c251365d66111e8bf0a15b159c8e729',
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       },
       buildMess: {},
     };

+ 8 - 4
src/components/dialogs/influenceDialog.vue

@@ -23,6 +23,7 @@
 </template>
 <script>
 import { getAllMess, deleteNotice } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
 export default {
   props: {
     width: {
@@ -44,6 +45,9 @@ export default {
       default: []
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       data: null,
@@ -70,8 +74,8 @@ export default {
         data: {
           ids: ids
         },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       };
       deleteNotice(param)
         .then(res => {
@@ -91,8 +95,8 @@ export default {
     },
     getAllMess() {
       getAllMess({
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       })
         .then(res => {
           if (res.data.Result == "success") {

+ 1 - 1
src/components/dialogs/list/guaranteeDialog.vue

@@ -133,7 +133,7 @@ export default {
         data: {
           venderId: this.id,
           insuranceNo: this.formData.name,
-          projectId: this.$route.query.projId,
+          projectId: this.projectId,
           contractFile: this.keysArr[0]
         }
       }

+ 5 - 2
src/components/dialogs/list/insurerDialog.vue

@@ -52,6 +52,7 @@
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
 import { getLib } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex";
 import tools from "@/utils/scan/tools"
 
 export default {
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 2
src/components/dialogs/list/maintainerDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
+import { mapGetters, mapActions } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -68,6 +69,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       search: "", //搜索文案
@@ -78,8 +82,7 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
   created() {

+ 5 - 1
src/components/dialogs/list/paramDetails.vue

@@ -13,6 +13,7 @@
 <script>
 
 import { getSpaceHeader } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex";
 
 export default {
   props: {
@@ -32,6 +33,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       labelArr: []
@@ -42,7 +46,7 @@ export default {
   methods: {
     getData() {
       let param = {
-        ProjId: this.$route.query.projId,
+        ProjId: this.projectId,
         code: this.data.eqFamily
       }
       getSpaceHeader(param).then(res => {

+ 5 - 2
src/components/dialogs/list/supplierDialog.vue

@@ -51,6 +51,7 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
+import { mapGetters } from "vuex";
 import { getLib } from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 
@@ -78,10 +79,12 @@ export default {
         sizes: [10, 30, 50, 100, 150, 200],
         total: 0,
         currentPage: 1
-      },
-      projectId: this.$route.query.projId,
+      }
     };
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   created() {
     // this.getData()
   },

+ 4 - 6
src/components/dialogs/list/systemType.vue

@@ -28,9 +28,7 @@
           <el-table-column label="本地编码" header-align='center'>
             <template slot-scope="scope">{{scope.row.SysLocalID || '--'}}</template>
           </el-table-column>
-          <el-table-column label="专业" header-align='center'>
-            <template slot-scope="scope">{{scope.row.MajorName}}</template>
-          </el-table-column>
+          <el-table-column label="专业" prop="MajorName" header-align='center'></el-table-column>
           <el-table-column label="详情" header-align='center' width="100" align="center">
             <template slot-scope="scope">
               <el-button @click="lookDeatils(scope.row)" type="text">详情</el-button>
@@ -177,9 +175,9 @@ export default {
       this.iframeSrc =
         process.env.BASE_URL +
         ":8889/#/details?perjectId=" +
-        this.$route.query.projId +
+        this.projectId +
         "&secret=" +
-        this.$route.query.secret +
+        this.secret +
         "&FmId=" +
         infos.id +
         "&type=1&code=" +
@@ -228,7 +226,7 @@ export default {
   watch: {
     dialog: {
       deep: true,
-      handler: function () {
+      handler () {
         if (this.dialog.systemType) {
           this.getData()
           this.getTableData()

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

@@ -158,6 +158,9 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+  },
   data() {
     return {
       width: "30%",
@@ -351,7 +354,7 @@ export default {
       this.main = table(1)
       getTableHeader({
         code: this.deviceType.code,
-        ProjId: this.$route.query.projId
+        ProjId: this.projectId
       }).then(res => {
         this.headers = res.data.Content;
         if (!!this.hot) {
@@ -448,8 +451,8 @@ export default {
       console.log(param, data)
       let pushParam = {
         data: { criterias: [] },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
+        ProjId: this.projectId,
+        secret: this.secret
       }
       let list = []
       data.map((item, index) => {

+ 20 - 17
src/components/ledger/handsontables/assets.vue

@@ -49,7 +49,7 @@
     <!-- 新增资产 -->
     <el-dialog class="add-assets" :title="showAddByDie?'未关联资产的设备批量创建资产':'确定新增资产类型'" @close="showAddByDie = false" :visible.sync="myDialog.addDevice" width="670px">
       <el-row>
-        <my-cascader v-show="!showAddByDie" ref="cascader" @change="changeCader"></my-cascader>
+        <my-cascader v-show="!showAddByDie" ref="cascader" :all="true" @change="changeCader"></my-cascader>
         <die-cascader v-show="showAddByDie" ref="dieCascader" :Family="addData.Family" @change="changeDevice"></die-cascader>
         <floor-cascader v-show="showAddByDie" @change="changeFloor"></floor-cascader>
         <div class="die-text" v-show="showAddByDie">当前筛选条件下有<span class="die-num">{{dieNum}}</span>个设备可批量创建资产。</div>
@@ -328,7 +328,7 @@ export default {
       this.myDialog.addDevice = true
       if (this.mess.deviceId) {
         this.$nextTick(() => {
-          this.$refs.cascader.setValue([this.mess.deviceId])
+          this.$refs.cascader.setValue(this.mess.deviceId)
           this.addData.Family = this.mess.deviceId
           this.numParams.Family = this.mess.deviceId
         })
@@ -401,9 +401,11 @@ export default {
     },
     //选择设备类型-添加资产
     changeCader(val) {
-      this.addData.Family = val.code
-      this.addData.name = val.facility
-      this.numParams.Family = val.code
+      if(val.code && val.facility){
+        this.addData.Family = val.code
+        this.addData.name = val.facility
+        this.numParams.Family = val.code
+      }
     },
     //选择设备或部件
     changeDevice(val) {
@@ -600,7 +602,7 @@ export default {
     async removeDevice(param) {
       await deleteProperty(param, res => {
         this.$message.success("删除成功")
-        this.$emit('close','')
+        this.$emit('getJson','')
         this.getTableData()
       })
     },
@@ -609,20 +611,24 @@ export default {
       let param = {
         Content: [],
         Projection: []
-      }
+      }, keyList = []
       //生成要修改字段列表
       change.map(item => {
-        if (item[1] && param.Projection.indexOf(item[1]) == -1) {
-          if (item[1].split(".")[0] == "flowBuild") {
-            param.Projection.push("BuildingId","FloorId")
-          } else {
-            param.Projection.push(item[1].split(".")[0])
-          }
+        let key = item[1].split(".")[0]
+        if (key == "flowBuild" && keyList.indexOf(key) == -1) {
+          keyList.push("BuildingId","FloorId")
+          param.Projection.push("BuildingId","FloorId")
+        }
+        if (item[1] && keyList.indexOf(key) == -1) {
+          keyList.push(key)
+        }
+        if (item[1] && item[3] == "" && param.Projection.indexOf(key) == -1) {
+          param.Projection.push(key)
         }
       })
       //生成对应修改数据
       data.map((item, index) => {
-        param.Projection.map(value => {
+        keyList.map(value => {
           if (value == "BuildingId") {
             let itemData = tools.dataForKey(item, "flowBuild")
             if (itemData == "") {
@@ -643,11 +649,9 @@ export default {
             let itemData = tools.dataForKey(item, value)
             tools.setDataForKey(item, value, itemData == "" ? null : itemData)
           }
-          
         });
         param.Content.push(item)
       })
-      param.Projection = []
       updateProperty(param, res => { })
     },
     //修改资产类型
@@ -795,7 +799,6 @@ export default {
     },
     //获取被筛选掉的行号
     trimmedRows() {
-      debugger
       var plugin = this.hot.getPlugin("trimRows").trimmedRows;
       let dataLength = this.tableData.length;
       let dataArr = new Array();

+ 10 - 7
src/components/ledger/handsontables/device.vue

@@ -13,7 +13,7 @@
       <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>
+      <!-- <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button> -->
       <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>
@@ -348,7 +348,7 @@ export default {
       this.myDialog.addDevice = true
       if (this.mess.deviceId) {
         this.$nextTick(() => {
-          this.$refs.cascader.setValue([this.mess.deviceId])
+          this.$refs.cascader.setValue(this.mess.deviceId)
         })
       }
     },
@@ -551,22 +551,25 @@ export default {
       let param = {
         Content: [],
         Projection: []
-      };
+      }, keyList = [];
       //生成要修改字段列表
       change.map(item => {
-        if (item[1] && param.Projection.indexOf(item[1]) == -1 && item[1] != 'PropertyId') {
-          param.Projection.push(item[1].split(".")[0]);
+        let key = item[1].split(".")[0]
+        if (item[1] && keyList.indexOf(key) == -1 && item[1] != 'PropertyId') {
+          keyList.push(key);
+        }
+        if (item[1] && item[3] == "" && param.Projection.indexOf(key) == -1 && item[1] != 'PropertyId') {
+          param.Projection.push(key);
         }
       });
       //生成对应修改数据
       data.map((item, index) => {
-        param.Projection.map(value => {
+        keyList.map(value => {
           let itemData = tools.dataForKey(item, value);
           tools.setDataForKey(item, value, itemData == "" ? null : itemData);
         });
         param.Content.push(item);
       });
-      param.Projection = []
       updateEquip(param, res => { });
     },
     //修改设备类型

+ 57 - 44
src/components/ledger/handsontables/system.vue

@@ -90,8 +90,8 @@ export default {
     ...mapGetters("layout", ["projectId", "secret", "userId"]),
     showTypes() {
       return this.onlyRead ?
-        [{ value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }] :
-        [{ value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }, { value: "partInfo", label: '隐藏信息点' }]
+        [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
+        [{ value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }]
     }
   },
   data() {
@@ -224,7 +224,7 @@ export default {
       this.myDialog.addDevice = true
       if (this.mess.deviceId) {
         this.$nextTick(() => {
-          this.$refs.cascader.setValue([this.mess.deviceId])
+          this.$refs.cascader.setValue(this.mess.deviceId)
         })
       }
     },
@@ -281,47 +281,57 @@ export default {
           criterias: []
         }
       }
-      if (!!data && data.length) {
-        //一级遍历list
-        data.map(item => {
-          if (!!item.infos) {
-            //二级遍历对象infos
-            for (let key in item.infos) {
-              //判断是否是设定参数和动态参数
-              if (!!item.infos[key]) {
-                this.tableHeader.map(child => {
-                  //如果一级标签为动态参数或者设定参数放入数据等待请求
-                  if (key == child.InfoPointCode && (child.InputMode == "L" || child.InputMode == "L1" || child.InputMode == "L2" || child.InputMode == "M")) {
-                    param.data.criterias.push({
-                      id: item.id,
-                      code: key
-                    })
-                  }
-                })
-              }
+      //一级遍历list
+      this.tableHeader.map(head => {
+        //如果一级标签为动态参数或者设定参数放入数据等待请求
+        if (
+          head.InputMode == "L" ||
+          head.InputMode == "L1" ||
+          head.InputMode == "L2" ||
+          head.InputMode == "M"
+        ) {
+          data.map(item => {
+            let cur = tools.dataForKey(item, head.Path);
+            if (cur) {
+              param.data.criterias.push({
+                id: item.SysID,
+                code: head.InfoPointCode
+              });
             }
+          });
+        }
+      })
+      if (param.data.criterias.length) {
+        BeatchQueryParam(param, res => {
+          if (!this.onlyRead) {
+            return false
           }
-        })
-        if (param.data.criterias.length) {
-          BeatchQueryParam(param, res => {
-            if (!this.onlyRead) {
-              return false
-            }
-            this.tableData = data.map(item => {
-              res.Content.map(child => {
-                if (item.id == child.id) {
-                  if (!!child.data || child.data == 0) {
-                    item.infos[child.code] = child.data
-                  } else {
-                    item.infos[child.code] = child.error ? "表号功能号格式错误" : "表号功能号不存在"
-                  }
+          this.tableData = data.map(item => {
+            res.Content.map(child => {
+              if (item.SysID == child.id) {
+                if (!!child.data || child.data == 0) {
+                  this.tableHeader.map(head => {
+                    if (head.InfoPointCode == child.code) {
+                      tools.setDataForKey(item, head.Path, child.data);
+                    }
+                  });
+                } else {
+                  this.tableHeader.map(head => {
+                    if (head.InfoPointCode == child.code) {
+                      tools.setDataForKey(
+                        item,
+                        head.Path,
+                        child.error ? "表号功能号格式错误" : "表号功能号不存在"
+                      );
+                    }
+                  });
                 }
-              })
-              return item
+              }
             })
-            this.hot.loadData(this.tableData)
+            return item
           })
-        }
+          this.hot.loadData(this.tableData)
+        })
       }
     },
     //初始化插件
@@ -451,22 +461,25 @@ export default {
       let param = {
         Content: [],
         Projection: []
-      };
+      }, keyList = [];
        //生成要修改字段列表
       change.map(item => {
-        if (item[1] && param.Projection.indexOf(item[1]) == -1) {
-          param.Projection.push(item[1].split(".")[0]);
+        let key = item[1].split(".")[0]
+        if (item[1] && keyList.indexOf(key) == -1) {
+          keyList.push(key);
+        }
+        if (item[1] && item[3] == "" && param.Projection.indexOf(key) == -1) {
+          param.Projection.push(key);
         }
       });
       //生成对应修改数据
       data.map((item, index) => {
-        param.Projection.map(value => {
+        keyList.map(value => {
           let itemData = tools.dataForKey(item, value);
           tools.setDataForKey(item, value, itemData == "" ? null : itemData);
         });
         param.Content.push(item);
       });
-      param.Projection = []
       updateGeneralSys(param, res => { });
     },
     //获取到了正确的信息

+ 62 - 28
src/components/ledger/lib/assets.vue

@@ -1,7 +1,10 @@
 <template>
   <div id="cascaderMap">
     <span class="buildFloor" style="padding-right: 12px;">设备族</span>
-    <el-cascader
+    <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
+      <el-option  v-for="item in options" :key="item.code" :label="item.facility" :value="item.code"></el-option>
+    </el-select>
+    <!-- <el-cascader
       placeholder="请选择"
       :options="options"
       v-model="value"
@@ -11,24 +14,28 @@
       size="small"
       @change="changeVal"
       change-on-select
-    ></el-cascader>
+    ></el-cascader> -->
   </div>
 </template>
 <script>
 import {mapGetters} from 'vuex';
-import { getEquipBelongs } from "@/api/scan/request";
+import { getEquipBelongs, queryProperty } from "@/api/scan/request";
 export default {
   name: "getCode",
   props: {
     isWidth: {
       type: Boolean,
       default: true
+    },
+    all: {
+      type: Boolean,
+      default: false,
     }
   },
-      computed: {
-        ...mapGetters("layout", [
-            "projectId",
-        ])
+  computed: {
+    ...mapGetters("layout", [
+        "projectId",
+    ])
   },
   data() {
     return {
@@ -65,30 +72,63 @@ export default {
       this.value = val
       this.$emit("change", value)
     },
-    async getData() {
-      let params = {
+    getData() {
+      let param1 = {
         data:{
           Distinct: true,
           PageNumber: 1,
           PageSize: 500,
           Projection:["Family","FamilyName"]
         }
+      }, param2 = {
+        Distinct: true,
+        PageNumber: 1,
+        PageSize: 500,
+        Projection: [
+          "Family"
+        ]
       }
-      await getEquipBelongs(params, res => {
-        this.options = this.changeArr(res.Content)
-        if (!!this.value && this.value.length) {
-          let value = {}
-          this.options.map(item => {
-            if (item.code == this.value[0]) {
-              value = item
-            }
-          })
-          this.$emit("change", value)
+      let promise1 = new Promise((resolve, reject) => {
+        getEquipBelongs(param1, res => {
+          resolve(res)
+        })
+      })
+      let promise2 = new Promise((resolve, reject) => {
+        queryProperty(param2, res => {
+          resolve(res)
+        })
+      })
+      Promise.all([promise1,promise2]).then((res) => {
+        let allData = res[0], data = res[1]
+        this.options = this.changeArr(allData.Content)
+        if (this.value) {
+          this.changeVal(this.value)
         }
-        if (!this.falg) {
-          this.changeList()
+        if(!this.all) {
+          this.content = data.Content.map(item => {
+            return item.Family
+          });
+          this.changeList();
+          if (this.value) {
+            this.changeVal(this.value)
+          }
         }
       })
+      // getEquipBelongs(params, res => {
+      //   this.options = this.changeArr(res.Content)
+      //   if (!!this.value && this.value.length) {
+      //     let value = {}
+      //     this.options.map(item => {
+      //       if (item.code == this.value[0]) {
+      //         value = item
+      //       }
+      //     })
+      //     this.$emit("change", value)
+      //   }
+      //   if (!this.falg) {
+      //     this.changeList()
+      //   }
+      // })
     },
     changeArr(arr) {
       let data = [];
@@ -108,15 +148,9 @@ export default {
     },
     changeList() {
       this.options = this.options.filter(item => {
-        if (this.content.find(value => value.Family == item.code)) {
+        if (this.content.indexOf(item.code) > -1) {
           return item
         }
-        // item.disabled = true
-        // this.content.map(child => {
-        //   if (item.code == child) {
-        //     item.disabled = false
-        //   }
-        // })
       })
     }
   }

+ 7 - 4
src/components/ledger/lib/cascader.vue

@@ -1,8 +1,11 @@
 <template>
   <div id="cascaderMap">
     <span class="buildFloor" style="margin-right: 12px;">设备类别</span>
-    <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
-      @change="changeVal" change-on-select></el-cascader>
+    <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
+      <el-option  v-for="item in options" :key="item.code" :label="item.facility" :value="item.code"></el-option>
+    </el-select>
+    <!-- <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
+      @change="changeVal" change-on-select></el-cascader> -->
   </div>
 </template>
 <script>
@@ -25,7 +28,7 @@ export default {
   },
   data() {
     return {
-      value: [""],
+      value: "",
       options: [],
       props: {
         value: "code",
@@ -40,7 +43,7 @@ export default {
   },
   watch: {
     projectId() {
-      this.value = [''];
+      this.value = '';
       this.getData();
     }
   },

+ 7 - 2
src/components/ledger/lib/floorCascader.vue

@@ -102,7 +102,7 @@
                         label: "全部"
                     }, {
                         value: "noKnow",
-                        label: "未明确建筑的设备"
+                        label: "未明确建筑"
                     })
                     data.forEach(build => {
                         floorData.forEach(floor => {
@@ -120,7 +120,7 @@
                                         label: "全部"
                                     },{
                                         value: 'noKnow',
-                                        label: "未明确楼层的设备"
+                                        label: "未明确楼层"
                                     },{
                                         value: floor.FloorID,
                                         label: floor.FloorLocalName,
@@ -140,6 +140,11 @@
         }
     };
 </script>
+<style lang="less">
+    .el-cascader .el-input .el-input__inner {
+        vertical-align: bottom;
+    }
+</style>
 <style lang="less" scoped>
     #buildFloor {
         margin-left: 10px;

+ 9 - 6
src/components/ledger/lib/partsDieList.vue

@@ -1,8 +1,11 @@
 <template>
   <div id="cascaderMap">
     <span class="buildFloor" style="margin-right: 12px;">设备类</span>
-    <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
-      @change="changeVal" change-on-select></el-cascader>
+    <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
+      <el-option  v-for="item in options" :key="item.code" :label="item.facility" :value="item.code"></el-option>
+    </el-select>
+    <!-- <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
+      @change="changeVal" change-on-select></el-cascader> -->
   </div>
 </template>
 <script>
@@ -25,7 +28,7 @@ export default {
   },
   data() {
     return {
-      value: [""],
+      value: "",
       options: [],
       props: {
         value: "code",
@@ -42,7 +45,7 @@ export default {
   },
   watch: {
     projectId() {
-      this.value = [''];
+      this.value = '';
       this.getAllData()
     }
     // Family: {
@@ -56,7 +59,7 @@ export default {
   },
   methods: {
     setValue(val) {
-      if (val && val.length) {
+      if (val) {
         this.value = val
       }
     },
@@ -84,7 +87,7 @@ export default {
       queryPartsDie(param, res => {
         this.content = res.Content
         this.filterForOptions()
-        let val = this.options.length?[this.options[0].code]:[""]
+        let val = this.options.length?this.options[0].code:""
         this.changeVal(val)
       })
     },

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

@@ -1,8 +1,11 @@
 <template>
   <div id="cascaderMap">
     <span class="buildFloor" style="padding-right: 12px;">所属专业系统类型</span>
-    <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
-      @change="changeVal" change-on-select></el-cascader>
+    <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
+      <el-option  v-for="item in options" :key="item.Category" :label="item.CategoryName" :value="item.Category"></el-option>
+    </el-select>
+    <!-- <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
+      @change="changeVal" change-on-select></el-cascader> -->
   </div>
 </template>
 <script>
@@ -43,7 +46,7 @@ export default {
   },
   watch: {
     projectId() {
-      this.value = ['']
+      this.value = ''
     }
   },
   methods: {

+ 19 - 16
src/components/ledger/tableTransfers.vue

@@ -30,7 +30,7 @@
               <template slot-scope="scope">{{ scope.row.InstallLocation || "--" }}</template>
             </el-table-column>
           </el-table>
-          <div class="right">
+          <div class="right" style="overflow:hidden;">
             <my-pagination @change="changePages1" :page="pages1"></my-pagination>
           </div>
         </div>
@@ -75,7 +75,8 @@ import {
   getEquipNotInSys,
   getEquipInSys,
   getEquipBelongs,
-  sysLinkEquip
+  sysLinkEquip,
+  sysUnlinkEquip
 } from "@/api/scan/request"
 import {
   mapGetters,
@@ -187,10 +188,12 @@ export default {
       this.getRightData()
     },
     //pages1改变
-    changePages1() {
+    changePages1(page) {
+      this.pages1.PageNumber = page
       this.getLeftData()
     },
-    changePages2() {
+    changePages2(page) {
+      this.pages2.PageNumber = page
       this.getRightData()
     },
     //修改设备类型
@@ -211,7 +214,7 @@ export default {
         sysId: this.id
       }
       if (this.search1 != '') {
-        param.data.Filters = `EquipLocalName contain "${this.search1}";`
+        param.data.Filters = `EquipLocalName contain '${this.search1}' || EquipName contain '${this.search1}';`
       }
       //建筑id
       if (this.buildingId == "noKnow") {
@@ -246,11 +249,11 @@ export default {
       let param = {
         Filters: `sysId='${this.id}'`,
         Orders: "EquipID desc",
-        PageNumber: this.pages1.currentPage,
-        PageSize: this.pages1.size
+        PageNumber: this.pages2.currentPage,
+        PageSize: this.pages2.size
       }
       if (this.search2 != '') {
-        param.Filters += `;EquipLocalName contain "${this.search2}"`
+        param.Filters += `;EquipLocalName contain '${this.search2}' || EquipName contain '${this.search2}'`
       }
       getEquipInSys(param, res => {
         this.table2Data = res.Content
@@ -268,7 +271,7 @@ export default {
     },
     //关联
     leftToRight() {
-      let relationList = this.multipleSelection.concat(this.table2Data)
+      let relationList = this.multipleSelection
       relationList = relationList.map(t => {
         return t.EquipID || t.EquipId
       })
@@ -276,16 +279,16 @@ export default {
     },
     //取消关联
     rightToLeft() {
-      let relationList = [];
       let tempIDs = this.SelectionList.map(t => {
-        return t.EquipId
-      })
-      this.table2Data.map(t => {
-        if (tempIDs.indexOf(t.EquipId) < 0) {
-          relationList.push(t.EquipId)
+        return {
+          EquipID: t.EquipId,
+          SysID: t.SysID
         }
       })
-      this.relationChange(relationList)
+      sysUnlinkEquip(tempIDs, res => {
+        this.$message.success('修改关联关系成功')
+        this.getAllTable()
+      })
     },
     //更新设备 系统关系
     relationChange(arr) {

+ 1 - 1
src/components/model/file/modelLog.vue

@@ -7,7 +7,7 @@
           <el-tab-pane label="上传日志" name="first">
             <el-table :data="filterlogData" stripe height="300px" style="width: 100%">
               <el-table-column prop="Version" label="版本"></el-table-column>
-              <el-table-column prop="CreateTime" label="上传时间"></el-table-column>
+              <el-table-column prop="AcceptTime" label="上传时间"></el-table-column>
               <el-table-column prop="UserName" label="上传人"></el-table-column>
               <el-table-column prop="address" label="操作">
                 <template slot-scope="scope">

+ 209 - 0
src/data/mapTable.js

@@ -0,0 +1,209 @@
+export const State = {
+  '-5': '已撕码',
+  '-4': '现场未找到',
+  '-3': '现场已找到-隐蔽工程未贴码',
+  '-2': '现场已找到-距离太远未贴码',
+  '-1': '现场已找到-只验证未贴码',
+  '0': '现场已找到-正常贴码',
+  '1': '待现场验证',
+  '2': '撕码任务',
+  '3': '换码任务'
+}
+
+export const Family = {
+  "AHA": "空气源热泵",
+  "CLA": "吊顶",
+  "WGA": "风力发电装置",
+  "HEA": "换热器",
+  "WBA": "防水板",
+  "MAA": "手动报警按钮",
+  "SBA": "气体灭火启动瓶",
+  "CDA": "水加药装置",
+  "PAA": "燃气调压箱",
+  "SEA": "火灾探测器",
+  "DPA": "位移传感器",
+  "WTB": "水箱",
+  "SDB": "防火排烟阀",
+  "TCA": "伴热电缆",
+  "CRA": "门禁读卡器",
+  "ESA": "扶梯",
+  "OHA": "室外消火栓",
+  "TLC": "坐便器",
+  "DGA": "柴油发电机",
+  "SUA": "供水机组",
+  "CPB": "控制面板",
+  "HSA": "高压开关柜",
+  "FTA": "泡沫储罐组",
+  "TUA": "全程水处理仪",
+  "VDB": "图像传感器",
+  "SAA": "分体空调",
+  "AHB": "空调机组",
+  "DSB": "显示屏",
+  "APA": "空气净化器",
+  "FCB": "变频器",
+  "TUC": "直饮水处理机组",
+  "PNA": "嵌板",
+  "PSB": "巡更棒",
+  "IBA": "伴热保温器",
+  "TPA": "温度传感器",
+  "SKA": "洗碗槽",
+  "SPE": "蹲便器",
+  "EHA": "电热水器",
+  "STA": "自助终端机",
+  "PSD": "停车位",
+  "EXA": "交换机",
+  "WSA": "盥洗盆",
+  "EEA": "电度传感器",
+  "VMA": "监视器",
+  "FLA": "流量传感器",
+  "AAA": "抗浮锚杆",
+  "VDA": "真空脱气机",
+  "SDA": "软化水装置",
+  "ARA": "扶手",
+  "STC": "化粪池",
+  "CBB": "组合式传感器",
+  "OTA": "冷却塔",
+  "RCA": "雨水收集设备",
+  "SUB": "喷灌机组",
+  "ELB": "应急照明灯具",
+  "CBA": "燃煤锅炉",
+  "BGA": "气体灭火瓶组",
+  "SNA": "喷头",
+  "HDB": "干手机",
+  "CMA": "摄像头",
+  "ELA": "直梯",
+  "APB": "油烟净化器",
+  "HDA": "加湿器",
+  "CPA": "充电桩",
+  "PVA": "预作用报警阀组",
+  "AVA": "调节阀",
+  "BPA": "母线插接箱",
+  "DOA": "除味装置",
+  "FEB": "广播前端设备",
+  "PLB": "桩",
+  "CTC": "帘",
+  "STB": "蓄冷热槽",
+  "FCA": "风机盘管",
+  "IHA": "即时加热器",
+  "IUA": "室内机",
+  "PPA": "水泵",
+  "HFA": "硬件防火墙",
+  "XXX": "其他",
+  "TFA": "变压器",
+  "FNA": "风机",
+  "GHB": "燃气热水器",
+  "RVA": "减压阀",
+  "LSB": "漏电探测器",
+  "GLA": "车位引导灯",
+  "IOA": "风口",
+  "CPC": "集水坑",
+  "MFA": "消声器",
+  "CPE": "组件",
+  "GBA": "燃气锅炉",
+  "SDC": "声音传感器",
+  "SPC": "扬声器",
+  "KLA": "龙骨",
+  "CFA": "定压补水装置",
+  "MPA": "机械车位",
+  "EBA": "电锅炉",
+  "SNB": "气体灭火喷头",
+  "LPA": "液化石油气瓶",
+  "FHA": "地板采暖设备",
+  "CUA": "控制箱",
+  "BPC": "地埋管",
+  "OSA": "隔油池",
+  "DSA": "直流屏",
+  "OUA": "室外机",
+  "PFA": "人流量传感器",
+  "TSA": "水箱消毒器",
+  "FGA": "速通门",
+  "HBA": "消火栓箱",
+  "FUA": "新风机组",
+  "ALA": "声光报警器",
+  "CCA": "离心式冷水机组",
+  "WVA": "湿式报警阀组",
+  "HTB": "热量传感器",
+  "CVA": "燃气切断阀",
+  "SED": "强电线路",
+  "GHA": "地源热泵",
+  "CTA": "浓度传感器",
+  "FBA": "燃油锅炉",
+  "PDA": "车位检测器",
+  "EDA": "电梯基坑",
+  "SPD": "速度传感器",
+  "RSA": "中继台",
+  "DVA": "干式报警阀组",
+  "HAA": "辅热设备",
+  "RTA": "路由器",
+  "WEA": "弱电线路",
+  "MTA": "电机",
+  "DRA": "硬盘录像机",
+  "SEC": "入侵报警探测器",
+  "SPB": "潜污泵",
+  "LPB": "联动琴台",
+  "EIA": "疏散指示灯牌",
+  "WMA": "消防水炮设备",
+  "SPA": "太阳能电池板",
+  "PTA": "压力罐",
+  "ATA": "信号放大天线",
+  "PCA": "水泵接合器",
+  "DCA": "分集水器",
+  "CFC": "泳池循环过滤机组",
+  "SEB": "燃气探测器",
+  "RHA": "湿度传感器",
+  "HTA": "主机",
+  "ETA": "末端试水装置",
+  "ECA": "灭火剂容器",
+  "GTA": "进出闸机",
+  "WTA": "对讲机",
+  "ILA": "保温层",
+  "APC": "无线AP点位",
+  "GSA": "气体管道",
+  "IPA": "综合保护装置",
+  "GDA": "梁",
+  "PLA": "播放器",
+  "RDA": "散热器",
+  "ETB": "电梯曳引机",
+  "ORA": "餐饮除油成套设备",
+  "RLA": "继电器",
+  "EPA": "预埋件",
+  "ACA": "吸收式冷水机组",
+  "TLB": "电话",
+  "FAA": "地板空调器",
+  "LTA": "灯具",
+  "FRA": "防火卷帘门",
+  "FEA": "前端设备",
+  "SCA": "螺杆式冷水机组",
+  "PSC": "压力传感器",
+  "USA": "紫外线消毒器",
+  "BFA": "生物质炊暖炉",
+  "TLA": "工具",
+  "LUA": "污废水一体式提升机组",
+  "CPD": "巡更通讯座",
+  "ACB": "热风幕",
+  "FEC": "灭火器",
+  "SVA": "安全阀",
+  "LSA": "低压开关柜",
+  "PCB": "静压箱",
+  "CAA": "定风量箱",
+  "OVA": "通断阀",
+  "VRA": "变频多联机",
+  "ACC": "空压机",
+  "BPB": "备用电源",
+  "WHA": "水源热泵",
+  "CVB": "止回阀",
+  "FDA": "滤毒除湿机",
+  "LQA": "液体管道",
+  "BDA": "主体",
+  "RWA": "坡道",
+  "DWA": "低压配电抽屉",
+  "CSA": "垫层",
+  "CTB": "涂层",
+  "URA": "小便器",
+  "VAA": "变风量箱",
+  "SCB": "太阳能集热器",
+  "PSA": "稳压设备",
+  "TUB": "中水处理机组",
+  "BTA": "浴缸",
+  "CFB": "水景循环过滤机组"
+}

+ 6 - 3
src/framework/layout/PageHeader.vue

@@ -66,9 +66,12 @@ export default {
         }
     },
     created() {
-        let localProjectId = localStorage.getItem('projectId')
-        if(this.projects.some((item) => {return item.id == localProjectId})) {
-            this.selectedProjectId = localProjectId
+        let cacheInfo = JSON.parse(localStorage.getItem('_sagacloud_admin_store_cacheInfo'))?JSON.parse(localStorage.getItem('_sagacloud_admin_store_cacheInfo')):{}
+        if(cacheInfo[this.userInfo.username] && 
+            cacheInfo[this.userInfo.username].projectId && 
+            this.projects.some((item) => {return item.id == cacheInfo[this.userInfo.username].projectId})
+        ){
+            this.selectedProjectId = cacheInfo[this.userInfo.username].projectId
         } else {
             this.selectedProjectId = this.projectId
         }

+ 30 - 0
src/framework/layout/layout-store.js

@@ -63,8 +63,16 @@ export default {
             storage.set(KEY_MENU_SELECTED, val)
         },
         setprojectId: (state, val) => {
+            let cacheInfo = JSON.parse(localStorage.getItem('_sagacloud_admin_store_cacheInfo'))?JSON.parse(localStorage.getItem('_sagacloud_admin_store_cacheInfo')):{}
             state.projectId = val
             localStorage.setItem('projectId', val)
+            if(cacheInfo[state.userInfo.username]){
+                cacheInfo[state.userInfo.username].projectId = val
+                localStorage.setItem('_sagacloud_admin_store_cacheInfo', JSON.stringify(cacheInfo))
+            } else {
+                cacheInfo[state.userInfo.username] = {projectId: val}
+                localStorage.setItem('_sagacloud_admin_store_cacheInfo', JSON.stringify(cacheInfo))
+            }
             storage.set(KEY_PROJECT_SELECTED, val)
             state.projects.map((item) =>{
                 if(item.id == val) {
@@ -79,6 +87,28 @@ export default {
             return new Promise((resolve, reject) => {
                 frameworkApi.loadUserInfo().then(resp => {
                     console.log(resp)
+                    // if (resp.result == 'success') {
+                    //     state.userInfo = { username: resp.username }
+                    //     storage.set('user_name', resp.username)
+                    //     state.permissions = {}
+                    //     if (resp.permissions) {
+                    //         resp.permissions.forEach(p => (state.permissions[p] = true))
+                    //     }
+                    //     state.projects = []
+                    //     if (resp.projects) {
+                    //         if(resp.projects[0] && resp.projects[0].projId) {
+                    //             state.projectId = resp.projects[0].projId
+                    //             state.secret = resp.projects[0].secret?resp.projects[0].secret:""
+                    //         }
+                    //         resp.projects.forEach(proj =>
+                    //             state.projects.push({
+                    //                 id: proj.projId,
+                    //                 name: proj.projLocalName,
+                    //                 pwd: proj.secret?proj.secret:""
+                    //             })
+                    //         )
+                    //     }
+                    // } else {
                     if (resp.Result == 'success') {
                         state.userInfo = { username: resp.Username }
                         state.permissions = {}

+ 4 - 2
src/router/system.js

@@ -95,7 +95,8 @@ export default [
         name: 'LayoutMain',
         component: LayoutMain,
         children: [
-            { path: 'buildfloor', name: 'buildFloor', component: buildFloor, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
+            // { path: 'buildfloor', name: 'buildFloor', component: buildFloor, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
+            { path: 'buildfloor', name: 'buildFloor', component: Dasboard, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理' }] } },
             { path: 'collectsetting', name: 'collectsetting', component: collectsetting, meta: { keepAlive: false, breadcrumbs: [{ label: '需采集的信息点' }] } },
             { path: 'appuser', name: 'buildUser', component: buildUser, meta: { keepAlive: false, breadcrumbs: [{ label: '扫楼App用户管理' }] } },
             { path: 'buildfloor/repetitionGraphy', name: 'repetitionGraphy', component: repetitionGraphy, meta: { keepAlive: false, breadcrumbs: [{ label: '建筑楼层管理', path: '/ready/buildfloor' }, { label:'平面图维护' }] }}
@@ -111,7 +112,8 @@ export default [
             {
                 path: 'file',
                 name: 'modelFile',
-                component: modelFile,
+                component: Dasboard,
+                // component: modelFile,
                 meta: { keepAlive: false, breadcrumbs: [{ label: '模型管理', path: '/model/file' }, { label: '模型文件管理' }] }
             },
             {

+ 103 - 0
src/utils/JOSNToExcel.js

@@ -0,0 +1,103 @@
+import { saveAs } from 'file-saver'
+import XLSX from 'xlsx'
+
+const jsontoExcel = {
+  downloadExl: function (header, data, fileName) {
+    // var keys = Object.keys(data[0]);
+    let copyData = JSON.parse(JSON.stringify(data))
+    let firstRow = {};
+    let keys = header.map((item) => {
+      this.setDataForKey(firstRow, item.fieldName, item.headerName);
+      return item.fieldName
+    });
+    // header.forEach(function (item) {
+    //   firstRow[item] = item;
+    // });
+    copyData.unshift(firstRow);
+
+    let content = {};
+
+    // 把json格式的数据转为excel的行列形式
+    let sheetsData = copyData.map((item, rowIndex) => {
+      return keys.map((key, columnIndex) => {
+        return Object.assign({}, {
+          value: this.dataForKey(item, key),
+          // value: item[key],
+          position: (columnIndex > 25 ? this.getCharCol(columnIndex) : String.fromCharCode(65 + columnIndex)) + (rowIndex + 1),
+        });
+      });
+    }).reduce(function (prev, next) {
+      return prev.concat(next);
+    });
+
+    sheetsData.forEach((item) => {
+      content[item.position] = {
+        v: item.value
+      };
+    });
+
+    //设置区域,比如表格从A1到D10,SheetNames:标题,
+    let coordinate = Object.keys(content);
+    let workBook = {
+      SheetNames: ["Sheet1"],
+      Sheets: {
+        "Sheet1": Object.assign({}, content, { "!ref": coordinate[0] + ":" + coordinate[coordinate.length - 1] }),
+      }
+    };
+    //这里的数据是用来定义导出的格式类型
+    var excelData = XLSX.write(workBook, { bookType: "xlsx", bookSST: false, type: "binary" });
+    var blob = new Blob([this.string2ArrayBuffer(excelData)], { type: "" });
+    saveAs(blob, `${fileName}.xlsx`);
+  },
+  //字符串转字符流
+  string2ArrayBuffer: function (s) {
+    var buf = new ArrayBuffer(s.length);
+    var view = new Uint8Array(buf);
+    for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
+    return buf;
+  },
+  // 将指定的自然数转换为26进制表示。映射关系:[0-25] -> [A-Z]。
+  getCharCol: function (n) {
+    let s = "",
+      m = 0
+    while (n > 0) {
+      m = n % 26 + 1
+      s = String.fromCharCode(m + 64) + s
+      n = (n - m) / 26
+    }
+    return s
+  },
+  //根据key值去对象中取对应的值
+  dataForKey: function (data, key) {
+    let arr = key.split(".")
+    if (arr && arr[0]) {
+      for (let i = 0; i < arr.length; i++) {
+        if (arr[i] && data[arr[i]]) {
+          data = data[arr[i]]
+        } else {
+          return ''
+        }
+      }
+      return data
+    }
+  },
+  //根据key值去设置对象的值
+  setDataForKey: function (data, key, value) {
+    let arr = key.split(".")
+    if (arr && arr[0]) {
+      for (let i = 0; i < arr.length; i++) {
+        if (!(arr[i] && data[arr[i]])) {
+            data[arr[i]] = {}
+        }
+        if (value !== undefined) {
+            if (i == arr.length - 1) {
+                data[arr[i]] = value
+            }
+        }
+        data = data[arr[i]]
+      }
+    }
+  }
+}
+
+export default jsontoExcel

+ 11 - 4
src/utils/handsontable/buildFloorData.js

@@ -68,10 +68,17 @@ const buildFloor = {
       data.forEach(item => {
         if (item.children && item.children.length) {
           item.children.forEach(child => {
-            buildFloorData.push({
-              Code: item.value + "-" + child.value,
-              Name: item.label + "-" + child.label
-            })
+            if (child.value != "") {
+              buildFloorData.push({
+                Code: item.value + "-" + child.value,
+                Name: item.label + "-" + child.label
+              })
+            } else {
+              buildFloorData.push({
+                Code: item.value,
+                Name: item.label + "-" + child.label
+              })
+            }
           })
         } else {
           buildFloorData.push({

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

@@ -103,7 +103,7 @@ export default {
   }
 }
 .el-dialog__body{
-  max-height: 400px;
+  max-height: 600px;
   overflow-y: auto;
 }
 </style>

+ 11 - 9
src/views/ledger/cenotelist/index.vue

@@ -169,16 +169,20 @@ export default {
       let param = {
         Content: [],
         Projection: []
-      };
-      //生成要修改字段列表
-      change.map((item) => {
-        if(item[1] && param.Projection.indexOf(item[1]) == -1) {
-          param.Projection.push(item[1])
+      }, keyList = [];
+       //生成要修改字段列表
+      change.map(item => {
+        let key = item[1].split(".")[0]
+        if (item[1] && keyList.indexOf(key) == -1) {
+          keyList.push(key);
         }
-      })
+        if (item[1] && item[3] == "" && param.Projection.indexOf(key) == -1) {
+          param.Projection.push(key);
+        }
+      });
       //生成对应修改数据
       data.map((item, index) => {
-        param.Projection.map(value => {
+        keyList.map(value => {
           let itemData = tools.dataForKey(item, value)
           tools.setDataForKey(item, value, itemData == "" ? null : itemData)
         })
@@ -190,8 +194,6 @@ export default {
         // }
         param.Content.push(item);
       })
-      param.Projection = []
-
       await updataCenoteTableData(param, (res) => {
         
       })

+ 5 - 5
src/views/ledger/facility/index.vue

@@ -79,7 +79,7 @@ export default {
     let deviceId = this.$route.params.deviceId;
     if (deviceId) {
       this.$nextTick(() => {
-        this.$refs.cascader.changeVal([deviceId])
+        this.$refs.cascader.changeVal(deviceId)
       })
     }
   },
@@ -102,7 +102,7 @@ export default {
     close(val) {
       this.getCount()
       if (val && this.$refs.cascader){
-        this.$refs.cascader.changeVal([val.code])
+        this.$refs.cascader.changeVal(val.code)
       }
         this.$refs.cascader.getData()
       //   this.$refs.tableMain.getHeaderData(this.param);
@@ -163,9 +163,9 @@ export default {
 
     //修改设备族
     changeDevice(value) {
-      this.param.deviceId = value.code
-      this.param.name = value.facility
-      if (!!value) {
+      if (value.code && value.facility) {
+        this.param.deviceId = value.code
+        this.param.name = value.facility
         if (this.$refs.tableMain)
           this.$refs.tableMain.getHeaderData(this.param);
       }

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

@@ -241,16 +241,20 @@ export default {
           Content: [],
           Projection: []
         }
-      };
+      }, keyList = [];
       //生成要修改字段列表
-      change.map(item => {
-        if (item[1] && param.data.Projection.indexOf(item[1]) == -1) {
-          param.data.Projection.push(item[1].split(".")[0]);
+      change.map((item) => {
+        let key = item[1].split(".")[0]
+        if(item[1] && keyList.indexOf(key) == -1) {
+          keyList.push(key)
         }
-      });
+        if(item[1] && item[3] == "" && param.data.Projection.indexOf(key) == -1) {
+          param.data.Projection.push(key)
+        }
+      })
       //生成对应修改数据
       data.map((item, index) => {
-        param.data.Projection.map(value => {
+        keyList.map(value => {
           let itemData = tools.dataForKey(item, value);
           tools.setDataForKey(item, value, itemData == "" ? null : itemData);
         });

+ 20 - 4
src/views/ledger/property/addpropertys.vue

@@ -17,9 +17,9 @@
           <el-table-column label="设备本地编码" show-overflow-tooltip>
             <template slot-scope="scope">{{ scope.row.EquipLocalID?scope.row.EquipLocalID:scope.row.EquipID }}</template>
           </el-table-column>
-          <el-table-column prop="Category" label="设备类型" show-overflow-tooltip width="200"></el-table-column>
-          <el-table-column prop="BuildingId" label="所属建筑"></el-table-column>
-          <el-table-column prop="FloorId" label="所属楼层"></el-table-column>
+          <el-table-column prop="EquipCategory.EquipName" label="设备类型" show-overflow-tooltip width="200"></el-table-column>
+          <el-table-column prop="Building.BuildLocalName" label="所属建筑"></el-table-column>
+          <el-table-column prop="Floor.FloorLocalName" label="所属楼层"></el-table-column>
           <el-table-column prop="address" label="操作" width="100">
             <template slot-scope="scope">
               <el-button @click.native.prevent="handleOpenDetail(scope.row, tableData)" type="text" size="small">详情</el-button>
@@ -78,7 +78,7 @@ export default {
   },
   mounted() {
     if (this.params.category) {
-      this.$refs.dieCascader.setValue([this.params.category])
+      this.$refs.dieCascader.setValue(this.params.category)
     }
     if (this.params.buildId && this.params.floorId) {
       this.$refs.floorCascader.setValue([this.params.buildId,this.params.floorId])
@@ -106,6 +106,7 @@ export default {
       } else {
         this.params.category = ''
       }
+      this.page.pageNumber = 1
       this.getTableData()
     },
     //选择建筑楼层
@@ -118,6 +119,7 @@ export default {
       } else {
         this.params.floorId = ''
       }
+      this.page.pageNumber = 1
       this.getTableData()
     },
     //获取表格数据
@@ -133,6 +135,20 @@ export default {
     //格式化条件
     formatFilter() {
       let param = {
+        Cascade: [
+          {
+            Name: "equipCategory",
+            Projection: ["EquipCode", "EquipName"]
+          },
+          {
+            Name: "building",
+            Projection: [ "BuildLocalName", "BuildName", "BuildID" ]
+          },
+          {
+            Name: "floor",
+            Projection: [ "FloorLocalName", "FloorName", "FloorID" ]
+          }
+        ],
         Filters: `category='${this.params.category}';PropertyId isNull`,
         Orders: "createTime desc, EquipID asc",
         PageNumber: this.page.pageNumber,

+ 7 - 35
src/views/ledger/property/index.vue

@@ -17,10 +17,7 @@ import floorCascader from "@/components/ledger/lib/floorCascader";
 import myCascader from "@/components/ledger/lib/assets";
 import hansonTable from "@/components/ledger/handsontables/assets";
 import tableTransfers from "@/components/ledger/tableTransfers";
-import {
-    mapGetters,
-    mapActions
-} from "vuex";
+import { mapGetters, mapActions } from "vuex";
 import { countProperty, queryProperty } from "@/api/scan/request"
 import "./../index.scss"
 export default {
@@ -32,13 +29,8 @@ export default {
     tableTransfers
   },
   computed: {
-        ...mapGetters("layout", [
-            "projectId",
-            "projects",
-            "secret",
-            "userId"
-        ])
-    },
+    ...mapGetters("layout", [ "projectId", "projects", "secret", "userId" ])
+  },
   data() {
     return {
       mess: {
@@ -72,7 +64,7 @@ export default {
     let Family = this.$route.params.Family
     if (Family) {
       this.$nextTick(() => {
-        this.$refs.cascader.changeVal([Family])
+        this.$refs.cascader.changeVal(Family)
       })
     }
   },
@@ -91,21 +83,6 @@ export default {
         this.mess.perjectName = item.name
       })
     },
-    getFamilyList() {
-      let param = {
-        Distinct: true,
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "Family"
-        ]
-      }
-      queryProperty(param, res => {
-        if (this.$refs.cascader) {
-              this.$refs.cascader.pushData(res.Content)
-          }
-      })
-    },
     //获取header的list
     getNumber() {
       countProperty({}, res => {
@@ -113,7 +90,6 @@ export default {
       })
       countProperty({"Filters": "not EquipmentId isNull"}, res => {
         this.mess.name[1].num = res.Count
-        this.getFamilyList()
       })
     },
     //修改楼层
@@ -136,8 +112,7 @@ export default {
 
     //新建资产后进行刷新
     change(val) {
-      console.log(val)
-      this.$refs.cascader.setValue([val.code])
+      this.$refs.cascader.setValue(val.code)
       this.param.deviceId = val.code
       this.getNumber()
       if (!!this.param.deviceId) {
@@ -148,13 +123,10 @@ export default {
 
     //修改设备族
     changeDevice(value) {
-      console.log(value)
-      this.param.deviceId = value.code
-      if (!!value) {
+      if (value.code && value.facility) {
+        this.param.deviceId = value.code
         if(this.$refs.tableMain)
         this.$refs.tableMain.getHeaderData(this.param);
-      } else {
-        return;
       }
     }
   }

+ 11 - 9
src/views/ledger/rentlist/index.vue

@@ -185,16 +185,20 @@ export default {
       let param = {
         Content: [],
         Projection: []
-      }
-      //生成要修改字段列表
-      change.map((item) => {
-        if(item[1] && param.Projection.indexOf(item[1]) == -1) {
-          param.Projection.push(item[1])
+      }, keyList = [];
+       //生成要修改字段列表
+      change.map(item => {
+        let key = item[1].split(".")[0]
+        if (item[1] && keyList.indexOf(key) == -1) {
+          keyList.push(key);
         }
-      })
+        if (item[1] && item[3] == "" && param.Projection.indexOf(key) == -1) {
+          param.Projection.push(key);
+        }
+      });
       //生成对应修改数据
       data.map((item, index) => {
-        param.Projection.map(value => {
+        keyList.map(value => {
           let itemData = tools.dataForKey(item, value)
           tools.setDataForKey(item, value, itemData == "" ? null : itemData)
         })
@@ -206,8 +210,6 @@ export default {
         // }
         param.Content.push(item);
       });
-
-      param.Projection = []
       await updataRentTableData(param, (res) => {
         
       })

+ 286 - 27
src/views/ledger/report/index.vue

@@ -1,36 +1,295 @@
 <template>
-    <div>
-      <das-board>
-        <template v-slot:plan>
-          <span>{{plan?plan:"yyyy-mm-dd"}}</span>
-        </template>
-        <template v-slot:finish>
-          <span>{{finish?finish:"yyyy-mm-dd"}}</span>
-        </template>
-        <template v-slot:onLine>
-          <span>{{onLine?onLine:"yyyy-mm-dd"}}</span>
-        </template>
-        <template v-slot:explain>
-          <span>{{explain?explain:"yyyy-mm-dd"}}</span>
-        </template>
-      </das-board>
-    </div>
+  <div>
+    <el-row style="margin-top: 30px;">
+      <span>请选择要导出的数据:</span>
+      <el-select v-model="value" placeholder="请选择">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
+      </el-select>
+      <el-button @click="handleClickDownload" type="primary" :loading="loading" style="margin-left: 15px;">导出Excel</el-button>
+    </el-row>
+    <div style="text-align:center;font-size:25px;margin-top:20%;">当前页面中的为临时功能,完整版正在设计中……</div>
+  </div>
 </template>
 
 <script>
-import dasBoard from "@/views/dasboard/index";
+import jsontoExcel from "@/utils/JOSNToExcel"
+import { State, Family } from "@/data/mapTable"
+import { queryEquip, queryProperty } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex"
+
 export default {
-    components: {
-      dasBoard
+  data() {
+    return {
+      loading: false,
+      value: '',
+      dataList: [],
+      options: [{
+        value: 'header1',
+        label: '已建立关联的设备资产'
+      }, {
+        value: 'header2',
+        label: '未关联资产的设备'
+      }, {
+        value: 'header3',
+        label: '未关联设备的资产'
+      }],
+      header1: [{
+        fieldName: "Building.BuildLocalName",
+        headerName: "建筑"
+      }, {
+        fieldName: "Floor.FloorLocalName",
+        headerName: "楼层"
+      }, {
+        fieldName: "EquipCategory.EquipName",
+        headerName: "设备类"
+      }, {
+        fieldName: "EquipLocalName",
+        headerName: "设备本地名称"
+      }, {
+        fieldName: "EquipLocalID",
+        headerName: "设备本地编码"
+      }, {
+        fieldName: "EquipID",
+        headerName: "设备id"
+      }, {
+        fieldName: "BIMID",
+        headerName: "设备BIMID"
+      }, {
+        fieldName: "Property.EquipFamilyList.0.FamilyName",
+        headerName: "资产设备族"
+      }, {
+        fieldName: "Property.EquipLocalName",
+        headerName: "资产本地名称"
+      }, {
+        fieldName: "Property.EquipLocalID",
+        headerName: "资产本地编码"
+      }, {
+        fieldName: "Property.EquipID",
+        headerName: "资产id"
+      }, {
+        fieldName: "Property.CreateTime",
+        headerName: "资产创建时间"
+      }, {
+        fieldName: "Property.CodeType",
+        headerName: "资产现场验证状态"
+      }],
+      header2: [{
+        fieldName: "Building.BuildLocalName",
+        headerName: "建筑"
+      }, {
+        fieldName: "Floor.FloorLocalName",
+        headerName: "楼层"
+      }, {
+        fieldName: "EquipCategory.EquipName",
+        headerName: "设备类"
+      }, {
+        fieldName: "EquipLocalName",
+        headerName: "设备本地名称"
+      }, {
+        fieldName: "EquipLocalID",
+        headerName: "设备本地编码"
+      }, {
+        fieldName: "EquipID",
+        headerName: "设备id"
+      }, {
+        fieldName: "BIMID",
+        headerName: "设备BIMID"
+      }, {
+        fieldName: "Property.EquipFamilyList.0.FamilyName",
+        headerName: "资产设备族"
+      }, {
+        fieldName: "Property.EquipLocalName",
+        headerName: "资产本地名称"
+      }, {
+        fieldName: "Property.EquipLocalID",
+        headerName: "资产本地编码"
+      }, {
+        fieldName: "Property.EquipID",
+        headerName: "资产id"
+      }, {
+        fieldName: "Property.CreateTime",
+        headerName: "资产创建时间"
+      }, {
+        fieldName: "Property.CodeType",
+        headerName: "资产现场验证状态"
+      }],
+      header3: [{
+        fieldName: "Building.BuildLocalName",
+        headerName: "建筑"
+      }, {
+        fieldName: "Floor.FloorLocalName",
+        headerName: "楼层"
+      }, {
+        fieldName: "Equipment.EquipCategory.EquipName",
+        headerName: "设备类"
+      }, {
+        fieldName: "Equipment.EquipLocalName",
+        headerName: "设备本地名称"
+      }, {
+        fieldName: "Equipment.EquipLocalID",
+        headerName: "设备本地编码"
+      }, {
+        fieldName: "Equipment.EquipID",
+        headerName: "设备id"
+      }, {
+        fieldName: "Equipment.BIMID",
+        headerName: "设备BIMID"
+      }, {
+        fieldName: "EquipFamilyList.0.FamilyName",
+        headerName: "资产设备族"
+      }, {
+        fieldName: "EquipLocalName",
+        headerName: "资产本地名称"
+      }, {
+        fieldName: "EquipLocalID",
+        headerName: "资产本地编码"
+      }, {
+        fieldName: "EquipID",
+        headerName: "资产id"
+      }, {
+        fieldName: "CreateTime",
+        headerName: "资产创建时间"
+      }, {
+        fieldName: "CodeType",
+        headerName: "资产现场验证状态"
+      }
+      ]
+    }
+  },
+  methods: {
+    handleClickDownload() {
+      this.loading = true
+      this.dataList = []
+      if (this.value == 'header1') {
+        this.getheader1Data()
+      } else if (this.value == 'header2') {
+        this.getheader2Data()
+      } else if (this.value == 'header3') {
+        this.getheader3Data()
+      }
+    },
+    getheader1Data(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Cascade: [
+          {
+            Name: "equipCategory",
+            Projection: ["EquipCode", "EquipName"]
+          },
+          {
+            Name: "property",
+            Cascade: [
+              {
+                Name: "equipFamilyList",
+                Projection: [ "Family", "FamilyName" ]
+              }
+            ],
+            Projection: ["Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType", "CreateTime"]
+          },
+          {
+            Name: "building",
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
+          },
+          {
+            Name: "floor",
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
+          }
+        ],
+        Filters: " not propertyId isnull ",
+        Orders: "CreateTime desc, EquipID asc",
+        PageNumber: pageNum,
+        PageSize: 1000,
+        Projection: ["CreateTime", "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID"]
+      }
+      queryEquip(params, res => {
+        this.dataList = this.dataList.concat(res.Content.map((item) => {
+          item.Property.CodeType = State[item.Property.CodeType]
+          // item.Property.Family = Family[item.Property.Family]
+          return item
+        }))
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getheader1Data(res.PageNumber + 1)
+        } else {
+          let time = +new Date()
+          this.loading = false
+          jsontoExcel.downloadExl(this.header1, this.dataList, `已建立关联的资产设备-${time}`)
+        }
+      })
     },
-    data() {
-        return {
-          plan: "2019-10-30",
-          finish: "2019-10-30",
-          onLine: "2019-10-30",
-          explain: "照岗位和资产数据统计报告"
+    getheader2Data(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Cascade: [
+          {
+            Name: "equipCategory",
+            Projection: ["EquipCode", "EquipName"]
+          },
+          {
+            Name: "building",
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
+          },
+          {
+            Name: "floor",
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
+          }
+        ],
+        Filters: " propertyId isnull ",
+        Orders: "CreateTime desc, EquipID asc",
+        PageNumber: pageNum,
+        PageSize: 1000,
+        Projection: ["CreateTime", "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID"]
+      }
+      queryEquip(params, res => {
+        this.dataList = this.dataList.concat(res.Content)
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getheader2Data(res.PageNumber + 1)
+        } else {
+          let time = +new Date()
+          this.loading = false
+          jsontoExcel.downloadExl(this.header2, this.dataList, `未关联资产的设备-${time}`)
         }
+      })
     },
-    mounted() {}
+    getheader3Data(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Cascade: [
+          {
+            Name: "equipFamilyList",
+            Projection: [ "Family", "FamilyName" ]
+          },
+          {
+            Name: "building",
+            Projection: [ "BuildLocalName", "BuildName", "BuildID" ]
+          },
+          {
+            Name: "floor",
+            Projection: [ "FloorLocalName", "FloorName", "FloorID" ]
+          }
+        ],
+        Filters: " EquipmentId isnull ",
+        Orders: "CreateTime desc, EquipID asc",
+        PageNumber: pageNum,
+        PageSize: 1000,
+        Projection: [ "BuildingId", "FloorId", "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CreateTime", "CodeType" ]
+      }
+      queryProperty(params, res => {
+        this.dataList = this.dataList.concat(res.Content.map((item) => {
+          item.CodeType = State[item.CodeType]
+          return item
+        }))
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getheader3Data(res.PageNumber + 1)
+        } else {
+          let time = +new Date()
+          this.loading = false
+          jsontoExcel.downloadExl(this.header3, this.dataList, `未关联设备的资产-${time}`)
+        }
+      })
+    }
+  }
 }
-</script>
+</script>
+
+<style scoped>
+</style>

+ 2 - 2
src/views/ledger/system/index.vue

@@ -68,7 +68,7 @@ export default {
     let deviceId = this.$route.params.deviceId;
     if (deviceId) {
       this.$nextTick(() => {
-        this.$refs.cascader.changeVal([deviceId])
+        this.$refs.cascader.changeVal(deviceId)
       })
     }
   },
@@ -84,7 +84,7 @@ export default {
       this.countGeneralSys()
       if (!!val && !!val.Category) {
         if (this.$refs.cascader)
-          this.$refs.cascader.changeVal([val.Category])
+          this.$refs.cascader.changeVal(val.Category)
       }
       this.$refs.cascader.getData()
     },

+ 17 - 11
src/views/point/dynamicdata/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="dynamicdata">
     <!-- tab分页 -->
-    <el-row class="top-tab">
+    <el-row class="top-tab" v-show="typeList.length">
       <el-tabs v-model="curType" type='card'>
         <el-tab-pane v-for="(item) in typeList" :key="item.Name" :label="item.Name+'('+item.Sum+'/'+item.Rcount+')'" :name="item.Name">
         </el-tab-pane>
@@ -26,16 +26,18 @@
         </el-tooltip>
       </div>
     </el-row>
-    <!-- 设备 -->
-    <equipRules v-if="curType=='设备'" ref="equip" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></equipRules>
-    <!-- 部件 -->
-    <partsRules v-else-if="curType=='部件'" ref="parts" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></partsRules>
-    <!-- 系统 -->
-    <systemRules v-else-if="curType=='系统'" ref="system" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></systemRules>
-    <!-- 空间 -->
-    <spaceRules v-else-if="curType=='空间'" ref="space" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></spaceRules>
-    <!-- 开发中 -->
-    <div v-else>开发中</div>
+    <div v-show="typeList.length" style="height: 100%;">
+      <!-- 设备 -->
+      <equipRules v-if="curType=='设备'" ref="equip" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></equipRules>
+      <!-- 部件 -->
+      <partsRules v-else-if="curType=='部件'" ref="parts" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></partsRules>
+      <!-- 系统 -->
+      <systemRules v-else-if="curType=='系统'" ref="system" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></systemRules>
+      <!-- 空间 -->
+      <spaceRules v-else-if="curType=='空间'" ref="space" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></spaceRules>
+      <!-- 开发中 -->
+      <div v-else>开发中</div>
+    </div>
     <!-- 应用规则弹窗 -->
     <apply-rules-dialog ref="apply" @refresh="getExecuteFeedback" @cancel="cancelApply" @clash="getClash"></apply-rules-dialog>
     <!-- 冲突日志 -->
@@ -68,6 +70,10 @@
         <el-button size="small" type="primary" @click="apply">确认</el-button>
       </span>
     </el-dialog>
+    <div v-if="!typeList.length" class="center" style="margin-top: 260px;">
+      <i class="icon-wushuju iconfont"></i>
+      暂无数据
+    </div>
   </div>
 </template>
 <script>

+ 2 - 1
src/views/system/auth/index.vue

@@ -20,7 +20,8 @@ export default {
         console.log(this.$store.state.ssoToken)         
         this.$store.dispatch('layout/loadUserInfo').then(resp => {
             console.log('store dispatch result ', resp)
-            if (resp.Result == 'success') {
+            // if (resp.result  == 'success') {
+            if (resp.Result  == 'success') {
                 let lastRoute = this.$store.getters['lastRoute']
                 console.log('last route ', lastRoute)
                 if (lastRoute) {

BIN
static/favicon.ico