significative 2 months ago
commit 8c3778ca78
  1. 3
      backend/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java
  2. 90
      backend/src/main/resources/application-local.yml
  3. 3
      teaching_integration_platform_admin_template/.env.development
  4. 3
      teaching_integration_platform_admin_template/src/api/user/news.js
  5. 73
      teaching_integration_platform_admin_template/src/views/message/components/messageContent.vue
  6. 4
      teaching_integration_platform_admin_template/src/views/message/components/sendMessage.vue
  7. 25
      teaching_integration_platform_admin_template/src/views/message/index.vue
  8. 4
      teaching_integration_platform_admin_template/src/views/myMessage/index.vue
  9. 121
      teaching_integration_platform_admin_template/src/views/news/components/newsContentManage.vue
  10. 31
      teaching_integration_platform_admin_template/src/views/news/index.vue
  11. 26
      teaching_integration_platform_template/src/api/news.ts
  12. 27
      teaching_integration_platform_template/src/views/pedagogicalReform/index.vue
  13. 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){

@ -0,0 +1,90 @@
server:
port: 8080
spring:
application:
name: teaching-backend
servlet:
multipart:
enabled: true
max-file-size: 10MB
max-request-size: 10MB
neo4j:
uri: bolt://10.100.200.177:7687
authentication:
username: neo4j # 连接Neo4j数据P库的用户名
password: neo4j123456 # 连接Neo4j数据库的密码
mvc:
pathmatch:
matching-strategy: ant_path_matcher
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.100.200.177:3306/teaching_db
username: root
password: root
# url: jdbc:mysql://rm-bp189rd5595301145do.mysql.rds.aliyuncs.com:3306/teaching_db
# username: root123
# password: Zjh@111111
mybatis:
configuration:
map-underscore-to-camel-case: true
mapper-locations:
- classpath:mapper/*.xml
- classpath*:com/**/mapper/*.xml
jwt:
tokenHeader: Authorization
secret: mySecret
expiration: 604800
tokenHead: Bearer
knife4j:
enable: true
openapi:
title: 111
description: "123"
concat: zjh
version: v1.0.0
group:
default:
group-name: default
api-rule: package
api-rule-resources:
- com.teaching.backend.controller
secure:
ignored:
urls:
# - /swagger-ui/
# - /swagger-resources/**
# - /**/v2/api-docs
# - /**/*.html
# - /**/*.js
# - /**/*.css
# - /**/*.png
# - /**/*.map
# - /favicon.ico
# - /actuator/**
# - /druid/**
# - /user/**
# - /user/login
# - /user/register
# - /user/info
# - /user/logout
# - /minio/upload
- /**
aliyun:
oss:
endpoint: oss-cn-wuhan-lr.aliyuncs.com
accessKeyId: LTAI5tFkdu3y5WddxbjgaG2F
accessKeySecret: 1xUchxUTlmUBoTV5JQIrKsVjSkmsLF
bucketName: ceshi132132
minio:
endpoint: http://39.106.16.162:9090 #MinIO服务所在地址
bucketName: teaching # 存储桶名称
accessKey: minioadmin # 访问的key
secretKey: minioadmin # 访问的秘钥
filename:
maxlength: 10

@ -1,5 +1,6 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台'
VITE_APP_BASE_API = 'http://127.0.0.1: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) {

@ -150,25 +150,62 @@ 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 () => {
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'
})
})
}
try {
//
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',
});
});
} catch (error) {
//
if (error.type === 'cancel') {
//
return;
}
//
ElMessage.error({
message: '发送失败',
type: 'error',
});
console.error('发送失败:', error);
}
};
</script>
<style scoped>
.header{

@ -61,14 +61,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 sendMessage = ref({})

@ -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:
})
const total = ref(0)
const Message = ref([])
@ -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:320px;
height:425px;
border: 2px solid #d3d3d3;"
v-model="newsForm.content"
></textarea>
@ -71,21 +70,21 @@
<!-- <el-form-item label="发布时间" label-width="140px">-->
<!-- <el-input v-model="newsForm.publishTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
<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="所属栏目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-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">
<el-input v-model="newsForm.userId" autocomplete="off" style="width: 200px" readonly/>
</el-form-item>
<!-- <el-form-item label="当前用户id" label-width="120px">-->
<!-- <el-input v-model="newsForm.userId" autocomplete="off" style="width: 200px" readonly/>-->
<!-- </el-form-item>-->
</el-form>
<template #footer>
<div class="dialog-footer">
@ -102,23 +101,24 @@
<!-- 栏目编辑弹框-->
<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>
</div>
</el-drawer>
<!-- 栏目添加对话框-->
<!-- 栏目添加-->
<el-dialog v-model="addFormVisible" title="栏目添加" width="500">
<el-form :model="form">
<el-form-item label="栏目名称" label-width="140px">
@ -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,7 +275,6 @@ const addNewsButton = (item)=>{
nowCategoryName.value = item.categoryName
}
const nowTimeNewsData = ref({})
console.log(userStore.data,'当前用户数据')
//
const newViews = (listObject)=> {
nowTimeNewsData.value = { ...listObject }
@ -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)
@ -379,7 +450,7 @@ const addNewsContentConfirm = async (id)=>{
userId:newsForm.value.userId
}).then(()=>{
ElMessage({
message:'添加成功',
message:'新闻添加成功',
type:'success'
});
})

@ -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);
@ -87,17 +88,27 @@ onMounted(() => {
})
const essay = ref([])
const nowTimeNewsData = ref({})
// console.log(nowTimeNewsData,'dsdsd')
//
const newViews = (listObject)=> {
nowTimeNewsData.value = { ...listObject }
}
//
const EssayList = async (id)=>{
const response = await queryEssay(id)
essay.value = response.data
if (essay.value.length > 0) {
newViews(essay.value[0]); //
console.log(nowTimeNewsData,'当前点击新闻详细内容')
}
//
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>

@ -0,0 +1,26 @@
import request from '@/utils/requset'
//获取栏目
/**
* queryCategory
* @returns
*/
export function queryCategory() {
return request.get(`/api/cms-category/query`);
}
//获取文章
/**
* queryEssay
* @param {string} category_id category_id
* @returns
*/
export function queryEssay(category_id) {
return request.get(`/api/cms-essay/query?category_id=${category_id}`);
}
//修改新闻
export function editEssay(params) {
return request.put(`/api/cms-essay/edit`, params);
}
//根据id查询关于我们文章
export function queryEssayById(essay_id) {
return request.get(`/api/cms-essay/queryessaybyid?essay_id=${essay_id}`);
}

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