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. 32
      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. 252
      src/views/student/index.vue

@ -1,22 +1,15 @@
import request from '@/utils/request'
//分页查询
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')
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) => {
// return request.get(`/api/studentManage/${id}`)
// }
export const stuListService = (id) => {
return request.get(`/api/studentManage/${id}`)
}
//删除和批量删除学生
export const delStuListService = (ids) => {
return request.delete(`/api/studentManage/batchDelete?ids=${ids}`)
@ -25,7 +18,7 @@ export const delStuListService = (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}`)
}

@ -33,7 +33,10 @@ export const userGetInfoService = (token) =>
})
//修改用户信息
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) => {

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

@ -21,7 +21,7 @@ export const constantRoute: any = [
// },
// },
// ],
redirect: '/home',
redirect: '/curriculumCenter/basicCourseInformation',
children: [
{
path: '/home',
@ -45,28 +45,6 @@ export const constantRoute: any = [
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',
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',
component: () => import('@/layout/index.vue'),

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

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

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

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

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

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

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

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

@ -1,13 +1,6 @@
<template>
<div id="your-element-selector" style="width: 100%; height: 100vh"></div>
<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-col
:span="12"

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

Loading…
Cancel
Save