Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chat-query
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
jaden
chat-query
Commits
311f4e5e
Commit
311f4e5e
authored
Jul 19, 2023
by
jaden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix bugs
parent
ed16e4be
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
19 deletions
+47
-19
components/AITool/index.tsx
components/AITool/index.tsx
+3
-4
components/import_modal.js
components/import_modal.js
+12
-5
components/list_nav.js
components/list_nav.js
+15
-7
components/nav.js
components/nav.js
+9
-2
next-i18next.config.js
next-i18next.config.js
+2
-0
pages/graphs/[id].js
pages/graphs/[id].js
+6
-1
No files found.
components/AITool/index.tsx
View file @
311f4e5e
...
...
@@ -394,6 +394,7 @@ export function AIWrapper({
onPressEnter={() => !SendButton && handleButtonClick()}
value={inputValue}
onChange={value => {
console.log(value, 'value');
const el = input.current?.dom;
if (el) {
el.value = value;
...
...
@@ -517,6 +518,7 @@ export function AIWrapper({
);
}
}, [currentAssistantMessage, check]);
console.log(currentAssistantMessage, 'currentAssistantMessage');
if (simpleMode) {
if (simpleMode === 'input') {
...
...
@@ -700,13 +702,11 @@ export function AIWrapper({
ref={input}
value={inputValue}
onChange={value => {
setRecordValue(value);
const el = input.current?.dom;
console.log(value, recordValue, el, el.value);
if (el) el.value = value || '';
setRecordValue(value);
}}
onPressEnter={e => {
console.log('w22');
if (
e.key === 'Enter' &&
!e?.nativeEvent.isComposing &&
...
...
@@ -740,7 +740,6 @@ export function AIWrapper({
// popupVisible: true,
}}
onSelect={(value: string) => {
console.log('w22');
const el = input.current?.dom;
if (el) {
el.value = value;
...
...
components/import_modal.js
View file @
311f4e5e
...
...
@@ -6,7 +6,7 @@ import Editor from '@monaco-editor/react';
import
graphState
from
'
../hooks/use-graph-state
'
;
import
tableModel
from
'
../hooks/table-model
'
;
import
{
Typography
}
from
'
@arco-design/web-react
'
;
import
{
map
}
from
'
lodash
'
;
import
{
get
,
map
}
from
'
lodash
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
{
useEffect
}
from
'
react
'
;
import
{
useMemo
}
from
'
react
'
;
...
...
@@ -207,14 +207,20 @@ export default function ImportModal({ showModal, onCloseModal, cb = _p => {}, ty
const
[
val
,
setValue
]
=
useState
(
''
);
const
[
importType
,
setImportType
]
=
useState
(
'
dbml
'
);
// eslint-disable-next-line react-hooks/exhaustive-deps
const
handleOk
=
async
(
changeValue
,
handleCb
,
failCall
)
=>
{
/**
* options: {
new: Boolean,
importType:string
}
*/
const
handleOk
=
async
(
changeValue
,
handleCb
,
failCall
,
options
=
{})
=>
{
const
value
=
changeValue
||
val
;
if
(
!
value
)
{
onCloseModal
();
return
;
}
try
{
const
result
=
await
Parser
.
parse
(
value
,
importType
);
const
result
=
await
Parser
.
parse
(
value
,
get
(
options
,
'
importType
'
,
importType
)
);
const
graph
=
result
.
schemas
[
0
];
const
tableDict
=
{};
const
linkDict
=
{};
...
...
@@ -294,11 +300,11 @@ export default function ImportModal({ showModal, onCloseModal, cb = _p => {}, ty
});
setTableDict
(
state
=>
({
...
state
,
...
(
options
.
new
?
[]
:
state
)
,
...
tableDict
,
}));
setLinkDict
(
state
=>
({
...
state
,
...
(
options
.
new
?
[]
:
state
)
,
...
linkDict
,
}));
...
...
@@ -316,6 +322,7 @@ export default function ImportModal({ showModal, onCloseModal, cb = _p => {}, ty
if
(
importDBML
)
{
importDBML
.
current
=
handleOk
;
}
//表示已经导,避免多次导入
const
recordData
=
useRef
();
useEffect
(()
=>
{
if
(
recordData
.
current
!==
data
)
{
...
...
components/list_nav.js
View file @
311f4e5e
...
...
@@ -118,13 +118,21 @@ export default function ListNav({
),
});
}
importDBML
.
current
(
sqlNodes
[
0
]?.
textContent
,
({
tableDict
,
linkDict
})
=>
{
handlerImportGraph
({
tableDict
,
linkDict
,
name
:
`
${
modelName
.
outerText
}
`
,
});
});
importDBML
.
current
(
sqlNodes
[
0
]?.
textContent
,
({
tableDict
,
linkDict
})
=>
{
handlerImportGraph
({
tableDict
,
linkDict
,
name
:
`
${
modelName
.
outerText
}
`
,
});
},
undefined
,
{
new
:
true
,
importType
:
'
dbml
'
,
}
);
}}
// renderMessageItem={props => <MessageItem {...props} />}
/
>
...
...
components/nav.js
View file @
311f4e5e
...
...
@@ -253,9 +253,16 @@ export default function Nav({ setShowModal, setShowDrawer, leave = () => {}, imp
<
Menu
.
Item
key
=
"
import
"
className
=
"
context-menu-item
"
onClick
=
{()
=>
setShowModal
(
'
import
'
)}
onClick
=
{()
=>
setShowModal
(
'
import
'
,
2
)}
>
<
IconImport
/>
{
t
(
'
Import Table
'
)}
<
IconImport
/>
{
t
(
'
Import DDL
'
)}
<
/Menu.Item
>
<
Menu
.
Item
key
=
"
import
"
className
=
"
context-menu-item
"
onClick
=
{()
=>
setShowModal
(
'
import
'
,
1
)}
>
<
IconImport
/>
{
t
(
'
Import DBML
'
)}
<
/Menu.Item
>
<
/Menu
>
}
...
...
next-i18next.config.js
View file @
311f4e5e
...
...
@@ -37,6 +37,8 @@ i18n.use(LanguageDetector)
'
AI未能理解您的输入, 请进一步明确您的输入。
'
,
},
nav
:
{
'
Import DBML
'
:
'
导入 DBML
'
,
'
Import DDL
'
:
'
导入 DDL
'
,
'
Apply Select Version
'
:
'
应用所选版本
'
,
'
Exit Logs View
'
:
'
退出日志视图
'
,
Save
:
'
保存
'
,
...
...
pages/graphs/[id].js
View file @
311f4e5e
...
...
@@ -55,6 +55,7 @@ export default function Home() {
const
[
movingTable
,
setMovingTable
]
=
useState
();
const
[
showModal
,
setShowModal
]
=
useState
(
''
);
const
[
addType
,
setAadType
]
=
useState
(
1
);
const
[
showDrawer
,
setShowDrawer
]
=
useState
(
''
);
const
[
formChange
,
setFormChange
]
=
useState
(
false
);
const
[
editingLink
,
setEditingLink
]
=
useState
(
null
);
...
...
@@ -422,7 +423,10 @@ export default function Home() {
<
/Head
>
<
Nav
setShowModal
=
{
setShowModal
}
setShowModal
=
{(
kind
,
type
=
1
)
=>
{
setShowModal
(
kind
);
setAadType
(
type
);
}}
setShowDrawer
=
{
setShowDrawer
}
leave
=
{
saveCheck
}
importDBML
=
{
importDBML
}
...
...
@@ -501,6 +505,7 @@ export default function Home() {
showModal
=
{
showModal
}
onCloseModal
=
{()
=>
setShowModal
(
''
)}
importDBML
=
{
importDBML
}
type
=
{
addType
}
/
>
<
ExportModal
showModal
=
{
showModal
}
onCloseModal
=
{()
=>
setShowModal
(
''
)}
/
>
<
LogsDrawer
showDrawer
=
{
showDrawer
}
onCloseDrawer
=
{()
=>
setShowDrawer
(
''
)}
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment