2024-07-07 21:09:28 +08:00
|
|
|
<template>
|
2024-12-30 16:44:53 +08:00
|
|
|
<div class="home">
|
2025-02-24 21:25:49 +08:00
|
|
|
<div v-if="currentRole.roleKey==='temp'">
|
|
|
|
|
<div class="onboarding-homepage">
|
|
|
|
|
<!-- 提示信息 -->
|
|
|
|
|
<el-alert
|
|
|
|
|
title="欢迎加入,请尽快补充您的必要信息!"
|
|
|
|
|
type="info"
|
|
|
|
|
show-icon>
|
|
|
|
|
</el-alert>
|
|
|
|
|
|
|
|
|
|
<!-- 数据补充表单 -->
|
|
|
|
|
<el-form :model="employeeData" class="employee-form" label-width="80px">
|
|
|
|
|
<el-form-item label="姓名">
|
|
|
|
|
<el-input v-model="employeeData.name"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="邮箱">
|
|
|
|
|
<el-input v-model="employeeData.email"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- 根据实际需求添加更多字段 -->
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<!-- 流程图 -->
|
|
|
|
|
<div class="flow-chart">
|
|
|
|
|
<el-steps :active="activeStep" finish-status="success">
|
|
|
|
|
<el-step title="填写信息"></el-step>
|
|
|
|
|
<el-step title="审批中"></el-step>
|
|
|
|
|
<el-step title="完成"></el-step>
|
|
|
|
|
</el-steps>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
2024-12-30 16:44:53 +08:00
|
|
|
<el-container style="height: 100vh;">
|
2025-02-24 21:25:49 +08:00
|
|
|
<el-main>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<!-- 右侧展示区域 -->
|
|
|
|
|
<el-col :span="18" class="content-area">
|
|
|
|
|
<announcements />
|
|
|
|
|
<financial-charts />
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<!-- 左侧功能区域 -->
|
|
|
|
|
<el-col :span="6" class="sidebar">
|
|
|
|
|
<quick-access />
|
|
|
|
|
<inventory />
|
|
|
|
|
<project-management />
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-main>
|
|
|
|
|
|
2024-12-30 16:44:53 +08:00
|
|
|
|
|
|
|
|
</el-container>
|
2025-02-24 21:25:49 +08:00
|
|
|
|
|
|
|
|
</div>
|
2024-07-07 21:09:28 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getCache } from "@/api/monitor/cache";
|
2024-12-30 16:44:53 +08:00
|
|
|
import { getFinishedCount, getOwnCount, getTodoListCount } from "@/api/oa/homeCount";
|
|
|
|
|
import { getNotice, listNoticeLimit } from "@/api/system/notice";
|
|
|
|
|
import QuickAccess from "../components/QuickAccess/index.vue";
|
|
|
|
|
import Inventory from "../components/Inventory/index.vue";
|
|
|
|
|
import Announcements from "../components/Announcements/index.vue";
|
|
|
|
|
import ProjectManagement from "../components/ProjectManagement/index.vue";
|
|
|
|
|
import FinancialCharts from "../components/FinancialCharts/index.vue";
|
2025-02-24 21:25:49 +08:00
|
|
|
import {currentRole} from "@/api/system/role";
|
2024-12-30 16:44:53 +08:00
|
|
|
|
2024-07-07 21:09:28 +08:00
|
|
|
export default {
|
|
|
|
|
name: "Index",
|
2024-12-30 16:44:53 +08:00
|
|
|
components: {
|
|
|
|
|
FinancialCharts,
|
|
|
|
|
ProjectManagement,
|
|
|
|
|
Announcements,
|
|
|
|
|
Inventory,
|
|
|
|
|
QuickAccess,
|
|
|
|
|
},
|
2024-07-07 21:09:28 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
2025-02-24 21:25:49 +08:00
|
|
|
// 新员工填写的信息
|
|
|
|
|
employeeData: {
|
|
|
|
|
name: "",
|
|
|
|
|
email: "",
|
|
|
|
|
// 其他必要字段
|
|
|
|
|
},
|
|
|
|
|
// 当前步骤,从 0 开始计数
|
|
|
|
|
activeStep: 0,
|
2024-07-07 21:09:28 +08:00
|
|
|
version: "0.8.3",
|
|
|
|
|
commandstats: null,
|
|
|
|
|
usedmemory: null,
|
|
|
|
|
cache: [],
|
|
|
|
|
finishedCount: 0,
|
|
|
|
|
todoListCount: 0,
|
|
|
|
|
ownCount: 0,
|
2024-12-30 16:44:53 +08:00
|
|
|
noticeList: [],
|
2024-07-07 21:09:28 +08:00
|
|
|
noticeTitle: '',
|
2024-12-30 16:44:53 +08:00
|
|
|
noticeContent: '',
|
2024-07-07 21:09:28 +08:00
|
|
|
drawer: false,
|
2025-02-24 21:25:49 +08:00
|
|
|
currentRole:{}
|
2024-07-07 21:09:28 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
2025-02-24 21:25:49 +08:00
|
|
|
this.getCurrentUserRole();
|
2024-07-07 21:09:28 +08:00
|
|
|
this.getList();
|
2024-12-30 16:44:53 +08:00
|
|
|
this.getListNotice();
|
2024-07-07 21:09:28 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2025-02-24 21:25:49 +08:00
|
|
|
submitForm() {
|
|
|
|
|
// 这里可以加入表单验证与提交逻辑
|
|
|
|
|
// 模拟提交后进入下一流程(例如审批中)
|
|
|
|
|
this.activeStep = 1;
|
|
|
|
|
this.$message({
|
|
|
|
|
message: "表单提交成功,进入审批流程!",
|
|
|
|
|
type: "success"
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getCurrentUserRole(){
|
|
|
|
|
currentRole().then(res => {
|
|
|
|
|
this.currentRole = res.data;
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-07-07 21:09:28 +08:00
|
|
|
getList() {
|
|
|
|
|
getCache().then((response) => {
|
|
|
|
|
this.cache = response.data;
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getListNotice() {
|
|
|
|
|
this.loading = true;
|
2024-12-30 16:44:53 +08:00
|
|
|
listNoticeLimit().then((response) => {
|
2024-07-07 21:09:28 +08:00
|
|
|
this.noticeList = response;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-12-30 16:44:53 +08:00
|
|
|
toDrawer(nid) {
|
|
|
|
|
this.drawer = true;
|
|
|
|
|
getNotice(nid).then((res) => {
|
2024-07-07 21:09:28 +08:00
|
|
|
this.noticeTitle = res.data.noticeTitle;
|
|
|
|
|
this.noticeContent = res.data.noticeContent;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
goTarget(href) {
|
2024-12-30 16:44:53 +08:00
|
|
|
this.$router.push({path: href});
|
2024-07-07 21:09:28 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2025-02-24 21:25:49 +08:00
|
|
|
.onboarding-homepage {
|
|
|
|
|
max-width: 800px;
|
|
|
|
|
margin: 20px auto;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
}
|
|
|
|
|
.employee-form {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
}
|
|
|
|
|
.flow-chart {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
}
|
2024-12-30 16:44:53 +08:00
|
|
|
/* 栅格列样式 */
|
|
|
|
|
.content-area {
|
|
|
|
|
background: #fff;
|
|
|
|
|
}
|
2024-07-07 21:09:28 +08:00
|
|
|
|
2024-12-30 16:44:53 +08:00
|
|
|
/* 左侧功能区域 */
|
|
|
|
|
.sidebar {
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
}
|
2024-07-07 21:09:28 +08:00
|
|
|
|
2024-12-30 16:44:53 +08:00
|
|
|
/* 响应式隐藏侧边栏 */
|
|
|
|
|
@media screen and (max-width: 768px) {
|
|
|
|
|
.sidebar {
|
|
|
|
|
display: none;
|
2024-07-07 21:09:28 +08:00
|
|
|
}
|
2024-11-20 21:02:30 +08:00
|
|
|
|
2024-12-30 16:44:53 +08:00
|
|
|
.content-area {
|
|
|
|
|
width: 100% !important;
|
2024-07-07 21:09:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|