Compare commits

..

No commits in common. '3fad5889db20e5ec641429269908280461750b46' and '76e68544a64e8c015429616bdf4c5aa23c45d86b' have entirely different histories.

  1. 7717
      pnpm-lock.yaml
  2. 4
      src/store/modules/user.ts
  3. 12
      src/views/home/components/Info.vue
  4. 26
      src/views/home/components/Welcome.vue
  5. 6
      src/views/home/index.vue
  6. 2
      src/views/login/index.vue

File diff suppressed because it is too large Load Diff

@ -54,6 +54,7 @@ const useUserStore = defineStore(
SET_TKOEN('TOKEN', this.token) SET_TKOEN('TOKEN', this.token)
// localStorage.setItem('TOKEN', this.token) // localStorage.setItem('TOKEN', this.token)
ElNotification({ ElNotification({
type: 'success', type: 'success',
message: '登录成功!', message: '登录成功!',
@ -61,6 +62,7 @@ const useUserStore = defineStore(
}) })
return 'ok' return 'ok'
} else { } else {
console.log(res, '33333')
// ElNotification({ // ElNotification({
// // type: 'error', // // type: 'error',
// message: res.message, // message: res.message,
@ -100,8 +102,6 @@ const useUserStore = defineStore(
const result: any = await userGetInfoService(GET_TKOEN('TOKEN')) const result: any = await userGetInfoService(GET_TKOEN('TOKEN'))
if (result.code === 200) { if (result.code === 200) {
const res = await userIdenService(result.data.id) const res = await userIdenService(result.data.id)
console.log(res, 'huonghu')
// @ts-expect-error // @ts-expect-error
this.userInfo = res.data this.userInfo = res.data

@ -10,6 +10,7 @@ const props = defineProps({
type: Object, type: Object,
}, },
}) })
console.log(props.data, 'djegd ')
const formModel = ref() const formModel = ref()
const loading = ref() const loading = ref()
//true //true
@ -18,7 +19,6 @@ const editForm = ref({
name: '', name: '',
content: '', content: '',
}) })
const readonlyField = computed(() => editForm.value.name) const readonlyField = computed(() => editForm.value.name)
const editRowIndex = ref() const editRowIndex = ref()
const openEditDialog = (row) => { const openEditDialog = (row) => {
@ -46,18 +46,14 @@ const cancelEdit = () => {
} }
onMounted(() => { onMounted(() => {
if (props.data.roleId[0] === '1') { if (props.data.roleId === 1) {
formModel.value = [ formModel.value = [
{ par: 'name', name: '姓名', content: props.data.name }, { par: 'name', name: '姓名', content: props.data.name },
{ par: 'sex', name: '性别', content: props.data.sex }, { par: 'sex', name: '性别', content: props.data.sex },
{ par: 'nationality', name: '民族', content: props.data.nationality }, { par: 'nationality', name: '民族', content: props.data.nationality },
{ par: 'profession', name: '专业', content: props.data.profession }, { par: 'profession', name: '专业', content: props.data.profession },
{ par: 'education', name: '学历', content: props.data.education }, { par: 'education', name: '学历', content: props.data.education },
{ { par: 'degree', name: '学位', content: props.data.degree },
par: 'academicDegree',
name: '学位',
content: props.data.academicDegree,
},
{ {
par: 'professionalTitle', par: 'professionalTitle',
name: '职称', name: '职称',
@ -79,7 +75,7 @@ onMounted(() => {
content: props.data.politicalStatus, content: props.data.politicalStatus,
}, },
] ]
} else if (props.data.roleId[0] === '2') { } else if (props.data.roleId === 2) {
formModel.value = [ formModel.value = [
{ par: 'name', name: '姓名', content: props.data.name }, { par: 'name', name: '姓名', content: props.data.name },
{ par: 'sex', name: '性别', content: props.data.sex }, { par: 'sex', name: '性别', content: props.data.sex },

@ -1,34 +1,14 @@
<script setup> <script setup>
import { onMounted, ref, computed } from 'vue'
const props = defineProps({ const props = defineProps({
data: { username: String,
type: Object,
},
})
const username = ref()
const daysOnJob = ref()
const flagVisible = ref(true)
onMounted(() => {
username.value = props.data.name
const hireDate = new Date(props.data.joinWorkTime)
console.log(props.data.name, 'welcome')
//
const currentDate = new Date()
const millisecondsPerDay = 1000 * 60 * 60 * 24
daysOnJob.value = Math.floor((currentDate - hireDate) / millisecondsPerDay)
}) })
</script> </script>
<template> <template>
<div class="nav_info"> <div class="nav_info">
<div class="name"> <div class="name">
{{ username }} {{ props.username }}
</div>
<div class="intro" v-if="props.data.roleId[0] === '1'">
<p>今天是你工作的第{{ daysOnJob }}~~</p>
</div>
<div class="intro" v-else>
<p>Hell0,欢迎回来</p>
</div> </div>
<div class="intro">今天是你的第一天~~</div>
</div> </div>
</template> </template>
<style scoped> <style scoped>

@ -25,15 +25,17 @@ onMounted(() => {
sum = parseInt(sum) + 1 sum = parseInt(sum) + 1
localStorage.setItem('sum', sum.toString()) localStorage.setItem('sum', sum.toString())
console.log(sum, 'sum') console.log(sum, 'sum')
username.value = userStore.userName username.value = userStore.userName
data.value = userStore.data data.value = userStore.data
infoData.value = userStore.userInfo infoData.value = userStore.userInfo
// console.log(data.value, '11111') // console.log(data.value, '11111')
// console.log(userStore.userInfo, '22222') // console.log(userStore.userInfo, '22222')
// console.log(userStore, 'userStore')
username.value = data.value.username username.value = data.value.username
flag.value = true flag.value = true
role.value = data.value.roles[0] role.value = data.value.roles[0]
if (role.value === '1') { if (role.value === '老师') {
rightVisible.value = true rightVisible.value = true
} else { } else {
rightVisible.value = false rightVisible.value = false
@ -44,7 +46,7 @@ onMounted(() => {
<div class="container"> <div class="container">
<div class="left"> <div class="left">
<div class="nav"> <div class="nav">
<welcome :data="infoData" v-if="flag"></welcome> <welcome :username="username"></welcome>
</div> </div>
<div class="info" style="width: 100%; height: 368px"> <div class="info" style="width: 100%; height: 368px">
<Info :data="infoData" v-if="flag"></Info> <Info :data="infoData" v-if="flag"></Info>

@ -580,7 +580,7 @@ onUnmounted(() => {
// background: url('../../assets/images/background.jpg') no-repeat; // background: url('../../assets/images/background.jpg') no-repeat;
.loin_form { .loin_form {
position: relative; position: relative;
top: 20vh; top: 30vh;
width: 80%; width: 80%;
// background: url('../../assets/images/login_form.png') no-repeat; // background: url('../../assets/images/login_form.png') no-repeat;
// background-size: cover; // background-size: cover;

Loading…
Cancel
Save