|
@@ -30,7 +30,7 @@
|
|
|
<span style="margin-right: 16px">文本列表:</span>
|
|
|
</div>
|
|
|
<div class="list">
|
|
|
- <div v-for="(item, i) in data.record_list" :key="i + 'one'">
|
|
|
+ <div v-for="(item, i) in data.record_list" :key="`${i}one`">
|
|
|
<div class="number">{{ i + 1 }}</div>
|
|
|
<div class="txt" @click="handleJump(item)">
|
|
|
{{ item.first_sentence }}
|
|
@@ -44,7 +44,7 @@
|
|
|
>
|
|
|
{{ item.analysis_status === 3 ? '重新解析' : '解析' }}
|
|
|
</div>
|
|
|
- <el-popconfirm title="确定删除这一条记录吗?" @confirm="deleteOne(item.id, i)">
|
|
|
+ <el-popconfirm title="确定删除这一条记录吗?" @confirm="deleteTextAnalyseRecord(item.id)">
|
|
|
<img slot="reference" src="../../assets/teacherdev/delete-one.png" alt="删除" />
|
|
|
</el-popconfirm>
|
|
|
</div>
|
|
@@ -69,6 +69,7 @@ import {
|
|
|
PageQueryMyTextAnalyseRecordList,
|
|
|
analyse,
|
|
|
reparse,
|
|
|
+ DeleteTextAnalyseRecord,
|
|
|
} from '@/api/api';
|
|
|
import { getToken } from '@/utils/auth';
|
|
|
|
|
@@ -183,23 +184,16 @@ export default {
|
|
|
/**
|
|
|
* 删除一条记录
|
|
|
* @param {string} id
|
|
|
- * @param {number} index
|
|
|
*/
|
|
|
- deleteOne(id, index) {
|
|
|
+ deleteTextAnalyseRecord(id) {
|
|
|
this.loading = true;
|
|
|
- postapi({
|
|
|
- url: '/GCLSTCServer/tools/TS/analysis/record/del',
|
|
|
- data: {
|
|
|
- id,
|
|
|
- },
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.data.record_list.splice(index, 1);
|
|
|
- this.data.total_count -= 1;
|
|
|
- this.$message.success(res.msg);
|
|
|
+ DeleteTextAnalyseRecord({ id })
|
|
|
+ .then(() => {
|
|
|
+ this.pageQueryMyTextAnalyseRecordList();
|
|
|
+ this.$message.success('删除成功');
|
|
|
this.loading = false;
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
+ .finally(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|