自动化

This commit is contained in:
2024-12-22 17:11:36 +08:00
parent 3d658f030d
commit dcea82e412
47 changed files with 174271 additions and 5675 deletions

View File

@@ -275,7 +275,7 @@
</el-col>
</el-row>
</div>
<el-dialog title="Manuscript Basic Information" :visible.sync="Detailvisible" width="800px">
<el-dialog destroy-on-close title="Manuscript Basic Information" :visible.sync="Detailvisible" width="800px">
<div class="art_state_message">
<p>
<font>Title :</font><b>{{artMes.title}}</b>
@@ -359,6 +359,7 @@
</p>
</el-collapse-item>
</el-collapse>
</div>
<div class="art_file">
@@ -423,6 +424,8 @@
</p>
<br clear="both">
</div>
<common-word-html :articleId="articleId" style="box-sizing: border-box"
></common-word-html>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="Detailvisible=false">OK</el-button>
</span>
@@ -468,7 +471,8 @@
totalpageFileList: [],
manuscirptFileList: [],
supplementaryFileList:[],
fileL_supplementary:[]
fileL_supplementary:[],
wordTables:[],
};
},
created: function() {
@@ -680,8 +684,41 @@
},
// 上传文件
onSubmit() {
addWordTablesList(tables) {
console.log('tables at line 687:', tables)
var data = {
article_id: this.fileMesForm.articleId,
list: tables.map(e=>( {
table: JSON.stringify([...e]),
type: 0,
html_data: ''
})),
};
this.$api.post('api/Article/addArticleTable', data).then((res) => {
});
},
async clearFileManuscript() {
var that=this
await this.$api
.post('api/Article/reloadArticleImages', {
article_id: this.fileMesForm.articleId
})
.then((res) => {});
await this.$api
.post('api/Article/reloadArticleTable', {
article_id: this.fileMesForm.articleId
})
.then((res) => {that. addWordTablesList(that.wordTables);});
},
async onSubmit() {
console.log(this.fileMesForm)
var that=this;
//验证文件
if (this.fileMesForm.manuscirpt == undefined || this.fileMesForm.manuscirpt == '') {
this.$message.error(
@@ -694,19 +731,28 @@
return false;
}
this.loading = true;
this.$api
await this.$api
.post('api/Article/RepairBack', this.fileMesForm)
.then((res) => {
this.loading = false;
.then(async (res) => {
if (res.code == 0) {
await that.clearFileManuscript()
this.$message.success('Upload successful!');
this.loading = false;
setTimeout(()=>{
this.loading = false;
this.$router.push({
path: 'articleProcess',
query: {
id: this.articleId
}
});
},500)
} else {
this.$message.error('Failed to submit, please contact administrator!');
console.log(res.msg);
@@ -765,9 +811,21 @@
// this.fileMesForm.picturesAndTables.push('picturesAndTables/' + url);
// }
},
upSuccess_manuscirpt(res, file) {
upSuccess_manuscirpt(res, File) {
if (res.code == 0) {
this.fileMesForm.manuscirpt = 'manuscirpt/' + res.upurl;
if (File) {
var that = this;
const reader = new FileReader();
reader.onload = function (e) {
that.$commonJS.extractWordTablesToArrays(File.raw, function (wordTables) {
console.log('tablesHtml at line 61:', wordTables);
that.wordTables=wordTables
});
};
reader.readAsArrayBuffer(File.raw);
}
} else {
this.$message.error('service error' + res.msg);
}