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);
});
}
}
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);
}
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);
});
}
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);
}
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());
}
});
}
Aggregations