diff --git a/src/components/common/common.vue b/src/components/common/common.vue index 2af024a..c8c1b0a 100644 --- a/src/components/common/common.vue +++ b/src/components/common/common.vue @@ -14,7 +14,12 @@ //本地(正式环境 ) -const mediaUrl = 'https://submission.tmrjournals.com/public/'; +// const mediaUrl = 'https://submission.tmrjournals.com/public/'; + +// const baseUrl = '/api'; +//晓玲 + +const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; const baseUrl = '/api'; diff --git a/src/components/page/editorBorder.vue b/src/components/page/editorBorder.vue index 82bce89..0b6aab5 100644 --- a/src/components/page/editorBorder.vue +++ b/src/components/page/editorBorder.vue @@ -594,7 +594,7 @@ - +
@@ -706,7 +706,7 @@ { if (valid) { + if (this.BoardEditorForm.icon == '' || this.BoardEditorForm.icon == undefined) { + this.$message.error('Please upload the picture!'); + return + } this.$api - .post('/api/Board/editBoard', this.BoardEditorForm) + .post('/api/Board/editBoardNew', this.BoardEditorForm) .then((res) => { if (res.code == 0) { - this.getDate(); + this.$refs.BoardEditorForm.resetFields(); this.$message.success('succeed!'); this.BoardEditorFormVisible = false; + setTimeout(()=>{ + this.getDate(); + },500) + + + } else { this.$message.error(res.msg); } @@ -1499,10 +1527,10 @@ export default { }, // 改变期刊 - getJourAdd() { + getJourAdd(type) { this.$api .post('api/Board/getBoardGroupList', { - journal_id: this.addForm.journal_id + journal_id:type?this.BoardEditorForm.journal_id: this.addForm.journal_id }) .then((res) => { if (res.code == 0) { @@ -1523,19 +1551,46 @@ export default { // 编辑编委操作 bhandleEdit(index, row) { - this.$nextTick(() => { - // console.log(row,'row') - this.BoardEditorForm.btj_id = row.btj_id; - this.BoardEditorForm.type = row.type; - this.BoardEditorForm.board_group_id = row.board_group_id; - this.BoardEditorForm.research_areas = row.research_areas; - if (row.icon != '') { - this.pictureUrl = this.mediaUrl + 'usericon/' + row.icon; + + this.$api + .post('api/Board/getBoardInfo', { + btj_id: row.btj_id + }) + .then((res) => { + if (res.code == 0&&res.data) { + + var info={...res.data} + this.$nextTick(() => { + + this.BoardEditorForm.btj_id = info.btj_id; + this.BoardEditorForm.type = info.type; + this.BoardEditorForm.board_group_id = info.board_group_id; + this.BoardEditorForm.research_areas = info.research_areas; + this.BoardEditorForm.affiliation = info.affiliation||info.company; + this.BoardEditorForm.icon = info.icon; + this.BoardEditorForm.technical = info.technical; + this.BoardEditorForm.website = info.website; + this.BoardEditorForm.email = info.email; + this.BoardEditorForm.realname = info.realname; + this.BoardEditorForm.journal_id = info.journal_id; + // this.pictureUrl=this.mediaUrl + 'usericon/' + info.icon; + + if (info.icon != '') { + this.pictureUrl = this.mediaUrl + 'usericon/' + info.icon; } else { this.pictureUrl = ''; } + this.getJourAdd('edit'); this.BoardEditorFormVisible = true; }); + } else { + + } + }) + .catch((err) => { + this.$message.error(err); + }); + }, // 查找账号 saerNa_U() { @@ -1558,6 +1613,7 @@ export default { this.addForm.affiliation = res.data.user_info.affiliation; this.addForm.website = res.data.user_info.website; this.addForm.technical = res.data.user_info.technical; + this.addForm.icon = res.data.user_info.icon; this.pictureUrl = this.mediaUrl + 'usericon/' + res.data.user_info.icon; this.$forceUpdate() } @@ -1575,16 +1631,19 @@ export default { // 保存添加 saveAdd() { + + console.log('this.addForm at line 1597:', this.addForm) + this.$refs.add_Form.validate((valid) => { if (valid) { - if (this.addForm.board_icon == '' || this.addForm.board_icon == undefined) { + if (this.addForm.icon == '' || this.addForm.icon == undefined) { this.$message.error('Please upload the picture!'); return } this.$api .post('api/Board/addBoardNew', { user_id: this.addForm.user_id, - journal_id: this.addForm.journal_id, + journal_id: this.query.journal_id, board_group_id: this.addForm.board_group_id, type: this.addForm.type, research_areas: this.addForm.field, @@ -1601,7 +1660,9 @@ export default { this.$refs.add_Form.resetFields(); this.$message.success(`Added successfully!`); this.dis_able = false; - this.getDate(); + setTimeout(()=>{ + this.getDate(); + },500) } else { this.$message.error(res.msg); } @@ -1625,7 +1686,7 @@ export default { // 编辑操作 handleEdit(index, row) { this.editForm = Object.assign({}, row); - this.imageUrl_ = this.baseUrl + 'journalpublic/' + this.editForm.board_icon; + this.imageUrl_ = this.baseUrl + 'journalpublic/' + this.editForm.icon; this.imageUrl_Mark = 0; this.editVisible = true; // this.getJourEdit(this.query.journal_id) @@ -1634,7 +1695,7 @@ export default { // 改变期刊 getJourEdit(e) { this.$api - .post('api/Board/getBoardGroupList', { + .post('', { journal_id: e }) .then((res) => { @@ -1790,7 +1851,7 @@ export default { //上传图片-添加 handleAvatarSuccess(res, file) { if (res.code == 0) { - this.addForm.board_icon = res.upurl; + this.addForm.icon = res.upurl; } else { this.$message.error(res.msg); } @@ -1810,7 +1871,7 @@ export default { //上传图片-编辑 handleAvatarSuccess_(res, file) { if (res.code == 0) { - this.editForm.board_icon = res.upurl; + this.editForm.icon = res.upurl; // this.imageUrl_ = this.baseUrl + 'boardIcon/' + res.upurl; this.imageUrl_Mark = 1; } else { diff --git a/vue.config.js b/vue.config.js index 63a64ca..dde9ebf 100644 --- a/vue.config.js +++ b/vue.config.js @@ -76,8 +76,8 @@ module.exports = { // target: 'http://api.tmrjournals.com/public/index.php/',//正式 // target: 'http://192.168.110.90:80/',//晓玲 - // target: 'http://zmzm.tougao.dev.com/',//晓玲 - target: 'https://submission.tmrjournals.com/',//正式 + target: 'http://zmzm.tougao.dev.com/',//晓玲 + // target: 'https://submission.tmrjournals.com/',//正式 changeOrigin: true, pathRewrite: { '^/api': ''