diff --git a/src/api/stu.js b/src/api/stu.js new file mode 100644 index 0000000..89953f6 --- /dev/null +++ b/src/api/stu.js @@ -0,0 +1,3 @@ +export const userStudentListService = (id) => { + return request.post('/api/coursesteacher/studentList?userId=' + id) +} diff --git a/src/api/user/user.js b/src/api/user/user.js index 94c9e29..ca3abff 100644 --- a/src/api/user/user.js +++ b/src/api/user/user.js @@ -25,6 +25,7 @@ export const userPhoneRegisterService = (jsonData) => { export const userCodeRegisterService = (phoness) => { return request.post('/api/user/code?phone=' + phoness) } + //用户信息接口 export const userGetInfoService = (token) => request.get('/api/user/info', { @@ -46,3 +47,34 @@ export const userIdenChangeService = (dataToSend) => { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, }) } +//修改密码 +export const userChangePasswordService = (dataToSend) => { + return request.post('/api/user/updatePassword', dataToSend) +} + +//获取排名靠前的课程 +export const userToplessonService = () => request.get('#') +//获取最新收藏的课程 +export const userNewLikeService = (id) => { + return request.post('/api/course_favour/newCollect?userId=' + id) +} +//获取学生列表 +export const userStudentListService = (id) => { + return request.post('/api/coursesteacher/studentList?userId=' + id) +} +//获取课程列表 +export const userLessonListService = (id) => { + return request.post('/api/courselearingrecord/courseList?userId=' + id) +} +//获取浏览量 +export const userLookService = () => { + return request.get('/api/report/receptionBrowse') +} +//获取图表 +export const userPicService = () => { + return request.get('/api/report/browseStatistics') +} +//获取学习最多的知识点 +export const userMaxKnowService = (id) => { + return request.post('/api/knowledgelearning/studyMaxKnowledge?userId=' + id) +} diff --git a/src/assets/images/default.png b/src/assets/images/default.png new file mode 100644 index 0000000..e16488e Binary files /dev/null and b/src/assets/images/default.png differ diff --git a/src/assets/images/fe.jpg b/src/assets/images/fe.jpg new file mode 100644 index 0000000..ff9e1ba Binary files /dev/null and b/src/assets/images/fe.jpg differ diff --git a/src/layout/tabbar/setting/index.vue b/src/layout/tabbar/setting/index.vue index 6d134b2..a6182ff 100644 --- a/src/layout/tabbar/setting/index.vue +++ b/src/layout/tabbar/setting/index.vue @@ -12,11 +12,22 @@ + + @@ -37,12 +48,16 @@ // import { useDark, useToggle } from '@vueuse/core' import useLayoutSettingStoe from '@/store/modules/setting' import useUserStore from '@/store/modules/user' +import { onMounted } from 'vue' import { useRouter, useRoute } from 'vue-router' +// import default from '@/assets/images/default.jpg' +import defImg from '@/assets/images/default.png' // import { Moon, Sunny } from '@element-plus/icons-vue' const useStore = useLayoutSettingStoe() const userStore = useUserStore() const $router = useRouter() const $route = useRoute() + // 全屏方法 const fullScreen = () => { let full = document.fullscreenElement @@ -56,7 +71,6 @@ const fullScreen = () => { const refresh = () => { useStore.refresh = !useStore.refresh } - // 用户下拉框事件 const handleCommand = (command: string) => { switch (command) { @@ -65,18 +79,28 @@ const handleCommand = (command: string) => { break } } +//跳转链接 +const openWeb = (url, name) => { + window.open(url, name, '_blank') +} + +//用户头像 +onMounted(() => { + userStore.getUserInfo() + console.log(userStore.data.icon, 'icon') +}) + const logout = () => { console.log($route) - userStore.logout() $router.push({ path: '/login', query: { redirect: $route.path }, }) } + // import IconEpSunny from '~icons/ep/sunny'; // import IconEpMoon from '~icons/ep/moon'; - // const isDark = useDark() // const toggleDark = () => useToggle(isDark) diff --git a/src/setting.ts b/src/setting.ts index acf187d..7734acc 100644 --- a/src/setting.ts +++ b/src/setting.ts @@ -3,4 +3,7 @@ export default { title: '教学一体化后台', //项目标题 logo: '/public/vite.svg', //项目logo logoHidden: true, // logo隐藏设置 + 'files.associations': { + '*.vue': 'html', + }, } diff --git a/src/store/index.ts b/src/store/index.ts index 68dd922..5fee903 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,9 +1,9 @@ // 引入仓库 import { createPinia } from 'pinia' -import persist from 'pinia-plugin-persistedstate' +// import persist from 'pinia-plugin-persistedstate' // 创建仓库 const pinia = createPinia() // 暴露仓库 -pinia.use(persist) +// pinia.use(persist) export default pinia -export * from './modules/user' +// export * from './modules/user' diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index a93760b..214a405 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,5 @@ // 创建用户相关的仓库 import { defineStore } from 'pinia' -// 引入登录接口 -// import { reqLogin, getUserInfo } from '@/api/user/index' // 引入登录参数类型 import { loginType } from '@/api/user/types' // 引入ElementPlus通知插件 @@ -21,137 +19,108 @@ import { userIdenService, } from '@/api/user/user.js' -const useUserStore = defineStore( - 'User', - { - // @ts-expect-error - - state: (): LoginStoreType => { - return { - token: GET_TKOEN('TOKEN') || '', - menuRoutes: constantRoute, //存储生成菜单路由数据 - userName: '', // 用户姓名 - avatar: '', // 用户头像 - routes: '', - phone: '', - userInfo: {}, // 当前用户相关信息 - data: {}, +const useUserStore = defineStore('User', { + // @ts-expect-error + state: (): LoginStoreType => { + return { + token: GET_TKOEN('TOKEN') || '', + menuRoutes: constantRoute, //存储生成菜单路由数据 + userName: '', // 用户姓名 + avatar: '', // 用户头像 + routes: '', + phone: '', + userInfo: {}, // 当前用户相关信息 + data: {}, + } + }, + actions: { + // 登录事件 + async userLogin(data: any) { + // console.log(data, 'pinia') + const res: any = await userLoginService(data).catch((error) => { + ElMessage.error(error.response.data.message) + // console.log(error, 'error') + }) + if (res.code === 200) { + this.token = res.data.token as string + SET_TKOEN('TOKEN', this.token) + // localStorage.setItem('TOKEN', this.token) + ElNotification({ + type: 'success', + message: '登录成功!', + title: `Hi ${getTime()}!`, + }) + return 'ok' + } else { + // ElNotification({ + // // type: 'error', + // message: res.message, + // }) + ElMessage.error(res.message) + return Promise.reject(new Error(res.data.message)) } }, - actions: { - // 登录事件 - async userLogin(data: any) { - // console.log(data, 'pinia') - const res: any = await userLoginService(data).catch((error) => { - ElMessage.error(error.response.data.message) - console.log(error, 'error') + //手机号登录 + async userPhoneLogin(data: loginType) { + const res: any = await userPhoneLoginService(data) + // console.log(res, 11111) + if (res.code === 200) { + this.token = res.data.token as string //接收返回的token + // @ts-expect-error + SET_TKOEN('TOKEN', this.token) + // localStorage.setItem('TOKEN', this.token) + ElNotification({ + type: 'success', + message: '登录成功!', + title: `Hi ${getTime()}!`, }) - - if (res.code === 200) { - // @ts-expect-error - this.token = res.data.token as string - // @ts-expect-error - - SET_TKOEN('TOKEN', this.token) - // localStorage.setItem('TOKEN', this.token) - ElNotification({ - type: 'success', - message: '登录成功!', - title: `Hi ${getTime()}!`, - }) - return 'ok' - } else { - // ElNotification({ - // // type: 'error', - // message: res.message, - // }) - ElMessage.error(res.message) - return Promise.reject(new Error(res.data.message)) - } - }, - //手机号登录 - async userPhoneLogin(data: loginType) { - const res: any = await userPhoneLoginService(data) - console.log(res, 11111) - if (res.code === 200) { - // @ts-expect-error - - this.token = res.data.token as string //接收返回的token - // @ts-expect-error - - SET_TKOEN('TOKEN', this.token) - // localStorage.setItem('TOKEN', this.token) - ElNotification({ - type: 'success', - message: '登录成功!', - title: `Hi ${getTime()}!`, - }) - return 'ok' - } else { - ElNotification({ - type: 'error', - message: res.message, - }) - return Promise.reject(new Error(res.data.message)) - } - }, - // 获取用户信息事件 - async getUserInfo() { - const result: any = await userGetInfoService(GET_TKOEN('TOKEN')) - if (result.code === 200) { - const res = await userIdenService(result.data.id) - console.log(res, 'huonghu') - - // @ts-expect-error - console.log(res.data, 'res.data') - - this.userInfo = res.data - console.log(this.userInfo, 'this.userInfo') - // @ts-expect-error - - this.data = result.data - console.log(result, '123') - // @ts-expect-error - - this.userName = result.data.username - // this.avatar = result.data.checkUser.avatar - // @ts-expect-error - - this.routes = result.data.permissions - return { - result, - } - } else { - return Promise.reject('登录过期') + return 'ok' + } else { + ElNotification({ + type: 'error', + message: res.message, + }) + return Promise.reject(new Error(res.data.message)) + } + }, + // 获取用户信息 + async getUserInfo() { + const result: any = await userGetInfoService(GET_TKOEN('TOKEN')) + if (result.code === 200) { + console.log(result, 'result') + const res = await userIdenService(result.data.id) + // console.log(res, 'res') + this.userInfo = res.data + // console.log(this.userInfo, 'this.userInfo') + this.data = result.data + // console.log(result, '123') + this.userName = result.data.username + // this.avatar = result.data.checkUser.avatar + this.routes = result.data.permissions + return { + result, } - }, - // 退出登录事件 - logout() { - const usePermissionStore = permissionStore() - console.log(usePermissionStore) - // 清除token - REMOVE_TOKEN('TOKEN'), - // ;(this.userName = ''), (this.avatar = '') - // @ts-expect-error - - (this.userName = ''), - // @ts-expect-error - - (this.avatar = '') + } else { + return Promise.reject('登录过期') + } + }, + // 退出登录事件 + logout() { + const usePermissionStore = permissionStore() + // console.log(usePermissionStore) + // 清除token + REMOVE_TOKEN('TOKEN'), + // ;(this.userName = ''), (this.avatar = '') // @ts-expect-error - - this.token = '' + (this.userName = ''), // @ts-expect-error - - this.routes = '' - usePermissionStore.removeRouter() - location.reload() - }, + (this.avatar = '') + this.token = '' + this.routes = '' + usePermissionStore.removeRouter() + location.reload() }, - getters: {}, - }, - { - persist: true, // 持久化 }, -) + getters: {}, +}) export default useUserStore diff --git a/src/views/course/CourseObjectives.vue b/src/views/course/CourseObjectives.vue index b463672..133301b 100644 --- a/src/views/course/CourseObjectives.vue +++ b/src/views/course/CourseObjectives.vue @@ -18,7 +18,6 @@ const route = useRoute() const router = useRouter() // id : 分目标id // targetId : 选中的分类 - const targetList = ref([ { label: '课程目标一', diff --git a/src/views/course/components/KnowledgeGraphUi/AddOrEdit copy.vue b/src/views/course/components/KnowledgeGraphUi/AddOrEdit copy.vue index 3780716..cc16136 100644 --- a/src/views/course/components/KnowledgeGraphUi/AddOrEdit copy.vue +++ b/src/views/course/components/KnowledgeGraphUi/AddOrEdit copy.vue @@ -1,213 +1,253 @@ - \ No newline at end of file + diff --git a/src/views/course/components/KnowledgeGraphUi/FoldAdd.vue b/src/views/course/components/KnowledgeGraphUi/FoldAdd.vue index eb77aad..09e0b36 100644 --- a/src/views/course/components/KnowledgeGraphUi/FoldAdd.vue +++ b/src/views/course/components/KnowledgeGraphUi/FoldAdd.vue @@ -1,4 +1,54 @@ diff --git a/src/views/course/components/KnowledgeGraphUi/FoldEdit.vue b/src/views/course/components/KnowledgeGraphUi/FoldEdit.vue index 7e5fcd4..b716d29 100644 --- a/src/views/course/components/KnowledgeGraphUi/FoldEdit.vue +++ b/src/views/course/components/KnowledgeGraphUi/FoldEdit.vue @@ -1,72 +1,101 @@ - \ No newline at end of file + diff --git a/src/views/course/components/KnowledgeGraphUi/foldInfoUi.vue b/src/views/course/components/KnowledgeGraphUi/foldInfoUi.vue index 823b067..be5c4da 100644 --- a/src/views/course/components/KnowledgeGraphUi/foldInfoUi.vue +++ b/src/views/course/components/KnowledgeGraphUi/foldInfoUi.vue @@ -2,7 +2,15 @@
+<<<<<<< HEAD + @@ -22,10 +30,26 @@
本章资源
+<<<<<<< HEAD + + +======= +>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05 删除 @@ -39,7 +63,15 @@
+<<<<<<< HEAD +
+=======
+>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
{{ ind + 1 }}
@@ -53,10 +85,26 @@
+<<<<<<< HEAD + + +======= +>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05 删除
@@ -177,7 +225,9 @@ const MyBtn = { $line: 1px dashed #d9d9d9; .left { - width: calc($title-icon-width + $title--icon-m-r + $title-index-width / 2); + width: calc( + $title-icon-width + $title--icon-m-r + $title-index-width / 2 + ); border-right: $line; } @@ -188,7 +238,7 @@ const MyBtn = { width: 100%; .structure-item-titile-box { - &>* { + & > * { padding-left: 42px; } @@ -258,7 +308,11 @@ const MyBtn = { gap: 38px; flex-wrap: wrap; +<<<<<<< HEAD + & > * { +======= &>* { +>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05 border: 1px solid #0052d9; font-weight: bold; font-size: 12px; @@ -309,6 +363,29 @@ const MyBtn = { cursor: pointer; &:hover { +<<<<<<< HEAD + background: linear-gradient( + 128deg, + lighten($color-start, 5%) 0%, + lighten($color-end, 5%) 100% + ); + } + + &:active { + background: linear-gradient( + 128deg, + darken($color-start, 10%) 0%, + darken($color-end, 10%) 100% + ); + } + + &:disabled { + background: linear-gradient( + 128deg, + lighten($color-start, 20%) 0%, + lighten($color-end, 20%) 100% + ); +======= background: linear-gradient(128deg, lighten($color-start, 5%) 0%, lighten($color-end, 5%) 100%); @@ -324,6 +401,7 @@ const MyBtn = { background: linear-gradient(128deg, lighten($color-start, 20%) 0%, lighten($color-end, 20%) 100%); +>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05 } } diff --git a/src/views/course/courseChapters.vue b/src/views/course/courseChapters.vue index f329982..e53fe59 100644 --- a/src/views/course/courseChapters.vue +++ b/src/views/course/courseChapters.vue @@ -1,4 +1,12 @@ diff --git a/src/views/home/components/ConHeader.vue b/src/views/home/components/ConHeader.vue index c5161af..58710e8 100644 --- a/src/views/home/components/ConHeader.vue +++ b/src/views/home/components/ConHeader.vue @@ -1,31 +1,38 @@ diff --git a/src/views/home/components/Echart/Echarts.vue b/src/views/home/components/Echart/Echarts.vue index af7d72a..c54a51b 100644 --- a/src/views/home/components/Echart/Echarts.vue +++ b/src/views/home/components/Echart/Echarts.vue @@ -1,8 +1,18 @@ @@ -16,14 +40,22 @@ defineProps(['sum']) display: flex; flex-direction: column; justify-content: space-between; + margin-bottom: 20px; + /* justify-content: flex-start; */ } -.echarts { +/* .echarts { background: #ffffff; box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1); border-radius: 6px 6px 6px 6px; - margin-bottom: 16px; + display: flex; - justify-content: center; + justify-content: start; align-items: center; +} */ +.info_content { + display: flex; + justify-content: start; + align-items: bottom; + background: #fff; } diff --git a/src/views/home/components/Info keep.vue b/src/views/home/components/Info keep.vue deleted file mode 100644 index d0c638b..0000000 --- a/src/views/home/components/Info keep.vue +++ /dev/null @@ -1,287 +0,0 @@ - - - diff --git a/src/views/home/components/Info.vue b/src/views/home/components/Info.vue deleted file mode 100644 index 05f4894..0000000 --- a/src/views/home/components/Info.vue +++ /dev/null @@ -1,156 +0,0 @@ - - - diff --git a/src/views/home/components/Lessonlist.vue b/src/views/home/components/Lessonlist.vue new file mode 100644 index 0000000..8824686 --- /dev/null +++ b/src/views/home/components/Lessonlist.vue @@ -0,0 +1,128 @@ + + + + diff --git a/src/views/home/components/Status.vue b/src/views/home/components/Status.vue index db53eda..bdeea9b 100644 --- a/src/views/home/components/Status.vue +++ b/src/views/home/components/Status.vue @@ -1,126 +1,132 @@ diff --git a/src/views/home/components/Student1.vue b/src/views/home/components/Student1.vue index 3c4e29a..f538d09 100644 --- a/src/views/home/components/Student1.vue +++ b/src/views/home/components/Student1.vue @@ -1,79 +1,110 @@ diff --git a/src/views/home/components/Welcome.vue b/src/views/home/components/Welcome.vue index d984815..5527d7c 100644 --- a/src/views/home/components/Welcome.vue +++ b/src/views/home/components/Welcome.vue @@ -1,5 +1,14 @@ - - diff --git a/src/views/home/components/myDrawer/index.vue b/src/views/home/components/myDrawer/index.vue deleted file mode 100644 index 4f8cae9..0000000 --- a/src/views/home/components/myDrawer/index.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 59116ea..1d3d82b 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,41 +1,65 @@ diff --git a/src/views/login/index.vue b/src/views/login/index.vue index db2c982..bb60908 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -281,20 +281,11 @@ + -const collectData = () => { - // 在这里可以收集Dialog中的其他可修改字段的数据 - // ... + diff --git a/src/views/student/login.vue b/src/views/student/login.vue deleted file mode 100644 index 89bfa2a..0000000 --- a/src/views/student/login.vue +++ /dev/null @@ -1,68 +0,0 @@ - - -