| | |
| | | <DashboardLayout> |
| | | <template #leftBlock1>任务筛选tabs</template> |
| | | <template #leftBlock2> |
| | | <div style="height: 1500px">通道任务</div> |
| | | <ChannelCollapse :channels="channels"></ChannelCollapse> |
| | | </template> |
| | | <template #middleBlock1>标题</template> |
| | | <template #middleBlock2>主看板</template> |
| | |
| | | </DashboardLayout> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { getTaskList } from '@/api' |
| | | import { computed, ref } from 'vue' |
| | | import ChannelCollapse from '@/views/dashboard/components/ChannelCollapse.vue' |
| | | import type { Task } from '@/api/task' |
| | | import { chain } from 'lodash-es' |
| | | |
| | | defineOptions({ |
| | | name: 'DashboardView' |
| | | }) |
| | | |
| | | const taskList = ref<Task[]>() |
| | | |
| | | function getChannels() { |
| | | getTaskList(2) |
| | | .then((res) => { |
| | | taskList.value = res.data.Tasks |
| | | }) |
| | | .catch((err) => { |
| | | console.error(err) |
| | | taskList.value = [] |
| | | }) |
| | | } |
| | | |
| | | const channels = computed(() => { |
| | | return chain<Task>(taskList.value) |
| | | .groupBy((ele) => ele.Channel) |
| | | .value() |
| | | }) |
| | | |
| | | getChannels() |
| | | </script> |
| | | |
| | | <style scoped></style> |