|
@@ -570,29 +570,50 @@ export default {
|
|
|
item.name = item.book_name + ' ' + percent.toFixed(2) + '%';
|
|
|
}
|
|
|
});
|
|
|
- if (this.rightTopIndex === 1 && this.corpus.scope.length > 0) {
|
|
|
+ if (this.rightTopIndex === 1) {
|
|
|
let data = [];
|
|
|
let tempdata = {};
|
|
|
- this.corpus.scope.forEach((str) => {
|
|
|
- if (!tempdata[str[0]]) {
|
|
|
+ if (this.corpus.scope.length === 0) {
|
|
|
+ this.levelList.forEach((item) => {
|
|
|
let obj = {
|
|
|
- name: str[0],
|
|
|
+ name: item.label,
|
|
|
children: [],
|
|
|
};
|
|
|
- tempdata[str[0]] = obj;
|
|
|
- }
|
|
|
- let childObj = {
|
|
|
- name: '',
|
|
|
- value: 0,
|
|
|
- };
|
|
|
- if (this.bookSourceObj[str[1]]) {
|
|
|
- childObj.name = this.bookSourceObj[str[1]].book_name + ' ' + this.bookSourceObj[str[1]].percent + '%';
|
|
|
- childObj.value = this.bookSourceObj[str[1]].count;
|
|
|
+ item.children.forEach((items) => {
|
|
|
+ let childObj = {
|
|
|
+ name: '',
|
|
|
+ value: 0,
|
|
|
+ };
|
|
|
+ if (this.bookSourceObj[items.id]) {
|
|
|
+ childObj.name = items.name + ' ' + this.bookSourceObj[items.id].percent + '%';
|
|
|
+ childObj.value = this.bookSourceObj[items.id].count;
|
|
|
+ }
|
|
|
+ obj.children.push(childObj);
|
|
|
+ });
|
|
|
+ data.push(obj);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.corpus.scope.forEach((str) => {
|
|
|
+ if (!tempdata[str[0]]) {
|
|
|
+ let obj = {
|
|
|
+ name: str[0],
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
+ tempdata[str[0]] = obj;
|
|
|
+ }
|
|
|
+ let childObj = {
|
|
|
+ name: '',
|
|
|
+ value: 0,
|
|
|
+ };
|
|
|
+ if (this.bookSourceObj[str[1]]) {
|
|
|
+ childObj.name = this.bookSourceObj[str[1]].book_name + ' ' + this.bookSourceObj[str[1]].percent + '%';
|
|
|
+ childObj.value = this.bookSourceObj[str[1]].count;
|
|
|
+ }
|
|
|
+ tempdata[str[0]].children.push(childObj);
|
|
|
+ });
|
|
|
+ for (const key in tempdata) {
|
|
|
+ data.push(tempdata[key]);
|
|
|
}
|
|
|
- tempdata[str[0]].children.push(childObj);
|
|
|
- });
|
|
|
- for (const key in tempdata) {
|
|
|
- data.push(tempdata[key]);
|
|
|
}
|
|
|
option = {
|
|
|
title: {
|
|
@@ -845,7 +866,7 @@ export default {
|
|
|
if (this.rightTopIndex === 0) {
|
|
|
this.rightList = res.stat_list_word_definition;
|
|
|
} else {
|
|
|
- this.rightList = res.stat_list_sentence_source_book_series_code;
|
|
|
+ this.rightList = res.stat_list_sentence_source_book;
|
|
|
}
|
|
|
this.getrightListdata();
|
|
|
if (this.patternIndex === 0) {
|