diff --git a/src/api/user/stud.js b/src/api/user/stud.js new file mode 100644 index 0000000..b3d38b1 --- /dev/null +++ b/src/api/user/stud.js @@ -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}`) +} diff --git a/src/api/user/user.js b/src/api/user/user.js index ca3abff..4064558 100644 --- a/src/api/user/user.js +++ b/src/api/user/user.js @@ -32,10 +32,11 @@ export const userGetInfoService = (token) => headers: { Authorization: `Bearer ${token}` }, }) //修改用户信息 -export const userChangeService = (jsonData) => { - return request.post('/api/user/update', jsonData, { - headers: { 'Content-Type': 'application/json;charset=UTF-8' }, - }) +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) } //获取个人信息 export const userIdenService = (id) => { diff --git a/src/layout/tabbar/setting/index.vue b/src/layout/tabbar/setting/index.vue index a6182ff..22360a1 100644 --- a/src/layout/tabbar/setting/index.vue +++ b/src/layout/tabbar/setting/index.vue @@ -16,7 +16,7 @@ size="small" icon="Link" circle - @click="openWeb('http://www.baidu.com/', 'baidu')" + @click="openWeb('https://www.baidu.com', 'baidu')" /> { flog.value = false drawer.value.open({}) } + const flog = ref(false) // 编辑时传递数据给子组件 const onEditCourse = (item: any) => { @@ -208,7 +209,11 @@ const CloseCouresNameChangeEvent = () => {
- + - + @@ -289,7 +320,6 @@ const CloseCouresNameChangeEvent = () => { } .course { - // display: flex; // flex: 0 0 25%; // justify-content: space-between; diff --git a/src/views/course/components/courseEdit.vue b/src/views/course/components/courseEdit.vue index 9cc4f99..343f394 100644 --- a/src/views/course/components/courseEdit.vue +++ b/src/views/course/components/courseEdit.vue @@ -268,11 +268,20 @@ const upload = async (option: any) => { @@ -94,6 +124,7 @@ onMounted(() => { font-size: 16px; font-weight: bold; margin-bottom: 5px; + cursor: pointer; } .lessonlist-item-info .p { /* font-size: 14px; diff --git a/src/views/home/components/Status.vue b/src/views/home/components/Status.vue index bdeea9b..3817738 100644 --- a/src/views/home/components/Status.vue +++ b/src/views/home/components/Status.vue @@ -2,7 +2,7 @@ import add from '@/assets/images/add.png' // import tool from '@/utils/oss.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 { Edit } from '@element-plus/icons-vue' import { tool, client } from '@/utils/alioss.js' @@ -19,7 +19,16 @@ const props = defineProps({ const imageUrl = ref() //设置头像显示 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 res = await tool.oss.upload(option.file) @@ -28,10 +37,9 @@ const upload = async (option) => { // console.log(imageUrl.value, 'img') } //修改用户头像 -const emit = defineEmits(['get-avater']) +const emit = defineEmits(['get-avater', 'getInfo']) let isUploading = ref(false) const changeInfo = async () => { - // console.log('向后端服务器发起请求,修改用户头像信息', imageUrl.value) if (!isUploading.value) { isUploading.value = true const userInfo = { @@ -49,23 +57,48 @@ const changeInfo = async () => { isUploading.value = false } } -// onMounted(() => { -// console.log(props.data.icon, 'props.icon') -// }) + //用户基本信息的显示与编辑 + 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 } +// console.log(props.userData, '传入的值') +// console.log(form.value, '表单的值') +form.value.sex === '男' ? 0 : 1 +const value = ref('') +value.value = form.value.politicalStatus const openInfo = () => { dialog.value = true } const onCancel = () => { dialog.value = false } -const onsubmit = async () => {} -const formLabelWidth = '60px' -const loading = ref(false) +//编辑表单提交 +const onSubmit = async () => { + // 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 + }) +}