Files
zhxg_pc/src/views/index.vue

119 lines
3.5 KiB
Vue
Raw Normal View History

2025-07-28 15:52:07 +08:00
<template>
2025-10-18 17:13:04 +08:00
<div id="main">
<indexNew />
<!-- <Index1 v-if="showRole == 1" />
2025-07-28 15:52:07 +08:00
<Index2 v-else-if="showRole == 2" />
<Index3 v-else-if="showRole == 3" />
<Index4 v-else-if="showRole == 4" />
<Index1 v-else/> -->
<!-- 学生信息确认弹窗 -->
<el-dialog
title="学生信息确认"
:visible.sync="infoConfirmDialogVisible"
width="500px"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
>
<div style="text-align: center;">
<p>为了确保您的信息准确无误请确认并完善个人信息</p>
<p>点击下方按钮前往信息修改页面进行确认</p>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center;">
<el-button type="primary" @click="goToEditInfo">去确认信息</el-button>
</div>
</el-dialog>
2025-10-18 17:13:04 +08:00
</div>
2025-07-28 15:52:07 +08:00
</template>
2025-07-28 15:52:07 +08:00
<script>
2025-10-18 17:13:04 +08:00
import Index1 from '@/views/Home/index-1.vue'
import Index2 from '@/views/Home/index-2.vue'
import Index3 from '@/views/Home/index-3.vue'
import Index4 from '@/views/Home/index-4.vue'
2025-07-28 15:52:07 +08:00
2025-10-18 17:13:04 +08:00
import indexNew from './Home/index-new-blue.vue'
import {getConfigKey} from '@/api/system/config'
import research from '@/views/teacher/basicmessage/research/index.vue';
2025-07-28 15:52:07 +08:00
export default {
2025-10-18 17:13:04 +08:00
name: 'Index',
2025-07-28 15:52:07 +08:00
components: {
Index1,
Index2,
Index3,
Index4,
indexNew
},
data() {
return {
showRole: 0,
infoConfirmDialogVisible: false // 控制信息确认弹窗显示
2025-07-28 15:52:07 +08:00
}
2025-10-18 17:13:04 +08:00
},
watch: {
2025-07-28 15:52:07 +08:00
},
created() {
2025-10-18 17:13:04 +08:00
let temp = this.$store.getters.roles
2025-07-28 15:52:07 +08:00
temp.map(x => {
2025-10-18 17:13:04 +08:00
if (x == 'admin') {
this.showRole = 1
2025-07-28 15:52:07 +08:00
}
2025-10-18 17:13:04 +08:00
if (x == 'test') { //学工
this.showRole = 1
2025-07-28 15:52:07 +08:00
}
2025-10-18 17:13:04 +08:00
if (x == 'stumanger') { //学务
this.showRole = 2
2025-07-28 15:52:07 +08:00
}
2025-10-18 17:13:04 +08:00
if (x == 'testteacher') { //辅导员
this.showRole = 3
2025-07-28 15:52:07 +08:00
}
2025-10-18 17:13:04 +08:00
if (x == 'teststu') { //学生
this.showRole = 4
2025-07-28 15:52:07 +08:00
}
2025-10-18 17:13:04 +08:00
})
2025-07-28 15:52:07 +08:00
// 如果是学生角色,检查是否需要显示信息确认弹窗
if (this.showRole === 4) {
this.checkShowInfoConfirmDialog()
}
2025-07-28 15:52:07 +08:00
},
methods: {
// 检查是否显示信息确认弹窗
async checkShowInfoConfirmDialog() {
try {
// 调用API获取系统参数sys.stu.ConfirmDialogVisible
const res = await getConfigKey('sys.stu.ConfirmDialogVisible');
const paramValue = res.msg
// 如果参数值为 true则显示弹窗
if (paramValue === 'true') {
this.infoConfirmDialogVisible = true
}
} catch (error) {
console.error('获取系统参数失败:', error)
// 默认开启弹窗(容错处理)
this.infoConfirmDialogVisible = true
}
},
// 跳转到信息修改页面
goToEditInfo() {
// 关闭弹窗
this.infoConfirmDialogVisible = false
// 设置已确认标记,避免下次重复弹出
// localStorage.setItem('studentInfoConfirmed', 'true')
// 跳转到信息修改页面
this.$router.push('/basedata/stuOwnInfo/edit')
}
2025-07-28 15:52:07 +08:00
}
}
</script>
<style lang="scss" scoped></style>