lijiaqi 3 months ago
commit 0cf6e42287
  1. 2
      src/api/stu.js
  2. 24
      src/api/user/stud.js
  3. 9
      src/api/user/user.js
  4. 2
      src/layout/tabbar/setting/index.vue
  5. 62
      src/router/routers.ts
  6. 52
      src/views/course/basicCourseInformation.vue
  7. 34
      src/views/course/components/courseEdit.vue
  8. 35
      src/views/home/components/Echarts.vue
  9. 45
      src/views/home/components/Lessonlist.vue
  10. 148
      src/views/home/components/Status.vue
  11. 4
      src/views/home/components/Student1.vue
  12. 226
      src/views/home/components/Welcome.vue
  13. 63
      src/views/home/index.vue
  14. 10
      src/views/login/index.vue
  15. 437
      src/views/student/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)
} }

@ -0,0 +1,24 @@
import request from '@/utils/request'
//分页查询
export const stuPageService = (params) => {
// console.log(params, 'params')
return request.get(
`/api/studentManage/page?name=${params.name}&number=${params.number}&page=${params.page}&pageSize=${params.pagesize}&userId=${params.id}`,
)
}
//获取学生
export const stuListService = (id) => {
return request.get(`/api/studentManage/${id}`)
}
//删除和批量删除学生
export const delStuListService = (ids) => {
return request.delete(`/api/studentManage/batchDelete?ids=${ids}`)
}
//重置学生密码
export const reStuPassService = (ids) => {
return request.put(`/api/studentManage/initialPassword?ids=${ids}`)
}
//重置学生密码
export const changeStaService = (status, id) => {
return request.post(`/api/studentManage/status/${status}?id=${id}`)
}

