This commit is contained in:
2025-04-23 15:03:58 +08:00
parent c9b62477e6
commit da7a953ee2
3 changed files with 74 additions and 29 deletions

BIN
dist.zip

Binary file not shown.

View File

@@ -238,7 +238,7 @@
</el-button> </el-button>
</p> </p>
</el-drawer> </el-drawer>
<el-dialog <el-dialog
destroy-on-close destroy-on-close
v-if="commentVisible" v-if="commentVisible"
title="Comment" title="Comment"
@@ -518,7 +518,7 @@ export default {
openLatexEditor(data) { openLatexEditor(data) {
console.log('data at line 563:', data); console.log('data at line 563:', data);
this.showLateX = true; this.showLateX = true;
this.LateXInfo=data this.LateXInfo = data;
}, },
isShowEditComment() { isShowEditComment() {
if (localStorage.getItem('U_role')) { if (localStorage.getItem('U_role')) {
@@ -680,7 +680,7 @@ export default {
} }
}, },
saveLateX(data) { saveLateX(data) {
console.log('data at line 735:', data) console.log('data at line 735:', data);
const { editorId, wmathId, latex } = data; const { editorId, wmathId, latex } = data;
const newLatex = latex ? latex.trim() : ''; const newLatex = latex ? latex.trim() : '';
if (!editorId || !wmathId) return; if (!editorId || !wmathId) return;
@@ -1573,7 +1573,34 @@ export default {
}); });
}, },
async saveTable(content) { async saveTable(content) {
const cleanTableData = (tableList) => {
if (tableList.length == 0) {
return [];
} else {
// 假设第一行是表头,保存表头
const header = tableList[0];
// 从第二行开始,移除与表头相同的行
const cleanedTable = tableList.filter((row, index) => {
// 如果是第一行,则保留
if (index === 0) return true;
// 比较当前行的每个单元格与表头是否相同
const isHeaderRow = row.every((cell, cellIndex) => {
return cell.text === header[cellIndex].text;
});
return !isHeaderRow; // 只保留与表头不同的行
});
return cleanedTable;
}
};
var cleanedTableList = content.table ? content.table : [];
console.log('content at line 998:', content); console.log('content at line 998:', content);
cleanedTableList = cleanTableData(content.table);
var strTitle = this.lineStyle.title; var strTitle = this.lineStyle.title;
strTitle = await this.$commonJS.decodeHtml(strTitle); strTitle = await this.$commonJS.decodeHtml(strTitle);
@@ -1582,18 +1609,18 @@ export default {
strNote = await this.$commonJS.decodeHtml(strNote); strNote = await this.$commonJS.decodeHtml(strNote);
} }
if (content && content.table && content.table.length > 0) { if (content && cleanedTableList && cleanedTableList.length > 0) {
if (this.lineStyle.visiTitle == 'Edit Table') { if (this.lineStyle.visiTitle == 'Edit Table') {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: 'Loading...', text: 'Loading...',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
this.$api this.$api
.post(this.urlList.editTable, { .post(this.urlList.editTable, {
amt_id: this.lineStyle.amt_id, amt_id: this.lineStyle.amt_id,
table_data: JSON.stringify(content.table), table_data: JSON.stringify(cleanedTableList),
html_data: content.html_data, html_data: content.html_data,
note: strNote, note: strNote,
title: strTitle title: strTitle
@@ -1609,16 +1636,18 @@ export default {
}); });
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
loading.close();
} }
}) })
.catch((err) => { .catch((err) => {
this.$message.error(err); this.$message.error(err);
loading.close();
}); });
} else { } else {
this.$api this.$api
.post(this.urlList.addTable, { .post(this.urlList.addTable, {
article_id: this.articleId, article_id: this.articleId,
table_data: JSON.stringify(content.table), table_data: JSON.stringify(cleanedTableList),
html_data: content.html_data, html_data: content.html_data,
note: this.lineStyle.note, note: this.lineStyle.note,
title: this.lineStyle.title title: this.lineStyle.title
@@ -1631,14 +1660,17 @@ export default {
this.$refs.commonWordHtmlTypeSetting.refresh('table'); this.$refs.commonWordHtmlTypeSetting.refresh('table');
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
loading.close();
} }
}) })
.catch((err) => { .catch((err) => {
this.$message.error(err); this.$message.error(err);
loading.close();
}); });
} }
} else { } else {
this.$message.error('Please fill in the table content!'); this.$message.error('Please fill in the table content!');
loading.close();
} }
}, },
async removeEvent(row) { async removeEvent(row) {

View File

@@ -1,18 +1,19 @@
<template> <template>
<div><span style="font-size: 14px; color: #606266; margin: 0 10px 0 0">Research direction :</span> <div>
<span style="font-size: 14px; color: #606266; margin: 0 10px 0 0">Research direction :</span>
<el-input <el-input
v-model="messform.email" v-model="messform.email"
clearable clearable
placeholder="Please enter email" placeholder="Please enter email"
style="width: 190px; display: inline-block; margin: 0 10px 20px 0" style="width: 190px; display: inline-block; margin: 0 10px 20px 0"
></el-input> ></el-input>
<el-input <el-input
v-model="messform.field" v-model="messform.field"
clearable clearable
placeholder="Please enter field" placeholder="Please enter field"
style="width: 190px; display: inline-block; margin: 0 10px 20px 0" style="width: 190px; display: inline-block; margin: 0 10px 20px 0"
></el-input> ></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">Search</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">Search</el-button>
<el-table <el-table
:data="revTable" :data="revTable"
border border
@@ -38,16 +39,27 @@
<!-- <p class="tab_tie_col" v-if="scope.row.majorstr != ''"><span>Major: </span>{{ scope.row.majorstr }}</p> --> <!-- <p class="tab_tie_col" v-if="scope.row.majorstr != ''"><span>Major: </span>{{ scope.row.majorstr }}</p> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rs_num" label="Review Record" width="180">
<template slot-scope="scope">
Major review: {{ scope.row.major_times }} ({{ scope.row.major_rate }}%)
<br />
Cancel review : {{ scope.row.rd_num }}
<!-- <font style="margin-left: 5px">(Reviewing:{{ scope.row.now }})</font> -->
</template>
</el-table-column>
<el-table-column prop="rs_num" label="Reviewed Times" width="140"> <el-table-column prop="rs_num" label="Reviewed Times" width="140">
<template slot-scope="scope"> <template slot-scope="scope">
Total: {{ scope.row.rs_num }} Total: {{ scope.row.rs_num }}
<br /> <br />
<div> <div>
<i class="el-icon-check" style="font-weight: bold; color: green;margin-right: 4px;"> </i> <span style="margin-right: 4px;color: green;">{{ scope.row.right_times }}</span> <i class="el-icon-check" style="font-weight: bold; color: green; margin-right: 4px"> </i>
<span style="margin-right: 4px; color: green">{{ scope.row.right_times }}</span>
<span>({{ scope.row.right_rate }}%)</span> <span>({{ scope.row.right_rate }}%)</span>
</div> </div>
<div> <div>
<i class="el-icon-close" style="font-weight: bold; color: red;margin-right: 4px;"> </i> <span style="margin-right: 4px;color: red;">{{ scope.row.error_times }}</span> <i class="el-icon-close" style="font-weight: bold; color: red; margin-right: 4px"> </i>
<span style="margin-right: 4px; color: red">{{ scope.row.error_times }}</span>
<span>({{ scope.row.error_rate }}%)</span> <span>({{ scope.row.error_rate }}%)</span>
</div> </div>
<!-- <font style="margin-left: 5px">(Reviewing:{{ scope.row.now }})</font> --> <!-- <font style="margin-left: 5px">(Reviewing:{{ scope.row.now }})</font> -->
@@ -109,23 +121,24 @@ export default {
methods: { methods: {
// 获取编辑列表数据 // 获取编辑列表数据
getDate() { getDate() {
this.$emit('loading',true) this.$emit('loading', true);
this.$api this.$api
.post('/api/Recommend/lists', this.messform) .post('/api/Recommend/lists', this.messform)
.then((res) => { .then((res) => {
this.$emit('loading', false);
this.revTable = res.data.lists; this.revTable = res.data.lists;
this.Total = res.data.total; this.Total = res.data.total;
this.$emit('loading',false)
// this.loading = false; // this.loading = false;
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
this.$emit('loading', false);
}); });
}, },
// 关键字搜索 // 关键字搜索
handleSearch() { handleSearch() {
// this.loading = true; // this.loading = true;
// console.log(this.messform) // console.log(this.messform)
this.getDate(); this.getDate();