Search in sources :

Example 1 with PageController

use of com.cas.sim.tis.view.controller.PageController in project TeachingInSimulation by ScOrPiOzzy.

the class LibraryMenu method initMenu.

@Override
protected void initMenu() {
    int role = Session.get(Session.KEY_LOGIN_ROLE);
    if (RoleConst.ADMIN == role) {
        addMenuItem(MsgUtil.getMessage("library.menu.mock"), "iconfont.svg.exam", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.ADMIN_MOCK), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.old"), "iconfont.svg.exam", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.ADMIN_OLD), PageLevel.Level1);
        });
    } else if (RoleConst.TEACHER == role) {
        addMenuItem(MsgUtil.getMessage("library.menu.mock"), "iconfont.svg.exam", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.TEACHER_MOCK), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.old"), "iconfont.svg.exam", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.TEACHER_OLD), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.teacher"), "iconfont.svg.more", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.TEACHER_MINE), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.exam"), "iconfont.svg.record", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new PublishListForTeacher(), PageLevel.Level1);
        });
        Integer publishId = Session.get(Session.KEY_LIBRARY_PUBLISH_ID);
        if (publishId != null) {
            publish(publishId);
        }
    } else if (RoleConst.STUDENT == role) {
        addMenuItem(MsgUtil.getMessage("library.menu.mock"), "iconfont.svg.exam", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.STUDENT_MOCK), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.old"), "iconfont.svg.exam", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.STUDENT_OLD), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.teacher"), "iconfont.svg.more", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new LibraryList(LibraryMenuType.STUDENT_MINE), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.exam"), "iconfont.svg.record", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new PublishListForStudent(PublishType.EXAM), PageLevel.Level1);
        });
        addMenuItem(MsgUtil.getMessage("library.menu.train"), "iconfont.svg.record", e -> {
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new PublishListForStudent(PublishType.PRACTICE), PageLevel.Level1);
        });
    }
}
Also used : PageLevel(com.cas.sim.tis.view.controller.PageController.PageLevel) RoleConst(com.cas.sim.tis.consts.RoleConst) IPublish(com.cas.sim.tis.view.control.IPublish) PublishType(com.cas.sim.tis.consts.PublishType) PageController(com.cas.sim.tis.view.controller.PageController) LibraryMenuType(com.cas.sim.tis.view.control.imp.library.LibraryList.LibraryMenuType) SpringUtil(com.cas.sim.tis.util.SpringUtil) IDistory(com.cas.sim.tis.view.control.IDistory) ExamingMenuItem(com.cas.sim.tis.view.control.imp.question.ExamingMenuItem) LeftMenu(com.cas.sim.tis.view.control.imp.LeftMenu) MsgUtil(com.cas.sim.tis.util.MsgUtil) Session(com.cas.sim.tis.consts.Session) PageController(com.cas.sim.tis.view.controller.PageController)

Example 2 with PageController

use of com.cas.sim.tis.view.controller.PageController in project TeachingInSimulation by ScOrPiOzzy.

the class PreparationDetail method openResource.

private void openResource(Integer id) {
    ResourceAction action = SpringUtil.getBean(ResourceAction.class);
    action.browsed(id);
    Resource resource = action.findResourceByID(id);
    // 跳转到查看页面
    PageController controller = SpringUtil.getBean(PageController.class);
    controller.loadContent(new ResourceViewer(resource), PageLevel.Level2);
}
Also used : PageController(com.cas.sim.tis.view.controller.PageController) PreparationResource(com.cas.sim.tis.entity.PreparationResource) Resource(com.cas.sim.tis.entity.Resource) ResourceViewer(com.cas.sim.tis.view.control.imp.ResourceViewer) ResourceAction(com.cas.sim.tis.action.ResourceAction) PreparationResourceAction(com.cas.sim.tis.action.PreparationResourceAction)

Example 3 with PageController

use of com.cas.sim.tis.view.controller.PageController in project TeachingInSimulation by ScOrPiOzzy.

the class PreparationDetail method openCognition.

private void openCognition(Integer id) {
    ElecComp comp = SpringUtil.getBean(ElecCompAction.class).findElecCompById(id);
    PageController controller = SpringUtil.getBean(PageController.class);
    Recongnize3D content = new Recongnize3D();
    controller.loadContent(content, PageLevel.Level2);
    controller.showLoading();
    controller.setEndHideLoading((v) -> {
        content.setElecComp(comp);
    });
}
Also used : ElecCompAction(com.cas.sim.tis.action.ElecCompAction) Recongnize3D(com.cas.sim.tis.view.control.imp.jme.Recongnize3D) PageController(com.cas.sim.tis.view.controller.PageController) ElecComp(com.cas.sim.tis.entity.ElecComp)

Example 4 with PageController

use of com.cas.sim.tis.view.controller.PageController in project TeachingInSimulation by ScOrPiOzzy.