@ -32,10 +32,11 @@ export const userGetInfoService = (token) =>
headers: { Authorization: `Bearer ${token}` }, headers: { Authorization: `Bearer ${token}` },
}) })
//修改用户信息 //修改用户信息
export const userChangeService = (jsonData) => { export const userChangeService = (params) => {
return request.post('/api/user/update', jsonData, { // return request.post('/api/user/update', jsonData, {
headers: { 'Content-Type': 'application/json;charset=UTF-8' }, // headers: { 'Content-Type': 'application/json;charset=UTF-8' },
}) // })
return request.post(`/api/user/update/PersonalInfo`, params)
} }
//获取个人信息 //获取个人信息
export const userIdenService = (id) => { export const userIdenService = (id) => {

@ -16,7 +16,7 @@
size="small" size="small"
icon="Link" icon="Link"
circle circle
@click="openWeb('http://www.baidu.com/', 'baidu')" @click="openWeb('https://www.baidu.com', 'baidu')"
/> />
<img <img
:src="userStore.data.icon || defImg" :src="userStore.data.icon || defImg"

@ -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: '知识点学习记录',

@ -97,6 +97,7 @@ const onAddCourse = () => {
flog.value = false flog.value = false
drawer.value.open({}) drawer.value.open({})
} }
const flog = ref(false) const flog = ref(false)
// //
const onEditCourse = (item: any) => { const onEditCourse = (item: any) => {
@ -208,7 +209,11 @@ const CloseCouresNameChangeEvent = () => {
</el-form> </el-form>
<div class="course"> <div class="course">
<ul class="course_list"> <ul class="course_list">
<li v-if="userStore.userInfo.roleId[0] === '1'" @click="onAddCourse()" class="add_course"> <li
v-if="userStore.userInfo.roleId[0] === '1'"
@click="onAddCourse()"
class="add_course"
>
<div class="plus"> <div class="plus">
<el-icon class="avatar-uploader-icon"> <el-icon class="avatar-uploader-icon">
<Plus /> <Plus />
@ -217,8 +222,17 @@ const CloseCouresNameChangeEvent = () => {
<h2 class="course_name">{{ course_name }}</h2> <h2 class="course_name">{{ course_name }}</h2>
</li> </li>
<li v-for="item in courseList" :key="item.id"> <li v-for="item in courseList" :key="item.id">
<img title="点击查看课程详情" :src="item.img" alt="" @click="onGetCourseObject(item.id)" /> <img
<h2 title="点击查看课程基本信息" class="course_name" @click="onEditCourse(item)"> title="点击查看课程详情"
:src="item.img"
alt=""
@click="onGetCourseObject(item.id)"
/>
<h2
title="点击查看课程基本信息"
class="course_name"
@click="onEditCourse(item)"
>
{{ item.name }} {{ item.name }}
</h2> </h2>
<p class="teacher_name">讲师{{ item.teacher }}</p> <p class="teacher_name">讲师{{ item.teacher }}</p>
@ -231,19 +245,36 @@ const CloseCouresNameChangeEvent = () => {
<el-icon class="del" @click="onDeleteCourse(item.id)"> <el-icon class="del" @click="onDeleteCourse(item.id)">
<Delete /> <Delete />
</el-icon> </el-icon>
<el-button class="object" round plain @click="onGetCourseObject(item.id)"> <el-button
class="object"
round
plain
@click="onGetCourseObject(item.id)"
>
查看课程详情 查看课程详情
</el-button> </el-button>
</li> </li>
</ul> </ul>
</div> </div>
<el-pagination v-model:current-page="params.pageNo" v-model:page-size="params.pageSize" <el-pagination
:page-sizes="[2, 5, 7, 10]" :background="true" layout="jumper,total, sizes, prev, pager, next " :total="total" v-model:current-page="params.pageNo"
@size-change="handleSizeChange" @current-change="handleCurrentChange" v-model:page-size="params.pageSize"
style="margin-top: 10px; justify-content: center" /> :page-sizes="[2, 5, 7, 10]"
:background="true"
layout="jumper,total, sizes, prev, pager, next "
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="margin-top: 10px; justify-content: center"
/>
</div> </div>
<course-edit ref="drawer" @success="onSuccess" @couresNameChange="couresNameChangeEvent" <course-edit
@CloseCouresNameChange="CloseCouresNameChangeEvent" :flog="flog"></course-edit> ref="drawer"
@success="onSuccess"
@couresNameChange="couresNameChangeEvent"
@CloseCouresNameChange="CloseCouresNameChangeEvent"
:flog="flog"
></course-edit>
</div> </div>
</div> </div>
</template> </template>
@ -289,7 +320,6 @@ const CloseCouresNameChangeEvent = () => {
} }
.course { .course {
// display: flex; // display: flex;
// flex: 0 0 25%; // flex: 0 0 25%;
// justify-content: space-between; // justify-content: space-between;

@ -243,11 +243,20 @@ const upload = async (option: any) => {
</script> </script>
<template> <template>
<el-drawer :before-close="handleClose" v-model="visibleDrawer" direction="rtl" <el-drawer
:title="formModel.id ? '编辑课程' : '添加课程'"> :before-close="handleClose"
v-model="visibleDrawer"
direction="rtl"
:title="formModel.id ? '编辑课程' : '添加课程'"
>
<el-form :model="formModel" :rules="rules" ref="formRef"> <el-form :model="formModel" :rules="rules" ref="formRef">
<el-form-item label="课程封面" prop="img"> <el-form-item label="课程封面" prop="img">
<el-upload v-model="formModel.img" class="avatar-uploader" :http-request="upload" :show-file-list="false"> <el-upload
v-model="formModel.img"
class="avatar-uploader"
:http-request="upload"
:show-file-list="false"
>
<img v-if="imgUrl" :src="imgUrl" class="avatar" /> <img v-if="imgUrl" :src="imgUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"> <el-icon v-else class="avatar-uploader-icon">
<Plus /> <Plus />
@ -286,8 +295,12 @@ const upload = async (option: any) => {
</el-upload> --> </el-upload> -->
</el-form-item> </el-form-item>
<el-form-item label="课程名称" prop="name"> <el-form-item label="课程名称" prop="name">
<el-input :disabled="nameDisabled" style="width: 200px" v-model="formModel.name" <el-input
@input="courseNameInput"></el-input> :disabled="nameDisabled"
style="width: 200px"
v-model="formModel.name"
@input="courseNameInput"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="课程类别" prop="category"> <el-form-item label="课程类别" prop="category">
<el-radio-group v-model="formModel.category"> <el-radio-group v-model="formModel.category">
@ -303,13 +316,20 @@ const upload = async (option: any) => {
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="课程编码" prop="code"> <el-form-item label="课程编码" prop="code">
<el-input style="width: 200px" v-model="formModel.code" :disabled="codeDisabled"></el-input> <el-input
style="width: 200px"
v-model="formModel.code"
:disabled="codeDisabled"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="课程学分" prop="credit"> <el-form-item label="课程学分" prop="credit">
<el-input style="width: 200px" v-model="formModel.credit"></el-input> <el-input style="width: 200px" v-model="formModel.credit"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="课程学时" prop="classhours"> <el-form-item label="课程学时" prop="classhours">
<el-input style="width: 200px" v-model="formModel.classhours"></el-input> <el-input
style="width: 200px"
v-model="formModel.classhours"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="考核类型" prop="assessmenttype"> <el-form-item label="考核类型" prop="assessmenttype">
<el-radio-group v-model="formModel.assessmenttype"> <el-radio-group v-model="formModel.assessmenttype">

@ -16,8 +16,8 @@ onMounted(() => {
// lastMonthBrowseList.value = res.data.lastMonthBrowseList // lastMonthBrowseList.value = res.data.lastMonthBrowseList
// thisMonthBrowseList.value = res.data.thisMonthBrowseList // thisMonthBrowseList.value = res.data.thisMonthBrowseList
count.value = res.data count.value = res.data
console.log(res.data, 'echart11') // console.log(res.data, 'echart11')
console.log(count.value, 'echart') // console.log(count.value, 'echart')
}) })
}) })
</script> </script>
@ -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,10 @@ 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 { useRouter } from 'vue-router'
import { userLessonListService } from '@/api/user/user.js'
import courseEdit from '@/views/course/components/courseEdit.vue'
const router = useRouter()
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 +18,28 @@ const getLesList = async () => {
loading.value = false loading.value = false
// console.log(res.data, 'less') // console.log(res.data, 'less')
} }
// const onGetCourseObject = async (id) => {
const maxKnow = ref('') router.push({
const getmaxKnow = async () => { path: '/curriculumCenter/courseDetails',
const res = await userMaxKnowService(userStore.data.id) query: {
maxKnow.value = res.data id: id,
// console.log(res.data.label, 'max') },
})
}
const drawer = ref()
const flog = ref(false)
const onEditCourse = (item) => {
flog.value = true
console.log(item, 'item')
drawer.value.open(item)
}
const onSuccess = () => {
loading.value = true
getLesList()
loading.value = false
} }
getmaxKnow()
onMounted(() => { onMounted(() => {
getLesList() getLesList()
getmaxKnow()
}) })
</script> </script>
<template> <template>
@ -44,14 +58,22 @@ onMounted(() => {
<img <img
:src="item.img" :src="item.img"
style="width: 100%; height: 125px; border-radius: 10px 10px 0px 0px" style="width: 100%; height: 125px; border-radius: 10px 10px 0px 0px"
@click="onGetCourseObject(item.id)"
/> />
</div> </div>
<div class="lessonlist-item-info"> <div class="lessonlist-item-info">
<h3>{{ item.name }}</h3> <h3 @click="onGetCourseObject(item.id)">{{ item.name }}</h3>
<div class="p"><p>编辑</p></div> <div class="p" @click="onEditCourse(item)"><p>编辑</p></div>
</div> </div>
</div> </div>
</div> </div>
<course-edit
ref="drawer"
@success="onSuccess"
@couresNameChange="couresNameChangeEvent"
@CloseCouresNameChange="CloseCouresNameChangeEvent"
:flog="flog"
></course-edit>
</div> </div>
<courseedit @click="open"></courseedit> <courseedit @click="open"></courseedit>
</template> </template>
@ -102,6 +124,7 @@ onMounted(() => {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-bottom: 5px; margin-bottom: 5px;
cursor: pointer;
} }
.lessonlist-item-info .p { .lessonlist-item-info .p {
/* font-size: 14px; /* font-size: 14px;

@ -2,7 +2,7 @@
import add from '@/assets/images/add.png' import add from '@/assets/images/add.png'
// import tool from '@/utils/oss.js' // import tool from '@/utils/oss.js'
import { userChangeService } from '@/api/user/user.js' import { userChangeService } from '@/api/user/user.js'
import { ref, defineEmits, onMounted } from 'vue' import { ref, defineEmits, onMounted, reactive } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Edit } from '@element-plus/icons-vue' import { Edit } from '@element-plus/icons-vue'
import { tool, client } from '@/utils/alioss.js' import { tool, client } from '@/utils/alioss.js'
@ -19,7 +19,16 @@ const props = defineProps({
const imageUrl = ref() const imageUrl = ref()
// //
imageUrl.value = props.data.icon imageUrl.value = props.data.icon
// console.log(props.data.username, 'img') // console.log(props.userData, 'img')
const beforeUpload = (file) => {
const validImageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp']
if (!validImageTypes.includes(file.type)) {
ElMessage.error('请上传图片')
return false
}
return true
}
// //
const upload = async (option) => { const upload = async (option) => {
const res = await tool.oss.upload(option.file) const res = await tool.oss.upload(option.file)
@ -28,10 +37,9 @@ const upload = async (option) => {
// console.log(imageUrl.value, 'img') // console.log(imageUrl.value, 'img')
} }
// //
const emit = defineEmits(['get-avater']) const emit = defineEmits(['get-avater', 'getInfo'])
let isUploading = ref(false) let isUploading = ref(false)
const changeInfo = async () => { const changeInfo = async () => {
// console.log('', imageUrl.value)
if (!isUploading.value) { if (!isUploading.value) {
isUploading.value = true isUploading.value = true
const userInfo = { const userInfo = {
@ -49,23 +57,48 @@ const changeInfo = async () => {
isUploading.value = false isUploading.value = false
} }
} }
// onMounted(() => {
// console.log(props.data.icon, 'props.icon')
// })
// //
const dialog = ref(false) const dialog = ref(false)
const radio = ref(3)
const form = ref({}) const formLabelWidth = '68px'
const form = ref({
name: '',
sex: '',
emergencyContact: '',
nationality: '',
professionalTitle: '',
politicalStatus: '',
profession: '',
education: '',
academicDegree: '',
})
form.value = { ...props.userData } form.value = { ...props.userData }
// console.log(props.userData, '')
// console.log(form.value, '')
form.value.sex === '男' ? 0 : 1
const value = ref('')
value.value = form.value.politicalStatus
const openInfo = () => { const openInfo = () => {
dialog.value = true dialog.value = true
} }
const onCancel = () => { const onCancel = () => {
dialog.value = false dialog.value = false
} }
const onsubmit = async () => {} //
const formLabelWidth = '60px' const onSubmit = async () => {
const loading = ref(false) // const jsonData = JSON.stringify(form.value)
console.log(form.value, 'jj')
await userChangeService(form).then(() => {
ElMessage.success('修改成功')
console.log(form.value, 'aaaa')
emit('getInfo', form.value)
dialog.value = false
})
}
</script> </script>
<template> <template>
<div class="ident" style="width: 100%; height: 100%; background: #375fff"> <div class="ident" style="width: 100%; height: 100%; background: #375fff">
@ -81,9 +114,10 @@ const loading = ref(false)
</div> </div>
<el-upload <el-upload
class="click" class="click"
:http-request="upload"
:show-file-list="false" :show-file-list="false"
auto-upload="false" auto-upload="false"
:before-upload="beforeUpload"
:http-request="upload"
> >
<img :src="add" /> <img :src="add" />
</el-upload> </el-upload>
@ -101,25 +135,88 @@ const loading = ref(false)
<el-drawer v-model="dialog" title="个人信息" class="demo-drawer"> <el-drawer v-model="dialog" title="个人信息" class="demo-drawer">
<div class="content"> <div class="content">
<el-form :model="form"> <el-form :model="form">
<el-form-item label="姓名" :label-width="formLabelWidth"> <el-form-item label="姓名" :label-width="formLabelWidth" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input> <el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="性别" :label-width="formLabelWidth"> <el-form-item label="性别" :label-width="formLabelWidth" prop="sex">
<el-radio-group v-model="radio"> <el-radio-group v-model="form.sex">
<el-radio :value="3"></el-radio> <el-radio value="男"></el-radio>
<el-radio :value="6"></el-radio> <el-radio value="女"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="民族" :label-width="formLabelWidth"> <el-form-item
<el-input v-model="form.email" autocomplete="off"></el-input> label="手机号"
:label-width="formLabelWidth"
prop="emergencyContact"
>
<el-input
v-model="form.emergencyContact"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item
label="民族"
:label-width="formLabelWidth"
prop="nationality"
>
<el-input v-model="form.nationality" autocomplete="off"></el-input>
</el-form-item>
<el-form-item
label="职位"
:label-width="formLabelWidth"
prop="professionalTitle"
>
<el-input
v-model="form.professionalTitle"
autocomplete="off"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号" :label-width="formLabelWidth"> <el-form-item
<el-input v-model="form.phone" autocomplete="off"></el-input> label="政治面貌"
:label-width="formLabelWidth"
prop="politicalStatus"
>
<el-select v-model="form.politicalStatus">
<el-option :label="'中共党员'" :value="'中共党员'" />
<el-option :label="'中共预备党员'" :value="'中共预备党员'" />
<el-option :label="'共青团员'" :value="'共青团员'" />
<el-option :label="'群众'" :value="'群众'" />
</el-select>
</el-form-item>
<el-form-item
label="专业"
:label-width="formLabelWidth"
prop="profession"
>
<el-input v-model="form.profession" autocomplete="off"></el-input>
</el-form-item>
<el-form-item
label="学历"
:label-width="formLabelWidth"
prop="education"
>
<el-select v-model="form.education">
<el-option :label="'专科'" :value="'专科'" />
<el-option :label="'本科'" :value="'本科'" />
<el-option :label="'硕士研究生'" :value="'硕士研究生'" />
<el-option :label="'博士研究生'" :value="'博士研究生'" />
</el-select>
</el-form-item>
<el-form-item
label="学位"
:label-width="formLabelWidth"
prop="academicDegree"
>
<el-select v-model="form.academicDegree">
<el-option :label="'学士'" :value="'专科'" />
<el-option :label="'硕士'" :value="'硕士'" />
<el-option :label="'博士'" :value="'博士'" />
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="footer"> <div class="footer">
<el-button @click="onCancel">取消</el-button> <el-button @click="onCancel">取消</el-button>
<el-button type="primary" :loading="loading" @click="onsubmit"> <el-button type="primary" :loading="loading" @click="onSubmit">
确认 确认
</el-button> </el-button>
</div> </div>
@ -179,7 +276,7 @@ const loading = ref(false)
} }
.footer { .footer {
display: flex; display: flex;
justify-content: space-around; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 20px; margin-top: 20px;
} }
@ -230,4 +327,7 @@ span {
margin-left: 65px; margin-left: 65px;
margin-top: -50px; margin-top: -50px;
} }
/* .el-form el-form--default el-form--label-right {
height: 500px;
} */
</style> </style>

@ -34,7 +34,7 @@ getStuList()
<li class="stu-item" v-for="(item, index) in stuList" :key="index"> <li class="stu-item" v-for="(item, index) in stuList" :key="index">
<img :src="item.icon || defImg" class="stu-item-img" /> <img :src="item.icon || defImg" class="stu-item-img" />
<div class="stu-item-info"> <div class="stu-item-info">
<h4>{{ item.name }}</h4> <h4 style="font-weight: bold">{{ item.name }}</h4>
<h4 style="color: #666">{{ item.number }}</h4> <h4 style="color: #666">{{ item.number }}</h4>
</div> </div>
</li> </li>
@ -95,7 +95,7 @@ getStuList()
} }
h4 { h4 {
margin-left: 15px; margin-left: 15px;
font-weight: bold; /* font-weight: bold; */
font-size: 14px; font-size: 14px;
font-family: Inter, Inter; font-family: Inter, Inter;
/* font-weight: 400; */ /* font-weight: 400; */

@ -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, Back } from '@element-plus/icons-vue'
const props = defineProps({ const props = defineProps({
name: { name: {
type: String, type: String,
@ -33,23 +34,23 @@ const pwdForm = ref({
const dialogFormVisible = ref(false) const dialogFormVisible = ref(false)
// //
const passFormVisible = ref(false) 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: '', newphone: '' }
const openInfo = () => { const openInfo = () => {
dialogFormVisible.value = true dialogFormVisible.value = true
form.value = { ...props.userData } change.value = true
// console.log(form.value, 'form') // console.log(form.value, 'form')
} }
const openPass = () => { const openPass = () => {
passFormVisible.value = true passFormVisible.value = true
pwdForm.value = {}
} }
// //
const checkOldSame = (rule, value, callback) => { const checkOldSame = (rule, value, callback) => {
if (value === props.userData.password) { if (value === pwdForm.value.old_pwd) {
callback(new Error('新密码不能与旧密码相同')) callback(new Error('新密码不能与旧密码相同'))
} else { } else {
callback() callback()
@ -57,28 +58,44 @@ const checkOldSame = (rule, value, callback) => {
} }
const checkNewSame = (rule, value, cb) => { const checkNewSame = (rule, value, cb) => {
if (value !== pwdForm.value.new_pwd) { if (value !== pwdForm.value.new_pwd) {
cb(new Error('新密码和确认再次输入的新密码不一样!')) cb(new Error('新密码和确认再次输入的新密码不一样'))
} else {
cb()
}
}
const checkOldPhone = (rule, value, cb) => {
if (value === form.value.phone) {
cb(new Error('新手机号与旧手机号相同'))
} else { } else {
cb() 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: [ newphone: [
{ required: true, message: '请输入昵称', trigger: 'blur' },
{ {
pattern: /^[\u4e00-\u9fa5a-zA-Z0-9_]{1,10}$/, pattern: /^1[3-9]\d{9}$/,
message: '昵称格式不正确', message: '手机号格式不正确',
trigger: 'blur', trigger: ['change', 'blur'],
}, },
{ validator: checkOldPhone, trigger: 'blur' },
], ],
} }
// //
@ -117,17 +134,86 @@ const rules = {
const infoRef = ref() const infoRef = ref()
// //
const emit = defineEmits(['get-message']) const emit = defineEmits(['get-message'])
const change = ref(true)
//
const countdown = ref(0)
//
//
const phoneValue = form.value.phone
const toggleVisibility = () => {
// console.log('change')
change.value = false
}
//
const codecode = ref()
const codeSubmit = async () => {
await infoRef.value.validate()
// console.log('')
const phoness = form.value.newphone
userCodeRegisterService(phoness)
.then((response) => {
codecode.value = response.data
console.log(codecode.value, 'codecode')
})
.catch((error) => {
console.log(error.message, 'error')
})
}
// console.log(change.value == true, 'toggleVisibility.value == false')
// if (toggleVisibility.value == 'false') {
// console.log(' false')
// } else {
// console.log('')
// }
const changeInfo = async () => { const changeInfo = async () => {
await infoRef.value.validate() await infoRef.value.validate()
const userInfo = { if (change.value === true) {
// console.log(form.value.phone, '')
await userChangeService({
phone: form.value.phone,
id: form.value.id,
nickName: form.value.nickName,
}).then(() => {
ElMessage.success('修改成功')
emit('get-message', form.value.nickName)
form.value.newphone = ''
form.value.code = ''
})
dialogFormVisible.value = false
} else {
if (codecode.value === form.value.code) {
// console.log(form.value.newphone, '')
// console.log('')
await userChangeService({
phone: form.value.newphone,
id: form.value.id,
nickName: form.value.nickName,
}).then(() => {
ElMessage.success('修改成功')
form.value.phone = form.value.newphone
emit('get-phone', form.value.phone)
form.value.newphone = ''
form.value.code = ''
})
dialogFormVisible.value = false
} else {
ElMessage.error('验证码错误')
}
}
}
//
const pwdRef = ref()
const changePassword = async () => {
await pwdRef.value.validate()
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)
form.value.newphone = ''
form.value.code = ''
}) })
dialogFormVisible.value = false dialogFormVisible.value = false
} }
@ -138,18 +224,17 @@ 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
}) })
.catch((error) => { .catch((error) => {
console.log(error, 'error') // console.log(error, 'error')
ElMessage.error(error.response.data.message) ElMessage.error(error.response.data.message)
}) })
pwdForm.value = {} pwdForm.value = {}
@ -173,8 +258,31 @@ const flagVisible = ref(true)
// //
const currentDate = new Date() const currentDate = new Date()
const formattedDate = dayjs(currentDate).format('YYYY-MM-DD') const formattedDate = ref()
let currentTime = ref(new Date().toLocaleString())
// 使 setInterval
let timer1 = setInterval(() => {
currentTime.value = new Date().toLocaleString()
}, 1000)
//
onUnmounted(() => {
clearInterval(timer1)
})
//
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 +290,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')
}, 1000)
})
onUnmounted(() => {
clearInterval(timer)
}) })
</script> </script>
<template> <template>
@ -205,14 +319,21 @@ onMounted(() => {
修改密码 修改密码
</el-button> </el-button>
</div> </div>
<div class="time">{{ formattedDate }}</div> <div class="time">{{ currentTime }}</div>
</div> </div>
<el-dialog <el-dialog
v-model="dialogFormVisible" v-model="dialogFormVisible"
title="登录信息" title="登录信息"
style="width: 800px; text-align: center" style="width: 800px; text-align: center"
> >
<el-form :rules="infoRules" ref="infoRef" :data="form"> <!-- <div v-if="change"> -->
<el-form
:model="form"
:rules="infoRules"
ref="infoRef"
size="large"
v-if="change"
>
<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,9 +341,60 @@ 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>
<el-form :model="form" :rules="infoRules" ref="infoRef" size="large" v-else>
<el-form-item>
<el-icon style="margin-left: 20px" size="large" @click="change = true">
<Back />
</el-icon>
</el-form-item>
<el-form-item
label="新手机号"
:label-width="formLabelWidth"
prop="newphone"
>
<el-input
v-model="form.newphone"
autocomplete="off"
placeholder="请输入新手机号"
/>
</el-form-item>
<el-form-item label="验证码" :label-width="formLabelWidth" prop="code">
<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>
<!-- </div> -->
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="cancleInfo">取消</el-button> <el-button @click="cancleInfo">取消</el-button>
@ -235,7 +407,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 +459,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;

@ -15,7 +15,7 @@ import {
userMaxKnowService, userMaxKnowService,
} from '@/api/user/user' } from '@/api/user/user'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import fe from '@/assets/images/fe.jpg' // import fe from '@/assets/images/fe.jpg'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
// import { Picture } from 'element-plus/icons-vue' // import { Picture } from 'element-plus/icons-vue'
@ -35,11 +35,21 @@ const name = ref()
const getMessage = (msg) => { const getMessage = (msg) => {
name.value = msg name.value = msg
} }
const getPhone = (phone) => {
// console.log(msg, 'msg')
userStore.data.phone = phone
// console.log(data.value.icon, 'icon')
}
const getAvater = (avater) => { const getAvater = (avater) => {
// console.log(msg, 'msg') // console.log(msg, 'msg')
userStore.data.icon = avater userStore.data.icon = avater
// console.log(data.value.icon, 'icon') // console.log(data.value.icon, 'icon')
} }
const getInfo = (info) => {
console.log(userStore.userInfo, 'msg')
userStore.userInfo = info
// console.log(userStore.userData, 'icon111')
}
const courselist = ref([]) const courselist = ref([])
const img = ref() const img = ref()
const courseName = ref() const courseName = ref()
@ -74,8 +84,11 @@ onMounted(() => {
// }) // })
// //
userNewLikeService(userStore.data.id).then((res) => { userNewLikeService(userStore.data.id).then((res) => {
console.log(res.data, '最新收藏的课程') loading.value = true
// console.log(res.data, '')
courselist.value = res.data courselist.value = res.data
loading.value = false
// console.log(courselist.value.id, 'course') // console.log(courselist.value.id, 'course')
// img.value = res.data.img // img.value = res.data.img
// courseName.value = res.data.name // courseName.value = res.data.name
@ -96,6 +109,7 @@ onMounted(() => {
:userData="data" :userData="data"
:name="name" :name="name"
@get-message="getMessage" @get-message="getMessage"
@get-phone="getPhone"
v-if="flag" v-if="flag"
></welcome> ></welcome>
</div> </div>
@ -113,6 +127,7 @@ onMounted(() => {
:data="data" :data="data"
:userData="infoData" :userData="infoData"
@get-avater="getAvater" @get-avater="getAvater"
@getInfo="getInfo"
v-if="flag" v-if="flag"
></status> ></status>
</div> </div>
@ -165,12 +180,12 @@ onMounted(() => {
</a> </a>
<div class="con"> <div class="con">
<ul> <ul>
<li class="lessonlist-item" v-for="item in 4" :key="item"> <li class="lessonlist-item" v-for="(item, index) in 4" :key="item">
<img :src="fe" class="lessonlist-item-img" /> <!-- <img :src="fe" class="lessonlist-item-img" /> -->
<div class="lessonlist-item-info"> <div class="lessonlist-item-info">
<p>{{ index + 1 }}</p>
<h5>课程名称</h5> <h5>课程名称</h5>
<p>教师</p>
</div> </div>
</li> </li>
</ul> </ul>
@ -178,7 +193,7 @@ onMounted(() => {
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="lesson" v-loading="loading"> <div class="lesson">
<a <a
href="#" href="#"
style="width: 90%; font-size: 12px; display: flex; margin: 0 auto" style="width: 90%; font-size: 12px; display: flex; margin: 0 auto"
@ -189,13 +204,15 @@ onMounted(() => {
<ul> <ul>
<li <li
class="lessonlist-item" class="lessonlist-item"
v-for="item in courselist" v-for="(item, index) in courselist"
:key="item.id" :key="item.id"
v-loading="loading"
> >
<img :src="item.img || fe" class="lessonlist-item-img" /> <!-- <img :src="item.img || fe" class="lessonlist-item-img" /> -->
<div class="lessonlist-item-info"> <div class="lessonlist-item-info">
<h5>{{ item.name }}</h5> <p>{{ index + 1 }}</p>
<p>{{ item.teacher }}</p> <h5>{{ item.name || '暂无' }}</h5>
<!-- <p>{{ item.teacher }}</p> -->
</div> </div>
</li> </li>
</ul> </ul>
@ -250,9 +267,9 @@ onMounted(() => {
background-color: pink; background-color: pink;
padding-top: 30px; padding-top: 30px;
// padding-bottom: 30px; // padding-bottom: 30px;
padding: 30px 10px 0px 10px; padding: 25px 10px 0px 10px;
margin-bottom: 16px; margin-bottom: 16px;
height: 317px; height: 312px;
background: #ffffff; background: #ffffff;
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
border-radius: 6px 6px 6px 6px; border-radius: 6px 6px 6px 6px;
@ -282,8 +299,17 @@ onMounted(() => {
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
margin: 5px 10px; margin: 5px 10px;
border: 2px solid #ccc; // border: 2px solid #ccc;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
width: 40%; width: 40%;
padding: 0px 15px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.button :hover {
overflow: visible;
white-space: normal;
} }
a { a {
text-decoration: none; text-decoration: none;
@ -341,14 +367,17 @@ ul {
height: 40px; height: 40px;
background-color: #ffffff; background-color: #ffffff;
display: flex; display: flex;
flex-direction: column; // flex-direction: column;
justify-content: space-between; justify-content: space-between;
// align-items: flex-start; align-items: center;
h3 { h5 {
font-weight: bold; // font-weight: bold;
width: 80%;
text-align: center;
} }
p { p {
font-size: small; font-size: small;
width: 20%;
color: #a0a5ab; color: #a0a5ab;
} }
} }

@ -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,63 +1,184 @@
<script setup> <script setup>
import { Search, Edit, Delete } from '@element-plus/icons-vue' import { Search, Edit, Delete } from '@element-plus/icons-vue'
import { ref } from 'vue' import { ref, onMounted } from 'vue'
const tableData = [ import {
{ stuListService,
date: '2016-05-03', stuPageService,
name: 'Tom', delStuListService,
state: 'California', reStuPassService,
city: 'Los Angeles', changeStaService,
address: 'No. 189, Grove St, Los Angeles', } from '@/api/user/stud'
zip: 'CA 90036', import { ElMessage, ElMessageBox } from 'element-plus'
tag: 'Home', import useUserStore from '@/store/modules/user'
}, const userStore = useUserStore()
{ // console.log(userStore.data.id, 'icon') //
date: '2016-05-02', const formLabelWidth = '60px'
name: 'Tom', const tableData = ref([])
state: 'California', //
city: 'Los Angeles', const isFirstLoad = ref(true)
address: 'No. 189, Grove St, Los Angeles', const params = ref({
zip: 'CA 90036', page: 1,
tag: 'Office', pagesize: 3,
}, id: userStore.data.id,
{ name: '',
date: '2016-05-04', number: '',
name: 'Tom', })
state: 'California',
city: 'Los Angeles', //
address: 'No. 189, Grove St, Los Angeles', const getData = async () => {
zip: 'CA 90036', loading.value = true
tag: 'Home', await stuPageService(params.value).then((res) => {
}, tableData.value = res.data.Records
{ // console.log(tableData.value, 'params')
date: '2016-05-01', loading.value = false
name: 'Tom', console.log(res.data, 'res.data')
state: 'California', isFirstLoad.value = false
city: 'Los Angeles', })
address: 'No. 189, Grove St, Los Angeles', }
zip: 'CA 90036',
tag: 'Office', //
}, // const getData = async () => {
{ // // id.value = userStore.data.id
date: '2016-05-01', // // console.log(id.value, 'id.value')
name: 'Tom', // stuListService(2).then((res) => {
state: 'California', // tableData.value = res.data
city: 'Los Angeles', // console.log(res.data, 'res.data')
address: 'No. 189, Grove St, Los Angeles', // })
zip: 'CA 90036', // }
tag: 'Office', //
}, const onSizeChange = (size) => {
{ //访
date: '2016-05-01', loading.value = true
name: 'Tom', params.value.page = 1
state: 'California', params.value.pagesize = size
city: 'Los Angeles', //
address: 'No. 189, Grove St, Los Angeles', getData()
zip: 'CA 90036', loading.value = false
tag: 'Office', }
}, //
] const onCurrentChange = (page) => {
params.value.page = page
getData()
}
//
const onReset = () => {
params.value.page = 1
getData()
}
//
const onSearch = () => {
params.value.pagenum = 1
// getArticleService()
}
const loading = ref(false) const loading = ref(false)
//
const drawer = ref(false)
//
const editTable = (row) => {
drawer.value = true
console.log(row)
}
//
const delTable = async (row) => {
console.log(row.userId, 'delrow')
await ElMessageBox.confirm('您确定删除这条学生信息吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await delStuListService(row.userId).then(() => {
ElMessage({
message: '删除成功',
type: 'success',
})
})
getData()
}
//
const selectedIds = ref([])
function handleSelectionChange(selection) {
selectedIds.value = selection.map((row) => row.userId)
console.log(selectedIds.value, 'selectedIds.value')
}
const onDel = async () => {
await ElMessageBox.confirm('您确定删除这些学生信息吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await delStuListService(selectedIds.value).then(() => {
ElMessage({
message: '删除成功',
type: 'success',
})
})
getData()
}
//
const onResetPass = async () => {
await ElMessageBox.confirm('您确定重置这些学生密码吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await reStuPassService(selectedIds.value).then(() => {
ElMessage({
message: '重置成功',
type: 'success',
})
})
getData()
}
//
const status = ref()
async function handleStatusChange(row) {
status.value = row.status
// console.log(status.value, 'status')
// console.log(`: ${row.status}`)
// if (!isFirstLoad.value) {
// await changeStaService(status.value, row.userId).then(() => {
// ElMessage({
// message: '',
// type: 'success',
// })
// })
// }
// getData()
}
//
const studentId = ref()
const searchNumber = async () => {
params.value.number = studentId.value
console.log(params.value.number, 'params.value.number')
await stuPageService(params.value).then((res) => {
params.value.page = 1
console.log(res, 'change')
})
// getData()
}
//
const studentName = ref()
const searchInfo = async () => {
params.value.name = studentName.value
console.log(params.value.name, 'params.value.number')
await stuPageService(params.value).then((res) => {
params.value.page = 1
console.log(res, 'change')
})
// getData()
}
function clearInput() {
studentId.value = ''
}
function clearInput1() {
studentName.value = ''
}
const changeStatus = async (row) => {}
onMounted(() => {
getData()
})
</script> </script>
<template> <template>
<page-container title="文章分类"> <page-container title="文章分类">
@ -65,21 +186,43 @@ const loading = ref(false)
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>学生信息</span> <span>学生信息</span>
<el-button type="primary">重置密码</el-button> <div>
<el-button type="primary" @click="onResetPass">重置密码</el-button>
<el-button type="danger" @click="onDel">批量删除</el-button>
</div>
</div> </div>
</template> </template>
<div class="content"> <div class="content">
<el-form style="display: flex"> <el-form style="display: flex">
<el-form-item style="width: 250px"> <el-form-item style="width: 250px">
<el-input class="input_search"></el-input> <!-- <p>学号</p> -->
<el-input
class="input_search"
v-model="studentId"
@blur="clearInput"
></el-input>
<el-icon><Search /></el-icon>
</el-form-item>
<el-button class="btn_search" @click="searchNumber">
学号搜索
</el-button>
<el-form-item style="width: 250px; margin-left: 30px">
<el-input
class="input_search"
@blur="clearInput1"
v-model="studentName"
></el-input>
<el-icon><Search /></el-icon> <el-icon><Search /></el-icon>
</el-form-item> </el-form-item>
<el-button class="btn_search">搜索</el-button> <el-button class="btn_search" @click="searchInfo">搜索</el-button>
<el-button type="primary" @click="onReset">重置</el-button>
</el-form> </el-form>
<el-table <el-table
class="tableBox" class="tableBox"
:data="tableData" :data="tableData"
v-loading="loading" v-loading="loading"
@selection-change="handleSelectionChange"
:header-cell-style="{ :header-cell-style="{
background: '#FAFAFA', background: '#FAFAFA',
color: '#666', color: '#666',
@ -103,21 +246,47 @@ const loading = ref(false)
style="width: 100%" style="width: 100%"
> >
<el-table-column type="selection" width="55" height="100" /> <el-table-column type="selection" width="55" height="100" />
<el-table-column prop="date" label="日期" /> <el-table-column prop="icon" label="头像">
<template v-slot="scope">
<img
:src="scope.row.icon"
alt="头像"
width="40"
height="40"
class="rounded-circle"
/>
</template>
</el-table-column>
<el-table-column prop="name" label="姓名" /> <el-table-column prop="name" label="姓名" />
<el-table-column prop="state" label="状态" /> <el-table-column prop="number" label="学号" width="120" />
<el-table-column prop="city" label="City" width="300" /> <el-table-column prop="sex" label="性别" />
<el-table-column prop="address" label="Address" /> <el-table-column prop="username" label="用户名" />
<el-table-column prop="zip" label="Zip" /> <el-table-column prop="nickName" label="昵称" />
<el-table-column prop="phone" label="手机号" width="120" />
<el-table-column prop="major" label="专业" />
<el-table-column prop="yearAge" label="年级" />
<!-- <el-table-column prop="className" label="班级" /> -->
<el-table-column prop="createTime" label="创建时间" width="200" />
<el-table-column prop="status" label="状态">
<template v-slot="scope">
<el-switch
v-model="scope.row.status"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="125"> <el-table-column fixed="right" label="操作" min-width="125">
<template #default> <template #default="{ row }">
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
:icon="Edit" :icon="Edit"
circle circle
plain plain
@click="handleClick" @click="editTable(row)"
></el-button> ></el-button>
<el-button <el-button
:icon="Delete" :icon="Delete"
@ -125,6 +294,7 @@ const loading = ref(false)
size="small" size="small"
circle circle
plain plain
@click="delTable(row)"
></el-button> ></el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -132,47 +302,82 @@ const loading = ref(false)
<el-empty description="没有数据" /> <el-empty description="没有数据" />
</template> </template>
</el-table> </el-table>
<!-- <el-table :data="tableData" style="width: 100%">
<el-table-column type="selection" width="65" />
<el-table-column prop="cate_name" label="分类名称" />
<el-table-column prop="cate_alias" label="分类别名" />
<el-table-column prop="address" label="操作">
<template #default="{ row, $index }">
<el-button
@click="onEditChannel(row, $index)"
:icon="Edit"
type="primary"
circle
plain
></el-button>
<el-button
@click="onDelChannel(row)"
:icon="Delete"
type="danger"
circle
plain
></el-button>
</template>
</el-table-column>
<template #empty>
<el-empty description="没有数据" />
</template>
</el-table> -->
<el-pagination <el-pagination
v-model:current-page="currentPage4" v-model:current-page="params.page"
v-model:page-size="pageSize4" v-model:page-size="params.pagesize"
:page-sizes="[10, 20, 30, 40]" :page-sizes="[3, 5, 7, 10]"
:size="small" :size="small"
:disabled="disabled" :disabled="disabled"
:background="background" :background="true"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="40" :total="10"
@size-change="handleSizeChange" @size-change="onSizeChange"
@current-change="handleCurrentChange" @current-change="onCurrentChange"
/> />
</div> </div>
</el-card> </el-card>
<el-drawer v-model="drawer" title="编辑信息" style="">
<el-form :model="tableData" :rules="rules" ref="formRef">
<el-form-item label="头像" prop="icon">
<el-upload
v-model="tableData.icon"
class="avatar-uploader"
:http-request="upload"
:show-file-list="false"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
<template #tip>
<div class="el-upload__tip">
图片文件要为jpg/png格式小于500kb
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="tableData.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="学号" prop="number">
<el-input v-model="tableData.number" placeholder="请输入学号" />
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="tableData.sex">
<el-radio value="1"></el-radio>
<el-radio value="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="姓名" prop="username">
<el-input v-model="tableData.username" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="用户名" prop="nickName">
<el-input v-model="tableData.nickName" />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="tableData.nickName" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="tableData.phone" />
</el-form-item>
<el-form-item label="专业" prop="major">
<el-input v-model="tableData.major" placeholder="请输入专业" />
</el-form-item>
<el-form-item label="年级" prop="yearAge">
<el-input v-model="tableData.yearAge" placeholder="请输入年级" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="tableData.createTime" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch
v-model="tableData.status"
inline-prompt
active-text="启用"
inactive-text="禁用"
/>
<!-- <el-input v-model="tableData.status" placeholder="请输入姓名" /> -->
</el-form-item>
</el-form>
</el-drawer>
</page-container> </page-container>
</template> </template>
@ -223,6 +428,9 @@ const loading = ref(false)
font-weight: bold; font-weight: bold;
color: #af4141; color: #af4141;
} }
.rounded-circle {
border-radius: 50%;
}
::v-deep.el-table td.el-table__cell div { ::v-deep.el-table td.el-table__cell div {
// margin-left: -6px; // margin-left: -6px;
// width: 170px; // width: 170px;
@ -238,4 +446,31 @@ const loading = ref(false)
justify-content: end; justify-content: end;
font-size: 12px; font-size: 12px;
} }
.avatar-uploader {
:deep() {
.avatar {
width: 178px;
height: 178px;
display: block;
}
.el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.el-upload:hover {
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
text-align: center;
}
}
}
</style> </style>

Loading…
Cancel
Save