<template>
	<div>
		<div class="crumbs">
			<el-breadcrumb separator="/">
				<el-breadcrumb-item>
					<i class="el-icon-lx-calendar"></i>
					<router-link :to="{path:'/articleList'}">
						<span class="top_dao"> Manuscript list</span>
					</router-link>
					>> Manuscript process revision
				</el-breadcrumb-item>
			</el-breadcrumb>
		</div>
		<!-- <div class="art_state_text">
			Dear author
		</div> -->
		<div class="container_state" v-loading="loading">
			<p class="art_suthor_message">
				<font style="color: #888;">ID : {{artMes.accept_sn}}</font>
				<b>{{artMes.title}}
					<i @click="man_detal()" class="det_cssep">Manuscript Detail</i>
				</b>
			</p>
			<el-row :gutter="30">
				<el-col :span="16">
					<div style="border: 1px solid #dcdfe6;border-radius: 5px;background-color: #fff;">
						<div class="art_author_">
							<h2>
								Comments from reviewers
							</h2>
							<el-collapse v-model="activeComment" v-if="comentDeploy!=''">
								<el-collapse-item v-for="(item,index) in comentDeploy" :name="index"
									class="art_author_list">
									<template slot="title">
										<b class="com_shu">{{index+1}}</b>
										Reviewer Comment
										<font style="margin: 0 0 0 50px;color: #888;">
											<i class="el-icon-time" style="margin:0 2px 0 0;"></i>
											{{formatDate1(item.ctime)}}
										</font>
									</template>
									<div class="art_author_coment">
										<p v-if="item.qu9_contents!=''">
											<font>Does the title represent manuscript's contents?</font>
										<pre>{{item.qu9_contents}}</pre>
										</p>
										<p v-if="item.qu10_contents!=''">
											<font>Is the Abstract accurate and concise?</font>
										<pre>{{item.qu10_contents}}</pre>
										</p>
										<p v-if="item.qu11_contents!=''">
											<font>Are the approach/ methods properly described?</font>
										<pre>{{item.qu11_contents}}</pre>
										</p>
										<p v-if="item.qu12_contents!=''">
											<font>Are the conclusions and interpretations sound?</font>
										<pre>{{item.qu12_contents}}</pre>
										</p>
										<p v-if="item.qu13_contents!=''">
											<font>Are the references properly cited?</font>
										<pre>{{item.qu13_contents}}</pre>
										</p>
										<p v-if="item.comments!=''">
											<font>Comments for the Authors</font>
										<pre>{{item.comments}}</pre>
										</p>
									</div>
								</el-collapse-item>
							</el-collapse>
							<p v-if="comentDeploy==''" style="color: #888888;margin: 0 0 0 10px;">No Comment</p>
						</div>

						<div class="art_author_">
							<h2 :style="{'margin-bottom':(ComEditor==''?'0':'20px')}">
								Comments from editor
								<span v-if="ComEditor==''"
									style="color: #888888;margin: 0 0 0 10px;font-size: 12px;font-weight: normal;margin-left: 30px;letter-spacing: 0;">No
									Comment</span>
							</h2>
							<div v-if="ComEditor!=''" v-for="(item,index) in ComEditor" class="art_author_peng">
								<span style="color: #555;">{{index+1}}. Editor Comment</span>
								<i class="el-icon-time" style="margin:0 6px 0 50px;color: #888888;"></i>
								<span style="color: #888888;">{{formatDate1(item.ap_ctime)}}</span>
								<p style="margin: 5px 0 0 16px;">{{item.proposal_content}}</p>
							</div>

						</div>

						<div style="height: 1px;width: 95%;background-color: #EBEEF5;margin: 0 auto;"></div>

						<div class="art_author_">
							<h2 :style="{'margin-bottom':(ComRespe==''?'0':'20px')}">
								Response to reviewers
								<span v-if="ComRespe==''"
									style="color: #888888;margin: 0 0 0 10px;font-size: 12px;font-weight: normal;margin-left: 30px;letter-spacing: 0;">No
									Response</span>
							</h2>
							<div style="margin: 10px 0 0px 10px;line-height: 24px;">
								<a v-if="ComRespe!=''" v-for="(item,index) in ComRespe" :href="mediaUrl + item.file_url"
									style="color: #333;display: block;margin-bottom: 10px;">
									<span>{{index+1}}. Response Content</span>
									<img src="../../assets/img/icon_0.png"
										style="width: 15px;vertical-align: text-bottom;margin: 0 0 0 20px;">

									<span style="color: #888888;">
										<i class="el-icon-time"
											style="margin:0 6px 0 20px;"></i>{{formatDate1(item.artr_ctime)}}
									</span>
									<i class="el-icon-download download"
										style="margin:0 6px 0 20px;font-weight: 700;color: #75abf1;"></i>
								</a>
							</div>
						</div>
					</div>

					<div class="art_caozuo_">
						<div class="art_author_btn">
							<!-- <div class="art_file_btn_text">
								Dear author
							</div> -->
							<!-- <h4>Cover letter :</h4>
							<p>
								<el-upload class="upload-demo" :action="upload_coverLetter" accept=".pdf, .doc, .docx" name="coverLetter"
								 :before-upload="beforeupload_coverLetter" :on-error="uperr_coverLetter" :on-success="upSuccess_coverLetter"
								 :limit="1" :on-exceed="alertlimit" :on-remove="removefilecoverLetter">
									<div class="el-upload__text" style="padding:8px 5px;">
										<em>Click Upload</em>
									</div>
									<div class="el-upload__tip" slot="tip">Only pdf and word files can be uploaded (.pdf,.doc,.docx)</div>
								</el-upload>
							</p>
							<br clear="both"> -->
							<h4><b style="margin-right:5px;color: red;">*</b>Manuscirpt :</h4>
							<p>
								<el-upload class="upload-demo" :action="upload_manuscirpt" accept=".docx"
									name="manuscirpt" :before-upload="beforeupload_manuscirpt"
									:on-error="uperr_coverLetter" :on-success="upSuccess_manuscirpt" :limit="1"
									:on-exceed="alertlimit" :on-remove="removefilemanuscirpt">
									<div class="el-upload__text" style="padding:8px 5px;">
										<em>Click Upload</em>
									</div>
									<div class="el-upload__tip" slot="tip">Only word and compressed files (.docx)</div>
								</el-upload>
							</p>
							<br clear="both">
							<h4>Supplementary Material :</h4>
							<p>
								<el-upload class="upload-demo up_newstyle" :action="upload_supplementary" accept=".zip"
								name="supplementary" :before-upload="beforeupload_supplementary"
								:on-error="uperr_coverLetter" :on-success="upSuccess_supplementary" :limit="1"
								:on-exceed="alertlimit" :on-remove="removefilesupplementary"
								>
								<div class="el-upload__text" style="padding:8px 5px;">
										<em>Click Upload</em>
									</div>
								<div class="el-upload__tip" slot="tip">
								Only ZIP files can be uploaded (file formats: .zip).
								</div>
							</el-upload>
							</p>
							<br clear="both">
							<h4>Figures :</h4>
							<p>
								<el-upload class="upload-demo" :action="upload_picturesAndTables" accept=".rar, .zip"
									name="picturesAndTables" :before-upload="beforeupload_picturesAndTables"
									:on-error="uperr_coverLetter" :on-success="upSuccess_picturesAndTables" :limit="1"
									:on-exceed="alertlimit" :on-remove="removefilepicturesAndTables">
									<div class="el-upload__text" style="padding:8px 5px;">
										<em>Click Upload</em>
									</div>
									<div class="el-upload__tip" slot="tip">Only compressed files can be uploaded
										(.rar,.zip)</div>
								</el-upload>
							</p>
							<br clear="both">
							<h4><b style="margin-right:5px;color: red;">*</b>Response to reviewers :</h4>
							<p>
								<el-upload class="upload-demo" :action="upload_response" accept=".docx,"
									name="articleResponse" :before-upload="beforeupload_response"
									:on-error="uperr_coverLetter" :on-success="upSuccess_response" :limit="1"
									:on-exceed="alertlimit" :on-remove="removefileresponse">
									<div class="el-upload__text" style="padding:8px 5px;">
										<em>Click Upload</em>
									</div>
									<div class="el-upload__tip" slot="tip">Only word files can be uploaded
										(.docx)</div>
								</el-upload>
							</p>
							<br clear="both">
							<el-button type="primary" @click="onSubmit" style="margin: 0 0 0 200px;">Submit Revision
							</el-button>
						</div>
					</div>
				</el-col>
				<el-col :span="8">

					<div class="kuang_communtion">
						<h2>
							Communication
						</h2>
						<div v-for="item in talkMsgs" class="kuang_communtion_conmt">
							<div v-if="item.user_id != artMes.user_id" class="talk_aued">
								<p> Editor : </p>
								<el-card>
									<p style="white-space: pre-wrap;">{{ item.ad_content }}</p>
								</el-card>
								<b>{{formatDate(item.ad_ctime)}}</b>
							</div>
							<div v-if="item.user_id == artMes.user_id" class="talk_aued talk_edit">
								<p> Author : </p>
								<el-card>
									<p style="white-space: pre-wrap;">{{ item.ad_content }}</p>
								</el-card>
								<b>{{formatDate(item.ad_ctime)}}</b>
							</div>
						</div>
						<div class="kuang_communtion_input">
							<p v-if="talkMsgs"></p>
							<span class="text_bor_ghu">
								<el-input type="textarea" rows="3" v-model="msgform.ad_content"
									placeholder="You can initiate short conversations with the editor." resize="none">
								</el-input>
								<el-button type="primary" @click="saveMsg">Send</el-button>
							</span>

							<font style="font-size: 12px;color: #999;padding:12px 5px 0 5px;display: block;">
								This column is served as an instant correspondence between the editor and authors,
								aiming to acquire a faster
								way of communication than E-Mail. If you have any questions, please start the instant
								corresponding, and the
								editors will reply to you in 24 hours.
								<br>
								<font style="color: #006699;">Please Attention</font>
								<br>
								<font style="color: #006699;">1.</font> If you need to send files as attachments, please
								send them to
								tmr@tmrjournals.com
								<br>
								<font style="color: #006699;">2.</font> Please do not upload the primary documents like
								the cover letter, the
								reply to the reviewer comments,
								etc.
							</font>
						</div>
					</div>
				</el-col>
			</el-row>
		</div>
		<el-dialog title="Manuscript Basic Information" :visible.sync="Detailvisible" width="800px">
			<div class="art_state_message">
				<p>
					<font>Title :</font><b>{{artMes.title}}</b>
				</p>
				<p>
					<font>Type :</font><b>{{ellType(artMes.type)}}</b>
				</p>
				<p v-show="artMes.type=='A'">
					<font>Ethical Approval :</font><b>{{artMes.approval?'Yes':'No'}}</b>
				</p>
				<p>
					<font>Journal :</font><b>{{journal_me}}</b>
				</p>
				<p v-if="artMes.special_num > 0">
					<font>Special Issues :</font><b>{{ artMes.special_title }}</b>
				</p>
				<p>
					<font>Major :</font><b>{{artMes.major}}</b>
				</p>
				<el-collapse v-model="activeNames" class="auth_colla auth_colla_new">
					<el-collapse-item :title="authorList_name" name="1">
						<div v-for="(item, index) in artMes.authorList" class="auth_mess">
							<h4 style="font-weight: bolder;">
								<img src="../../assets/img/state_one.png" v-if="item.isSuper"
									style="width: 15px;margin: 0 2px 0 0;vertical-align: text-bottom;">
								{{item.firstname}} {{item.lastname}} {{item.isSuper?'#':''}}{{item.isReport?'*':''}}
							</h4>
							<div>
								<p v-if="item.email">
									<img src="../../assets/img/state_email.png" v-if="item.isReport"
										style="width: 14px;margin: 0 8px 0 0;vertical-align: text-bottom;">
									<font>Email : </font>{{item.email}}
								</p>
								<p v-if="item.orcid">
									<font>ORCID iD : </font>{{item.orcid}}
								</p>
								<p>
									<font>First Author : </font>
									<b v-if="item.isSuper">Yes</b>
									<b v-if="!item.isSuper">No</b>
								</p>
								<p>
									<font>Corresponding Author :</font>
									<b v-if="item.isReport">Yes</b>
									<b v-if="!item.isReport">No</b>
								</p>
								<p v-if="item.address">
									<font>Address : </font>{{item.address}}
								</p>
								<p v-if="item.company">
									<font>Affiliation : </font>{{item.company}}
								</p>
								<p v-if="item.department">
									<font>Department : </font>{{item.department}}
								</p>
								<p v-if="item.title">
									<font>Title : </font>{{item.title}}
								</p>
								<p v-if="item.country">
									<font>Country : </font>{{item.country}}
								</p>
							</div>
						</div>
					</el-collapse-item>
				</el-collapse>
				<el-collapse class="auth_colla auth_colla_new" style="margin-top: -15px;border-top: 0;">
					<el-collapse-item>
						<template slot="title">
							Abstract
							<font v-if="artMes.keywords" style="margin-left: 3px;">, Keywords</font>
							<font v-if="artMes.fund" style="margin-left: 3px;">, Fund</font>
						</template>
						<p>
							<font>Abstract :</font><b>{{artMes.abstrart}}</b>
						</p>
						<p v-if="artMes.keywords">
							<font>Keywords :</font><b>{{artMes.keywords}}</b>
						</p>
						<p v-if="artMes.fund">
							<font>Fund :</font><b>{{artMes.fund}}</b>
						</p>
					</el-collapse-item>
				</el-collapse>
			</div>

			<div class="art_file">
				<h4 v-if="coverLetterFileList">Cover letter : </h4>
				<p v-if="coverLetterFileList">
					<a v-for="item in coverLetterFileList" :href="mediaUrl + item.file_url">
						<img src="../../assets/img/icon_0.png">
						<span>
							<font>Uploader : </font>{{item.username}}
							<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
						</span>
						<i class="el-icon-download download"></i>
					</a>
				</p>
				<br clear="both" v-if="coverLetterFileList">
				<h4 v-if="picturesAndTablesFileList">Figures : </h4>
				<p v-if="picturesAndTablesFileList">
					<a v-for="item in picturesAndTablesFileList" :href="mediaUrl + item.file_url">
						<img src="../../assets/img/icon_0.png">
						<span>
							<font>Uploader : </font>{{item.username}}
							<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
						</span>
						<i class="el-icon-download download"></i>
					</a>
				</p>
				<br clear="both" v-if="picturesAndTablesFileList">
				<h4 v-if="totalpageFileList">Title page : </h4>
				<p v-if="totalpageFileList">
					<a v-for="item in totalpageFileList" :href="mediaUrl + item.file_url">
						<img src="../../assets/img/icon_0.png">
						<span>
							<font>Uploader : </font>{{item.username}}
							<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
						</span>
						<i class="el-icon-download download"></i>
					</a>
				</p>
				<br clear="both" v-if="totalpageFileList">
				<h4 v-if="supplementaryFileList">Supplementary Material : </h4>
				<p v-if="supplementaryFileList">
					<a v-for="item in supplementaryFileList" :href="mediaUrl + item.file_url">
						<img src="../../assets/img/icon_0.png">
						<span>
							<font>Uploader : </font>{{item.username}}
							<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
						</span>
						<i class="el-icon-download download"></i>
					</a>
				</p>
				<br clear="both" v-if="supplementaryFileList">
				<h4>Manuscirpt : </h4>
				<p>
					<a v-for="item in manuscirptFileList" :href="mediaUrl + item.file_url">
						<img src="../../assets/img/icon_0.png">
						<span>
							<font>Uploader : </font>{{item.username}}
							<i><i class="el-icon-time"></i>{{formatDate(item.ctime)}}</i>
						</span>
						<i class="el-icon-download download"></i>
					</a>
				</p>
				<br clear="both">
			</div>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="Detailvisible=false">OK</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl: this.Common.baseUrl,
				mediaUrl: this.Common.mediaUrl,
				articleId: this.$route.query.id,
				userName: localStorage.getItem('U_name'),
				loading: false,
				Detailvisible: false,
				activeComment: [],
				activeNames: ['2'],
				authorList_name: '',
				artMes: {
					articleId: this.$route.query.id
				},
				fileMesForm: {
					manuscirpt: '',
					picturesAndTables: '',
					responseFile: '',
					supplementary:'', // 
					articleId: this.$route.query.id,
					username: localStorage.getItem('U_name')
				},
				msgform: {
					username: localStorage.getItem('U_name'),
					article_id: this.$route.query.id,
					ad_content: ''
				},
				comentDeploy: [],
				talkMsgs: [],
				ComEditor: [],
				ComRespe: [],
				coverLetterFileList: [],
				picturesAndTablesFileList: [],
				totalpageFileList: [],
				manuscirptFileList: [],
				supplementaryFileList:[],
				fileL_supplementary:[]
			};
		},
		created: function() {
			this.initarticle();
		},
		computed: {
			journal_me: function() {
				var frag = this.artMes.journalname;
				if (this.artMes.special_num > 0) {
					frag += "(Special Issues)";
				}
				return frag;
			},
			upload_coverLetter: function() {
				return this.baseUrl + 'api/Article/up_file/type/coverLetter';
			},
			upload_picturesAndTables: function() {
				return this.baseUrl + 'api/Article/up_file/type/picturesAndTables';
			},
			upload_supplementary: function() {
				return this.baseUrl + 'api/Article/up_file/type/supplementary';
			},
			upload_manuscirpt: function() {
				return this.baseUrl + 'api/Article/up_file/type/manuscirpt';
			},
			upload_response: function() {
				return this.baseUrl + 'api/Article/up_response_file';
			},
		},
		methods: {
			//初始化文章信息
			initarticle() {
				this.$api
					.post('api/Article/getArticleDetail', {
						articleId: this.articleId,
						human: 'author'
					})
					.then((res) => {
						this.artMes = res.article;
						this.artMes.major = res.major;
						this.artMes.authorList = []
						let alist = res.authors;
						let alist_name = [];
						for (let i in alist) {
							this.artMes.authorList.push({
								art_aut_id: alist[i].art_aut_id,
								firstname: alist[i].firstname,
								lastname: alist[i].lastname,
								orcid: alist[i].orcid,
								company: alist[i].company,
								department: alist[i].department,
								title: alist[i].author_title,
								country: alist[i].country,
								email: alist[i].email,
								address: alist[i].address,
								isSuper: alist[i].is_super == 1 ? true : false,
								isReport: alist[i].is_report == 1 ? true : false
							});
							if (i == alist.length - 1) {
								alist_name.push(alist[i].firstname + ' ' + alist[i].lastname)
							} else {
								alist_name.push(alist[i].firstname + ' ' + alist[i].lastname + ' , ')
							}
						}
						this.authorList_name = "Author : " + alist_name.join("");

						// 审稿人意见
						this.comentDeploy = res.suggest
					})
					.catch((err) => {
						console.log(err);
					});
				//初始化filelist
				this.$api
					.post('api/Article/getFilelistByArticleID', {
						articleId: this.articleId
					})
					.then(res => {
						this.coverLetterFileList = res.coverLetter;
						this.picturesAndTablesFileList = res.picturesAndTables;
						this.manuscirptFileList = res.manuscirpt;
						this.totalpageFileList = res.totalpage;
						this.supplementaryFileList = res.supplementary;
					})
					.catch(err => {
						console.log(err);
					});


				// 获取编辑修回意见列表
				this.$api
					.post('api/Article/getArticleProposals', {
						article_id: this.articleId
					})
					.then(res => {
						this.ComEditor = res.data.proposals;
					})
					.catch(err => {
						console.log(err);
					});


				// 获取作者发给审稿人邮件列表
				this.$api
					.post('api/Article/getArticleResponseFiles', {
						article_id: this.articleId
					})
					.then(res => {
						this.ComRespe = res.data.files;
					})
					.catch(err => {
						console.log(err);
					});


				// 留言板列表
				this.$api
					.post('api/Article/getArticleDialogs', {
						article_id: this.$route.query.id
					})
					.then((res) => {
						this.talkMsgs = res.data.dialogs;
					})
					.catch((err) => {
						console.log(err);
					});
			},

			// 查看详情
			man_detal() {
				this.Detailvisible = true
			},

			// 时间
			formatDate(timestamp) {
				var date = new Date(timestamp * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
				var h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
				var m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
				var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
				return Y + M + D + ' ' + h + ':' + m + ':' + s;
			},
			formatDate1(timestamp) {
				var date = new Date(timestamp * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
				return Y + M + D;
			},


			// 保存留言
			saveMsg() {
				if (this.msgform.ad_content == '') {
					this.$message.error('Please input messages');
					return false;
				}
				this.loading = true;
				this.$api.post('api/Article/pushArticleDialog', this.msgform)
					.then((res) => {
						this.loading = false;
						this.$message.success('Sent successfully');
						this.initarticle()
						this.msgform.ad_content = ''
					});
			},
			beforeupload_supplementary(file) {
				let flieArr = file.name.split(".")
				let fileSuffix = flieArr[flieArr.length - 1];
				if (fileSuffix != 'zip') {
					this.$message.error('Only zip files can be uploaded(.zip)');
					return false;
				}
				
			},

			upSuccess_supplementary(res, file) {
				if (res.code == 0) {
					this.fileMesForm.supplementary = 'supplementary/' + res.upurl;
					this.fileL_supplementary = [{}]
					this.fileL_supplementary[0].name = "Supplementary Material";
					this.fileL_supplementary[0].url = 'supplementary/' + res.upurl;					
				} else {
					this.$message.error('service error: ' + res.msg);
				}
			},

			removefilesupplementary() {
				this.fileMesForm.supplementary = '';
				this.fileL_supplementary = [];
				// this.$api
				// 	.post('api/Article/delArticleFile', {
				// 		file_id: this.fileMesForm.supplementaryId
				// 	})
				// 	.then((res) => {
				// 		if (res.code == 0) {
				// 			this.$message.success('Deletion succeeded!');
				// 		} else {
				// 			this.$message.error(res.msg);
				// 		}
				// 	});
			},

			// 上传文件
			onSubmit() {
			console.log(this.fileMesForm)
				//验证文件
				if (this.fileMesForm.manuscirpt == undefined || this.fileMesForm.manuscirpt == '') {
					this.$message.error(
						'Failed to submit. Please upload manuscirpt,ensure the integrity of the information');
					return false;
				}
				if (this.fileMesForm.responseFile == undefined || this.fileMesForm.responseFile == '') {
					this.$message.error(
						'Required information is not allowed to be empty.');
					return false;
				}
				this.loading = true;
				this.$api
					.post('api/Article/RepairBack', this.fileMesForm)
					.then((res) => {
						this.loading = false;
						if (res.code == 0) {
							this.$message.success('Upload successful!');
							this.loading = false;
							this.$router.push({
								path: 'articleProcess',
								query: {
									id: this.articleId
								}
							});
						} else {
							this.$message.error('Failed to submit, please contact administrator!');
							console.log(res.msg);
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},

			//检验上传文件的格式
			beforeupload_coverLetter(file) {},
			beforeupload_picturesAndTables(file) {},
			beforeupload_manuscirpt(file) {
				let flieArr = file.name.split(".")
				let fileSuffix = flieArr[flieArr.length - 1];
				if (fileSuffix != 'docx') {
					this.$message.error('Only word and compressed files can be uploaded(.docx)');
					return false;
				}
			},
			beforeupload_response(file) {},
			uperr_coverLetter(err) {
				this.$message.error('upload error!');
			},
			//超出传送文件个数限制
			alertlimit() {
				this.$message.error('The maximum number of uploaded files has been exceeded');
			},
			// 成功上传文件
			upSuccess_coverLetter(res, file) {
				if (res.code == 0) {
					this.fileMesForm.coverLetter = 'coverLetter/' + res.upurl;
				} else {
					this.$message.error('service error：' + res.msg);
				}
			},
			upSuccess_picturesAndTables(res, file) {
				if (res.code == 0) {
					this.fileMesForm.picturesAndTables = 'picturesAndTables/' + res.upurl;
				} else {
					this.$message.error('service error:' + res.msg);
				}
				// this.fileMesForm.picturesAndTables = [];
				// for (var ii in fileList) {
				// 	var url = fileList[ii].response.upurl;
				// 	this.fileMesForm.picturesAndTables.push('picturesAndTables/' + url);
				// }
			},
			upSuccess_manuscirpt(res, file) {
				if (res.code == 0) {
					this.fileMesForm.manuscirpt = 'manuscirpt/' + res.upurl;
				} else {
					this.$message.error('service error：' + res.msg);
				}
			},
			upSuccess_response(res, file) {
				if (res.code == 0) {
					this.fileMesForm.responseFile = 'articleResponse/' + res.upurl;
				} else {
					this.$message.error('service error：' + res.msg);
				}
			},
			//清除文件时的事件
			removefilecoverLetter(file, fileList) {
				this.fileMesForm.coverLetter = '';
			},
			removefilepicturesAndTables(file, fileList) {
				this.fileMesForm.picturesAndTables = '';
				// this.fileMesForm.picturesAndTables = [];
				// for (var ii in fileList) {
				// 	var url = fileList[ii].response.upurl;
				// 	this.fileMesForm.picturesAndTables.push('picturesAndTables/' + url);
				// }
			},
			removefilemanuscirpt(file, fileList) {
				this.fileMesForm.manuscirpt = '';
			},
			removefileresponse(file, fileList) {
				this.fileMesForm.responseFile = '';
			},

			statetostr(mystate) {
				let str = '';
				switch (mystate) {
					case -1:
						str = 'Manuscript Submission';
						break;
					case 0:
						str = 'Received';
						break;
					case 1:
						str = 'With editor';
						break;
					case 2:
						str = 'Under review';
						break;
					case 3:
						str = 'Reject';
						break;
					case 4:
						str = 'Revision';
						break;
					case 5:
						str = 'Accept';
						break;
					case 6:
						str = 'Pre-accept';
						break;
					default:
						str = 'error!!';
				}
				return str;
			},

			ellType(e) {
				let frag = '';
				switch (e) {
					case "A":
						frag = 'Article';
						break;
					case 'B':
						frag = 'Review';
						break;
					case 'C':
						frag = 'Case report';
						break;
					case 'P':
						frag = 'Research proposal';
						break;
					case 'N':
						frag = 'News';
						break;
					case 'T':
						frag = 'Comment';
						break;
					case 'CT':
						frag = 'Correction';
						break;
					case 'HT':
						frag = 'Hypothesis';
						break;
					case 'PF':
						frag = 'Preface';
						break;
					case 'ET':
						frag = 'Editorial';
						break;
					case 'RP':
						frag = 'Report';
						break;
					case 'LR':
						frag = 'Letter';
						break;
					case 'EF':
						frag = 'Empirical formula';
						break;
					case 'EM':
						frag = 'Evidence-based medicine';
						break;
					case 'EC':
						frag = 'Expert consensus';
						break;
					case 'LTE':
						frag = 'Letter to editor';
						break;
					case 'QI':
						frag = 'Questionnaire investigation';
						break;
					case 'PT':
						frag = 'Protocol';
						break;
					case 'CS':
						frag = 'Case Series';
						break;
					case 'RT':
						frag = 'Retraction';
						break;
					case 'MR':
						frag = 'Mini Review';
						break;
					default:
						frag = 'Others';
				}
				return frag;
			},

		},
		filters: {

		}
	};
</script>


<style scoped>
	.top_dao:hover {
		text-decoration: underline;
		cursor: pointer;
	}

	.process_new {
		color: #333;
	}

	.art_suthor_message {
		margin: 0 0 30px 0;
	}

	.art_suthor_message>b {
		font-size: 16px;
		display: block;
		margin: 5px 0 0 0;
		letter-spacing: -0.5px;
	}

	.art_suthor_message .det_cssep {
		background-color: #006699;
		color: #fff;
		font-size: 12px;
		margin: 0 0 0 15px;
		padding: 2px 5px;
		border-radius: 5px;
		cursor: pointer;
		font-style: normal;
		letter-spacing: 0;
	}

	.art_suthor_message .det_cssep:hover {
		text-decoration: underline;
	}

	.art_author_ {
		padding: 20px;
	}

	.art_author_>h2 {
		font-size: 18px;
		margin: 0 0 15px 0;
		letter-spacing: -0.8px;
	}

	.art_author_list {
		margin: 0 0 0 5px;
	}

	.art_author_list .com_shu {
		background-color: #006699;
		color: #fff;
		display: inline-block;
		width: 18px;
		height: 18px;
		line-height: 18px;
		text-align: center;
		margin: 0 10px 0 0;
	}

	.art_author_peng {
		margin: 10px 0 0px 10px;
		line-height: 24px;

	}

	.art_author_peng>a {
		color: #333;
	}

	.art_author_peng>a:hover {
		text-decoration: underline;
	}

	.art_author_peng>a>img {
		width: 15px;
		vertical-align: text-bottom;
		margin: 0 15px 0 0;
	}

	.art_author_peng>a>span {
		color: #888;
		margin: 0 0 0 30px;
	}

	.art_author_peng>a>i {
		font-weight: bold;
		color: #75abf1;
		margin: 0 0 0 18px;
	}


	.art_author_btn>div {
		margin-bottom: 30px;
		color: #006699;
	}

	.art_author_btn>h4 {
		float: left;
		width: 180px;
		padding: 8px 20px 0 0;
		letter-spacing: -0.5px;
		text-align: right;
	}

	.art_author_btn>p {
		float: left;
		margin: 0 0 30px 0;
	}

	.el-upload__tip {
		margin-left: 6px;
	}

	.el-collapse {
		border-bottom: 0;
	}

	.art_author_coment {}

	.art_author_coment>p {
		margin: 10px 0 0 28px;
		line-height: 20px;
	}

	.art_author_coment>p:first-child {
		margin-top: 0;
	}

	.art_author_coment>p>font {
		display: block;
		margin: 0 0 2px 0;
		color: #006699;
		font-weight: bold;
		letter-spacing: -0.5px;
	}
</style>
