|
@@ -28,10 +28,6 @@
|
|
|
<div v-if="data" class="list_main">
|
|
|
<div class="title">
|
|
|
<span style="margin-right: 16px">文本列表:</span>
|
|
|
- <span>
|
|
|
- {{ data.cur_page_begin_index }} ~ {{ Math.min(data.cur_page_end_index, data.total_count) }} /
|
|
|
- {{ data.total_count }}
|
|
|
- </span>
|
|
|
</div>
|
|
|
<div class="list">
|
|
|
<div v-for="(item, i) in data.record_list" :key="i + 'one'">
|
|
@@ -40,7 +36,14 @@
|
|
|
{{ item.first_sentence }}
|
|
|
</div>
|
|
|
<div class="time">{{ item.create_time }}</div>
|
|
|
- <div v-if="item.analysis_status === 3" class="cxjx" @click="anewSubmit(item.partition_key)">重新解析</div>
|
|
|
+ <div class="analysis_status">{{ analysis_status_list[item.analysis_status] }}</div>
|
|
|
+ <div
|
|
|
+ v-if="item.analysis_status === 3 || item.analysis_status === 0"
|
|
|
+ class="cxjx"
|
|
|
+ @click="anewSubmit(item.id)"
|
|
|
+ >
|
|
|
+ {{ item.analysis_status === 3 ? '重新解析' : '解析' }}
|
|
|
+ </div>
|
|
|
<el-popconfirm title="确定删除这一条记录吗?" @confirm="deleteOne(item.id, i)">
|
|
|
<img slot="reference" src="../../assets/teacherdev/delete-one.png" alt="删除" />
|
|
|
</el-popconfirm>
|
|
@@ -59,7 +62,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { postapi, AddTextFile, GetTextAnalyseRecordInfo, PageQueryMyTextAnalyseRecordList, analyse } from '@/api/api';
|
|
|
+import {
|
|
|
+ postapi,
|
|
|
+ AddTextFile,
|
|
|
+ GetTextAnalyseRecordInfo,
|
|
|
+ PageQueryMyTextAnalyseRecordList,
|
|
|
+ analyse,
|
|
|
+ reparse,
|
|
|
+} from '@/api/api';
|
|
|
import { getToken } from '@/utils/auth';
|
|
|
|
|
|
import HeaderPage from '@/components/Header';
|
|
@@ -77,6 +87,12 @@ export default {
|
|
|
pageSize: 20,
|
|
|
data: null,
|
|
|
file_id_list: [],
|
|
|
+ analysis_status_list: {
|
|
|
+ 0: '未解析',
|
|
|
+ 1: '解析中',
|
|
|
+ 2: '解析成功',
|
|
|
+ 3: '解析失败',
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -125,89 +141,39 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleJump(item) {
|
|
|
- if (item.analysis_status === 0) return this.analysisText(item.id);
|
|
|
+ if (item.analysis_status === 0) return this.anewSubmit(item.id);
|
|
|
if (item.analysis_status === 1) return this.$message.warning('当前数据正在解析,请稍后');
|
|
|
if (item.analysis_status === 2) {
|
|
|
return this.getTextAnalyseRecordInfo(item.id).then((record) => {
|
|
|
- this.jumpResultNew(record);
|
|
|
+ this.jumpResult(record);
|
|
|
});
|
|
|
}
|
|
|
- if (item.analysis_status === 3) return this.anewSubmit(item.partition_key);
|
|
|
+ if (item.analysis_status === 3) return this.anewSubmit(item.id);
|
|
|
},
|
|
|
+
|
|
|
/**
|
|
|
- * 解析上传但未解析的文本
|
|
|
+ * 跳转分析结果页
|
|
|
+ * @param {object} item
|
|
|
*/
|
|
|
- analysisText(id) {
|
|
|
- this.getTextAnalyseRecordInfo(id)
|
|
|
- .then((record) => {
|
|
|
- return record.txt;
|
|
|
- })
|
|
|
- .then((txt) => {
|
|
|
- this.loading = true;
|
|
|
- return analyse({
|
|
|
- analyse_record_id: id,
|
|
|
- tenantId: '',
|
|
|
- text: txt,
|
|
|
- });
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.jumpResult(res.data.result);
|
|
|
- this.pageQueryMyTextAnalyseRecordList();
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 新的跳转分析结果页(参数采用蛇形命名法)
|
|
|
- jumpResultNew(item) {
|
|
|
- if (item.analysis_status !== 2) {
|
|
|
- this.$message.warning('当前数据解析失败,请重新解析');
|
|
|
- return;
|
|
|
- }
|
|
|
- window.open(
|
|
|
- this.$router.resolve({
|
|
|
- path: '/textanalysis/Result',
|
|
|
- query: {
|
|
|
- partitionKey: item.partition_key,
|
|
|
- subjectWords: item.subject_words,
|
|
|
- wordTextCount: item.word_text_count,
|
|
|
- wordCount: item.word_count,
|
|
|
- vocabularyTextCount: item.vocabulary_text_count,
|
|
|
- vocabularyCount: item.vocabulary_count,
|
|
|
- pinyinCount: item.pinyin_count,
|
|
|
- pinyinTextCount: item.pinyin_text_count,
|
|
|
- pinyinDifficulty: item.pinyin_difficulty,
|
|
|
- wordDifficulty: item.word_difficulty,
|
|
|
- vocabularyDifficulty: item.vocabulary_difficulty,
|
|
|
- type: '文本分析',
|
|
|
- },
|
|
|
- }).href,
|
|
|
- '_blank',
|
|
|
- );
|
|
|
- },
|
|
|
-
|
|
|
- // 跳转分析结果页
|
|
|
jumpResult(item) {
|
|
|
- if (item.analysisStatus !== 2) {
|
|
|
- this.$message.warning('当前数据解析失败,请重新解析');
|
|
|
- return;
|
|
|
+ if (item.analysis_status !== 2) {
|
|
|
+ return this.$message.warning('当前数据解析失败,请重新解析');
|
|
|
}
|
|
|
window.open(
|
|
|
this.$router.resolve({
|
|
|
path: '/textanalysis/Result',
|
|
|
query: {
|
|
|
- partitionKey: item.partitionKey,
|
|
|
- subjectWords: item.subjectWords,
|
|
|
- wordTextCount: item.wordTextCount,
|
|
|
- wordCount: item.wordCount,
|
|
|
- vocabularyTextCount: item.vocabularyTextCount,
|
|
|
- vocabularyCount: item.vocabularyCount,
|
|
|
- pinyinCount: item.pinyinCount,
|
|
|
- pinyinTextCount: item.pinyinTextCount,
|
|
|
- pinyinDifficulty: item.pinyinDifficulty,
|
|
|
- wordDifficulty: item.wordDifficulty,
|
|
|
- vocabularyDifficulty: item.vocabularyDifficulty,
|
|
|
+ partition_key: item.partition_key,
|
|
|
+ subject_words: item.subject_words,
|
|
|
+ word_text_count: item.word_text_count,
|
|
|
+ word_count: item.word_count,
|
|
|
+ vocabulary_text_count: item.vocabulary_text_count,
|
|
|
+ vocabulary_count: item.vocabulary_count,
|
|
|
+ pinyin_count: item.pinyin_count,
|
|
|
+ pinyin_text_count: item.pinyin_text_count,
|
|
|
+ pinyin_difficulty: item.pinyin_difficulty,
|
|
|
+ word_difficulty: item.word_difficulty,
|
|
|
+ vocabulary_difficulty: item.vocabulary_difficulty,
|
|
|
type: '文本分析',
|
|
|
},
|
|
|
}).href,
|
|
@@ -237,41 +203,38 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- anewSubmit(partitionKey) {
|
|
|
+ /**
|
|
|
+ * 重新解析
|
|
|
+ * @param {string} analyse_record_id
|
|
|
+ */
|
|
|
+ anewSubmit(analyse_record_id) {
|
|
|
this.loading = true;
|
|
|
- postapi({
|
|
|
- url: '/GCLSTCServer/tools/TS/reparse',
|
|
|
- data: {
|
|
|
- partitionKey,
|
|
|
- },
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.jumpResult(res.data.result);
|
|
|
+ reparse({ analyse_record_id })
|
|
|
+ .then(({ record }) => {
|
|
|
+ this.jumpResult(record);
|
|
|
this.pageQueryMyTextAnalyseRecordList(true);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- // 分析
|
|
|
+ /**
|
|
|
+ * 分析
|
|
|
+ */
|
|
|
submit() {
|
|
|
if (this.txt === '') {
|
|
|
- this.$message.warning('请先输入内容');
|
|
|
- return;
|
|
|
+ return this.$message.warning('请先输入内容');
|
|
|
}
|
|
|
if (this.txt.length > 1000) {
|
|
|
- this.$message.warning('超出字数限制');
|
|
|
- return;
|
|
|
+ return this.$message.warning('超出字数限制');
|
|
|
}
|
|
|
this.loading = true;
|
|
|
analyse({
|
|
|
- analyse_record_id: '',
|
|
|
- tenantId: '',
|
|
|
text: this.txt,
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(({ record }) => {
|
|
|
this.txt = '';
|
|
|
- this.jumpResult(res.data.result);
|
|
|
+ this.jumpResult(record);
|
|
|
this.pageQueryMyTextAnalyseRecordList(true);
|
|
|
})
|
|
|
.finally(() => {
|
|
@@ -407,6 +370,7 @@ export default {
|
|
|
|
|
|
> div {
|
|
|
display: flex;
|
|
|
+ column-gap: 24px;
|
|
|
align-items: center;
|
|
|
height: 48px;
|
|
|
padding: 0 16px;
|
|
@@ -418,13 +382,11 @@ export default {
|
|
|
|
|
|
.number {
|
|
|
width: 20px;
|
|
|
- margin-right: 24px;
|
|
|
text-align: right;
|
|
|
}
|
|
|
|
|
|
.txt {
|
|
|
- width: 774px;
|
|
|
- margin-right: 24px;
|
|
|
+ width: 740px;
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
@@ -432,15 +394,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
.time {
|
|
|
- width: 190px;
|
|
|
- margin-right: 24px;
|
|
|
+ width: 135px;
|
|
|
}
|
|
|
|
|
|
.cxjx {
|
|
|
- margin-right: 24px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
+ .analysis_status {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
img {
|
|
|
width: 24px;
|
|
|
height: 24px;
|