Przeglądaj źródła

添加建筑楼层数据

zhangyu 4 lat temu
rodzic
commit
6060737552
1 zmienionych plików z 51 dodań i 45 usunięć
  1. 51 45
      src/components/homeView/createCanvasDialog.vue

+ 51 - 45
src/components/homeView/createCanvasDialog.vue

@@ -11,7 +11,15 @@
         <div class="dialog-bodys">
             <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" label-position="top">
                 <el-form-item label="所属楼层" prop="buildFloor">
-                    <el-cascader v-model="ruleForm.buildFloor" :options="buildFloorData" @change="handleChangeBuildFloor" size="small"></el-cascader>
+                    <el-cascader
+                        style="width: 260px"
+                        v-model="ruleForm.buildFloor"
+                        :options="buildFloorData"
+                        :props="props"
+                        clearable
+                        @change="handleChangeBuildFloor"
+                        size="small"
+                    ></el-cascader>
                 </el-form-item>
                 <el-form-item label="名称" prop="name">
                     <el-input v-model="ruleForm.name" placeholder="请输入名称" size="small"></el-input>
@@ -69,6 +77,11 @@ export default {
                 folder: [{ required: true, message: "请选择所属文件夹", trigger: "blur" }],
             },
             buildFloorData: [],
+            props: {
+                value: "id",
+                label: "localName",
+                children: "floor",
+            },
             value: [],
             outerVisible: false,
             dynamicTags: [],
@@ -125,11 +138,20 @@ export default {
         },
         // 获取建筑楼层数据
         getBuildingFloorData() {
-            const params = {}
-            buildingQuery(params, res => {
-                debugger
-                console.log(res)
-            })
+            const params = {
+                pageNumber: 1,
+                pageSize: 1000,
+                orders: "name asc, createTime desc",
+                cascade: [
+                    {
+                        name: "floor",
+                        orders: "floorSequenceId desc",
+                    },
+                ],
+            };
+            buildingQuery(params).then((res) => {
+                this.buildFloorData = res.content;
+            });
         },
         // 切换建筑楼层
         handleChangeBuildFloor(val) {
@@ -175,23 +197,7 @@ export default {
                     },
                 ],
             };
-            createGraph(pa).then((res) => {
-                if (res.result == "success") {
-                    this.outerVisible = false;
-                    this.$message.success("创建成功");
-                    this.$router.push({
-                        name: "Editer",
-                        query: {
-                            graphId: res.entityList[0].graphId,
-                            id: res.entityList[0].id,
-                            categoryName: encodeURI(this.buttonStr),
-                            isPub: 0,
-                        },
-                    });
-                } else {
-                    this.$message(res.message);
-                }
-            });
+            console.log(pa)
         },
         closeModal() {
             this.resetForm("ruleForm");
@@ -228,28 +234,6 @@ export default {
     .el-form-item__label {
         line-height: 1;
     }
-    .el-tag {
-        background: #eff0f1;
-        border-radius: 2px;
-        color: #1f2429ff;
-        margin: 0 8px 8px 0;
-        padding: 5px 6px 5px 8px;
-        font-size: 14px;
-        height: 24px;
-        line-height: 1;
-        border: none;
-        &:hover {
-            border: none;
-        }
-        .el-icon-close {
-            color: #9ca2a9ff;
-            right: 0;
-            &:hover {
-                color: #fff;
-                background-color: #ccc;
-            }
-        }
-    }
     .input-new-tag {
         width: 150px;
         // input{
@@ -286,6 +270,28 @@ export default {
         border: 1px solid #c3c6cb;
         padding: 7px 12px;
         line-height: 1;
+        .el-tag {
+            background: #eff0f1;
+            border-radius: 2px;
+            color: #1f2429ff;
+            margin: 0 8px 8px 0;
+            padding: 5px 6px 5px 8px;
+            font-size: 14px;
+            height: 24px;
+            line-height: 1;
+            border: none;
+            &:hover {
+                border: none;
+            }
+            .el-icon-close {
+                color: #9ca2a9ff;
+                right: 0;
+                &:hover {
+                    color: #fff;
+                    background-color: #ccc;
+                }
+            }
+        }
     }
 }
 </style>