瀏覽代碼

修改菜单功能

SanHQin 3 月之前
父節點
當前提交
46f18b5a8b

文件差異過大導致無法顯示
+ 0 - 0
dist/css/app.30ce0e31.css


+ 1 - 1
dist/index.html

@@ -36,4 +36,4 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.3a922260.js"></script><script defer="defer" src="/js/app.52cda20d.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.35e2ca19.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
+      }</style><script defer="defer" src="/js/chunk-vendors.3a922260.js"></script><script defer="defer" src="/js/app.b844a815.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.30ce0e31.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.b844a815.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.b844a815.js.map


+ 1 - 1
src/components/dialog/addMenuDialog.vue

@@ -110,7 +110,7 @@ export default {
 		},
 		submit() {
 			if(!this.form.menuName || !this.form.menuIcon || !this.form.menuActiveIcon)return this.$message.error("请完善表单")
-			this.$emit("success", this.form);
+			this.$emit("success", {item:this.form,type:this.type});
 		},
 		async addUrlIcon(type = "menuIcon") {
 			let _url = await this.uploadFile("image/*");

+ 33 - 5
src/components/dialog/permissionSettingDialog.vue

@@ -655,7 +655,7 @@
 								</el-table-column>
 								<el-table-column
 									label="操作"
-									width="270px"
+									width="320px"
 									fixed="right"
 									show-overflow-tooltip
 								>
@@ -673,6 +673,20 @@
 										>
 											添加工具
 										</button>
+
+										<button
+											@click="editMenu(scope.row)"
+											v-if="scope.row.menuName"
+											style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											"
+										>
+											修改
+										</button>
 										<button
 											@click="moveUp(scope.row, scope.row.typeId)"
 											style="
@@ -1195,15 +1209,29 @@ export default {
 				this.form.desktop.list
 			);
 		},
-		addMenuSuccess(item) {
-			this.form.admin.sidebar.list.push(item);
-			item.id = String(new Date().getTime());
-			item.typeId = item.id;
+		addMenuSuccess({item,type}) {
+			console.log(item,type)
+			if(type=='add'){
+				this.form.admin.sidebar.list.push(item);
+				item.id = String(new Date().getTime());
+				item.typeId = item.id;
+			}else if(type=='edit'){
+				let _index = this.form.admin.sidebar.list.findIndex(i=>i.typeId==item.typeId);
+				if(_index!=-1){
+					let _sidebar = JSON.parse(JSON.stringify(this.form.admin.sidebar));
+					_sidebar.list[_index] = item;
+					this.form.admin.sidebar = JSON.parse(JSON.stringify(_sidebar))
+					this.$forceUpdate();
+				}
+			}
 			this.$refs.addMenuDialogRef.close();
 		},
 		addMenu() {
 			this.$refs.addMenuDialogRef.open();
 		},
+		editMenu(row){
+			this.$refs.addMenuDialogRef.open(row,"edit");
+		},
 	},
 };
 </script>

部分文件因文件數量過多而無法顯示