|
|
|
@ -5,7 +5,6 @@ |
|
|
|
|
<div class="common-layout"> |
|
|
|
|
<el-container> |
|
|
|
|
<el-aside> |
|
|
|
|
|
|
|
|
|
<div class="header-flex-container"> |
|
|
|
|
<div> |
|
|
|
|
<el-button class="button-container_column" @click="editHandle" type="primary" plain round>栏目管理</el-button> |
|
|
|
@ -60,7 +59,7 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="文章内容" label-width="120px"> |
|
|
|
|
<textarea style="width: 100%; |
|
|
|
|
height:430px; |
|
|
|
|
height:425px; |
|
|
|
|
border: 2px solid #d3d3d3;" |
|
|
|
|
v-model="newsForm.content" |
|
|
|
|
></textarea> |
|
|
|
@ -79,8 +78,8 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="发布状态" label-width="120px"> |
|
|
|
|
<el-select v-model="newsForm.status" placeholder="请选择发布状态" style="width: 200px"> |
|
|
|
|
<el-option label="已发布" value="1" /> |
|
|
|
|
<el-option label="未发布" value="2" /> |
|
|
|
|
<el-option label="直接发布" value="1" /> |
|
|
|
|
<el-option label="暂不发布" value="0" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <el-form-item label="当前用户id" label-width="120px">--> |
|
|
|
@ -102,17 +101,18 @@ |
|
|
|
|
<!-- 栏目编辑弹框--> |
|
|
|
|
<el-drawer v-model="drawer" title="栏目编辑" :with-header="false"> |
|
|
|
|
<span>栏目编辑</span><br/> |
|
|
|
|
<el-button type="success" round style="margin: 30px" @click="addFormVisible = true">添加新闻栏目</el-button> |
|
|
|
|
<el-button type="success" style="margin: 30px" @click="addFormVisible = true">添加新闻栏目</el-button> |
|
|
|
|
<div> |
|
|
|
|
<el-table :data="column" style="width: 100%"> |
|
|
|
|
<el-table-column prop="categoryName" label="名称" width="200" /> |
|
|
|
|
<el-table-column width="200" > |
|
|
|
|
<el-table :data="column" style="width: 100%;"> |
|
|
|
|
<el-table-column prop="categoryName" label="名称" width="200"/> |
|
|
|
|
<el-table-column width="400" > |
|
|
|
|
<template #header> |
|
|
|
|
操作 |
|
|
|
|
</template> |
|
|
|
|
<template #default="{row}"> |
|
|
|
|
<!-- 删除按钮 --> |
|
|
|
|
<el-button size="default" type="danger" @click="deleteHandle(row.id)">删除</el-button> |
|
|
|
|
<el-button size="default" type="danger" @click="deleteHandle(row.id)">栏目删除</el-button> |
|
|
|
|
<el-button size="default" type="warning" @click="editStatusHandle(row)">栏目编辑</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -130,11 +130,14 @@ |
|
|
|
|
<el-form-item label="创建该栏目的用户id" label-width="140px"> |
|
|
|
|
<el-input v-model="form.creatorId" autocomplete="off" readonly disabled/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="排序" label-width="140px"> |
|
|
|
|
<el-input v-model="form.sort" autocomplete="off" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="是否显示" label-width="140px"> |
|
|
|
|
<el-input v-model="form.status" autocomplete="off" /> |
|
|
|
|
<!-- <el-form-item label="排序" label-width="140px">--> |
|
|
|
|
<!-- <el-input v-model="form.sort" autocomplete="off" />--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<el-form-item label="发布状态" label-width="140px"> |
|
|
|
|
<el-select v-model="form.status" placeholder="请选择显示状态" style="width: 200px"> |
|
|
|
|
<el-option label="显示" value="1" /> |
|
|
|
|
<el-option label="不显示" value="0" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
@ -146,6 +149,40 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
<!-- 栏目编辑--> |
|
|
|
|
<el-dialog v-model="editStatusVisible" title="栏目添加" width="500"> |
|
|
|
|
<el-form :model="editForm"> |
|
|
|
|
<el-form-item label="栏目id" label-width="140px"> |
|
|
|
|
<el-input v-model="editForm.id" autocomplete="off" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="栏目名称" label-width="140px"> |
|
|
|
|
<el-input v-model="editForm.categoryName" autocomplete="off" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="栏目父id" label-width="140px"> |
|
|
|
|
<el-input v-model="editForm.categoryPid" autocomplete="off" readonly/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="创建该栏目的用户id" label-width="140px"> |
|
|
|
|
<el-input v-model="editForm.creatorId" autocomplete="off" readonly disabled/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <el-form-item label="排序" label-width="140px">--> |
|
|
|
|
<!-- <el-input v-model="" autocomplete="off" />--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<el-form-item label="发布状态" label-width="140px"> |
|
|
|
|
<el-select v-model="editForm.status" placeholder="请选择显示状态" style="width: 200px"> |
|
|
|
|
<el-option label="显示" value="1" /> |
|
|
|
|
<el-option label="不显示" value="0" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
<el-button @click="editStatusVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="confirmEdit"> |
|
|
|
|
确定 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
<!-- 修改新闻--> |
|
|
|
|
<el-drawer v-model="editNewsDialogFormVisible" title="修改新闻" width="500px"> |
|
|
|
|
<el-form v-model="nowTimeNewsData"> |
|
|
|
@ -171,7 +208,7 @@ |
|
|
|
|
<el-form-item label="发布状态" label-width="140px"> |
|
|
|
|
<el-select v-model="nowTimeNewsData.status" placeholder="请选择发布状态" style="width: 200px"> |
|
|
|
|
<el-option label="已发布" value="1" /> |
|
|
|
|
<el-option label="未发布" value="2" /> |
|
|
|
|
<el-option label="未发布" value="0" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="发布文章的用户id" label-width="140px"> |
|
|
|
@ -225,6 +262,7 @@ const drawer = ref(false) |
|
|
|
|
const nowColumnId = ref() |
|
|
|
|
const nowCategoryName = ref('') |
|
|
|
|
const addFormVisible = ref(false) |
|
|
|
|
const editStatusVisible = ref(false) |
|
|
|
|
const aboutContentDrawer = ref(false) |
|
|
|
|
//存取栏目信息 |
|
|
|
|
const column =ref([]) |
|
|
|
@ -237,11 +275,10 @@ const addNewsButton = (item)=>{ |
|
|
|
|
nowCategoryName.value = item.categoryName |
|
|
|
|
} |
|
|
|
|
const nowTimeNewsData = ref({}) |
|
|
|
|
console.log(userStore.data,'当前用户数据') |
|
|
|
|
//新闻详细信息获取 |
|
|
|
|
const newViews = (listObject)=> { |
|
|
|
|
nowTimeNewsData.value = { ...listObject } |
|
|
|
|
console.log(nowTimeNewsData,'当前新闻数据') |
|
|
|
|
// console.log(nowTimeNewsData,'当前新闻数据') |
|
|
|
|
} |
|
|
|
|
//栏目 |
|
|
|
|
const form = ref({ |
|
|
|
@ -254,7 +291,14 @@ const form = ref({ |
|
|
|
|
status:'', |
|
|
|
|
updateTime:'' |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//编辑栏目信息 |
|
|
|
|
const editForm = ref({ |
|
|
|
|
id: '', |
|
|
|
|
categoryName: '', |
|
|
|
|
categoryPid: '', |
|
|
|
|
creatorId: '', |
|
|
|
|
status: '' |
|
|
|
|
}); |
|
|
|
|
//获取栏目信息 |
|
|
|
|
const CategoryList = async () => { |
|
|
|
|
const res = await queryCategory() |
|
|
|
@ -304,6 +348,33 @@ const deleteHandle = async (id)=>{ |
|
|
|
|
}) |
|
|
|
|
await CategoryList() |
|
|
|
|
} |
|
|
|
|
//栏目状态编辑 |
|
|
|
|
const editStatusHandle = (row) => { |
|
|
|
|
editForm.value = { |
|
|
|
|
id: row.id, |
|
|
|
|
categoryName: row.categoryName, |
|
|
|
|
categoryPid: row.categoryPid, |
|
|
|
|
creatorId: row.creatorId, |
|
|
|
|
status: row.status |
|
|
|
|
}; |
|
|
|
|
editStatusVisible.value = true; |
|
|
|
|
}; |
|
|
|
|
//栏目内容编辑后提交 |
|
|
|
|
const confirmEdit = async ()=>{ |
|
|
|
|
await editStatus({ |
|
|
|
|
id:editForm.value.id, |
|
|
|
|
categoryName:editForm.value.categoryName, |
|
|
|
|
categoryPid: editForm.value.categoryPid, |
|
|
|
|
creatorId: editForm.value.creatorId, |
|
|
|
|
status: editForm.value.status |
|
|
|
|
}).then(()=>{ |
|
|
|
|
CategoryList() |
|
|
|
|
ElMessage({ |
|
|
|
|
message:'修改成功', |
|
|
|
|
type:'success' |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//新闻文章查询 |
|
|
|
|
const EssayList = async (id)=>{ |
|
|
|
|
const response = await queryEssay(id) |
|
|
|
|