Files
zhxg_pc/src/views/index.vue

119 lines
3.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div id="main">
<indexNew />
<!-- <Index1 v-if="showRole == 1" />
<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>
</div>
</template>
<script>
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'
import indexNew from './Home/index-new-blue.vue'
import {getConfigKey} from '@/api/system/config'
import research from '@/views/teacher/basicmessage/research/index.vue';
export default {
name: 'Index',
components: {
Index1,
Index2,
Index3,
Index4,
indexNew
},
data() {
return {
showRole: 0,
infoConfirmDialogVisible: false // 控制信息确认弹窗显示
}
},
watch: {
},
created() {
let temp = this.$store.getters.roles
temp.map(x => {
if (x == 'admin') {
this.showRole = 1
}
if (x == 'test') { //学工
this.showRole = 1
}
if (x == 'stumanger') { //学务
this.showRole = 2
}
if (x == 'testteacher') { //辅导员
this.showRole = 3
}
if (x == 'teststu') { //学生
this.showRole = 4
}
})
// 如果是学生角色,检查是否需要显示信息确认弹窗
if (this.showRole === 4) {
this.checkShowInfoConfirmDialog()
}
},
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')
}
}
}
</script>
<style lang="scss" scoped></style>