|
|
|
@ -2,8 +2,8 @@ |
|
|
|
<div> |
|
|
|
<!-- 项目标题 --> |
|
|
|
<div class="navbar flex items-center justify-between"> |
|
|
|
<div class="project-name">{{ project.name }}</div> |
|
|
|
<div class="project-action"> |
|
|
|
<div class="project-name truncate">{{ project.name }}</div> |
|
|
|
<div class="project-action flex-shrink-0"> |
|
|
|
<ReloadOutlined :style="{ fontSize: 20 + 'px' }" /> |
|
|
|
<MoreOutlined :style="{ fontSize: 20 + 'px' }" /> |
|
|
|
</div> |
|
|
|
@ -11,67 +11,22 @@ |
|
|
|
|
|
|
|
<!-- 角色 --> |
|
|
|
<Roles /> |
|
|
|
<!-- <div class="role-list flex items-center"> |
|
|
|
<div class="role-box relative" v-for="(item, index) in roles" :key="index"> |
|
|
|
<div class="role-name" :class="{ mine: roleId === item.id }">{{ item.name }}</div> |
|
|
|
<div class="line-box absolute flex justify-center" v-if="roleId === item.id"><div class="line"></div></div> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
|
|
|
|
<!-- 日常任务 --> |
|
|
|
<Global ref="globalRef" /> |
|
|
|
<!-- <div class="global"> |
|
|
|
<div class="global-box" v-if="permanents && permanents.length > 0"> |
|
|
|
<div class="global-task cursor-pointer" v-for="(item, index) in permanents" :key="index" @click="toGlobalDetail(item)"> |
|
|
|
<template v-for="v in item.plugins"> |
|
|
|
<template v-if="v[0].pluginId == 1">{{ item.name }}</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
|
|
|
|
<!-- 定期任务 --> |
|
|
|
<RegularTask :style="{ height: tasksHeight + 'px' }" /> |
|
|
|
<!-- <div class="task-list" :style="{ height: 'calc(100vh - 160px - (' + globalHeight + 'px))' }"> |
|
|
|
<div class="task-box" v-for="(item, index) in regularTasks" :key="index"> |
|
|
|
<div class="task-time flex items-center justify-between"> |
|
|
|
<div class="flex items-center"> |
|
|
|
<PlayCircleOutlined style="font-size: 23px; color: #999999" /> |
|
|
|
<span>{{ dayjs(item.planStart).format('D日 HH:mm') }}</span> |
|
|
|
</div> |
|
|
|
<div class="task-action"></div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="task-info"> |
|
|
|
<div> |
|
|
|
<div class="task-card"> |
|
|
|
<div class="task-name cursor-pointer" @click="toDetail(item)"> |
|
|
|
<template v-for="v in item.plugins"> |
|
|
|
<template v-if="v[0].pluginId == 1">{{ item.name }}</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="task-con" v-if="item.sonList && item.sonList.length > 0"> |
|
|
|
<div v-for="(val, key) in item.sonList" :key="key"> |
|
|
|
<span class="son-task-name cursor-pointer" @click.stop="toSonDetail(item, val.detailId)">{{ val.name }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { computed, watch, ref } from 'vue'; |
|
|
|
import { computed, watch, ref, nextTick } from 'vue'; |
|
|
|
import { useStore } from 'vuex'; |
|
|
|
import { ReloadOutlined, MoreOutlined } from '@ant-design/icons-vue'; |
|
|
|
|
|
|
|
const store = useStore(); |
|
|
|
const project = computed(() => store.state.projects.project); // 项目信息 |
|
|
|
// const sessionTasks = sessionStorage.getItem('regularTasks'); // 定期任务缓存 |
|
|
|
const globals = computed(() => store.getters['task/globals']); // 日常任务 |
|
|
|
|
|
|
|
const globalRef = ref(null); |
|
|
|
@ -80,32 +35,12 @@ const clientHeight = ref(0); // 浏览器可视区域高度 |
|
|
|
const tasksHeight = ref(null); // 定期任务高度 |
|
|
|
|
|
|
|
watch(globals, () => { |
|
|
|
clientHeight.value = `${document.documentElement.clientHeight}`; // 获取浏览器可视区域高度 |
|
|
|
globalHeight.value = globalRef.value.$el.clientHeight; |
|
|
|
tasksHeight.value = clientHeight.value - 48 - 44 - 36 - globalHeight.value; |
|
|
|
console.log('globalHeight', globalHeight.value, clientHeight.value, tasksHeight.value); |
|
|
|
nextTick(() => { |
|
|
|
clientHeight.value = `${document.documentElement.clientHeight}`; // 获取浏览器可视区域高度 |
|
|
|
globalHeight.value = globalRef.value.$el.clientHeight; |
|
|
|
tasksHeight.value = clientHeight.value - 48 - 44 - 36 - globalHeight.value; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// if (sessionTasks) { |
|
|
|
// const arr = JSON.parse(sessionTasks); |
|
|
|
// store.commit('task/setRegularTasks', arr); |
|
|
|
// } |
|
|
|
|
|
|
|
// watch(project, async () => { |
|
|
|
// if (project.value.id) { |
|
|
|
// await getRoles(project.value.id); // 通过项目id获取角色信息 |
|
|
|
// await getPermanentData(roleId.value); // 根据角色查找永久的日常任务 |
|
|
|
// await getTasks({ roleId: roleId.value }); // 根据角色查找定期任务 |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
// watch(refreshProjects, async () => { |
|
|
|
// if (project.value.id) { |
|
|
|
// await getRoles(project.value.id); // 通过项目id获取角色信息 |
|
|
|
// await getPermanentData(roleId.value); // 根据角色查找永久的日常任务 |
|
|
|
// await getTasks({ roleId: roleId.value }); // 根据角色查找定期任务 |
|
|
|
// } |
|
|
|
// }); |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|