Showing
4 changed files
with
21 additions
and
6 deletions
... | ... | @@ -7,7 +7,7 @@ import { |
7 | 7 | } from '../DetailModal/config'; |
8 | 8 | import { TaskStatusEnum, TaskTargetEnum, TaskTargetNameEnum } from '../../config'; |
9 | 9 | import { h } from 'vue'; |
10 | -import { Tag } from 'ant-design-vue'; | |
10 | +import { Tag, Textarea } from 'ant-design-vue'; | |
11 | 11 | import { TaskStatusNameEnum } from '../../config'; |
12 | 12 | import { TaskRecordType } from '/@/api/task/model'; |
13 | 13 | import { TaskTypeNameEnum } from '../../config'; |
... | ... | @@ -102,6 +102,13 @@ export const schemas: DescItem[] = [ |
102 | 102 | }, |
103 | 103 | }, |
104 | 104 | { |
105 | + field: 'rpcCommand', | |
106 | + label: '命令内容', | |
107 | + render(_val: any, data: TaskRecordType) { | |
108 | + return h(Textarea, { value: data.executeContent.pushContent.rpcCommand } as Recordable); | |
109 | + }, | |
110 | + }, | |
111 | + { | |
105 | 112 | field: 'createTime', |
106 | 113 | label: '创建时间', |
107 | 114 | }, | ... | ... |
1 | 1 | <script lang="ts" setup> |
2 | 2 | import { EChartsOption, ECharts, init } from 'echarts'; |
3 | - import { unref, ref, onMounted, nextTick } from 'vue'; | |
3 | + import { unref, ref, onMounted, nextTick, toRaw } from 'vue'; | |
4 | 4 | import { useMultipleDataFetch } from '../../../hook/useSocket'; |
5 | 5 | import { ComponentPropsConfigType, MultipleDataFetchUpdateFn } from '../../../index.type'; |
6 | 6 | import { option } from './config'; |
... | ... | @@ -71,6 +71,9 @@ |
71 | 71 | color: '#019680', |
72 | 72 | }, |
73 | 73 | }, |
74 | + tooltip: { | |
75 | + show: true, | |
76 | + }, | |
74 | 77 | legend: { |
75 | 78 | top: '10%', |
76 | 79 | left: 'center', |
... | ... | @@ -92,7 +95,7 @@ |
92 | 95 | color: 'rgba(226,226,226,0.5)', |
93 | 96 | }, |
94 | 97 | }, |
95 | - data: unref(data).map((item) => item.name), | |
98 | + data: toRaw(unref(data)).map((item) => item.name), | |
96 | 99 | }, |
97 | 100 | yAxis: { |
98 | 101 | type: 'value', | ... | ... |
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | import { ref, onMounted, unref } from 'vue'; |
8 | 8 | import { useIntervalFn } from '@vueuse/core'; |
9 | 9 | import { DeviceName } from '/@/views/visual/commonComponents/DeviceName'; |
10 | + import { useReceiveValue } from '../../../hook/useReceiveValue'; | |
10 | 11 | |
11 | 12 | const props = defineProps<{ |
12 | 13 | config: ComponentPropsConfigType<typeof option>; |
... | ... | @@ -36,8 +37,13 @@ |
36 | 37 | isOpenClose.value = !unref(isOpenClose); |
37 | 38 | }, 2000); |
38 | 39 | }; |
39 | - | |
40 | - const updateFn: DataFetchUpdateFn = () => {}; | |
40 | + const { getNumberValue } = useReceiveValue(); | |
41 | + const updateFn: DataFetchUpdateFn = (message, attribute) => { | |
42 | + const { data = {} } = message; | |
43 | + const [latest] = data[attribute] || []; | |
44 | + const [_, value] = latest; | |
45 | + isOpenClose.value = Boolean(getNumberValue(value)); | |
46 | + }; | |
41 | 47 | |
42 | 48 | onMounted(() => { |
43 | 49 | !props.config.option.uuid && randomFn(); | ... | ... |