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