ww 3 months ago
parent b9f8abd1a9
commit db068acb6a
  1. 2
      src/api/stu.js
  2. 62
      src/router/routers.ts
  3. 31
      src/views/home/components/Echarts.vue
  4. 12
      src/views/home/components/Lessonlist.vue
  5. 145
      src/views/home/components/Welcome.vue
  6. 10
      src/views/login/index.vue
  7. 43
      src/views/message/index.vue

@ -1,3 +1,3 @@
export const userStudentListService = (id) => { export const getStuService = (id) => {
return request.post('/api/coursesteacher/studentList?userId=' + id) return request.post('/api/coursesteacher/studentList?userId=' + id)
} }

@ -8,7 +8,20 @@ export const constantRoute: any = [
hidden: false, hidden: false,
icon: 'HomeFilled', // 菜单图标 icon: 'HomeFilled', // 菜单图标
}, },
redirect: '/home', // redirect: '/home',
// children: [
// {
// path: '/home',
// component: () => import('@/views/home/index.vue'),
// name: 'Home',
// meta: {
// title: '个人中心',
// hidden: false,
// icon: 'HomeFilled',
// },
// },
// ],
redirect: '/curriculumCenter/basicCourseInformation',
children: [ children: [
{ {
path: '/home', path: '/home',
@ -127,28 +140,28 @@ export const constantRoute: any = [
}, },
], ],
}, },
{ // {
path: '/groupManagement', // path: '/groupManagement',
component: () => import('@/layout/index.vue'), // component: () => import('@/layout/index.vue'),
name: 'GroupManagement', // name: 'GroupManagement',
meta: { // meta: {
title: '', // title: '',
hidden: false, // hidden: false,
icon: 'HomeFilled', // 菜单图标 // icon: 'HomeFilled', // 菜单图标
}, // },
children: [ // children: [
{ // {
path: '/groupManagement/group', // path: '/groupManagement/group',
component: () => import('@/views/group/index.vue'), // component: () => import('@/views/group/index.vue'),
name: 'Group', // name: 'Group',
meta: { // meta: {
title: '分组', // title: '分组',
hidden: false, // hidden: false,
icon: 'Operation', // icon: 'Operation',
}, // },
}, // },
], // ],
}, // },
{ {
path: '/mssageManagement', path: '/mssageManagement',
component: () => import('@/layout/index.vue'), component: () => import('@/layout/index.vue'),
@ -194,7 +207,8 @@ export const constantRoute: any = [
}, },
{ {
path: '/myCourseStudyManagement/learningProcess1', path: '/myCourseStudyManagement/learningProcess1',
component: () => import('@/views/MyCourseStudy/knowledgeLearningProcess.vue'), component: () =>
import('@/views/MyCourseStudy/knowledgeLearningProcess.vue'),
name: 'LearningProcess1', name: 'LearningProcess1',
meta: { meta: {
title: '知识点学习记录', title: '知识点学习记录',

@ -26,7 +26,9 @@ onMounted(() => {
class="info_container" class="info_container"
style="width: 95%; height: 85%; background: #fff; align-items: center" style="width: 95%; height: 85%; background: #fff; align-items: center"
> >
<conheader :title="`主页访问数据`"></conheader> <div class="info_title">
<div class="title_name">主页访问数据</div>
</div>
<div <div
class="info_content" class="info_content"
style="width: 95%; margin-top: 10px; height: 90%; margin-left: -30px" style="width: 95%; margin-top: 10px; height: 90%; margin-left: -30px"
@ -58,4 +60,31 @@ onMounted(() => {
align-items: bottom; align-items: bottom;
background: #fff; background: #fff;
} }
.info_title {
display: flex;
justify-content: space-between;
width: 100%;
height: 32px;
text-decoration: none;
}
.title_name {
font-family: Inter, Inter;
font-weight: 400;
font-size: 20px;
color: rgba(0, 0, 0, 0.9);
line-height: 30px;
text-align: left;
font-style: normal;
text-transform: none;
}
.icon {
height: 32px;
border-radius: 3px 3px 3px 3px;
display: flex;
text-decoration: none;
font-size: small;
justify-content: center;
align-items: center;
cursor: pointer;
}
</style> </style>

@ -3,7 +3,7 @@ import conheader from '@/views/home/components/ConHeader.vue'
import courseedit from '@/views/course/components/courseEdit.vue' import courseedit from '@/views/course/components/courseEdit.vue'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { userLessonListService, userMaxKnowService } from '@/api/user/user.js' import { userLessonListService } from '@/api/user/user.js'
const userStore = useUserStore() const userStore = useUserStore()
// console.log(userStore.data.id, 'sfa') // console.log(userStore.data.id, 'sfa')
const loading = ref(false) const loading = ref(false)
@ -15,17 +15,9 @@ const getLesList = async () => {
loading.value = false loading.value = false
// console.log(res.data, 'less') // console.log(res.data, 'less')
} }
//
const maxKnow = ref('')
const getmaxKnow = async () => {
const res = await userMaxKnowService(userStore.data.id)
maxKnow.value = res.data
// console.log(res.data.label, 'max')
}
getmaxKnow()
onMounted(() => { onMounted(() => {
getLesList() getLesList()
getmaxKnow()
}) })
</script> </script>
<template> <template>

@ -1,14 +1,15 @@
<script setup> <script setup>
import { onMounted, ref, computed } from 'vue' import { onMounted, ref, computed, onUnmounted, onBeforeUnmount } from 'vue'
import { import {
userChangeService, userChangeService,
userChangePasswordService, userChangePasswordService,
userCodeRegisterService,
} from '@/api/user/user.js' } from '@/api/user/user.js'
// import { defineEmits } from 'vue' // import { defineEmits } from 'vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { ElMessage, dayjs } from 'element-plus' import { ElMessage, dayjs } from 'element-plus'
import { Edit } from '@element-plus/icons-vue'
const props = defineProps({ const props = defineProps({
name: { name: {
type: String, type: String,
@ -36,12 +37,12 @@ const passFormVisible = ref(false)
//dialog //dialog
const form = ref({}) const form = ref({})
const formLabelWidth = '80px' const formLabelWidth = '80px'
//dialog //dialog
form.value = { ...props.userData, code: '' }
const openInfo = () => { const openInfo = () => {
dialogFormVisible.value = true dialogFormVisible.value = true
form.value = { ...props.userData } codeVisible.value = false
// console.log(form.value, 'form') // console.log(form.value, 'form')
} }
const openPass = () => { const openPass = () => {
@ -64,20 +65,21 @@ const checkNewSame = (rule, value, cb) => {
} }
// //
const infoRules = { const infoRules = {
nickName: [
{ required: true, message: '请输入昵称', trigger: 'blur' },
{
max: 10,
min: 1,
message: '昵称长度最小一位最大十位',
trigger: ['change', 'blur'],
},
],
phone: [ phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' }, { required: true, message: '请输入手机号', trigger: 'blur' },
{ {
pattern: /^1[3-9]\d{9}$/, pattern: /^1[3-9]\d{9}$/,
message: '手机号格式不正确', message: '手机号格式不正确',
trigger: 'blur', trigger: ['change', 'blur'],
},
],
nickName: [
{ required: true, message: '请输入昵称', trigger: 'blur' },
{
pattern: /^[\u4e00-\u9fa5a-zA-Z0-9_]{1,10}$/,
message: '昵称格式不正确',
trigger: 'blur',
}, },
], ],
} }
@ -117,15 +119,49 @@ const rules = {
const infoRef = ref() const infoRef = ref()
// //
const emit = defineEmits(['get-message']) const emit = defineEmits(['get-message'])
//
const countdown = ref(0)
//
const codeVisible = ref(false)
//
const toggleVisibility = () => {
codeVisible.value = !codeVisible.value
if (codeVisible.value == true) {
//
form.value.phone = ''
} else {
// 'sample text'
form.value.phone = props.userData.phone //
}
}
//
const toggleInputValue = () => {}
//
const codecode = ref()
const codeSubmit = async () => {
await infoRef.value.validate()
// console.log('')
const phoness = form.value.phone
userCodeRegisterService(phoness)
.then((response) => {
codecode.value = response.data
console.log(codecode.value, 'codecode')
})
.catch((error) => {
console.log(error.message, 'error')
})
}
const changePhone = () => {
codeVisible.value = true
}
const changeInfo = async () => { const changeInfo = async () => {
await infoRef.value.validate() await infoRef.value.validate()
const userInfo = { await userChangeService({
phone: form.value.phone, phone: form.value.phone,
id: form.value.id, id: form.value.id,
nickName: form.value.nickName, nickName: form.value.nickName,
} }).then(() => {
const jsonData = JSON.stringify(userInfo)
await userChangeService(jsonData).then(() => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
emit('get-message', form.value.nickName) emit('get-message', form.value.nickName)
}) })
@ -138,12 +174,11 @@ const cancleInfo = () => {
const userStore = useUserStore() const userStore = useUserStore()
const onSubmit = async () => { const onSubmit = async () => {
await formRef.value.validate() await formRef.value.validate()
const passData = ref({ await userChangePasswordService({
oldPassword: pwdForm.value.old_pwd, oldPassword: pwdForm.value.old_pwd,
newPassword: pwdForm.value.new_pwd, newPassword: pwdForm.value.new_pwd,
username: props.userData.username, username: props.userData.username,
}) })
await userChangePasswordService(passData.value)
.then(() => { .then(() => {
ElMessage.success('密码修改成功') ElMessage.success('密码修改成功')
passFormVisible.value = false passFormVisible.value = false
@ -173,8 +208,22 @@ const flagVisible = ref(true)
// //
const currentDate = new Date() const currentDate = new Date()
const formattedDate = dayjs(currentDate).format('YYYY-MM-DD') const formattedDate = ref()
// const formattedDate = dayjs(currentDate).format('YYYY-MM-DD HH:mm:ss')
// const timer = ref()
//
let timer
const updateCountdown = () => {
if (countdown.value > 0) {
countdown.value--
} else {
clearInterval(timer) //
}
}
onBeforeUnmount(() => {
clearInterval(timer) //
})
onMounted(() => { onMounted(() => {
username.value = props.data.name username.value = props.data.name
const hireDate = new Date(props.data.joinWorkTime) const hireDate = new Date(props.data.joinWorkTime)
@ -182,6 +231,12 @@ onMounted(() => {
// const currentDate = new Date() // const currentDate = new Date()
const millisecondsPerDay = 1000 * 60 * 60 * 24 const millisecondsPerDay = 1000 * 60 * 60 * 24
daysOnJob.value = Math.floor((currentDate - hireDate) / millisecondsPerDay) daysOnJob.value = Math.floor((currentDate - hireDate) / millisecondsPerDay)
let timer = setInterval(() => {
formattedDate.value = dayjs(currentDate).format('YYYY-MM-DD HH:mm:ss')
}, 100)
})
onUnmounted(() => {
clearInterval(timer)
}) })
</script> </script>
<template> <template>
@ -212,7 +267,7 @@ onMounted(() => {
title="登录信息" title="登录信息"
style="width: 800px; text-align: center" style="width: 800px; text-align: center"
> >
<el-form :rules="infoRules" ref="infoRef" :data="form"> <el-form :model="form" :rules="infoRules" ref="infoRef" size="large">
<el-form-item label="用户名" :label-width="formLabelWidth"> <el-form-item label="用户名" :label-width="formLabelWidth">
<el-input :disabled="true" v-model="form.username" autocomplete="off" /> <el-input :disabled="true" v-model="form.username" autocomplete="off" />
</el-form-item> </el-form-item>
@ -220,13 +275,53 @@ onMounted(() => {
<el-input v-model="form.nickName" autocomplete="off" /> <el-input v-model="form.nickName" autocomplete="off" />
</el-form-item> </el-form-item>
<el-form-item label="手机" :label-width="formLabelWidth" prop="phone"> <el-form-item label="手机" :label-width="formLabelWidth" prop="phone">
<el-input v-model="form.phone" autocomplete="off" /> <el-input v-model="form.phone" autocomplete="off" style="width: 92%" />
<el-button
type="primary"
plain
circle
@click="toggleVisibility"
style="margin-left: 2%"
>
<el-icon>
<Edit />
</el-icon>
</el-button>
</el-form-item>
<el-form-item
label="验证码"
:label-width="formLabelWidth"
prop="code"
v-if="codeVisible"
>
<el-input
type="text"
v-model="form.code"
placeholder="请输入验证码"
size="large"
style="width: 84%"
/>
<div class="p" v-if="countdown > 0">
<p>{{ countdown }} </p>
</div>
<el-button
type="primary"
plain
v-if="countdown <= 0"
@click="codeSubmit"
:disabled="countdown > 0"
>
发送验证码
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="cancleInfo">取消</el-button> <el-button @click="cancleInfo">取消</el-button>
<el-button type="primary" @click="changeInfo">确认</el-button> <el-button type="primary" @click="changeInfo, toggleInputValue">
确认
</el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
@ -235,7 +330,7 @@ onMounted(() => {
title="修改密码" title="修改密码"
style="width: 800px; text-align: center" style="width: 800px; text-align: center"
> >
<el-form :rules="rules" ref="formRef" :data="pwdForm"> <el-form :rules="rules" ref="formRef" :model="pwdForm">
<el-form-item label="原密码" prop="old_pwd" :label-width="formLabelWidth"> <el-form-item label="原密码" prop="old_pwd" :label-width="formLabelWidth">
<el-input <el-input
type="password" type="password"
@ -287,7 +382,7 @@ onMounted(() => {
margin-right: 68px; margin-right: 68px;
} }
.intro { .intro {
width: 60%; width: 50%;
height: 22px; height: 22px;
font-family: Inter, Inter; font-family: Inter, Inter;
font-weight: bold; font-weight: bold;

@ -324,9 +324,9 @@ const rules = {
username: [ username: [
{ required: true, message: '用户名不能为空', trigger: 'blur' }, { required: true, message: '用户名不能为空', trigger: 'blur' },
{ {
max: 10, max: 30,
min: 5, min: 5,
message: '用户名长度最小五位最大十位', message: '用户名长度最小五位最大十位',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}, },
], ],
@ -440,7 +440,7 @@ const handleSubmit = async () => {
const codecode = ref() const codecode = ref()
const codeSubmit = async () => { const codeSubmit = async () => {
await form.value.validate() await form.value.validate()
console.log('开始发起注册验证码') // console.log('')
const phoness = formModel.value.phone const phoness = formModel.value.phone
userCodeRegisterService(phoness) userCodeRegisterService(phoness)
.then((response) => { .then((response) => {
@ -491,7 +491,7 @@ const login = async () => {
try { try {
await userStore.userLogin(formModel.value).then(() => { await userStore.userLogin(formModel.value).then(() => {
isBtnLoading.value = false isBtnLoading.value = false
$router.push('/home') $router.push('/curriculumCenter/basicCourseInformation')
if ($route.query.redirect) { if ($route.query.redirect) {
$router.push($route.query.redirect as string) $router.push($route.query.redirect as string)
} else { } else {
@ -515,7 +515,7 @@ const phoneLogin = async () => {
.userPhoneLogin(phones) .userPhoneLogin(phones)
.then(() => { .then(() => {
isBtnLoading.value = false isBtnLoading.value = false
$router.push('/home') $router.push('/curriculumCenter/basicCourseInformation')
if ($route.query.redirect) { if ($route.query.redirect) {
$router.push($route.query.redirect as string) $router.push($route.query.redirect as string)
} else { } else {

@ -1,5 +1,44 @@
<template> <template>
<div>消息</div> <div>
<el-input v-model="inputValue" placeholder="Enter value"></el-input>
<el-button @click="toggleInputValue">切换</el-button>
<el-button @click="handleSubmit">Submit</el-button>
</div>
</template> </template>
<script></script> <script>
import { ref } from 'vue'
export default {
setup() {
//
const inputValue = ref('')
//
const toggleInputValue = () => {
if (inputValue.value) {
//
inputValue.value = ''
} else {
// 'sample text'
inputValue.value = 'sample text' //
}
}
//
const handleSubmit = () => {
console.log('Submitted Value:', inputValue.value)
}
return {
inputValue,
toggleInputValue,
handleSubmit,
}
},
}
</script>
<style>
/* 添加一些样式(如果必要的话) */
</style>

Loading…
Cancel
Save