|
@@ -261,6 +261,20 @@ const actions = {
|
|
commit("setTopicSeries", topicSeries);
|
|
commit("setTopicSeries", topicSeries);
|
|
commit("setTopicNoSeries", topicNoSeries);
|
|
commit("setTopicNoSeries", topicNoSeries);
|
|
},
|
|
},
|
|
|
|
+ resetTopicNo({ state }) {
|
|
|
|
+ let curTopicId = "",
|
|
|
|
+ curTopicNo = 0;
|
|
|
|
+ state.topics.forEach((topic) => {
|
|
|
|
+ if (!topic.parent) return;
|
|
|
|
+
|
|
|
|
+ if (curTopicId !== topic.parent.id) {
|
|
|
|
+ curTopicId = topic.parent.id;
|
|
|
|
+ curTopicNo++;
|
|
|
|
+ }
|
|
|
|
+ topic.parent.topicNo = curTopicNo;
|
|
|
|
+ topic.topicNo = curTopicNo;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
scrollToElementPage({ state, commit }, element) {
|
|
scrollToElementPage({ state, commit }, element) {
|
|
let elementPapeNo = null;
|
|
let elementPapeNo = null;
|
|
state.pages.forEach((page, pageNo) => {
|
|
state.pages.forEach((page, pageNo) => {
|
|
@@ -307,6 +321,7 @@ const actions = {
|
|
state.topics.push(preElement);
|
|
state.topics.push(preElement);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ dispatch("resetTopicNo");
|
|
dispatch("resetTopicSeries");
|
|
dispatch("resetTopicSeries");
|
|
commit("setCurElement", element);
|
|
commit("setCurElement", element);
|
|
},
|
|
},
|
|
@@ -481,7 +496,7 @@ const actions = {
|
|
positionInfos.reverse().forEach((pos) => {
|
|
positionInfos.reverse().forEach((pos) => {
|
|
state.topics.splice(pos._elementNo, 1);
|
|
state.topics.splice(pos._elementNo, 1);
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ dispatch("resetTopicNo");
|
|
dispatch("resetTopicSeries");
|
|
dispatch("resetTopicSeries");
|
|
|
|
|
|
commit("setCurElement", {});
|
|
commit("setCurElement", {});
|
|
@@ -580,7 +595,7 @@ const actions = {
|
|
relateTopics.reverse().forEach((topic) => {
|
|
relateTopics.reverse().forEach((topic) => {
|
|
state.topics.splice(prevTopicFirstIndex, 0, topic);
|
|
state.topics.splice(prevTopicFirstIndex, 0, topic);
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ dispatch("resetTopicNo");
|
|
dispatch("resetTopicSeries");
|
|
dispatch("resetTopicSeries");
|
|
},
|
|
},
|
|
// 重构页面
|
|
// 重构页面
|