yh 5 months ago
commit dae612864d
  1. 4
      src/api/user/user.js
  2. 12
      src/views/home/components/Class1.vue
  3. 9
      src/views/home/components/Class2.vue
  4. 29
      src/views/home/components/Info.vue
  5. 9
      src/views/home/index.vue
  6. 18
      src/views/login/index.vue

@ -36,11 +36,11 @@ export const userChangeService = (jsonData) => {
headers: { 'Content-Type': 'application/json;charset=UTF-8' }, headers: { 'Content-Type': 'application/json;charset=UTF-8' },
}) })
} }
//获取身份信息 //获取个人信息
export const userIdenService = (id) => { export const userIdenService = (id) => {
return request.post('/api/user/personal/info?id=' + id) return request.post('/api/user/personal/info?id=' + id)
} }
//修改身份信息 //修改个人信息
export const userIdenChangeService = (dataToSend) => { export const userIdenChangeService = (dataToSend) => {
return request.post('/api/user/update/PersonalInfo', dataToSend, { return request.post('/api/user/update/PersonalInfo', dataToSend, {
headers: { 'Content-Type': 'application/json;charset=UTF-8' }, headers: { 'Content-Type': 'application/json;charset=UTF-8' },

@ -2,22 +2,22 @@
import conheader from '@/views/home/components/ConHeader.vue' import conheader from '@/views/home/components/ConHeader.vue'
const courses = [ const courses = [
{ {
name: 'Vue.js Basics', name: '软件构造',
image: 'vuejs-basics.jpg', image: 'vuejs-basics.jpg',
hours: 20, hours: 20,
}, },
{ {
name: 'Reac', name: '软件项目管理',
image: 'react-fundamentals.jpg', image: 'react-fundamentals.jpg',
hours: 25, hours: 25,
}, },
{ {
name: 'Reacts', name: 'React',
image: 'react-fundamentals.jpg', image: 'react-fundamentals.jpg',
hours: 25, hours: 25,
}, },
{ {
name: 'React Fund', name: '程序设计',
image: 'react-fundamentals.jpg', image: 'react-fundamentals.jpg',
hours: 25, hours: 25,
}, },
@ -33,7 +33,7 @@ const courses = [
:key="index" :key="index"
class="course-item" class="course-item"
> >
<img :src="course.image" alt="course image" class="course-image" /> <img :src="course.image" class="course-image" />
<div class="course-info"> <div class="course-info">
<p class="course-name">{{ course.name }}</p> <p class="course-name">{{ course.name }}</p>
<p class="course-hours">{{ course.hours }}</p> <p class="course-hours">{{ course.hours }}</p>
@ -63,7 +63,7 @@ const courses = [
.course-list { .course-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 132px;
height: 48px; height: 48px;
} }
.course-item { .course-item {

@ -2,22 +2,22 @@
import conheader from '@/views/home/components/ConHeader.vue' import conheader from '@/views/home/components/ConHeader.vue'
const courses = [ const courses = [
{ {
name: 'Vue.js Basics', name: '软件构造',
image: 'vuejs-basics.jpg', image: 'vuejs-basics.jpg',
hours: 20, hours: 20,
}, },
{ {
name: 'Reac', name: '项目管理',
image: 'react-fundamentals.jpg', image: 'react-fundamentals.jpg',
hours: 25, hours: 25,
}, },
{ {
name: 'Reacts', name: 'React',
image: 'react-fundamentals.jpg', image: 'react-fundamentals.jpg',
hours: 25, hours: 25,
}, },
{ {
name: 'React Fund', name: '程序设计',
image: 'react-fundamentals.jpg', image: 'react-fundamentals.jpg',
hours: 25, hours: 25,
}, },
@ -63,7 +63,6 @@ const courses = [
.course-list { .course-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 132px;
height: 48px; height: 48px;
} }
.course-item { .course-item {

@ -4,12 +4,13 @@ import { onMounted, ref, computed } from 'vue'
import { userIdenChangeService } from '@/api/user/user.js' import { userIdenChangeService } from '@/api/user/user.js'
import { Edit } from '@element-plus/icons-vue' import { Edit } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
}, },
}) })
console.log(props.data, 'info') console.log(props.data, 'djegd ')
const formModel = ref() const formModel = ref()
const loading = ref() const loading = ref()
//true //true
@ -27,7 +28,6 @@ const openEditDialog = (row) => {
} }
// //
const saveEdit = () => { const saveEdit = () => {
console.log(editRowIndex.value, 'rowww')
const index = editRowIndex.value const index = editRowIndex.value
if (index !== -1) { if (index !== -1) {
formModel.value[index] = { ...editForm.value } formModel.value[index] = { ...editForm.value }
@ -44,9 +44,8 @@ const cancelEdit = () => {
content: '', content: '',
} }
} }
const identInfo = ref()
onMounted(() => { onMounted(() => {
// console.log(props.data, 'res')
if (props.data.roleId === 1) { if (props.data.roleId === 1) {
formModel.value = [ formModel.value = [
{ par: 'name', name: '姓名', content: props.data.name }, { par: 'name', name: '姓名', content: props.data.name },
@ -86,8 +85,8 @@ onMounted(() => {
{ par: 'phone', name: '手机号', content: props.data.phone }, { par: 'phone', name: '手机号', content: props.data.phone },
{ par: 'faculty', name: '院系', content: props.data.faculty }, { par: 'faculty', name: '院系', content: props.data.faculty },
{ par: 'major', name: '专业', content: props.data.major }, { par: 'major', name: '专业', content: props.data.major },
{ par: 'year_age', name: '入学年份', content: props.data.year_age }, { par: 'yearAge', name: '入学年份', content: props.data.yearAge },
{ par: 'class_name', name: '班级', content: props.data.class_name }, { par: 'className', name: '班级', content: props.data.className },
] ]
} }
// else { // else {
@ -103,7 +102,6 @@ onMounted(() => {
// { name: '', content: 9.9 }, // { name: '', content: 9.9 },
// ] // ]
// } // }
console.log(formModel.value)
}) })
// 1 // 1
const drawer2 = ref(false) const drawer2 = ref(false)
@ -111,7 +109,7 @@ const direction = ref('rtl')
function cancelClick() { function cancelClick() {
drawer2.value = false drawer2.value = false
} }
const data1 = ref() const data1 = ref([])
const confirmClick = () => { const confirmClick = () => {
drawer2.value = false drawer2.value = false
data1.value = formModel.value data1.value = formModel.value
@ -119,12 +117,17 @@ const confirmClick = () => {
data1.value.map((item) => (values[item.par] = item.content)) data1.value.map((item) => (values[item.par] = item.content))
const dataToSend = { const dataToSend = {
...values, ...values,
roleId: identInfo.value.roleId, roleId: props.data.roleId,
id: identInfo.value.id, id: props.data.id,
} }
userIdenChangeService(dataToSend).then(() => { console.log(dataToSend, 'datato111')
ElMessage.success('修改成功') userIdenChangeService(dataToSend)
}) .then(() => {
ElMessage.success('修改成功')
})
.catch((error) => {
console.log(error)
})
} }
</script> </script>
<template> <template>

@ -16,11 +16,10 @@ const infoData = ref()
const flag = ref(false) const flag = ref(false)
const role = ref(null) const role = ref(null)
const rightVisible = ref(false) const rightVisible = ref(false)
const getData = async () => { userStore.getUserInfo().catch((error) => {
await userStore.getUserInfo().catch((error) => { console.log(error)
console.log(error) })
})
}
onMounted(() => { onMounted(() => {
// getData() // getData()
username.value = userStore.userName username.value = userStore.userName

@ -385,15 +385,15 @@ onBeforeUnmount(() => {
clearInterval(timer) // clearInterval(timer) //
}) })
// //
// watch(isRegister, () => { watch(isRegister, () => {
// formModel.value = { formModel.value = {
// username: '', username: '',
// password: '', password: '',
// repassword: '', repassword: '',
// phone: '', phone: '',
// code: '', code: '',
// } }
// }) })
// //
watch(isToggle, () => { watch(isToggle, () => {
formModel.value = { formModel.value = {

Loading…
Cancel
Save