the class PreparationMenu method initializeContent.

private void initializeContent(TitledPane pane, Catalog project) {
    List<Catalog> tasks = SpringUtil.getBean(CatalogAction.class).findCatalogsByParentId(project.getId());
    VBox box = new VBox(10);
    for (Catalog task : tasks) {
        ToggleButton taskBtn = new ToggleButton(task.getName());
        taskBtn.setGraphic(createGraphicTitle(task));
        taskBtn.getStyleClass().add("titled-content-btn");
        taskBtn.setOnAction(e -> {
            // TODO 加载备课详情
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new PreparationDetail(task), PageLevel.Level1);
        });
        box.getChildren().add(taskBtn);
        group.getToggles().add(taskBtn);
    }
    pane.setContent(box);
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) PageController(com.cas.sim.tis.view.controller.PageController) CatalogAction(com.cas.sim.tis.action.CatalogAction) VBox(javafx.scene.layout.VBox) Catalog(com.cas.sim.tis.entity.Catalog)

Example 5 with PageController

use of com.cas.sim.tis.view.controller.PageController in project TeachingInSimulation by ScOrPiOzzy.

the class PreviewQuestionPaper method publish.

@FXML
private void publish() {
    // 判断当前是否有考核正在进行
    if (Session.get(Session.KEY_LIBRARY_PUBLISH_ID) != null) {
        AlertUtil.showAlert(AlertType.WARNING, MsgUtil.getMessage("alert.warning.examing"));
        return;
    }
    // 创建考核记录
    List<Class> classes = SpringUtil.getBean(ClassAction.class).findClassesByTeacher(Session.get(Session.KEY_LOGIN_ID));
    Dialog<Integer> dialog = new Dialog<>();
    dialog.setDialogPane(new ClassSelectDialog(classes));
    dialog.setTitle(MsgUtil.getMessage("class.dialog.select"));
    dialog.setPrefSize(652, 420);
    dialog.showAndWait().ifPresent(cid -> {
        if (cid == null) {
            return;
        }
        try {
            Integer publishId = SpringUtil.getBean(LibraryPublishAction.class).publishLibraryToClass(rid, cid);
            // 记录当前考核发布编号
            Session.set(Session.KEY_LIBRARY_PUBLISH_ID, publishId);
            // 添加考核进行时菜单
            PageController controller = SpringUtil.getBean(PageController.class);
            ILeftContent content = controller.getLeftMenu();
            if (content instanceof IPublish) {
                ((IPublish) content).publish(publishId);
            }
        } catch (Exception e) {
            e.printStackTrace();
            AlertUtil.showAlert(AlertType.ERROR, e.getMessage());
        }
    });
}
Also used : IPublish(com.cas.sim.tis.view.control.IPublish) ClassAction(com.cas.sim.tis.action.ClassAction) LibraryPublishAction(com.cas.sim.tis.action.LibraryPublishAction) PageController(com.cas.sim.tis.view.controller.PageController) ClassSelectDialog(com.cas.sim.tis.view.control.imp.classes.ClassSelectDialog) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) ClassSelectDialog(com.cas.sim.tis.view.control.imp.classes.ClassSelectDialog) Class(com.cas.sim.tis.entity.Class) ILeftContent(com.cas.sim.tis.view.control.ILeftContent) IOException(java.io.IOException) FXML(javafx.fxml.FXML)

Aggregations

PageController (com.cas.sim.tis.view.controller.PageController)10 MsgUtil (com.cas.sim.tis.util.MsgUtil)3 SpringUtil (com.cas.sim.tis.util.SpringUtil)3 PageLevel (com.cas.sim.tis.view.controller.PageController.PageLevel)3 ResourceAction (com.cas.sim.tis.action.ResourceAction)2 RoleConst (com.cas.sim.tis.consts.RoleConst)2 Session (com.cas.sim.tis.consts.Session)2 Resource (com.cas.sim.tis.entity.Resource)2 IPublish (com.cas.sim.tis.view.control.IPublish)2 LeftMenu (com.cas.sim.tis.view.control.imp.LeftMenu)2 ResourceViewer (com.cas.sim.tis.view.control.imp.ResourceViewer)2 IOException (java.io.IOException)2 JSONArray (com.alibaba.fastjson.JSONArray)1 CatalogAction (com.cas.sim.tis.action.CatalogAction)1 ClassAction (com.cas.sim.tis.action.ClassAction)1 ElecCompAction (com.cas.sim.tis.action.ElecCompAction)1 LibraryPublishAction (com.cas.sim.tis.action.LibraryPublishAction)1 PreparationResourceAction (com.cas.sim.tis.action.PreparationResourceAction)1 TypicalCaseAction (com.cas.sim.tis.action.TypicalCaseAction)1 UserAction (com.cas.sim.tis.action.UserAction)1