diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue index bb25090..7589be6 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue @@ -108,6 +108,8 @@ import { icon } from '@/plugins' import { goDialog, toString } from '@/utils' import { customizeHttp } from '@/api/http' import cloneDeep from 'lodash/cloneDeep' +import { RequestDataTypeEnum } from "@/enums/httpEnum"; +import { fetchDataByIot } from "@/api/path/dataSource"; const { DocumentTextIcon } = icon.ionicons5 const { FilterIcon, FilterEditIcon } = icon.carbon @@ -127,7 +129,12 @@ const sourceData = ref('') // 动态获取数据 const fetchTargetData = async () => { try { - const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig)) + let res; + if (targetData.value.request.requestDataType === RequestDataTypeEnum.Source) { + res = await fetchDataByIot(targetData.value.requestSource) + } else { + res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig)) + } if (res) { sourceData.value = res return