2022-06-27 10:05:27 +08:00
|
|
|
|
<template>
|
2022-07-05 10:09:28 +08:00
|
|
|
|
<el-container style="width: 100%;height: 100%">
|
|
|
|
|
<el-aside width="260px"
|
|
|
|
|
style="display: flex;flex-direction: column;align-items: stretch;overflow: unset">
|
|
|
|
|
<el-menu
|
|
|
|
|
router
|
|
|
|
|
style="height: 100%"
|
2022-07-06 15:25:09 +08:00
|
|
|
|
:default-active="menuDefaultActive">
|
2022-07-05 10:09:28 +08:00
|
|
|
|
<div
|
|
|
|
|
style="width: 100%;height: 60px;margin: 30px 0 20px 20px; display: flex; flex-direction: row; align-items: center">
|
|
|
|
|
<svg-icon style="width: 52px;height: 52px;margin: 10px" icon-class="logo"></svg-icon>
|
|
|
|
|
<p style="font-family: 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">项目<br/>管理系统</p>
|
|
|
|
|
</div>
|
2022-07-05 13:18:56 +08:00
|
|
|
|
<el-button style="width: 100%;height: 40px;display: flex;flex-direction: row;justify-content: flex-start"
|
2022-07-08 17:05:28 +08:00
|
|
|
|
text :icon="ArrowLeft" @click="back">返回
|
2022-07-06 15:25:09 +08:00
|
|
|
|
</el-button>
|
2022-07-05 13:18:56 +08:00
|
|
|
|
|
2022-07-05 10:09:28 +08:00
|
|
|
|
<el-menu-item index="1" :route="'/project/'+$route.params.projectId">
|
2022-07-05 13:18:56 +08:00
|
|
|
|
<span>概览</span>
|
2022-07-05 10:09:28 +08:00
|
|
|
|
</el-menu-item>
|
|
|
|
|
<el-menu-item index="2" :route="'/project/'+$route.params.projectId+'/workitem'">
|
|
|
|
|
<span>工作项</span>
|
|
|
|
|
</el-menu-item>
|
2022-07-06 15:25:09 +08:00
|
|
|
|
<el-menu-item index="3" :route="'/project/'+$route.params.projectId+'/group'">
|
2022-07-05 10:09:28 +08:00
|
|
|
|
<span>团队</span>
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
</el-menu>
|
|
|
|
|
</el-aside>
|
|
|
|
|
<el-container style="background-color: #F2F3F5">
|
|
|
|
|
<el-header height="100px">
|
|
|
|
|
<div style="height: 60px; margin: 30px 30px 30px 30px; background-color: white; border-radius: 10px;
|
|
|
|
|
display: flex; flex-direction: row; align-items: center;justify-content: space-between">
|
2022-07-05 13:18:56 +08:00
|
|
|
|
<logout-button></logout-button>
|
2022-07-06 15:25:09 +08:00
|
|
|
|
<span
|
2022-07-08 16:10:19 +08:00
|
|
|
|
style="font-family: 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">{{
|
|
|
|
|
project.projectName
|
|
|
|
|
}}</span>
|
2022-07-05 10:09:28 +08:00
|
|
|
|
<div style="margin: 0 30px 0 30px; ;
|
|
|
|
|
display: flex; flex-direction: row-reverse; align-items: center">
|
|
|
|
|
<div style="width: 42px;height: 42px; background-color: #409EFF; border-radius: 21px;
|
|
|
|
|
display: flex; justify-content: center;align-items: center;">
|
2022-07-06 15:25:09 +08:00
|
|
|
|
<span style="color: white">{{
|
2022-07-08 16:10:19 +08:00
|
|
|
|
getStaffFullname()[0]
|
2022-07-06 15:25:09 +08:00
|
|
|
|
}}</span>
|
2022-07-05 10:09:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div style="height: 100%; margin-right: 10px;
|
|
|
|
|
display: flex; flex-direction: column;justify-content: center;align-items: flex-end;">
|
|
|
|
|
<span
|
|
|
|
|
style="color: #606266; font-family: 'Segoe UI',sans-serif;font-size: 14px;font-weight: bold; ">
|
2022-07-06 15:25:09 +08:00
|
|
|
|
{{
|
2022-07-08 16:10:19 +08:00
|
|
|
|
getStaffFullname()
|
2022-07-06 15:25:09 +08:00
|
|
|
|
}}</span>
|
2022-07-05 10:09:28 +08:00
|
|
|
|
<span style="color: #606266; font-family: 'Segoe UI',sans-serif;font-size: 12px;">{{
|
2022-07-07 21:29:30 +08:00
|
|
|
|
projectStaffPosition
|
2022-07-05 10:09:28 +08:00
|
|
|
|
}}</span>
|
2022-06-27 10:05:27 +08:00
|
|
|
|
|
2022-07-05 10:09:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-header>
|
|
|
|
|
<el-main style="overflow: unset">
|
2022-07-08 09:33:37 +08:00
|
|
|
|
<router-view
|
|
|
|
|
:projectAccessLevel="projectAccessLevel"
|
|
|
|
|
:projectGroup="projectGroup"
|
2022-07-12 14:17:44 +08:00
|
|
|
|
@groupChanged="groupChanged"
|
2022-07-08 09:33:37 +08:00
|
|
|
|
></router-view>
|
2022-07-05 10:09:28 +08:00
|
|
|
|
</el-main>
|
|
|
|
|
</el-container>
|
|
|
|
|
</el-container>
|
2022-06-27 10:05:27 +08:00
|
|
|
|
</template>
|
2022-07-05 13:18:56 +08:00
|
|
|
|
<script setup>
|
|
|
|
|
import {ArrowLeft} from '@element-plus/icons'
|
|
|
|
|
import LogoutButton from "../components/LogoutButton";
|
|
|
|
|
</script>
|
2022-06-27 10:05:27 +08:00
|
|
|
|
<script>
|
|
|
|
|
import request from "@/utils/request";
|
|
|
|
|
import router from "@/router";
|
|
|
|
|
import {ElMessage} from "element-plus";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Project",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-07-05 13:18:56 +08:00
|
|
|
|
project: {
|
|
|
|
|
projectName: ''
|
|
|
|
|
},
|
2022-07-07 21:29:30 +08:00
|
|
|
|
projectGroup: [],
|
|
|
|
|
projectStaffPosition: '',
|
|
|
|
|
projectAccessLevel: 3,
|
2022-07-06 15:25:09 +08:00
|
|
|
|
menuDefaultActive: '1',
|
2022-06-27 10:05:27 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2022-07-05 13:18:56 +08:00
|
|
|
|
created() {
|
2022-07-06 15:25:09 +08:00
|
|
|
|
switch (this.$route.path.split('/').pop()) {
|
|
|
|
|
case 'workitem':
|
|
|
|
|
this.menuDefaultActive = '2';
|
|
|
|
|
break
|
|
|
|
|
case 'group':
|
|
|
|
|
this.menuDefaultActive = '3';
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
this.menuDefaultActive = '1';
|
|
|
|
|
break
|
|
|
|
|
}
|
2022-07-07 21:29:30 +08:00
|
|
|
|
const that = this
|
|
|
|
|
request({
|
2022-07-08 16:10:19 +08:00
|
|
|
|
url: 'project/' + this.$route.params.projectId + '/group/' + this.$store.state.staff.staffId,
|
2022-07-07 21:29:30 +08:00
|
|
|
|
method: 'get',
|
|
|
|
|
}).then(response => {
|
|
|
|
|
if (response.data.code === 200) {
|
2022-07-12 15:45:15 +08:00
|
|
|
|
that.projectStaffPosition = response.data.data.projectStaffPosition.replaceAll(',',',')
|
2022-07-08 16:10:19 +08:00
|
|
|
|
that.projectAccessLevel = response.data.data.projectAccessLevel
|
2022-07-07 21:29:30 +08:00
|
|
|
|
}
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
2022-07-05 13:18:56 +08:00
|
|
|
|
this.getProjectInfo();
|
2022-07-07 21:29:30 +08:00
|
|
|
|
this.getProjectGroup()
|
2022-06-27 10:05:27 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-07-08 17:05:28 +08:00
|
|
|
|
back() {
|
|
|
|
|
router.push({path: '/'})
|
|
|
|
|
},
|
2022-07-08 16:10:19 +08:00
|
|
|
|
getStaffFullname() {
|
|
|
|
|
return this.$store.state.staff === null ? ' ' : this.$store.state.staff.staffFullname
|
|
|
|
|
},
|
2022-07-05 13:18:56 +08:00
|
|
|
|
getProjectInfo() {
|
|
|
|
|
const that = this
|
2022-07-05 10:09:28 +08:00
|
|
|
|
request({
|
2022-07-06 15:25:09 +08:00
|
|
|
|
url: 'project/' + this.$route.params.projectId,
|
2022-07-05 13:18:56 +08:00
|
|
|
|
method: 'get'
|
2022-07-05 10:09:28 +08:00
|
|
|
|
|
2022-07-05 13:18:56 +08:00
|
|
|
|
}).then(response => {
|
|
|
|
|
if (response.data.code === 200) {
|
|
|
|
|
that.project = response.data.data
|
|
|
|
|
}
|
2022-07-05 10:09:28 +08:00
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-07-07 21:29:30 +08:00
|
|
|
|
getProjectGroup() {
|
|
|
|
|
const that = this
|
|
|
|
|
request({
|
2022-07-08 16:10:19 +08:00
|
|
|
|
url: 'project/' + this.$route.params.projectId + '/group',
|
2022-07-07 21:29:30 +08:00
|
|
|
|
method: 'get'
|
|
|
|
|
|
|
|
|
|
}).then(response => {
|
|
|
|
|
if (response.data.code === 200) {
|
2022-07-08 09:33:37 +08:00
|
|
|
|
that.projectGroup = response.data.data.records
|
2022-07-07 21:29:30 +08:00
|
|
|
|
}
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
console.log(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-07-12 14:17:44 +08:00
|
|
|
|
groupChanged() {
|
|
|
|
|
console.log('groupChanged')
|
|
|
|
|
this.getProjectGroup()
|
|
|
|
|
}
|
2022-06-27 10:05:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|