提交 0a462e5c authored 作者: pengxiaohui's avatar pengxiaohui

fix: 首页路由引导按钮增加是否完成产品分析判断 [2217]

上级 117258ba
......@@ -40,7 +40,6 @@ export default {
} else {
if (['/user-study', '/market-tools'].includes(item.path)) {
const flag = await this.fetchWorkStatus()
console.log(flag)
if (flag) {
this.$router.push(item.path)
} else {
......
......@@ -20,6 +20,7 @@ import AppMenu from '@/components/base/AppMenu.vue'
import RoleSelect from '../components/RoleSelect.vue'
import Btn from '../components/Btn.vue'
import { selectRole } from '../api'
import { getWorkStatus } from '@/api/base.js'
export default {
components: { AppMenu, RoleSelect, Btn },
data() {
......@@ -51,11 +52,40 @@ export default {
}
},
methods: {
handleClick(item) {
if (!item.disabled.includes(this.role)) {
this.$router.push(item.path)
// handleClick(item) {
// if (!item.disabled.includes(this.role)) {
// this.$router.push(item.path)
// }
// },
async handleClick(item) {
if (this.role === 0) {
this.$message.error('请选择角色')
} else if (item.disabled.includes(this.role)) {
this.$message.error('您当前的角色禁止访问该页面')
} else {
if (['/user-study', '/market-tools'].includes(item.path)) {
const flag = await this.fetchWorkStatus()
if (flag) {
this.$router.push(item.path)
} else {
this.$message.error('请先完成产品分析报告,再进行' + item.label)
}
} else {
this.$router.push(item.path)
}
}
},
fetchWorkStatus() {
return new Promise((resolve) => {
getWorkStatus().then(res => {
if (res.code === 0 && res.data && res.data.case_status) {
resolve(true)
} else {
resolve(false)
}
}).catch(() => resolve(false))
})
},
menuSelect(item) {
this.$router.push(item.path)
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论