Merge branch 'master' of http://119.45.132.149:3000/security/go-view-fetch
This commit is contained in:
commit
49b4b663d2
@ -139,6 +139,7 @@ import axiosInstance from '@/api/axios'
|
||||
import VChart from 'vue-echarts'
|
||||
import SmallBorder from '../SmallBorder01Co/index.vue'
|
||||
import { height } from 'dom-helpers'
|
||||
import axios from 'axios'
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<CreateComponentType & typeof option>,
|
||||
@ -272,7 +273,7 @@ const formatAlarmItem = (item) => {
|
||||
const fetchRecentAlarms = async () => {
|
||||
try {
|
||||
isLoading.value = true
|
||||
const res = await axiosInstance.get('/awjt/space/getRecentAlarms', { baseURL: '' });
|
||||
const res = await axiosInstance.get('/awjt/space/getRecentAlarms', {responseType: 'json', baseURL: '' });
|
||||
if (res.state === true) {
|
||||
let rawData = [];
|
||||
if (Array.isArray(res.value.items)) {
|
||||
|
@ -59,7 +59,8 @@
|
||||
import { PropType, computed, ref, onMounted, onUnmounted } from 'vue'
|
||||
import { option as configOption } from './config'
|
||||
import SmallBorder from '../SmallBorder/index.vue'
|
||||
import axios from 'axios'
|
||||
import axiosInstance from '@/api/axios'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<{ option: typeof configOption }>,
|
||||
@ -87,10 +88,11 @@ const convertTimestampToDateTime = (timestamp: number | string) => {
|
||||
|
||||
const fetchRecentAlarms = async () => {
|
||||
try {
|
||||
const res = await axios.get(
|
||||
const res = await axiosInstance.get(
|
||||
`/awjt/space/getRecentAlarms`, // 手动添加 dev
|
||||
{
|
||||
responseType: 'json',
|
||||
baseURL:''
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -38,7 +38,7 @@ import { mergeTheme } from '@/packages/public/chart'
|
||||
import config, { includes } from './config'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent } from 'echarts/components'
|
||||
import CustomSelect from './select.vue'
|
||||
import axios from 'axios'
|
||||
import axiosInstance from '@/api/axios'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@ -74,7 +74,8 @@ use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponen
|
||||
// API调用函数
|
||||
const fetchChartData = async (timeType: string, riskLevel: number) => {
|
||||
try {
|
||||
const response = await axios.get(`/awjt/screen/alarmByOption/${timeType}/${riskLevel}`)
|
||||
const response = await axiosInstance.get(`/awjt/screen/alarmByOption/${timeType}/${riskLevel}`,
|
||||
{baseURL:''})
|
||||
if (response.data.state === true) {
|
||||
return response.data.value || []
|
||||
} else {
|
||||
|
@ -49,7 +49,7 @@ import { useChartDataFetch } from '@/hooks'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import isObject from 'lodash/isObject'
|
||||
import CustomSelect from './select.vue'
|
||||
import axios from 'axios'
|
||||
import axiosInstance from '@/api/axios'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@ -82,7 +82,7 @@ const selectedTimeRange = ref('day')
|
||||
// API调用函数
|
||||
const fetchChartData = async (option: string) => {
|
||||
try {
|
||||
const response = await axios.get(`/awjt/screen/handleByOption/${option}`)
|
||||
const response = await axiosInstance.get(`/awjt/screen/handleByOption/${option}`,{baseURL:''})
|
||||
if (response.data.state === true) {
|
||||
return response.data.value || []
|
||||
} else {
|
||||
|
@ -24,7 +24,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent, GraphicComponent } from 'echarts/components'
|
||||
import CustomSelect from './select.vue'
|
||||
import dataJson from './data.json'
|
||||
import axios from 'axios'
|
||||
import axiosInstance from '@/api/axios'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@ -236,11 +236,12 @@ function generateTimeRange(period: string): { startTime: string; endTime: string
|
||||
// 异步获取报警数据
|
||||
async function fetchAlarmData({ startTime, endTime }: { startTime: string; endTime: string }) {
|
||||
try {
|
||||
const res = await axios.get(
|
||||
const res = await axiosInstance.get(
|
||||
`/awjt/getAlarmdataRecord`,
|
||||
{
|
||||
params: { startTime, endTime }, // 请求参数
|
||||
responseType: 'json',
|
||||
baseURL:''
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -55,7 +55,7 @@ import { ref, computed, PropType, onMounted } from 'vue'
|
||||
import { option as configOption } from './config'
|
||||
import SmallBorder from '../SmallBorder/index.vue'
|
||||
import CustomSelect from './select.vue'
|
||||
import axios from 'axios'
|
||||
import axiosInstance from '@/api/axios'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
@ -89,7 +89,7 @@ const calculateWidth = (value: number) => {
|
||||
// 新增:API调用函数
|
||||
const fetchCorpsData = async (option: string) => {
|
||||
try {
|
||||
const response = await axios.get(`/awjt/screen/corpsFive/${option}`)
|
||||
const response = await axiosInstance.get(`/awjt/screen/corpsFive/${option}`,{baseURL:''})
|
||||
if (response.data.state === true) {
|
||||
displayData.value = response.data.value || []
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user