Compare commits

..

No commits in common. 'b7ce5c3eed4d70e5708488bb50fb533a06f22205' and '0cf6e42287ac328db87ccb9539f1fefaea1479ff' have entirely different histories.

  1. 17
      src/api/user/stud.js
  2. 5
      src/api/user/user.js
  3. 4
      src/layout/tabbar/setting/index.vue
  4. 47
      src/router/routers.ts
  5. 7
      src/store/modules/user.ts
  6. 30
      src/views/MyCourseStudy/learningProcess.vue
  7. 2
      src/views/home/components/ConHeader.vue
  8. 2
      src/views/home/components/Echart/Echarts.vue
  9. 10
      src/views/home/components/Lessonlist.vue
  10. 7
      src/views/home/components/Status.vue
  11. 89
      src/views/home/components/Welcome.vue
  12. 106
      src/views/home/index.vue
  13. 7
      src/views/login/index.vue
  14. 210
      src/views/student/index.vue

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

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

@ -87,11 +87,11 @@ const openWeb = (url, name) => {
// //
onMounted(() => { onMounted(() => {
userStore.getUserInfo() userStore.getUserInfo()
// console.log(userStore.data.icon, 'icon') console.log(userStore.data.icon, 'icon')
}) })
const logout = () => { const logout = () => {
// console.log($route) console.log($route)
userStore.logout() userStore.logout()
$router.push({ $router.push({
path: '/login', path: '/login',

@ -21,7 +21,7 @@ export const constantRoute: any = [
// }, // },
// }, // },
// ], // ],
redirect: '/home', redirect: '/curriculumCenter/basicCourseInformation',
children: [ children: [
{ {
path: '/home', path: '/home',
@ -45,28 +45,6 @@ export const constantRoute: any = [
icon: 'Notebook', icon: 'Notebook',
}, },
}, },
{
path: '/mssageManagement',
component: () => import('@/layout/index.vue'),
name: 'MssageManagement',
meta: {
title: '',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/mssageManagement/message',
component: () => import('@/views/message/index.vue'),
name: 'Message',
meta: {
title: '消息',
hidden: false,
icon: 'ChatDotSquare',
},
},
],
},
{ {
path: '/curriculumCenter', path: '/curriculumCenter',
redirect: '/curriculumCenter/basicCourseInformation', redirect: '/curriculumCenter/basicCourseInformation',
@ -162,7 +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: '/mssageManagement', path: '/mssageManagement',
component: () => import('@/layout/index.vue'), component: () => import('@/layout/index.vue'),

@ -87,12 +87,15 @@ const useUserStore = defineStore('User', {
async getUserInfo() { async getUserInfo() {
const result: any = await userGetInfoService(GET_TKOEN('TOKEN')) const result: any = await userGetInfoService(GET_TKOEN('TOKEN'))
if (result.code === 200) { if (result.code === 200) {
// console.log(result, 'result') console.log(result, 'result')
// 获取用户个人信息
const res = await userIdenService(result.data.id) const res = await userIdenService(result.data.id)
// console.log(res, 'res')
this.userInfo = res.data this.userInfo = res.data
// console.log(this.userInfo, 'this.userInfo')
this.data = result.data this.data = result.data
// console.log(result, '123')
this.userName = result.data.username this.userName = result.data.username
// this.avatar = result.data.checkUser.avatar
this.routes = result.data.permissions this.routes = result.data.permissions
return { return {
result, result,

@ -15,7 +15,7 @@ const selectedIds = ref([])
const loading = ref(false) const loading = ref(false)
const showCheckbox = ref(false) const showCheckbox = ref(false)
onMounted(() => { onMounted(()=>{
userStore.getUserInfo() userStore.getUserInfo()
}) })
const params = ref({ const params = ref({
@ -23,7 +23,7 @@ const params = ref({
// pagenum: '1', // pagenum: '1',
userId: userStore.data.id, userId: userStore.data.id,
}) })
console.log(userStore.data.id) console.log(userStore.data.id);
// //
const getrecordList = async () => { const getrecordList = async () => {
loading.value = true loading.value = true
@ -108,7 +108,9 @@ const deleteSelected = async () => {
}) })
// //
await LearningRecordsControllerService.deleteCourseRecords(selectedIds.value) await LearningRecordsControllerService.deleteCourseRecords(
selectedIds.value,
)
.then(() => { .then(() => {
recordList.value = recordList.value.filter( recordList.value = recordList.value.filter(
(item) => !selectedIds.value.includes(item.id), (item) => !selectedIds.value.includes(item.id),
@ -123,12 +125,12 @@ const deleteSelected = async () => {
} }
// //
const router = useRouter() const router = useRouter()
const goToAnotherPage = (address, courseId) => { const goToAnotherPage = (address,courseId) => {
router.push({ router.push({
path: address, path:address,
query: { query:{
courseId: courseId, courseId: courseId
}, }
}) })
} }
// //
@ -160,17 +162,7 @@ const goToAnotherPage = (address, courseId) => {
<!-- 中间 --> <!-- 中间 -->
<div class="record-list"> <div class="record-list">
<ul v-if="recordList.length > 0"> <ul v-if="recordList.length > 0">
<li <li v-for="record in recordList" :key="record.id" v-loading="loading" @click="goToAnotherPage('/myCourseStudyManagement/learningProcess1' , record.courseId)">
v-for="record in recordList"
:key="record.id"
v-loading="loading"
@click="
goToAnotherPage(
'/myCourseStudyManagement/learningProcess1',
record.courseId,
)
"
>
<input <input
style="display: flex" style="display: flex"
type="checkbox" type="checkbox"

@ -20,7 +20,7 @@ const props = defineProps({
modelValue: Boolean, modelValue: Boolean,
urouter: String, urouter: String,
}) })
// console.log(props.title, 'router111') console.log(props.title, 'router111')
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const router = useRouter() const router = useRouter()
</script> </script>

@ -12,7 +12,7 @@ const props = defineProps({
}) })
onMounted(() => { onMounted(() => {
// console.log(props.count.dateList, 'count') console.log(props.count.dateList, 'count')
const myChart = echarts.init(echarsDom.value) const myChart = echarts.init(echarsDom.value)
// //
myChart.setOption({ myChart.setOption({

@ -30,7 +30,7 @@ const drawer = ref()
const flog = ref(false) const flog = ref(false)
const onEditCourse = (item) => { const onEditCourse = (item) => {
flog.value = true flog.value = true
// console.log(item, 'item') console.log(item, 'item')
drawer.value.open(item) drawer.value.open(item)
} }
const onSuccess = () => { const onSuccess = () => {
@ -67,7 +67,13 @@ onMounted(() => {
</div> </div>
</div> </div>
</div> </div>
<course-edit ref="drawer" @success="onSuccess" :flog="flog"></course-edit> <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>

@ -61,6 +61,7 @@ const changeInfo = async () => {
// //
const dialog = ref(false) const dialog = ref(false)
const formLabelWidth = '68px' const formLabelWidth = '68px'
const form = ref({ const form = ref({
name: '', name: '',
@ -88,10 +89,10 @@ const onCancel = () => {
// //
const onSubmit = async () => { const onSubmit = async () => {
// const jsonData = JSON.stringify(form.value) // const jsonData = JSON.stringify(form.value)
// console.log(form.value, 'jj') console.log(form.value, 'jj')
await userChangeService(form).then(() => { await userChangeService(form).then(() => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
// console.log(form.value, 'aaaa') console.log(form.value, 'aaaa')
emit('getInfo', form.value) emit('getInfo', form.value)
@ -114,7 +115,7 @@ const onSubmit = async () => {
<el-upload <el-upload
class="click" class="click"
:show-file-list="false" :show-file-list="false"
:auto-upload="false" auto-upload="false"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:http-request="upload" :http-request="upload"
> >

@ -10,7 +10,6 @@ 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' import { Edit, Back } from '@element-plus/icons-vue'
const props = defineProps({ const props = defineProps({
name: { name: {
type: String, type: String,
@ -29,7 +28,7 @@ const pwdForm = ref({
new_pwd: '', new_pwd: '',
re_pwd: '', re_pwd: '',
}) })
// console.log(props.userData, '22222') // console.log(props.userData.username, 'props.data')
//dialog //dialog
// //
const dialogFormVisible = ref(false) const dialogFormVisible = ref(false)
@ -134,8 +133,7 @@ const rules = {
const infoRef = ref() const infoRef = ref()
// //
const emit = defineEmits(['get-message', 'userInfoModified']) const emit = defineEmits(['get-message'])
const change = ref(true) const change = ref(true)
// //
const countdown = ref(0) const countdown = ref(0)
@ -150,6 +148,7 @@ const toggleVisibility = () => {
const codecode = ref() const codecode = ref()
const codeSubmit = async () => { const codeSubmit = async () => {
await infoRef.value.validate() await infoRef.value.validate()
// console.log('')
const phoness = form.value.newphone const phoness = form.value.newphone
userCodeRegisterService(phoness) userCodeRegisterService(phoness)
.then((response) => { .then((response) => {
@ -157,78 +156,69 @@ const codeSubmit = async () => {
console.log(codecode.value, 'codecode') console.log(codecode.value, 'codecode')
}) })
.catch((error) => { .catch((error) => {
ElMessage.error(error.newphone.message) console.log(error.message, 'error')
// console.log(error.newphone.message, 'error')
}) })
} }
const res = ref() // 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()
// console.log(props.userData, 'props.data') if (change.value === true) {
if ( // console.log(form.value.phone, '')
// change.value === true ||
(change.value === true &&
props.userData.nickName !== form.value.nickName) ||
(change.value === false &&
form.value.newphone === '' &&
props.userData.nickName !== form.value.nickName &&
form.value.code === '')
) {
await userChangeService({ 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(async () => { }).then(() => {
// console.log('11')
ElMessage.success('修改成功') ElMessage.success('修改成功')
res.value = await userStore.getUserInfo()
res.value = res.value.result.data
// console.log(res.result.data, '1')
emit('get-message', form.value.nickName) emit('get-message', form.value.nickName)
emit('userInfoModified', res)
dialogFormVisible.value = false
form.value.newphone = '' form.value.newphone = ''
form.value.code = '' form.value.code = ''
}) })
} else if ( dialogFormVisible.value = false
change.value === false && } else {
form.value.newphone !== form.value.phone &&
form.value.code !== ''
) {
// console.log('22')
if (codecode.value === form.value.code) { if (codecode.value === form.value.code) {
// console.log(form.value.newphone, '')
// console.log('')
await userChangeService({ await userChangeService({
phone: form.value.newphone, phone: form.value.newphone,
id: form.value.id, id: form.value.id,
nickName: form.value.nickName, nickName: form.value.nickName,
}).then(async () => { }).then(() => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
res.value = userStore.getUserInfo()
// res.value = res.result.data
// console.log(res.value, 'hsouji')
// userStore.getUserInfo()
form.value.phone = form.value.newphone form.value.phone = form.value.newphone
// emit('get-phone', form.value.phone) emit('get-phone', form.value.phone)
emit('get-message', form.value.nickName)
emit('userInfoModified', res)
dialogFormVisible.value = false
form.value.newphone = '' form.value.newphone = ''
form.value.code = '' form.value.code = ''
}) })
dialogFormVisible.value = false
} else { } else {
ElMessage.error('验证码错误') ElMessage.error('验证码错误')
} }
} else {
// console.log('33')
dialogFormVisible.value = false
} }
} }
//
const pwdRef = ref()
const changePassword = async () => {
await pwdRef.value.validate()
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
}
const cancleInfo = () => { const cancleInfo = () => {
dialogFormVisible.value = false dialogFormVisible.value = false
form.value = { ...props.userData, code: '', newphone: '' }
} }
// //
const userStore = useUserStore() const userStore = useUserStore()
@ -351,12 +341,7 @@ onUnmounted(() => {
<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 <el-input v-model="form.phone" autocomplete="off" style="width: 92%" />
v-model="form.phone"
autocomplete="off"
style="width: 92%"
readonly
/>
<el-button <el-button
type="primary" type="primary"
plain plain

@ -2,18 +2,24 @@
import status from '@/views/home/components/Status.vue' import status from '@/views/home/components/Status.vue'
import welcome from './components/Welcome.vue' import welcome from './components/Welcome.vue'
import conheader from '@/views/home/components/ConHeader.vue' import conheader from '@/views/home/components/ConHeader.vue'
// import Info from './components/Info.vue'
import echarts from './components/Echarts.vue' import echarts from './components/Echarts.vue'
import lessonlist from './components/Lessonlist.vue' import lessonlist from './components/Lessonlist.vue'
// import Class1 from './components/Class1.vue'
import Student1 from './components/Student1.vue' import Student1 from './components/Student1.vue'
// import Class2 from './components/Class2.vue'
// import Student2 from './components/Student2.vue'
import { import {
userNewLikeService, userNewLikeService,
userLookService, userLookService,
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 { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
// import { Picture } from 'element-plus/icons-vue'
const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const username = ref() const username = ref()
const data = ref({}) const data = ref({})
@ -28,47 +34,34 @@ userStore.getUserInfo().catch((error) => {
const name = ref() const name = ref()
const getMessage = (msg) => { const getMessage = (msg) => {
name.value = msg name.value = msg
// console.log(name.value, 'msg')
} }
const getPhone = (phone) => {
//?
// const getData = async () => {
// const res = await userLookService(userStore.data.id)
// // console.log(res.data, '11111')
// data.value = res.data
// }
const getUserName = (username) => {
// console.log(msg, 'msg') // console.log(msg, 'msg')
userStore.userName = username userStore.data.phone = phone
// console.log(data.value.icon, 'icon'); // 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) => { const getInfo = (info) => {
// console.log(userStore.userInfo, 'msg') console.log(userStore.userInfo, 'msg')
userStore.userInfo = info userStore.userInfo = info
// console.log(userStore.userData, 'icon111') // console.log(userStore.userData, 'icon111')
} }
const courselist = ref([]) const courselist = ref([])
// const img = ref() const img = ref()
// const courseName = ref() const courseName = ref()
// const courseTea = ref() const courseTea = ref()
// //
const maxKnow = ref([]) const maxKnow = ref([])
const getmaxKnow = async () => { const getmaxKnow = async () => {
const res = await userMaxKnowService(userStore.data.id) const res = await userMaxKnowService(userStore.data.id)
maxKnow.value = res.data maxKnow.value = res.data
// console.log(maxKnow.value, 'max') console.log(maxKnow.value, 'max')
}
function fetchNewUserInfo(res) {
// userInfo
data.value = res
} }
onMounted(() => { onMounted(() => {
// getData() // getData()
username.value = userStore.userName username.value = userStore.userName
@ -92,8 +85,14 @@ onMounted(() => {
// //
userNewLikeService(userStore.data.id).then((res) => { userNewLikeService(userStore.data.id).then((res) => {
loading.value = true loading.value = true
// console.log(res.data, '')
courselist.value = res.data courselist.value = res.data
loading.value = false loading.value = false
// console.log(courselist.value.id, 'course')
// img.value = res.data.img
// courseName.value = res.data.name
// courseTea.value = res.data.teacher
}) })
//echart //echart
userLookService() userLookService()
@ -107,10 +106,10 @@ onMounted(() => {
<div class="nav"> <div class="nav">
<welcome <welcome
:data="infoData" :data="infoData"
:userData="userStore.data" :userData="data"
:name="name" :name="name"
@get-message="getMessage" @get-message="getMessage"
@userInfoModified="fetchNewUserInfo" @get-phone="getPhone"
v-if="flag" v-if="flag"
></welcome> ></welcome>
</div> </div>
@ -125,7 +124,7 @@ onMounted(() => {
<el-col :span="6"> <el-col :span="6">
<div class="info"> <div class="info">
<status <status
:data="userStore.data" :data="data"
:userData="infoData" :userData="infoData"
@get-avater="getAvater" @get-avater="getAvater"
@getInfo="getInfo" @getInfo="getInfo"
@ -142,10 +141,8 @@ onMounted(() => {
style=" style="
font-size: 14px; font-size: 14px;
display: flex; display: flex;
width: 90%; /* margin: 0px auto; */
margin: 0px auto; margin: 0px 10px;
/* margin: 0px 10px; */
margin-bottom: 5px;
" "
> >
<conheader <conheader
@ -153,7 +150,7 @@ onMounted(() => {
:urouter="'/curriculumCenter/knowledgePoints'" :urouter="'/curriculumCenter/knowledgePoints'"
></conheader> ></conheader>
</a> </a>
<div class="contt"> <div class="con">
<p class="button" round v-for="item in maxKnow" :key="item.id"> <p class="button" round v-for="item in maxKnow" :key="item.id">
{{ item.label }} {{ item.label }}
</p> </p>
@ -164,17 +161,11 @@ onMounted(() => {
<div class="lesson"> <div class="lesson">
<a <a
href="#" href="#"
style=" style="width: 90%; font-size: 14px; display: flex; margin: 0 auto"
width: 90%;
font-size: 14px;
display: flex;
margin: 0 auto;
margin-bottom: 5px;
"
> >
<conheader :title="`推荐知识点`"></conheader> <conheader :title="`推荐知识点`"></conheader>
</a> </a>
<div class="contt"> <div class="con">
<p class="button" round v-for="item in 30" :key="item">Roshabei</p> <p class="button" round v-for="item in 30" :key="item">Roshabei</p>
</div> </div>
</div> </div>
@ -185,10 +176,7 @@ onMounted(() => {
href="#" href="#"
style="width: 90%; font-size: 14px; display: flex; margin: 0 auto" style="width: 90%; font-size: 14px; display: flex; margin: 0 auto"
> >
<conheader <conheader :title="`推荐课程`"></conheader>
:title="`推荐课程`"
:urouter="'/curriculumCenter/basicCourseInformation'"
></conheader>
</a> </a>
<div class="con"> <div class="con">
<ul> <ul>
@ -210,10 +198,7 @@ onMounted(() => {
href="#" href="#"
style="width: 90%; font-size: 12px; display: flex; margin: 0 auto" style="width: 90%; font-size: 12px; display: flex; margin: 0 auto"
> >
<conheader <conheader :title="`最新收藏课程`"></conheader>
:title="`最新收藏课程`"
:urouter="'/curriculumCenter/basicCourseInformation'"
></conheader>
</a> </a>
<div class="con"> <div class="con">
<ul> <ul>
@ -223,9 +208,11 @@ onMounted(() => {
:key="item.id" :key="item.id"
v-loading="loading" v-loading="loading"
> >
<!-- <img :src="item.img || fe" class="lessonlist-item-img" /> -->
<div class="lessonlist-item-info"> <div class="lessonlist-item-info">
<p>{{ index + 1 }}</p> <p>{{ index + 1 }}</p>
<h5>{{ item.name || '暂无' }}</h5> <h5>{{ item.name || '暂无' }}</h5>
<!-- <p>{{ item.teacher }}</p> -->
</div> </div>
</li> </li>
</ul> </ul>
@ -277,6 +264,7 @@ onMounted(() => {
justify-content: space-between; justify-content: space-between;
} }
.lesson { .lesson {
background-color: pink;
padding-top: 30px; padding-top: 30px;
// padding-bottom: 30px; // padding-bottom: 30px;
padding: 25px 10px 0px 10px; padding: 25px 10px 0px 10px;
@ -296,32 +284,24 @@ onMounted(() => {
// align-items: center; // align-items: center;
// margin: 0 auto; // margin: 0 auto;
// background-color: yellow; // background-color: yellow;
padding: 5px; padding: 5px;
// margin-top: 5px; margin-top: 5px;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-evenly; justify-content: space-evenly;
padding-bottom: 30px; padding-bottom: 30px;
} }
.contt {
// background-color: yellow;
padding: 5px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 11px;
}
.button { .button {
justify-content: space-between; justify-content: space-between;
margin-bottom: 5px;
height: 30px; height: 30px;
border-radius: 10px; border-radius: 10px;
// color: #0080ff;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
margin: 5px 10px;
// border: 2px solid #ccc;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.1); box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
width: 100%; width: 40%;
padding: 0px 15px; padding: 0px 15px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -364,8 +344,6 @@ ul {
} }
.lessonlist-item { .lessonlist-item {
// background-color: pink;
height: 50px; height: 50px;
// margin: 0 auto; // margin: 0 auto;
border-radius: 10px; border-radius: 10px;

@ -1,13 +1,6 @@
<template> <template>
<div id="your-element-selector" style="width: 100%; height: 100vh"></div> <div id="your-element-selector" style="width: 100%; height: 100vh"></div>
<div class="login_container"> <div class="login_container">
<el-row :span="24" style="height: 5%; background-color: #5577ff">
<el-col>
<div class="grid-content ep-bg-purple-dark">
<img src="" />
</div>
</el-col>
</el-row>
<el-row> <el-row>
<el-col <el-col
:span="12" :span="12"

@ -1,25 +1,19 @@
<script setup> <script setup>
import { Search, Edit, Delete, CircleClose } from '@element-plus/icons-vue' import { Search, Edit, Delete } from '@element-plus/icons-vue'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { import {
// stuListService, stuListService,
stuPageService, stuPageService,
delStuListService, delStuListService,
reStuPassService, reStuPassService,
changeStaService, changeStaService,
stuNumberService,
} from '@/api/user/stud' } from '@/api/user/stud'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { tryOnMounted } from '@vueuse/core'
const userStore = useUserStore() const userStore = useUserStore()
// console.log(userStore.data.id, 'icon') // // console.log(userStore.data.id, 'icon') //
const formLabelWidth = '60px' const formLabelWidth = '60px'
const tableData = ref([]) const tableData = ref([])
const total = ref()
const show = ref(false)
const show1 = ref(false)
// //
const isFirstLoad = ref(true) const isFirstLoad = ref(true)
const params = ref({ const params = ref({
@ -35,14 +29,22 @@ const getData = async () => {
loading.value = true loading.value = true
await stuPageService(params.value).then((res) => { await stuPageService(params.value).then((res) => {
tableData.value = res.data.Records tableData.value = res.data.Records
total.value = res.data.totalCount // console.log(tableData.value, 'params')
console.log(tableData.value, 'params')
loading.value = false loading.value = false
// console.log(res.data.totalCount, 'res.data') console.log(res.data, 'res.data')
isFirstLoad.value = false isFirstLoad.value = false
}) })
} }
//
// const getData = async () => {
// // id.value = userStore.data.id
// // console.log(id.value, 'id.value')
// stuListService(2).then((res) => {
// tableData.value = res.data
// console.log(res.data, 'res.data')
// })
// }
// //
const onSizeChange = (size) => { const onSizeChange = (size) => {
//访 //访
@ -58,12 +60,16 @@ const onCurrentChange = (page) => {
params.value.page = page params.value.page = page
getData() getData()
} }
//
const onReset = () => {
params.value.page = 1
getData()
}
// //
// const onSearch = () => { const onSearch = () => {
// params.value.pagenum = 1 params.value.pagenum = 1
// // getArticleService() // getArticleService()
// } }
const loading = ref(false) const loading = ref(false)
// //
@ -75,7 +81,7 @@ const editTable = (row) => {
} }
// //
const delTable = async (row) => { const delTable = async (row) => {
// console.log(row.userId, 'delrow') console.log(row.userId, 'delrow')
await ElMessageBox.confirm('您确定删除这条学生信息吗', '温馨提示', { await ElMessageBox.confirm('您确定删除这条学生信息吗', '温馨提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -93,11 +99,10 @@ const delTable = async (row) => {
const selectedIds = ref([]) const selectedIds = ref([])
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
selectedIds.value = selection.map((row) => row.userId) selectedIds.value = selection.map((row) => row.userId)
// console.log(selectedIds.value, 'selectedIds.value') console.log(selectedIds.value, 'selectedIds.value')
} }
const onDel = async () => { const onDel = async () => {
if (selectedIds.value.length !== 0) { await ElMessageBox.confirm('您确定删除这些学生信息吗', '温馨提示', {
await ElMessageBox.confirm('确定删除学生信息吗', '温馨提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -108,17 +113,12 @@ const onDel = async () => {
type: 'success', type: 'success',
}) })
}) })
getData() getData()
} else {
ElMessage({
message: '请选择要删除的学生',
})
}
} }
// //
const onResetPass = async () => { const onResetPass = async () => {
if (selectedIds.value.length !== 0) { await ElMessageBox.confirm('您确定重置这些学生密码吗', '温馨提示', {
await ElMessageBox.confirm('确定重置密码吗', '温馨提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -130,113 +130,51 @@ const onResetPass = async () => {
}) })
}) })
getData() getData()
} else {
ElMessage({
message: '请选择要重置密码的学生',
})
}
} }
// //
const status = ref() const status = ref()
tableData.value.forEach((item) => {
item.status = item.status === 1
})
async function handleStatusChange(row) { async function handleStatusChange(row) {
status.value = row.status status.value = row.status
console.log(status.value, 'status') // console.log(status.value, 'status')
console.log(`状态更改: ${row.status}`) // console.log(`: ${row.status}`)
if (!isFirstLoad.value) { // if (!isFirstLoad.value) {
await changeStaService(status.value, row.userId).then(() => { // await changeStaService(status.value, row.userId).then(() => {
ElMessage({ // ElMessage({
message: '状态更改成功', // message: '',
type: 'success', // type: 'success',
}) // })
}) // })
} // }
getData() // getData()
}
//
const studentName = ref()
function onFocus1() {
show1.value = true
}
// function onBlur1() {
// show1.value = true
// }
const closeName = () => {
show1.value = false
studentName.value = ''
}
const searchInfo = async () => {
params.value.name = studentName.value
// console.log(params.value.name, 'params.value.number')
if (studentName.value.trim() !== '') {
// show.value = true
// console.log(params.value.name, 'params')
await stuPageService({
page: 1,
pagesize: 3,
id: userStore.data.id,
name: studentName.value,
number: '',
}).then((res) => {
params.value.page = 1
console.log(res, 'change')
getData()
// studentName.value = ''
})
}
} }
// //
const studentId = ref() const studentId = ref()
function onFocus() {
show.value = true
}
function onblur1() {
show.value = false
}
// closeName
const clearIdinput = () => {
show.value = false
studentId.value = ''
}
const searchNumber = async () => { const searchNumber = async () => {
// console.log(studentId.value, 'params.value.number')
// console.log(studentId.value > 0, 'params')
params.value.number = studentId.value params.value.number = studentId.value
if (studentId.value > 0) { console.log(params.value.number, 'params.value.number')
await stuPageService({ await stuPageService(params.value).then((res) => {
page: 1,
pagesize: 3,
id: userStore.data.id,
name: '',
number: studentId.value,
}).then((res) => {
params.value.page = 1 params.value.page = 1
getData() console.log(res, 'change')
}) })
} // getData()
// console.log(res, 'change')
} }
// //
const onReset = () => { 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 params.value.page = 1
params.value.name = '' console.log(res, 'change')
params.value.number = '' })
getData() // getData()
} }
function clearInput() { function clearInput() {
studentId.value = '' studentId.value = ''
} }
function clearInput1() { function clearInput1() {
studentName.value = '' studentName.value = ''
} }
const value1 = ref(true)
console.log(typeof value1.value, 'value2')
const changeStatus = async (row) => {} const changeStatus = async (row) => {}
onMounted(() => { onMounted(() => {
getData() getData()
@ -249,7 +187,6 @@ onMounted(() => {
<div class="card-header"> <div class="card-header">
<span>学生信息</span> <span>学生信息</span>
<div> <div>
<el-switch v-model="value1" />
<el-button type="primary" @click="onResetPass">重置密码</el-button> <el-button type="primary" @click="onResetPass">重置密码</el-button>
<el-button type="danger" @click="onDel">批量删除</el-button> <el-button type="danger" @click="onDel">批量删除</el-button>
</div> </div>
@ -258,41 +195,24 @@ onMounted(() => {
<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">
<!-- <p>学号</p> -->
<el-input <el-input
class="input_search" class="input_search"
v-model="studentId" v-model="studentId"
@focus="onFocus" @blur="clearInput"
placeholder="输入学号进行搜索"
></el-input> ></el-input>
<el-icon
color="gray"
:size="12"
style="margin-right: 20px"
@click="clearIdinput"
v-if="show"
>
<CircleClose />
</el-icon>
<el-icon><Search /></el-icon> <el-icon><Search /></el-icon>
</el-form-item> </el-form-item>
<el-button class="btn_search" @click="searchNumber">搜索</el-button>
<el-button class="btn_search" @click="searchNumber">
学号搜索
</el-button>
<el-form-item style="width: 250px; margin-left: 30px"> <el-form-item style="width: 250px; margin-left: 30px">
<el-input <el-input
class="input_search" class="input_search"
@blur="clearInput1"
v-model="studentName" v-model="studentName"
@focus="onFocus1"
placeholder="输入姓名进行搜索"
></el-input> ></el-input>
<el-icon
color="gray"
:size="12"
style="margin-right: 20px"
v-if="show1"
@click="closeName"
>
<CircleClose />
</el-icon>
<el-icon><Search /></el-icon> <el-icon><Search /></el-icon>
</el-form-item> </el-form-item>
<el-button class="btn_search" @click="searchInfo">搜索</el-button> <el-button class="btn_search" @click="searchInfo">搜索</el-button>
@ -345,6 +265,7 @@ onMounted(() => {
<el-table-column prop="phone" label="手机号" width="120" /> <el-table-column prop="phone" label="手机号" width="120" />
<el-table-column prop="major" label="专业" /> <el-table-column prop="major" label="专业" />
<el-table-column prop="yearAge" 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="createTime" label="创建时间" width="200" />
<el-table-column prop="status" label="状态"> <el-table-column prop="status" label="状态">
<template v-slot="scope"> <template v-slot="scope">
@ -389,7 +310,7 @@ onMounted(() => {
:disabled="disabled" :disabled="disabled"
:background="true" :background="true"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="total" :total="10"
@size-change="onSizeChange" @size-change="onSizeChange"
@current-change="onCurrentChange" @current-change="onCurrentChange"
/> />
@ -467,8 +388,6 @@ onMounted(() => {
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);
flex: 1; flex: 1;
font-family: Inter, 'Helvetica Neue', Helvetica, 'PingFang SC',
'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
} }
.card-header { .card-header {
display: flex; display: flex;
@ -476,7 +395,7 @@ onMounted(() => {
justify-content: space-between; justify-content: space-between;
} }
.content { .content {
min-height: 660px; min-height: 440px;
} }
.input_search { .input_search {
@ -488,13 +407,9 @@ onMounted(() => {
right: 10px; right: 10px;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
.close {
margin-right: 10px;
}
} }
.btn_search { .btn_search {
margin: 0px 15px; margin-left: 15px;
// margin-top: 12px;
border-radius: 8px; border-radius: 8px;
font-size: 13px; font-size: 13px;
background-color: #377be5; background-color: #377be5;
@ -531,9 +446,6 @@ onMounted(() => {
justify-content: end; justify-content: end;
font-size: 12px; font-size: 12px;
} }
h5 {
margin-top: 22px;
}
.avatar-uploader { .avatar-uploader {
:deep() { :deep() {
.avatar { .avatar {

Loading…
Cancel
Save