-
}
- type="primary"
- style={{ right: 24, top: 100 }}
- />
-
- {data.map((item: any) => {
- return (
-
- {
- handleEditKnowledge(item.id);
- }}
- >
-
-
-
{item.name}
-
- {
- e.stopPropagation();
- e.nativeEvent.stopImmediatePropagation();
- confirm(item.id);
- }}
- okText="Yes"
- cancelText="No"
- >
- {
- e.stopPropagation();
- e.nativeEvent.stopImmediatePropagation();
- }}
- />
-
-
-
-
-
-
- {item.doc_num}文档
-
-
-
- {item.chunk_num}个
-
-
-
- {item.token_num}千字符
-
-
- {formatDate(item.update_date)}
-
-
-
-
-
- );
- })}
-
+
+
+
+
Welcome back, Zing
+
+ Which database are we going to use today?
+
+
+
+ } className={styles.filterButton}>
+ Filters
+
+ }
+ onClick={handleAddKnowledge}
+ className={styles.topButton}
+ >
+ Create knowledge base
+
+
- >
+
+ {data.map((item: any) => {
+ return (
+
+
+
+ );
+ })}
+
+
);
};
diff --git a/web/src/pages/knowledge/knowledge-card/index.less b/web/src/pages/knowledge/knowledge-card/index.less
new file mode 100644
index 000000000..17b6bb642
--- /dev/null
+++ b/web/src/pages/knowledge/knowledge-card/index.less
@@ -0,0 +1,73 @@
+.container {
+ height: 251px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+
+ .content {
+ display: flex;
+ justify-content: space-between;
+
+ .context {
+ flex: 1;
+ }
+ }
+
+ .footer {
+ // text-align: left;
+ }
+ .footerTop {
+ padding-bottom: 2px;
+ }
+}
+
+.card {
+ border-radius: 12px;
+ border: 1px solid rgba(234, 236, 240, 1);
+ box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
+ padding: 24px;
+ min-width: 300px;
+ cursor: pointer;
+
+ .titleWrapper {
+ // flex: 1;
+ .title {
+ font-size: 24px;
+ line-height: 32px;
+ font-weight: 600;
+ color: rgba(0, 0, 0, 0.88);
+ }
+ .description {
+ font-size: 12px;
+ font-weight: 600;
+ line-height: 20px;
+ color: rgba(0, 0, 0, 0.45);
+ }
+ }
+
+ :global {
+ .ant-card-body {
+ padding: 0;
+ margin: 0;
+ }
+ }
+ .bottom {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+ .bottomLeft {
+ vertical-align: middle;
+ }
+ .leftIcon {
+ margin-right: 10px;
+ font-size: 18px;
+ vertical-align: middle;
+ }
+ .rightText {
+ font-size: 12px;
+ font-weight: 600;
+ color: rgba(0, 0, 0, 0.65);
+ vertical-align: middle;
+ }
+}
diff --git a/web/src/pages/knowledge/knowledge-card/index.tsx b/web/src/pages/knowledge/knowledge-card/index.tsx
new file mode 100644
index 000000000..2536641c0
--- /dev/null
+++ b/web/src/pages/knowledge/knowledge-card/index.tsx
@@ -0,0 +1,123 @@
+import { ReactComponent as MoreIcon } from '@/assets/svg/more.svg';
+import { formatDate } from '@/utils/date';
+import {
+ AntDesignOutlined,
+ CalendarOutlined,
+ DeleteOutlined,
+ FileTextOutlined,
+ UserOutlined,
+} from '@ant-design/icons';
+import { Avatar, Card, Dropdown, MenuProps, Space, Tooltip } from 'antd';
+import { MouseEvent } from 'react';
+import { useDispatch, useNavigate } from 'umi';
+
+import styles from './index.less';
+
+interface IProps {
+ item: any;
+}
+
+const KnowledgeCard = ({ item }: IProps) => {
+ const navigate = useNavigate();
+ const dispatch = useDispatch();
+
+ const handleDelete = (e: MouseEvent
) => {
+ e.stopPropagation();
+ };
+
+ const items: MenuProps['items'] = [
+ {
+ key: '1',
+ label: (
+
+ 删除
+
+
+ ),
+ },
+ ];
+
+ const confirm = (id: string) => {
+ dispatch({
+ type: 'knowledgeModel/rmKb',
+ payload: {
+ kb_id: id,
+ },
+ });
+ };
+
+ const handleCardClick = () => {
+ navigate(`add/setting?activeKey=file&id=${item.id}`);
+ };
+
+ const onConfirmDelete = (e?: MouseEvent) => {
+ e?.stopPropagation();
+ e?.nativeEvent.stopImmediatePropagation();
+ confirm(item.id);
+ };
+
+ return (
+
+
+
+
} />
+
+
+ {/*
+
+ */}
+
+
+
+
+
+
+
{item.name}
+
A comprehensive knowledge base for crafting effective resumes.
+
+
+
+
+
+
+ {item.doc_num}文档
+
+
+
+
+
+
+
+ {formatDate(item.update_date)}
+
+
+
+
+
+ K
+
+
+ }
+ />
+
+ }
+ />
+
+
+
+
+
+ );
+};
+
+export default KnowledgeCard;
diff --git a/web/src/utils/date.ts b/web/src/utils/date.ts
index 9f806e9dc..dc9272d30 100644
--- a/web/src/utils/date.ts
+++ b/web/src/utils/date.ts
@@ -12,9 +12,9 @@ export function lastWeek() {
return formatDate(moment().subtract(1, 'weeks'));
}
-export function formatDate(date) {
+export function formatDate(date: any) {
if (!date) {
return '';
}
- return moment(date).format('YYYY-MM-DD');
+ return moment(date).format('DD/MM/YYYY');
}