Compare commits

...

2 Commits

Author SHA1 Message Date
fwb f074bef41e 'med' 2 months ago
fwb e5d13ae4f5 'gengxin' 2 months ago
  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. 8302
      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. 7042
      teaching_integration_platform_template/pnpm-lock.yaml

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

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