|
|
|
|
@ -108,6 +108,8 @@ import { icon } from '@/plugins'
@@ -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<any>('')
@@ -127,7 +129,12 @@ const sourceData = ref<any>('')
|
|
|
|
|
// 动态获取数据 |
|
|
|
|
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 |
|
|
|
|
|