diff --git a/src/editor/widgets/task/TaskView2.vue b/src/editor/widgets/task/TaskView2.vue index 198ecb3..eb5d5cd 100644 --- a/src/editor/widgets/task/TaskView2.vue +++ b/src/editor/widgets/task/TaskView2.vue @@ -5,6 +5,8 @@ import { localeText as localeTextCn } from "@/components/yvTable/yv-aggrid-cn.lo import { Request } from "@ease-forge/shared"; import type { GridOptions } from "ag-grid-enterprise"; import type { GridApi, GridReadyEvent } from "ag-grid-community"; +import { Refresh } from "@element-plus/icons-vue"; +import { ElButton, ElInput, ElSwitch } from "element-plus"; defineOptions({ name: 'TaskView', @@ -20,12 +22,14 @@ const props = withDefaults(defineProps(), {}); // 定义 State 类型 interface TaskViewState { loading: boolean; + automaticTracking: boolean; grid1Data: Array; } // state 属性 const state = reactive({ loading: false, + automaticTracking: false, grid1Data: [], }); @@ -50,6 +54,7 @@ const data: TaskViewData = { { field: 'type', headerName: '类型', width: 120 }, { field: 'status', headerName: '状态', width: 120 }, { field: 'err', headerName: '异常' }, + { field: 'progress', headerName: '进度' }, { field: 'payload', headerName: '任务负载', width: 600 }, { field: 'priority', headerName: '优先级', width: 120 }, { field: 'info', headerName: '任务明细', width: 800 }, @@ -65,7 +70,7 @@ const data: TaskViewData = { field: 'title', width: 300, }, - groupDefaultExpanded: -1, + // groupDefaultExpanded: -1, onGridReady(event: GridReadyEvent) { data.api = event.api; }, @@ -160,12 +165,13 @@ function toTreeData(data: Array) { info: `报文类型: ${device.packetType}, 报文目标点: ${device.packetEndPoint}, 报文内容: ${device.packetPayload}, 执行器ID: ${device.deviceItemId}`, children: [], }; - // planNode.children.push(deviceNode); + planNode.children.push(deviceNode); tree.push(deviceNode); } - // bizNode.children.push(planNode); + bizNode.children.push(planNode); tree.push(planNode); } + bizNode.progress = `${bizNode.children.filter(item => item.status === PlanTaskStatus.FINISHED).length}/${bizNode.children.length}`; tree.push(bizNode); } return tree; @@ -190,10 +196,27 @@ export type {