You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1014 B
Vue

<template>
<div>
<el-button type="primary" plain icon="el-icon-s-data" size="mini" @click="goto">
</el-button>
</div>
</template>
<script>
import {selectSecnes} from '@/api/board/nav'
export default {
name: 'RuoYiGit',
data() {
return {
url: 'https://gitee.com/y_project/RuoYi-Cloud'
}
},
methods: {
goto() {
if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
this.$router.push({path: "/board/index"});
} else {
selectSecnes().then((e)=>{
let data = e.data.find(e=> e.defaultFlag === '1') || null
debugger
if(!data){
data = e.data[0]
}
debugger
this.$store.dispatch('app/setSceneId', data.sceneId)
this.$router.push({path: '/board/'+data.router+'?name='+data.sceneName})
})
// this.$router.push({path: '/board/smartScene'})
}
}
}
}
</script>