|
@@ -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>
|