mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 新增数据池代码
This commit is contained in:
@@ -3,24 +3,27 @@
|
||||
<setting-item-box name="请求方式" :alone="true">
|
||||
<n-select v-model:value="targetData.request.requestDataType" :disabled="isNotData" :options="selectOptions" />
|
||||
</setting-item-box>
|
||||
|
||||
<!-- 静态 -->
|
||||
<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-if="targetData.request.requestDataType === RequestDataTypeEnum.AJAX"></chart-data-ajax>
|
||||
<!-- 数据池 -->
|
||||
<chart-data-pond v-if="targetData.request.requestDataType === RequestDataTypeEnum.Pond"></chart-data-pond>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { loadAsyncComponent } from '@/utils'
|
||||
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
||||
import { useTargetData } from '../hooks/useTargetData.hook'
|
||||
import { ChartDataStatic } from './components/ChartDataStatic/index'
|
||||
import { ChartDataAjax } from './components/ChartDataAjax/index'
|
||||
import { SelectCreateDataType, SelectCreateDataEnum } from './index.d'
|
||||
import { RequestDataTypeEnum } from '@/enums/httpEnum'
|
||||
|
||||
const ChartDataStatic = loadAsyncComponent(() => import('./components/ChartDataStatic/index.vue'))
|
||||
const ChartDataAjax = loadAsyncComponent(() => import('./components/ChartDataAjax/index.vue'))
|
||||
const ChartDataPond = loadAsyncComponent(() => import('./components/ChartDataPond/index.vue'))
|
||||
|
||||
const { targetData } = useTargetData()
|
||||
|
||||
// 选项
|
||||
@@ -32,6 +35,10 @@ const selectOptions: SelectCreateDataType[] = [
|
||||
{
|
||||
label: SelectCreateDataEnum.AJAX,
|
||||
value: RequestDataTypeEnum.AJAX
|
||||
},
|
||||
{
|
||||
label: SelectCreateDataEnum.Pond,
|
||||
value: RequestDataTypeEnum.Pond
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user