章节管理

main
tamguo 7 years ago
parent 5edb7a30d1
commit eb53db701a

@ -0,0 +1,15 @@
package com.tamguo.admin.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.tamguo.admin.model.BookEntity;
public interface BookMapper extends BaseMapper<BookEntity>{
List<BookEntity> queryPage(@Param(value="name")String name , Pagination page);
}

@ -9,7 +9,7 @@ import com.tamguo.admin.model.ChapterEntity;
public interface ChapterMapper extends SuperMapper<ChapterEntity>{
List<ChapterEntity> findByCourseId(@Param(value="courseId") String courseId);
List<ChapterEntity> findByBookId(@Param(value="bookId") String bookId);
List<ChapterEntity> findByParentId(@Param(value="parentId") String parentId);

@ -16,9 +16,7 @@ public class AdEntity extends SuperEntity<AdEntity> implements Serializable {
private static final long serialVersionUID = 1L;
private String businessKey;
private String name;
private String adInfo;
public String getName() {

@ -13,15 +13,10 @@ public class AreaEntity extends SuperEntity<AreaEntity> implements Serializable
private static final long serialVersionUID = 1L;
private String name;
private Integer orders;
private String fullName;
private Integer grade;
private String treePath;
private String parent;
public String getName() {

@ -0,0 +1,91 @@
package com.tamguo.admin.model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.tamguo.admin.config.dao.SuperEntity;
@TableName(value="tiku_book")
public class BookEntity extends SuperEntity<BookEntity>{
private static final long serialVersionUID = 1L;
private String subjectId;
private String courseId;
private String name;
private String publishingHouse;
private Integer questionNum;
private Integer pointNum;
private Integer orders;
@TableField(exist=false)
private String courseName;
public String getCourseId() {
return courseId;
}
public void setCourseId(String courseId) {
this.courseId = courseId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPublishingHouse() {
return publishingHouse;
}
public void setPublishingHouse(String publishingHouse) {
this.publishingHouse = publishingHouse;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public Integer getQuestionNum() {
return questionNum;
}
public void setQuestionNum(Integer questionNum) {
this.questionNum = questionNum;
}
public Integer getPointNum() {
return pointNum;
}
public void setPointNum(Integer pointNum) {
this.pointNum = pointNum;
}
public Integer getOrders() {
return orders;
}
public void setOrders(Integer orders) {
this.orders = orders;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getSubjectId() {
return subjectId;
}
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}
}

@ -18,20 +18,15 @@ public class ChapterEntity extends SuperEntity<ChapterEntity> implements Seriali
private static final long serialVersionUID = 1L;
private String courseId;
private String bookId;
private String name;
private String parentId;
private Integer questionNum;
private Integer pointNum;
private Integer orders;
@TableField(exist=false)
private String parentName;
@TableField(exist=false)
private List<ChapterEntity> childChapterList;
@ -102,4 +97,12 @@ public class ChapterEntity extends SuperEntity<ChapterEntity> implements Seriali
this.parentName = parentName;
}
public String getBookId() {
return bookId;
}
public void setBookId(String bookId) {
this.bookId = bookId;
}
}

@ -17,24 +17,16 @@ public class CourseEntity extends SuperEntity<CourseEntity> implements Serializa
private static final long serialVersionUID = 1L;
private String name;
private String subjectId;
private Integer pointNum;
private Integer questionNum;
private Integer orders;
private String seoTitle;
private String seoKeywords;
private String seoDescription;
@TableField(exist=false)
private String subjectName;
@TableField(exist=false)
private List<ChapterEntity> chapterList;

@ -16,33 +16,19 @@ public class MemberEntity extends SuperEntity<MemberEntity> implements Serializa
private static final long serialVersionUID = 1L;
private String subjectId;
private String courseId;
private String username;
private String nickName;
private String password;
private String avatar;
private String mobile;
private String email;
private Integer point;
private BigDecimal amount;
private Long lastLoginTime;
private Integer paperNum;
private Integer questionNum;
private Integer downNum;
private Integer hitsNum;
@TableField(exist=false)

@ -17,15 +17,10 @@ public class MenuEntity extends SuperEntity<MenuEntity> implements Serializable
private static final long serialVersionUID = 1L;
private String name;
private String pinyin;
private String parentId;
private String isShow;
private Integer orders;
private String url;
@TableField(value="reserve_1")

@ -18,42 +18,26 @@ public class PaperEntity extends SuperEntity<PaperEntity> implements Serializabl
private static final long serialVersionUID = 1L;
private String subjectId;
private String courseId;
private String schoolId;
private String areaId;
private String createrId;
private String name;
private String questionInfo;
private String type;
private String year;
private Integer downHits;
private Integer openHits;
private String seoTitle;
private String seoKeywords;
private String seoDescription;
@TableField(exist=false)
private String subjectName;
@TableField(exist=false)
private String courseName;
@TableField(exist=false)
private String areaName;
@TableField(exist=false)
private String schoolName;

@ -14,35 +14,22 @@ public class QuestionEntity extends SuperEntity<QuestionEntity> implements Seria
private static final long serialVersionUID = 1L;
private String analysis;
private String paperId;
private String answer;
private String chapterId;
private String questionType;
private String content;
private String subjectId;
private String courseId;
private String reviewPoint;
private String year;
private String score;
private String auditStatus;
@TableField(exist=false)
private String courseName;
@TableField(exist=false)
private String chapterName;
@TableField(exist=false)
private String subjectName;

@ -16,9 +16,7 @@ public class SchoolEntity extends SuperEntity<SchoolEntity> implements Serializa
private static final long serialVersionUID = 1L;
private String areaId;
private String name;
private String image;
// 试卷

@ -17,15 +17,10 @@ public class SysMenuEntity extends SuperEntity<SysMenuEntity> implements Seriali
private static final long serialVersionUID = 1L;
private String name;
private int orderNum;
private Integer orderNum;
private String parentId;
private int type;
private Integer type;
private String url;
private String perms;
@TableField(exist=false)
@ -48,11 +43,11 @@ public class SysMenuEntity extends SuperEntity<SysMenuEntity> implements Seriali
this.name = name;
}
public int getOrderNum() {
public Integer getOrderNum() {
return this.orderNum;
}
public void setOrderNum(int orderNum) {
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}

@ -17,7 +17,6 @@ public class SysRoleEntity extends SuperEntity<SysRoleEntity> implements Seriali
private static final long serialVersionUID = 1L;
private String perms;
private String name;
@TableField(exist=false)

@ -20,26 +20,18 @@ public class SysUserEntity extends SuperEntity<SysUserEntity> implements Seriali
private static final long serialVersionUID = 1L;
private String userName;
private String nickName;
private String mobile;
private String email;
private String password;
private String roleIds;
@JSONField(serialzeFeatures= SerializerFeature.WriteEnumUsingToString)
private SysUserStatusEnum status;
private String safeKeyValue;
private Long createTime;
private String courseId;
private String subjectId;
@TableField(exist=false)

@ -18,43 +18,29 @@ public class TeacherEntity extends SuperEntity<TeacherEntity> implements Seriali
private static final long serialVersionUID = 1L;
private String mobile;
private String email;
private String name;
private String motto;
private String provinceId;
private String cityId;
private String subjectId;
private String courseId;
private String cardId;
private String cardPhoto;
private String occupationPapers;
private Long createTime;
@JSONField(serialzeFeatures= SerializerFeature.WriteEnumUsingToString)
private TeacherStatus status;
private String qq;
@TableField(exist=false)
private String provinceName;
@TableField(exist=false)
private String courseName;
@TableField(exist=false)
private String cityName;
@TableField(exist=false)
private String subjectName;

@ -0,0 +1,16 @@
package com.tamguo.admin.service;
/**
* Service -
*
* @author tamguo
*
*/
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.tamguo.admin.model.BookEntity;
public interface IBookService extends IService<BookEntity>{
Page<BookEntity> queryPage(String name , Page<BookEntity> page);
}

@ -6,9 +6,6 @@ import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.admin.model.ChapterEntity;
public interface IChapterService {
// 获取科目章节
public List<ChapterEntity> findCourseChapter(String courseId);
// 获取当前章节
public ChapterEntity findById(String uid);
@ -17,7 +14,7 @@ public interface IChapterService {
public ChapterEntity findNextPoint(String uid , Integer orders);
// 获取树形
public List<ChapterEntity> getChapterTree(String courseId);
public List<ChapterEntity> getChapterTree(String bookId);
// 获取树形
public List<ChapterEntity> getChapterTree();

@ -0,0 +1,23 @@
package com.tamguo.admin.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.tamguo.admin.dao.BookMapper;
import com.tamguo.admin.model.BookEntity;
import com.tamguo.admin.service.IBookService;
@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, BookEntity> implements IBookService{
@Autowired
BookMapper bookMapper;
@Override
public Page<BookEntity> queryPage(String name, Page<BookEntity> page) {
return page.setRecords(bookMapper.queryPage(name , page));
}
}

@ -1,6 +1,5 @@
package com.tamguo.admin.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -24,54 +23,6 @@ public class ChapterService extends ServiceImpl<ChapterMapper, ChapterEntity> im
@Autowired
private ChapterMapper chapterMapper;
@Override
public List<ChapterEntity> findCourseChapter(String courseId) {
List<ChapterEntity> chapterList = chapterMapper.findByCourseId(courseId);
// 获取根chapter UID
String rootUid = StringUtils.EMPTY;
for(int i=0 ; i<chapterList.size() ; i++){
ChapterEntity chapter = chapterList.get(i);
if(chapter.getParentId().equals(TamguoConstant.CHAPTER_DEFAULT_ROOT_UID)){
rootUid = chapter.getUid();
}
}
// 获取第一层结构
List<ChapterEntity> entitys = new ArrayList<>();
for(int i=0 ; i<chapterList.size() ; i++){
ChapterEntity chapter = chapterList.get(i);
if(rootUid.equals(chapter.getParentId())){
entitys.add(chapter);
}
}
for(int i=0 ; i<entitys.size() ; i++){
ChapterEntity entity = entitys.get(i);
List<ChapterEntity> childs = new ArrayList<>();
for(int k=0 ; k<chapterList.size() ; k++){
ChapterEntity chapter = chapterList.get(k);
if(entity.getUid().equals(chapter.getParentId())){
childs.add(chapter);
}
}
entity.setChildChapterList(childs);
}
for(int i=0 ; i<entitys.size() ; i++){
List<ChapterEntity> childs = entitys.get(i).getChildChapterList();
for(int k=0 ; k<childs.size() ; k++){
ChapterEntity child = childs.get(k);
List<ChapterEntity> tmpChilds = new ArrayList<>();
for(int n=0 ; n<chapterList.size() ; n++){
ChapterEntity chapter = chapterList.get(n);
if(child.getUid().equals(chapter.getParentId())){
tmpChilds.add(chapter);
}
}
child.setChildChapterList(tmpChilds);
}
}
return entitys;
}
@Override
public ChapterEntity findById(String uid) {
return chapterMapper.selectById(uid);
@ -84,11 +35,11 @@ public class ChapterService extends ServiceImpl<ChapterMapper, ChapterEntity> im
@Transactional(readOnly=false)
@Override
public List<ChapterEntity> getChapterTree(String courseId) {
if(StringUtils.isEmpty(courseId) || "null".equals(courseId)){
public List<ChapterEntity> getChapterTree(String bookId) {
if(StringUtils.isEmpty(bookId) || "null".equals(bookId)){
return rootChapterNode();
}
List<ChapterEntity> list = chapterMapper.findByCourseId(courseId);
List<ChapterEntity> list = chapterMapper.findByBookId(bookId);
if(CollectionUtils.isEmpty(list)) {
return rootChapterNode();
}
@ -98,7 +49,7 @@ public class ChapterService extends ServiceImpl<ChapterMapper, ChapterEntity> im
@Transactional(readOnly=false)
@Override
public List<ChapterEntity> getChapterTree() {
List<ChapterEntity> list = chapterMapper.findByCourseId(ShiroUtils.getUser().getCourseId());
List<ChapterEntity> list = chapterMapper.findByBookId(ShiroUtils.getUser().getCourseId());
if(CollectionUtils.isEmpty(list)) {
return rootChapterNode();
}

@ -0,0 +1,45 @@
package com.tamguo.admin.web.tiku;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.admin.model.BookEntity;
import com.tamguo.admin.service.IBookService;
import com.tamguo.admin.util.ExceptionSupport;
import com.tamguo.admin.util.Result;
@Controller(value="tikuBookController")
public class TikuBookController {
@Autowired
IBookService iBookService;
@RequestMapping("book/queryPage")
@ResponseBody
public Map<String, Object> queryPage(String name , Integer page , Integer limit) {
try {
Page<BookEntity> bookPage = iBookService.queryPage(name, new Page<>(page, limit));
return Result.jqGridResult(bookPage.getRecords(), bookPage.getTotal(), bookPage.getSize(), bookPage.getCurrent(), bookPage.getPages());
} catch (Exception e) {
ExceptionSupport.resolverResult("查询书籍错误", this.getClass(), e);
return null;
}
}
@RequestMapping("book/info/{bookId}.html")
@ResponseBody
public Result info(@PathVariable String bookId){
try {
return Result.result(0, iBookService.selectById(bookId), null);
} catch (Exception e) {
return ExceptionSupport.resolverResult("查询科目", this.getClass(), e);
}
}
}

@ -35,10 +35,10 @@ public class TikuCourseController {
return Result.jqGridResult(list.getRecords(), list.getTotal(), limit, page, list.getPages());
}
@RequestMapping("course/getChapterTree/{courseId}.html")
@RequestMapping("course/getChapterTree/{bookId}")
@ResponseBody
public Result getChapterTree(@PathVariable String courseId){
return Result.result(0, iChapterService.getChapterTree(courseId), null);
public Result getChapterTree(@PathVariable String bookId){
return Result.result(0, iChapterService.getChapterTree(bookId), null);
}
@RequestMapping("course/info/{courseId}.html")

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tamguo.admin.dao.BookMapper">
<select id="queryPage" resultType="BookEntity">
SELECT
b.uid,
b.course_id,
c. name as course_name,
b. name,
b.publishing_house,
b.question_num,
b.point_num,
b.orders
FROM
tiku_book b
LEFT JOIN tiku_course c ON b.course_id = c.uid
<where>
<if test="name != null and name != ''">
b.name like #{name}
</if>
</where>
</select>
</mapper>

@ -21,12 +21,12 @@
</if>
</select>
<select id="findByCourseId" resultType="ChapterEntity">
<select id="findByBookId" resultType="ChapterEntity">
SELECT
c.uid,c.course_id , c.parent_id , c.`name` , c.question_num , c.point_num , c.orders
c.uid,c.course_id , c.book_id , c.parent_id , c.`name` , c.question_num , c.point_num , c.orders
FROM
tiku_chapter c
WHERE c.course_id = #{courseId}
WHERE c.book_id = #{bookId}
ORDER BY c.orders asc
</select>

@ -0,0 +1,248 @@
$(function () {
$("#jqGrid").jqGrid({
url: mainHttp + 'book/queryPage.html',
datatype: "json",
colModel: [
{ label: '书籍ID', name: 'uid', width: 40, key: true , hidden:true},
{ label: '科目名称', name: 'courseName', width: 60 },
{ label: '书籍名称', name: 'name', width: 60 },
{ label: '题目数量', name: 'questionNum', width: 60 },
{ label: '知识点数量', name: 'pointNum', width: 100 },
{ label: '排序', name: 'orders', width: 60 }
],
viewrecords: true,
height: 385,
rowNum: 10,
rowList : [10,30,50],
rownumbers: true,
rownumWidth: 25,
autowidth:true,
multiselect: true,
pager: "#jqGridPager",
jsonReader : {
root: "list",
page: "currPage",
total: "totalPage",
records: "totalCount"
},
prmNames : {
page:"page",
rows:"limit",
order: "order"
},
gridComplete:function(){
//隐藏grid底部滚动条
$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
}
});
});
var setting = {
data: {
simpleData: {
enable: true,
idKey: "uid",
pIdKey: "parentId",
rootPId: -1
},
key: {
url:"nourl"
}
},
view: {
addHoverDom: addHoverDom,
removeHoverDom: removeHoverDom,
selectedMulti: false
},
edit: {
enable: true,
showRemoveBtn: showRemoveBtn
}
};
var newCount = 1;
function addHoverDom(treeId, treeNode) {
var sObj = $("#" + treeNode.tId + "_span");
if(treeNode.level <3){
if (treeNode.editNameFlag || $("#addBtn_"+treeNode.tId).length>0) return;
var addStr = "<span class='button add' id='addBtn_" + treeNode.tId
+ "' title='add node' onfocus='this.blur();'></span>";
sObj.after(addStr);
var btn = $("#addBtn_"+treeNode.tId);
if (btn) btn.bind("click", function(){
var zTree = $.fn.zTree.getZTreeObj("menuTree");
zTree.addNodes(treeNode, {uid:(100 + newCount), parentId:treeNode.id, name:"章节" + (newCount++)});
return false;
});
}
};
function removeHoverDom(treeId, treeNode) {
$("#addBtn_"+treeNode.tId).unbind().remove();
};
function showRemoveBtn(treeId, treeNode) {
if(treeNode.courseId != null){
return false;
}else{
true;
}
}
var ztree;
var vm = new Vue({
el:'#rrapp',
data:{
showList: true,
title: null,
subjectList:null,
courseList:null,
q:{
name:null
},
book:{
name:null,
subjectId:null,
courseId:null,
pointNum:null,
questionNum:null,
orders:0,
chapterList:[]
}
},
methods: {
query: function () {
vm.reload();
},
getMenu: function(bookId){
//加载菜单树
return axios.get(mainHttp + "course/getChapterTree/"+bookId+".html");
},
getSubjectList: function(){
return axios.get(mainHttp + "subject/getSubject.html");
},
getCouseList: function(){
return axios.get(mainHttp + "course/findBySubjectId.html?subjectId="+vm.book.subjectId);
},
add: function(){
vm.showList = false;
vm.title = "新增";
vm.book = {uid:null,name:null,subjectId:null,courseId:null,pointNum:null,questionNum:null,orders:0};
axios.all([vm.getMenu() , vm.getSubjectList()]).then(axios.spread(function (mResponse,sResponse) {
ztree = $.fn.zTree.init($("#menuTree"), setting, mResponse.data.result);
vm.subjectList = sResponse.data.result;
}));
},
update: function (event) {
var bookId = getSelectedRow();
if(bookId == null){
return ;
}
vm.showList = false;
vm.title = "修改";
axios.all([vm.getMenu(bookId) , vm.getSubjectList(), vm.getBook(bookId)]).then(axios.spread(function (mResponse , sResponse, cResponse) {
ztree = $.fn.zTree.init($("#menuTree"), setting, mResponse.data.result);
vm.subjectList = sResponse.data.result;
vm.book = cResponse.data.result;
// 获取科目
axios.all([vm.getCouseList() , vm.getBook(bookId)]).then(axios.spread(function (cResponse , bResponse) {
vm.courseList = cResponse.data.result;
vm.book = bResponse.data.result;
}));
}));
},
getBook:function(bookId){
return axios.get(mainHttp + "book/info/"+bookId+".html");
},
del: function (event) {
var bookIds = getSelectedRows();
if(bookIds == null){
return ;
}
confirm('确定要删除选中的记录?', function(){
$.ajax({
type: "POST",
url: mainHttp + "book/delete.html",
data: JSON.stringify(bookIds),
success: function(r){
if(r.code === 0){
alert('操作成功', function(index){
vm.reload();
});
}else{
alert(r.message);
}
}
});
});
},
saveOrUpdate: function (event) {
var url = vm.book.uid == null ? mainHttp + "book/save.html" : mainHttp + "book/update.html";
// 获取章节
var node = ztree.getNodes();
var nodes = ztree.transformToArray(node);
Vue.set(vm.book, 'chapterList', nodes);
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(vm.book),
success: function(r){
if(r.code === 0){
alert('操作成功', function(index){
vm.reload();
});
}else{
alert(r.message);
}
}
});
},
menuTree: function(){
layer.open({
type: 1,
offset: '50px',
skin: 'layui-layer-molv',
title: "选择菜单",
area: ['300px', '450px'],
shade: 0,
shadeClose: false,
content: jQuery("#menuLayer"),
btn: ['确定', '取消'],
btn1: function (index) {
var node = ztree.getSelectedNodes();
//选择上级菜单
vm.menu.parentId = node[0].uid;
vm.menu.parentName = node[0].name;
layer.close(index);
}
});
},
reload: function (event) {
vm.showList = true;
var page = $("#jqGrid").jqGrid('getGridParam','page');
$("#jqGrid").jqGrid('setGridParam',{
postData:{'name': vm.q.name},
page:page
}).trigger("reloadGrid");
},
changeSubject:function(){
axios.all([this.getCouseList()]).then(axios.spread(function (cResponse) {
vm.courseList = cResponse.data.result;
}));
}
},
watch:{
// 数据修改时触发
subjectList: function() {
this.$nextTick(function(){
$('#subjectId').selectpicker('refresh');
})
},
courseList: function() {
this.$nextTick(function(){
$('#courseId').selectpicker('refresh');
})
}
}
});

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<title>书籍管理</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" th:href="${setting.domain + 'css/bootstrap.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'css/font-awesome.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'plugins/jqgrid/ui.jqgrid-bootstrap.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'plugins/ztree/css/metroStyle/metroStyle.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'plugins/bootstrap-select/bootstrap-select.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'css/main.css'}">
<script th:src="${setting.domain + 'libs/jquery.min.js'}"></script>
<script th:src="${setting.domain + 'plugins/layer/layer.js'}"></script>
<script th:src="${setting.domain + 'libs/bootstrap.min.js'}"></script>
<script th:src="${setting.domain + 'libs/vue.min.js'}"></script>
<script th:src="${setting.domain + 'plugins/jqgrid/grid.locale-cn.js'}"></script>
<script th:src="${setting.domain + 'plugins/jqgrid/jquery.jqGrid.min.js'}"></script>
<script th:src="${setting.domain + 'plugins/ztree/jquery.ztree.all.min.js'}"></script>
<script th:src="${setting.domain + 'plugins/bootstrap-select/bootstrap-select.min.js'}"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script th:src="${setting.domain + 'js/common.js'}"></script>
</head>
<body>
<div id="rrapp" v-cloak>
<div v-show="showList">
<div class="grid-btn">
<div class="form-group col-sm-2">
<input type="text" class="form-control" v-model="q.name" @keyup.enter="query" placeholder="用户名">
</div>
<a class="btn btn-default" @click="query">查询</a>
<a shiro:hasPermission="tiku:course:save" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a shiro:hasPermission="tiku:course:update" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
<a shiro:hasPermission="tiku:course:delete" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>
<div v-show="!showList" class="panel panel-default">
<div class="panel-heading">{{title}}</div>
<form class="form-horizontal">
<div class="form-group">
<div class="col-sm-2 control-label">考试</div>
<div class="col-sm-10">
<select id="subjectId" data-live-search="true" v-model="book.subjectId" @change="changeSubject">
<option value="">请选择</option>
<option v-bind:value="subject.uid" v-for="subject in subjectList">{{subject.name}}</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">科目</div>
<div class="col-sm-10">
<select id="courseId" data-live-search="true" v-model="book.courseId">
<option value="">请选择</option>
<option v-bind:value="course.uid" v-for="course in courseList">{{course.name}}</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">名称</div>
<div class="col-sm-10">
<input type="text" class="form-control" v-model="book.name" placeholder="书籍名称"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">题目数量</div>
<div class="col-sm-10">
<input type="number" class="form-control" v-model="book.questionNum" placeholder="题目数量"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">知识点数量</div>
<div class="col-sm-10">
<input type="number" class="form-control" v-model="book.pointNum" placeholder="知识点数量"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">排序</div>
<div class="col-sm-10">
<input type="number" class="form-control" v-model="book.orders" placeholder="排序"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">章节</div>
<div class="col-sm-4" >
<ul id="menuTree" class="ztree"></ul>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label"></div>
<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
</div>
</form>
</div>
</div>
<!-- 选择菜单 -->
<div id="menuLayer" style="display: none;padding:10px;">
<ul id="menuTree" class="ztree"></ul>
</div>
<script th:src="${setting.domain + 'js/tiku/book/list.js?v=6'}"></script>
<script type="text/javascript" th:inline="javascript">
var mainHttp = [[${setting.domain}]];
</script>
</body>
</html>
Loading…
Cancel
Save