Browse Source

联调建筑楼层

zhangyu 4 years ago
parent
commit
bff7e19ba1
4 changed files with 37 additions and 17 deletions
  1. 5 0
      src/api/datacenter.ts
  2. 7 0
      src/store/modules/user.ts
  3. 20 16
      src/views/manage/build/index.vue
  4. 5 1
      vue.config.js

+ 5 - 0
src/api/datacenter.ts

@@ -9,6 +9,11 @@ export function buildingQuery(postParams: any): any {
     return httputils.postJson(`${baseApi}/object/building/query`, postParams);
 }
 
+// 查询建筑信息
+export function floorQuery(postParams: any): any {
+    return httputils.postJson(`${baseApi}/object/floor/query`, postParams);
+}
+
 // 字典查询
 export function dictCategoryQuery(postParams: any): any {
     return httputils.postJson(`${baseApi}/dict/category`, postParams);

+ 7 - 0
src/store/modules/user.ts

@@ -14,6 +14,7 @@ export interface IUserState {
     name: string;
     username: string;
     userId: string;
+    group: string;
     projectId: string;
     projects: any[];
     avatar: string;
@@ -27,6 +28,7 @@ class User extends VuexModule implements IUserState {
     public name = "";
     public username = "yanruolan";
     public userId = "06328a53c69a41bb8f5bb1a552c6e8d6";
+    public group = "";// 集团
     public projectId = "Pj4403070003";// 深圳龙岗万达广场
     public projects: any[] = [];// 用户项目列表
     public avatar = "";
@@ -44,6 +46,11 @@ class User extends VuexModule implements IUserState {
     }
 
     @Mutation
+    private SET_GROUP(group: string) {
+        this.group = group;
+    }
+
+    @Mutation
     private SET_PROJECTID(projectId: string) {
         this.projectId = projectId;
     }

+ 20 - 16
src/views/manage/build/index.vue

@@ -23,7 +23,7 @@
                             <el-scrollbar style="height: 100%">
                                 <li
                                     @click="openFolder(index, item)"
-                                    v-for="(item, index) in navigationModel"
+                                    v-for="(item, index) in navigationBuild"
                                     :key="index"
                                     :class="[choiceIndex === index + 1 ? 'li-active' : '']"
                                 >
@@ -32,7 +32,7 @@
                                         width="40"
                                         height="40"
                                     ></i>
-                                    <span :title="item.Name">{{ item.Name }}</span>
+                                    <span :title="item.localName">{{ item.localName }}</span>
                                 </li>
                             </el-scrollbar>
                         </ul>
@@ -114,6 +114,7 @@
 import { Vue, Component, Watch } from "vue-property-decorator";
 import { UserModule } from "@/store/modules/user";
 import { queryFloorList, queryModel } from "@/api/modelapi";
+import { buildingQuery, floorQuery } from "@/api/datacenter";
 import Bus from "@/utils/bus";
 import FloorTable from "./components/FloorTable/index.vue"; //右侧list表
 import AddFloorDialog from "./components/AddFloorDialog/index.vue"; //新增楼层弹窗
@@ -134,7 +135,7 @@ export default class extends Vue {
     private modelLogVisible = false; // 是否显示模型日志弹窗
     private changeFolderNameVisible = false; // 是否显示编辑文件夹弹窗
 
-    private navigationModel: any[] = []; // 文件夹模型list
+    private navigationBuild: any[] = []; // 文件夹模型list
     private choiceIndex = 0; // 当前文件夹index
     private currentFolderId = ""; // 当前选择的文件夹id
     private currentFolderName = ""; // 当前选择文件夹的Name
@@ -160,8 +161,8 @@ export default class extends Vue {
      */
     private openFolder(index: number, item: any): void {
         this.choiceIndex = index + 1;
-        this.currentFolderId = item.Id;
-        this.currentFolderName = item.Name;
+        this.currentFolderId = item.id;
+        this.currentFolderName = item.localName;
         // 获取模型文件夹对应得楼层文件
         this.queryFloorFile(this.currentFolderId);
     }
@@ -191,16 +192,17 @@ export default class extends Vue {
      * 查询所有文件夹模型
      */
     private async queryModel(): Promise<void> {
-        this.navigationModel = [];
+        this.navigationBuild = [];
         this.loading = true;
-        const res = await queryModel({ Orders: "Name asc" });
-        this.navigationModel = res.Content;
+        const res = await buildingQuery({ Orders: "Name asc" });
+        // const res = await queryModel({ Orders: "Name asc" });
+        this.navigationBuild = res.content;
         this.loading = false;
-        if (this.navigationModel.length) {
+        if (this.navigationBuild.length) {
             //默认选择第一个文件夹
             this.choiceIndex = 1;
-            this.currentFolderName = this.navigationModel[0].Name;
-            this.currentFolderId = this.navigationModel[0].Id;
+            this.currentFolderName = this.navigationBuild[0].localName;
+            this.currentFolderId = this.navigationBuild[0].id;
             this.queryFloorFile(this.currentFolderId);
         } else {
             this.tableData = [];
@@ -225,12 +227,14 @@ export default class extends Vue {
             this.tableData = [];
             this.tableLoading = true;
             let params = {
-                Filters: `FolderId='${currentFolderId}'`,
-                PageNumber: 1,
-                PageSize: 1000,
+                filters: `buildingId='${currentFolderId}'`,
+                pageNumber: 1,
+                pageSize: 1000,
             };
-            const res = await queryFloorList(params);
-            this.tableData = res.Content;
+            const res = await floorQuery(params);
+            debugger
+            // const res = await queryFloorList(params);
+            this.tableData = res.content;
             this.tableLoading = false;
         }
     }

+ 5 - 1
vue.config.js

@@ -25,7 +25,11 @@ module.exports = {
                 }
             },
             "/datacenter": {
-                target: "http://60.205.177.43:28888",
+                target: "http://192.168.64.17:28890",
+                changeOrigin: true
+            },
+            "/equip-component": {
+                target: "http://192.168.64.17:28890",
                 changeOrigin: true
             },
             "/modelapi": {