学生开学发起基本信息确认功能,点击按钮跳转到基本信息页面
This commit is contained in:
@@ -6,8 +6,27 @@
|
||||
<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'
|
||||
@@ -16,6 +35,8 @@ 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',
|
||||
@@ -29,7 +50,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
showRole: 0,
|
||||
|
||||
infoConfirmDialogVisible: false // 控制信息确认弹窗显示
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -37,7 +58,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
let temp = this.$store.getters.roles
|
||||
let role = 0
|
||||
temp.map(x => {
|
||||
if (x == 'admin') {
|
||||
this.showRole = 1
|
||||
@@ -60,10 +80,40 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
// 如果是学生角色,检查是否需要显示信息确认弹窗
|
||||
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>
|
||||
<style lang="scss" scoped></style>
|
||||
Reference in New Issue
Block a user