haoxuan
2023-10-28 d13f2db56f0a82b9324c19e48d41848e7f5909b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
  <DashboardLayout>
    <template #leftBlock1>任务筛选tabs</template>
    <template #leftBlock2>
      <ChannelCollapse :channels="channels"></ChannelCollapse>
    </template>
    <template #middleBlock1>标题</template>
    <template #middleBlock2
      >主看板
      <ProcessInfo :process="process"></ProcessInfo>
    </template>
    <template #middleBlock3>任务详情</template>
    <template #middleBlock4
      >人员信息
      <PersonInfo :person="person"></PersonInfo>
    </template>
    <template #rightBlock1>时间</template>
    <template #rightBlock2>状态面板</template>
    <template #rightBlock3>知识库</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'
import ProcessInfo from '@/views/dashboard/components/ProcessInfo.vue'
import PersonInfo from '@/views/dashboard/components/PersonInfo.vue'
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()
})
const process = computed(() => {
  return { name: '工艺名称', number: '111' }
})
const person = computed(() => {
  return {
    workerName: '姓名',
    phone: '111'
  }
})
getChannels()
</script>
 
<style scoped></style>