diff --git a/ruoyi-ui/src/layout/components/ChatComponent/index.vue b/ruoyi-ui/src/layout/components/ChatComponent/index.vue index 5ef091e..08a98c4 100644 --- a/ruoyi-ui/src/layout/components/ChatComponent/index.vue +++ b/ruoyi-ui/src/layout/components/ChatComponent/index.vue @@ -57,11 +57,10 @@ export default { name: 'ChatComponent', props:{ drawerVisible:Boolean, - }, + data() { return { - contacts: [], // 联系人列表 selectedContact: null, // 当前选中的联系人 chatHistory: [], // 当前聊天记录 @@ -82,7 +81,10 @@ export default { // 关闭聊天窗口 handleClose() { - this.drawerVisible = false; + console.log("关闭聊天窗口"); + // props是只读的,不能直接修改,需要通过$emit通知父组件关闭 + // this.drawerVisible = false; + this.$emit('close'); // 通知父组件关闭聊天窗口 }, diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 3612fcf..2b900ca 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -14,8 +14,8 @@
- 打开聊天 - + 打开聊天 +
@@ -142,6 +142,11 @@ export default { this.$store.dispatch('app/toggleSideBar') }, + hiddenChat() { + this.chat = false; + console.log(this.chat, '关闭chat'); + }, + getUser() { getUserProfile().then(response => { this.user = response.data.user; diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index c01c9c9..f314430 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -85,14 +85,25 @@ export const constantRoutes = [ }) } }, - { - path: 'temp', - component: () => import('@/views/temp'), - name: 'Temp', - meta: { title: '临时页面', icon: 'dashboard', affix: true } - } ] }, + { + path: '/temp', + component: () => import('@/views/temp'), + name: 'Temp', + meta: { title: '临时页面', icon: 'dashboard', affix: true }, + beforeEnter: (to, from, next) => { + // 从本地存储获取角色信息 + currentRole().then(res => { + const role = res.data.roleKey; + if (role === 'temp') { + next() + } else { + next('/index') // 重定向到工作台 + } + }) + } + }, { path: '/tool', component: Layout, diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index f95338f..0e747ca 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -2,7 +2,7 @@
- + diff --git a/ruoyi-ui/src/views/temp.vue b/ruoyi-ui/src/views/temp.vue index c651634..52395c3 100644 --- a/ruoyi-ui/src/views/temp.vue +++ b/ruoyi-ui/src/views/temp.vue @@ -1,5 +1,14 @@ @@ -66,7 +96,7 @@ export default { data() { return { - showForm: false, + currentStep: 0, // 0-开启流程 1-填写资料 2-等待审核 loading: false, employeeData: { name: "", @@ -78,18 +108,68 @@ export default { async startOnboarding() { this.loading = true try { - // 模拟API请求 await new Promise(resolve => setTimeout(resolve, 1500)) - this.showForm = true + this.currentStep = 1 } finally { this.loading = false } - } + }, + submitForm() { + // 这里添加实际提交逻辑 + this.currentStep = 2 + }, + async logout() { + this.$confirm('确定注销并退出系统吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = process.env.VUE_APP_CONTEXT_PATH + "index"; + }) + }).catch(() => { + }); + }, } } \ No newline at end of file