|
@@ -84,7 +84,7 @@
|
|
<span class="type">{{ item.name }}</span>
|
|
<span class="type">{{ item.name }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="rightCount">
|
|
<div class="rightCount">
|
|
- <span class="count">{{ item.value }}</span>
|
|
|
|
|
|
+ <span class="count">{{ item.count }}</span>
|
|
<span class="precent">{{ item.ratio }}%</span>
|
|
<span class="precent">{{ item.ratio }}%</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -386,7 +386,7 @@ import * as echarts from 'echarts';
|
|
import 'echarts/lib/chart/bar';
|
|
import 'echarts/lib/chart/bar';
|
|
import 'echarts/lib/component/legend';
|
|
import 'echarts/lib/component/legend';
|
|
import 'echarts/lib/component/title';
|
|
import 'echarts/lib/component/title';
|
|
-import { postapi } from '@/api/api';
|
|
|
|
|
|
+import { postapi, publicMethods } from '@/api/api';
|
|
import { levelMap } from '../../common/data';
|
|
import { levelMap } from '../../common/data';
|
|
import { json2excel } from '@/utils/setMethods';
|
|
import { json2excel } from '@/utils/setMethods';
|
|
|
|
|
|
@@ -460,6 +460,7 @@ export default {
|
|
difficulty: {},
|
|
difficulty: {},
|
|
textContent: '',
|
|
textContent: '',
|
|
routerData: null,
|
|
routerData: null,
|
|
|
|
+ id: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -476,6 +477,7 @@ export default {
|
|
this.difficulty.pinyinDifficulty = this.routerData.pinyin_difficulty;
|
|
this.difficulty.pinyinDifficulty = this.routerData.pinyin_difficulty;
|
|
this.difficulty.vocabularyDifficulty = this.routerData.vocabulary_difficulty;
|
|
this.difficulty.vocabularyDifficulty = this.routerData.vocabulary_difficulty;
|
|
this.difficulty.wordDifficulty = this.routerData.word_difficulty;
|
|
this.difficulty.wordDifficulty = this.routerData.word_difficulty;
|
|
|
|
+ this.id = this.routerData.id
|
|
this.getstatistics();
|
|
this.getstatistics();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -999,7 +1001,6 @@ export default {
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
formatter(params) {
|
|
formatter(params) {
|
|
- console.log(this.ratioShow);
|
|
|
|
if (this.ratioShow) {
|
|
if (this.ratioShow) {
|
|
return `${params[0].name} ${params[0].value}%`;
|
|
return `${params[0].name} ${params[0].value}%`;
|
|
}
|
|
}
|
|
@@ -1162,38 +1163,45 @@ export default {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
}
|
|
}
|
|
let base = null;
|
|
let base = null;
|
|
- if (this.leftNavIndex === 0) {
|
|
|
|
- base = this.headerText === 'wordCount' ? this.base.pinyinCount : this.base.pinyinTextCount;
|
|
|
|
- } else if (this.leftNavIndex === 1) {
|
|
|
|
- base = this.headerText === 'wordCount' ? this.base.wordCount : this.base.wordTextCount;
|
|
|
|
- } else {
|
|
|
|
- base = this.headerText === 'wordCount' ? this.base.vocabularyCount : this.base.vocabularyTextCount;
|
|
|
|
- }
|
|
|
|
- postapi({
|
|
|
|
- url: '/GCLSTCServer/tools/TS/statistics',
|
|
|
|
- data: {
|
|
|
|
- searchType: this.leftNavIndex,
|
|
|
|
- partitionKey: this.partitionKey,
|
|
|
|
- statisticsType: this.xifen ? 0 : 1,
|
|
|
|
- base: base || null,
|
|
|
|
- textType: this.headerText === 'wordCount' ? 0 : 1,
|
|
|
|
- },
|
|
|
|
|
|
+ publicMethods('/TeachingServer/TextAnalyser/StatLevelDist',{
|
|
|
|
+ analyse_record_id: this.id,
|
|
|
|
+ type: this.leftNavIndex,
|
|
|
|
+ level_type: this.xifen ? 1 : 0,
|
|
|
|
+ count_type: this.headerText === 'wordCount' ? 0 : 1
|
|
})
|
|
})
|
|
|
|
+ // if (this.leftNavIndex === 0) {
|
|
|
|
+ // base = this.headerText === 'wordCount' ? this.base.pinyinCount : this.base.pinyinTextCount;
|
|
|
|
+ // } else if (this.leftNavIndex === 1) {
|
|
|
|
+ // base = this.headerText === 'wordCount' ? this.base.wordCount : this.base.wordTextCount;
|
|
|
|
+ // } else {
|
|
|
|
+ // base = this.headerText === 'wordCount' ? this.base.vocabularyCount : this.base.vocabularyTextCount;
|
|
|
|
+ // }
|
|
|
|
+ // postapi({
|
|
|
|
+ // url: '/GCLSTCServer/tools/TS/statistics',
|
|
|
|
+ // data: {
|
|
|
|
+ // searchType: this.leftNavIndex,
|
|
|
|
+ // partitionKey: this.partitionKey,
|
|
|
|
+ // statisticsType: this.xifen ? 0 : 1,
|
|
|
|
+ // base: base || null,
|
|
|
|
+ // textType: this.headerText === 'wordCount' ? 0 : 1,
|
|
|
|
+ // },
|
|
|
|
+ // })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.allRatio = 0;
|
|
this.allRatio = 0;
|
|
this.allValue = 0;
|
|
this.allValue = 0;
|
|
- res.data.result.forEach((item) => {
|
|
|
|
|
|
+ res.data_list.forEach((item) => {
|
|
this.allRatio += Number(item.ratio);
|
|
this.allRatio += Number(item.ratio);
|
|
- this.allValue += item.value;
|
|
|
|
|
|
+ this.allValue += item.count;
|
|
|
|
+ item.value = item.count
|
|
});
|
|
});
|
|
- res.data.result.forEach((item) => {
|
|
|
|
- if (item.value !== 0) {
|
|
|
|
- item.ratio = ((item.value / this.allValue) * 100).toFixed(2);
|
|
|
|
|
|
+ res.data_list.forEach((item) => {
|
|
|
|
+ if (item.count !== 0) {
|
|
|
|
+ item.ratio = ((item.count / this.allValue) * 100).toFixed(2);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
this.allRatio = this.allRatio.toFixed(2);
|
|
this.allRatio = this.allRatio.toFixed(2);
|
|
- this.leftList = res.data.result;
|
|
|
|
|
|
+ this.leftList = res.data_list;
|
|
|
|
|
|
this.createEcharts('main_echarts', '柱状图', this.leftList, 0);
|
|
this.createEcharts('main_echarts', '柱状图', this.leftList, 0);
|
|
|
|
|
|
@@ -1211,79 +1219,80 @@ export default {
|
|
// 获取分析结果
|
|
// 获取分析结果
|
|
getArticleData() {
|
|
getArticleData() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- postapi({
|
|
|
|
- url: '/GCLSTCServer/tools/TS/analysis/parsed/text',
|
|
|
|
- data: {
|
|
|
|
- partitionKey: this.partitionKey,
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
|
|
+ publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
|
|
|
|
+ analyse_record_id: this.id,
|
|
|
|
+ }
|
|
|
|
+ )
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- let newdata = [];
|
|
|
|
- res.data.result.forEach((item) => {
|
|
|
|
- if (item.length !== 0) {
|
|
|
|
- newdata.push(item);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.ArticelData = newdata;
|
|
|
|
- let str = '';
|
|
|
|
- // 合并标点
|
|
|
|
- this.ArticelData.forEach((item) => {
|
|
|
|
- item.forEach((items) => {
|
|
|
|
- items.forEach((itemss, index) => {
|
|
|
|
- itemss.text.forEach((itemsss) => {
|
|
|
|
- if (this.chsFhList.indexOf(itemsss.word) === -1) {
|
|
|
|
- itemsss.isShow = true;
|
|
|
|
- } else {
|
|
|
|
- let obj = JSON.parse(JSON.stringify(itemsss));
|
|
|
|
- obj.isShow = true;
|
|
|
|
- if (index > 0) {
|
|
|
|
- if (items[index - 1].text[items[index - 1].text.length - 1].isShow) {
|
|
|
|
- items[index - 1].text.push(obj);
|
|
|
|
- itemsss.isShow = false;
|
|
|
|
- } else {
|
|
|
|
- items[index - 2].text.push(obj);
|
|
|
|
- itemsss.isShow = false;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- itemsss.isShow = true;
|
|
|
|
|
|
+ if(res.status===1){
|
|
|
|
+ let newdata = [];
|
|
|
|
+ res.parsed_text.paragraph_list.forEach((item) => {
|
|
|
|
+ if (item.length !== 0) {
|
|
|
|
+ newdata.push(item);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- str += itemsss.word;
|
|
|
|
});
|
|
});
|
|
- });
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- let index = 0;
|
|
|
|
- // 添加索引
|
|
|
|
- this.ArticelData.forEach((item) => {
|
|
|
|
- item.forEach((items) => {
|
|
|
|
- items.forEach((itemss) => {
|
|
|
|
- itemss.text.forEach((itemsss) => {
|
|
|
|
- if (itemsss.isShow) {
|
|
|
|
- itemsss.index = index;
|
|
|
|
- index += 1;
|
|
|
|
- }
|
|
|
|
|
|
+ this.ArticelData = newdata;
|
|
|
|
+ let str = '';
|
|
|
|
+ // 合并标点
|
|
|
|
+ this.ArticelData.forEach((item) => {
|
|
|
|
+ item.forEach((items) => {
|
|
|
|
+ items.forEach((itemss, index) => {
|
|
|
|
+ itemss.text.forEach((itemsss) => {
|
|
|
|
+ if (this.chsFhList.indexOf(itemsss.word) === -1) {
|
|
|
|
+ itemsss.isShow = true;
|
|
|
|
+ } else {
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(itemsss));
|
|
|
|
+ obj.isShow = true;
|
|
|
|
+ if (index > 0) {
|
|
|
|
+ if (items[index - 1].text[items[index - 1].text.length - 1].isShow) {
|
|
|
|
+ items[index - 1].text.push(obj);
|
|
|
|
+ itemsss.isShow = false;
|
|
|
|
+ } else {
|
|
|
|
+ items[index - 2].text.push(obj);
|
|
|
|
+ itemsss.isShow = false;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ itemsss.isShow = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ str += itemsss.word;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- });
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- let arr = [];
|
|
|
|
- this.ArticelData.forEach((item, i) => {
|
|
|
|
- arr.push([]);
|
|
|
|
- item.forEach((items) => {
|
|
|
|
- items.forEach((itemss) => {
|
|
|
|
- arr[i].push(itemss);
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- this.ArticelData = arr;
|
|
|
|
- this.textContent = str;
|
|
|
|
- let flag = sessionStorage.getItem('tablehighlight');
|
|
|
|
- if (this.$route.query.remarks && flag === 'true') {
|
|
|
|
- this.cutNav(Number(this.$route.query.leftNavIndex));
|
|
|
|
- this.wordTablehighlight(JSON.parse(this.$route.query.remarks), this.$route.query.color);
|
|
|
|
- }
|
|
|
|
- this.loading = false;
|
|
|
|
|
|
+ let index = 0;
|
|
|
|
+ // 添加索引
|
|
|
|
+ this.ArticelData.forEach((item) => {
|
|
|
|
+ item.forEach((items) => {
|
|
|
|
+ items.forEach((itemss) => {
|
|
|
|
+ itemss.text.forEach((itemsss) => {
|
|
|
|
+ if (itemsss.isShow) {
|
|
|
|
+ itemsss.index = index;
|
|
|
|
+ index += 1;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ let arr = [];
|
|
|
|
+ this.ArticelData.forEach((item, i) => {
|
|
|
|
+ arr.push([]);
|
|
|
|
+ item.forEach((items) => {
|
|
|
|
+ items.forEach((itemss) => {
|
|
|
|
+ arr[i].push(itemss);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.ArticelData = arr;
|
|
|
|
+ this.textContent = str;
|
|
|
|
+ let flag = sessionStorage.getItem('tablehighlight');
|
|
|
|
+ if (this.$route.query.remarks && flag === 'true') {
|
|
|
|
+ this.cutNav(Number(this.$route.query.leftNavIndex));
|
|
|
|
+ this.wordTablehighlight(JSON.parse(this.$route.query.remarks), this.$route.query.color);
|
|
|
|
+ }
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
this.loading = false;
|
|
this.loading = false;
|