|
|
@@ -1,6 +1,12 @@
|
|
|
import molecule from "@dtinsight/molecule";
|
|
|
import {ColorThemeMode, IActivityMenuItemProps, IEditorGroup} from "@dtinsight/molecule/esm/model";
|
|
|
-import {DRAWER_MENU_ENUM, ID_COLLECTIONS, OPEN_IN_NEW_GROUP, QUESTION_LIST_PANEL} from "../constant";
|
|
|
+import {
|
|
|
+ DRAWER_MENU_ENUM,
|
|
|
+ FOLDERTREE_SUBMIT_TOOLBAR,
|
|
|
+ ID_COLLECTIONS,
|
|
|
+ OPEN_IN_NEW_GROUP,
|
|
|
+ QUESTION_LIST_PANEL
|
|
|
+} from "../constant";
|
|
|
import {UniqueId} from "@dtinsight/molecule/esm/common/types";
|
|
|
import {IExtension} from "@dtinsight/molecule/esm/model/extension";
|
|
|
import LogPane from "@/components/logPane";
|
|
|
@@ -9,7 +15,7 @@ import {jumpToLogin} from "@/services/auth";
|
|
|
import Api from "@/api";
|
|
|
import {history} from "umi";
|
|
|
import notification from "@/components/notification";
|
|
|
-import {deleteCookie, getQuestion, goToLogin, randomId, updateAccountContext} from "@/utils";
|
|
|
+import {deleteCookie, getQuestion, goToLogin, randomId, submitQuestion, updateAccountContext} from "@/utils";
|
|
|
import {loadUser} from "@/redux/action/action";
|
|
|
import {QuickTogglePanelAction} from "@dtinsight/molecule/esm/monaco/quickTogglePanelAction";
|
|
|
import {Button} from "antd";
|
|
|
@@ -123,18 +129,23 @@ function initExplorer() {
|
|
|
),
|
|
|
})
|
|
|
const explorerData = molecule.explorer.getState().data?.concat() || [];
|
|
|
- const { SAMPLE_FOLDER_PANEL_ID, EDITOR_PANEL_ID } = molecule.builtin.getConstants();
|
|
|
+ const { SAMPLE_FOLDER_PANEL_ID } = molecule.builtin.getConstants();
|
|
|
const folderTreePane = explorerData.find((item) => item.id === SAMPLE_FOLDER_PANEL_ID);
|
|
|
- const editorTreePane = explorerData.find((item) => item.id === EDITOR_PANEL_ID)
|
|
|
- if (editorTreePane?.toolbar) {
|
|
|
- editorTreePane.toolbar[0] = editorTreePane.toolbar[2]
|
|
|
- editorTreePane.toolbar.pop()
|
|
|
- editorTreePane.toolbar.pop()
|
|
|
- }
|
|
|
+
|
|
|
+ console.log(folderTreePane)
|
|
|
+ molecule.explorer.onPanelToolbarClick((panel, toolbarId)=>{
|
|
|
+ switch (toolbarId) {
|
|
|
+ case FOLDERTREE_SUBMIT_TOOLBAR.id:
|
|
|
+ submitQuestion()
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ })
|
|
|
if (folderTreePane?.toolbar) {
|
|
|
folderTreePane.toolbar[0] = folderTreePane.toolbar[2]
|
|
|
folderTreePane.toolbar[1] = folderTreePane.toolbar[3]
|
|
|
- folderTreePane.toolbar.pop()
|
|
|
+ folderTreePane.toolbar[2] = FOLDERTREE_SUBMIT_TOOLBAR
|
|
|
folderTreePane.toolbar.pop()
|
|
|
}
|
|
|
molecule.explorer.setState({
|