书签菜单编辑回显
This commit is contained in:
parent
e5997c1128
commit
5e67a19e04
@ -320,6 +320,19 @@
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加书签菜单";
|
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() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
@ -363,7 +376,7 @@
|
|||||||
//if (treeNode.parentNode && treeNode.parentNode.id!=1) return;
|
//if (treeNode.parentNode && treeNode.parentNode.id!=1) return;
|
||||||
var switchObjspan = $("#" + treeNode.tId + "_span");
|
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);
|
switchObjspan.after(editStr);
|
||||||
|
|
||||||
$("." + treeNode.tId + "_count").unbind().remove();
|
$("." + treeNode.tId + "_count").unbind().remove();
|
||||||
@ -426,31 +439,33 @@
|
|||||||
|
|
||||||
|
|
||||||
editBookmark:function(e){
|
editBookmark:function(e){
|
||||||
var that=this;
|
this.reset();
|
||||||
|
this.getTreeselect();
|
||||||
//console.log("menuid:"+e.srcElement.dataset.menuId)
|
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 )
|
if ( e && e.stopPropagation )
|
||||||
//因此它支持W3C的stopPropagation()方法
|
//因此它支持W3C的stopPropagation()方法
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
else
|
else
|
||||||
//否则,我们需要使用IE的方式来取消事件冒泡
|
//否则,我们需要使用IE的方式来取消事件冒泡
|
||||||
window.event.cancelBubble = true;
|
window.event.cancelBubble = true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
|
window['editBookmark'] = (e) => {
|
||||||
window['editBookmark'] = () => {
|
this.editBookmark(e)
|
||||||
this.editBookmark()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
handleCommand(command) {
|
handleCommand(command) {
|
||||||
this.$message('click on item ' + command);
|
this.$message('click on item ' + command);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user