集团列表 期刊管理

This commit is contained in:
2024-09-27 17:54:37 +08:00
parent 05802da734
commit 1f21793ee2
10 changed files with 2040 additions and 1456 deletions

View File

@@ -462,10 +462,10 @@ export default {
index: '5',
title: this.$t('sidebar.journalManagement'),
subs: [
// {
// index: 'JournalManagement',
// title: this.$t('sidebar.journalManagement')
// },
{
index: 'JournalManagement',
title: this.$t('sidebar.journalList')
},
{
index: 'Journal_Agreement',
@@ -666,11 +666,11 @@ export default {
subs: [
{
index: 'Classificationmanagement',
title: this.$t('menu.Classificationmanagement'),
title: this.$t('sidebar.journalManagement'),
subs: [
{
index: 'JournalManagementAll',
title: this.$t('sidebar.journalManagement')
title: this.$t('sidebar.journalList')
},
{
index: 'GroupClassification',

View File

@@ -173,6 +173,7 @@ const en = {
userTalSys8: 'Young Scientist apply list',
userManSys: 'User Management System',
journalManagement: 'Journal Management',
journalList: 'Journal List',
userManSys1: 'Total User',
userManSys11: 'Active Users',
userManSys12: 'Inactive Users',
@@ -236,7 +237,7 @@ const en = {
chiefInspector: 'Chief Inspector',
journalArticleCount: 'Journal Article Count',
managingDirector: 'Managing Director',
GroupClassification: 'Group Classification',
GroupClassification: 'Group List',
},
home: {
authortop: 'Author guide',

View File

@@ -168,6 +168,7 @@ const zh = {
userTalSys8: '青年科学家申请列表',
userManSys: '用户管理',
journalManagement: '期刊管理',
journalList: '期刊列表',
userManSys1: '用户管理',
userManSys11: '活跃用户',
userManSys12: '非活跃用户',
@@ -231,7 +232,7 @@ const zh = {
chiefInspector: '总监',
journalArticleCount: '期刊文章计数总结',
managingDirector: '总经理',
GroupClassification: '集团分类',
GroupClassification: '集团列表',
},
home: {

View File

@@ -0,0 +1,692 @@
<template>
<div style="height: calc(100% - 20px)">
<!-- <div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item> <i class="el-icon-user"></i> Journal Agreement </el-breadcrumb-item>
</el-breadcrumb>
</div> -->
<div class="container" style="min-width: 1000px; padding: 0 20px">
<!-- <div>
<span style="font-size: 14px; color: #606266; margin: 0 10px 0 0">Journal : </span>
<el-select
v-model="dataForm.journal_id"
placeholder="Please select a journal"
@change="handleSelectJournal"
style="width: 220px; margin-right: 35px"
>
<el-option v-for="item in df_jour" :label="item.title" :key="item.journal_id" :value="item.journal_id"></el-option>
</el-select>
</div>
<div class="handle-box" style="margin-bottom: 15px; overflow: hidden">
</div> -->
<!-- :action="'/api/api/Ucenter/up_userIcon_file'" -->
<el-upload
class="chapter-avatar-uploader"
:action="baseUrl + '/api/Ucenter/up_userIcon_file'"
name="icon"
accept=".jpeg,.jpg,.gif,.png"
:show-file-list="false"
:on-success="contentUploadSuccess"
>
</el-upload>
<quill-editor
v-model="dataForm.ethics"
ref="myQuillEditor"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)"
class="chapter_editor"
>
</quill-editor>
<div class="queSub">
<el-button type="primary" @click="submitGpt()"> Submit </el-button>
</div>
<!-- <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="query.pageIndex"
:page-size="query.pageSize" :total="Total" @current-change="handlePageChange"></el-pagination>
</div> -->
</div>
<!-- 添加弹出框 -->
<el-dialog title="Add Editors & Staff" :visible.sync="addVisible" width="660px" :close-on-click-modal="false" @close="addVisCancle">
<el-form ref="add_Form" :model="addForm" :rules="rules" label-width="140px" v-if="!dis_able">
<el-form-item label="Email / Account :" prop="account" v-if="!dis_able">
<el-input v-model="addForm.account" style="width: 300px"></el-input>
<el-button type="warning" @click="saerNa_U()" style="margin-left: 15px" icon="el-icon-paperclip"> Check</el-button>
<p style="color: #888; margin-top: 10px">
Note: The new Editors & Staff must be a registered user.
<br />Click <a class="zhu_ce" @click="Goto_res()">register</a>.
</p>
</el-form-item>
</el-form>
<el-form ref="add_Form" :model="addForm" :rules="rules" label-width="150px" v-if="dis_able">
<el-form-item label="Account :">
{{ addForm.account }}
</el-form-item>
<el-form-item label="Email :">
{{ addForm.email }}
</el-form-item>
<el-form-item label="Realname :">
{{ addForm.realname }}
</el-form-item>
<el-form-item label="Journal :" prop="journal_id">
<el-select v-model="addForm.journal_id" placeholder="Please select a journal" style="width: 270px">
<el-option v-for="item in df_jour" :label="item.title" :key="item.journal_id" :value="item.journal_id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="Title :" prop="title">
<el-select v-model="addForm.title" placeholder="Please select a title" style="width: 270px">
<el-option v-for="item in titleList" :label="item.name" :key="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="Personal introduction :" >
<el-input type="textarea" v-model="addForm.areas" placeholder="Please enter"></el-input>
</el-form-item> -->
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisCancle">Cancel</el-button>
<el-button type="primary" @click="saveAdd()" v-if="dis_able">OK</el-button>
</span>
</el-dialog>
<!-- 编辑弹出框 -->
<el-dialog title="Edit Editors & Staff" :visible.sync="editvisible" width="600px" @close="editClose()">
<el-form ref="addForm1" :model="addForm1" label-width="150px">
<el-form-item label="Title :" prop="editor_title">
<el-select v-model="addForm1.editor_title" placeholder="Please select a title" style="width: 270px">
<el-option v-for="item in titleList" :label="item.name" :key="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editClose()">Cancel</el-button>
<el-button type="primary" @click="saveEdit()">OK</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { quillEditor } from 'vue-quill-editor';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
['blockquote', 'code-block'], //引用,代码块
[{ header: 1 }, { header: 2 }], // 几级标题
[{ list: 'ordered' }, { list: 'bullet' }], // 有序列表,无序列表
[{ script: 'sub' }, { script: 'super' }], // 下角标,上角标
[{ indent: '-1' }, { indent: '+1' }], // 缩进
[{ direction: 'rtl' }], // 文字输入方向
[{ size: ['small', false, 'large', 'huge'] }], // 字体大小
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
[{ color: [] }, { background: [] }], // 颜色选择
[{ font: ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }], // 字体
[{ align: [] }], // 居中
['clean'], // 清除样式,
['link', 'image'] // 上传图片、上传视频
];
export default {
props: ['journal'],
name: 'youthList',
components: {
quillEditor
},
data() {
return {
YearThis: 0,
edit_id: localStorage.getItem('U_id'),
baseUrl: this.Common.baseUrl,
mediaUrl: this.Common.mediaUrl,
dataForm: {},
editorOption: {
modules: {
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
toolbar: {
container: toolbarOptions,
handlers: {
image: function (value) {
if (value) {
// 调用element的图片上传组件
document.querySelector('.chapter-avatar-uploader input').click();
} else {
this.quill.format('image', false);
}
}
}
}
},
placeholder: this.$t('protocol.PublishingAgreementInfo')
},
query: {
journal_id: 0
},
Total: 0,
df_jour: [],
df_year: [],
titleList: [{ name: 'Production Editor' }, { name: 'Assistant Editor' }, { name: 'Managing Editor' }],
list_year: [
{
title: '1 Year',
id: 1
},
{
title: '2 Years',
id: 2
},
{
title: '3 Years',
id: 3
}
],
tableData: [],
IMG_Url: '',
addVisible: false,
reneVisible: false,
cerVisible: false,
addForm: {
account: ''
},
addForm1: {
etj_id: null,
editor_title: ''
},
editvisible: false,
reneForm: {
journal_id: 0
},
remarkMes: {
remark: ''
},
remarkBox: false,
dis_able: false,
rules: {
account: [
{
required: true,
message: 'Please enter email / account',
trigger: 'blur'
}
],
journal_id: [
{
required: true,
message: 'Please select journal',
trigger: 'blur'
}
]
// year: [{
// required: true,
// message: 'Please select year',
// trigger: 'blur'
// }],
}
};
},
onShow() {
// var pages = getCurrentPages(); // 获取当前页面栈
// var currentPage = pages[pages.length - 1]; // 当前页面
// if (currentPage.data.refreshIfNeeded) {
// currentPage.data.refreshIfNeeded = false;
// //这里为要调用的函数重新获取数据记得加上this
// this.getDate();
// }
},
created() {
// this.getSelect();
},
methods: {
init() {
this.dataForm.journal_id = this.journal.journal_id;
console.log('this.journal.journal_id at line 248:', this.journal);
this.dataForm.ethics = this.journal.ethics;
this.$forceUpdate();
},
// 提交问题
submitGpt() {
// if (this.falseMark) {
// return false
// }
if (this.dataForm.ethics == '') {
this.$message.error(this.$t('protocol.PublishingAgreementInfo') + '');
return false;
}
// 传递问题
this.$api
.post('api/Journal/editJournalLeftZc', {
...this.dataForm
})
.then((res) => {
console.log('res at line 257:', res);
if (res.code == 0) {
this.$message.success(res.msg);
this.getSelect();
// 循环答案
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
console.log(err);
});
},
handleSelectJournal(e) {
console.log('data at line 212:', e);
var data = this.df_jour.find((v) => v.journal_id == e);
console.log('data at line 246:', data);
this.dataForm.ethics = data.ethics;
this.$refs.myQuillEditor.form = this.dataForm.ethics;
// const length = this.$refs.myQuillEditor.quill.getLength(); // 获取编辑器内容的长度
// this.$refs.myQuillEditor.quill.setSelection(length, 0);
this.$nextTick(() => {
// let quill = this.$refs.myQuillEditor.quill;
// console.log('quill.getSelection() at line 292:', quill.getSelection())
// let length = quill.getSelection().length;
// // 插入图片res为服务器返回的图片链接地址
// quill.insertEmbed(length, 'image', this.mediaUrl + 'usericon/' + res.upurl);
// // 调整光标到最后
// quill.setSelection(length + 1);
});
this.$forceUpdate();
},
contentUploadSuccess(res, file) {
// console.log(res)
let quill = this.$refs.myQuillEditor.quill;
// 如果上传成功
if (res) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, 'image', this.mediaUrl + 'usericon/' + res.upurl);
// 调整光标到最后
quill.setSelection(length + 1);
} else {
// 提示信息需引入Message
this.$message.error('图片插入失败!');
}
},
// 失去焦点事件
onEditorBlur(quill) {
// console.log('editor blur!', quill)
},
// 获得焦点事件
onEditorFocus(quill) {
//console.log('editor focus!', quill)
},
// 准备富文本编辑器
onEditorReady(quill) {
// console.log('editor ready!', quill)
},
// 关闭编辑弹窗
editClose() {
this.editvisible = false;
(this.addForm1.etj_id = null), (this.addForm1.editor_title = '');
},
// 显示编辑弹出框
editHandle(val) {
this.editvisible = true;
this.$nextTick(function () {
this.addForm1.etj_id = val.etj_id;
this.addForm1.editor_title = val.editor_title;
});
},
// 提交编辑弹窗
saveEdit() {
this.$api
.post('api/User/editEditorToJournal', {
etj_id: this.addForm1.etj_id,
editor_title: this.addForm1.editor_title
})
.then((res) => {
if (res.code == 0) {
this.$message.success('Edit successfully!');
this.editClose();
// this.getDate();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
},
// 获取下拉值
getSelect() {
this.$api
.post('api/Journal/getJournalByeditor', {
user_id: this.edit_id
})
.then((res) => {
if (res.code == 0) {
this.df_jour = res.data.journals;
if (JSON.stringify(this.dataForm) == '{}') {
this.dataForm.journal_id = this.df_jour[0].journal_id;
this.dataForm.ethics = this.df_jour[0].ethics;
}
// this.getDate();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
},
// 获取列表数据
getDate() {
this.$api
.post('api/Journal/getJournalByeditor', {
user_id: this.edit_id
})
.then((res) => {
console.log(res, 111111111111);
if (res.code == 0) {
this.tableData = res.data.journals;
// for (var i = 0; i < this.tableData.length; i++) {
// this.getScoreData(i, this.tableData[i].score)
// }
// this.Total = res.data.count;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
console.log(err);
});
},
// 评分
getScoreData(i, e) {
this.tableData[i].starList = [];
this.tableData[i].starList_mark = 0;
if (e < 0.5 && e > 0) {
this.tableData[i].starList.push({
star: 2
});
this.tableData[i].starList_mark = 1;
} else {
let zheng = Math.floor(e);
let xiao = Number(e) - Math.floor(e);
if (xiao >= 0.5) {
xiao = 0.5;
} else {
xiao = 0;
}
for (var j = 0; j < zheng; j++) {
this.tableData[i].starList.push({
star: 1
});
}
if (xiao == 0.5) {
this.tableData[i].starList.push({
star: 0
});
}
this.tableData[i].starList_mark = Number(zheng) + Number(xiao);
}
},
// 新增
addHandle() {
this.dis_able = false;
this.addForm.account = '';
this.addVisible = true;
},
// 保存添加
saveAdd() {
this.$refs.add_Form.validate((valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// console.log(this.addForm,'this.addForm')
this.$api
.post('api/User/addEditorToJournal', {
user_id: this.addForm.user_id,
journal_id: this.addForm.journal_id,
editor_title: this.addForm.title
//'research_areas': this.addForm.areas
})
.then((res) => {
if (res.code == 0) {
this.getDate();
this.$message.success('Added successfully!');
// this.$refs.add_Form.resetFields();
this.dis_able = false;
this.addVisible = false;
loading.close();
} else {
this.$message.error(res.msg);
loading.close();
}
})
.catch((err) => {
this.$message.error(err);
loading.close();
});
} else {
return false;
}
});
},
// 添加关闭
addVisCancle() {
this.addVisible = false;
this.addForm.journal_id = null;
this.addForm.research_areas = '';
},
// 查找与他相同的账号
saerNa_U() {
if (this.addForm.account != undefined && this.addForm.account != '') {
this.$api
.post('api/User/searchUserByAccountEmail', {
account: this.addForm.account
})
.then((res) => {
if (res.code == 0) {
if (res.data.user == null) {
this.dis_able = false;
this.$message.error('Verify that the account or mailbox does not exist!');
} else {
this.dis_able = true;
this.addForm.user_id = res.data.user.user_id;
this.addForm.account = res.data.user.account;
this.addForm.realname = res.data.user.realname;
this.addForm.email = res.data.user.email;
}
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
} else {
this.$message.error('Verification account or mailbox cannot be empty!');
}
},
// 点击注册
Goto_res() {
this.$router.push('/register');
},
// 详情
handleDtail(e) {
let routerJump = this.$router.resolve({
path: '/partyRole',
query: {
id: e.user_id
}
});
window.open(routerJump.href, '_blank');
},
// 删除
reneDelete(e) {
// 二次确认删除
this.$confirm('Are you sure you want to delete?', 'Tip', {
type: 'warning'
})
.then(() => {
this.$api
.post('api/User/delEditorToJournal', { etj_id: e.etj_id })
.then((res) => {
if (res.code == 0) {
this.$message.success('Deleted successfully');
this.getDate();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
})
.catch(() => {});
},
// 分页导航
handlePageChange(val) {
this.$set(this.query, 'pageIndex', val);
this.getDate();
},
colorIndex(num, time) {
if (time != 0) {
let date = new Date(parseInt(time * 1000));
let Y = date.getFullYear() + '-';
let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) + '-' : date.getMonth() + 1 + '-';
let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let H = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
let U = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
time = Y + M + D;
}
let str = '';
if (num < 10) {
str =
'<b style="color:#cb160a">' +
num +
'</b><span style="color:#aaa;font-size:14px;margin-left:5px;"><br/>(' +
time +
')</span>';
} else if (num < 15) {
str =
'<b style="color:#cbb504">' +
num +
'</b><span style="color:#aaa;font-size:14px;margin-left:5px;"><br/>(' +
time +
')</span>';
} else {
str =
'<b style="color:#0cbc15">' +
num +
'</b><span style="color:#aaa;font-size:14px;margin-left:5px;"><br/>(' +
time +
')</span>';
}
if (time == 0) {
str = '<b style="color:#aaa;">0</b><br/><span style="color:#aaa;font-size:14px;margin-left:5px;">(Empty)</span>';
}
return str;
},
// 时间格式
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;
},
formatYear(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;
return Y + M;
}
}
};
</script>
<style scoped>
.handle-box {
margin-bottom: 20px;
}
.table {
width: 100%;
font-size: 14px;
}
.red {
color: #ff0000;
}
.zhu_ce {
text-decoration: underline;
color: #006699;
font-weight: bold;
cursor: pointer;
}
.tab_tie_col {
margin-bottom: 5px;
color: #333;
word-wrap: break-word;
word-break: normal;
}
.tab_tie_col > span {
color: #888;
margin: 0 5px 0 0;
font-size: 13px;
}
.starSty {
width: 18px;
margin-right: 4px;
vertical-align: text-top;
}
.starSty:nth-last-child(1) {
margin-right: 0;
}
.queSub {
position: absolute;
bottom: 30px;
right: 45px;
margin: 20px 0 0 0;
}
.container {
height: 70vh;
}
/deep/.el-drawer__body{
height: 95% !important;
}
</style>

View File

@@ -1,140 +1,26 @@
<template>
<div id="app">
<!-- <el-button type="primary" @click="horizontal = !horizontal">切换tree方向</el-button> -->
<div style="overflow: hidden">
<span style="font-size: 14px;font-weight: 700; color: #606266; margin: 0 10px 0 0">{{ $t('GroupClassification.Journal') }}: </span>
<el-select
v-model="dataForm.journal_id"
placeholder="Please select a journal"
@change="handleSelectJournal"
style="width: 220px; margin-right: 35px"
>
<el-option v-for="item in df_jour" :label="item.title" :key="item.journal_id" :value="item.journal_id"></el-option>
</el-select>
<commonTable :urlList="urlList">
<div
@click="toggleExpand(data, true)"
style="float: right; line-height: 32px; color: #006699; font-size: 12px; font-weight: 700; margin-right: 20px"
>
{{ $t('GroupClassification.ExpandAll') }}
</div>
</div>
<org-tree
id="orgTreeNode"
:data="data"
:horizontal="horizontal"
isSelect
collapsable
:render-content="renderContent"
@on-expand="onExpand"
@on-node-mouseover="onMouseover"
@on-node-mouseout="onMouseout"
@on-expand-mouseover="Mouseover"
@on-expand-mouseout="Mouseout"
@on-node-click="cccc"
>
</org-tree>
<!-- <div
class="floating"
v-show="isShowF && bd&&this.currentTreeData.id!='abc0'"
@mouseover="
() => {
isShowF = true;
}
"
@mouseout="
() => {
isShowF = false;
}
"
@mousewheel.prevent="mouseWheelDia"
>
<p @click="addOrEdit(0)">{{ $t('GroupClassification.bind') }}</p>
</commonTable>
<p @click="addOrEdit(1)">{{ $t('GroupClassification.Unbind') }}</p>
</div> -->
<!-- 增加/编辑弹层 -->
<el-dialog
:title="isEdit == 0 ? $t('GroupClassification.add') : $t('GroupClassification.edit')"
v-if="dialogVisible"
:visible="dialogVisible"
@close="clearDialog"
show-close
:close-on-click-modal="false"
custom-class="addOrEditDia"
width="35%"
>
<div class="tips">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" @submit.native.prevent label-width="120px">
<el-form-item :label="$t('GroupClassification.major_current')" v-if="isEdit == 0">
{{ this.currentTreeData.label }}
</el-form-item>
<el-form-item prop="major_title" :label="$t('GroupClassification.major_title')">
<el-input
v-focus
:placeholder="$t('GroupClassification.enter')"
clearable
v-model="ruleForm.major_title"
@keyup.enter.native="confirm"
></el-input>
</el-form-item>
<el-form-item prop="nickname" :label="$t('GroupClassification.nickname')">
<el-input
v-focus
:placeholder="$t('GroupClassification.enter')"
clearable
v-model="ruleForm.nickname"
@keyup.enter.native="confirm"
></el-input>
</el-form-item>
<el-form-item prop="major_sort" :label="$t('GroupClassification.sort')">
<el-input
v-focus
:placeholder="$t('GroupClassification.enter')"
clearable
v-model="ruleForm.major_sort"
@keyup.enter.native="confirm"
></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<div class="tip-left">
<el-button size="small" type="info" @click="dialogVisible = false">{{ $t('GroupClassification.cancel') }}</el-button>
<el-button size="small" type="primary" @click="confirm">{{ $t('GroupClassification.submit') }}</el-button>
</div>
</span>
</el-dialog>
<!-- 删除 -->
<el-dialog
:title="$t('GroupClassification.delete')"
v-if="dialogVisible2"
:visible="dialogVisible2"
@close="clearDialog"
custom-class="delDia"
width="35%"
>
<div class="tips">
<p style="text-align: left">{{ $t('GroupClassification.deleteInfo') }} {{ this.currentTreeData.label }} ?</p>
</div>
<span slot="footer" class="dialog-footer">
<div class="tip-left">
<el-button size="mini" type="info" @click="dialogVisible2 = false">{{ $t('GroupClassification.cancel') }}</el-button>
<el-button size="mini" type="primary" @click="confimdelete">{{ $t('GroupClassification.submit') }}</el-button>
</div>
</span>
</el-dialog>
</div>
</template>
<script>
import OrgTree from '@/components/org-tree';
import commonTable from './common.vue';
import bus from '@/components/common/bus';
export default {
name: 'app',
components: {
OrgTree
OrgTree,commonTable
},
directives: {
focus: {
@@ -145,6 +31,10 @@ export default {
},
data() {
return {
defaultProps: {
children: 'children',
label: 'title'
},
dataForm: {},
edit_id: localStorage.getItem('U_id'),
currentJournal: {},
@@ -176,6 +66,8 @@ export default {
labelClassName: 'bg-white',
urlList: {
list: 'api/Major/getJournalMajorInAll',
getJournalList: 'api/Journal/getAllJournal',
bind: 'api/Major/addJournalMajor',
unbind: 'api/Major/delJournalMajor'
@@ -189,35 +81,32 @@ export default {
this.ruleForm = {};
}
}
},
}
},
async created() {
const a = this.numFormatter(9999999999);
console.log(a);
await this.getSelect();
// const a = this.numFormatter(9999999999);
// console.log(a);
// await this.getSelect();
},
async activated() {
const a = this.numFormatter(9999999999);
console.log(a);
await this.getSelect();
// const a = this.numFormatter(9999999999);
// console.log(a);
// await this.getSelect();
},
methods: {
// 获取下拉值
async getSelect() {
var that = this;
this.$api
.post('/api/Journal/getAllJournal', {})
.post('/api/Journal/getJournalByeditor', {
user_id: this.edit_id
})
.then(async (res) => {
if (res.code == 0) {
this.df_jour = res.data.journals;
this.dataForm.journal_id = this.df_jour[0].journal_id;
this.currentJournal = this.df_jour[0];
this.$nextTick(async () => {
await that.getDate();
});
await this.getDate();
// this.getDate();
} else {
@@ -229,11 +118,9 @@ export default {
});
},
async handleSelectJournal(e) {
var data = this.df_jour.find((v) => v.journal_id == e);
this.currentJournal = e;
this.currentJournal = data;
console.log('this.currentJournal at line 221:', this.currentJournal);
await this.getDate();
// await this.getDate();
this.$forceUpdate();
},
@@ -250,15 +137,14 @@ export default {
},
// 获取数据
async getDate() {
console.log('getDate at line 251:', 'getDate');
this.$api
.post(this.urlList.list, { journal_issn: this.currentJournal.issn })
.post(this.urlList.list, {})
.then(async (res) => {
if (res.code == 0) {
this.data.children = res.data.majors;
this.data = res.data.journals;
await this.renameKeys(this.data.children, 'major_title', 'label');
await this.toggleExpand(this.data, true); // 调用全部展开
// await this.renameKeys(this.data.children, 'major_title', 'label');
// await this.toggleExpand(this.data, true); // 调用全部展开
this.$forceUpdate();
} else {
this.$message.error(res.msg);
@@ -286,7 +172,7 @@ export default {
console.log('b at line 270:', b);
// isShowF && bd
console.log('bd at line 272:', this.isShowF, this.bd);
if (this.isShowF && this.bd&&this.currentTreeData.id!='abc0') {
if (this.isShowF && this.bd && this.currentTreeData.id != 'abc0') {
var BindInfo = b.selected == 0 ? this.$t('GroupClassification.BindInfo') : this.$t('GroupClassification.UnBindInfo');
this.$confirm(`${this.$t('GroupClassification.JournalBindInfo')} ${this.currentJournal.title}${BindInfo}`, '提示', {
confirmButtonText: this.$t('GroupClassification.submit'),
@@ -645,4 +531,25 @@ export default {
width: calc(100% - 40px) !important;
overflow: auto !important;
}
.journalList {
width: 360px;
height: 100%;
padding: 5px 10px 10px;
background-color: #fff;
box-sizing: border-box;
float: left;
background: #fff;
color: #606266;
font-size: 14px;
line-height: 30px;
}
.baseInfo{
width: calc(100% - 370px);
height: 100%;
padding: 20px;
box-sizing: border-box;
background-color: #fff;
float: right;
}
</style>

View File

@@ -1,17 +1,19 @@
<template>
<div id="app">
<div style="width: 100%; height: 100%">
<!-- <el-button type="primary" @click="horizontal = !horizontal">切换tree方向</el-button> -->
<div style="overflow: hidden">
<span style="font-size: 14px;font-weight: 700; color: #606266; margin: 0 10px 0 0">{{ $t('GroupClassification.Journal') }}: </span>
<el-select
<div style="overflow: hidden; padding-left: 20px; box-sizing: border-box">
<!-- <span style="font-size: 14px; font-weight: 700; color: #606266; margin: 0 10px 0 0"
>{{ $t('GroupClassification.Journal') }}:{{ journal.title }}
</span> -->
<!-- <el-select
v-model="dataForm.journal_id"
placeholder="Please select a journal"
@change="handleSelectJournal"
style="width: 220px; margin-right: 35px"
>
<el-option v-for="item in df_jour" :label="item.title" :key="item.journal_id" :value="item.journal_id"></el-option>
</el-select>
</el-select> -->
<div
@click="toggleExpand(data, true)"
@@ -21,6 +23,7 @@
</div>
</div>
<org-tree
v-loading="dataLoading"
id="orgTreeNode"
:data="data"
:horizontal="horizontal"
@@ -133,6 +136,7 @@ import OrgTree from '@/components/org-tree';
import bus from '@/components/common/bus';
export default {
name: 'app',
props: ['journal', 'urlList'],
components: {
OrgTree
},
@@ -145,9 +149,11 @@ export default {
},
data() {
return {
dataLoading:false,
dataForm: {},
edit_id: localStorage.getItem('U_id'),
currentJournal: {},
df_jour: [],
bd: true,
ruleForm: {
@@ -173,13 +179,13 @@ export default {
isEdit: 0,
currentTreeData: {},
lastId: 11,
labelClassName: 'bg-white',
urlList: {
list: 'api/Major/getJournalMajorInAll',
labelClassName: 'bg-white'
// urlList: {
// list: 'api/Major/getJournalMajorInAll',
bind: 'api/Major/addJournalMajor',
unbind: 'api/Major/delJournalMajor'
}
// bind: 'api/Major/addJournalMajor',
// unbind: 'api/Major/delJournalMajor'
// }
};
},
watch: {
@@ -191,34 +197,39 @@ export default {
}
}
},
async created() {
const a = this.numFormatter(9999999999);
console.log(a);
await this.getSelect();
},
async activated() {
const a = this.numFormatter(9999999999);
console.log(a);
await this.getSelect();
},
// async created() {
// const a = this.numFormatter(9999999999);
// console.log(a);
// await this.getSelect();
// },
// async activated() {
// const a = this.numFormatter(9999999999);
// console.log(a);
// await this.getSelect();
// },
methods: {
async init(){
async init() {
this.dataLoading=true;
this.dataForm.journal_id = this.journal.journal_id;
console.log('this.journal.journal_id at line 210:', this.journal);
this.currentJournal = { ...this.journal };
await this.getSelect();
},
// 获取下拉值
async getSelect() {
this.$api
.post('/api/Journal/getJournalByeditor', {
.post(this.urlList.getJournalList, {
user_id: this.edit_id
})
.then(async (res) => {
if (res.code == 0) {
this.df_jour = res.data.journals;
if (this.journal == {}) {
this.dataForm.journal_id = this.df_jour[0].journal_id;
this.currentJournal = this.df_jour[0];
await this.getDate();
}
await this.getDate();
// this.getDate();
} else {
@@ -234,6 +245,7 @@ export default {
this.currentJournal = data;
console.log('this.currentJournal at line 221:', this.currentJournal);
await this.getDate();
this.$forceUpdate();
@@ -259,12 +271,15 @@ export default {
await this.renameKeys(this.data.children, 'major_title', 'label');
await this.toggleExpand(this.data, true); // 调用全部展开
this.dataLoading=false;
this.$forceUpdate();
} else {
this.dataLoading=false;
this.$message.error(res.msg);
}
})
.catch((err) => {
this.dataLoading=false;
this.$message.error(err);
});
},
@@ -286,11 +301,11 @@ export default {
console.log('b at line 270:', b);
// isShowF && bd
console.log('bd at line 272:', this.isShowF, this.bd);
if (this.isShowF && this.bd&&this.currentTreeData.id!='abc0') {
if (this.isShowF && this.bd && this.currentTreeData.id != 'abc0') {
var BindInfo = b.selected == 0 ? this.$t('GroupClassification.BindInfo') : this.$t('GroupClassification.UnBindInfo');
this.$confirm(`${this.$t('GroupClassification.JournalBindInfo')} ${this.currentJournal.title}${BindInfo}`, '提示', {
confirmButtonText: this.$t('GroupClassification.submit'),
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true,
cancelButtonText: this.$t('GroupClassification.cancel'),
type: 'warning'
})
@@ -507,17 +522,16 @@ export default {
onMouseover(e, data) {
var collapse = localStorage.getItem('collapse');
var width = Number(e.clientX - (!collapse || collapse == 'false' ? 260 : 40));
// 鼠标移入树节点
this.currentTreeData = data; // 鼠标移入,该节点的所有数据
this.isShowF = true;
var floating = document.getElementsByClassName('floating')[0];
if(floating){
floating.style.left = width + 'px';
floating.style.top = e.clientY - 80 + 'px';
if (floating) {
floating.style.left = width + 'px';
floating.style.top = e.clientY - 80 + 'px';
}
},
onMouseout(e, data) {
// 鼠标移出树节点

View File

@@ -9,6 +9,9 @@
ref="multipleTable"
header-cell-class-name="table-header"
empty-text="New messages (0)"
:row-key="getRowKeys"
:expand-row-keys="expands"
@expand-change="expndChange"
>
<el-table-column type="expand" width="30">
<template slot-scope="scope">
@@ -46,30 +49,52 @@
<el-table-column prop="issn" width="160" label="issn"></el-table-column>
<el-table-column label=" " width="200" align="center">
<template slot-scope="scope">
<p
<template slot-scope="scope"
>
<span
@click="
openJournal({
...scope.row
})
"
style="color: #006699 !important; cursor: pointer"
style="background-color: #c2d4ff; color: #4665b0; cursor: pointer;padding: 2px 2px;font-weight: bold;;border-radius: 4px;"
>
{{ $t('menu.Classificationmanagement') }}
</p>
<i class="el-icon-connection" style="color: #4665b0;"></i> {{ $t('menu.Classificationmanagement') }}
</span>
<span
@click="
openJournalAgreement({
...scope.row
})
"
style="color: #006699 !important; cursor: pointer; margin-left: 6px"
>
<i class="el-icon-document"></i> {{ $t('sidebar.userManSys11') }}
</span>
</template>
</el-table-column>
</el-table>
</div>
<el-drawer
:title="this.currentTreeData.label + ' ' + $t('GroupClassification.AssociatedJournal')"
destroy-on-close
:title="$t('GroupClassification.Journal') + ' : ' + currentJournal.title"
:visible.sync="drawer"
direction="rtl"
:before-close="handleClose"
size="50%"
size="90%"
>
<common-class ref="commonClass" :currentJournal="currentJournal"></common-class>
<commonclass ref="commonClassRef" :journal="currentJournal" :urlList="urlList"></commonclass>
</el-drawer>
<el-drawer
destroy-on-close
:title="$t('GroupClassification.Journal') + ' : ' + currentJournal.title"
:visible.sync="drawerAgreement"
direction="rtl"
:before-close="handleAgreementClose"
size="90%"
>
<common-agreement ref="commonAgreementRef" :journal="currentJournal" :urlList="urlList"></common-agreement>
</el-drawer>
</div>
</template>
@@ -77,13 +102,15 @@
<script>
import OrgTree from '@/components/org-tree';
import commonclass from './class.vue';
import commonAgreement from './agreement.vue';
import bus from '@/components/common/bus';
export default {
name: 'app',
props: ['urlList'],
components: {
OrgTree,
commonclass
commonclass,
commonAgreement
},
directives: {
focus: {
@@ -94,10 +121,13 @@ export default {
},
data() {
return {
activeNames: [],
expands: [],
edit_id: localStorage.getItem('U_id'),
AssociatedJournalList: [],
JournalList: [],
drawer: false,
drawerAgreement: false,
bd: true,
ruleForm: {
major_title: '',
@@ -143,6 +173,19 @@ export default {
await this.getDate();
},
methods: {
expndChange(row, expandedRows) {
if (expandedRows.length) {
this.expands = []
if (row) {
this.expands.push(row.journal_id) // 每次push进去的是每行的ID
}
} else {
this.expands = [] // 默认不展开
}
},
getRowKeys(row) {
return row.journal_id
},
changeBind(b) {
var BindInfo = b.selected == 0 ? this.$t('GroupClassification.BindInfo') : this.$t('GroupClassification.UnBindInfo');
this.$confirm(`${this.$t('GroupClassification.JournalBindInfo')} ${b.title}${BindInfo}`, '提示', {
@@ -194,6 +237,11 @@ export default {
},
handleClose() {
this.drawer = false;
this.currentJournal = {};
},
handleAgreementClose() {
this.drawerAgreement = false;
this.currentJournal = {};
},
getAssociatedJournalList() {
this.$api
@@ -213,12 +261,20 @@ export default {
});
},
openJournal(data) {
this.currentJournal=data
var that = this;
this.currentJournal = data;
this.drawer = true;
this.$refs.commonClass.init()
// AssociatedJournalList
// this.getAssociatedJournalList();
this.$nextTick(() => {
that.$refs.commonClassRef.init();
});
},
openJournalAgreement(data) {
var that = this;
this.currentJournal = data;
this.drawerAgreement = true;
this.$nextTick(() => {
that.$refs.commonAgreementRef.init();
});
},
renameKeys(obj, oldKey, newKey) {
if (obj[oldKey]) {
@@ -234,7 +290,7 @@ export default {
// 获取数据
async getDate() {
this.$api
.post(this.urlList.list, {
.post(this.urlList.getJournalList, {
user_id: this.edit_id
})
.then(async (res) => {

View File

@@ -1,22 +1,6 @@
<template>
<div id="app">
<!-- <el-button type="primary" @click="horizontal = !horizontal">切换tree方向</el-button> -->
<!-- <div class="journalList" style="overflow: hidden">
<span style="font-size: 14px;font-weight: 700; color: #333; margin: 0 0px 20 0">{{ this.$t('sidebar.editorialBoard3') }} </span>
<div v-for="(v, i) in df_jour">
<p @click="handleSelectJournal(v)">
<span
class="el-tree-node__expand-icon el-icon-caret-right"
style="margin-right: 10px"
:style="currentJournal.journal_id == v.journal_id ? 'color: #006699;' : 'color:transparent'"
></span>
<span :style="currentJournal.journal_id == v.journal_id ? 'color: #006699;font-weight:700;' : ''">{{ v.title }}</span>
</p>
</div>
</div> -->
<commonTable :urlList="urlList">
@@ -24,96 +8,7 @@
</commonTable>
<!-- <div
class="floating"
v-show="isShowF && bd&&this.currentTreeData.id!='abc0'"
@mouseover="
() => {
isShowF = true;
}
"
@mouseout="
() => {
isShowF = false;
}
"
@mousewheel.prevent="mouseWheelDia"
>
<p @click="addOrEdit(0)">{{ $t('GroupClassification.bind') }}</p>
<p @click="addOrEdit(1)">{{ $t('GroupClassification.Unbind') }}</p>
</div> -->
<!-- 增加/编辑弹层 -->
<el-dialog
:title="isEdit == 0 ? $t('GroupClassification.add') : $t('GroupClassification.edit')"
v-if="dialogVisible"
:visible="dialogVisible"
@close="clearDialog"
show-close
:close-on-click-modal="false"
custom-class="addOrEditDia"
width="35%"
>
<div class="tips">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" @submit.native.prevent label-width="120px">
<el-form-item :label="$t('GroupClassification.major_current')" v-if="isEdit == 0">
{{ this.currentTreeData.label }}
</el-form-item>
<el-form-item prop="major_title" :label="$t('GroupClassification.major_title')">
<el-input
v-focus
:placeholder="$t('GroupClassification.enter')"
clearable
v-model="ruleForm.major_title"
@keyup.enter.native="confirm"
></el-input>
</el-form-item>
<el-form-item prop="nickname" :label="$t('GroupClassification.nickname')">
<el-input
v-focus
:placeholder="$t('GroupClassification.enter')"
clearable
v-model="ruleForm.nickname"
@keyup.enter.native="confirm"
></el-input>
</el-form-item>
<el-form-item prop="major_sort" :label="$t('GroupClassification.sort')">
<el-input
v-focus
:placeholder="$t('GroupClassification.enter')"
clearable
v-model="ruleForm.major_sort"
@keyup.enter.native="confirm"
></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<div class="tip-left">
<el-button size="small" type="info" @click="dialogVisible = false">{{ $t('GroupClassification.cancel') }}</el-button>
<el-button size="small" type="primary" @click="confirm">{{ $t('GroupClassification.submit') }}</el-button>
</div>
</span>
</el-dialog>
<!-- 删除 -->
<el-dialog
:title="$t('GroupClassification.delete')"
v-if="dialogVisible2"
:visible="dialogVisible2"
@close="clearDialog"
custom-class="delDia"
width="35%"
>
<div class="tips">
<p style="text-align: left">{{ $t('GroupClassification.deleteInfo') }} {{ this.currentTreeData.label }} ?</p>
</div>
<span slot="footer" class="dialog-footer">
<div class="tip-left">
<el-button size="mini" type="info" @click="dialogVisible2 = false">{{ $t('GroupClassification.cancel') }}</el-button>
<el-button size="mini" type="primary" @click="confimdelete">{{ $t('GroupClassification.submit') }}</el-button>
</div>
</span>
</el-dialog>
</div>
</template>
@@ -169,7 +64,9 @@ export default {
lastId: 11,
labelClassName: 'bg-white',
urlList: {
list: 'api/Journal/getJournalByeditor',
list: 'api/Major/getJournalMajorInAll',
getJournalList: 'api/Journal/getJournalByeditor',
bind: 'api/Major/addJournalMajor',
unbind: 'api/Major/delJournalMajor'
@@ -186,14 +83,14 @@ export default {
}
},
async created() {
const a = this.numFormatter(9999999999);
console.log(a);
await this.getSelect();
// const a = this.numFormatter(9999999999);
// console.log(a);
// await this.getSelect();
},
async activated() {
const a = this.numFormatter(9999999999);
console.log(a);
await this.getSelect();
// const a = this.numFormatter(9999999999);
// console.log(a);
// await this.getSelect();
},
methods: {
// 获取下拉值

View File

@@ -29,7 +29,8 @@
class="msg-table"
empty-text="New Data (0)"
:tree-props="{ children: 'articles', hasChildren: 'hasChildren' }"
>
>
<el-table-column type="expand" width="15" align="center">
<template slot-scope="props">
<!-- {{ props.row.articles.length }} -->
@@ -171,6 +172,8 @@
export default {
data() {
return {
activeNames: [],
expands: [],
citeLoading: false,
expandedRows: [],
lang: !localStorage.getItem('langs') || localStorage.getItem('langs') == 'en' ? 'en' : 'zh',
@@ -198,6 +201,19 @@ export default {
this.getData();
},
methods: {
expndChange(row, expandedRows) {
if (expandedRows.length) {
this.expands = []
if (row) {
this.expands.push(row.journal_id) // 每次push进去的是每行的ID
}
} else {
this.expands = [] // 默认不展开
}
},
getRowKeys(row) {
return row.journal_id
},
toggleRow(row) {
const index = this.expandedRows.indexOf(row.journal_stage_id);
if (index === -1) {

File diff suppressed because it is too large Load Diff