|
@@ -1,16 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="go-chart-configurations-data" v-if="targetData">
|
|
<div class="go-chart-configurations-data" v-if="targetData">
|
|
|
<setting-item-box name="请求方式" :alone="true">
|
|
<setting-item-box name="请求方式" :alone="true">
|
|
|
- <n-select
|
|
|
|
|
- v-model:value="targetData.request.requestDataType"
|
|
|
|
|
- :options="selectOptions"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <n-select v-model:value="targetData.request.requestDataType" :disabled="isNotData" :options="selectOptions" />
|
|
|
</setting-item-box>
|
|
</setting-item-box>
|
|
|
|
|
|
|
|
<!-- 静态 -->
|
|
<!-- 静态 -->
|
|
|
- <chart-data-static
|
|
|
|
|
- v-if="targetData.request.requestDataType === RequestDataTypeEnum.STATIC"
|
|
|
|
|
- ></chart-data-static>
|
|
|
|
|
|
|
+ <chart-data-static v-if="targetData.request.requestDataType === RequestDataTypeEnum.STATIC"></chart-data-static>
|
|
|
|
|
|
|
|
<!-- 动态 -->
|
|
<!-- 动态 -->
|
|
|
<chart-data-ajax v-else></chart-data-ajax>
|
|
<chart-data-ajax v-else></chart-data-ajax>
|
|
@@ -18,6 +13,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
|
+import { computed } from 'vue'
|
|
|
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
|
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
|
|
import { useTargetData } from '../hooks/useTargetData.hook'
|
|
import { useTargetData } from '../hooks/useTargetData.hook'
|
|
|
import { ChartDataStatic } from './components/ChartDataStatic/index'
|
|
import { ChartDataStatic } from './components/ChartDataStatic/index'
|
|
@@ -38,4 +34,9 @@ const selectOptions: SelectCreateDataType[] = [
|
|
|
value: RequestDataTypeEnum.AJAX
|
|
value: RequestDataTypeEnum.AJAX
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
-</script>
|
|
|
|
|
|
|
+
|
|
|
|
|
+// 无数据源
|
|
|
|
|
+const isNotData = computed(() => {
|
|
|
|
|
+ return typeof targetData.value?.option?.dataset === 'undefined'
|
|
|
|
|
+})
|
|
|
|
|
+</script>
|