Ver código fonte

优化更新

liujiejie 1 ano atrás
pai
commit
917eaddfd0

BIN
dist.zip


+ 1 - 4
src/views/home/components/Menu.vue

@@ -34,6 +34,7 @@
       </div>
     </div>
     <el-menu
+      collapse-transition
       ref="menu"
       class="mt-3 el-menu-vertical-demo"
       @open="handleOpen"
@@ -242,10 +243,6 @@ export default {
   border-right: 1px solid #d8d8d8;
   position: relative;
 
-
- 
-
-  
   .homeBox {
     width: 100%;
     padding: 0 20px;

+ 25 - 6
src/views/system/menuMag/components/editDialog.vue

@@ -124,7 +124,7 @@ export default {
   created() {
     console.log(this.checkId, "checkid");
     this.menuOptions[0].children.push(...this.tableData);
-    if (this.title === "编辑" && this.activeName === "2") {
+    if (this.row && this.title === "编辑" && this.activeName === "2") {
       this.menuForm = {
         parentId: this.row.parentId,
         pname: this.row.permissionName,
@@ -167,13 +167,31 @@ export default {
       if (newVal !== null && newVal !== undefined) {
         console.log(newVal, "checkId");
         this.menuForm.parentId = newVal;
+        if (
+          this.menuForm.pname === null &&
+          this.row &&
+          this.title === "编辑" &&
+          this.activeName === "2"
+        ) {
+          console.log(this.props, " this.row");
+          this.menuForm = {
+            parentId: this.row.parentId,
+            pname: this.row.permissionName,
+            purl: this.row.permissionUrl,
+            pstat: this.row.permissionState,
+            pcode: this.row.permissionCode,
+            permissionShow: this.row.permissionShow,
+          };
+        }
       }
     },
     tableData: {
       handler(newData) {
         this.$nextTick(() => {
-          console.log("gengxin");
-          this.setExpandAll(this.defaultExpandAll);
+          console.log("gengxin", this.setExpandAll(newData));
+          this.setExpandAll(newData);
+          this.menuOptions[0].children = [];
+          this.menuOptions[0].children.push(...this.tableData);
         });
       },
       immediate: true,
@@ -193,9 +211,9 @@ export default {
             });
           }
         });
+        console.log(this.tableData, "新值");
       }
     },
-    /** 转换菜单数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
         delete node.children;
@@ -210,7 +228,7 @@ export default {
       const that = this;
       this.$refs["addUserForm"].validate((valid) => {
         if (valid) {
-          if (this.title === "编辑") {
+          if (this.title === "编辑" && this.row) {
             updateMenuFn({
               ...this.menuForm,
               permissionId: this.row.permissionId,
@@ -230,11 +248,12 @@ export default {
                 });
               });
           } else if (this.title === "新增") {
+            console.log("新增", this.activeName);
             addMenuFn({
               ...this.menuForm,
               purl:
                 this.menuForm.purl !== null ? this.menuForm.purl : undefined,
-              ptype: "1",
+              ptype: this.activeName,
               parentId:
                 this.activeName === "1" ? undefined : this.menuForm.parentId,
             })

+ 7 - 13
src/views/system/menuMag/index.vue

@@ -61,18 +61,16 @@
           align="center"
         >
           <template slot-scope="scope">
-            <span>{{ scope.row.permissionType == 1 ? "菜单" : "功能" }}</span>
+            <span>{{
+              scope.row.permissionType == 1
+                ? "目录"
+                : scope.row.permissionType == 2
+                ? "菜单"
+                : "按钮"
+            }}</span>
           </template>
         </el-table-column>
 
-        <el-table-column
-          prop="permissionSort"
-          label="排序"
-          width="80"
-          align="center"
-        >
-        </el-table-column>
-
         <el-table-column prop="permissionCode" label="权限标识" align="center">
         </el-table-column>
         <el-table-column prop="permissionUrl" label="路径" align="center">
@@ -357,8 +355,4 @@ export default {
 .el-select {
   width: 250px;
 }
-.dialog-footer{
-  margin-top: 10px;
-}
-
 </style>

+ 2 - 2
vue.config.js

@@ -56,8 +56,8 @@ module.exports = {
   devServer: {
     proxy: {
       "/api": {
-        // target: "http://192.168.5.4:16200", // 石月
-        target: "http://192.168.50.235:16200",
+        target: "http://192.168.5.4:16200", // 石月
+        // target: "http://192.168.50.235:16200",
         // target: "http://106.120.102.238:16600",//外网
         changeOrigin: true,
         pathRewrite: {