forked from CodePhiliaX/Chat2DB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
3,081 additions
and
1,302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"echart", | ||
"echarts", | ||
"favicons", | ||
"fulltext", | ||
"ghostoy", | ||
"iconfont", | ||
"jdbc", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,9 @@ | |
"echarts", | ||
"favicons", | ||
"findstr", | ||
"fulltext", | ||
"gtag", | ||
"hexi", | ||
"Iconfont", | ||
"indexs", | ||
"JDBC", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
chat2db-client/src/blocks/DatabaseTableEditor/BaseInfo/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '../../../styles/var.less'; | ||
|
||
.box { | ||
padding: 10px; | ||
} | ||
|
||
.formBox { | ||
width: 50%; | ||
} |
54 changes: 54 additions & 0 deletions
54
chat2db-client/src/blocks/DatabaseTableEditor/BaseInfo/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { memo, useState, useContext, useEffect, useImperativeHandle, ForwardedRef, forwardRef } from 'react'; | ||
import styles from './index.less'; | ||
import classnames from 'classnames'; | ||
import { Form, Input } from 'antd'; | ||
import { Context } from '../index'; | ||
import { IBaseInfo } from '@/typings'; | ||
import i18n from '@/i18n'; | ||
|
||
|
||
export interface IBaseInfoRef { | ||
getBaseInfo: () => IBaseInfo; | ||
} | ||
|
||
interface IProps { | ||
className?: string; | ||
} | ||
|
||
const BaseInfo = forwardRef((props: IProps, ref: ForwardedRef<IBaseInfoRef>) => { | ||
const { className } = props; | ||
const { tableDetails } = useContext(Context); | ||
const [form] = Form.useForm(); | ||
|
||
useEffect(() => { | ||
form.setFieldsValue({ | ||
name: tableDetails.name, | ||
comment: tableDetails.comment, | ||
}); | ||
}, [tableDetails]); | ||
|
||
function getBaseInfo(): IBaseInfo { | ||
return form.getFieldsValue(); | ||
} | ||
|
||
useImperativeHandle(ref, () => ({ | ||
getBaseInfo, | ||
})); | ||
|
||
return ( | ||
<div className={classnames(className, styles.box)}> | ||
<div className={styles.formBox}> | ||
<Form form={form} initialValues={{ remember: true }} autoComplete="off" className={styles.form}> | ||
<Form.Item label={i18n('editTable.label.tableName')} name="name"> | ||
<Input /> | ||
</Form.Item> | ||
<Form.Item label={i18n('editTable.label.comment')} name="comment"> | ||
<Input /> | ||
</Form.Item> | ||
</Form> | ||
</div> | ||
</div> | ||
); | ||
}); | ||
|
||
export default BaseInfo |
36 changes: 36 additions & 0 deletions
36
chat2db-client/src/blocks/DatabaseTableEditor/ColumnList/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@import '../../../styles/var.less'; | ||
|
||
.box { | ||
height: 100%; | ||
padding: 10px; | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.columnListHeader { | ||
margin: 0px -5px 10px; | ||
button { | ||
margin: 0px 5px; | ||
} | ||
} | ||
|
||
.tableBox { | ||
flex: 1; | ||
overflow: auto; | ||
} | ||
|
||
.editableCell { | ||
height: 28px; | ||
line-height: 26px; | ||
padding: 0px 7px; | ||
box-sizing: border-box; | ||
border: 1px solid transparent; | ||
border-radius: 4px; | ||
.f-single-line(); | ||
width: 100%; | ||
cursor: pointer; | ||
&:hover { | ||
border: 1px solid var(--color-border); | ||
} | ||
} |
Oops, something went wrong.