master
Your Name 2 months ago
parent 776a81ccf1
commit df6fb3010c
  1. 3
      backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java
  2. 4
      teaching_integration_platform_admin_template/.env.development
  3. 3
      teaching_integration_platform_admin_template/src/api/user/news.js
  4. 21
      teaching_integration_platform_admin_template/src/views/message/index.vue
  5. 4
      teaching_integration_platform_admin_template/src/views/myMessage/index.vue
  6. 107
      teaching_integration_platform_admin_template/src/views/news/components/newsContentManage.vue
  7. 26
      teaching_integration_platform_admin_template/src/views/news/index.vue
  8. 27
      teaching_integration_platform_template/src/views/pedagogicalReform/index.vue
  9. 4
      teaching_integration_platform_template/src/views/scientificResearch/index.vue

@ -27,6 +27,9 @@ public class CmsEssayServiceImpl extends ServiceImpl<CmsEssayMapper, CmsEssay> i
public BaseResponse<String> addEssay(CmsEssay cmsEssay) {
//设置文章发布时间
cmsEssay.setPublishTime(LocalDate.now());
//设置发布人姓名
// String nickName = userService.getById(cmsEssay.getUserId()).getNickName();
// cmsEssay.setUsername(nickName);
//如果数据库里没有文章,文章id设为2
Long count = query().count();
if (count == 0){

@ -1,5 +1,5 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台'
# VITE_APP_BASE_API = 'http://127.0.0.1:8080'
VITE_APP_BASE_API = 'http://39.106.16.162:8080'
VITE_APP_BASE_API = 'http://127.0.0.1:8080'
# VITE_APP_BASE_API = 'http://39.106.16.162:8080'

@ -9,7 +9,7 @@ export function deleteCategory(ids) {
}
//编辑栏目
export function editStatus(params) {
return request.put(`/api/cms-category/edit/status`, params);
return request.put(`/api/cms-category/edit/status`, {},{params});
}
//添加栏目
function parseParams(params){
@ -26,6 +26,7 @@ function parseParams(params){
export function addCategory(params) {
const str = parseParams(params)
return request.post(`/api/cms-category/add${str}`);
// return request.post(`/api/cms-category/add`,{},{params});
}
//查询新闻文章
export function queryEssay(category_id) {

@ -158,15 +158,7 @@ const deleteMessage = async (id: any) => {
await getMessageList()
}
//
const readMessage = async (id:any) =>{
// console.log(id,userStore.data.id,'dddddd')
await readMessagesBatch({
messageIds:id,
userId:userStore.data.id
})
await getMessageList()
}
//
const handleSizeChange = (size: any) => {
// loading.value = true
@ -191,8 +183,15 @@ const editContent =()=>{
const sendContent = ()=>{
router.push('/messageManagement/sendMessage')
}
//
//
const readMessage = async (id:any) =>{
await readMessagesBatch({
messageIds:id,
userId:userStore.data.id
})
await getMessageList()
}
//
const handleClick = (item)=> {
//
if(!item.isRead){

@ -70,14 +70,14 @@ const userStore = useUserStore()
const params = ref({
userId: userStore.data.id,
// userId: 4,
isAsc:true,
isAsc:false,
isDelete:0,
isRead:'',
isSend:1,
// messageId:false,
pageNo:1,
pageSize:5,
sortBy:false,//
//sortBy:false,
})
const total = ref(0)
const Message = ref([])

@ -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)

@ -49,7 +49,6 @@
</div>
<div style="text-align: center">
<el-scrollbar class="scrollbarContent">
<!-- <span>{{ nowTimeNewsData.content }}</span>-->
<textarea v-model="nowTimeNewsData.content" style="width: 100%;height: 65vh;border: none;" readonly></textarea>
</el-scrollbar>
</div>
@ -73,7 +72,9 @@ const column =ref([])
//
const CategoryList = async () => {
const res = await queryCategory()
column.value = res.data
// 1
const showColumns = res.data.filter(column => column.status === 1);
column.value = showColumns;
//
if (column.value.length > 0) {
await EssayList(column.value[0].id);
@ -93,12 +94,21 @@ const newViews = (listObject)=> {
nowTimeNewsData.value = { ...listObject }
console.log(nowTimeNewsData,'当前点击新闻详细内容')
}
//
const EssayList = async (id)=>{
const response = await queryEssay(id)
essay.value = response.data
if (essay.value.length > 0) {
newViews(essay.value[0]); //
//
const EssayList = async (id) => {
try {
const response = await queryEssay(id);
// 1
const filteredEssays = response.data.filter((item) => item.status === 1);
essay.value = filteredEssays;
//
if (essay.value.length > 0) {
newViews(essay.value[0]); //
} else {
ElMessage.warning('此栏目下没有可用的新闻!');
}
} catch (error) {
ElMessage.error('获取新闻列表失败,请稍后再试!');
}
}
</script>

@ -30,36 +30,27 @@
<script lang='ts' setup>
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
import {queryCategory,queryEssay} from '@/api/news'
import {ElMessage} from 'element-plus'
const column = ref([])
const essayContent = ref({})
//
//
const CategoryList = async () => {
const res = await queryCategory()
column.value = res.data
// console.log(column.value,'')
}
const selectEssay =async (essay)=>{
essayContent.value = essay
// console.log(essayContent,'')
};
//
const fetchCategoriesAndEssays = async () => {
try {
const categoriesResponse = await queryCategory();
column.value = categoriesResponse.data;
//
const showColumns = categoriesResponse.data.filter(column => column.status === 1);
column.value = showColumns;
// 1
for (const category of column.value) {
const essaysResponse = await queryEssay(category.id);
category.essays = essaysResponse.data || [];
console.log(category.essays,'s')
// 1
category.essays = essaysResponse.data.filter(article => article.status === 1);
}
} catch (error) {
console.error('查找信息失败', error);
// console.error('', error);
ElMessage.error('查找信息失败,请稍后再试!');
}
}
onMounted(() => {
CategoryList()
fetchCategoriesAndEssays()
})
</script>

@ -7,12 +7,8 @@
</div>
</template>
<div class="news_main">
<!-- {{ aboutEssay.content }}-->
<textarea v-model="aboutEssay.content" class="textSty"></textarea>
</div>
<!-- <template #footer>-->
<!-- <span>...</span>-->
<!-- </template>-->
</el-card>
</div>
</template>

Loading…
Cancel
Save