Commit 0f12e5c8 authored by 姬鋆屾's avatar 姬鋆屾

parent f230b2cb
<template> <template>
<div class="page page-home"> <div class="page page-home">
<!-- 欢迎你,{{userData}} --> <!-- 欢迎你,{{userData}} -->
<el-row type="flex" align="top" justify="space-between" :gutter="40"> <el-row type="flex" align="top" justify="space-between" :gutter="40">
<el-col :span="6" :xs="12"> <el-col :span="6" :xs="12">
<el-card> <el-card>
<div class="data_left"> <div class="data_left">
<div class="title" style="margin-bottom:40px">今日数据洞察</div> <div class="title" style="margin-bottom:40px">今日数据洞察</div>
<div class="cell1"> <div class="cell1">
<div class="title">人事数据</div> <div class="title">人事数据</div>
<div class="datas flex flex-align-center flex-pack-justify flex_warp"> <div
<div class="item"> class="datas flex flex-align-center flex-pack-justify flex_warp"
<div>总人数</div> >
<div>{{homeStat.totalPersonNum}}</div> <div class="item">
</div> <div>总人数</div>
<div class="item"> <div>{{ homeStat.totalPersonNum }}</div>
<div>部门人数</div> </div>
<div>{{homeStat.totalDeptNum}}</div> <div class="item">
</div> <div>部门人数</div>
</div> <div>{{ homeStat.totalDeptNum }}</div>
</div> </div>
<div class="cell1"> </div>
<div class="title">考勤数据</div> </div>
<div class="datas flex flex-align-center flex-pack-justify flex_warp"> <div class="cell1">
<div class="item"> <div class="title">考勤数据</div>
<div>打卡人数</div> <div
<div>{{homeStat.attendPersonNum}}</div> class="datas flex flex-align-center flex-pack-justify flex_warp"
</div> >
<div class="item"> <div class="item">
<div>出勤率</div> <div>打卡人数</div>
<div>{{homeStat.attendRadio}}%</div> <div>{{ homeStat.attendPersonNum }}</div>
</div> </div>
<div class="item"> <div class="item">
<div>请假人数</div> <div>出勤率</div>
<div>{{homeStat.levealPersonNum}}</div> <div>{{ homeStat.attendRadio }}%</div>
</div> </div>
<div class="item"> <div class="item">
<div>迟到人数</div> <div>请假人数</div>
<div>{{homeStat.latePersonNum}}</div> <div>{{ homeStat.levealPersonNum }}</div>
</div> </div>
<div class="item"> <div class="item">
<div>早退人数</div> <div>迟到人数</div>
<div>{{homeStat.leftEarlyPersonNum}}</div> <div>{{ homeStat.latePersonNum }}</div>
</div> </div>
<div class="item"> <div class="item">
<div>缺卡人数</div> <div>早退人数</div>
<div>{{homeStat.missCardPersonNum}}</div> <div>{{ homeStat.leftEarlyPersonNum }}</div>
</div> </div>
</div> <div class="item">
</div> <div>缺卡人数</div>
</div> <div>{{ homeStat.missCardPersonNum }}</div>
</el-card> </div>
</el-col> </div>
<el-col :span="18" :xs="12"> </div>
<el-card class="right_card"> </div>
<div class="data_right"> </el-card>
<div class="title">科学化、精细化、以人为本知行合一的管理理念</div> </el-col>
<div class="textWord"> <el-col :span="18" :xs="12">
坚持政治性与人民性的根本遵循、制度化与规范化的根本依托、考人与考事的相互结合<br> <el-card class="right_card">
创新性与技术性的重要支撑以及效能性与发展性的不懈追求 <div class="data_right">
</div> <div class="title">科学化、精细化、以人为本知行合一的管理理念</div>
<div class="selectBars flex flex-align-center flex-pack-justify flex_warp"> <div class="textWord">
<div class="Bar_item" v-for="(item, index) in barList" :key="index" 坚持政治性与人民性的根本遵循、制度化与规范化的根本依托、考人与考事的相互结合<br />
@click="tabChildren(item.barName)"> 创新性与技术性的重要支撑以及效能性与发展性的不懈追求
<div class="icon"> </div>
<img :src="item.icon"> <div
</div> class="selectBars flex flex-align-center flex-pack-justify flex_warp"
<div class="barnam">{{ item.barName }}</div> >
<div class="des" v-html="item.desc"></div> <div
</div> class="Bar_item"
</div> v-for="(item, index) in barList"
</div> :key="index"
</el-card> @click="tabChildren(item.barName)"
</el-col> >
</el-row> <div class="icon">
</div> <img :src="item.icon" />
</div>
<div class="barnam">{{ item.barName }}</div>
<div class="des" v-html="item.desc"></div>
</div>
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template> </template>
<script> <script>
export default { export default {
computed: { computed: {
userData() { userData() {
return this.$store.state.userData; return this.$store.state.userData;
},
menu() {
return this.mapMenu(this.userData.barList);
},
},
data() {
return {
// 数据洞察
homeStat: {
totalPersonNum: 0, //总人数
totalDeptNum: 0, //部门数
attendPersonNum: 0, //考勤人数
attendRadio: 0, //出勤率
levealPersonNum: 0, //请假人数
latePersonNum: 0, //迟到人数
leftEarlyPersonNum: 0, //早退人数
missCardPersonNum: 0, //缺卡人数
},
barList: [
{
icon: require("@/assets/images/u148.png"),
barName: "智能人事",
desc:
"提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能",
navList: [],
},
{
icon: require("@/assets/images/u153.png"),
barName: "考勤打卡",
desc:
"提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能",
navList: [],
},
{
icon: require("@/assets/images/u158.png"),
barName: "绩效管理",
desc:
"根据部门/个人承担的目标和任务完成情况以及工作<br>评价结果、加减分纪实现考核结果自动生成。",
navList: [],
}, },
menu() { // {
return this.mapMenu(this.userData.barList) // icon: require('@/assets/images/u167.png'),
// barName: 'OA审批',
// desc: '无纸化审批流程,轻松完成打卡请假、移动审批等<br>操作,审批资料查找方便',
// navList: []
// },
// {
// icon: require('@/assets/images/u172.png'),
// barName: '数据分析',
// desc: '完整团队经营状态的数字化,人财物事数据分析<br>展示,为管理提供智能决策依据',
// navList: []
// },
{
icon: require("@/assets/images/u177.png"),
barName: "系统设置",
desc:
"提供包括RBAC用户-角色-权限管理、版本管理、<br>操作及登录日志管理等功能",
navList: [],
},
],
};
},
created() {
this.$store.commit("setHeadBar", []);
this.$store.commit("setCurrentParentName", "");
this.$store.commit("setCurrentThirdArr", []);
this.$store.commit("setCurrentSecondPath", "");
this.$store.commit("setThirdPath", "");
this.homeNum();
},
methods: {
tabChildren(name) {
console.log("name:" + name);
this.$store.commit("setCurrentParentName", name); //存储选择路由
let result = this.menu.find((item) => item.name === name);
this.$store.commit("setHeadBar", result);
console.log("result:", result);
if (result) {
// 路由跳转
if (result.children.length > 0) {
this.$store.commit("setCurrentThirdArr", result.children[0].children);
this.$store.commit("setCurrentSecondPath", result.children[0].path);
this.$store.commit("setThirdPath", result.children[0].path);
this.$router.push({ path: result.children[0].path });
} else {
this.$message.error("暂未完成添加");
} }
} else {
this.$message.error("暂无权限");
}
}, },
data() { mapMenu(arr) {
if (arr.length === 0) return [];
let result = arr.map((item) => {
const url = item.url
? item.url
: item.childList[0]
? item.childList[0].url || ""
: "";
return { return {
// 数据洞察 name: item.name,
homeStat:{ path: url,
totalPersonNum:0,//总人数 id: item.id,
totalDeptNum:0,//部门数 icon: item.imgPath,
attendPersonNum:0,//考勤人数 children:
attendRadio:0,//出勤率 item.childList.length === 0 ? [] : this.mapMenu(item.childList),
levealPersonNum:0,//请假人数 };
latePersonNum:0,//迟到人数 });
leftEarlyPersonNum:0,//早退人数 return result;
missCardPersonNum:0,//缺卡人数
},
barList: [
{
icon: require('@/assets/images/u148.png'),
barName: '智能人事',
desc: '提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能',
navList: []
},
{
icon: require('@/assets/images/u153.png'),
barName: '考勤打卡',
desc: '提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能',
navList: []
},
{
icon: require('@/assets/images/u158.png'),
barName: '绩效管理',
desc: '根据部门/个人承担的目标和任务完成情况以及工作<br>评价结果、加减分纪实现考核结果自动生成。',
navList: []
},
// {
// icon: require('@/assets/images/u167.png'),
// barName: 'OA审批',
// desc: '无纸化审批流程,轻松完成打卡请假、移动审批等<br>操作,审批资料查找方便',
// navList: []
// },
// {
// icon: require('@/assets/images/u172.png'),
// barName: '数据分析',
// desc: '完整团队经营状态的数字化,人财物事数据分析<br>展示,为管理提供智能决策依据',
// navList: []
// },
{
icon: require('@/assets/images/u177.png'),
barName: '系统设置',
desc: '提供包括RBAC用户-角色-权限管理、版本管理、<br>操作及登录日志管理等功能',
navList: []
}
]
}
},
created() {
this.$store.commit('setHeadBar', [])
this.$store.commit("setCurrentParentName", '')
this.$store.commit('setCurrentThirdArr', [])
this.$store.commit('setCurrentSecondPath', '')
this.$store.commit('setThirdPath', '')
this.homeNum()
}, },
methods: { // 查询统计数据
homeNum() {
tabChildren(name) { this.$post("/login/index").then((res) => {
console.log("name:" + name) const { code, data } = res;
this.$store.commit("setCurrentParentName", name)//存储选择路由 if (code == 1) {
let result = this.menu.find(item => item.name === name) this.homeStat = Object.assign({}, this.homeStat, data.homeStat);
this.$store.commit('setHeadBar', result) console.log(data, "####");
console.log("result:", result)
// 路由跳转
if (result.children.length > 0) {
this.$store.commit('setCurrentThirdArr', result.children[0].children)
this.$store.commit('setCurrentSecondPath', result.children[0].path)
this.$store.commit('setThirdPath', result.children[0].path)
this.$router.push({ path: result.children[0].path })
} else {
this.$message.error('暂未完成添加');
}
},
mapMenu(arr) {
if (arr.length === 0) return []
let result = arr.map(item => {
const url = item.url
? item.url
: item.childList[0]
? item.childList[0].url || ""
: "";
return {
name: item.name,
path: url,
id: item.id,
icon: item.imgPath,
children: item.childList.length === 0 ? [] : this.mapMenu(item.childList)
}
})
return result
},
// 查询统计数据
homeNum() {
this.$post("/login/index").then((res) => {
const { code, data } = res
if (code == 1) {
this.homeStat = Object.assign({},this.homeStat,data.homeStat)
console.log(data,"####")
}
});
} }
} });
} },
},
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.page-home { .page-home {
width: 100%; width: 100%;
min-width: 1400px; min-width: 1400px;
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
// padding: 2% 5%; // padding: 2% 5%;
background-color: #f3f2f2; background-color: #f3f2f2;
.data_left {
padding: 50px 20px 0 20px;
.cell1 { .data_left {
font-size: 16px; padding: 50px 20px 0 20px;
.title { .cell1 {
color: #409EFF; font-size: 16px;
margin-bottom: 20px;
}
.item { .title {
text-align: left; color: #409eff;
width: 50%; margin-bottom: 20px;
margin-bottom: 20px; }
}
.item div:first-child { .item {
color: gray; text-align: left;
margin-bottom: 20px; width: 50%;
} margin-bottom: 20px;
}
border-bottom: 1px solid rgb(245, 245, 245); .item div:first-child {
padding: 10px 0; color: gray;
} margin-bottom: 20px;
}
.cell1:last-child { border-bottom: 1px solid rgb(245, 245, 245);
border: none padding: 10px 0;
}
} }
// 数据标题 .cell1:last-child {
.data_left>.title, border: none;
.data_right>.title {
text-align: center;
font-size: 22px;
font-weight: bold;
} }
}
.right_card { // 数据标题
background-image: url('~@/assets/images/u162.svg'); .data_left > .title,
background-repeat: no-repeat; .data_right > .title {
background-size: 100% auto; text-align: center;
background-position: bottom; font-size: 22px;
} font-weight: bold;
}
// 导航栏 .right_card {
.data_right { background-image: url("~@/assets/images/u162.svg");
padding-top: 40px; background-repeat: no-repeat;
.textWord { background-size: 100% auto;
text-align: center; background-position: bottom;
margin-top: 30px; }
font-size: 16px;
line-height: 1.5em;
}
}
.selectBars { // 导航栏
padding: 0 20px; .data_right {
padding-top: 40px;
.textWord {
text-align: center;
margin-top: 30px;
font-size: 16px;
line-height: 1.5em;
} }
}
.Bar_item { .selectBars {
width: 30%; padding: 0 20px;
margin-top: 50px; }
border-radius: 10px;
padding: 20px 0;
text-align: center;
background: linear-gradient(90deg, rgba(187, 193, 255, 0.3), rgb(235, 235, 235));
cursor: pointer;
.icon img { .Bar_item {
width: 40px; width: 30%;
height: 40px; margin-top: 50px;
} border-radius: 10px;
padding: 20px 0;
text-align: center;
background: linear-gradient(
90deg,
rgba(187, 193, 255, 0.3),
rgb(235, 235, 235)
);
cursor: pointer;
.barnam { .icon img {
font-size: 18px; width: 40px;
margin-top: 10px; height: 40px;
} }
.des { .barnam {
font-size: 14px; font-size: 18px;
color: #666; margin-top: 10px;
margin-top: 15px;
}
} }
.des {
font-size: 14px;
color: #666;
margin-top: 15px;
}
}
} }
::v-deep .el-row, ::v-deep .el-row,
::v-deep .el-col { ::v-deep .el-col {
height: 100%; height: 100%;
} }
::v-deep .el-card { ::v-deep .el-card {
height: 100%; height: 100%;
}</style> }
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment