feat(component-env): 添加测试状态展示功能

- 新增测试状态列,显示未测试、测试通过、测试失败三种状态
- 更新环境配置按钮的显示条件,需测试通过才可点击
- 优化按钮loading状态的初始化代码结构
master
钟良源 2 months ago
parent 6450b05a56
commit ec6569a8ab

@ -33,7 +33,10 @@ const ComponentEnv = () => {
const [selectedArch, setSelectedArch] = useState(null); // 选中的架构类型
const [searchText, setSearchText] = useState(''); // 搜索文本
const [addItem, setAddItem] = useState(null); // 点击环境配置按钮时记录当前信息
const [loadingActions, setLoadingActions] = useState<{ id: number | null; action: string | null }>({ id: null, action: null }); // 按钮loading状态
const [loadingActions, setLoadingActions] = useState<{ id: number | null; action: string | null }>({
id: null,
action: null
}); // 按钮loading状态
const columns: TableColumnProps[] = [
{
@ -87,13 +90,36 @@ const ComponentEnv = () => {
</div>
)
},
{
title: '测试状态',
dataIndex: 'available',
render: (_, record: any) => (
<div>
{record.available == '0' && (
<Tag color="gray">
</Tag>
)}
{record.available == '1' && (
<Tag color="green">
</Tag>
)}
{record.available == '-1' && (
<Tag color="red">
</Tag>
)}
</div>
)
},
{
title: '操作',
width: 230,
align: 'center',
render: (_, record: any) => (
<Space>
{record.isEnable === 'NOT_EXIST' && (
{record.isEnable === 'NOT_EXIST' && record.available == '1' && (
<Button type="text" onClick={() => {
setAddItem(record);
setVisible1(true);

Loading…
Cancel
Save