|
|
|
@ -50,12 +50,7 @@
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-input
|
|
|
|
|
placeholder="输入发布人名称"
|
|
|
|
|
size="medium"
|
|
|
|
|
v-model="queryForm.data.creatorId"
|
|
|
|
|
></el-input>
|
|
|
|
|
<!-- <el-select
|
|
|
|
|
<el-select
|
|
|
|
|
placeholder="输入发布人名称"
|
|
|
|
|
size="medium"
|
|
|
|
|
v-model="queryForm.data.creatorId"
|
|
|
|
@ -66,7 +61,7 @@
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select> -->
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-date-picker
|
|
|
|
@ -130,7 +125,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="期刊封面">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<img style="height: 50px;" :src="scope.row.image">
|
|
|
|
|
<img style="height: 50px;" :src="scope.row.image" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="期刊编号" prop="journalNo"></el-table-column>
|
|
|
|
@ -219,7 +214,7 @@
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="['新建期刊', '编辑期刊', '详情'][modifyDialog.type]"
|
|
|
|
|
title="详情"
|
|
|
|
|
class="popup-dialog"
|
|
|
|
|
:visible="true"
|
|
|
|
|
v-if="modifyDialog.visible"
|
|
|
|
@ -231,16 +226,6 @@
|
|
|
|
|
v-loading="modifyDialog.loading"
|
|
|
|
|
style="height: 70vh;overflow: auto;padding-left:20px;padding-right:20px"
|
|
|
|
|
>
|
|
|
|
|
<ArticleModify
|
|
|
|
|
ref="modifyDialog"
|
|
|
|
|
v-if="
|
|
|
|
|
modifyDialog.visible &&
|
|
|
|
|
(modifyDialog.type === 0 || modifyDialog.type === 1)
|
|
|
|
|
"
|
|
|
|
|
:data="modifyDialog.data"
|
|
|
|
|
:remoteTagList="queryForm.remoteData.superFilterTags"
|
|
|
|
|
:publisher="queryForm.remoteData.publisher"
|
|
|
|
|
></ArticleModify>
|
|
|
|
|
<ArticleDetail
|
|
|
|
|
v-if="modifyDialog.visible && modifyDialog.type === 2"
|
|
|
|
|
:data="modifyDialog.data"
|
|
|
|
@ -249,11 +234,7 @@
|
|
|
|
|
></ArticleDetail>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="modifyDialog.type === 0 || modifyDialog.type === 1"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleDialogSubmit"
|
|
|
|
|
<el-button size="small" type="primary" @click="handleDialogCancel"
|
|
|
|
|
>确定</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button size="small" @click="handleDialogCancel">取消</el-button>
|
|
|
|
@ -327,7 +308,6 @@
|
|
|
|
|
import articleApi from "@/api/article";
|
|
|
|
|
import tagApi from "@/api/tag";
|
|
|
|
|
import SuperFilterTagDrawer from "./superFilterTagDrawer.vue";
|
|
|
|
|
import ArticleModify from "./articleModify.vue";
|
|
|
|
|
import ArticleDetail from "./articleDetail.vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
@ -380,7 +360,6 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
ArticleModify,
|
|
|
|
|
ArticleDetail,
|
|
|
|
|
SuperFilterTagDrawer
|
|
|
|
|
},
|
|
|
|
@ -554,37 +533,13 @@ export default {
|
|
|
|
|
* 新建标签点击事件
|
|
|
|
|
*/
|
|
|
|
|
handleAddClick() {
|
|
|
|
|
let newData = {
|
|
|
|
|
id: null,
|
|
|
|
|
title: null,
|
|
|
|
|
tag: [],
|
|
|
|
|
journalNo: null,
|
|
|
|
|
userId: null,
|
|
|
|
|
image: null,
|
|
|
|
|
songs: []
|
|
|
|
|
};
|
|
|
|
|
this.modifyDialog.data = newData;
|
|
|
|
|
this.modifyDialog.type = 0;
|
|
|
|
|
this.modifyDialog.visible = true;
|
|
|
|
|
this.modifyDialog.loading = false;
|
|
|
|
|
this.$router.push(`/mainPage/article?type=add`);
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 编辑标签点击事件
|
|
|
|
|
*/
|
|
|
|
|
handleModifyClick(row) {
|
|
|
|
|
this.modifyDialog.visible = true;
|
|
|
|
|
this.modifyDialog.loading = true;
|
|
|
|
|
articleApi.getDetail(row.id).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.modifyDialog.data = JSON.parse(JSON.stringify(res.data));
|
|
|
|
|
this.modifyDialog.type = 1;
|
|
|
|
|
this.modifyDialog.loading = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.modifyDialog.visible = false;
|
|
|
|
|
this.modifyDialog.loading = false;
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$router.push(`/mainPage/article?id=${row.id}&type=modify`);
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 发布点击事件
|
|
|
|
@ -629,69 +584,6 @@ export default {
|
|
|
|
|
handlePublishDialogCancel() {
|
|
|
|
|
this.publishDialog.visible = false;
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 弹窗确定按扭点击事件
|
|
|
|
|
*/
|
|
|
|
|
handleDialogSubmit() {
|
|
|
|
|
this.$refs.modifyDialog.$refs.modifyDialogForm.validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
let orgData = this.$refs.modifyDialog.data;
|
|
|
|
|
let param = {
|
|
|
|
|
id: orgData["id"],
|
|
|
|
|
content: orgData["content"],
|
|
|
|
|
image: orgData["image"],
|
|
|
|
|
journalNo: orgData["journalNo"],
|
|
|
|
|
songs: [],
|
|
|
|
|
tag: orgData["tag"],
|
|
|
|
|
title: orgData["title"],
|
|
|
|
|
userId: orgData["userId"]
|
|
|
|
|
};
|
|
|
|
|
let newMusicIdList = [];
|
|
|
|
|
if (orgData.songs) {
|
|
|
|
|
for (let i in orgData.songs) {
|
|
|
|
|
newMusicIdList.push(orgData.songs[i].id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
param.songs = newMusicIdList;
|
|
|
|
|
console.log(param);
|
|
|
|
|
|
|
|
|
|
// 新增
|
|
|
|
|
if (this.modifyDialog.type === 0) {
|
|
|
|
|
articleApi.add(param).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.message);
|
|
|
|
|
this.modifyDialog.visible = false;
|
|
|
|
|
this.table.page.current = 1;
|
|
|
|
|
// 新增时重置查询条件
|
|
|
|
|
this.handleResetClick();
|
|
|
|
|
this.fetchData(this.queryForm.lastQuery);
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log("新增");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 编辑
|
|
|
|
|
if (this.modifyDialog.type === 1) {
|
|
|
|
|
articleApi.update(param.id, param).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.message);
|
|
|
|
|
this.modifyDialog.visible = false;
|
|
|
|
|
this.fetchData(this.queryForm.lastQuery);
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log("编辑");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error("请完善表单相关信息!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 发布弹窗确认按扭
|
|
|
|
|
*/
|
|
|
|
|