From 8223e2aa3eea90a97560ed988be73f614e53cc90 Mon Sep 17 00:00:00 2001
From: flower-string <2178503051@qq.com>
Date: Fri, 7 Mar 2025 14:45:30 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E4=BF=AE=E6=94=B9temp?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BB=93=E6=9E=84=E5=92=8C=E8=B7=AF=E7=94=B1?=
=?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=81=8A=E5=A4=A9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../layout/components/ChatComponent/index.vue | 8 +-
ruoyi-ui/src/layout/components/Navbar.vue | 9 +-
ruoyi-ui/src/router/index.js | 23 ++-
ruoyi-ui/src/views/index.vue | 2 +-
ruoyi-ui/src/views/temp.vue | 139 +++++++++++++++---
5 files changed, 151 insertions(+), 30 deletions(-)
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