feat(Charts): 添加场景ID配置并更新API调用

在HazardousChemicalsSpace图表组件中添加场景ID配置选项,并修改API调用以包含场景ID参数
同时更新vite配置中的代理设置
This commit is contained in:
gaohaifeng 2025-09-03 11:41:28 +08:00
parent ef3d8d7334
commit 83a14dd6ad
4 changed files with 26 additions and 8 deletions

View File

@ -33,10 +33,10 @@ const otherConfig = {
}
]
},
sceneId: '',
}
const option = {
export const option = {
...otherConfig,
backgroundColor: 'rgba(13, 16, 22, 1)',
grid: {

View File

@ -1,16 +1,27 @@
<template>
<collapse-item name="信息" :expanded="true">
<setting-item-box name="场景ID" :alone="true">
<setting-item>
<n-input v-model:value="optionData.sceneId" type="textarea" size="small"></n-input>
</setting-item>
</setting-item-box>
</collapse-item>
</template>
<script setup lang="ts">
import { PropType } from 'vue'
import { NSpace, NCard, NFormItem, NInput } from 'naive-ui'
import { option } from './config'
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
import config from './config'
defineProps({
chartConfig: {
type: Object as PropType<config>,
required: true
},
optionData: {
type: Object as PropType<typeof option>,
required: true
}
})
</script>

View File

@ -74,7 +74,8 @@ use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponen
// API
const fetchChartData = async (timeType: string, riskLevel: number) => {
try {
const response:any = await axiosInstance.get(`/awjt/screen/alarmByOption/${timeType}/${riskLevel}`,
console.log('props.chartConfig.option',props.chartConfig.option)
const response:any = await axiosInstance.get(`/awjt/screen/alarmByOption/${timeType}/${riskLevel}/${props.chartConfig.option.sceneId}`,
{baseURL:''})
if (response.state === true) {
return response.value || []

View File

@ -66,9 +66,15 @@ export default ({ mode }) =>
rewrite: (path) => path.replace(/^\/aw/, '')
},
'/awjt/': {
target: 'http://127.0.0.1:8921/',
changeOrigin: true
}, '/dev': {
target: 'http://127.0.0.1:8080/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/awjt/, '')
},
// '/awjt/': {
// target: 'http://127.0.0.1:8921/',
// changeOrigin: true
// },
'/dev': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev/, '')