20230517
This commit is contained in:
@@ -9,42 +9,71 @@
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="handle-box">
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="addJournal">add</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addJournal">Add Journal</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData" border stripe class="table" ref="multipleTable" header-cell-class-name="table-header" empty-text="New messages (0)">
|
||||
<el-table-column prop="journal_id" label="ID" align="center"></el-table-column>
|
||||
|
||||
<el-table :data="tableData" border stripe class="table" ref="multipleTable"
|
||||
header-cell-class-name="table-header" empty-text="New messages (0)">
|
||||
<el-table-column prop="journal_id" label="ID" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="title" label="Title" align="center"></el-table-column>
|
||||
<el-table-column prop="issn" label="Issn" align="center"></el-table-column>
|
||||
<el-table-column prop="alias" label="Alias" align="center"></el-table-column>
|
||||
<el-table-column prop="issn" label="Issn" align="center" width="110"></el-table-column>
|
||||
<el-table-column prop="alias" label="Alias" align="center" width="80"></el-table-column>
|
||||
<el-table-column prop="level" label="Level" align="center" width="70"></el-table-column>
|
||||
<el-table-column prop="editor" label="Editor" align="center"></el-table-column>
|
||||
<el-table-column label="" width="200" align="center">
|
||||
<el-table-column label="" width="210" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-tickets" @click="showdetail(scope.row)">detail</el-button>
|
||||
<el-button size="mini" type="warning" plain icon="el-icon-tickets" @click="handleChange(scope.row)">change</el-button>
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-tickets"
|
||||
@click="showdetail(scope.row)">Detail</el-button>
|
||||
<el-button size="mini" type="warning" plain icon="el-icon-edit"
|
||||
@click="handleChange(scope.row)">Change</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<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>
|
||||
<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="change" :visible.sync="editVisible" width="40%">
|
||||
<el-form ref="changform" :model="change" label-width="80px">
|
||||
<el-form-item label="editormsg">
|
||||
<span>{{change.title}}</span>
|
||||
|
||||
<el-dialog title="Detail" :visible.sync="detailVisible" width="500px">
|
||||
<el-form ref="detail_form" :model="detailForm" :rules="rules" label-width="110px">
|
||||
<el-form-item label="Journal :">
|
||||
<span>{{detailForm.title}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="state">
|
||||
<el-select v-model="change.editorId" placeholder="Please select">
|
||||
<el-form-item label="Level :" prop="level">
|
||||
<el-select v-model="detailForm.level" placeholder="Please select">
|
||||
<el-option v-for="item in levelList" :key="item.title" :label="item.title" :value='item.title'>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Email :" prop="email">
|
||||
<el-input v-model="detailForm.email"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="Password :" prop="epassword">
|
||||
<el-input v-model="detailForm.epassword"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="saveDetail">Save</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="Change" :visible.sync="editVisible" width="500px">
|
||||
<el-form ref="changform" :model="changeForm" label-width="90px">
|
||||
<el-form-item label="Editormsg :">
|
||||
<span>{{changeForm.title}}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="State :">
|
||||
<el-select v-model="changeForm.editorId" placeholder="Please select">
|
||||
<el-option :key="0" label="Please select" :value="0"></el-option>
|
||||
<el-option v-for="item in editorList" :key="item.user_id" :label="item.account" :value='item.user_id'></el-option>
|
||||
<el-option v-for="item in editorList" :key="item.user_id" :label="item.account"
|
||||
:value='item.user_id'></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editVisible = false">cancel</el-button>
|
||||
<el-button type="primary" @click="saveChange">save</el-button>
|
||||
<el-button @click="editVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="saveChange">Save</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -59,69 +88,62 @@
|
||||
pageIndex: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
change: {
|
||||
tableData: [],
|
||||
Total: 0,
|
||||
detailForm: {
|
||||
journal_id: 0,
|
||||
level: '',
|
||||
email: '',
|
||||
epassword: '',
|
||||
},
|
||||
changeForm: {
|
||||
journalId: 0,
|
||||
editorId: 0,
|
||||
title: ''
|
||||
},
|
||||
tableData: [],
|
||||
editorList: [],
|
||||
Total: 0,
|
||||
detailVisible: false,
|
||||
editVisible: false,
|
||||
levelList: [{
|
||||
title: "A"
|
||||
}, {
|
||||
title: "B"
|
||||
}, {
|
||||
title: "C"
|
||||
}],
|
||||
editorList: [],
|
||||
rules: {
|
||||
level: [{
|
||||
required: true,
|
||||
message: 'please select level',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
epassword: [{
|
||||
required: true,
|
||||
message: 'Please input re-password',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
email: [{
|
||||
required: true,
|
||||
message: 'Please input email',
|
||||
trigger: 'blur'
|
||||
}, {
|
||||
validator: function(rule, value, callback) {
|
||||
if (/^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value) == false) {
|
||||
callback(new Error("Please enter the correct email format"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: "blur"
|
||||
}],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getdate();
|
||||
this.getDate();
|
||||
this.initEditorList();
|
||||
},
|
||||
methods: {
|
||||
// 获取编辑列表数据
|
||||
getdate() {
|
||||
this.$api
|
||||
.post('api/Admin/getJournals', this.query)
|
||||
.then(res => {
|
||||
this.Total = res.total;
|
||||
this.tableData = res.data;
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handlePageChange(val) {
|
||||
this.$set(this.query, 'pageIndex', val);
|
||||
this.getdate();
|
||||
},
|
||||
addJournal() {
|
||||
this.$router.push('/journalAdd');
|
||||
},
|
||||
showdetail(row) {
|
||||
alert('Under development');
|
||||
},
|
||||
//更改期刊编辑
|
||||
handleChange(row) {
|
||||
this.change.journalId = row.journal_id;
|
||||
this.change.editorId = row.editor_id;
|
||||
this.change.title = row.title;
|
||||
this.editVisible = true;
|
||||
},
|
||||
//更改期刊编辑
|
||||
saveChange() {
|
||||
this.$api.post('api/Admin/journalEditorChange', this.change)
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('change success');
|
||||
this.editVisible = false;
|
||||
this.getdate();
|
||||
} else {
|
||||
this.$message.error('Change failed');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
},
|
||||
//获取编辑列表
|
||||
initEditorList() {
|
||||
this.$api.post('api/Admin/getEditorList')
|
||||
@@ -135,7 +157,83 @@
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取编辑列表数据
|
||||
getDate() {
|
||||
this.$api
|
||||
.post('api/Admin/getJournals', this.query)
|
||||
.then(res => {
|
||||
this.Total = res.total;
|
||||
this.tableData = res.data;
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handlePageChange(val) {
|
||||
this.$set(this.query, 'pageIndex', val);
|
||||
this.getDate();
|
||||
},
|
||||
// 添加期刊
|
||||
addJournal() {
|
||||
this.$router.push('/journalAdd');
|
||||
},
|
||||
// 更改期刊参数
|
||||
showdetail(row) {
|
||||
this.detailForm.title = row.title;
|
||||
this.detailForm.journal_id = row.journal_id;
|
||||
this.detailForm.level = row.level;
|
||||
this.detailForm.email = row.email;
|
||||
this.detailForm.epassword = row.epassword;
|
||||
this.detailVisible = true
|
||||
},
|
||||
// 保存期刊参数
|
||||
saveDetail() {
|
||||
this.$refs.detail_form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$api.post('api/Journal/editJournal', this.detailForm)
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('Change Success!');
|
||||
this.detailVisible = false;
|
||||
this.getDate();
|
||||
} else {
|
||||
this.$message.error('Change failed');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
} else {
|
||||
this.$message.error('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//更改期刊编辑
|
||||
handleChange(row) {
|
||||
this.changeForm.journalId = row.journal_id;
|
||||
this.changeForm.editorId = row.editor_id;
|
||||
this.changeForm.title = row.title;
|
||||
this.editVisible = true;
|
||||
},
|
||||
//更改期刊编辑
|
||||
saveChange() {
|
||||
this.$api.post('api/Admin/journalEditorChange', this.changeForm)
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('Change Success!');
|
||||
this.editVisible = false;
|
||||
this.getDate();
|
||||
} else {
|
||||
this.$message.error('Change failed');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user