master
fwb 2 months ago
parent 07e2c41c6d
commit e5d13ae4f5
  1. 3
      backend/src/main/java/com/teaching/backend/model/entity/cms/CmsEssay.java
  2. 4
      backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java
  3. 7954
      teaching_integration_platform_admin_template/pnpm-lock.yaml
  4. 4
      teaching_integration_platform_admin_template/src/router/routers.ts
  5. 24
      teaching_integration_platform_admin_template/src/views/message/components/messageContent.vue
  6. 122
      teaching_integration_platform_admin_template/src/views/news/components/newsContentManage.vue
  7. 40
      teaching_integration_platform_admin_template/src/views/news/index.vue
  8. 6742
      teaching_integration_platform_template/pnpm-lock.yaml

@ -58,6 +58,9 @@ public class CmsEssay implements Serializable {
@ApiModelProperty(value = "发布文章的用户id") @ApiModelProperty(value = "发布文章的用户id")
private Integer userId; private Integer userId;
@ApiModelProperty(value = "发布文章的用户名字")
private String username;
@ApiModelProperty(value = "文章文件") @ApiModelProperty(value = "文章文件")
private String file; private String file;

@ -33,8 +33,8 @@ public class CmsEssayServiceImpl extends ServiceImpl<CmsEssayMapper, CmsEssay> i
//设置文章发布时间 //设置文章发布时间
cmsEssay.setPublishTime(LocalDate.now()); cmsEssay.setPublishTime(LocalDate.now());
//设置发布人姓名 //设置发布人姓名
// String nickName = userService.getById(cmsEssay.getUserId()).getNickName(); String nickName = userService.getById(cmsEssay.getUserId()).getNickName();
// cmsEssay.setUsername(nickName); cmsEssay.setUsername(nickName);
//将浏览次数设置为0 //将浏览次数设置为0
cmsEssay.setReadingNumber(0); cmsEssay.setReadingNumber(0);
//如果数据库里没有文章,文章id设为2 //如果数据库里没有文章,文章id设为2

File diff suppressed because it is too large Load Diff

@ -232,7 +232,7 @@ export const constantRoute: any = [
meta: { meta: {
title: '栏目', title: '栏目',
hidden: false, hidden: false,
icon: 'Promotion', icon: 'Memo',
}, },
}, },
{ {
@ -243,7 +243,7 @@ export const constantRoute: any = [
meta: { meta: {
title: '文章', title: '文章',
hidden: false, hidden: false,
icon: 'BellFilled', icon: 'Tickets',
}, },
}, },

@ -98,7 +98,6 @@ const inputCourseId = computed(()=>{
if(props.multiple) return selectStudent.value.map(item=>item[0]) if(props.multiple) return selectStudent.value.map(item=>item[0])
else return selectStudent.value[0] else return selectStudent.value[0]
}) })
//==========================
const inputText = ref('') const inputText = ref('')
const textarea = ref('') const textarea = ref('')
const addPerson = ref(false) const addPerson = ref(false)
@ -149,26 +148,7 @@ const confirm = ()=>{
const disappoint = ()=>{ const disappoint = ()=>{
addPerson.value = false addPerson.value = false
} }
// //
// const send = async () => {
// await ElMessageBox.confirm('', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// })
// await SendMessageApi({
// receiverId: inputPerson.value.toString(),
// courseId:inputCourseId.value.toString(),
// title:inputText.value,
// content:textarea.value,
// senderId:userStore.data.id
// }).then(()=>{
// ElMessage({
// message:'',
// type:'success'
// })
// })
// }
const send = async () => { const send = async () => {
try { try {
// //
@ -177,7 +157,6 @@ const send = async () => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}); });
// //
await SendMessageApi({ await SendMessageApi({
receiverId: inputPerson.value.toString(), receiverId: inputPerson.value.toString(),
@ -197,7 +176,6 @@ const send = async () => {
// //
return; return;
} }
// //
ElMessage.error({ ElMessage.error({
message: '发送失败', message: '发送失败',

@ -6,9 +6,11 @@
<el-container> <el-container>
<el-aside> <el-aside>
<div class="header-flex-container"> <div class="header-flex-container">
<div> <div class="column-manage">
<el-button class="button-container_column" @click="editHandle" type="primary" plain round>栏目管理</el-button> <span>栏目</span>
<el-button style="margin-left: 20px;margin-bottom: 8px" @click="editHandle" type="primary" plain round>栏目管理</el-button>
</div> </div>
<el-divider/>
<ul class="header-list"> <ul class="header-list">
<li v-for="item in column"> <li v-for="item in column">
<el-dropdown placement="right"> <el-dropdown placement="right">
@ -32,7 +34,7 @@
</ul> </ul>
</el-dropdown-item> </el-dropdown-item>
<div class="add-news-button"> <div class="add-news-button">
<el-button @click="addNewsButton(item)" type="success" style="margin-bottom: 10px" plain round>添加当前栏目新闻</el-button> <el-button @click="addNewsButton(item)" type="success" style="margin-bottom: 10px" plain >添加{{item.categoryName}}栏目新闻</el-button>
</div> </div>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
@ -46,7 +48,7 @@
<el-card class="container"> <el-card class="container">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>添加当前栏目新闻信息</span> <span>添加新闻信息</span>
</div> </div>
</template> </template>
<!-- 栏目内添加新闻--> <!-- 栏目内添加新闻-->
@ -59,7 +61,7 @@
</el-form-item> </el-form-item>
<el-form-item label="文章内容" label-width="120px"> <el-form-item label="文章内容" label-width="120px">
<textarea style="width: 100%; <textarea style="width: 100%;
height:425px; height:452px;
border: 2px solid #d3d3d3;" border: 2px solid #d3d3d3;"
v-model="newsForm.content" v-model="newsForm.content"
></textarea> ></textarea>
@ -73,9 +75,9 @@
<!-- <el-form-item label="所属栏目id" label-width="120px">--> <!-- <el-form-item label="所属栏目id" label-width="120px">-->
<!-- <el-input v-model="newsForm.categoryId" autocomplete="off" style="width: 200px" readonly/>--> <!-- <el-input v-model="newsForm.categoryId" autocomplete="off" style="width: 200px" readonly/>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="浏览次数" label-width="120px"> <!-- <el-form-item label="浏览次数" label-width="120px">-->
<el-input v-model="newsForm.readingNumber" autocomplete="off" style="width: 200px"/> <!-- <el-input v-model="newsForm.readingNumber" autocomplete="off" style="width: 200px"/>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="发布状态" label-width="120px"> <el-form-item label="发布状态" label-width="120px">
<el-select v-model="newsForm.status" placeholder="请选择发布状态" style="width: 200px"> <el-select v-model="newsForm.status" placeholder="请选择发布状态" style="width: 200px">
<el-option label="直接发布" value="1" /> <el-option label="直接发布" value="1" />
@ -133,7 +135,7 @@
<!-- <el-form-item label="排序" label-width="140px">--> <!-- <el-form-item label="排序" label-width="140px">-->
<!-- <el-input v-model="form.sort" autocomplete="off" />--> <!-- <el-input v-model="form.sort" autocomplete="off" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="发布状态" label-width="140px"> <el-form-item label="栏目显示状态" label-width="140px">
<el-select v-model="form.status" placeholder="请选择显示状态" style="width: 200px"> <el-select v-model="form.status" placeholder="请选择显示状态" style="width: 200px">
<el-option label="显示" value="1" /> <el-option label="显示" value="1" />
<el-option label="不显示" value="0" /> <el-option label="不显示" value="0" />
@ -167,7 +169,7 @@
<!-- <el-form-item label="排序" label-width="140px">--> <!-- <el-form-item label="排序" label-width="140px">-->
<!-- <el-input v-model="" autocomplete="off" />--> <!-- <el-input v-model="" autocomplete="off" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="发布状态" label-width="140px"> <el-form-item label="栏目显示状态" label-width="140px">
<el-select v-model="editForm.status" placeholder="请选择显示状态" style="width: 200px"> <el-select v-model="editForm.status" placeholder="请选择显示状态" style="width: 200px">
<el-option label="显示" value="1" /> <el-option label="显示" value="1" />
<el-option label="不显示" value="0" /> <el-option label="不显示" value="0" />
@ -273,12 +275,19 @@ const editNewsDialogFormVisible = ref(false)
const addNewsButton = (item)=>{ const addNewsButton = (item)=>{
nowColumnId.value = item.id nowColumnId.value = item.id
nowCategoryName.value = item.categoryName nowCategoryName.value = item.categoryName
resetForm()
}
//
const resetForm =()=>{
newsForm.value.title = ''
newsForm.value.content = ''
newsForm.value.status = ''
} }
const nowTimeNewsData = ref({}) const nowTimeNewsData = ref({})
// //
const newViews = (listObject)=> { const newViews = (listObject)=> {
nowTimeNewsData.value = { ...listObject } nowTimeNewsData.value = { ...listObject }
// console.log(nowTimeNewsData,'') console.log(nowTimeNewsData,'当前新闻数据')
} }
// //
const form = ref({ const form = ref({
@ -396,28 +405,6 @@ const deleteNewsList = async (id)=>{
}) })
}) })
} }
//
const editNewsContentConfirm = async ()=>{
editNewsDialogFormVisible.value = false
await editEssay({
categoryId:nowTimeNewsData.value.categoryId,
content:nowTimeNewsData.value.content,
file:nowTimeNewsData.value.file,
id:nowTimeNewsData.value.id,
pic:nowTimeNewsData.value.pic,
publishTime:nowTimeNewsData.value.publishTime,
readingNumber:nowTimeNewsData.value.readingNumber,
status:nowTimeNewsData.value.status,
title:nowTimeNewsData.value.title,
updateTime:nowTimeNewsData.value.updateTime,
userId:nowTimeNewsData.value.userId
}).then(()=>{
ElMessage({
message:'添加成功',
type:'success'
});
})
}
// //
const newsForm = ref({ const newsForm = ref({
categoryId:nowColumnId, categoryId:nowColumnId,
@ -436,6 +423,15 @@ const newsForm = ref({
}) })
// //
const addNewsContentConfirm = async (id)=>{ const addNewsContentConfirm = async (id)=>{
//
if (!newsForm.value.categoryName) {
ElMessage({
message: '栏目名不能为空,请从栏目内添加新闻!',
type: 'error'
});
return; //
}
//
await addEssay({ await addEssay({
categoryId:newsForm.value.categoryId, categoryId:newsForm.value.categoryId,
content:newsForm.value.content, content:newsForm.value.content,
@ -455,13 +451,35 @@ const addNewsContentConfirm = async (id)=>{
}); });
}) })
} }
//
const editNewsContentConfirm = async ()=>{
editNewsDialogFormVisible.value = false
await editEssay({
categoryId:nowTimeNewsData.value.categoryId,
content:nowTimeNewsData.value.content,
file:nowTimeNewsData.value.file,
id:nowTimeNewsData.value.id,
pic:nowTimeNewsData.value.pic,
publishTime:nowTimeNewsData.value.publishTime,
readingNumber:nowTimeNewsData.value.readingNumber,
status:nowTimeNewsData.value.status,
title:nowTimeNewsData.value.title,
updateTime:nowTimeNewsData.value.updateTime,
userId:nowTimeNewsData.value.userId
}).then(()=>{
ElMessage({
message:'添加成功',
type:'success'
});
})
}
// //
const aboutEssay = ref('') const aboutEssay = ref('')
const aboutContent = async (essay_id)=>{ const aboutContent = async (essay_id)=>{
aboutContentDrawer.value = true aboutContentDrawer.value = true
const responseEssay = await queryEssayById('1') const responseEssay = await queryEssayById('1')
aboutEssay.value = responseEssay.data aboutEssay.value = responseEssay.data
// console.log(aboutEssay.value,'')
} }
// //
const editConfirm =async ()=>{ const editConfirm =async ()=>{
@ -490,11 +508,9 @@ const editConfirm =async ()=>{
overflow-y: auto; /* 当内容超出时显示滚动条 */ overflow-y: auto; /* 当内容超出时显示滚动条 */
} }
.header-flex-container { .header-flex-container {
display: flex;
/*align-items: center; !* 垂直居中 *!*/
padding: 20px; padding: 20px;
gap: 10px;
background: white; background: white;
/*background: powderblue;*/
margin-top: 20px; margin-top: 20px;
height: 810px; height: 810px;
overflow-y: auto; overflow-y: auto;
@ -502,10 +518,21 @@ const editConfirm =async ()=>{
.header-flex-container::-webkit-scrollbar { .header-flex-container::-webkit-scrollbar {
width: 0px; /* 滚动条宽度 */ width: 0px; /* 滚动条宽度 */
} }
.column-manage{
/*background: #5ee183;*/
height: 35px;
}
.column-manage span{
margin-left: 100px;
font-size: 24px;
line-height: 50px;
color: #4b81d7;
}
.header-list { .header-list {
flex-wrap: wrap; /* 如果需要换行 */ flex-wrap: wrap; /* 如果需要换行 */
margin-left: 40px; /* 移除默认外边距 */
padding: 0; /* 移除默认内边距 */ padding: 0; /* 移除默认内边距 */
/*background: darkorange;*/
text-align: center;
} }
.header-list span{ .header-list span{
font-size: 17px; font-size: 17px;
@ -517,11 +544,13 @@ const editConfirm =async ()=>{
} }
.header-column{ .header-column{
height:30px; height:30px;
margin-top: 20px; margin-top: 15px;
margin-right: 80px; margin-left: 6px;
padding: 5px; padding: 5px;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; /* 鼠标悬停时显示手指形状,表示可点击 */ cursor: pointer; /* 鼠标悬停时显示手指形状,表示可点击 */
/*background: darkseagreen;*/
width: 150px;
} }
.header-column span{ .header-column span{
color: #222222; color: #222222;
@ -537,16 +566,11 @@ const editConfirm =async ()=>{
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
} }
/* 添加新的类来控制按钮的位置 */
.button-container { .button-container {
display: flex; display: flex;
justify-content: flex-end; /* 按钮靠右 */ justify-content: flex-end; /* 按钮靠右 */
align-items: center; /* 垂直居中 */ align-items: center; /* 垂直居中 */
} }
.button-container_column{
position:absolute;
margin-left: 180px;
}
.flex-container p { .flex-container p {
flex-grow: 1; /* 扩展剩余空间 */ flex-grow: 1; /* 扩展剩余空间 */
margin-right: 10px; /* 添加一些右侧间距以避免按钮与文本直接接触 */ margin-right: 10px; /* 添加一些右侧间距以避免按钮与文本直接接触 */
@ -558,14 +582,16 @@ const editConfirm =async ()=>{
margin-right: 0; margin-right: 0;
} }
.card-header { .card-header {
display: flex; /* 使用 Flexbox */ display: flex;
justify-content: space-between; /* 主轴上平均分配剩余空间 */ justify-content: space-between; /* 主轴上平均分配剩余空间 */
align-items: center; /* 交叉轴上居中对齐 */ align-items: center; /* 交叉轴上居中对齐 */
height: 42px;
} }
.card-header span { .card-header span {
flex: 1; /* 使 span 占用可用空间,实现居中效果 */ flex: 1; /* 使 span 占用可用空间,实现居中效果 */
text-align: center; /* 文本居中 */ text-align: center;
font-size: 20px; font-size: 25px;
color: #4b81d7;
} }
.dialog-footer{ .dialog-footer{
display: flex; display: flex;

@ -6,6 +6,10 @@
<el-container> <el-container>
<el-aside> <el-aside>
<div class="header-flex-container"> <div class="header-flex-container">
<div class="column-manage">
<span>栏目</span>
</div>
<el-divider/>
<ul class="header-list"> <ul class="header-list">
<li v-for="item in column"> <li v-for="item in column">
<el-dropdown placement="right"> <el-dropdown placement="right">
@ -34,13 +38,13 @@
<el-main> <el-main>
<div class="card-header"> <div class="card-header">
<el-card shadow="hover"> <el-card shadow="hover">
<div style="height:33px"> <div style="height:43px">
<span class="contentTitle">{{nowTimeNewsData.title}}</span> <span class="contentTitle">{{nowTimeNewsData.title}}</span>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover"> <el-card shadow="hover">
<div class="news-flex-container"> <div class="news-flex-container">
<p>发布人{{ nowTimeNewsData.userId }}</p> <p>发布人{{ nowTimeNewsData.username }}</p>
<p>阅读数量{{ nowTimeNewsData.readingNumber }}</p> <p>阅读数量{{ nowTimeNewsData.readingNumber }}</p>
<p>发布日期{{ nowTimeNewsData.publishTime }}</p> <p>发布日期{{ nowTimeNewsData.publishTime }}</p>
<p>更新时间{{nowTimeNewsData.updateTime}}</p> <p>更新时间{{nowTimeNewsData.updateTime}}</p>
@ -139,24 +143,32 @@ const EssayList = async (id) => {
margin: auto; margin: auto;
background-image: linear-gradient(60deg,honeydew,powderblue,honeydew); background-image: linear-gradient(60deg,honeydew,powderblue,honeydew);
} }
/*侧边*/
.header-flex-container { .header-flex-container {
display: flex;
/*align-items: center; !* 垂直居中 *!*/
padding: 20px; padding: 20px;
gap: 10px;
background: white; background: white;
/*background: powderblue;*/
margin-top: 20px; margin-top: 20px;
height: 810px; height: 820px;
overflow-y: auto; overflow-y: auto;
} }
.header-flex-container::-webkit-scrollbar { .header-flex-container::-webkit-scrollbar {
width: 0px; /* 滚动条宽度 */ width: 0px; /* 滚动条宽度 */
} }
.column-manage{
/*background: #5ee183;*/
height: 40px;
}
.column-manage span{
margin-left: 100px;
font-size: 24px;
line-height: 50px;
color: #4b81d7;
}
.header-list { .header-list {
flex-wrap: wrap; flex-wrap: wrap; /* 如果需要换行 */
margin-left: 50px; padding: 0; /* 移除默认内边距 */
padding: 0; /*background: darkorange;*/
text-align: center;
} }
.header-list span{ .header-list span{
font-size: 17px; font-size: 17px;
@ -168,11 +180,13 @@ const EssayList = async (id) => {
} }
.header-column{ .header-column{
height:30px; height:30px;
margin-top: 20px; margin-top: 15px;
margin-right: 80px; margin-left: 6px;
padding: 5px; padding: 5px;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; /* 鼠标悬停时显示手指形状,表示可点击 */ cursor: pointer; /* 鼠标悬停时显示手指形状,表示可点击 */
/*background: darkseagreen;*/
width: 150px;
} }
.header-column span{ .header-column span{
color: #222222; color: #222222;
@ -193,7 +207,7 @@ const EssayList = async (id) => {
font-size: 30px; font-size: 30px;
text-align: center; text-align: center;
display: block; display: block;
width: 100%; /* 或者设置一个具体的宽度 */ line-height: 50px;
} }
.flex-container { .flex-container {
display: flex; display: flex;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save