Showing
1 changed file
with
4 additions
and
4 deletions
| ... | ... | @@ -66,17 +66,17 @@ export const useChartDataFetch = ( |
| 66 | 66 | // 目标组件 |
| 67 | 67 | const { |
| 68 | 68 | requestUrl, |
| 69 | + requestContentType, | |
| 69 | 70 | requestIntervalUnit: targetUnit, |
| 70 | 71 | requestInterval: targetInterval |
| 71 | 72 | } = toRefs(targetComponent.request) |
| 72 | 73 | |
| 73 | 74 | try { |
| 74 | 75 | // 处理地址 |
| 75 | - if (requestUrl?.value) { | |
| 76 | + if (requestUrl?.value || requestContentType?.value === RequestContentTypeEnum.SQL) { | |
| 76 | 77 | // requestOriginUrl 允许为空 |
| 77 | 78 | const completePath = requestOriginUrl && requestOriginUrl.value + requestUrl.value |
| 78 | - if (!completePath) return | |
| 79 | - | |
| 79 | + if (!completePath && requestContentType?.value !== RequestContentTypeEnum.SQL) return | |
| 80 | 80 | clearInterval(fetchInterval) |
| 81 | 81 | |
| 82 | 82 | const fetchFn = async () => { |
| ... | ... | @@ -137,7 +137,7 @@ export const useChartDataFetch = ( |
| 137 | 137 | setInterval(handleExecuteRequest, intervalUnitHandle(time, (unit as unknown as any))) |
| 138 | 138 | // |
| 139 | 139 | let res:any; |
| 140 | - if (targetComponent.request?.requestContentType === 1) { | |
| 140 | + if (requestContentType?.value === RequestContentTypeEnum.SQL) { | |
| 141 | 141 | // @ts-ignore |
| 142 | 142 | res = await getDataView({id: targetComponent.request?.id || '',paramMap:targetComponent.request?.requestParams?.Params}) |
| 143 | 143 | }else { | ... | ... |