|
@@ -49,6 +49,28 @@
|
|
|
}
|
|
|
.right-content{
|
|
|
width: calc(100% - 60px);
|
|
|
+ .tool-bar{
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ padding: 0 15px;
|
|
|
+ border-bottom: solid 1px #DEE0E3;
|
|
|
+ display: flex;
|
|
|
+ &>div{
|
|
|
+ flex: auto;
|
|
|
+ span:first-child{
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ span:nth-child(3){
|
|
|
+ margin-left: 50px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &>p{
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .route-area{
|
|
|
+ height: calc(100% - 60px);
|
|
|
+ }
|
|
|
}
|
|
|
.seting-bt{
|
|
|
color: white;
|
|
@@ -58,6 +80,17 @@
|
|
|
bottom: 20px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+.dialog-style{
|
|
|
+ /deep/ .el-dialog__body{
|
|
|
+ height: 500px;
|
|
|
+ padding: 10px 20px;
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+ p{
|
|
|
+ font-size: 16px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<template>
|
|
|
<div class="main-page">
|
|
@@ -75,34 +108,97 @@
|
|
|
</ul>
|
|
|
<i class="el-icon-s-release seting-bt" @click="logout"></i>
|
|
|
</div>
|
|
|
- <router-view class="right-content"></router-view>
|
|
|
+ <div class="right-content">
|
|
|
+ <div class="tool-bar">
|
|
|
+ <div>
|
|
|
+ <span v-if="ableChangeUser">查看计划:{{$store.state.checkUser.name}}</span>
|
|
|
+ <el-button type="primary" icon="el-icon-edit" circle v-if="ableChangeUser" @click="personChange = true;currentUser = JSON.parse(JSON.stringify($store.state.checkUser))"></el-button>
|
|
|
+ </div>
|
|
|
+ <p>
|
|
|
+ <label>年度总目标:{{currentPlan.name}}</label>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <router-view class="route-area"></router-view>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ class="dialog-style"
|
|
|
+ title="切换成员"
|
|
|
+ :visible.sync="personChange"
|
|
|
+ width="500px">
|
|
|
+ <p>查看:{{currentUser.name}}</p>
|
|
|
+ <UserTree @chooseUser="chooseUser"></UserTree>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="personChange = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="changeCheckUser">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getCurrent } from '@/api/year';
|
|
|
import { logout } from "@/api/login";
|
|
|
+import UserTree from "@/components/MainPage/Department/UserTree";
|
|
|
+
|
|
|
export default {
|
|
|
name: 'MainPage',
|
|
|
components: {
|
|
|
+ UserTree
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- list:[{
|
|
|
- name: '待办',
|
|
|
- src: require('@/images/icon/todo.png'),
|
|
|
- link: '/app/mainPage/todo'
|
|
|
+ list:[
|
|
|
+ // {
|
|
|
+ // name: '待办',
|
|
|
+ // src: require('@/images/icon/todo.png'),
|
|
|
+ // link: '/app/mainPage/todo'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ name: '年度计划',
|
|
|
+ src: require('@/images/icon/year.png'),
|
|
|
+ link: '/app/mainPage/year'
|
|
|
+ },{
|
|
|
+ name: '季度计划',
|
|
|
+ src: require('@/images/icon/quarter.png'),
|
|
|
+ link: '/app/mainPage/quarter'
|
|
|
},{
|
|
|
- name: '任务',
|
|
|
- src: require('@/images/icon/task.png'),
|
|
|
- link: '/app/mainPage/task'
|
|
|
+ name: '月计划',
|
|
|
+ src: require('@/images/icon/month.png'),
|
|
|
+ link: '/app/mainPage/month'
|
|
|
},{
|
|
|
name: '人员',
|
|
|
src: require('@/images/icon/person.png'),
|
|
|
link: '/app/mainPage/department'
|
|
|
- }]
|
|
|
+ }],
|
|
|
+ personChange: false,
|
|
|
+ currentPlan:{},
|
|
|
+ currentUser: {}
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getCurrent();
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ableChangeUser() {
|
|
|
+ return this.$route.name == 'Month'
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getCurrent(){
|
|
|
+ let currentYear = new Date().getFullYear();
|
|
|
+ getCurrent(currentYear).then((data) => {
|
|
|
+ if(data.result){
|
|
|
+ this.currentPlan = data.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ chooseUser(val){
|
|
|
+ this.currentUser = val;
|
|
|
+ },
|
|
|
+ changeCheckUser(){
|
|
|
+ this.$store.dispatch('setCheckUser', this.currentUser);
|
|
|
+ this.personChange = false;
|
|
|
+ },
|
|
|
logout() {
|
|
|
logout()
|
|
|
.then(res => {
|