书签菜单编辑回显

This commit is contained in:
WangHao 2020-08-22 17:42:06 +08:00
parent e5997c1128
commit 5e67a19e04

View File

@ -320,6 +320,19 @@
this.open = true;
this.title = "添加书签菜单";
},
// /** */
// handleUpdate(row) {
// this.reset();
// this.getTreeselect(); //
// if (row != undefined) {
// this.form.parentId = row.menuId;
// }
// getMenu(row.menuId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "";
// });
// },
//
reset() {
this.form = {
@ -363,7 +376,7 @@
//if (treeNode.parentNode && treeNode.parentNode.id!=1) return;
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_sz onclick='editBookmark()' style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'><i class='el-icon-edit'></i></span>";
var editStr = "<span class="+treeNode.tId+"_sz data-parentId="+treeNode.parentId+" data-menuId="+treeNode.menuId+" onclick='editBookmark(this)' style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'><i class='el-icon-edit'></i></span>";
switchObjspan.after(editStr);
$("." + treeNode.tId + "_count").unbind().remove();
@ -426,31 +439,33 @@
editBookmark:function(e){
var that=this;
//console.log("menuid:"+e.srcElement.dataset.menuId)
this.reset();
this.getTreeselect();
if (e.getAttribute("data-menuId")!=null&&e.getAttribute("data-parentId")!=null) {
this.form.parentId = e.getAttribute("data-parentId");
}
getMenu(e.getAttribute("data-menuId")).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改书签菜单";
});
that.handleAdd();//
//
if ( e && e.stopPropagation )
//W3CstopPropagation()
e.stopPropagation();
else
//使IE
window.event.cancelBubble = true;
return false;
},
},
mounted(){
window['editBookmark'] = () => {
this.editBookmark()
window['editBookmark'] = (e) => {
this.editBookmark(e)
}
},
handleCommand(command) {
this.$message('click on item ' + command);