Compare commits

...

2 Commits

  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,15 +1,22 @@
import request from '@/utils/request'
//分页查询
export const stuPageService = (params) => {
// console.log(params, '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 stuListService = (id) => {
return request.get(`/api/studentManage/${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}`,
)
}
//获取学生
// export const stuListService = (id) => {
// return request.get(`/api/studentManage/${id}`)
// }
//删除和批量删除学生
export const delStuListService = (ids) => {
return request.delete(`/api/studentManage/batchDelete?ids=${ids}`)
@ -18,7 +25,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,10 +33,7 @@ export const userGetInfoService = (token) =>
})
//修改用户信息
export const userChangeService = (params) => {
// return request.post('/api/user/update', jsonData, {
// headers: { 'Content-Type': 'application/json;charset=UTF-8' },
// })
return request.post(`/api/user/update/PersonalInfo`, params)
return request.post(`/api/user/update`, 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: '/curriculumCenter/basicCourseInformation',
redirect: '/home',
children: [
{
path: '/home',
@ -45,6 +45,28 @@ 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',
@ -140,28 +162,7 @@ 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,15 +87,12 @@ 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,9 +108,7 @@ 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),
@ -125,12 +123,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,
},
})
}
//
@ -162,7 +160,17 @@ 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,13 +67,7 @@ onMounted(() => {
</div>
</div>
</div>
<course-edit
ref="drawer"
@success="onSuccess"
@couresNameChange="couresNameChangeEvent"
@CloseCouresNameChange="CloseCouresNameChangeEvent"
:flog="flog"
></course-edit>
<course-edit ref="drawer" @success="onSuccess" :flog="flog"></course-edit>
</div>
<courseedit @click="open"></courseedit>
</template>

@ -61,7 +61,6 @@ const changeInfo = async () => {
//
const dialog = ref(false)
const formLabelWidth = '68px'
const form = ref({
name: '',
@ -89,10 +88,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)
@ -115,7 +114,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,6 +10,7 @@ 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,
@ -28,7 +29,7 @@ const pwdForm = ref({
new_pwd: '',
re_pwd: '',
})
// console.log(props.userData.username, 'props.data')
// console.log(props.userData, '22222')
//dialog
//
const dialogFormVisible = ref(false)
@ -133,7 +134,8 @@ const rules = {
const infoRef = ref()
//
const emit = defineEmits(['get-message'])
const emit = defineEmits(['get-message', 'userInfoModified'])
const change = ref(true)
//
const countdown = ref(0)
@ -148,7 +150,6 @@ const toggleVisibility = () => {
const codecode = ref()
const codeSubmit = async () => {
await infoRef.value.validate()
// console.log('')
const phoness = form.value.newphone
userCodeRegisterService(phoness)
.then((response) => {
@ -156,69 +157,78 @@ const codeSubmit = async () => {
console.log(codecode.value, 'codecode')
})
.catch((error) => {
console.log(error.message, 'error')
ElMessage.error(error.newphone.message)
// console.log(error.newphone.message, 'error')
})
}
// console.log(change.value == true, 'toggleVisibility.value == false')
// if (toggleVisibility.value == 'false') {
// console.log(' false')
// } else {
// console.log('')
// }
const res = ref()
const changeInfo = async () => {
await infoRef.value.validate()
if (change.value === true) {
// console.log(form.value.phone, '')
// 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 === '')
) {
await userChangeService({
phone: form.value.phone,
id: form.value.id,
nickName: form.value.nickName,
}).then(() => {
}).then(async () => {
// console.log('11')
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 = ''
})
dialogFormVisible.value = false
} else {
} else if (
change.value === false &&
form.value.newphone !== form.value.phone &&
form.value.code !== ''
) {
// console.log('22')
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(() => {
}).then(async () => {
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-phone', form.value.phone)
emit('get-message', form.value.nickName)
emit('userInfoModified', res)
dialogFormVisible.value = false
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()
@ -341,7 +351,12 @@ 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%" />
<el-input
v-model="form.phone"
autocomplete="off"
style="width: 92%"
readonly
/>
<el-button
type="primary"
plain

@ -2,24 +2,18 @@
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({})
@ -34,34 +28,47 @@ userStore.getUserInfo().catch((error) => {
const name = ref()
const getMessage = (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')
userStore.data.phone = phone
// console.log(data.value.icon, 'icon')
userStore.userName = username
// 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')
// console.log(maxKnow.value, 'max')
}
function fetchNewUserInfo(res) {
// userInfo
data.value = res
}
onMounted(() => {
// getData()
username.value = userStore.userName
@ -85,14 +92,8 @@ 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()
@ -106,10 +107,10 @@ onMounted(() => {
<div class="nav">
<welcome
:data="infoData"
:userData="data"
:userData="userStore.data"
:name="name"
@get-message="getMessage"
@get-phone="getPhone"
@userInfoModified="fetchNewUserInfo"
v-if="flag"
></welcome>
</div>
@ -124,7 +125,7 @@ onMounted(() => {
<el-col :span="6">
<div class="info">
<status
:data="data"
:data="userStore.data"
:userData="infoData"
@get-avater="getAvater"
@getInfo="getInfo"
@ -141,8 +142,10 @@ onMounted(() => {
style="
font-size: 14px;
display: flex;
/* margin: 0px auto; */
margin: 0px 10px;
width: 90%;
margin: 0px auto;
/* margin: 0px 10px; */
margin-bottom: 5px;
"
>
<conheader
@ -150,7 +153,7 @@ onMounted(() => {
:urouter="'/curriculumCenter/knowledgePoints'"
></conheader>
</a>
<div class="con">
<div class="contt">
<p class="button" round v-for="item in maxKnow" :key="item.id">
{{ item.label }}
</p>
@ -161,11 +164,17 @@ onMounted(() => {
<div class="lesson">
<a
href="#"
style="width: 90%; font-size: 14px; display: flex; margin: 0 auto"
style="
width: 90%;
font-size: 14px;
display: flex;
margin: 0 auto;
margin-bottom: 5px;
"
>
<conheader :title="`推荐知识点`"></conheader>
</a>
<div class="con">
<div class="contt">
<p class="button" round v-for="item in 30" :key="item">Roshabei</p>
</div>
</div>
@ -176,7 +185,10 @@ onMounted(() => {
href="#"
style="width: 90%; font-size: 14px; display: flex; margin: 0 auto"
>
<conheader :title="`推荐课程`"></conheader>
<conheader
:title="`推荐课程`"
:urouter="'/curriculumCenter/basicCourseInformation'"
></conheader>
</a>
<div class="con">
<ul>
@ -198,7 +210,10 @@ onMounted(() => {
href="#"
style="width: 90%; font-size: 12px; display: flex; margin: 0 auto"
>
<conheader :title="`最新收藏课程`"></conheader>
<conheader
:title="`最新收藏课程`"
:urouter="'/curriculumCenter/basicCourseInformation'"
></conheader>
</a>
<div class="con">
<ul>
@ -208,11 +223,9 @@ 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>
@ -264,7 +277,6 @@ onMounted(() => {
justify-content: space-between;
}
.lesson {
background-color: pink;
padding-top: 30px;
// padding-bottom: 30px;
padding: 25px 10px 0px 10px;
@ -284,24 +296,32 @@ 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: 40%;
width: 100%;
padding: 0px 15px;
overflow: hidden;
text-overflow: ellipsis;
@ -344,6 +364,8 @@ ul {
}
.lessonlist-item {
// background-color: pink;
height: 50px;
// margin: 0 auto;
border-radius: 10px;

@ -1,6 +1,13 @@
<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,19 +1,25 @@
<script setup>
import { Search, Edit, Delete } from '@element-plus/icons-vue'
import { Search, Edit, Delete, CircleClose } 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({
@ -29,22 +35,14 @@ const getData = async () => {
loading.value = true
await stuPageService(params.value).then((res) => {
tableData.value = res.data.Records
// console.log(tableData.value, 'params')
total.value = res.data.totalCount
console.log(tableData.value, 'params')
loading.value = false
console.log(res.data, 'res.data')
// console.log(res.data.totalCount, '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) => {
//访
@ -60,16 +58,12 @@ 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)
//
@ -81,7 +75,7 @@ const editTable = (row) => {
}
//
const delTable = async (row) => {
console.log(row.userId, 'delrow')
// console.log(row.userId, 'delrow')
await ElMessageBox.confirm('您确定删除这条学生信息吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
@ -99,82 +93,150 @@ 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 () => {
await ElMessageBox.confirm('您确定删除这些学生信息吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await delStuListService(selectedIds.value).then(() => {
if (selectedIds.value.length !== 0) {
await ElMessageBox.confirm('确定删除学生信息吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await delStuListService(selectedIds.value).then(() => {
ElMessage({
message: '删除成功',
type: 'success',
})
})
getData()
} else {
ElMessage({
message: '删除成功',
type: 'success',
message: '请选择要删除的学生',
})
})
getData()
}
}
//
const onResetPass = async () => {
await ElMessageBox.confirm('您确定重置这些学生密码吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await reStuPassService(selectedIds.value).then(() => {
if (selectedIds.value.length !== 0) {
await ElMessageBox.confirm('确定重置密码吗', '温馨提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
await reStuPassService(selectedIds.value).then(() => {
ElMessage({
message: '重置成功',
type: 'success',
})
})
getData()
} else {
ElMessage({
message: '重置成功',
type: 'success',
message: '请选择要重置密码的学生',
})
})
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
console.log(params.value.number, 'params.value.number')
await stuPageService(params.value).then((res) => {
params.value.page = 1
console.log(res, 'change')
})
// getData()
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')
}
//
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()
//
const onReset = () => {
params.value.page = 1
params.value.name = ''
params.value.number = ''
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()
@ -187,6 +249,7 @@ 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>
@ -195,24 +258,41 @@ 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"
@blur="clearInput"
@focus="onFocus"
placeholder="输入学号进行搜索"
></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>
@ -265,7 +345,6 @@ 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">
@ -310,7 +389,7 @@ onMounted(() => {
:disabled="disabled"
:background="true"
layout="total, sizes, prev, pager, next, jumper"
:total="10"
:total="total"
@size-change="onSizeChange"
@current-change="onCurrentChange"
/>
@ -388,6 +467,8 @@ 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;
@ -395,7 +476,7 @@ onMounted(() => {
justify-content: space-between;
}
.content {
min-height: 440px;
min-height: 660px;
}
.input_search {
@ -407,9 +488,13 @@ onMounted(() => {
right: 10px;
top: 50%;
transform: translateY(-50%);
.close {
margin-right: 10px;
}
}
.btn_search {
margin-left: 15px;
margin: 0px 15px;
// margin-top: 12px;
border-radius: 8px;
font-size: 13px;
background-color: #377be5;
@ -446,6 +531,9 @@ onMounted(() => {
justify-content: end;
font-size: 12px;
}
h5 {
margin-top: 22px;
}
.avatar-uploader {
:deep() {
.avatar {

Loading…
Cancel
Save