Browse Source

feat: "任务"

master
xuesinan 4 years ago
parent
commit
8187dd00ef
  1. 6
      src/components/tall/center/ProjectDetail.vue
  2. 3
      src/components/tall/left/Projects.vue
  3. 41
      src/components/tall/right/Intro.vue
  4. 35
      src/components/tall/task/CheckSubjectProgress.vue
  5. 0
      src/components/tall/task/MeetingManagement.vue
  6. 1
      src/components/tall/top/Navbar.vue
  7. 2
      src/components/tall/top/TopNavbar.vue
  8. 23
      src/views/detail/Test.vue
  9. 36
      src/views/home/Index.vue

6
src/components/tall/center/ProjectDetail.vue

@ -105,13 +105,7 @@ watch(project, async newVal => {
function setInitialRoleId(visibleList) {
if (!visibleList || !visibleList.length) return;
// roles.value = [];
roles.value = [...visibleList];
// visibleList.forEach(item => {
// roles.arr.push(item);
// });
console.log(roles);
const index = visibleList.findIndex(item => +item.mine === 1);
const currentRole = index > 0 ? visibleList[index] : visibleList[0];

3
src/components/tall/left/Projects.vue

@ -122,7 +122,7 @@ const getProjectsList = async (startTime, endTime) => {
getProjectsList(dayjs().startOf('day').format('x'), dayjs().endOf('day').format('x'));
function toDetail(item) {
item.show = !item.show;
item.show = true;
const obj = {
id: item.id,
@ -131,6 +131,7 @@ function toDetail(item) {
};
store.commit('projects/setProject', obj);
store.commit('task/setTaskDetail', null);
}
function changeShow(item) {

41
src/components/tall/right/Intro.vue

@ -0,0 +1,41 @@
<template>
<div class="intro-flex flex justify-between">
<div class="intro-wrap left"></div>
<div class="intro-wrap center"></div>
<div class="intro-wrap right"></div>
</div>
111111111111111111111111
</template>
<script setup></script>
<style scoped>
.intro-flex {
padding: 16px;
width: 100%;
height: 100%;
}
.intro-wrap {
width: calc((100% - 32px) / 3);
height: 100%;
border-radius: 10px;
}
.intro-wrap.left {
border: 1px solid #1890ff;
background: rgba(24, 144, 255, 0.05);
}
.intro-wrap.center {
border: 1px solid #3cc282;
background: rgba(60, 194, 130, 0.05);
}
.intro-wrap.right {
border: 1px solid #fa8c16;
background: rgba(250, 140, 22, 0.05);
}
</style>

35
src/components/tall/task/CheckSubjectProgress.vue

@ -0,0 +1,35 @@
<template>
<div class="task-form">11111111111111</div>
</template>
<script setup>
// import { computed, watch, ref } from 'vue';
// import { useStore } from 'vuex';
// const store = useStore();
// const signInFormRef = ref(null);
// const signInForm = ref({
// username: '',
// password: '',
// });
// const rules = ref({
// username: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
// password: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
// });
</script>
<style scoped></style>

0
src/components/tall/task/MeetingManagement.vue

1
src/components/tall/top/Navbar.vue

@ -26,7 +26,6 @@ watch(taskDetail, newVal => {
<style scoped>
h1 {
font-size: 16px;
font-weight: 600;
color: #666666;
margin: 0;
}

2
src/components/tall/top/TopNavbar.vue

@ -37,6 +37,8 @@ function toggleCollapse() {
// 退
function signOut() {
store.commit('user/setUser', null);
store.commit('projects/setProject', null);
store.commit('task/setTaskDetail', null);
router.push({ path: '/user/signin' });
}
</script>

23
src/views/detail/Test.vue

@ -1,8 +1,13 @@
<template>
<div class="task-detail">
<div class="task-con">{{ taskInfo.name }}</div>
<div>
<router-view></router-view>
<div class="task-con">
{{ taskInfo.name }}
<!-- 查看课题进展 -->
<CheckSubjectProgress v-if="taskInfo.id === '1462039176656457728'" />
<!-- 科研会议管理 -->
<MeetingManagement v-if="taskInfo.id === '1462039176748732416'" />
</div>
</div>
</template>
@ -10,20 +15,22 @@
<script setup>
import { computed, watch, ref } from 'vue';
import { useStore } from 'vuex';
import CheckSubjectProgress from 'components/tall/task/CheckSubjectProgress.vue';
import MeetingManagement from 'components/tall/task/MeetingManagement.vue';
const store = useStore();
const taskDetail = computed(() => store.state.task.taskDetail); //
const taskInfo = ref({});
const sessionTaskDetail = sessionStorage.getItem('taskDetail');
// const sessionTaskId = sessionStorage.getItem('taskId');
if (sessionTaskDetail) {
taskInfo.value = JSON.parse(sessionTaskDetail);
}
// console.log('sessionTaskDetail', taskInfo.value, sessionTaskId)
//
watch(taskDetail, newVal => {
taskInfo.value = newVal;
store.commit('task/setTaskDetail', newVal);
watch(taskDetail, () => {
taskInfo.value = taskDetail.value;
});
</script>
@ -31,7 +38,7 @@ watch(taskDetail, newVal => {
.task-detail {
width: 100%;
height: 100%;
padding: 15px 12px;
padding: 16px;
}
.task-con {

36
src/views/home/Index.vue

@ -14,9 +14,11 @@
<a-layout-sider v-show="collapsed" style="background: #fff"><Left /></a-layout-sider>
<a-layout>
<a-layout-sider class="project-detail"><ProjectDetail /></a-layout-sider>
<Intro v-if="!projectId" />
<a-layout v-if="sessionTaskId">
<a-layout-sider v-if="projectId" class="project-detail"><ProjectDetail /></a-layout-sider>
<a-layout v-if="taskId">
<!-- 导航栏-->
<a-layout-header style="background: #fff">
<Navbar />
@ -33,7 +35,7 @@
</template>
<script setup>
import { computed } from 'vue';
import { computed, watch, ref } from 'vue';
import { useStore } from 'vuex';
// import { useRoute, useRouter } from 'vue-router';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
@ -41,11 +43,39 @@ import Left from 'components/tall/left/Index.vue';
import Navbar from 'components/tall/top/Navbar.vue';
import TopNavbar from 'components/tall/top/TopNavbar.vue';
import ProjectDetail from 'components/tall/center/ProjectDetail.vue';
import Intro from 'components/tall/right/Intro.vue';
const locale = zhCN;
const store = useStore();
const collapsed = computed(() => store.state.layout.display.left); //
const projectId = ref(null);
const project = computed(() => store.state.projects.project); //
const sessionProjectId = sessionStorage.getItem('projectId');
projectId.value = sessionProjectId;
const taskId = ref(null);
const sessionTaskId = sessionStorage.getItem('taskId');
taskId.value = sessionTaskId;
const taskDetail = computed(() => store.state.task.taskDetail); //
//
watch(project, () => {
if (project.value) {
projectId.value = project.value.id;
} else {
projectId.value = null;
}
});
//
watch(taskDetail, () => {
if (taskDetail.value) {
taskId.value = taskDetail.value.id;
} else {
taskId.value = null;
}
});
// queryu token
// const route = useRoute();

Loading…
Cancel
Save