|
@@ -153,19 +153,19 @@
|
|
|
</div>
|
|
|
<div class="btn_set">
|
|
|
<div class="btn">
|
|
|
- <div class="btn_dv" style="margin-right: 16px" @click="ciyunEvent">
|
|
|
+ <div class="btn_dv" style="margin-right: 12px" @click="ciyunEvent">
|
|
|
<img src="../../assets/teacherdev/icon-ciyun.png" alt="" />
|
|
|
词云
|
|
|
</div>
|
|
|
- <div class="btn_dv" style="margin-right: 16px" @click="gowordTable">
|
|
|
+ <div class="btn_dv" style="margin-right: 12px" @click="gowordTable">
|
|
|
<img src="../../assets/teacherdev/icon-cibiao.png" alt="" />
|
|
|
词表
|
|
|
</div>
|
|
|
- <div class="btn_dv" style="margin-right: 24px" @click="downArticle">
|
|
|
+ <div class="btn_dv" style="margin-right: 12px" @click="downArticle">
|
|
|
<img src="../../assets/teacherdev/icon-down.png" alt="" />
|
|
|
下载
|
|
|
</div>
|
|
|
- <div class="btn_dv" style="margin-right: 24px" @click="checkArticle">
|
|
|
+ <div class="btn_dv" style="margin-right: 12px" @click="checkArticle">
|
|
|
<img src="../../assets/teacherdev/pencil-ruler-line.png" alt="" />
|
|
|
校对
|
|
|
</div>
|
|
@@ -191,64 +191,81 @@
|
|
|
</div>
|
|
|
<div class="set">
|
|
|
<el-switch
|
|
|
- v-model="fenci"
|
|
|
+ v-model="pinyinShow"
|
|
|
active-color="#735CFF"
|
|
|
+ style="margin-right: 12px"
|
|
|
:width="26"
|
|
|
- style="margin-right: 24px"
|
|
|
- inactive-text="分词"
|
|
|
+ inactive-text="拼音"
|
|
|
/>
|
|
|
- <el-switch v-model="pinyinShow" active-color="#735CFF" :width="26" inactive-text="显示拼音" />
|
|
|
<el-switch
|
|
|
v-if="pinyinShow"
|
|
|
v-model="pinyinBottom"
|
|
|
active-color="#735CFF"
|
|
|
:width="26"
|
|
|
inactive-text="拼音在下"
|
|
|
- style="margin-left: 24px"
|
|
|
+ style="margin-right: 12px"
|
|
|
@change="changePinyinPosition"
|
|
|
/>
|
|
|
+ <el-switch
|
|
|
+ v-model="fenci"
|
|
|
+ active-color="#735CFF"
|
|
|
+ :width="26"
|
|
|
+ style="margin-right: 12px"
|
|
|
+ inactive-text="分词"
|
|
|
+ />
|
|
|
+ <el-switch
|
|
|
+ v-if="fenci"
|
|
|
+ v-model="cixing"
|
|
|
+ active-color="#735CFF"
|
|
|
+ :width="26"
|
|
|
+ style="margin-right: 12px"
|
|
|
+ inactive-text="词性"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right_main">
|
|
|
- <div class="right_main_top">
|
|
|
- <div title="采用TTR公式衡量文本丰富度,TTR指不同音节数量与总数量的比值。">
|
|
|
- <span
|
|
|
- >音节丰富度
|
|
|
- <span style="margin-left: 5px">
|
|
|
- {{ (difficulty.pinyinDifficulty * 1).toFixed(2) }}
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="right_main_top">
|
|
|
+ <div title="采用TTR公式衡量文本丰富度,音节丰富度指不同音节数量与总数量的比值。">
|
|
|
+ <span
|
|
|
+ >音节丰富度
|
|
|
+ <span style="margin-left: 5px">
|
|
|
+ {{ (difficulty.pinyinDifficulty * 1).toFixed(2) }}
|
|
|
+ </span>
|
|
|
</span>
|
|
|
- </span>
|
|
|
- <span class="line"></span>
|
|
|
- <span>{{ base.pinyinCount }} / {{ base.pinyinTextCount }}</span>
|
|
|
- </div>
|
|
|
- <div class="twoline">
|
|
|
- <span class="line"></span>
|
|
|
- <span class="line"></span>
|
|
|
- </div>
|
|
|
- <div title="采用TTR公式衡量文本丰富度,TTR指不同汉字数量与总数量的比值。">
|
|
|
- <span
|
|
|
- >汉字丰富度
|
|
|
- <span style="margin-left: 5px">
|
|
|
- {{ (difficulty.wordDifficulty * 1).toFixed(2) }}
|
|
|
+ <span class="line"></span>
|
|
|
+ <span>{{ base.pinyinCount }} / {{ base.pinyinTextCount }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="twoline">
|
|
|
+ <span class="line"></span>
|
|
|
+ <span class="line"></span>
|
|
|
+ </div>
|
|
|
+ <div title="采用TTR公式衡量文本丰富度,汉字丰富度指不同汉字数量与总数量的比值。">
|
|
|
+ <span
|
|
|
+ >汉字丰富度
|
|
|
+ <span style="margin-left: 5px">
|
|
|
+ {{ (difficulty.wordDifficulty * 1).toFixed(2) }}
|
|
|
+ </span>
|
|
|
</span>
|
|
|
- </span>
|
|
|
- <span class="line"></span>
|
|
|
- <span>{{ base.wordCount }} / {{ base.wordTextCount }}</span>
|
|
|
- </div>
|
|
|
- <div class="twoline">
|
|
|
- <span class="line"></span>
|
|
|
- <span class="line"></span>
|
|
|
- </div>
|
|
|
- <div title="采用TTR公式衡量文本丰富度,TTR指不同词汇数量与总数量的比值。">
|
|
|
- <span
|
|
|
- >词汇丰富度
|
|
|
- <span style="margin-left: 5px">
|
|
|
- {{ (difficulty.vocabularyDifficulty * 1).toFixed(2) }}
|
|
|
+ <span class="line"></span>
|
|
|
+ <span>{{ base.wordCount }} / {{ base.wordTextCount }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="twoline">
|
|
|
+ <span class="line"></span>
|
|
|
+ <span class="line"></span>
|
|
|
+ </div>
|
|
|
+ <div title="采用TTR公式衡量文本丰富度,词汇丰富度指不同词汇数量与总数量的比值。">
|
|
|
+ <span
|
|
|
+ >词汇丰富度
|
|
|
+ <span style="margin-left: 5px">
|
|
|
+ {{ (difficulty.vocabularyDifficulty * 1).toFixed(2) }}
|
|
|
+ </span>
|
|
|
</span>
|
|
|
- </span>
|
|
|
- <span class="line"></span>
|
|
|
- <span>{{ base.vocabularyCount }} / {{ base.vocabularyTextCount }}</span>
|
|
|
+ <span class="line"></span>
|
|
|
+ <span>{{ base.vocabularyCount }} / {{ base.vocabularyTextCount }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <span class="edit-btn" @click="editArticle()"><i class="el-icon-edit"></i>修改文本</span>
|
|
|
</div>
|
|
|
<div class="articel">
|
|
|
<div v-for="(items, index) in ArticelData" :key="index + 'paragraph'" class="paragraph">
|
|
@@ -472,6 +489,15 @@
|
|
|
>{{ word.word }}</span
|
|
|
>
|
|
|
</template>
|
|
|
+ <span
|
|
|
+ v-if="cixing"
|
|
|
+ class="hanzi"
|
|
|
+ :style="{
|
|
|
+ fontSize: wordFontsize - 4 + 'px',
|
|
|
+ lineHeight: wordLineHeight + 'px',
|
|
|
+ }"
|
|
|
+ >{{ '_' + itemss.pos }}</span
|
|
|
+ >
|
|
|
</span>
|
|
|
<br v-if="pinyinShow" />
|
|
|
<template v-if="pinyinShow && pinyinBottom">
|
|
@@ -870,6 +896,29 @@
|
|
|
<div id="echarts_none_1" style="display: none; width: 592px; height: 568px"></div>
|
|
|
<div id="echarts_none_2" style="display: none; width: 592px; height: 568px"></div>
|
|
|
<div id="echarts_none_3" style="display: none; width: 592px; height: 568px"></div>
|
|
|
+ <el-dialog
|
|
|
+ :show-close="false"
|
|
|
+ :visible.sync="editArticleFlag"
|
|
|
+ width="800px"
|
|
|
+ :before-close="handleClose"
|
|
|
+ :modal="false"
|
|
|
+ class="edit-dialog"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="noPosContent"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入文本"
|
|
|
+ :autosize="{ minRows: 9 }"
|
|
|
+ :maxlength="3000"
|
|
|
+ />
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <span class="left">{{ noPosContent.length }}/{{ 3000 }}</span>
|
|
|
+ <div>
|
|
|
+ <el-button @click="handleClose">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveWord(id)">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -957,22 +1006,14 @@ export default {
|
|
|
routerData: null,
|
|
|
id: null,
|
|
|
userID: this.$route.query.userID,
|
|
|
+ cixing: false, // 词性开关
|
|
|
+ editArticleFlag: false, // 修改文本
|
|
|
+ noPosContent: '',
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.routerData = this.$route.query;
|
|
|
if (!this.routerData) return;
|
|
|
- // this.partitionKey = Number(this.routerData.partition_key);
|
|
|
- // this.subjectWords = JSON.parse(this.routerData.subject_words || '[]');
|
|
|
- // this.base.wordTextCount = Number(this.routerData.word_text_count);
|
|
|
- // this.base.wordCount = Number(this.routerData.word_count);
|
|
|
- // this.base.vocabularyTextCount = Number(this.routerData.vocabulary_text_count);
|
|
|
- // this.base.vocabularyCount = Number(this.routerData.vocabulary_count);
|
|
|
- // this.base.pinyinCount = Number(this.routerData.pinyin_count);
|
|
|
- // this.base.pinyinTextCount = Number(this.routerData.pinyin_text_count);
|
|
|
- // this.difficulty.pinyinDifficulty = this.routerData.pinyin_difficulty;
|
|
|
- // this.difficulty.vocabularyDifficulty = this.routerData.vocabulary_difficulty;
|
|
|
- // this.difficulty.wordDifficulty = this.routerData.word_difficulty;
|
|
|
this.id = this.routerData.id;
|
|
|
this.getstatistics();
|
|
|
},
|
|
@@ -1755,6 +1796,7 @@ export default {
|
|
|
// 获取分析结果
|
|
|
getArticleData() {
|
|
|
this.loading = true;
|
|
|
+ let posStr = '';
|
|
|
publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo', {
|
|
|
analyse_record_id: this.id,
|
|
|
})
|
|
@@ -1863,6 +1905,22 @@ export default {
|
|
|
this.difficulty.vocabularyDifficulty = res.record.vocabulary_ttr;
|
|
|
this.difficulty.wordDifficulty = res.record.word_ttr;
|
|
|
this.pinyinBottom = res.record.pinyin_mark_position !== 0;
|
|
|
+ newdata.forEach((item, index) => {
|
|
|
+ item.forEach((items, indexs) => {
|
|
|
+ items.forEach((itemss, indexss) => {
|
|
|
+ let strWord = '';
|
|
|
+ itemss.text.forEach((itemT, indexT) => {
|
|
|
+ strWord += itemT.word;
|
|
|
+ });
|
|
|
+ posStr += strWord; //如果是英文 需要加空格
|
|
|
+ });
|
|
|
+ posStr += '\n';
|
|
|
+ });
|
|
|
+ if (index !== newdata.length - 1) {
|
|
|
+ posStr += '\n';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.noPosContent = posStr;
|
|
|
this.loading = false;
|
|
|
}
|
|
|
})
|
|
@@ -1905,6 +1963,75 @@ export default {
|
|
|
path: '/TextAnalysis',
|
|
|
});
|
|
|
},
|
|
|
+ // 修改文本
|
|
|
+ editArticle() {
|
|
|
+ this.editArticleFlag = true;
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.editArticleFlag = false;
|
|
|
+ },
|
|
|
+ saveWord(analyse_record_id) {
|
|
|
+ let saveArr = [];
|
|
|
+ let arr = this.noPosContent.split('\n');
|
|
|
+ let indexP = 0; // 段落索引
|
|
|
+ let indexS = 0; // 句子索引
|
|
|
+ let flag = true;
|
|
|
+ arr.forEach((item) => {
|
|
|
+ if (item === '') {
|
|
|
+ saveArr.push([]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ arr.forEach((item, index) => {
|
|
|
+ if (item === '') {
|
|
|
+ indexP++;
|
|
|
+ indexS = 0;
|
|
|
+ } else {
|
|
|
+ let arrs = item.trim().split(' ');
|
|
|
+ let saveItem = [];
|
|
|
+ arrs.forEach((items, indexs) => {
|
|
|
+ // if(items.lastIndexOf('_')===-1||this.posList.indexOf(items.substring(items.lastIndexOf('_')+1).trim())==-1){
|
|
|
+ // flag = false
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ let obj = {
|
|
|
+ word: items.lastIndexOf('_') > -1 ? items.substring(0, items.lastIndexOf('_')).trim() : items,
|
|
|
+ pos: '',
|
|
|
+ };
|
|
|
+ saveItem.push(obj);
|
|
|
+ });
|
|
|
+ saveArr[indexP].push(saveItem);
|
|
|
+ indexS++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // if(!flag){
|
|
|
+ // this.$message.warning('词性有错误请检查')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ this.loading = true;
|
|
|
+ publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord', {
|
|
|
+ analyse_record_id: this.id,
|
|
|
+ proofread_text: {
|
|
|
+ paragraph_list: saveArr,
|
|
|
+ },
|
|
|
+ is_proofread_cx: 'false',
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ this.editArticleFlag = false;
|
|
|
+ reparse({ analyse_record_id })
|
|
|
+ .then(({ record }) => {
|
|
|
+ this.getArticleData();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -2409,6 +2536,7 @@ export default {
|
|
|
font-weight: 600;
|
|
|
line-height: 22px;
|
|
|
color: #a5a5a5;
|
|
|
+ flex: 1;
|
|
|
|
|
|
.twoline {
|
|
|
margin: 0 20px;
|
|
@@ -2429,7 +2557,16 @@ export default {
|
|
|
background: #525252;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .edit-btn {
|
|
|
+ color: #000;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 22px;
|
|
|
+ cursor: pointer;
|
|
|
+ .el-icon-edit {
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
.articel {
|
|
|
width: 640px;
|
|
|
margin: 0 auto;
|
|
@@ -2507,4 +2644,31 @@ export default {
|
|
|
height: 8px;
|
|
|
}
|
|
|
}
|
|
|
+.edit-dialog {
|
|
|
+ .el-dialog__header {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ .el-dialog__body {
|
|
|
+ padding: 16px;
|
|
|
+ }
|
|
|
+ .el-dialog__footer {
|
|
|
+ padding-top: 0;
|
|
|
+ }
|
|
|
+ .dialog-footer {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .el-button {
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.15);
|
|
|
+ background: #f8f8f8;
|
|
|
+ box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.04);
|
|
|
+ width: 124px;
|
|
|
+ padding: 8px;
|
|
|
+ color: #000;
|
|
|
+ &.el-button--primary {
|
|
|
+ background: #ffc600;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|