fix: 指标页面数据获取异常接口调整

This commit is contained in:
TsMask
2025-07-18 21:24:58 +08:00
parent a76c595c4c
commit a19427e953
7 changed files with 102 additions and 103 deletions

View File

@@ -92,8 +92,8 @@ let tableColumns: ColumnsType = [
},
{
title: t('views.perfManage.customTarget.expression'),
dataIndex: 'exprAlias',
align: 'center',
dataIndex: 'expression',
align: 'left',
},
{
title: t('views.perfManage.customTarget.description'),
@@ -354,7 +354,6 @@ function fnModalVisibleByEdit(row?: any, id?: any) {
} else {
fnSelectPerformanceInit(row.neType);
modalState.from = Object.assign(modalState.from, row);
modalState.from.expression = modalState.from.exprAlias;
modalState.title = t('views.perfManage.customTarget.editCustom');
modalState.openByEdit = true;
}

View File

@@ -166,13 +166,14 @@ let queryParams: any = reactive({
/**网元标识 */
neId: '',
/**开始时间 */
startTime: '',
beginTime: '',
/**结束时间 */
endTime: '',
/**排序字段 */
sortField: 'created_at',
sortField: 'timeGroup',
/**排序方式 */
sortOrder: 'desc',
interval: 60,
});
/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */
@@ -335,7 +336,7 @@ function fnGetListTitle() {
if (!state.neType[0]) return false;
// 获取表头文字
listCustom({ neType: state.neType[0], status: '1' })
listCustom({ neType: state.neType[0], status: '1', pageNum: 1, pageSize: 50 })
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.rows.length === 0) {
@@ -409,7 +410,7 @@ function fnGetList() {
tableState.loading = true;
queryParams.neType = state.neType[0];
queryParams.neId = state.neType[1];
queryParams.startTime = queryRangePicker.value[0];
queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1];
listCustomData(toRaw(queryParams))
.then(res => {
@@ -639,7 +640,7 @@ function fnRanderChartData() {
for (const key of keys) {
if (y.key === key) {
y.data.push(+item[key]);
chartDataXAxisData.push(item['timeGroup']);
chartDataXAxisData.push(parseDateToStr(item['timeGroup']));
}
}
}
@@ -749,7 +750,7 @@ function wsMessage(res: Record<string, any>) {
// x轴
if (key === 'timeGroup') {
// chartDataXAxisData.shift();
chartDataXAxisData.push(v);
chartDataXAxisData.push(parseDateToStr(v));
continue;
}
// y轴
@@ -879,7 +880,7 @@ watch(
onMounted(() => {
// 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF
// 获取网元网元列表
listCustom({ status: '1' }).then((res: any) => {
listCustom({ status: '1', pageNum: 1, pageSize: 200 }).then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS) {
if (!res.data.rows.length) {
message.warning({
@@ -925,9 +926,9 @@ onMounted(() => {
const now = new Date();
now.setMinutes(0, 0, 0);
// 设置起始时间为整点前一小时
const startTime = new Date(now);
startTime.setHours(now.getHours() - 1);
queryRangePicker.value[0] = `${startTime.getTime()}`;
const beginTime = new Date(now);
beginTime.setHours(now.getHours() - 1);
queryRangePicker.value[0] = `${beginTime.getTime()}`;
// 设置结束时间为整点
const endTime = new Date(now);
endTime.setMinutes(59, 59, 59);

View File

@@ -213,14 +213,14 @@ async function fetchHistoryData(neId: string) {
try {
// 计算30分钟前的时间
const endTime = Date.now()
const startTime = endTime - (30 * 60 * 1000) // 30分钟前
const beginTime = endTime - (30 * 60 * 1000) // 30分钟前
// 构建查询参数,与黄金指标界面保持一致
const params = {
neType: 'IMS',
neId: neId,
interval: 60, // 1分钟颗粒度
startTime: startTime.toString(),
beginTime: beginTime.toString(),
endTime: endTime.toString(),
sortField: 'timeGroup',
sortOrder: 'desc',