wiki文档优化
This commit is contained in:
@@ -331,18 +331,19 @@
|
||||
urlParamPageId: function (newVal, oldVal) {
|
||||
if (!this.initOver) return;
|
||||
var oldPageId = oldVal || 0;
|
||||
// console.log(app.doNotPushState, newVal, oldVal);
|
||||
if (app.doNotPushState) {
|
||||
app.doNotPushState = false;
|
||||
} else {
|
||||
this.urlParam.pageId = newVal;
|
||||
var params = urlToParam(this.urlParam).slice(1);
|
||||
window.history.pushState(null, null, '?' + params);
|
||||
}
|
||||
if (!!newVal && newVal > 0 && newVal !== oldPageId) {
|
||||
console.log(app.doNotPushState, newVal, oldVal);
|
||||
if (!newVal) {
|
||||
app.rightContentType = 0;
|
||||
} else if (newVal !== oldPageId) {
|
||||
this.wikiPageExpandedKeys = [newVal];
|
||||
this.loadPageDetail(newVal);
|
||||
if (!app.doNotPushState) {
|
||||
this.urlParam.pageId = newVal;
|
||||
var params = urlToParam(this.urlParam).slice(1);
|
||||
window.history.pushState(null, null, '?' + params);
|
||||
}
|
||||
}
|
||||
app.doNotPushState = false;
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -582,6 +583,7 @@
|
||||
if (validateResult(json)) {
|
||||
Toast.success("保存成功!");
|
||||
app.urlParamPageId = json.data.id;
|
||||
app.loadPageDetail(json.data.id);
|
||||
app.doGetPageList(null);
|
||||
}
|
||||
});
|
||||
@@ -652,6 +654,10 @@
|
||||
app.pageContent = json.data.pageContent || {};
|
||||
app.pageFileList = json.data.fileList || [];
|
||||
app.uploadFormData = {pageId: app.wikiPage.id};
|
||||
// 修改最后点击的项,保证刷新后点击编辑能展示编辑的项
|
||||
if (!app.lastClickNode.id) {
|
||||
app.lastClickNode = {id: wikiPage.id, nodePath: wikiPage.name};
|
||||
}
|
||||
}
|
||||
});
|
||||
this.loadCommentList(pageId);
|
||||
@@ -720,7 +726,7 @@
|
||||
node.children = pathIndex;
|
||||
} else {
|
||||
app.wikiPageList = pathIndex;
|
||||
app.lastClickNode = {};
|
||||
//app.lastClickNode = {};
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -752,10 +758,12 @@
|
||||
},
|
||||
createUrlParam() {
|
||||
var url = document.location.toString();
|
||||
var urlParam = {};
|
||||
if (url.indexOf("?") >= 0) {
|
||||
var urlParam = {};
|
||||
for (var key in this.urlParam) {
|
||||
urlParam[key] = this.urlParam[key];
|
||||
if (key != 'pageId') {
|
||||
urlParam[key] = this.urlParam[key];
|
||||
}
|
||||
}
|
||||
var params = url.split("?")[1];
|
||||
var paramArr = params.split("&");
|
||||
@@ -767,9 +775,12 @@
|
||||
}
|
||||
if (!!urlParam.pageId) {
|
||||
this.urlParamPageId = parseInt(urlParam.pageId);
|
||||
} else {
|
||||
this.urlParamPageId = 0;
|
||||
this.lastClickNode = {};
|
||||
}
|
||||
this.urlParam = urlParam;
|
||||
}
|
||||
this.urlParam = urlParam;
|
||||
},
|
||||
init(){
|
||||
page.newPageContentEditor = new window.wangEditor('#newPageContentDiv');
|
||||
|
||||
Reference in New Issue
Block a user