Merge branch 'develoop' of http://182.92.169.222:3000/dlsx/Teaching_integration_platform_template into develoop
commit
01c6188528
13 changed files with 509 additions and 150 deletions
@ -1,23 +1,81 @@ |
||||
<template> |
||||
<div class="footer"> |
||||
<h1>FOOTER</h1> |
||||
<ul> |
||||
<li> |
||||
系统标题: |
||||
{{ adminInfoStore.info.title }} |
||||
|
||||
</li><el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
版权信息: |
||||
{{ adminInfoStore.info.copyrightInformation }} |
||||
|
||||
</li> <el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
备案号: |
||||
{{ adminInfoStore.info.recordNumber }} |
||||
|
||||
</li> <el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
qq: |
||||
{{ adminInfoStore.info.qqNumber }} |
||||
|
||||
</li><el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
邮箱: |
||||
{{ adminInfoStore.info.mailbox }} |
||||
|
||||
</li> <el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
电话: |
||||
{{ adminInfoStore.info.phone }} |
||||
|
||||
</li> |
||||
<li> |
||||
地址: |
||||
{{ adminInfoStore.info.address }} |
||||
</li> |
||||
<el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
<el-image style="width: 50px; height: 50px" :src="adminInfoStore.info.qrCode" fit="cover" /> |
||||
</li> |
||||
<el-divider direction="vertical" border-style="dashed" /> |
||||
<li> |
||||
备案信息: |
||||
{{ adminInfoStore.info.recordInformation }} |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import {} from 'vue' |
||||
import useAdminInfoStore from '@/store/module/adminInfo' |
||||
const adminInfoStore = useAdminInfoStore() |
||||
console.log(adminInfoStore); |
||||
|
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.footer { |
||||
// position: fixed; |
||||
// bottom: 0; |
||||
height: 300px; |
||||
width: 100%; |
||||
background-color: #252527; |
||||
height: 300px; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
color: #fff; |
||||
|
||||
ul { |
||||
width: 600px; |
||||
height: 200px; |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
align-items: center; |
||||
justify-content: center; |
||||
color: #ccc; |
||||
font-family:'Courier New', Courier, monospace; |
||||
// background: linear-gradient(white,#38495a); |
||||
// background-clip: text; |
||||
// color: transparent; |
||||
} |
||||
|
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,71 @@ |
||||
import request from '@/utils/requset' |
||||
import { ElLoading, ElMessage } from 'element-plus' |
||||
|
||||
|
||||
enum Api { |
||||
get系统配置 = '/api/systemSettings/save', |
||||
|
||||
} |
||||
// 提示批量处理
|
||||
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 getSysSettingApi() { |
||||
return request.get(Api.get系统配置) |
||||
} |
||||
export const proxGetSysSettingApi = proxrequest(getSysSettingApi) |
||||
|
||||
|
||||
export const userGetInfoService = (token: any) => |
||||
request.get('/api/user/info', { |
||||
headers: { Authorization: `Bearer ${token}` }, |
||||
}) |
||||
|
||||
|
||||
//获取学生列表
|
||||
export const userStudentListService = (id) => { |
||||
return request.post('/api/coursesteacher/studentList?userId=' + id) |
||||
} |
||||
|
||||
|
||||
// 获取课程列表
|
||||
type CourseListParams = { |
||||
'assessmenttype': string, |
||||
'category'?: string, |
||||
'isAsc'?: boolean, |
||||
'name'?: string, |
||||
'nature'?: string, |
||||
'pageNo'?: number, |
||||
'pageSize'?: number, |
||||
'sortBy'?: string, |
||||
'teacher'?: string, |
||||
'username'?: string, |
||||
} |
||||
export const getCourseListApi = (params: CourseListParams) => { |
||||
return request.get('/api/coursesteacher/page', { |
||||
params, |
||||
}) |
||||
} |
||||
|
||||
// 根据id获取课程详情
|
||||
export const getCourseDetailApi = (id: string) => { |
||||
return request.get(`/api/coursesteacher/${id}`) |
||||
} |
After Width: | Height: | Size: 4.0 KiB |
@ -0,0 +1,33 @@ |
||||
import { defineStore } from 'pinia' |
||||
import { reactive } from 'vue'; |
||||
import { getSysSettingApi } from '@/api/configuration'; |
||||
|
||||
|
||||
const useAdminInfoStore = defineStore('adminInfo', () => { |
||||
const info = reactive({ |
||||
address: '', |
||||
copyrightInformation: '', |
||||
id: '', |
||||
loginAddress: '', |
||||
logo: 'http://teaching-edu123.oss-cn-beijing.aliyuncs.com/eVAnKnTrHVMTVyr_2up5S.png', |
||||
name: '', |
||||
phone: '', |
||||
promotionalImages: 'http://teaching-edu123.oss-cn-beijing.aliyuncs.com/eEnQCDAMwwAm66pgZJh6K.jpg', |
||||
qqNumber: '', |
||||
qrCode: '', |
||||
recordNumber: '', |
||||
title: '', |
||||
mailbox: '', |
||||
home: '', |
||||
recordInformation: '' |
||||
}) |
||||
function upAdminInfo() { |
||||
getSysSettingApi().then(res => { |
||||
if (res.code === 200) Object.assign(info, res.data) |
||||
}) |
||||
} |
||||
upAdminInfo() |
||||
|
||||
return { info } |
||||
}) |
||||
export default useAdminInfoStore |
@ -0,0 +1,24 @@ |
||||
import { defineStore } from 'pinia' |
||||
import { ref } from 'vue'; |
||||
import { getCourseDetailApi } from '@/api/configuration'; |
||||
|
||||
|
||||
|
||||
const useLearnPathStore = defineStore('learnPath', () => { |
||||
let item = sessionStorage.getItem('learnPath:itemData') |
||||
let course = sessionStorage.getItem('learnPath:courseData') |
||||
if (item) item = JSON.parse(item) |
||||
if (course) course = JSON.parse(course) |
||||
const itemData = ref<Record<string, any>>(item as {} || {}) |
||||
const courseData = ref<Record<string, any>>(course as {} || {}) |
||||
function setCourseData(item: any) { |
||||
courseData.value = item |
||||
sessionStorage.setItem('learnPath:itemData', JSON.stringify(item)) |
||||
getCourseDetailApi(item.id).then(res => { |
||||
courseData.value = res.data |
||||
sessionStorage.setItem('learnPath:courseData', JSON.stringify(res.data)) |
||||
}) |
||||
} |
||||
return { setCourseData, itemData, courseData } |
||||
}) |
||||
export default useLearnPathStore |
@ -1,19 +1,40 @@ |
||||
import { defineStore } from 'pinia' |
||||
const userStore = defineStore('userStore', { |
||||
state() { |
||||
return { |
||||
token: '', |
||||
import { userGetInfoService } from '@/api/configuration' |
||||
import { ref, reactive } from 'vue' |
||||
const userStore = defineStore('userStore', () => { |
||||
const userInfo = reactive<any>({}) |
||||
const isLogin = ref(false) |
||||
const token = ref('eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ4aWFvMTExMSIsImNyZWF0ZWQiOjE3MjQ2NTQxNjMxMjIsImV4cCI6MTcyNTI1ODk2M30.uIEZhGG6-XGomV0aqpamOn54VxP4ItfM_ip9EgI0ohcYPyEnln6dXBoG8eVBNlbigglIjw5V1N5bHPdIAifeaA') |
||||
|
||||
userGetInfoService(token.value).then(res => { |
||||
// @ts-ignore
|
||||
if (res.code === 200) { |
||||
Object.assign(userInfo, res.data) |
||||
isLogin.value = true |
||||
} |
||||
}, |
||||
actions: { |
||||
async verifyToken(token:string){ |
||||
const res = await verifyTokenApi({token}) |
||||
if(res){ |
||||
this.token = token |
||||
}else{ |
||||
return false |
||||
} |
||||
} |
||||
}, |
||||
}) |
||||
return { |
||||
token, |
||||
userInfo, |
||||
isLogin |
||||
} |
||||
}) |
||||
export default userStore |
||||
// const userStore = defineStore('userStore', {
|
||||
// state() {
|
||||
// return {
|
||||
// token: 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ4aWFvMTExMSIsImNyZWF0ZWQiOjE3MjQ2NTQxNjMxMjIsImV4cCI6MTcyNTI1ODk2M30.uIEZhGG6-XGomV0aqpamOn54VxP4ItfM_ip9EgI0ohcYPyEnln6dXBoG8eVBNlbigglIjw5V1N5bHPdIAifeaA',
|
||||
// }
|
||||
// },
|
||||
// actions: {
|
||||
// async verifyToken(token:string){
|
||||
// const res = await verifyTokenApi({token})
|
||||
// if(res){
|
||||
// this.token = token
|
||||
// }else{
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// })
|
||||
// export default userStore
|
||||
|
@ -0,0 +1,80 @@ |
||||
<script setup lang="ts"> |
||||
import defImg from '@/assets/images/default.png' |
||||
import useUserStore from '@/store/module/user'; |
||||
const userStore = useUserStore() |
||||
import { ref, watch } from 'vue'; |
||||
import { userStudentListService } from '@/api/configuration'; |
||||
const loading = ref(false) |
||||
const stuList: any = ref([]) |
||||
const getStuList = async () => { |
||||
loading.value = true |
||||
const res = await userStudentListService(userStore.userInfo.id) |
||||
stuList.value = res.data |
||||
loading.value = false |
||||
} |
||||
|
||||
watch(() => userStore.userInfo.id, () => { |
||||
getStuList() |
||||
}) |
||||
if(userStore.userInfo.id) getStuList() |
||||
</script> |
||||
|
||||
<template> |
||||
<div class="stu-list"> |
||||
<div class="stu_content" v-loading="loading"> |
||||
<ul> |
||||
<li class="stu-item" v-for="(item, index) in stuList" :key="index"> |
||||
<img :src="item.icon || defImg" class="stu-item-img" /> |
||||
<div class="stu-item-info"> |
||||
<h4 style="font-weight: bold">{{ item.name }}</h4> |
||||
<h4 style="color: #666">{{ item.number }}</h4> |
||||
</div> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<style lang="scss" scoped> |
||||
.stu_content { |
||||
height: 86%; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
font-family: 'Microsoft YaHei'; |
||||
|
||||
/* background-color: rgb(100, 100, 64); */ |
||||
.stu-item { |
||||
margin-top: 20px; |
||||
/* height: 100%; */ |
||||
/* border-radius: 10px; */ |
||||
/* background-color: #0080ff; */ |
||||
border-bottom: 1px solid #ededed; |
||||
/* border-radius: 10px; */ |
||||
/* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */ |
||||
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.07); |
||||
display: flex; |
||||
padding: 5px; |
||||
/* margin: 10px; */ |
||||
justify-content: space-between; |
||||
} |
||||
|
||||
.stu-item-img { |
||||
background-color: yellow; |
||||
border-radius: 50%; |
||||
width: 40px; |
||||
height: 40px; |
||||
justify-content: center; |
||||
align-items: center; |
||||
} |
||||
|
||||
.stu-item-info { |
||||
/* margin-left: 15px; */ |
||||
width: 80%; |
||||
height: 40px; |
||||
background-color: #ffffff; |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: space-between; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue