Compare commits

..

No commits in common. '3107411e0ce78c1fed3452b807a2569b342da1f2' and 'f6dea2720fd0ad6ab62f53607d894cd0c406cb6d' have entirely different histories.

  1. 8420
      pnpm-lock.yaml
  2. 1
      src/store/modules/type/types.ts
  3. 9
      src/store/modules/user.ts
  4. 18
      src/views/course/basicCourseInformation.vue
  5. 136
      src/views/home/components/Info.vue
  6. 2
      src/views/home/index.vue

File diff suppressed because it is too large Load Diff

@ -6,5 +6,4 @@ export interface LoginStoreType {
avatar: string // 用户头像
routes: string
phone: string
userInfo: object
}

@ -18,7 +18,6 @@ import {
userLoginService,
userGetInfoService,
userPhoneLoginService,
userIdenService,
} from '@/api/user/user.js'
const useUserStore = defineStore(
@ -31,7 +30,6 @@ const useUserStore = defineStore(
userName: '', // 用户姓名
avatar: '', // 用户头像
routes: '',
userInfo: {}, // 当前用户相关信息
}
},
actions: {
@ -49,7 +47,6 @@ const useUserStore = defineStore(
this.token = res.data.token as string
SET_TKOEN('TOKEN', this.token)
// localStorage.setItem('TOKEN', this.token)
ElNotification({
type: 'success',
message: '登录成功!',
@ -92,11 +89,7 @@ const useUserStore = defineStore(
async getUserInfo() {
const result = await userGetInfoService(GET_TKOEN('TOKEN'))
if (result.code === 200) {
const res = await userIdenService(result.data.id)
this.userInfo = res.data
console.log(this.userInfo, 'this.userInfo')
console.log(result, '123')
// console.log(result)
this.userName = result.data.username
// this.avatar = result.data.checkUser.avatar
this.routes = result.data.menus.map((item) => {

@ -11,10 +11,6 @@ import {
import { ElMessageBox, ElMessage } from 'element-plus'
// import router from '@/router'
import { useRouter } from 'vue-router'
import useUserStore from '@/store/modules/user'
// import { useRoute } from 'vue-router'
const userStore = useUserStore()
// const userInfo = userStore.userInfo
const router = useRouter()
// const route = useRoute()
// console.log(route)
@ -33,7 +29,7 @@ const total = ref(0)
const params = ref({
pageNo: 1,
pageSize: 7,
username: userStore.userName,
username: 'qiu',
assessmenttype: '',
category: '',
nature: '',
@ -43,14 +39,12 @@ const loading = ref(false)
//
const getCourseList = async () => {
loading.value = true
console.log(params.value, '11')
const res = await getCourseListApi(params.value)
// console.log(res)
courseList.value = res.data.list
total.value = res.data.total
console.log(res.data.list)
loading.value = false
// console.log(userStore.userName, '1111')
}
//
onMounted(() => {
@ -167,7 +161,7 @@ const CloseCouresNameChangeEvent = () => {
<div class="btn">
<!-- <el-button type="primary" round size="large">全部课程</el-button>
<el-button type="primary" round plain size="large">我的文件夹</el-button> -->
<el-form inline v-if="userStore.userInfo.roleId === 1">
<el-form inline>
<el-form-item label="课程教师:" class="short-form-item">
<el-select v-model="params.teacher">
<el-option
@ -204,11 +198,7 @@ const CloseCouresNameChangeEvent = () => {
</el-form>
<div class="course">
<ul class="course_list">
<li
v-if="userStore.userInfo.roleId === 1"
@click="onAddCourse()"
class="add_course"
>
<li @click="onAddCourse()" class="add_course">
<div class="plus">
<el-icon class="avatar-uploader-icon">
<Plus />

@ -46,80 +46,80 @@ const cancelEdit = () => {
}
const identInfo = ref()
//
// const getInfo = async (id) => {
// const res = await userIdenService(id)
// identInfo.value = res
// return res
// }
const getInfo = async (id) => {
const res = await userIdenService(id)
identInfo.value = res
return res
}
console.log()
onMounted(() => {
// getInfo(id)
// getInfo(id)
// .then((res) => {
// // 访 getData
// console.log(res.data, '000000')
// identInfo.value = res.data
// //
// if (res.data.roleId === 1) {
// formModel.value = [
// { par: 'name', name: '', content: res.data.name },
// { par: 'sex', name: '', content: res.data.sex },
// { par: 'nationality', name: '', content: res.data.nationality },
// { par: 'profession', name: '', content: res.data.profession },
// { par: 'education', name: '', content: res.data.education },
// { par: 'degree', name: '', content: res.data.degree },
// {
// par: 'professionalTitle',
// name: '',
// content: res.data.professionalTitle,
// },
// {
// par: 'emergencyContact',
// name: '',
// content: res.data.emergencyContact,
// },
// {
// par: 'joinWorkTime',
// name: '',
// content: res.data.joinWorkTime,
// },
// {
// par: 'politicalStatus',
// name: '',
// content: res.data.politicalStatus,
// },
// ]
// } else if (res.data.roleId === 2) {
getInfo(id)
.then((res) => {
// 访 getData
console.log(res.data, '000000')
identInfo.value = res.data
//
if (res.data.roleId === 1) {
formModel.value = [
{ par: 'name', name: '姓名', content: res.data.name },
{ par: 'sex', name: '性别', content: res.data.sex },
{ par: 'nationality', name: '民族', content: res.data.nationality },
{ par: 'profession', name: '专业', content: res.data.profession },
{ par: 'education', name: '学历', content: res.data.education },
{ par: 'degree', name: '学位', content: res.data.degree },
{
par: 'professionalTitle',
name: '职称',
content: res.data.professionalTitle,
},
{
par: 'emergencyContact',
name: '手机号',
content: res.data.emergencyContact,
},
{
par: 'joinWorkTime',
name: '参加工作时间',
content: res.data.joinWorkTime,
},
{
par: 'politicalStatus',
name: '政治面貌',
content: res.data.politicalStatus,
},
]
} else if (res.data.roleId === 2) {
formModel.value = [
{ par: 'name', name: '姓名', content: res.data.name },
{ par: 'sex', name: '性别', content: res.data.sex },
{ par: 'nationality', name: '民族', content: res.data.nationality },
{ par: 'number', name: '学号', content: res.data.number },
{ par: 'birthday', name: '生日', content: res.data.birthday },
{ par: 'phone', name: '手机号', content: res.data.phone },
{ par: 'faculty', name: '院系', content: res.data.faculty },
{ par: 'major', name: '专业', content: res.data.major },
{ par: 'year_age', name: '入学年份', content: res.data.year_age },
{ par: 'class_name', name: '班级', content: res.data.class_name },
]
}
// else {
// formModel.value = [
// { par: 'name', name: '', content: res.data.name },
// { par: 'sex', name: '', content: res.data.sex },
// { par: 'nationality', name: '', content: res.data.nationality },
// { par: 'number', name: '', content: res.data.number },
// { par: 'birthday', name: '', content: res.data.birthday },
// { par: 'phone', name: '', content: res.data.phone },
// { par: 'faculty', name: '', content: res.data.faculty },
// { par: 'major', name: '', content: res.data.major },
// { par: 'year_age', name: '', content: res.data.year_age },
// { par: 'class_name', name: '', content: res.data.class_name },
// { name: '', content: res.data.name },
// { name: '', content: res.data.id },
// { name: '', content: 9.9 },
// { name: '', content: 9.9 },
// { name: '', content: 9.9 },
// { name: '', content: 9.9 },
// { name: '', content: 9.9 },
// { name: '', content: 9.9 },
// { name: '', content: 9.9 },
// ]
// }
// // else {
// // formModel.value = [
// // { name: '', content: res.data.name },
// // { name: '', content: res.data.id },
// // { name: '', content: 9.9 },
// // { name: '', content: 9.9 },
// // { name: '', content: 9.9 },
// // { name: '', content: 9.9 },
// // { name: '', content: 9.9 },
// // { name: '', content: 9.9 },
// // { name: '', content: 9.9 },
// // ]
// // }
// })
// .catch((error) => {
// console.error(error)
// })
})
.catch((error) => {
console.error(error)
})
})
// 1
const drawer2 = ref(false)

@ -32,7 +32,7 @@ const getData = async () => {
} else {
rightVisible.value = false
}
console.log(data.value, 333333)
// console.log(data.value.roles[0], 333333)
})
.catch((error) => {
console.log(error)

Loading…
Cancel
Save