推广管理
This commit is contained in:
@@ -155,8 +155,11 @@
|
||||
<!-- 编辑 -->
|
||||
<template v-if="this.userrole == 1">
|
||||
<el-submenu index="mailboxManagement">
|
||||
<template slot="title"> <i class="el-icon-message"></i> {{ $t('sidebar.mailboxManagement') }} </template>
|
||||
<template slot="title"> <i class="el-icon-message"></i> {{ $t('sidebar.promotionManagement') }} </template>
|
||||
|
||||
<el-menu-item index="expertDatabase">
|
||||
{{ $t('sidebar.expertDatabase') }}
|
||||
</el-menu-item>
|
||||
<el-menu-item index="mailboxConfig">
|
||||
{{ $t('sidebar.mailboxManagement') }}
|
||||
</el-menu-item>
|
||||
|
||||
@@ -273,6 +273,7 @@ const en = {
|
||||
tools: 'Assistant tools',
|
||||
mailboxManagement: 'Mailbox Management',
|
||||
scholarCrawlers: 'Scholar Crawlers',
|
||||
expertDatabase: 'Expert Database',
|
||||
ReArticles: 'Rejected Manuscripts', // 被拒稿件
|
||||
editorialBoard: 'Boss System',
|
||||
editorialBoard1: 'Board Management',
|
||||
@@ -283,6 +284,8 @@ const en = {
|
||||
managingDirector: 'Managing Director',
|
||||
GroupClassification: 'Group List',
|
||||
JournalInstallment: 'Journal Installment',
|
||||
mailboxCollect: 'Email List',
|
||||
promotionManagement: 'Promotion Management',
|
||||
},
|
||||
mailboxConfig: {
|
||||
mailSystem: 'Mailbox system',
|
||||
@@ -492,6 +495,7 @@ const en = {
|
||||
operation: 'Operation',
|
||||
loadingMore: 'Loading more...',
|
||||
noMore: 'No more',
|
||||
selectAccountTip: 'Please select an email account first.'
|
||||
},
|
||||
mailboxSend: {
|
||||
title: 'Write mail',
|
||||
|
||||
@@ -257,13 +257,11 @@ const zh = {
|
||||
emailStyles: '邮件风格',
|
||||
tools: '辅助工具',
|
||||
mailboxManagement: '邮箱管理',
|
||||
<<<<<<< HEAD
|
||||
mailboxConfig: '邮箱配置管理',
|
||||
mailboxCollect: '邮箱列表',
|
||||
scholarCrawlers: '学者抓取',
|
||||
=======
|
||||
|
||||
|
||||
scholarCrawlers: '学者数据库',
|
||||
>>>>>>> 577a30aeb65a03b5b8b229e5b6a974645e171a0c
|
||||
expertDatabase: '专家库',
|
||||
ReArticles: '被拒稿件', // 被拒稿件
|
||||
editorialBoard: '编委管理',
|
||||
editorialBoard1: '编委列表',
|
||||
@@ -274,6 +272,8 @@ const zh = {
|
||||
managingDirector: '总经理',
|
||||
GroupClassification: '集团列表',
|
||||
JournalInstallment: '分期列表',
|
||||
mailboxCollect: '邮件列表',
|
||||
promotionManagement: '推广管理',
|
||||
|
||||
},
|
||||
mailboxConfig: {
|
||||
@@ -484,6 +484,7 @@ const zh = {
|
||||
operation: '操作',
|
||||
loadingMore: '加载更多...',
|
||||
noMore: '没有更多了',
|
||||
selectAccountTip: '请先选择一个邮箱账号.',
|
||||
},
|
||||
mailboxSend: {
|
||||
title: '写邮件',
|
||||
|
||||
315
src/components/page/expertDatabase.vue
Normal file
315
src/components/page/expertDatabase.vue
Normal file
@@ -0,0 +1,315 @@
|
||||
<template>
|
||||
<div class="scholar-db-container">
|
||||
<div class="crumbs">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item>
|
||||
<i class="el-icon-user"></i> Expert Database
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="toolbar">
|
||||
<div class="filters">
|
||||
<el-form :inline="true" :model="query" size="small">
|
||||
<el-form-item label="">
|
||||
<el-cascader
|
||||
ref="cascader"
|
||||
@change="handleChange"
|
||||
v-model="major_id"
|
||||
:placeholder="'Please select field'"
|
||||
:options="options"
|
||||
:props="getProps()"
|
||||
style="width: 260px"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-input
|
||||
v-model="query.keyword"
|
||||
placeholder="Name / Email / Affiliation"
|
||||
clearable
|
||||
style="width: 260px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" :loading="loading" @click="handleSearch">
|
||||
Search
|
||||
</el-button>
|
||||
<el-button @click="handleReset">Reset</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<el-button type="success" icon="el-icon-download" @click="handleExport" :loading="exportLoading">
|
||||
Download Excel
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-card class="table-card" shadow="never">
|
||||
<el-table :data="list" border stripe v-loading="loading" header-row-class-name="dark-table-header">
|
||||
<el-table-column prop="name" label="Base Information" min-width="220">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<p class="info-row">
|
||||
<span class="label">Name: </span><span class="value bold">{{ scope.row.name }}</span>
|
||||
</p>
|
||||
<p class="info-row">
|
||||
<span class="label">Email: </span><span class="value link">{{ scope.row.email }}</span>
|
||||
</p>
|
||||
<p class="info-row" style="margin-top: 10px; font-size: 12px">
|
||||
<span class="label">Acquisition Time:</span>
|
||||
<span class="value time">{{ scope.row.ctime_text ? scope.row.ctime_text : '-' }}</span>
|
||||
</p>
|
||||
|
||||
<span class="custom-tag">{{ scope.row.state_text }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="affiliation" label="Affiliation" min-width="260" />
|
||||
<el-table-column prop="fieldDisplay" label="Research areas" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<div v-for="(field, index) in scope.row.fields" :key="index">
|
||||
<span>
|
||||
<span style="color: #006699">{{ index + 1 }}.</span>
|
||||
{{ field.field }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
background
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:current-page="query.pageIndex"
|
||||
:page-size="query.pageSize"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Common from '@/components/common/common';
|
||||
export default {
|
||||
name: 'expertDatabase',
|
||||
data() {
|
||||
return {
|
||||
mediaUrl: Common.mediaUrl,
|
||||
major_id: [],
|
||||
query: {
|
||||
major_id: null,
|
||||
keyword: '',
|
||||
pageIndex: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
options: [],
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
exportLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadFields();
|
||||
this.fetchList();
|
||||
},
|
||||
methods: {
|
||||
loadFields() {
|
||||
this.$api.post('api/Major/getMajorList', {}).then((res) => {
|
||||
const transformData = (data) => {
|
||||
return data.map((item) => {
|
||||
const transformedItem = {
|
||||
...item,
|
||||
value: item.major_id,
|
||||
label: `${item.major_title}`
|
||||
};
|
||||
if (item.children && item.children.length > 0) {
|
||||
transformedItem.children = transformData(item.children);
|
||||
}
|
||||
return transformedItem;
|
||||
});
|
||||
};
|
||||
const root = (res.data.majors || []).find((item) => item.major_id == 1);
|
||||
const data = root && root.children ? transformData(root.children) : [];
|
||||
this.options = [...data];
|
||||
});
|
||||
},
|
||||
handleChange() {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.cascader && this.$refs.cascader.dropDownVisible !== undefined) {
|
||||
this.$refs.cascader.dropDownVisible = false;
|
||||
}
|
||||
this.query.major_id = this.major_id[this.major_id.length - 1] || null;
|
||||
this.query.pageIndex = 1;
|
||||
this.fetchList();
|
||||
});
|
||||
},
|
||||
getProps() {
|
||||
return {
|
||||
value: 'value',
|
||||
label: 'label',
|
||||
children: 'children',
|
||||
checkStrictly: true,
|
||||
expandTrigger: 'hover'
|
||||
};
|
||||
},
|
||||
async fetchList() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const params = {
|
||||
major_id: this.query.major_id,
|
||||
keyword: this.query.keyword,
|
||||
pageIndex: this.query.pageIndex,
|
||||
pageSize: this.query.pageSize
|
||||
};
|
||||
const res = await this.$api.post('api/expert_manage/getList', params);
|
||||
if (res && res.code === 0 && res.data) {
|
||||
const rawList = res.data.list || [];
|
||||
this.list = rawList.map((item) => {
|
||||
const fieldArray = item.fields || [];
|
||||
const fieldNames = fieldArray.map((f) => f.field).join(', ');
|
||||
return {
|
||||
...item,
|
||||
fieldDisplay: fieldNames
|
||||
};
|
||||
});
|
||||
this.total = res.data.total || 0;
|
||||
} else {
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
}
|
||||
} catch (e) {
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
handleSearch() {
|
||||
this.query.pageIndex = 1;
|
||||
this.fetchList();
|
||||
},
|
||||
handleReset() {
|
||||
this.major_id = [];
|
||||
this.query = {
|
||||
major_id: null,
|
||||
keyword: '',
|
||||
pageIndex: 1,
|
||||
pageSize: 10
|
||||
};
|
||||
this.fetchList();
|
||||
},
|
||||
handleSizeChange(size) {
|
||||
this.query.pageSize = size;
|
||||
this.query.pageIndex = 1;
|
||||
this.fetchList();
|
||||
},
|
||||
handlePageChange(page) {
|
||||
this.query.pageIndex = page;
|
||||
this.fetchList();
|
||||
},
|
||||
async handleExport() {
|
||||
if (!this.query.major_id && !this.query.keyword) {
|
||||
this.$message.warning('Please select a research area or enter a keyword before exporting.');
|
||||
return;
|
||||
}
|
||||
this.exportLoading = true;
|
||||
try {
|
||||
const params = {
|
||||
major_id: this.query.major_id,
|
||||
keyword: this.query.keyword
|
||||
};
|
||||
const res = await this.$api.post('api/expert_manage/exportExcel', params);
|
||||
if (res && res.code === 0 && res.data && res.data.file_url) {
|
||||
window.open(this.mediaUrl + res.data.file_url, '_blank');
|
||||
} else {
|
||||
this.$message.error(res.msg || 'Export failed');
|
||||
}
|
||||
} catch (e) {
|
||||
this.$message.error(e.msg || 'Export failed');
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scholar-db-container {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.filters {
|
||||
flex: 1;
|
||||
margin: 0 20px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.actions {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.table-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.pagination {
|
||||
margin-top: 15px;
|
||||
text-align: right;
|
||||
}
|
||||
/deep/ .dark-table-header th {
|
||||
background-color: #f5f7fa;
|
||||
font-weight: 600;
|
||||
}
|
||||
/deep/ .el-form-item--mini.el-form-item,
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.custom-tag {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 0px;
|
||||
color: #ce4f15;
|
||||
font-size: 12px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
}
|
||||
.info-row {
|
||||
margin-bottom: 4px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1.2;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.label {
|
||||
color: #999;
|
||||
margin-right: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.value {
|
||||
color: #333;
|
||||
}
|
||||
.value.bold {
|
||||
font-weight: bold;
|
||||
font-size: 15px;
|
||||
}
|
||||
.value.link {
|
||||
color: #0066a1;
|
||||
}
|
||||
.value.time {
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -226,11 +226,27 @@ export default {
|
||||
},
|
||||
initAccountSelection() {
|
||||
const q = this.$route.query;
|
||||
const storedEmailId = localStorage.getItem('mailboxCollect_j_email_id');
|
||||
const storedJournalId = localStorage.getItem('mailboxCollect_journal_id');
|
||||
|
||||
// 1. 兼容老链接:如果地址栏里带有参数,优先用并写入本地
|
||||
if (q.j_email_id) {
|
||||
this.loadAccountById(q.j_email_id);
|
||||
} else {
|
||||
this.openAccountDialog();
|
||||
localStorage.setItem('mailboxCollect_j_email_id', q.j_email_id);
|
||||
if (q.journal_id) {
|
||||
localStorage.setItem('mailboxCollect_journal_id', q.journal_id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 否则尝试从本地缓存恢复上次选择
|
||||
if (storedEmailId) {
|
||||
this.loadAccountById(storedEmailId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. 都没有则弹出选择账号弹窗
|
||||
this.openAccountDialog();
|
||||
},
|
||||
loadDefaultAccount() {
|
||||
this.$api.post(API.getAllJournal, {}).then(res => {
|
||||
@@ -310,13 +326,17 @@ export default {
|
||||
chooseAccount(row) {
|
||||
this.selectedAccount = row;
|
||||
this.accountDialogVisible = false;
|
||||
this.closeDetail();
|
||||
// 回填到地址栏
|
||||
const q = Object.assign({}, this.$route.query, {
|
||||
j_email_id: row.j_email_id,
|
||||
journal_id: row.journal_id
|
||||
});
|
||||
this.$router.replace({ path: this.$route.path, query: q });
|
||||
this.closeDetail();
|
||||
|
||||
// 将所选邮箱配置持久化到本地,避免暴露在地址栏
|
||||
if (row && row.j_email_id) {
|
||||
localStorage.setItem('mailboxCollect_j_email_id', String(row.j_email_id));
|
||||
}
|
||||
if (row && row.journal_id) {
|
||||
localStorage.setItem('mailboxCollect_journal_id', String(row.journal_id));
|
||||
}
|
||||
|
||||
// 不再写入路由 query,直接拉取数据
|
||||
this.fetchData();
|
||||
},
|
||||
handleAccountDialogBeforeClose(done) {
|
||||
@@ -521,7 +541,7 @@ export default {
|
||||
.folder-list li.active { background: #edeef0; color: #006699; font-weight: bold; border-right: 3px solid #006699; }
|
||||
.badge { margin-left: auto; background: #ddd; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
|
||||
|
||||
.sidebar-footer { padding: 15px 20px; border-top: 1px solid #eee; background: #f8f9fa; }
|
||||
.sidebar-footer { padding: 10px 0px; border-top: 1px solid #eee; background: #f8f9fa; }
|
||||
.user-card { display: flex; align-items: center; margin-bottom: 8px; overflow: hidden; }
|
||||
.user-avatar { flex-shrink: 0; background: #ffeded; color: #f56c6c; }
|
||||
.user-detail { margin-left: 10px; overflow: hidden; flex: 1; }
|
||||
|
||||
@@ -306,12 +306,16 @@
|
||||
});
|
||||
},
|
||||
handleMailManage(row) {
|
||||
// 进入邮箱列表前,把当前选择的邮箱账号写入本地,供 mailboxCollect 使用
|
||||
if (row && row.j_email_id) {
|
||||
localStorage.setItem('mailboxCollect_j_email_id', String(row.j_email_id));
|
||||
}
|
||||
if (row && row.journal_id) {
|
||||
localStorage.setItem('mailboxCollect_journal_id', String(row.journal_id));
|
||||
}
|
||||
|
||||
this.$router.push({
|
||||
path: '/mailboxCollect',
|
||||
query: {
|
||||
journal_id: row.journal_id,
|
||||
j_email_id: row.j_email_id
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除邮箱配置:接口 api/email_client/deleteAccount,传参 j_email_id
|
||||
|
||||
@@ -1097,6 +1097,13 @@ export default new Router({
|
||||
title: 'Scholar Database'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/expertDatabase', //专家库
|
||||
component: () => import('../components/page/expertDatabase'),
|
||||
meta: {
|
||||
title: 'Expert Database'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/PreIngested', //预收录-完善资料页面
|
||||
component: () => import('../components/page/Complete_profile'),
|
||||
|
||||
Reference in New Issue
Block a user