mirror of
https://gitee.com/dromara/go-view.git
synced 2025-06-29 16:29:14 +08:00
fix: 设备一张图优化
This commit is contained in:
parent
99e7bcd68a
commit
5dff1aa08f
2
.env
2
.env
@ -5,7 +5,7 @@ VITE_DEV_PORT = '8080'
|
|||||||
# VITE_DEV_PATH = 'http://192.168.0.34:11887'
|
# VITE_DEV_PATH = 'http://192.168.0.34:11887'
|
||||||
VITE_DEV_PATH = 'http://192.168.0.34:8025/'
|
VITE_DEV_PATH = 'http://192.168.0.34:8025/'
|
||||||
# VITE_DEV_PATH = 'http://192.168.0.120:3001'
|
# VITE_DEV_PATH = 'http://192.168.0.120:3001'
|
||||||
VITE_DEV_TOKEN = "1c476210-ddea-4f3f-bd82-832fd5df020d"
|
VITE_DEV_TOKEN = "2e51947c-5d8d-42f2-99e8-8d841cff7a00"
|
||||||
|
|
||||||
# production path
|
# production path
|
||||||
# VITE_PRO_PATH = 'http://192.168.0.235:8177'
|
# VITE_PRO_PATH = 'http://192.168.0.235:8177'
|
||||||
|
@ -19,31 +19,35 @@ const globalQueryParamsStore = useGlobalQueryParamsStore()
|
|||||||
}
|
}
|
||||||
// 处理数据
|
// 处理数据
|
||||||
if(dataSource==='IT'){
|
if(dataSource==='IT'){
|
||||||
|
|
||||||
const res = await publicInterface('/dcim/asset','get_asset_overview_page_info_new', query)
|
const res = await publicInterface('/dcim/asset','get_asset_overview_page_info_new', query)
|
||||||
res!.data = {
|
res!.data = {
|
||||||
// dimensions: res?.data.brand_count.map((item: {})=>Object.keys(item).join('')),
|
// dimensions: res?.data.brand_count.map((item: {})=>Object.keys(item).join('')),
|
||||||
dimensions: ['品牌','data'],
|
dimensions: ['品牌','data'],
|
||||||
source:res?.data.brand_count.slice(0,8).map((item: {})=>{
|
source:res?.data?.brand_count.slice(0,7).map((item: {})=>{
|
||||||
return {
|
return {
|
||||||
'品牌':Object.keys(item)[0],
|
'品牌':Object.keys(item)[0],
|
||||||
data:Object.values(item)[0],
|
data:Object.values(item)[0],
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
console.log(res,'调用了吗')
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}else{
|
}else{
|
||||||
const res = await publicInterface('/dcim/dems/device','get_dev_brand_count', query)
|
const res = await publicInterface('/dcim/dems/device','get_dev_brand_count', query)
|
||||||
|
|
||||||
res!.data = {
|
res!.data = {
|
||||||
// dimensions: res?.data.brand_count.map((item: {})=>Object.keys(item).join('')),
|
// dimensions: res?.data.brand_count.map((item: {})=>Object.keys(item).join('')),
|
||||||
dimensions: ['品牌','data'],
|
dimensions: ['品牌','data'],
|
||||||
source:res?.data.slice(0,8).map((item: any)=>{
|
source:res?.data.slice(0,7).map((item: any)=>{
|
||||||
return {
|
return {
|
||||||
'品牌':item.name,
|
'品牌':item.name,
|
||||||
data:item.count,
|
data:item.count,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
console.log(res,'调用了吗1')
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,14 +14,11 @@ export const handleCategoryBrandCountTable =async (targetComponent: CreateCompon
|
|||||||
errmsg: ''
|
errmsg: ''
|
||||||
}
|
}
|
||||||
const globalQueryParamsStore = useGlobalQueryParamsStore()
|
const globalQueryParamsStore = useGlobalQueryParamsStore()
|
||||||
|
|
||||||
console.log(currentSource,'currentSource');
|
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
...globalQueryParamsStore.getGlobalQueryParams
|
...globalQueryParamsStore.getGlobalQueryParams
|
||||||
}
|
}
|
||||||
const res = await publicInterface(currentSource==='IT'?'/dcim/asset':'/dcim/dems/device',currentSource==='IT'?'get_category_brand_count': 'get_dev_category_brand_count', queryParams)
|
const res = await publicInterface(currentSource==='IT'?'/dcim/asset':'/dcim/dems/device',currentSource==='IT'?'get_category_brand_count': 'get_dev_category_brand_count', queryParams)
|
||||||
const top = ['TOP1','TOP2','TOP3']
|
const top = ['TOP1','TOP2','TOP3']
|
||||||
|
|
||||||
res!.data = {
|
res!.data = {
|
||||||
dimensions: ['分类名',...top],
|
dimensions: ['分类名',...top],
|
||||||
source:res?.data.map((item: any)=>{
|
source:res?.data.map((item: any)=>{
|
||||||
|
@ -14,9 +14,10 @@ export const handleCompanyTempTop =async (targetComponent: CreateComponentType)
|
|||||||
data: { ...dataJson },
|
data: { ...dataJson },
|
||||||
errmsg: ''
|
errmsg: ''
|
||||||
}
|
}
|
||||||
const res = await publicInterface('/dcim/dems/device_point', 'temp_list_dashboard', {signal_ids:[signal_ids],space_complete_id})
|
const res:any = await publicInterface('/dcim/dems/device_point', 'temp_list_dashboard', {signal_ids:[signal_ids],space_complete_id})
|
||||||
|
console.log(res,'res_handleCompanyTempTop');
|
||||||
|
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
console.log(res,'res_handleCompanyTempTop');
|
|
||||||
res.data = {
|
res.data = {
|
||||||
// dimensions: res?.data.brand_count.map((item: {})=>Object.keys(item).join('')),
|
// dimensions: res?.data.brand_count.map((item: {})=>Object.keys(item).join('')),
|
||||||
dimensions: ['名称','温度值'],
|
dimensions: ['名称','温度值'],
|
||||||
@ -28,5 +29,13 @@ export const handleCompanyTempTop =async (targetComponent: CreateComponentType)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
}else{
|
||||||
|
// 后端没有给errcode,前端重置
|
||||||
|
res.errcode = '00000'
|
||||||
|
res.data = {
|
||||||
|
dimensions:[],
|
||||||
|
source:[]
|
||||||
|
}
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type VChart from 'vue-echarts'
|
import type VChart from 'vue-echarts'
|
||||||
import { setOption } from "@/packages/public";
|
import { setOption } from "@/packages/public";
|
||||||
import { ref, toRefs, watch } from "vue";
|
import { ref, toRefs, watch,getCurrentInstance } from "vue";
|
||||||
import { CreateComponentType, ChartFrameEnum } from '@/packages/index.d'
|
import { CreateComponentType, ChartFrameEnum } from '@/packages/index.d'
|
||||||
import { useChartEditStore } from "@/store/modules/chartEditStore/chartEditStore";
|
import { useChartEditStore } from "@/store/modules/chartEditStore/chartEditStore";
|
||||||
import { CurrentSourceEnum, resultType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
import { CurrentSourceEnum, resultType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||||
@ -24,6 +24,8 @@ import { handleManulInput } from './commonDataComponents/useManualInputRes'
|
|||||||
import { handleManulInputSingle } from './commonDataComponents/useManualInputSingleRes'
|
import { handleManulInputSingle } from './commonDataComponents/useManualInputSingleRes'
|
||||||
import { ResultErrcode } from '@/enums/httpEnum'
|
import { ResultErrcode } from '@/enums/httpEnum'
|
||||||
import { logDark } from 'naive-ui';
|
import { logDark } from 'naive-ui';
|
||||||
|
import { fetchChartComponent } from '@/packages';
|
||||||
|
|
||||||
|
|
||||||
// 获取类型
|
// 获取类型
|
||||||
type ChartEditStoreType = typeof useChartEditStore
|
type ChartEditStoreType = typeof useChartEditStore
|
||||||
@ -61,18 +63,34 @@ export const useChartCommonData = (
|
|||||||
// let series = []
|
// let series = []
|
||||||
// if(dataset.dimensions.length - 1) {
|
// if(dataset.dimensions.length - 1) {
|
||||||
// for(let i = 0; i < dataset.dimensions.length - 1; i++) {
|
// for(let i = 0; i < dataset.dimensions.length - 1; i++) {
|
||||||
// series.push(cloneDeep(seriesItem))
|
// series.push(cloneDeep(seriesItem))
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// series = [seriesItem]
|
// series = [seriesItem]
|
||||||
// }
|
// }
|
||||||
|
// 获取当前组件实例
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (vChartRef.value) {
|
if (vChartRef.value) {
|
||||||
|
// 缓存组件的实例后续更新用得上
|
||||||
|
const instanceMap = new Map()
|
||||||
|
// 存储构造函数引用,如果直接使用vChartRef.value的话会报错,因为json序列化无法对构造函数进行处理,先将它放到map中等使用的时候再获取
|
||||||
|
instanceMap.set('$ref', vChartRef.value);
|
||||||
|
targetComponent.$ref = instanceMap
|
||||||
Object.assign(targetComponent.option, {
|
Object.assign(targetComponent.option, {
|
||||||
// series,
|
// series,
|
||||||
dataset,
|
dataset,
|
||||||
})
|
})
|
||||||
setOption(vChartRef.value, { dataset })
|
setOption(vChartRef.value, { dataset })
|
||||||
|
}else{
|
||||||
|
Object.assign(targetComponent.option, {
|
||||||
|
// series,
|
||||||
|
dataset,
|
||||||
|
})
|
||||||
|
const instance = targetComponent?.$ref?.get('$ref')
|
||||||
|
setOption(instance, { dataset })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(SingleDataArr.some(_ => _ === currentSource)) { // 单个值的处理
|
else if(SingleDataArr.some(_ => _ === currentSource)) { // 单个值的处理
|
||||||
@ -135,9 +153,12 @@ export const useChartCommonData = (
|
|||||||
break;
|
break;
|
||||||
case CurrentSourceEnum.ASSETSCLASS:
|
case CurrentSourceEnum.ASSETSCLASS:
|
||||||
res = await handleAssetsClass(targetComponent)
|
res = await handleAssetsClass(targetComponent)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case CurrentSourceEnum.COMPANYTEMPTOP:
|
case CurrentSourceEnum.COMPANYTEMPTOP:
|
||||||
res = await handleCompanyTempTop(targetComponent)
|
res = await handleCompanyTempTop(targetComponent)
|
||||||
|
console.log(res,'res',targetComponent,'触发了吗')
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case CurrentSourceEnum.ALARMTREND:
|
case CurrentSourceEnum.ALARMTREND:
|
||||||
res = await handleAlarmTrend(targetComponent)
|
res = await handleAlarmTrend(targetComponent)
|
||||||
|
@ -65,15 +65,17 @@ switch (props.chartConfig.commonData.currentSource) {
|
|||||||
globalQueryParamsStore.setGlobalQueryParams({
|
globalQueryParamsStore.setGlobalQueryParams({
|
||||||
space_complete_id : e.data.complete_id
|
space_complete_id : e.data.complete_id
|
||||||
})
|
})
|
||||||
console.log(chartEditStore.getComponentList,'chartEditStore')
|
console.log(chartEditStore.getComponentList,'chartEditStore_getComponentList')
|
||||||
// 没有统一更新数据的方法,只能尝试改变它的更新时间,促使watch触发请求方法
|
// 没有统一更新数据的方法,只能尝试改变它的更新时间,促使watch触发请求方法
|
||||||
chartEditStore.getComponentList.forEach(component=>{
|
chartEditStore.getComponentList.forEach(component=>{
|
||||||
component.request.requestInterval = 15
|
// component.request.requestInterval = 10
|
||||||
|
// component.request.requestInterval = 15
|
||||||
|
component.request.immediate = true
|
||||||
|
|
||||||
useChartCommonData(component, useChartEditStore)
|
useChartCommonData(component, useChartEditStore)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(globalQueryParamsStore.getGlobalQueryParams,'chartConfig2')
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -162,7 +162,6 @@ const updateMapFn = (data: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(props.chartConfig.option.series[0].data,'props.chartConfig.option.series[0].data')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//动态获取json注册地图
|
//动态获取json注册地图
|
||||||
|
@ -150,11 +150,13 @@ watch(() => checkAll.value, (v) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const getNumber = () => {
|
const getNumber = () => {
|
||||||
|
console.log(props.chartConfig.customData?.dems_device_point_signal_ids,'props.chartConfig.customData?.dems_device_point_signal_ids')
|
||||||
const q = {
|
const q = {
|
||||||
space_complete_id: props.chartConfig.customData?.space_complete_id,
|
space_complete_id: props.chartConfig.customData?.space_complete_id,
|
||||||
confirm_statuss: alarmConfirmStatus.value,
|
confirm_statuss: alarmConfirmStatus.value,
|
||||||
handle_statuss: alarmHandleStatuss.value,
|
handle_statuss: alarmHandleStatuss.value,
|
||||||
recovery_statuss: alarmRecoveryStatus.value
|
recovery_statuss: alarmRecoveryStatus.value,
|
||||||
|
dems_device_point_signal_ids: props.chartConfig.customData?.dems_device_point_signal_ids.split(','),
|
||||||
}
|
}
|
||||||
publicInterface('/dcim/dems/devie_active_alarm', 'count_by_level_new', q).then(res => {
|
publicInterface('/dcim/dems/devie_active_alarm', 'count_by_level_new', q).then(res => {
|
||||||
if (res && JSON.stringify(res.data) !== '{}') {
|
if (res && JSON.stringify(res.data) !== '{}') {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<div class="classify" v-for="item in type_count" :key="item">
|
<div class="classify" v-for="item in type_count" :key="item">
|
||||||
<div class="img">
|
<div class="img">
|
||||||
<img v-if="props.chartConfig?.customData?.currentSource==='IT'" src="@/assets/images/chart/decorates/Base1.png" alt="">
|
<img v-if="props.chartConfig?.customData?.currentSource==='IT'" src="@/assets/images/chart/decorates/Base1.png" alt="">
|
||||||
<img v-else src="@/assets/images/chart/decorates/Base2.png" alt="">
|
<img v-else src="@/assets/images/chart/decorates/Base4.png" alt="">
|
||||||
<div class="value">
|
<div class="value">
|
||||||
{{Object.values(item)[0]}}
|
{{Object.values(item)[0]}}
|
||||||
|
|
||||||
@ -59,7 +59,9 @@ const queryParams = {
|
|||||||
}
|
}
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
if(props.chartConfig?.customData?.currentSource==='IT'){
|
if(props.chartConfig?.customData?.currentSource==='IT'){
|
||||||
publicInterface('/dcim/asset', 'get_asset_overview_page_info_new', queryParams).then(res => {
|
publicInterface('/dcim/asset', 'get_asset_overview_page_info_new', {
|
||||||
|
...globalQueryParamsStore.getGlobalQueryParams
|
||||||
|
}).then(res => {
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
type_count.value = res.data.type_count
|
type_count.value = res.data.type_count
|
||||||
// for (const key in computeNodeData) {
|
// for (const key in computeNodeData) {
|
||||||
@ -68,7 +70,9 @@ const getData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
publicInterface('/dcim/dems/device', 'get_dev_category_count', queryParams).then(res => {
|
publicInterface('/dcim/dems/device', 'get_dev_category_count', {
|
||||||
|
...globalQueryParamsStore.getGlobalQueryParams
|
||||||
|
}).then(res => {
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
type_count.value = res.data.map((item:any)=>{
|
type_count.value = res.data.map((item:any)=>{
|
||||||
return {
|
return {
|
||||||
@ -104,7 +108,14 @@ watch(()=>props.chartConfig?.customData?.currentSource,()=>{
|
|||||||
console.log(props.chartConfig?.customData?.currentSource,'chartConfig');
|
console.log(props.chartConfig?.customData?.currentSource,'chartConfig');
|
||||||
getData()
|
getData()
|
||||||
// 根据currentSource去获取对应 参数
|
// 根据currentSource去获取对应 参数
|
||||||
|
})
|
||||||
|
watch(()=>props.chartConfig?.request?.immediate,(v)=>{
|
||||||
|
|
||||||
|
if(!v)return
|
||||||
|
getData()
|
||||||
|
props.chartConfig.request.immediate = false
|
||||||
|
// 根据currentSource去获取对应 参数
|
||||||
|
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@ -167,14 +178,14 @@ onUnmounted(() => {
|
|||||||
transform: translate(-50%,-50%);
|
transform: translate(-50%,-50%);
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 17px;
|
font-size: 20px;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.count{
|
.count{
|
||||||
font-size: 17px;
|
font-size: 20px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
font-family: LESLIE;
|
font-family: LESLIE;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
<div class="overview" v-for="item in type_count" :key="item">
|
<div class="overview" v-for="item in type_count" :key="item">
|
||||||
<div class="img">
|
<div class="img">
|
||||||
<img src="@/assets/images/chart/decorates/Base7.png" alt="">
|
<img v-if="props.chartConfig?.customData?.currentSource==='IT'" src="@/assets/images/chart/decorates/Base1.png" alt="">
|
||||||
|
<img v-else src="@/assets/images/chart/decorates/Base4.png" alt="">
|
||||||
<div class="value">
|
<div class="value">
|
||||||
{{item.value}}
|
{{item.value}}
|
||||||
|
|
||||||
@ -55,14 +56,16 @@ const queryParams = {
|
|||||||
}
|
}
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
if(props.chartConfig?.customData?.currentSource==='IT'){
|
if(props.chartConfig?.customData?.currentSource==='IT'){
|
||||||
publicInterface('/dcim/asset', 'get_asset_overview_page_info_new', queryParams).then(res => {
|
publicInterface('/dcim/asset', 'get_asset_overview_page_info_new', {
|
||||||
|
...globalQueryParamsStore.getGlobalQueryParams
|
||||||
|
}).then(res => {
|
||||||
|
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
let commonBrands = res.data.type_count.reduce((prev:any, curr:any) => {
|
let commonBrands = res.data.type_count?.reduce((prev:any, curr:any) => {
|
||||||
const prevValue:any = Object.values(prev)[0];
|
const prevValue:any = Object.values(prev)[0];
|
||||||
const currValue:any = Object.values(curr)[0];
|
const currValue:any = Object.values(curr)[0];
|
||||||
return currValue > prevValue ? curr : prev;
|
return currValue > prevValue ? curr : prev;
|
||||||
});
|
},{});
|
||||||
let obj = [
|
let obj = [
|
||||||
{
|
{
|
||||||
label:'设备总数',
|
label:'设备总数',
|
||||||
@ -81,11 +84,13 @@ const getData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
publicInterface('/dcim/dems/device', 'get_dev_category_count', queryParams).then(res => {
|
publicInterface('/dcim/dems/device', 'get_dev_category_count', {
|
||||||
|
...globalQueryParamsStore.getGlobalQueryParams
|
||||||
|
}).then(res => {
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
const commonBrands:any = res.data.reduce((prev:any, curr:any) => {
|
const commonBrands:any = res?.data?.reduce((prev:any, curr:any) => {
|
||||||
return curr.count > prev.count ? curr : prev;
|
return curr.count > prev.count ? curr : prev;
|
||||||
});
|
},{});
|
||||||
let obj = [
|
let obj = [
|
||||||
{
|
{
|
||||||
label:'设备总数',
|
label:'设备总数',
|
||||||
@ -107,7 +112,9 @@ const getData = () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
let timer:unknown
|
let timer:unknown
|
||||||
|
console.log([props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit].join('&&'),'[props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit]_overview')
|
||||||
watch(() => [props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit].join('&&'), v => {
|
watch(() => [props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit].join('&&'), v => {
|
||||||
|
console.log(v,'overview_v')
|
||||||
if(!isPreview()) return
|
if(!isPreview()) return
|
||||||
console.log(props,'props')
|
console.log(props,'props')
|
||||||
|
|
||||||
@ -120,15 +127,25 @@ watch(() => [props.chartConfig.request.requestInterval, props.chartConfig.reques
|
|||||||
getData()
|
getData()
|
||||||
}, number)
|
}, number)
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
deep:true,
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(()=>props.chartConfig?.customData?.currentSource,()=>{
|
watch(()=>props.chartConfig?.customData?.currentSource,()=>{
|
||||||
|
|
||||||
console.log(props.chartConfig?.customData?.currentSource,'chartConfig');
|
|
||||||
getData()
|
getData()
|
||||||
// 根据currentSource去获取对应 参数
|
// 根据currentSource去获取对应 参数
|
||||||
|
|
||||||
})
|
})
|
||||||
|
watch(()=>props.chartConfig?.request?.immediate,(v)=>{
|
||||||
|
|
||||||
|
if(!v)return
|
||||||
|
getData()
|
||||||
|
props.chartConfig.request.immediate = false
|
||||||
|
// 根据currentSource去获取对应 参数
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|
||||||
@ -177,6 +194,7 @@ onUnmounted(() => {
|
|||||||
transform: translate(-50%,-50%);
|
transform: translate(-50%,-50%);
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
src/packages/index.d.ts
vendored
3
src/packages/index.d.ts
vendored
@ -166,7 +166,8 @@ export interface PublicConfigType {
|
|||||||
[InteractEvents.INTERACT_COMPONENT_ID]: string | undefined
|
[InteractEvents.INTERACT_COMPONENT_ID]: string | undefined
|
||||||
[InteractEvents.INTERACT_FN]: { [name: string]: string }
|
[InteractEvents.INTERACT_FN]: { [name: string]: string }
|
||||||
}[]
|
}[]
|
||||||
}
|
},
|
||||||
|
$ref
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateComponentType extends PublicConfigType, requestConfig {
|
export interface CreateComponentType extends PublicConfigType, requestConfig {
|
||||||
|
@ -24,11 +24,12 @@ import cloneDeep from 'lodash/cloneDeep'
|
|||||||
|
|
||||||
// 请求基础属性
|
// 请求基础属性
|
||||||
export const requestConfig: RequestConfigType = {
|
export const requestConfig: RequestConfigType = {
|
||||||
|
immediate:false,
|
||||||
requestDataType: RequestDataTypeEnum.STATIC,
|
requestDataType: RequestDataTypeEnum.STATIC,
|
||||||
requestHttpType: RequestHttpEnum.GET,
|
requestHttpType: RequestHttpEnum.GET,
|
||||||
requestUrl: '',
|
requestUrl: '',
|
||||||
requestInterval: 15,
|
requestInterval: 15,
|
||||||
requestIntervalUnit: RequestHttpIntervalEnum.SECOND,
|
requestIntervalUnit: RequestHttpIntervalEnum.HOUR,
|
||||||
requestContentType: RequestContentTypeEnum.DEFAULT,
|
requestContentType: RequestContentTypeEnum.DEFAULT,
|
||||||
requestParamsBodyType: RequestBodyEnum.NONE,
|
requestParamsBodyType: RequestBodyEnum.NONE,
|
||||||
requestSQLContent: {
|
requestSQLContent: {
|
||||||
|
@ -214,6 +214,8 @@ export interface RequestGlobalConfigType extends RequestPublicConfigType {
|
|||||||
|
|
||||||
// 单个图表请求配置
|
// 单个图表请求配置
|
||||||
export interface RequestConfigType extends RequestPublicConfigType {
|
export interface RequestConfigType extends RequestPublicConfigType {
|
||||||
|
// 是否立即执行
|
||||||
|
immediate?:boolean
|
||||||
// 所选全局数据池的对应 id
|
// 所选全局数据池的对应 id
|
||||||
requestDataPondId?: string
|
requestDataPondId?: string
|
||||||
// 组件定制轮询时间
|
// 组件定制轮询时间
|
||||||
|
@ -275,11 +275,15 @@ export const setKeyboardDressShow = (keyCode?: number) => {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const JSONStringify = <T>(data: T) => {
|
export const JSONStringify = <T>(data: T) => {
|
||||||
|
console.log(data,'data')
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
data,
|
data,
|
||||||
(key, val) => {
|
(key, val) => {
|
||||||
// 处理函数丢失问题
|
// 处理函数丢失问题
|
||||||
if (typeof val === 'function') {
|
if (typeof val === 'function') {
|
||||||
|
console.log(key,'key')
|
||||||
|
console.log(val,'val')
|
||||||
|
|
||||||
return `${val}`
|
return `${val}`
|
||||||
}
|
}
|
||||||
// 处理 undefined 丢失问题
|
// 处理 undefined 丢失问题
|
||||||
|
Loading…
x
Reference in New Issue
Block a user