553 lines
22 KiB
Vue
553 lines
22 KiB
Vue
<template>
|
|
<div>
|
|
<div class="crumbs">
|
|
<!-- <el-page-header @back="goBack" content="Add manuscript reviewer">
|
|
</el-page-header> -->
|
|
<el-breadcrumb separator="/">
|
|
<el-breadcrumb-item> <i class="el-icon-lx-calendar"></i> {{ $t('reviewerAdd.pageTitle') }}</el-breadcrumb-item>
|
|
</el-breadcrumb>
|
|
</div>
|
|
<div
|
|
class="container" style="padding: 20px;"
|
|
v-loading="loading"
|
|
:element-loading-text="$t('reviewerAdd.loading')"
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-background="rgba(255, 255, 255, 0.8)"
|
|
>
|
|
<span
|
|
class="ai-mode-toggle"
|
|
style="float: right; display: flex; align-items: center; color: #6843ff; font-weight: bold; cursor: pointer"
|
|
@click="toggleSelectAI"
|
|
>
|
|
<el-checkbox v-model="isSelectAI" @click.native.stop></el-checkbox>
|
|
<img
|
|
src="@/assets/img/ai.png"
|
|
style="width: 30px; height: 30px; margin-left: 10px"
|
|
@click.stop="toggleSelectAI"
|
|
/>
|
|
</span>
|
|
|
|
<!-- <el-select v-model="messform.major_a" placeholder="Please select major" @change="majorChange(1)"
|
|
style="width: 200px;margin: 0 10px 0 0;">
|
|
<el-option :key="0" label="All major" :value="0"></el-option>
|
|
<el-option v-for="item in majors_a" :key="item.major_id" :label="item.major_title"
|
|
:value="item.major_id"></el-option>
|
|
</el-select>
|
|
|
|
<el-select v-model="messform.major_b" placeholder="Please select major" v-if="majors_b!=''"
|
|
@change="majorChange(2)" style="width: 200px;margin:0 10px 0 0;">
|
|
<el-option :key="0" label="None" :value="0"></el-option>
|
|
<el-option v-for="item in majors_b" :key="item.major_id" :label="item.major_title"
|
|
:value="item.major_id"></el-option>
|
|
</el-select>
|
|
<el-select v-model="messform.major_c" placeholder="Please select major" v-if="majors_c!=''"
|
|
@change="majorChange(3)" style="width: 200px;margin:0 10px 0 0;">
|
|
<el-option :key="0" label="None" :value="0"></el-option>
|
|
<el-option v-for="item in majors_c" :key="item.major_id" :label="item.major_title"
|
|
:value="item.major_id"></el-option>
|
|
</el-select> -->
|
|
|
|
<div v-if="!isSelectAI">
|
|
<div class="reviewer-search-toolbar">
|
|
<div class="reviewer-search-filters">
|
|
<span style="font-size: 14px; color: #606266; margin: 0 10px 0 0">{{ $t('reviewerAdd.researchDirection') }}</span>
|
|
<el-cascader
|
|
:placeholder="$t('reviewerAdd.selectMajor')"
|
|
v-model="selectFileds"
|
|
style="width: 300px; margin-right: 10px"
|
|
@change="fieldChange"
|
|
:options="allFileds"
|
|
:props="fieldsProps"
|
|
collapse-tags
|
|
clearable
|
|
></el-cascader>
|
|
<el-input
|
|
v-model="messform.email"
|
|
clearable
|
|
:placeholder="$t('reviewerAdd.enterEmail')"
|
|
style="width: 190px; display: inline-block; margin: 0 10px 0 0"
|
|
></el-input>
|
|
<el-input
|
|
v-model="messform.field"
|
|
clearable
|
|
:placeholder="$t('reviewerAdd.enterField')"
|
|
style="width: 190px; display: inline-block; margin: 0 10px 0 0"
|
|
></el-input>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleSearch">{{ $t('reviewerAdd.search') }}</el-button>
|
|
</div>
|
|
<div class="invite-sort-bar">
|
|
<span class="invite-sort-label">{{ $t('reviewerAdd.latestInvitation') }}</span>
|
|
<el-radio-group v-model="timeOrder" size="small">
|
|
<el-radio label="desc" :title="$t('reviewerAdd.orderDescTip')">{{ $t('reviewerAdd.orderDesc') }}</el-radio>
|
|
<el-radio label="asc" :title="$t('reviewerAdd.orderAscTip')">{{ $t('reviewerAdd.orderAsc') }}</el-radio>
|
|
</el-radio-group>
|
|
</div>
|
|
</div>
|
|
<el-table
|
|
:data="revTable"
|
|
border
|
|
stripe
|
|
class="table"
|
|
ref="multipleTable"
|
|
header-cell-class-name="table-header"
|
|
:empty-text="$t('reviewerAdd.emptyTable')"
|
|
>
|
|
<el-table-column width="360" :label="$t('reviewerAdd.colBaseInfo')">
|
|
<template slot-scope="scope">
|
|
<p class="tab_tie_col">
|
|
<span>{{ $t('reviewerAdd.realname') }}</span><b style="font-size: 14px">{{ scope.row.realname }}</b>
|
|
|
|
<el-button
|
|
|
|
size="mini"
|
|
type="success"
|
|
plain
|
|
icon="el-icon-tickets"
|
|
@click="openDetail(scope.row)"
|
|
style="margin-left: 10px;padding:4px;float: right;"
|
|
>{{ $t('reviewerAdd.detail') }}</el-button
|
|
>
|
|
</p>
|
|
<p class="tab_tie_col"><span>{{ $t('reviewerAdd.account') }}</span>{{ scope.row.account }}</p>
|
|
<p class="tab_tie_col"><span>{{ $t('reviewerAdd.email') }}</span>{{ scope.row.email }}</p>
|
|
<p class="tab_tie_col"><span>{{ $t('reviewerAdd.latestInvitationLabel') }}</span>{{ formatInviteTime(scope.row) }}</p>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('reviewerAdd.colOtherInfo')">
|
|
<template slot-scope="scope">
|
|
<p class="tab_tie_col" v-if="scope.row.company != ''"><span>{{ $t('reviewerAdd.affiliation') }}</span>{{ scope.row.company }}</p>
|
|
<p class="tab_tie_col" v-if="scope.row.field != ''"><span>{{ $t('reviewerAdd.field') }}</span>{{ scope.row.field }}</p>
|
|
<!-- <p class="tab_tie_col" v-if="scope.row.majorstr != ''"><span>Major: </span>{{ scope.row.majorstr }}</p> -->
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('reviewerAdd.colResearchAreas')" width="260">
|
|
<template slot-scope="scope">
|
|
<commonMajorTableList
|
|
:user_id="scope.row.user_id"
|
|
:baseInfo="scope.row"
|
|
:key="scope.row.user_id"
|
|
:disabled="true"
|
|
></commonMajorTableList>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="rs_num" :label="$t('reviewerAdd.colReviewedTimes')" width="160">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.rs_num }}
|
|
<font style="margin-left: 5px">({{ $t('reviewerAdd.reviewing') }}:{{ scope.row.now }})</font>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<!-- <el-table-column prop="rd_num" label="Fail number" width="140"></el-table-column> -->
|
|
<el-table-column label="" width="120" align="center">
|
|
<template slot-scope="scope">
|
|
<div style="display: flex; align-items: center; flex-wrap: wrap; flex-direction: column">
|
|
<el-button
|
|
style="margin-bottom: 10px"
|
|
size="mini"
|
|
type="primary"
|
|
plain
|
|
icon="el-icon-check"
|
|
@click="openSelect(scope.row)"
|
|
>{{ $t('reviewerAdd.select') }}</el-button
|
|
>
|
|
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<div class="pagination">
|
|
<el-pagination
|
|
background
|
|
layout="total, prev, pager, next"
|
|
:current-page="messform.pageIndex"
|
|
:page-size="messform.pageSize"
|
|
:total="Total"
|
|
@current-change="handlePageChange"
|
|
></el-pagination>
|
|
</div>
|
|
</div>
|
|
<div v-if="isSelectAI">
|
|
<commonAI
|
|
@openSelect="openSelect"
|
|
@openDetail="openDetail"
|
|
@loading="(status) => (loading = status)"
|
|
></commonAI>
|
|
</div>
|
|
</div>
|
|
<el-dialog
|
|
:title="$t('reviewerAdd.dialogTitle')"
|
|
:visible.sync="mesOpenVisble" :close-on-click-modal="false"
|
|
width="800px"
|
|
v-loading="loading"
|
|
:element-loading-text="$t('reviewerAdd.loading')"
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
>
|
|
<el-form v-model="mesOpen" label-width="140px">
|
|
<el-form-item :label="$t('reviewerAdd.dialogUser')">
|
|
<span>{{ mesOpen.account }}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('reviewerAdd.dialogName')">
|
|
<span>{{ mesOpen.realname }}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('reviewerAdd.dialogCountry')">
|
|
<span>{{ mesOpen.country }}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('reviewerAdd.dialogAffiliation')">
|
|
<span>{{ mesOpen.company }}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('reviewerAdd.dialogResearchAreas')">
|
|
<p v-for="(v, i) in majorData" >
|
|
<span style="font-weight: bold">{{ i + 1 }}.</span>
|
|
{{ v.major_title.replace('Medicine >', '').trim() }}
|
|
</p>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('reviewerAdd.dialogField')">
|
|
<span>{{ mesOpen.field }}</span>
|
|
</el-form-item>
|
|
<el-form-item :label="$t('reviewerAdd.dialogIntroduction')">
|
|
<span>{{ mesOpen.introduction }}</span>
|
|
</el-form-item>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="mesOpenVisble = false">{{ $t('reviewerAdd.cancel') }}</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import commonAI from './articleReviewerAIAdd.vue';
|
|
import commonMajorTableList from '../page/components/major/tableList.vue';
|
|
export default {
|
|
components: {
|
|
commonAI,
|
|
commonMajorTableList
|
|
},
|
|
data() {
|
|
return {
|
|
isSelectAI: false,
|
|
timeOrder: 'desc',
|
|
messform: {
|
|
article_id: this.$route.query.id,
|
|
email: '',
|
|
field: '',
|
|
pageIndex: 1,
|
|
pageSize: 15,
|
|
major_id: 0
|
|
|
|
// major_a: 0,
|
|
// major_b: '',
|
|
// major_c: '',
|
|
},
|
|
revTable: [],
|
|
mesOpen: [],
|
|
mesOpenVisble: false,
|
|
loading: false,
|
|
Total: 0,
|
|
majors_a: [],
|
|
majors_b: [],
|
|
majors_c: [],
|
|
allFileds: [], // 全部领域
|
|
fieldsProps: {
|
|
checkStrictly: true,
|
|
value: 'major_id',
|
|
label: 'major_title',
|
|
children: 'children'
|
|
},
|
|
selectFileds: []
|
|
};
|
|
},
|
|
created() {
|
|
this.getDate();
|
|
//this.initMajor()
|
|
this.getAllFields();
|
|
},
|
|
computed: {},
|
|
methods: {
|
|
toggleSelectAI() {
|
|
this.isSelectAI = !this.isSelectAI;
|
|
},
|
|
formatInviteTime(row) {
|
|
const raw =
|
|
row.invited_time != null && row.invited_time !== ''
|
|
? row.invited_time
|
|
: row.last_invite_time != null && row.last_invite_time !== ''
|
|
? row.last_invite_time
|
|
: row.invite_time != null && row.invite_time !== ''
|
|
? row.invite_time
|
|
: row.invitation_time != null && row.invitation_time !== ''
|
|
? row.invitation_time
|
|
: row.invit_time != null && row.invit_time !== ''
|
|
? row.invit_time
|
|
: row.inviteTime;
|
|
if (raw == null || raw === '') {
|
|
return '-';
|
|
}
|
|
if (typeof raw === 'string' && /[-/]/.test(raw) && isNaN(Number(raw))) {
|
|
return raw;
|
|
}
|
|
let ts = Number(raw);
|
|
if (!ts) {
|
|
return '-';
|
|
}
|
|
if (ts < 1e12) {
|
|
ts *= 1000;
|
|
}
|
|
const date = new Date(ts);
|
|
if (isNaN(date.getTime())) {
|
|
return String(raw);
|
|
}
|
|
const Y = date.getFullYear() + '-';
|
|
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
|
const D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
|
const h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
|
|
const m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
|
|
return Y + M + D + ' ' + h + ':' + m;
|
|
},
|
|
goBack() {
|
|
this.$router.push({
|
|
path: 'articleReviewer',
|
|
query: {
|
|
id: this.$route.query.id
|
|
}
|
|
});
|
|
|
|
|
|
},
|
|
fieldChange(e) {
|
|
this.messform.major_id = this.selectFileds[this.selectFileds.length - 1];
|
|
},
|
|
// 获取编辑列表数据
|
|
getDate() {
|
|
this.$api
|
|
.post('api/Reviewer/searchReviewer', this.messform)
|
|
.then((res) => {
|
|
this.revTable = res.data.reviewers;
|
|
this.Total = res.data.count;
|
|
this.loading = false;
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
},
|
|
|
|
// 下拉搜索
|
|
changereviewer() {
|
|
if (this.messform.class == 0) {
|
|
if (this.messform.grade != undefined) {
|
|
delete this.messform.grade;
|
|
}
|
|
} else if (this.messform.class == 1) {
|
|
this.messform.grade = '';
|
|
} else {
|
|
this.messform.grade = this.messform.class;
|
|
}
|
|
this.loading = true;
|
|
this.getDate();
|
|
},
|
|
|
|
// 关键字搜索
|
|
handleSearch() {
|
|
this.messform.pageIndex = 1;
|
|
this.loading = true;
|
|
this.getDate();
|
|
},
|
|
async fetchMajorData(userId) {
|
|
// if (!this.majorData[userId]) {
|
|
// 判断是否已经加载过该用户的数据
|
|
this.majorData = await this.getMajorData(userId);
|
|
console.log('this.majorData at line 279:', this.majorData)
|
|
this.$forceUpdate();
|
|
// }
|
|
},
|
|
// 修改标记
|
|
async getMajorData(userId) {
|
|
try {
|
|
const res = await this.$api.post('api/Reviewer/getUserField', { user_id: userId });
|
|
this.loading = false; // 开始加载数据
|
|
if (res.status === 1) {
|
|
return res.data; // 返回数据
|
|
} else {
|
|
return []; // 如果没有数据,返回空数组
|
|
}
|
|
} catch (error) {
|
|
console.error('Error fetching data:', error);
|
|
return []; // 如果发生错误,返回空数组
|
|
}
|
|
},
|
|
// 审稿人详情
|
|
openDetail(row) {
|
|
this.mesOpen = {};
|
|
this.mesOpenVisble = true;
|
|
this.majorData=[]
|
|
|
|
this.$api
|
|
.post('api/Article/getReviewerdetail', {
|
|
uid: row.user_id
|
|
})
|
|
.then((res) => {
|
|
this.mesOpen = res.data;
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});this.fetchMajorData(row.user_id);
|
|
},
|
|
// 保存添加操作
|
|
openSelect(row) {
|
|
this.loading = true;
|
|
this.$api
|
|
.post('api/Article/addArticleReviewer', {
|
|
uid: row.user_id,
|
|
articleId: this.$route.query.id
|
|
})
|
|
.then((res) => {
|
|
this.loading = false;
|
|
if (res.code == 0) {
|
|
this.$message.success('Add Success');
|
|
this.getDate();
|
|
// this.$router.push({
|
|
// path: 'articleReviewer',
|
|
// query: {
|
|
// id: this.$route.query.id
|
|
// }
|
|
// });
|
|
} else {
|
|
if (res.msg && res.msg != '') {
|
|
this.$message.error(res.msg);
|
|
} else {
|
|
this.$message.error('Add Error');
|
|
}
|
|
}
|
|
})
|
|
.catch((err) => {
|
|
this.loading = false;
|
|
console.log(err);
|
|
});
|
|
},
|
|
|
|
// 领域
|
|
initMajor() {
|
|
this.$api
|
|
.post('api/Ucenter/getMajor', {
|
|
major_id: 1
|
|
})
|
|
.then((res) => {
|
|
this.majors_a = res.data.major.children;
|
|
this.majors_a_input = res.data.major.children;
|
|
});
|
|
},
|
|
|
|
// 获取全部领域
|
|
getAllFields() {
|
|
this.$api.post('api/Major/getMajorList').then((res) => {
|
|
if (res.code == 0) {
|
|
this.allFileds = res.data.majors;
|
|
} else {
|
|
this.$message.error(res.msg);
|
|
}
|
|
});
|
|
},
|
|
// 搜索选择领域
|
|
majorChange(e) {
|
|
if (e == 1) {
|
|
this.$api
|
|
.post('api/Ucenter/getMajor', {
|
|
major_id: this.messform.major_a
|
|
})
|
|
.then((res) => {
|
|
this.majors_b = res.data.major.children;
|
|
this.majors_c = [];
|
|
this.messform.major_b = '';
|
|
this.messform.major_c = '';
|
|
this.majorChange_panduan();
|
|
});
|
|
} else if (e == 2 && this.messform.major_b != 0) {
|
|
this.$api
|
|
.post('api/Ucenter/getMajor', {
|
|
major_id: this.messform.major_b
|
|
})
|
|
.then((res) => {
|
|
this.majors_c = res.data.major.children;
|
|
this.messform.major_c = '';
|
|
this.majorChange_panduan();
|
|
});
|
|
} else {
|
|
this.majorChange_panduan();
|
|
}
|
|
},
|
|
|
|
majorChange_panduan() {
|
|
if (this.messform.major_c != '' || this.messform.major_c != 0) {
|
|
this.messform.major_id = this.messform.major_c;
|
|
} else if (this.messform.major_b != '' || this.messform.major_b != 0) {
|
|
this.messform.major_id = this.messform.major_b;
|
|
} else {
|
|
this.messform.major_id = this.messform.major_a;
|
|
}
|
|
this.getDate();
|
|
},
|
|
|
|
// 分页导航
|
|
handlePageChange(val) {
|
|
this.$set(this.messform, 'pageIndex', val);
|
|
this.getDate();
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.table {
|
|
width: 100%;
|
|
font-size: 14px;
|
|
}
|
|
.tab_tie_col {
|
|
margin-bottom: 5px;
|
|
color: #333;
|
|
}
|
|
|
|
.tab_tie_col > span {
|
|
color: #888;
|
|
margin: 0 5px 0 0;
|
|
font-size: 13px;
|
|
}
|
|
.reviewer-search-toolbar {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
width: 100%;
|
|
margin-bottom: 20px;
|
|
gap: 10px 12px;
|
|
}
|
|
.reviewer-search-filters {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 10px 12px;
|
|
}
|
|
.invite-sort-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 12px;
|
|
margin-left: auto;
|
|
font-size: 14px;
|
|
color: #606266;
|
|
}
|
|
.invite-sort-label {
|
|
white-space: nowrap;
|
|
font-weight: 500;
|
|
}
|
|
.invite-sort-bar ::v-deep .el-radio {
|
|
margin-right: 14px;
|
|
}
|
|
.invite-sort-bar ::v-deep .el-radio:last-child {
|
|
margin-right: 0;
|
|
}
|
|
::v-deep .el-page-header__left, ::v-deep .el-page-header__content{
|
|
font-size:14px !important ;
|
|
color:#606266 !important ;
|
|
}
|
|
</style>
|