This commit is contained in:
2024-11-01 14:13:36 +08:00
parent 62a4f2769a
commit 68e6e07754
3 changed files with 93 additions and 15 deletions

1
.gitignore vendored
View File

@@ -21,3 +21,4 @@ yarn-error.log*
*.sln *.sln
*.sw* *.sw*
node_modules node_modules
src/api/index.js

View File

@@ -37,8 +37,43 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.cite.month_num }} {{ scope.row.cite.month_num }}
<span @click="openDrawer(scope.row)" style="margin-left: 10px;cursor: pointer;color: #006699 !important;font-weight: bold"> <span
<i class="el-icon-edit"></i> {{ $t('JournalCitationAnalysis.edit') }} @click="openDrawer(scope.row, 'currentMonth')"
style="margin-left: 10px; cursor: pointer; color: #006699 !important; font-weight: bold"
>
<i class="el-icon-edit"></i> {{ $t('JournalCitationAnalysis.edit') }}
</span>
<!-- <el-button type="primary" size="mini" @click="openDrawer(scope.row)" style="">
</el-button> -->
<!-- <p
style="padding: 0px 6px;display: inline-block;cursor: pointer; color: #409eff; background: #ecf5ff; border: 1px solid #b3d8ff"
>
{{ scope.row.cite.month_num }}
</p> -->
</template>
</el-table-column>
<el-table-column
:label="
lang == 'en'
? `${$t('JournalCitationAnalysis.cite')} ${getMonthName(lastMonth)}${
lastMonth == 12 ? ' ' + lastMonthYear : ''
}`
: `${lastMonth == 12 ? lastMonthYear + '年' : ''}${lastMonth} 月${$t('JournalCitationAnalysis.cite')}`
"
width="200"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cite.p_month_num }}
<span
@click="openDrawer(scope.row, 'lastMonth')"
style="margin-left: 10px; cursor: pointer; color: #006699 !important; font-weight: bold"
>
<i class="el-icon-edit"></i> {{ $t('JournalCitationAnalysis.edit') }}
</span> </span>
<!-- <el-button type="primary" size="mini" @click="openDrawer(scope.row)" style=""> <!-- <el-button type="primary" size="mini" @click="openDrawer(scope.row)" style="">
@@ -195,13 +230,20 @@
</el-table> </el-table>
</div> </div>
</el-drawer> </el-drawer>
<common-cite-list ref="commonCiteList" :doiInfo="this.doiInfo" :journal="currentData" @refresh="getJournalList"></common-cite-list> <common-cite-list
ref="commonCiteList"
:doiInfo="this.doiInfo"
:monthType="monthType"
:journal="currentData"
@refresh="getJournalList"
></common-cite-list>
</div> </div>
</template> </template>
<script> <script>
const jAtableY = () => import('@/components/common/journalArticleTable'); const jAtableY = () => import('@/components/common/journalArticleTable');
const commonCiteList = () => import('@/components/page/components/JournalCitationAnalysis/citeList.vue'); const commonCiteList = () => import('@/components/page/components/JournalCitationAnalysis/citeList.vue');
// 获取当前日期
export default { export default {
data() { data() {
@@ -217,7 +259,9 @@ export default {
doiInfo: {}, doiInfo: {},
p_year: new Date().getFullYear() - 1, p_year: new Date().getFullYear() - 1,
year: new Date().getFullYear(), year: new Date().getFullYear(),
month: new Date().getMonth() + 1 month: new Date().getMonth() + 1,
lastMonth: '',
lastMonthYear: ''
}; };
}, },
components: { components: {
@@ -225,6 +269,22 @@ export default {
commonCiteList commonCiteList
}, },
async created() { async created() {
const currentDate = new Date();
// 获取上个月的年份
// 获取上个月的月份注意月份是从0开始计数的所以需要加1
const lastMonth = currentDate.getMonth();
if (lastMonth === 0) {
console.log('lastMonth at line 270:', lastMonth);
this.lastMonth = 12;
this.lastMonthYear = currentDate.getFullYear() - 1;
} else {
this.lastMonth = lastMonth;
this.lastMonthYear = currentDate.getFullYear();
}
this.loading = true; this.loading = true;
await this.getTableData(); await this.getTableData();
@@ -257,11 +317,13 @@ export default {
// } // }
// }); // });
}, },
getJournalList() { getJournalList(month) {
console.log('month at line 314:', month);
this.JournalListLoad = true; this.JournalListLoad = true;
this.JournalList = []; this.JournalList = [];
this.$api this.$api
.post('api/Monitor/getCiteListForEditorMonth', { .post(month == 'currentMonth' ? 'api/Monitor/getCiteListForEditorMonth' : 'api/Monitor/getCiteListForEditorPMonth', {
issn: this.currentData.issn issn: this.currentData.issn
}) })
.then(async (res) => { .then(async (res) => {
@@ -278,23 +340,38 @@ export default {
this.$message.error(err); this.$message.error(err);
}); });
}, },
openDrawer(data) { openDrawer(data, month) {
console.log('month at line 335:', month);
this.monthType = month;
this.currentData = data; this.currentData = data;
if (this.currentData) { if (this.currentData) {
this.drawerTitle = `${this.currentData.title} ${ if (month == 'currentMonth') {
this.lang == 'en' this.drawerTitle = `${this.currentData.title} ${
? this.$t('JournalCitationAnalysis.cite') + this.getMonthName(this.month) this.lang == 'en'
: this.month + '月' + this.$t('JournalCitationAnalysis.cite') ? this.$t('JournalCitationAnalysis.cite') + this.getMonthName(this.month)
} ( ${this.currentData.cite.month_num} )`; : this.month + '月' + this.$t('JournalCitationAnalysis.cite')
} ( ${this.currentData.cite.month_num} )`;
} else {
this.drawerTitle = `${this.currentData.title} ${
this.lang == 'en'
? `${this.$t('JournalCitationAnalysis.cite')} ${this.getMonthName(this.lastMonth)}${
this.lastMonth == 12 ? ' ' + this.lastMonthYear : ''
}`
: `${this.lastMonth == 12 ? this.lastMonthYear + '年' : ''}${this.lastMonth}${this.$t(
'JournalCitationAnalysis.cite'
)}`
} ( ${this.currentData.cite.p_month_num} )`;
}
} }
this.drawer = true; this.drawer = true;
this.getJournalList(); this.getJournalList(month);
}, },
handleClose() { handleClose() {
this.drawer = false; this.drawer = false;
}, },
getMonthName(month) { getMonthName(month) {
console.log('month at line 344:', month);
const months = [ const months = [
'January', 'January',
'February', 'February',

View File

@@ -112,7 +112,7 @@
<script> <script>
import VueUeditorWrap from 'vue-ueditor-wrap'; // ES6 Module import VueUeditorWrap from 'vue-ueditor-wrap'; // ES6 Module
export default { export default {
props: ['journal', 'doiInfo'], props: ['journal', 'doiInfo','monthType'],
data() { data() {
return { return {
tableWidth: !localStorage.getItem('langs') || localStorage.getItem('langs') == 'en' ? 100 : 70, tableWidth: !localStorage.getItem('langs') || localStorage.getItem('langs') == 'en' ? 100 : 70,
@@ -372,7 +372,7 @@ export default {
this.$message.success('successed'); this.$message.success('successed');
this.cancelSave(); this.cancelSave();
this.$emit('refresh') this.$emit('refresh',this.monthType)
} else if (res.code == 1) { } else if (res.code == 1) {
// doi 错误 // doi 错误
this.addLoading = false; this.addLoading = false;