瀏覽代碼

优化菜单

ZaiZai 1 年之前
父節點
當前提交
e7d184b04d
共有 1 個文件被更改,包括 77 次插入15 次删除
  1. 77 15
      src/views/system/menu.vue

+ 77 - 15
src/views/system/menu.vue

@@ -41,6 +41,9 @@
           v-if="userInfo.role_name.includes('admin') && scope.row.category === 1"
         >新增子项
         </el-button>
+        <el-button type="text" size="small" @click.stop="handleCopyAdd(scope.row,scope.index)"
+          v-if="userInfo.role_name.includes('admin') && scope.row.category === 1"
+        >复制菜单</el-button>
 
 <!--        <el-button
           type="text"
@@ -62,9 +65,9 @@
               <small slot="more">...</small>
             </avue-text-ellipsis>
          </el-link>
-            
+
       </template>
-    
+
     </avue-crud>
       <!-- PDF预览 -->
       <el-dialog title="文件预览" :visible.sync="dialogVisible4" width="70%" append-to-body center>
@@ -168,7 +171,8 @@
               prop: "source",
               type: "icon",
               slot: true,
-              iconList: iconList
+              iconList: iconList,
+              hide: true,
             },
             {
               label: "菜单编号",
@@ -183,11 +187,13 @@
             },
             {
               label: "客户端图标",
-              prop: "source"
+              prop: "source",
+              hide: true,
             },
             {
               label: "菜单别名",
               prop: "alias",
+              hide: true,
               rules: [
                 {
                   required: true,
@@ -224,6 +230,7 @@
               prop: "isOpen",
               type: "radio",
               disabled: false,
+              hide: true,
               dicData: [
                 {
                   label: "否",
@@ -248,6 +255,7 @@
               prop: "isLayout",
               type: "radio",
               disabled: false,
+              hide: true,
               dicData: [
                 {
                   label: "否",
@@ -258,7 +266,7 @@
                   value: 2
                 }
               ],
-              value: 2,
+              value: 1,
               rules: [
                 {
                   required: true,
@@ -272,6 +280,7 @@
               prop: "isShowButton",
               type: "radio",
               disabled: false,
+                  hide: true,
               dicData: [
                 {
                   label: "是",
@@ -282,7 +291,7 @@
                   value: 2
                 }
               ],
-              value: 2,
+              value: 1,
               rules: [
                 {
                   required: true,
@@ -320,6 +329,7 @@
               type: "textarea",
               span: 24,
               minRows: 2,
+              hide: true,
             },
             {
               label: '菜单视频',
@@ -327,6 +337,7 @@
               type: 'upload',
               listType: 'picture-img',
               span: 12,
+              hide: true,
               accept:"video/mp4",
               propsHttp: {
                 url:'data'
@@ -341,14 +352,15 @@
               prop: 'excelUrl',
               type: 'upload',
               span: 12,
+              hide: true,
               multiple:false,
-              dataType: "string",  
+              dataType: "string",
               loadText: '模板上传中,请稍等',
               propsHttp: {
-                url:'data', 
+                url:'data',
 
               },
-            
+
               limit:1,
               tip: '上传文档说明',
               action: "/api/blade-resource/oss/endpoint/upload-file2"
@@ -362,7 +374,7 @@
             //   propsHttp: {
             //     url:'data'
             //   }
-              
+
             // },
           ]
         },
@@ -426,8 +438,8 @@
       uploadPreview(file, column, done) {
           this.dialogVisible4=true;
           this.pdfSrc=file.url
-         
-          
+
+
       },
     // 点击第文档信息列的单元格
     clickCell(row, column, cell, event) {
@@ -444,9 +456,59 @@
       },
       handleAdd(row) {
         this.parentId = row.id;
-        const column = this.findObject(this.option.column, "parentId");
-        column.value = row.id;
-        column.addDisabled = true;
+        const column = this.option.column
+        //所属系统
+        const findSys = this.findObject(column, "sysId");
+        findSys.value = row.sysId;
+
+        //上级菜单
+        const findParent = this.findObject(column, "parentId");
+        findParent.value = row.id;
+        findParent.addDisabled = true;
+
+        //路由地址
+        const findPath = this.findObject(column, "path");
+        findPath.value = row.path;
+
+        //菜单编号
+        const findCode = this.findObject(column, "code");
+        findCode.value = row.code;
+
+        //菜单别名
+        const findAlias = this.findObject(column, "alias");
+        findAlias.value = row.alias;
+
+        //执行新增
+        this.$refs.crud.rowAdd();
+      },
+      handleCopyAdd(row) {
+        this.parentId = row.parentId;
+        const column = this.option.column
+        //所属系统
+        const findSys = this.findObject(column, "sysId");
+        findSys.value = row.sysId;
+
+        //上级菜单
+        const findParent = this.findObject(column, "parentId");
+        findParent.value = row.parentId;
+
+        //路由地址
+        const findPath = this.findObject(column, "path");
+        findPath.value = row.path;
+
+        //菜单编号
+        const findCode = this.findObject(column, "code");
+        findCode.value = row.code;
+
+        //菜单别名
+        const findAlias = this.findObject(column, "alias");
+        findAlias.value = row.alias;
+
+        //菜单排序
+        const findSort = this.findObject(column, "sort");
+        findSort.value = Number(row.sort) + 1;
+
+        //执行新增
         this.$refs.crud.rowAdd();
       },