Commit 759a4a7bee223b73d3d958daec92cc60d546d3e3
Merge branch 'feat/add-task-components-lesChamps' into 'main_dev'
feat: 任务中心详情新增命令内容字段 See merge request yunteng/thingskit-front!675
Showing
4 changed files
with
21 additions
and
6 deletions
| @@ -7,7 +7,7 @@ import { | @@ -7,7 +7,7 @@ import { | ||
| 7 | } from '../DetailModal/config'; | 7 | } from '../DetailModal/config'; |
| 8 | import { TaskStatusEnum, TaskTargetEnum, TaskTargetNameEnum } from '../../config'; | 8 | import { TaskStatusEnum, TaskTargetEnum, TaskTargetNameEnum } from '../../config'; |
| 9 | import { h } from 'vue'; | 9 | import { h } from 'vue'; |
| 10 | -import { Tag } from 'ant-design-vue'; | 10 | +import { Tag, Textarea } from 'ant-design-vue'; |
| 11 | import { TaskStatusNameEnum } from '../../config'; | 11 | import { TaskStatusNameEnum } from '../../config'; |
| 12 | import { TaskRecordType } from '/@/api/task/model'; | 12 | import { TaskRecordType } from '/@/api/task/model'; |
| 13 | import { TaskTypeNameEnum } from '../../config'; | 13 | import { TaskTypeNameEnum } from '../../config'; |
| @@ -102,6 +102,13 @@ export const schemas: DescItem[] = [ | @@ -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 | field: 'createTime', | 112 | field: 'createTime', |
| 106 | label: '创建时间', | 113 | label: '创建时间', |
| 107 | }, | 114 | }, |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | import { EChartsOption, ECharts, init } from 'echarts'; | 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 | import { useMultipleDataFetch } from '../../../hook/useSocket'; | 4 | import { useMultipleDataFetch } from '../../../hook/useSocket'; |
| 5 | import { ComponentPropsConfigType, MultipleDataFetchUpdateFn } from '../../../index.type'; | 5 | import { ComponentPropsConfigType, MultipleDataFetchUpdateFn } from '../../../index.type'; |
| 6 | import { option } from './config'; | 6 | import { option } from './config'; |
| @@ -71,6 +71,9 @@ | @@ -71,6 +71,9 @@ | ||
| 71 | color: '#019680', | 71 | color: '#019680', |
| 72 | }, | 72 | }, |
| 73 | }, | 73 | }, |
| 74 | + tooltip: { | ||
| 75 | + show: true, | ||
| 76 | + }, | ||
| 74 | legend: { | 77 | legend: { |
| 75 | top: '10%', | 78 | top: '10%', |
| 76 | left: 'center', | 79 | left: 'center', |
| @@ -92,7 +95,7 @@ | @@ -92,7 +95,7 @@ | ||
| 92 | color: 'rgba(226,226,226,0.5)', | 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 | yAxis: { | 100 | yAxis: { |
| 98 | type: 'value', | 101 | type: 'value', |
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | import { ref, onMounted, unref } from 'vue'; | 7 | import { ref, onMounted, unref } from 'vue'; |
| 8 | import { useIntervalFn } from '@vueuse/core'; | 8 | import { useIntervalFn } from '@vueuse/core'; |
| 9 | import { DeviceName } from '/@/views/visual/commonComponents/DeviceName'; | 9 | import { DeviceName } from '/@/views/visual/commonComponents/DeviceName'; |
| 10 | + import { useReceiveValue } from '../../../hook/useReceiveValue'; | ||
| 10 | 11 | ||
| 11 | const props = defineProps<{ | 12 | const props = defineProps<{ |
| 12 | config: ComponentPropsConfigType<typeof option>; | 13 | config: ComponentPropsConfigType<typeof option>; |
| @@ -36,8 +37,13 @@ | @@ -36,8 +37,13 @@ | ||
| 36 | isOpenClose.value = !unref(isOpenClose); | 37 | isOpenClose.value = !unref(isOpenClose); |
| 37 | }, 2000); | 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 | onMounted(() => { | 48 | onMounted(() => { |
| 43 | !props.config.option.uuid && randomFn(); | 49 | !props.config.option.uuid && randomFn(); |
| @@ -88,7 +88,6 @@ | @@ -88,7 +88,6 @@ | ||
| 88 | const percentList = ref( | 88 | const percentList = ref( |
| 89 | props.config.option.dataSource ? unref(getDesign).dataSource : defaultValue | 89 | props.config.option.dataSource ? unref(getDesign).dataSource : defaultValue |
| 90 | ); | 90 | ); |
| 91 | - console.log(percentList, 'percentList'); | ||
| 92 | 91 | ||
| 93 | const { forEachGroupMessage } = useReceiveMessage(); | 92 | const { forEachGroupMessage } = useReceiveMessage(); |
| 94 | 93 |