Compare commits

..

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

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

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

@ -1,34 +1,14 @@
<script setup>
import { onMounted, ref, computed } from 'vue'
const props = defineProps({
data: {
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)
username: String,
})
</script>
<template>
<div class="nav_info">
<div class="name">
{{ username }}
</div>
<div class="intro" v-if="props.data.roleId[0] === '1'">
<p>今天是你工作的第{{ daysOnJob }}~~</p>
</div>
<div class="intro" v-else>
<p>Hell0,欢迎回来</p>
{{ props.username }}
</div>
<div class="intro">今天是你的第一天~~</div>
</div>
</template>
<style scoped>

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

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

Loading…
Cancel
Save