|
@@ -174,7 +174,13 @@ export default {
|
|
|
SentenceSort,
|
|
|
Checkbox,
|
|
|
},
|
|
|
- props: ["context", "fatherName"],
|
|
|
+ props: [
|
|
|
+ "context",
|
|
|
+ "fatherName",
|
|
|
+ "currentTreeID",
|
|
|
+ "FatherTreeData",
|
|
|
+ "changeId",
|
|
|
+ ],
|
|
|
data() {
|
|
|
return {
|
|
|
contextData: null,
|
|
@@ -235,15 +241,43 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
// 上一页
|
|
|
handleNNPEprev() {
|
|
|
const _this = this;
|
|
|
if (_this.queIndex == 0) {
|
|
|
- this.$message({
|
|
|
- message: "已经是第一题",
|
|
|
- type: "success",
|
|
|
+ let data = {};
|
|
|
+ _this.FatherTreeData.forEach((item, itemIndex) => {
|
|
|
+ if (item.children) {
|
|
|
+ item.children.forEach((it, childrenIndex) => {
|
|
|
+ if (itemIndex < 1 && childrenIndex < 1) {
|
|
|
+ this.$message({
|
|
|
+ message: "已经是第一题",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else if (it.id == _this.currentTreeID) {
|
|
|
+ data.fatherName = item.children[childrenIndex - 1].fatherName;
|
|
|
+ data.id = item.children[childrenIndex - 1].id;
|
|
|
+ data.name = item.children[childrenIndex - 1].name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (itemIndex < 1) {
|
|
|
+ this.$message({
|
|
|
+ message: "已经是第一题",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else if (item.id == _this.currentTreeID) {
|
|
|
+ {
|
|
|
+ data.fatherName =
|
|
|
+ _this.FatherTreeData[itemIndex - 1].fatherName;
|
|
|
+ data.id = _this.FatherTreeData[itemIndex - 1].id;
|
|
|
+ data.name = _this.FatherTreeData[itemIndex - 1].name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
+ _this.queIndex = 0;
|
|
|
+ _this.changeId(data.id, data.name, data.fatherName);
|
|
|
} else {
|
|
|
_this.queIndex = _this.queIndex - 1;
|
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
@@ -254,10 +288,42 @@ export default {
|
|
|
handleNNPEnext() {
|
|
|
const _this = this;
|
|
|
if (_this.queIndex == _this.queTotal - 1) {
|
|
|
- this.$message({
|
|
|
- message: "已经是最后一题",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
+ let data = {};
|
|
|
+ _this.FatherTreeData.forEach((item, itemIndex) => {
|
|
|
+ if (item.children) {
|
|
|
+ item.children.forEach((it, childrenIndex) => {
|
|
|
+ if (
|
|
|
+ itemIndex == _this.FatherTreeData.length - 1 &&
|
|
|
+ childrenIndex == item.children.length - 1
|
|
|
+ ) {
|
|
|
+ this.$message({
|
|
|
+ message: "已经是最后一题",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else if (it.id == _this.currentTreeID) {
|
|
|
+ data.fatherName = item.children[childrenIndex + 1].fatherName;
|
|
|
+ data.id = item.children[childrenIndex + 1].id;
|
|
|
+ data.name = item.children[childrenIndex + 1].name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (itemIndex == _this.FatherTreeData.length - 1) {
|
|
|
+ this.$message({
|
|
|
+ message: "已经是最后一题",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else if (item.id == _this.currentTreeID) {
|
|
|
+ {
|
|
|
+ data.fatherName =
|
|
|
+ _this.FatherTreeData[itemIndex + 1].fatherName;
|
|
|
+ data.id = _this.FatherTreeData[itemIndex + 1].id;
|
|
|
+ data.name = _this.FatherTreeData[itemIndex + 1].name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ _this.queIndex = 0;
|
|
|
+ _this.changeId(data.id, data.name, data.fatherName);
|
|
|
} else {
|
|
|
_this.queIndex = _this.queIndex + 1;
|
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
@@ -346,7 +412,7 @@ export default {
|
|
|
border-radius: 8px;
|
|
|
padding: 12px 8px;
|
|
|
&.NNPE-tableList-hasBg {
|
|
|
- background: #F7F7F7;
|
|
|
+ background: #f7f7f7;
|
|
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 8px;
|