lijiaqi 3 months ago
commit 6f7b56b1ba
  1. 14015
      pnpm-lock.yaml
  2. 45
      src/api/configuration.ts
  3. 17
      src/api/user/news.js
  4. 81
      src/layout/menu/index copy.vue
  5. 44
      src/layout/menu/index.vue
  6. 2
      src/layout/tabbar/setting/index.vue
  7. 491
      src/router/routers copy.ts
  8. 307
      src/router/routers.ts
  9. 51
      src/views/configurationPage/MyUpdate.vue
  10. 93
      src/views/configurationPage/index.vue
  11. 11
      src/views/news/components/newsContent.vue
  12. 37
      src/views/news/components/newsContentDetails.vue
  13. 315
      src/views/news/index.vue

File diff suppressed because it is too large Load Diff

@ -0,0 +1,45 @@
import request from '@/utils/request'
import { tool } from '../utils/alioss.js'
import { ElLoading, ElMessage } from 'element-plus'
enum Api {
get系统配置 = '/api/systemSettings/save',
put系统配置 = '/api/systemSettings',
}
// 提示批量处理
const initOptions = { text: '加载中', success: '成功', error: '失败' }
function proxRequest(request, options: any = initOptions) {
return async (...arg) => {
if (!options) return request(...arg)
const loadingInstance = ElLoading.service({ text: options.text })
try {
await request(...arg)
ElMessage.success(options.success)
} catch (error) {
ElMessage.error(options.error)
} finally {
loadingInstance.close()
}
return request
}
}
export function uploadApi(file: File) {
if (file instanceof Object) return tool.oss.upload(file).then(res => res.url)
else return Promise.resolve(file)
}
export function getSysSettingApi() {
return request.get(Api.get系统配置)
}
export const proxGetSysSettingApi = proxRequest(getSysSettingApi)
export function putSysSettingApi(params: any) {
return request.put(Api.put系统配置, params)
}
export const proxPutSysSettingApi = proxRequest(putSysSettingApi, { success: '保存成功', error: '保存失败' })

@ -23,3 +23,20 @@ export function addCategory(params) {
const str = parseParams(params)
return request.post(`/api/cms-category/add${str}`);
}
//查询新闻文章
export function queryEssay(category_id) {
return request.get(`/api/cms-essay/query?category_id=${category_id}`);
}
//添加新闻文章
export function addEssay(params){
const str = parseParams(params)
return request.post(`/api/cms-essay/add${str}`)
}
//删除新闻
export function deleteEssay(ids) {
return request.delete(`/api/cms-essay/delete?ids=${ids}`);
}
//修改新闻
export function editEssay(params) {
return request.put(`/api/cms-essay/edit`, params);
}

@ -0,0 +1,81 @@
<template>
<!-- 根据路由动态生成菜单 -->
<template v-for="item in menuList" :key="item.path">
<!-- 没有子路由 -->
<template v-if="!item.children">
<el-menu-item
v-if="!item.meta.hidden"
:index="item.path"
@click="goToRoute"
>
<el-icon>
<component :is="item.meta.icon"></component>
</el-icon>
<template #title>
<!-- <el-icon>
<component :is="item.meta.icon"></component>
</el-icon> -->
<span v-show="!fold">{{ item.meta.title }}</span>
</template>
</el-menu-item>
</template>
<!-- 有子路由但是只有一个子路由 -->
<template v-if="item.children && item.children.length === 1">
<el-menu-item
v-if="!item.children[0].meta.hidden"
:index="item.children[0].path"
@click="goToRoute"
>
<el-icon>
<component :is="item.children[0].meta.icon"></component>
</el-icon>
<template #title>
<span v-show="!fold">{{ item.children[0].meta.title }}</span>
</template>
</el-menu-item>
</template>
<!-- 有子路由且有多个 -->
<el-sub-menu
:index="item.path"
v-if="item.children && item.children.length > 1"
>
<template #title>
<el-icon>
<component :is="item.meta.icon"></component>
</el-icon>
<span v-show="!fold">{{ item.meta.title }}</span>
</template>
<Menu :menuList="item.children" />
</el-sub-menu>
</template>
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { watch, ref } from 'vue'
import useLayoutSettingStoe from '@/store/modules/setting'
const LayoutSettingStoe = useLayoutSettingStoe()
// import { onMounted, reactive, ref, toRefs, watch } from 'vue'
//
const props = defineProps(['menuList'])
console.log(props.menuList);
const $router = useRouter()
const goToRoute = (vc: any) => {
$router.push(vc.index)
}
const fold = ref(false)
watch(
() => LayoutSettingStoe.fold,
(newVal) => {
setTimeout(() => {
fold.value = newVal
}, 200)
},
)
</script>
<script lang="ts">
export default {
name: 'Menu',
}
</script>
<style lang="scss" scoped></style>

