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)
}

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

@ -26,7 +26,9 @@ onMounted(() => {
class="info_container"
style="width: 95%; height: 85%; background: #fff; align-items: center"
>
<conheader :title="`主页访问数据`"></conheader>
<div class="info_title">
<div class="title_name">主页访问数据</div>
</div>
<div
class="info_content"
style="width: 95%; margin-top: 10px; height: 90%; margin-left: -30px"
@ -58,4 +60,31 @@ onMounted(() => {
align-items: bottom;
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>

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

@ -1,14 +1,15 @@
<script setup>
import { onMounted, ref, computed } from 'vue'
import { onMounted, ref, computed, onUnmounted, onBeforeUnmount } from 'vue'
import {
userChangeService,
userChangePasswordService,
userCodeRegisterService,
} from '@/api/user/user.js'
// import { defineEmits } from 'vue'
import useUserStore from '@/store/modules/user'
import { useRouter } from 'vue-router'
import { ElMessage, dayjs } from 'element-plus'
import { Edit } from '@element-plus/icons-vue'
const props = defineProps({
name: {
type: String,
@ -36,12 +37,12 @@ const passFormVisible = ref(false)
//dialog
const form = ref({})
const formLabelWidth = '80px'
//dialog
form.value = { ...props.userData, code: '' }
const openInfo = () => {
dialogFormVisible.value = true
form.value = { ...props.userData }
codeVisible.value = false
// console.log(form.value, 'form')
}
const openPass = () => {
@ -64,20 +65,21 @@ const checkNewSame = (rule, value, cb) => {
}
//
const infoRules = {
nickName: [
{ required: true, message: '请输入昵称', trigger: 'blur' },
{
max: 10,
min: 1,
message: '昵称长度最小一位最大十位',
trigger: ['change', 'blur'],
},
],
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{
pattern: /^1[3-9]\d{9}$/,
message: '手机号格式不正确',
trigger: 'blur',
},
],
nickName: [
{ required: true, message: '请输入昵称', trigger: 'blur' },
{
pattern: /^[\u4e00-\u9fa5a-zA-Z0-9_]{1,10}$/,
message: '昵称格式不正确',
trigger: 'blur',
trigger: ['change', 'blur'],
},
],
}
@ -117,15 +119,49 @@ const rules = {
const infoRef = ref()
//
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 () => {
await infoRef.value.validate()
const userInfo = {
await userChangeService({
phone: form.value.phone,
id: form.value.id,
nickName: form.value.nickName,
}
const jsonData = JSON.stringify(userInfo)
await userChangeService(jsonData).then(() => {
}).then(() => {
ElMessage.success('修改成功')
emit('get-message', form.value.nickName)
})
@ -138,12 +174,11 @@ const cancleInfo = () => {
const userStore = useUserStore()
const onSubmit = async () => {
await formRef.value.validate()
const passData = ref({
await userChangePasswordService({
oldPassword: pwdForm.value.old_pwd,
newPassword: pwdForm.value.new_pwd,
username: props.userData.username,
})
await userChangePasswordService(passData.value)
.then(() => {
ElMessage.success('密码修改成功')
passFormVisible.value = false
@ -173,8 +208,22 @@ const flagVisible = ref(true)
//
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(() => {
username.value = props.data.name
const hireDate = new Date(props.data.joinWorkTime)
@ -182,6 +231,12 @@ onMounted(() => {
// const currentDate = new Date()
const millisecondsPerDay = 1000 * 60 * 60 * 24
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>
<template>
@ -212,7 +267,7 @@ onMounted(() => {
title="登录信息"
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-input :disabled="true" v-model="form.username" autocomplete="off" />
</el-form-item>
@ -220,13 +275,53 @@ onMounted(() => {
<el-input v-model="form.nickName" autocomplete="off" />
</el-form-item>
<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>
<template #footer>
<div class="dialog-footer">
<el-button @click="cancleInfo">取消</el-button>
<el-button type="primary" @click="changeInfo">确认</el-button>
<el-button type="primary" @click="changeInfo, toggleInputValue">
确认
</el-button>
</div>
</template>
</el-dialog>
@ -235,7 +330,7 @@ onMounted(() => {
title="修改密码"
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-input
type="password"
@ -287,7 +382,7 @@ onMounted(() => {
margin-right: 68px;
}
.intro {
width: 60%;
width: 50%;
height: 22px;
font-family: Inter, Inter;
font-weight: bold;

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

@ -1,5 +1,44 @@
<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>
<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