学生开学发起基本信息确认功能,点击按钮跳转到基本信息页面

This commit is contained in:
2026-02-27 16:57:40 +08:00
parent 135967d1c4
commit 12be6d948e

View File

@@ -6,8 +6,27 @@
<Index3 v-else-if="showRole == 3" /> <Index3 v-else-if="showRole == 3" />
<Index4 v-else-if="showRole == 4" /> <Index4 v-else-if="showRole == 4" />
<Index1 v-else/> --> <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> </div>
</template> </template>
<script> <script>
import Index1 from '@/views/Home/index-1.vue' import Index1 from '@/views/Home/index-1.vue'
@@ -16,6 +35,8 @@ import Index3 from '@/views/Home/index-3.vue'
import Index4 from '@/views/Home/index-4.vue' import Index4 from '@/views/Home/index-4.vue'
import indexNew from './Home/index-new-blue.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 { export default {
name: 'Index', name: 'Index',
@@ -29,7 +50,7 @@ export default {
data() { data() {
return { return {
showRole: 0, showRole: 0,
infoConfirmDialogVisible: false // 控制信息确认弹窗显示
} }
}, },
watch: { watch: {
@@ -37,7 +58,6 @@ export default {
}, },
created() { created() {
let temp = this.$store.getters.roles let temp = this.$store.getters.roles
let role = 0
temp.map(x => { temp.map(x => {
if (x == 'admin') { if (x == 'admin') {
this.showRole = 1 this.showRole = 1
@@ -60,9 +80,39 @@ export default {
} }
}) })
// 如果是学生角色,检查是否需要显示信息确认弹窗
if (this.showRole === 4) {
this.checkShowInfoConfirmDialog()
}
}, },
methods: { 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> </script>