@ -1,13 +1,6 @@
<template>
<!-- 根据路由动态生成菜单 -->
<template v-for="item in menuList" :key="item.path">
<!-- 没有子路由 -->
<template v-if="!item.children">
<el-menu-item
v-if="!item.meta.hidden"
:index="item.path"
@click="goToRoute"
>
<template v-for="(item, index) in menuList[0].children" :key="item.path">
<el-menu-item v-if="!item.meta.hidden" :index="item.path" @click="goToRoute">
<el-icon>
<component :is="item.meta.icon"></component>
</el-icon>
@ -19,35 +12,6 @@
</template>
</el-menu-item>
</template>
<!-- 有子路由但是只有一个子路由 -->
<template v-if="item.children && (item.children.length === 1||item.children.filter(o=>!o.meta.hidden).length==1)">
<el-menu-item
v-if="!item.children[0].meta.hidden"
:index="item.children[0].path"
@click="goToRoute"
>
<el-icon>
<component :is="item.children[0].meta.icon"></component>
</el-icon>
<template #title>
<span v-show="!fold">{{ item.children[0].meta.title }}</span>
</template>
</el-menu-item>
</template>
<!-- 有子路由且有多个 -->
<el-sub-menu
:index="item.path"
v-if="item.children && item.children.length > 1&&item.children.filter(o=>!o.meta.hidden).length!=1"
>
<template #title>
<el-icon>
<component :is="item.meta.icon"></component>
</el-icon>
<span v-show="!fold">{{ item.meta.title }}</span>
</template>
<Menu :menuList="item.children" />
</el-sub-menu>
</template>
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router'
@ -56,7 +20,9 @@ import useLayoutSettingStoe from '@/store/modules/setting'
const LayoutSettingStoe = useLayoutSettingStoe()
// import { onMounted, reactive, ref, toRefs, watch } from 'vue'
//
defineProps(['menuList'])
const props = defineProps(['menuList'])
console.log(props.menuList)
const $router = useRouter()
const goToRoute = (vc: any) => {
$router.push(vc.index)

@ -11,7 +11,7 @@
/> -->
<el-button size="small" icon="refresh" circle @click="refresh" />
<el-button size="small" icon="FullScreen" circle @click="fullScreen" />
<el-button size="small" icon="Setting" circle />
<el-button size="small" icon="Setting" circle @click="$router.push('/configurationPage')"/>
<el-button
size="small"
icon="Link"

@ -0,0 +1,491 @@
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';
import { pa } from 'element-plus/es/locales.mjs';
export const constantRoute: any = [
{
path: '/',
component: () => import('@/layout/index.vue'),
name: 'layout',
meta: {
title: '',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
// redirect: '/home',
// children: [
// {
// path: '/home',
// component: () => import('@/views/home/index.vue'),
// name: 'Home',
// meta: {
// title: '个人中心',
// hidden: false,
// icon: 'HomeFilled',
// },
// },
// ],
redirect: '/home',
children: [
{
path: '/home',
component: () => import('@/views/home/index.vue'),
name: 'Home',
meta: {
title: '个人中心',
hidden: false,
icon: 'HomeFilled',
},
},
{
path: '/configurationPage',
component: () => import('@/views/configurationPage/index.vue'),
name: 'configurationPage',
meta: {
title: '系统设置',
hidden: true,
icon: 'HomeFilled',
},
},
{
path: '/curriculumCenter/basicCourseInformation',
component: () => import('@/views/course/basicCourseInformation.vue'),
name: 'BasicCourseInformation',
meta: {
title: '课程基本信息',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/courseDetails',
component: () => import('@/views/course/courseDetails.vue'),
name: 'CourseDetails',
meta: {
title: '课程详情',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/CourseObjectives',
component: () => import('@/views/course/CourseObjectives.vue'),
name: 'CourseObjectives',
meta: {
title: '课程目标',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/courseChapters',
component: () => import('@/views/course/courseChapters.vue'),
name: 'CourseChapters',
meta: {
title: '课程章节',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/knowledgePoints',
component: () => import('@/views/course/knowledgePoints.vue'),
name: 'KnowledgePoints', // name 要与权限一致
meta: {
title: '知识点',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/curriculumMap',
component: () => import('@/views/course/curriculumMap.vue'),
name: 'CurriculumMap', // name 要与权限一致
meta: {
title: '课程图谱',
hidden: false,
icon: 'Notebook',
},
},
],
},
{
path: '/knowledgeAtlas',
component: () => import('@/views/course/knowledgeAtlas.vue'),
name: 'knowledgeAtlas',
meta: {
title: '知识图谱',
hidden: true,
icon: 'Notebook',
},
},
// {
// path: '/mssageManagement',
// component: () => import('@/layout/index.vue'),
// name: 'MssageManagement',
// meta: {
// title: '',
// hidden: false,
// icon: 'HomeFilled', // 菜单图标
// },
// children: [
// {
// path: '/mssageManagement/message',
// component: () => import('@/views/message/index.vue'),
// name: 'Message',
// meta: {
// title: '消息',
// hidden: false,
// icon: 'ChatDotSquare',
// },
// },
// ],
// },
{
path: '/curriculumCenter',
redirect: '/curriculumCenter/basicCourseInformation',
component: () => import('@/layout/index.vue'),
name: 'CurriculumCenter',
meta: {
title: '课程',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/curriculumCenter/basicCourseInformation',
component: () => import('@/views/course/basicCourseInformation.vue'),
name: 'BasicCourseInformation',
meta: {
title: '课程基本信息',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/courseDetails',
component: () => import('@/views/course/courseDetails.vue'),
name: 'CourseDetails',
meta: {
title: '课程详情',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/CourseObjectives',
component: () => import('@/views/course/CourseObjectives.vue'),
name: 'CourseObjectives',
meta: {
title: '课程目标',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/courseChapters',
component: () => import('@/views/course/courseChapters.vue'),
name: 'CourseChapters',
meta: {
title: '课程章节',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/knowledgePoints',
component: () => import('@/views/course/knowledgePoints.vue'),
name: 'KnowledgePoints', // name 要与权限一致
meta: {
title: '知识点',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/curriculumMap',
component: () => import('@/views/course/curriculumMap.vue'),
name: 'CurriculumMap', // name 要与权限一致
meta: {
title: '课程图谱',
hidden: false,
icon: 'Notebook',
},
},
],
},
{
path: '/studentManagement',
component: () => import('@/layout/index.vue'),
name: 'StudentManagement',
meta: {
title: '',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/studentManagement/student',
component: () => import('@/views/student/index.vue'),
name: 'Student',
meta: {
title: '学生',
hidden: false,
icon: 'User',
},
},
],
},
{
path: '/messageManagement',
component: () => import('@/layout/index.vue'),
name: 'MessageManagement',
meta: {
title: '消息',
hidden: false,
icon: 'ChatLineRound', // 菜单图标
},
children: [
{
path: '/messageManagement/message',
component: () => import('@/views/message/index.vue'),
name: 'Message',
meta: {
title: '消息详情',
hidden: false,
icon: 'ChatDotSquare',
}
},
{
path: '/messageManagement/sendMessage',
component: () => import('@/views/message/components/sendMessage.vue'),
name: 'SendMessage',
meta: {
title: '个人发出',
hidden: true,
icon: '',
}
},
{
path: '/messageContentList',
component: () => import('@/views/message/components/indexContentList.vue'),
name: 'MessageContentList',
meta: {
title: '收到信息详情',
hidden: true,
icon: ''
}
},
{
path: '/sendMessageList',
component: () => import('@/views/message/components/sendMessageList.vue'),
name: 'SendMessageList',
meta: {
title: '发送信息详情',
hidden: true,
icon: ''
}
},
],
},
{
path: '/messageContent',
component: () => import('@/views/message/components/messageContent.vue'),
name: 'MessageContent',
meta: {
title: '写栈内信函',
hidden: true,
icon: 'EditPen',
}
},
{
path: '/news',
component: () => import('@/layout/index.vue'),
name: 'NewsManagement',
meta: {
title: '资讯',
hidden: false,
icon: 'BellFilled'
},
children: [
{
path: '/news/newsContent',
component: () => import('@/views/news/index.vue'),
name: 'NewsContent',
meta: {
title: '资讯管理',
hidden: false,
icon: 'BellFilled'
}
},
{
path: '/news/newsContentDetails',
component:()=>import('@/views/news/components/newsContentDetails.vue'),
name:'NewsContentDetails',
meta: {
title: '栏目添加新闻信息',
hidden: true,
icon: 'Promotion'
},
},
]
},
{
path: '/myCourseStudyManagement',
component: () => import('@/layout/index.vue'),
name: 'MyCourseStudyManagement',
meta: {
title: '学习过程',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/myCourseStudyManagement/learningProcess',
component: () => import('@/views/MyCourseStudy/learningProcess.vue'),
name: 'LearningProcess',
meta: {
title: '课程学习记录',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/learningProcess1',
component: () =>
import('@/views/MyCourseStudy/knowledgeLearningProcess.vue'),
name: 'LearningProcess1',
meta: {
title: '知识点学习记录',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/learningProcess2',
component: () => import('@/views/MyCourseStudy/resourceLearning.vue'),
name: 'LearningProcess2',
meta: {
title: '资源学习记录',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/courseCollections',
component: () => import('@/views/MyCourseStudy/courseCollections.vue'),
name: 'CourseCollections',
meta: {
title: '课程收藏',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/Courselikes',
component: () => import('@/views/MyCourseStudy/Courselikes.vue'),
name: 'Courselikes',
meta: {
title: '课程点赞',
hidden: false,
icon: 'StarFilled',
},
},
],
},
{
path: '/courseResourcesManagement',
component: () => import('@/layout/index.vue'),
name: 'CourseResourcesManagement',
meta: {
title: '课程资源',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/courseResourcesManagement/courseResources',
component: () => import('@/views/courseResources/index.vue'),
name: 'CourseResources',
meta: {
title: '课程资源',
hidden: false,
icon: 'Reading',
},
},
],
},
{
path: '/portal',
component: () => import('@/views/portal/view.vue'),
name: 'Portal',
meta: {
title: '门户',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/portal/webHome',
component: () => import('@/views/portal/index.vue'),
name: 'WebHome',
meta: {
title: '网站首页',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/courseHome',
component: () => import('@/views/portal/courseHomepage.vue'),
name: 'CourseHome',
meta: {
title: '课程首页',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/LearningPathRecommendations',
component: () =>
import('@/views/portal/LearningPathRecommendations.vue'),
name: 'LearningPathRecommendations',
meta: {
title: '学习路径推荐',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/knowledgePointLearning',
component: () => import('@/views/portal/knowledgePointLearning.vue'),
name: 'KnowledgePointLearning',
meta: {
title: '知识点学习',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/courseReports',
component: () => import('@/views/portal/courseReports.vue'),
name: 'CourseReports',
meta: {
title: '课程报告',
hidden: false,
icon: 'Reading',
},
},
],
},
{
path: '/curriculumCenter/largeScreen',
component: () => import('@/views/course/largeScreen.vue'),
name: 'LargeScreen', // name 要与权限一致
meta: {
title: '课程图谱',
hidden: true,
icon: 'Notebook',
},
},
]

@ -1,5 +1,3 @@
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';
import { pa } from 'element-plus/es/locales.mjs';
export const constantRoute: any = [
{
@ -7,23 +5,10 @@ export const constantRoute: any = [
component: () => import('@/layout/index.vue'),
name: 'layout',
meta: {
title: '',
title: '1',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
// redirect: '/home',
// children: [
// {
// path: '/home',
// component: () => import('@/views/home/index.vue'),
// name: 'Home',
// meta: {
// title: '个人中心',
// hidden: false,
// icon: 'HomeFilled',
// },
// },
// ],
redirect: '/home',
children: [
{
@ -36,7 +21,15 @@ export const constantRoute: any = [
icon: 'HomeFilled',
},
},
],
{
path: '/configurationPage',
component: () => import('@/views/configurationPage/index.vue'),
name: 'configurationPage',
meta: {
title: '系统设置',
hidden: true,
icon: 'HomeFilled',
},
},
{
path: '/knowledgeAtlas',
@ -48,39 +41,6 @@ export const constantRoute: any = [
icon: 'Notebook',
},
},
// {
// path: '/mssageManagement',
// component: () => import('@/layout/index.vue'),
// name: 'MssageManagement',
// meta: {
// title: '',
// hidden: false,
// icon: 'HomeFilled', // 菜单图标
// },
// children: [
// {
// path: '/mssageManagement/message',
// component: () => import('@/views/message/index.vue'),
// name: 'Message',
// meta: {
// title: '消息',
// hidden: false,
// icon: 'ChatDotSquare',
// },
// },
// ],
// },
{
path: '/curriculumCenter',
redirect: '/curriculumCenter/basicCourseInformation',
component: () => import('@/layout/index.vue'),
name: 'CurriculumCenter',
meta: {
title: '课程',
hidden: true,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/curriculumCenter/basicCourseInformation',
component: () => import('@/views/course/basicCourseInformation.vue'),
@ -141,18 +101,6 @@ export const constantRoute: any = [
icon: 'Notebook',
},
},
],
},
{
path: '/studentManagement',
component: () => import('@/layout/index.vue'),
name: 'StudentManagement',
meta: {
title: '',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/studentManagement/student',
component: () => import('@/views/student/index.vue'),
@ -163,19 +111,6 @@ export const constantRoute: any = [
icon: 'User',
},
},
],
},
{
path: '/messageManagement',
component: () => import('@/layout/index.vue'),
name: 'MessageManagement',
meta: {
title: '消息',
hidden: false,
icon: 'ChatLineRound', // 菜单图标
},
children: [
{
path: '/messageManagement/message',
component: () => import('@/views/message/index.vue'),
@ -184,7 +119,7 @@ export const constantRoute: any = [
title: '消息详情',
hidden: false,
icon: 'ChatDotSquare',
}
},
},
{
path: '/messageManagement/sendMessage',
@ -192,52 +127,44 @@ export const constantRoute: any = [
name: 'SendMessage',
meta: {
title: '个人发出',
hidden: true,
hidden: false,
icon: '',
}
},
},
{
path: '/messageContentList',
component: () => import('@/views/message/components/indexContentList.vue'),
component: () =>
import('@/views/message/components/indexContentList.vue'),
name: 'MessageContentList',
meta: {
title: '收到信息详情',
hidden: true,
icon: ''
}
icon: '',
},
},
{
path: '/sendMessageList',
component: () => import('@/views/message/components/sendMessageList.vue'),
component: () =>
import('@/views/message/components/sendMessageList.vue'),
name: 'SendMessageList',
meta: {
title: '发送信息详情',
hidden: true,
icon: ''
}
icon: '',
},
],
},
{
path: '/messageContent',
component: () => import('@/views/message/components/messageContent.vue'),
component: () =>
import('@/views/message/components/messageContent.vue'),
name: 'MessageContent',
meta: {
title: '写栈内信函',
hidden: true,
icon: 'EditPen',
}
},
{
path: '/news',
component: () => import('@/layout/index.vue'),
name: 'NewsManagement',
meta: {
title: '资讯',
hidden: false,
icon: 'BellFilled'
},
children: [
{
path: '/news/newsContent',
component: () => import('@/views/news/index.vue'),
@ -245,31 +172,20 @@ export const constantRoute: any = [
meta: {
title: '资讯管理',
hidden: false,
icon: 'BellFilled'
}
icon: 'BellFilled',
},
},
{
path: '/newsDetails',
component: () => import('@/views/news/components/newsContent.vue'),
name: 'NewsDetails',
path: '/news/newsContentDetails',
component: () =>
import('@/views/news/components/newsContentDetails.vue'),
name: 'NewsContentDetails',
meta: {
title: '新闻详情',
title: '栏目添加新闻信息',
hidden: true,
icon: ''
},
icon: 'Promotion',
},
]
},
{
path: '/myCourseStudyManagement',
component: () => import('@/layout/index.vue'),
name: 'MyCourseStudyManagement',
meta: {
title: '学习过程',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/myCourseStudyManagement/learningProcess',
component: () => import('@/views/MyCourseStudy/learningProcess.vue'),
@ -321,18 +237,6 @@ export const constantRoute: any = [
icon: 'StarFilled',
},
},
],
},
{
path: '/courseResourcesManagement',
component: () => import('@/layout/index.vue'),
name: 'CourseResourcesManagement',
meta: {
title: '课程资源',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/courseResourcesManagement/courseResources',
component: () => import('@/views/courseResources/index.vue'),
@ -345,77 +249,80 @@ export const constantRoute: any = [
},
],
},
{
path: '/portal',
component: () => import('@/views/portal/view.vue'),
name: 'Portal',
meta: {
title: '门户',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/portal/webHome',
component: () => import('@/views/portal/index.vue'),
name: 'WebHome',
meta: {
title: '网站首页',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/courseHome',
component: () => import('@/views/portal/courseHomepage.vue'),
name: 'CourseHome',
meta: {
title: '课程首页',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/LearningPathRecommendations',
component: () =>
import('@/views/portal/LearningPathRecommendations.vue'),
name: 'LearningPathRecommendations',
meta: {
title: '学习路径推荐',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/knowledgePointLearning',
component: () => import('@/views/portal/knowledgePointLearning.vue'),
name: 'KnowledgePointLearning',
meta: {
title: '知识点学习',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/courseReports',
component: () => import('@/views/portal/courseReports.vue'),
name: 'CourseReports',
meta: {
title: '课程报告',
hidden: false,
icon: 'Reading',
},
},
],
},
{
path: '/curriculumCenter/largeScreen',
component: () => import('@/views/course/largeScreen.vue'),
name: 'LargeScreen', // name 要与权限一致
meta: {
title: '课程图谱',
hidden: true,
icon: 'Notebook',
},
},
// {
// path: '/portal',
// component: () => import('@/views/portal/view.vue'),
// name: 'Portal',
// meta: {
// title: '门户',
// hidden: false,
// icon: 'HomeFilled', // 菜单图标
// },
// children: [
// {
// path: '/portal/webHome',
// component: () => import('@/views/portal/index.vue'),
// name: 'WebHome',
// meta: {
// title: '网站首页',
// hidden: false,
// icon: 'Reading',
// },
// },
// {
// path: '/portal/courseHome',
// component: () => import('@/views/portal/courseHomepage.vue'),
// name: 'CourseHome',
// meta: {
// title: '课程首页',
// hidden: false,
// icon: 'Reading',
// },
// },
// {
// path: '/portal/LearningPathRecommendations',
// component: () =>
// import('@/views/portal/LearningPathRecommendations.vue'),
// name: 'LearningPathRecommendations',
// meta: {
// title: '学习路径推荐',
// hidden: false,
// icon: 'Reading',
// },
// },
// {
// path: '/portal/knowledgePointLearning',
// component: () => import('@/views/portal/knowledgePointLearning.vue'),
// name: 'KnowledgePointLearning',
// meta: {
// title: '知识点学习',
// hidden: false,
// icon: 'Reading',
// },
// },
// {
// path: '/portal/courseReports',
// component: () => import('@/views/portal/courseReports.vue'),
// name: 'CourseReports',
// meta: {
// title: '课程报告',
// hidden: false,
// icon: 'Reading',
// },
// },
// ],
// },
// {
// path: '/curriculumCenter/largeScreen',
// component: () => import('@/views/course/largeScreen.vue'),
// name: 'LargeScreen', // name 要与权限一致
// meta: {
// title: '课程图谱',
// hidden: true,
// icon: 'Notebook',
// },
// },
]

@ -0,0 +1,51 @@
<template>
<el-upload ref="upload" class="upload-demo" action="#" :on-change="change" v-model:file-list="fileList" :limit="1"
:on-exceed="handleExceed" :auto-upload="false" list-type="picture-card">
<el-icon>
<Plus />
</el-icon>
<template #file="{ file }">
<div>
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete" @click="handleRemove">
<el-icon>
<Delete />
</el-icon>
</span>
</span>
</div>
</template>
</el-upload>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import type { UploadUserFile } from 'element-plus'
import { genFileId } from 'element-plus'
import { Delete, Plus } from '@element-plus/icons-vue'
const props = defineProps(['modelValue'])
const emit = defineEmits(['update:modelValue'])
watch(() => props.modelValue, newVal => {
if (!newVal) return
fileList.value.length = 0
fileList.value.push({ url: props.modelValue })
}, { once: true })
const fileList = ref<UploadUserFile[]>([])
const handleRemove = () => {
fileList.value.length = 0
change({ raw: false })
}
function change(file: any) {
emit('update:modelValue', file.raw)
}
const upload = ref()
const handleExceed = (files) => {
upload.value!.clearFiles()
const file = files[0]
file.uid = genFileId()
upload.value!.handleStart(file)
}
</script>

@ -0,0 +1,93 @@
<template>
<div class="configuration-page">
<el-form :model="form" label-width="auto" style="max-width: 600px">
<el-form-item label="LOGO">
<my-update v-model="form.logo"></my-update>
</el-form-item>
<el-form-item label="项目名称">
<el-input v-model="form.name" />
</el-form-item>
<p>门户宣传图配置</p>
<el-form-item label="门户头部宣传大图">
<my-update v-model="form.promotionalImages"></my-update>
</el-form-item>
<el-form-item label="门户首页">
<el-input v-model="form.home" />
</el-form-item>
<el-form-item label="后台登陆首页地址">
<el-input v-model="form.loginAddress" />
</el-form-item>
<el-form-item label="系统标题">
<el-input v-model="form.title" />
</el-form-item>
<el-form-item label="版权信息">
<el-input v-model="form.copyrightInformation" />
</el-form-item>
<el-form-item label="备案号">
<el-input v-model="form.recordNumber" />
</el-form-item>
<el-form-item label="qq">
<el-input v-model="form.qqNumber" />
</el-form-item>
<el-form-item label="邮箱">
<el-input v-model="form.mailbox" />
</el-form-item>
<el-form-item label="电话">
<el-input v-model="form.phone" />
</el-form-item>
<el-form-item label="联系地址">
<el-input v-model="form.address" />
</el-form-item>
<el-form-item label="二维码">
<my-update v-model="form.qrCode"></my-update>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">保存</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script lang="ts" setup>
import { getSysSettingApi, proxPutSysSettingApi, uploadApi } from '@/api/configuration';
import { ref, reactive } from 'vue'
import MyUpdate from './MyUpdate.vue';
import useUserStore from '@/store/modules/user';
const userStore = useUserStore()
// do not use same name with ref
const form = reactive({
address: '',
copyrightInformation: '',
id: userStore.data.id,
loginAddress: '',
logo: '',
name: '',
phone: '',
promotionalImages: '',
qqNumber: '',
qrCode: '',
recordNumber: '',
title: '',
mailbox: '',
home:''
})
const ran = ref(false)
getSysSettingApi().then((res) => {
Object.assign(form, res.data)
ran.value = true
})
const onSubmit = async () => {
form.logo = await uploadApi(form.logo)
form.promotionalImages = await uploadApi(form.promotionalImages)
form.qrCode = await uploadApi(form.qrCode)
await proxPutSysSettingApi(form)
}
</script>
<style lang="scss" scoped>
.configuration-page {
width: 600px;
margin: auto;
}
</style>

@ -1,11 +0,0 @@
<template>
</template>
<script>
</script>
<style scoped>
</style>

@ -0,0 +1,37 @@
<template>
<el-card class="container">
<template #header>
<div class="card-header">
<span>栏目添加新闻信息</span>
<el-button type="primary" @click="back" plain round>返回</el-button>
</div>
</template>
<p v-for="o in 4" :key="o" class="text item">{{ 'List item ' + o }}</p>
<template #footer>Footer content</template>
</el-card>
</template>
<script setup lang="ts">
import {useRouter} from "vue-router";
const router = useRouter();
const back = ()=>{
router.push('/news/newsContent')
}
</script>
<style scoped>
.container{
width: 80%;
margin: auto;
}
.card-header {
display: flex; /* 使用 Flexbox */
justify-content: space-between; /* 主轴上平均分配剩余空间 */
align-items: center; /* 交叉轴上居中对齐 */
}
.card-header span {
flex: 1; /* 使 span 占用可用空间,实现居中效果 */
text-align: center; /* 文本居中 */
}
</style>

@ -8,20 +8,28 @@
<ul class="header-list">
<li v-for="item in column">
<el-dropdown placement="bottom">
<span>{{ item.categoryName }}</span> <!-- 使用span代替p -->
<span @mouseenter="EssayList(item.id)">{{ item.categoryName }}</span> <!-- 使用span代替p -->
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<router-link to="/newsDetails">{{ item.createTime }}</router-link>
<ul>
<li class="flex-container" @click="newViews(listObject)" v-for="listObject in essay" style="margin-bottom: 15px">
<p >{{listObject.title}}</p>
<el-button type="danger" @click.stop="deleteNewsList(listObject.id)" round>删除</el-button>
<el-button type="primary" @click.stop="editNewsDialogFormVisible = true; newViews(listObject)" round>编辑</el-button>
</li>
</ul>
</el-dropdown-item>
<div class="add-news-button">
<el-button @click="addNewsDialogFormVisibleButton(item.id)" type="primary" plain round>添加当前栏目新闻</el-button>
</div>
</el-dropdown-menu>
</template>
</el-dropdown>
</li>
</ul>
<div>
<el-link href="https://element-plus.org" target="_blank" style="margin-right: 30px;font-size: 19px">关于我们</el-link>
<el-button name="editColumnButton" @click="editHandle" round>栏目编辑</el-button>
<el-button name="editColumnButton" @click="editHandle" round>栏目管理</el-button>
</div>
</div>
</el-card>
@ -38,7 +46,7 @@
操作
</template>
<template #default="{row}">
<!-- 在这里定义你的删除按钮 -->
<!-- 删除按钮 -->
<el-button size="default" type="danger" @click="deleteHandle(row.id)">删除</el-button>
</template>
</el-table-column>
@ -54,24 +62,24 @@
<el-form-item label="栏目父id" label-width="140px">
<el-input v-model="form.categoryPid" autocomplete="off" />
</el-form-item>
<el-form-item label="创建时间" label-width="140px">
<el-input v-model="form.createTime" autocomplete="off" type="date"/>
</el-form-item>
<el-form-item label="创建盖栏目的用户id" label-width="140px">
<el-input v-model="form.creatorId" autocomplete="off" />
</el-form-item>
<el-form-item label="栏目id" label-width="140px">
<el-input v-model="form.id" autocomplete="off" />
<!-- <el-form-item label="创建时间" label-width="140px">-->
<!-- <el-input v-model="form.createTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
<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="栏目id" label-width="140px">-->
<!-- <el-input v-model="form.id" autocomplete="off" />-->
<!-- </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>
<el-form-item label="更新时间" label-width="140px">
<el-input v-model="form.updateTime" autocomplete="off" type="date"/>
</el-form-item>
<!-- <el-form-item label="更新时间" label-width="140px">-->
<!-- <el-input v-model="form.updateTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
</el-form>
<template #footer>
<div class="dialog-footer">
@ -86,48 +94,186 @@
<el-card class="container">
<template #header>
<div class="card-header">
<span class="contentTitle">Content Title</span>
<span class="contentTitle">{{nowTimeNewsData.title}}</span>
<el-card shadow="hover">
<div class="flex-container">
<p>发布人{{ }}</p>
<p>信息来源{{ }}</p>
<p>日期{{ }}</p>
<div class="news-flex-container">
<p>发布人{{ nowTimeNewsData.userId }}</p>
<p>阅读数量{{ nowTimeNewsData.readingNumber }}</p>
<p>发布日期{{ nowTimeNewsData.publishTime }}</p>
<p>更新时间{{nowTimeNewsData.updateTime}}</p>
</div>
</el-card>
</div>
</template>
<div style="text-align: center">
<router-view></router-view>
<el-input
v-model="nowTimeNewsData.content"
style="width: 80%;font-size: 20px"
:rows="15"
type="textarea"
placeholder="Please input"
/>
</div>
<template #footer>
<div style="text-align: center">
<el-link href="https://element-plus.org" target="_blank" style="margin-right: 30px;font-size: 19px">关于我们</el-link>
</div>
</template>
</el-card>
<!-- 栏目内添加新闻-->
<el-dialog v-model="addNewsDialogFormVisible" title="添加新闻" width="500px">
<el-form v-model="newsForm">
<el-form-item label="所属栏目id" label-width="140px">
<el-input v-model="newsForm.categoryId" autocomplete="off" readonly disabled/>
</el-form-item>
<el-form-item label="文章内容" label-width="140px">
<el-input v-model="newsForm.content" autocomplete="off" />
</el-form-item>
<!-- <el-form-item label="文章文件" label-width="140px">-->
<!-- <el-input v-model="newsForm.file" autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="文章id" label-width="140px">-->
<!-- <el-input v-model="newsForm.id" autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标题图片" label-width="140px">-->
<!-- <el-input v-model="newsForm.pic" autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="发布时间" label-width="140px">-->
<!-- <el-input v-model="newsForm.publishTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
<el-form-item label="浏览次数" label-width="140px">
<el-input v-model="newsForm.readingNumber" autocomplete="off" />
</el-form-item>
<el-form-item label="发布状态" label-width="140px">
<el-input v-model="newsForm.status" placeholder="1:已发布 2:未发布" autocomplete="off" />
</el-form-item>
<el-form-item label="文章标题" label-width="140px">
<el-input v-model="newsForm.title" autocomplete="off" />
</el-form-item>
<!-- <el-form-item label="更新时间" label-width="140px">-->
<!-- <el-input v-model="newsForm.updateTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
<el-form-item label="发布文章的用户id" label-width="140px">
<el-input v-model="newsForm.userId" autocomplete="off" readonly disabled/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="addNewsDialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="addNewsContentConfirm">
提交
</el-button>
</div>
</template>
</el-dialog>
<!-- 修改新闻-->
<el-dialog v-model="editNewsDialogFormVisible" title="修改新闻" width="500px">
<el-form v-model="nowTimeNewsData">
<el-form-item label="所属栏目id" label-width="140px">
<el-input v-model="nowTimeNewsData.categoryId" autocomplete="off" readonly disabled/>
</el-form-item>
<el-form-item label="文章内容" label-width="140px">
<el-input v-model="nowTimeNewsData.content" autocomplete="off" />
</el-form-item>
<!-- <el-form-item label="文章文件" label-width="140px">-->
<!-- <el-input v-model="nowTimeNewsData.file" autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="文章id" label-width="140px">-->
<!-- <el-input v-model="nowTimeNewsData.id" autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标题图片" label-width="140px">-->
<!-- <el-input v-model="nowTimeNewsData.pic" autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="发布时间" label-width="140px">-->
<!-- <el-input v-model="nowTimeNewsData.publishTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
<el-form-item label="浏览次数" label-width="140px">
<el-input v-model="nowTimeNewsData.readingNumber" autocomplete="off" />
</el-form-item>
<el-form-item label="发布状态" label-width="140px">
<el-input v-model="nowTimeNewsData.status" placeholder="1:已发布 2:未发布" autocomplete="off" />
</el-form-item>
<el-form-item label="文章标题" label-width="140px">
<el-input v-model="nowTimeNewsData.title" autocomplete="off" />
</el-form-item>
<!-- <el-form-item label="更新时间" label-width="140px">-->
<!-- <el-input v-model="nowTimeNewsData.updateTime" autocomplete="off" type="date"/>-->
<!-- </el-form-item>-->
<el-form-item label="发布文章的用户id" label-width="140px">
<el-input v-model="nowTimeNewsData.userId" autocomplete="off" readonly disabled/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="addNewsDialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="editNewsContentConfirm">
提交
</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import {queryCategory,deleteCategory,addCategory} from "@/api/user/news.js"
import {ref,onMounted} from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'
import {
queryCategory,
deleteCategory,
addCategory,
addEssay,
queryEssay,
deleteEssay,
editEssay
} from "@/api/user/news.js"
import {ref,reactive,onMounted} from 'vue';
import {ElButton,ElDrawer, ElMessageBox, ElMessage} from 'element-plus'
import useUserStore from "@/store/modules/user";
const userStore = useUserStore()
const drawer = ref(false)
const addFormVisible = ref(false)
//
const column =ref([])
const form = ref(
{
//
const essay = ref([])
//id
const columnId = ref()
const addNewsDialogFormVisible = ref(false)
const editNewsDialogFormVisible = ref(false)
//
const addNewsDialogFormVisibleButton = (id)=>{
addNewsDialogFormVisible.value = true
columnId.value = id
}
const nowTimeNewsData = ref({})
//
const newViews = (listObject)=> {
nowTimeNewsData.value = listObject
}
//
const form = ref({
categoryName:'',
categoryPid:'',
createTime:'',
creatorId:'',
creatorId:userStore.userInfo.id,
id:'',
sort:'',
status:'',
updateTime:''
}
)
const params = ref({
categoryName:form.value.categoryName,
createTime:form.value.createTime,
id:form.value.id
})
//
const newsForm = ref({
categoryId:columnId,
content:'',
file:'',
id:'',
pic:'',
publishTime:'',
readingNumber:'',
status:'',
title:'',
updateTime:'',
userId:userStore.userInfo.id,
})
//
const CategoryList = async () => {
@ -153,18 +299,23 @@ const addFormConfirm = async ()=>{
id:form.value.id,
sort:form.value.sort,
status:form.value.status,
updateTime:form.value.updateTime
updateTime:form.value.updateTime,
}).then(()=>{
CategoryList()
ElMessage({
message:'添加成功',
type:'success'
})
})
}
//
const deleteHandle = async (row)=>{
console.log(row,'row.id')
const deleteHandle = async (id)=>{
await ElMessageBox.confirm('您确定删除这条栏目信息吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await deleteCategory(row.id).then(() => {
await deleteCategory(id).then(() => {
CategoryList() //
ElMessage({
message: '删除成功',
@ -173,12 +324,65 @@ const deleteHandle = async (row)=>{
})
await CategoryList()
}
//
const EssayList = async (id)=>{
const ress = await queryEssay(id)
// console.log(ress.data,'ress')
essay.value = ress.data
// console.log(essay.value,'essay')
}
//
const addNewsContentConfirm = async ()=>{
addNewsDialogFormVisible.value = false
await addEssay({
categoryId:newsForm.value.categoryId,
content:newsForm.value.content,
// file:newsForm.value.file,
// id:newsForm.value.id,
// pic:newsForm.value.pic,
publishTime:newsForm.value.publishTime,
readingNumber:newsForm.value.readingNumber,
status:newsForm.value.status,
title:newsForm.value.title,
updateTime:newsForm.value.updateTime,
userId:newsForm.value.userId
})
}
//
const deleteNewsList = async (id)=>{
// console.log(id)
await deleteEssay(id).then(() => {
EssayList(id) //
ElMessage({
message: '删除成功',
type: 'success',
})
})
}
//
const editNewsList=()=>{
editNewsDialogFormVisible.value = true
}
//
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
})
}
</script>
<style scoped>
.container{
height: 65vh;
}
.header_title{
font-size: 30px;
text-align: center;
@ -211,6 +415,11 @@ const deleteHandle = async (row)=>{
.el-dropdown {
margin-right: 30px;
}
.add-news-button {
margin-top: auto; /* 将按钮推到底部 */
text-align: center; /* 居中按钮 */
width: 100%;
}
.contentTitle{
color: red;
font-size: 30px;
@ -222,12 +431,26 @@ const deleteHandle = async (row)=>{
}
.flex-container {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中*/
flex-direction: row; /* 默认就是 row, */
justify-content: space-between; /* 将内容平均分布,按钮自动靠右 */
align-items: center;
flex-direction: row;
}
.news-flex-container {
display: flex; /* 使用 Flexbox 布局 */
justify-content: space-between; /* 平均分配空间 */
align-items: center; /* 垂直居中对齐 */
}
.news-flex-container p {
flex: 1; /* 平均分配剩余空间 */
text-align: center; /* 文本居中显示 */
}
.flex-container p {
margin-right: 100px;
flex-grow: 1; /* 扩展剩余空间 */
margin-right: 10px; /* 添加一些右侧间距以避免按钮与文本直接接触 */
}
.flex-container .el-button {
margin-left: 20px; /* 将按钮推到最右侧 */
}
.flex-container p:last-child {
margin-right: 0;

Loading…
Cancel
Save