diff --git a/web_new/components/chat/db-editor.tsx b/web_new/components/chat/db-editor.tsx index d0a9aa1c7..441dc9b5d 100644 --- a/web_new/components/chat/db-editor.tsx +++ b/web_new/components/chat/db-editor.tsx @@ -474,184 +474,186 @@ function DbEditor() { return (
-
-
-
- { + return { + label: item.round_name, + value: item.round, + }; + })} + onChange={(e) => { + setCurrentRound(e); + }} + /> + + {treeData && treeData.length > 0 && ( +
+ { + setExpandedKeys(newExpandedKeys); + setAutoExpandParent(false); }} - > - {item.title} -
- - ))} -
-
- {editorValue.map((item, index) => ( -
- { - const { sql, thoughts } = resolveSqlAndThoughts(value); - setNewEditorValue((old) => { - return Object.assign({}, old, { - sql, - thoughts, - }); - }); + expandedKeys={expandedKeys} + autoExpandParent={autoExpandParent} + treeData={treeData} + fieldNames={{ + title: 'showTitle', }} - tableData={tableData} - chartData={chartData} />
- ))} + )}
- ) : ( - { - const { sql, thoughts } = resolveSqlAndThoughts(value); - setNewEditorValue((old) => { - return Object.assign({}, old, { - sql, - thoughts, +
+
{ + setIsMenuExpand(!isMenuExpand); + }} + > + {!isMenuExpand ? : } +
+
+
+
+ {/* Actions */} +
+
+ + +
+
+ { + setLayout('TB'); + }} + /> + { + setLayout('LR'); + }} + /> +
+
+ {/* Panel */} + {Array.isArray(editorValue) ? ( +
+
+ {editorValue.map((item, index) => ( + +
{ + setCurrentTabIndex(index); + setNewEditorValue(editorValue?.[index]); + }} + > + {item.title} +
+
+ ))} +
+
+ {editorValue.map((item, index) => ( +
+ { + const { sql, thoughts } = resolveSqlAndThoughts(value); + setNewEditorValue((old) => { + return Object.assign({}, old, { + sql, + thoughts, + }); + }); + }} + tableData={tableData} + chartData={chartData} + /> +
+ ))} +
+
+ ) : ( + { + const { sql, thoughts } = resolveSqlAndThoughts(value); + setNewEditorValue((old) => { + return Object.assign({}, old, { + sql, + thoughts, + }); }); - }); - }} - tableData={tableData} - chartData={undefined} - tables={tables} - /> - )} + }} + tableData={tableData} + chartData={undefined} + tables={tables} + /> + )} +
);