Browse Source

用户页发布阿里云,第一次提交

yunxing 4 years ago
parent
commit
40b2e91e8d

+ 1 - 1
src/api/labsl.ts

@@ -44,7 +44,7 @@ export function planerQuery(postParams: any): any {
 }
 // 未发布 - 移至回收站
 export function planerRecycle(postParams: any): any {
-    return httputils.postJson(`${baseApi}/planar/graph/drafts/recycle`, postParams);
+    return httputils.postJson(`${baseApi}/planar/graph/drafts/recycle`, postParams);
 }
 // 未发布 - 更新平面图信息
 export function planerUpdate(postParams: any): any {

+ 1 - 1
src/components/editview/addEquipmentDialog.vue

@@ -21,7 +21,7 @@ export default {
     components: {},
     data() {
         return {
-            dialogTableVisible: true,
+            dialogTableVisible: false,
             cascaderData1: [
                 {
                     title: "1",

+ 4 - 8
src/components/homeView/deleteDialog.vue

@@ -36,21 +36,17 @@ export default {
             if (!this.data.length) {
                 return;
             }
-            const pa = this.data.map(({ id, graphId }) => {
+            const postParams = this.data.map(({ id, graphId }) => {
                 return { id, graphId };
             });
+            let res;
             if (this.isPub) {
                 // 已发布
-                let res = pubPlanerRecycle(pa);
-                this.updateCall(res);
+                res = await pubPlanerRecycle(postParams);
             } else {
                 // 未发布
-                let res = planerRecycle(pa);
-                this.updateCall(res);
+                res = await planerRecycle(postParams);
             }
-        },
-        // 更新成功回调
-        updateCall(res) {
             if (res.result == "success") {
                 this.dialogVisible = false;
                 this.$emit("deleteSuc");

+ 9 - 17
src/components/homeView/move.vue

@@ -13,7 +13,6 @@
 </template>
 
 <script>
-import { queryCategoryGraph, updateDraftsGraph, updatePubGraph } from "@/api/home";
 import { folderQuery, planerUpdate, pubPlanerUpdate } from "@/api/labsl";
 export default {
     props: {
@@ -93,37 +92,30 @@ export default {
             this.value = "";
         },
         // 确认修改
-        confirm() {
+        async confirm() {
             if (!this.value.length || !this.data.length) {
                 return;
             }
-            const categoryId = this.value[this.value.length - 1];
-            const pa = {
+            const postParams = {
                 content: [],
-                projection: ["categoryId"],
+                projection: ["folderId"],
             };
-            pa.content = this.data.map((t) => {
+            postParams.content = this.data.map((t) => {
                 return {
                     id: t.id,
                     graphId: t.graphId,
-                    categoryId: categoryId,
+                    folderId: this.value,
                 };
             });
+            let res;
             if (this.isPub) {
                 // 已发布
-                updatePubGraph(pa).then((res) => {
-                    this.updateCall(res);
-                });
+                res = await pubPlanerUpdate(postParams);
             } else {
                 // 未发布
-                updateDraftsGraph(pa).then((res) => {
-                    this.updateCall(res);
-                });
+                res = await planerUpdate(postParams);
             }
-        },
-        // 更新成功回调
-        updateCall(res) {
-            this.value = [];
+            this.value = '';
             if (res.result == "success") {
                 this.dialogVisible = false;
                 this.$message.success("移动成功");

+ 3 - 7
src/components/homeView/rename.vue

@@ -50,18 +50,14 @@ export default {
                 ],
                 projection: ["name"],
             };
+            let res;
             if (this.isPub) {
                 // 已发布
-                let res = await pubPlanerUpdate(postParams);
-                this.updateCall(res);
+                res = await pubPlanerUpdate(postParams);
             } else {
                 // 未发布
-                let res = await planerUpdate(postParams);
-                this.updateCall(res);
+                res = await planerUpdate(postParams);
             }
-        },
-        // 更新成功回调
-        updateCall(res) {
             if (res.result == "success") {
                 this.dialogVisible = false;
                 this.$message.success("更新成功");

+ 27 - 31
src/views/home.vue

@@ -206,6 +206,18 @@ export default {
         },
         // 新建画布成功回调
         createPlanarCallback(folder) {
+            
+           /*  this.$router.push({
+                name: "Editer",
+                query: {
+                    graphId: folder.graphId,
+                    id: folder.id,
+                    // categoryName: encodeURI(this.categoryName),
+                    isPub: 0, //新建的是未发布的
+                },
+            });
+            // 不进行文件夹的定位
+            return true; */
             if (folder.folderId) {
                 // 是否新建文件夹
                 if (folder.folderName) {
@@ -214,6 +226,9 @@ export default {
                 } else {
                     this.$refs.leftFolder.handleCheckFolder(folder.folderId);
                 }
+                // 选中未发布,查询列表
+                this.isPub = 0;
+                this.queryGraph();
             }
         },
         // 批量新建画布
@@ -244,8 +259,8 @@ export default {
             console.log(val);
             let cardTree = [];
             cardTree = this.cardTree.map((building) => {
-                building.floorList.map((_floor) => {
-                    _floor.floor.map((card) => {
+                building?.floorList?.map((_floor) => {
+                    _floor?.planarGraphLis?.map((card) => {
                         card.checked = val;
                     });
                     return _floor;
@@ -314,36 +329,15 @@ export default {
          * 更改选中的文件夹
          */
         changeFolder(data) {
-            console.log("changeFolder");
-            console.log(data);
+            // 如果没有文件夹数据,清空页面数据
+            if (!data) {
+                this.cardTree = [];
+                this.cardList = [];
+                this.folderId = "";
+                return true;
+            }
             this.folderId = data.id;
             this.queryGraph();
-            return true;
-            // TODO:
-            let { yfbMocKdata } = require("./mockData");
-            // console.log(yfbMocKdata);
-            let cardTree = [],
-                cardList = [];
-            cardTree = yfbMocKdata.content.map((building) => {
-                building.floorList.map((_floor) => {
-                    _floor.floor.map((card) => {
-                        card.checked = false;
-                        cardList.push({
-                            buildingId: building.buildingId,
-                            buildingName: building.buildingName,
-                            floorId: _floor.floorId,
-                            floorName: _floor.floorName,
-                            ...card,
-                        });
-                        return card;
-                    });
-                    return _floor;
-                });
-                return building;
-            });
-            this.cardTree = cardTree;
-            this.cardList = cardList;
-            this.cardLoading = false;
         },
         // 发布修改
         changePub() {
@@ -368,6 +362,8 @@ export default {
         },
         // 新建拓扑图成功
         toEdit(data) {
+            this.$message.warning("功能开发中");
+            return true;
             this.$router.push({
                 name: "Editer",
                 query: {
@@ -421,7 +417,7 @@ export default {
             cardTree = res?.content?.map((building) => {
                 building?.floorList?.map((_floor) => {
                     // TODO: 1111
-                    _floor?.floor?.map((card) => {
+                    _floor?.planarGraphLis?.map((card) => {
                         card.checked = false;
                         // 保存建筑,楼层,卡片信息
                         cardList.push({