From d13f2db56f0a82b9324c19e48d41848e7f5909b3 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期六, 28 十月 2023 18:48:54 +0800 Subject: [PATCH] 工艺信息的组件+人员的组件半成品 --- src/views/dashboard/index.vue | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 6a0fc85..c2f2e8a 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -2,21 +2,63 @@ <DashboardLayout> <template #leftBlock1>浠诲姟绛涢�塼abs</template> <template #leftBlock2> - <div style="height: 1500px">閫氶亾浠诲姟</div> + <ChannelCollapse :channels="channels"></ChannelCollapse> </template> <template #middleBlock1>鏍囬</template> - <template #middleBlock2>涓荤湅鏉�</template> + <template #middleBlock2 + >涓荤湅鏉� + <ProcessInfo :process="process"></ProcessInfo> + </template> <template #middleBlock3>浠诲姟璇︽儏</template> - <template #middleBlock4>浜哄憳淇℃伅</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> -- Gitblit v1.8.0