增加依赖是否已经安装判断

This commit is contained in:
whyour
2023-07-10 23:48:05 +08:00
parent f3791cbb62
commit b69ff2895e
6 changed files with 105 additions and 44 deletions
+13 -19
View File
@@ -33,6 +33,7 @@ import DependenceLogModal from './logModal';
import { useOutletContext } from '@umijs/max';
import { SharedContext } from '@/layouts';
import useTableScrollHeight from '@/hooks/useTableScrollHeight';
import dayjs from 'dayjs';
const { Text } = Typography;
const { Search } = Input;
@@ -123,27 +124,20 @@ const Dependence = () => {
dataIndex: 'remark',
key: 'remark',
},
{
title: '更新时间',
key: 'updatedAt',
dataIndex: 'updatedAt',
render: (text: string) => {
return <span>{dayjs(text).format('YYYY-MM-DD HH:mm:ss')}</span>;
},
},
{
title: '创建时间',
key: 'timestamp',
dataIndex: 'timestamp',
render: (text: string, record: any) => {
const language = navigator.language || navigator.languages[0];
const time = record.createdAt || record.timestamp;
const date = new Date(time)
.toLocaleString(language, {
hour12: false,
})
.replace(' 24:', ' 00:');
return (
<Tooltip
placement="topLeft"
title={date}
trigger={['hover', 'click']}
>
<span>{date}</span>
</Tooltip>
);
key: 'createdAt',
dataIndex: 'createdAt',
render: (text: string) => {
return <span>{dayjs(text).format('YYYY-MM-DD HH:mm:ss')}</span>;
},
},
{
+1 -1
View File
@@ -122,7 +122,7 @@ const DependenceModal = ({
name="name"
label="名称"
rules={[
{ required: true, message: '请输入依赖名称', whitespace: true },
{ required: true, message: '请输入依赖名称,支持指定版本', whitespace: true },
]}
>
<Input.TextArea