fix: 页面字段/接口调整
This commit is contained in:
@@ -301,14 +301,9 @@ const chartStates: Record<
|
||||
> = Object.fromEntries(
|
||||
networkElementTypes.value.map(type => [type, createChartState(type)])
|
||||
) as Record<AllChartType, ReturnType<typeof createChartState>>;
|
||||
|
||||
//期择器
|
||||
interface RangePicker extends Record<AllChartType, [string, string]> {
|
||||
placeholder: [string, string];
|
||||
}
|
||||
|
||||
|
||||
// 日期选择器状态
|
||||
const rangePicker = reactive<RangePicker>({
|
||||
const rangePicker = reactive({
|
||||
...(Object.fromEntries(
|
||||
networkElementTypes.value.map(type => [
|
||||
type,
|
||||
@@ -533,18 +528,18 @@ const fetchData = async (type: AllChartType) => {
|
||||
|
||||
try {
|
||||
const dateRange = rangePicker[type] as [string, string];
|
||||
const [startTime, endTime] = dateRange;
|
||||
const [beginTime, endTime] = dateRange;
|
||||
const res = await listKPIData({
|
||||
neType: type.toUpperCase(),
|
||||
neId: '001',
|
||||
startTime,
|
||||
beginTime,
|
||||
endTime,
|
||||
sortField: 'timeGroup',
|
||||
sortOrder: 'desc',
|
||||
interval: 60 * 15,
|
||||
});
|
||||
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
state.tableState.data = res.data;
|
||||
await renderChart(type);
|
||||
}
|
||||
@@ -810,7 +805,7 @@ const fetchKPITitle = async (type: AllChartType) => {
|
||||
: currentLocale.value.split('_')[0];
|
||||
try {
|
||||
const res = await getKPITitle(type.toUpperCase());
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 保存现有的颜色映
|
||||
const existingColors = new Map(chartStates[type].seriesColors);
|
||||
|
||||
@@ -827,7 +822,7 @@ const fetchKPITitle = async (type: AllChartType) => {
|
||||
return dayjs(Number(text)).format('YYYY-MM-DD HH:mm:ss');
|
||||
},
|
||||
},
|
||||
...res.data.map(item => {
|
||||
...res.data.map((item:any) => {
|
||||
const kpiId = item.kpiId;
|
||||
// 如果没有现有的颜色,生成新的颜色
|
||||
if (!existingColors.has(kpiId)) {
|
||||
|
||||
Reference in New Issue
Block a user