fix: 页面字段/接口调整
This commit is contained in:
@@ -550,8 +550,9 @@ function fnGetList(pageNum?: number) {
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
|
||||
@@ -372,8 +372,9 @@ function fnGetList(pageNum?: number) {
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
|
||||
@@ -64,22 +64,22 @@ let rangePicker = reactive<RangePickerType>({
|
||||
|
||||
/**查询全部资源数据列表 */
|
||||
function fnGetList() {
|
||||
let startTime = null;
|
||||
let beginTime = null;
|
||||
let endTime = null;
|
||||
const dateNumber = rangePicker.all;
|
||||
if (dateNumber[0]) {
|
||||
startTime = dateNumber[0];
|
||||
beginTime = dateNumber[0];
|
||||
endTime = dateNumber[1];
|
||||
} else {
|
||||
const now = new Date();
|
||||
now.setHours(0, 0, 0, 0);
|
||||
startTime = `${now.getTime()}`;
|
||||
beginTime = `${now.getTime()}`;
|
||||
endTime = `${new Date().getTime()}`;
|
||||
}
|
||||
|
||||
getLoad({
|
||||
type: 'all',
|
||||
startTime: startTime,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
neType: '#',
|
||||
neId: '#',
|
||||
@@ -94,7 +94,7 @@ function fnGetList() {
|
||||
});
|
||||
|
||||
// 设置初始时间段
|
||||
const initRangePicker: [string, string] = [startTime, endTime];
|
||||
const initRangePicker: [string, string] = [beginTime, endTime];
|
||||
rangePicker.all = initRangePicker;
|
||||
rangePicker.load = initRangePicker;
|
||||
rangePicker.cpu = initRangePicker;
|
||||
@@ -357,11 +357,11 @@ function fnGetQuery(
|
||||
if (!dateString[0]) {
|
||||
return;
|
||||
}
|
||||
const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
|
||||
const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
|
||||
const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
|
||||
getLoad({
|
||||
type: type,
|
||||
startTime: startTime.getTime(),
|
||||
beginTime: beginTime.getTime(),
|
||||
endTime: endTime.getTime(),
|
||||
neType: '#',
|
||||
neId: '#',
|
||||
@@ -385,11 +385,11 @@ function fnGetQueryIO(v: any, dateString: [string, string]) {
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
|
||||
const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
|
||||
const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
|
||||
getLoad({
|
||||
type: 'io',
|
||||
startTime: startTime.getTime(),
|
||||
beginTime: beginTime.getTime(),
|
||||
endTime: endTime.getTime(),
|
||||
neType: '#',
|
||||
neId: '#',
|
||||
@@ -405,11 +405,11 @@ function fnGetQueryNetwork(v: any, dateString: [string, string]) {
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
|
||||
const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
|
||||
const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
|
||||
getLoad({
|
||||
type: 'network',
|
||||
startTime: startTime.getTime(),
|
||||
beginTime: beginTime.getTime(),
|
||||
endTime: endTime.getTime(),
|
||||
neType: '#',
|
||||
neId: '#',
|
||||
|
||||
@@ -14,7 +14,7 @@ const { t } = useI18n();
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**登录主机 */
|
||||
ipaddr: '',
|
||||
loginIp: '',
|
||||
/**登录账号 */
|
||||
userName: '',
|
||||
});
|
||||
@@ -63,7 +63,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.monitor.online.host'),
|
||||
dataIndex: 'ipaddr',
|
||||
dataIndex: 'loginIp',
|
||||
align: 'left',
|
||||
},
|
||||
// {
|
||||
@@ -129,7 +129,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams.ipaddr = '';
|
||||
queryParams.loginIp = '';
|
||||
queryParams.userName = '';
|
||||
tablePagination.current = 1;
|
||||
tablePagination.pageSize = 20;
|
||||
@@ -141,8 +141,10 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listOnline(queryParams).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
tableState.data = res.rows;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
@@ -209,7 +211,7 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.monitor.online.host')" name="ipaddr">
|
||||
<a-input
|
||||
v-model:value="queryParams.ipaddr"
|
||||
v-model:value="queryParams.loginIp"
|
||||
allow-clear
|
||||
:maxlength="128"
|
||||
>
|
||||
|
||||
@@ -51,7 +51,7 @@ function fnGraphGroupChange(value: any) {
|
||||
function fnGraphDataGroups(reload: boolean = false) {
|
||||
getGraphGroups()
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
graphState.groupOptions = res.data.map(str => {
|
||||
return { label: str, value: str };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user