fix: 重置 Offset 部分 partationId 修改为 Select & Offset 数值限制

This commit is contained in:
GraceWalk
2022-09-13 14:35:23 +08:00
parent c9b4d45a64
commit 20756a3453
3 changed files with 26 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Button, DatePicker, Drawer, Form, notification, Radio, Utils, Space, Divider } from 'knowdesign';
import { Button, DatePicker, Drawer, Form, notification, Radio, Utils, Space, Divider, message } from 'knowdesign';
import { useParams } from 'react-router-dom';
import EditTable from '../TestingProduce/component/EditTable';
import Api from '@src/api/index';
@@ -53,11 +53,28 @@ export default (props: any) => {
const [resetOffsetVisible, setResetOffsetVisible] = useState(false);
const customFormRef: any = React.createRef();
const clusterPhyId = Number(routeParams.clusterId);
const [partitionIdList, setPartitionIdList] = useState([]);
useEffect(() => {
form.setFieldsValue({
resetType: defaultResetType,
});
}, []);
useEffect(() => {
Utils.request(Api.getTopicsMetaData(record?.topicName, +routeParams.clusterId))
.then((res: any) => {
const partitionLists = (res?.partitionIdList || []).map((item: any) => {
return {
label: item,
value: item,
};
});
setPartitionIdList(partitionLists);
})
.catch((err) => {
message.error(err);
});
}, []);
const confirm = () => {
let tableData;
if (customFormRef.current) {
@@ -160,8 +177,9 @@ export default (props: any) => {
colCustomConfigs={[
{
title: 'PartitionID',
inputType: 'number',
inputType: 'select',
placeholder: '请输入Partition',
options: partitionIdList,
},
{
title: 'Offset',

View File

@@ -30,7 +30,7 @@ const AutoPage = (props: any) => {
const searchFn = () => {
const params: getOperatingStateListParams = {
pageNo: pageIndex,
pageNo: 1,
pageSize,
fuzzySearchDTOList: [],
};

View File

@@ -651,3 +651,8 @@
}
}
}
.@{ant-prefix}-empty-img-default{
width: 100% !important;
}