Просмотр исходного кода

1.修正添加图书 图书分类代码不正确

1 14 часов назад
Родитель
Сommit
6b638759c6

+ 3 - 185
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/entity/Contents.java

@@ -2,6 +2,7 @@ package top.imwork.window.silos.entity;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
 
 import java.io.Serial;
 import java.io.Serializable;
@@ -14,6 +15,7 @@ import java.util.Date;
  * email: e-jiangxiaowei@outlook.com
  * date: 2025-11-04 17:46:32
  */
+@Data
 @TableName("book_contents")
 public class Contents implements Serializable {
     @Serial
@@ -26,7 +28,7 @@ public class Contents implements Serializable {
     /**
      * 关联的图书信息ID
      */
-    private Long bookInfoId;
+    private String bookInfoId;
     /**
      * 父级内容ID
      */
@@ -111,188 +113,4 @@ public class Contents implements Serializable {
      * 备注
      */
     private String remark;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getBookInfoId() {
-        return bookInfoId;
-    }
-
-    public void setBookInfoId(Long bookInfoId) {
-        this.bookInfoId = bookInfoId;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-
-    public Integer getChapterLevel() {
-        return chapterLevel;
-    }
-
-    public void setChapterLevel(Integer chapterLevel) {
-        this.chapterLevel = chapterLevel;
-    }
-
-    public String getChapterNumber() {
-        return chapterNumber;
-    }
-
-    public void setChapterNumber(String chapterNumber) {
-        this.chapterNumber = chapterNumber;
-    }
-
-    public String getChapterTitle() {
-        return chapterTitle;
-    }
-
-    public void setChapterTitle(String chapterTitle) {
-        this.chapterTitle = chapterTitle;
-    }
-
-    public Long getPageNumber() {
-        return pageNumber;
-    }
-
-    public void setPageNumber(Long pageNumber) {
-        this.pageNumber = pageNumber;
-    }
-
-    public String getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getContentText() {
-        return contentText;
-    }
-
-    public void setContentText(String contentText) {
-        this.contentText = contentText;
-    }
-
-    public String getContentHtml() {
-        return contentHtml;
-    }
-
-    public void setContentHtml(String contentHtml) {
-        this.contentHtml = contentHtml;
-    }
-
-    public String getMediaUrl() {
-        return mediaUrl;
-    }
-
-    public void setMediaUrl(String mediaUrl) {
-        this.mediaUrl = mediaUrl;
-    }
-
-    public Integer getWordCount() {
-        return wordCount;
-    }
-
-    public void setWordCount(Integer wordCount) {
-        this.wordCount = wordCount;
-    }
-
-    public Integer getReadingTime() {
-        return readingTime;
-    }
-
-    public void setReadingTime(Integer readingTime) {
-        this.readingTime = readingTime;
-    }
-
-    public Long getSortOrder() {
-        return sortOrder;
-    }
-
-    public void setSortOrder(Long sortOrder) {
-        this.sortOrder = sortOrder;
-    }
-
-    public Integer getIsPublic() {
-        return isPublic;
-    }
-
-    public void setIsPublic(Integer isPublic) {
-        this.isPublic = isPublic;
-    }
-
-    public Integer getHasChildren() {
-        return hasChildren;
-    }
-
-    public void setHasChildren(Integer hasChildren) {
-        this.hasChildren = hasChildren;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
 }

+ 4 - 185
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/bo/ContentsBO.java

@@ -1,5 +1,7 @@
 package top.imwork.window.silos.pojo.bo;
 
+import lombok.Data;
+
 import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
@@ -11,6 +13,7 @@ import java.util.Date;
  * email: e-jiangxiaowei@outlook.com
  * date: 2025-11-04 17:46:32
  */
+@Data
 public class ContentsBO implements Serializable {
     @Serial
     private static final long serialVersionUID = 1L;
@@ -21,7 +24,7 @@ public class ContentsBO implements Serializable {
     /**
      * 关联的图书信息ID
      */
-    private Long bookInfoId;
+    private String bookInfoId;
     /**
      * 父级内容ID
      */
@@ -106,188 +109,4 @@ public class ContentsBO implements Serializable {
      * 备注
      */
     private String remark;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getBookInfoId() {
-        return bookInfoId;
-    }
-
-    public void setBookInfoId(Long bookInfoId) {
-        this.bookInfoId = bookInfoId;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-
-    public Integer getChapterLevel() {
-        return chapterLevel;
-    }
-
-    public void setChapterLevel(Integer chapterLevel) {
-        this.chapterLevel = chapterLevel;
-    }
-
-    public String getChapterNumber() {
-        return chapterNumber;
-    }
-
-    public void setChapterNumber(String chapterNumber) {
-        this.chapterNumber = chapterNumber;
-    }
-
-    public String getChapterTitle() {
-        return chapterTitle;
-    }
-
-    public void setChapterTitle(String chapterTitle) {
-        this.chapterTitle = chapterTitle;
-    }
-
-    public Long getPageNumber() {
-        return pageNumber;
-    }
-
-    public void setPageNumber(Long pageNumber) {
-        this.pageNumber = pageNumber;
-    }
-
-    public String getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getContentText() {
-        return contentText;
-    }
-
-    public void setContentText(String contentText) {
-        this.contentText = contentText;
-    }
-
-    public String getContentHtml() {
-        return contentHtml;
-    }
-
-    public void setContentHtml(String contentHtml) {
-        this.contentHtml = contentHtml;
-    }
-
-    public String getMediaUrl() {
-        return mediaUrl;
-    }
-
-    public void setMediaUrl(String mediaUrl) {
-        this.mediaUrl = mediaUrl;
-    }
-
-    public Integer getWordCount() {
-        return wordCount;
-    }
-
-    public void setWordCount(Integer wordCount) {
-        this.wordCount = wordCount;
-    }
-
-    public Integer getReadingTime() {
-        return readingTime;
-    }
-
-    public void setReadingTime(Integer readingTime) {
-        this.readingTime = readingTime;
-    }
-
-    public Long getSortOrder() {
-        return sortOrder;
-    }
-
-    public void setSortOrder(Long sortOrder) {
-        this.sortOrder = sortOrder;
-    }
-
-    public Integer getIsPublic() {
-        return isPublic;
-    }
-
-    public void setIsPublic(Integer isPublic) {
-        this.isPublic = isPublic;
-    }
-
-    public Integer getHasChildren() {
-        return hasChildren;
-    }
-
-    public void setHasChildren(Integer hasChildren) {
-        this.hasChildren = hasChildren;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
 }

+ 4 - 184
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/dto/ContentsDTO.java

@@ -1,5 +1,7 @@
 package top.imwork.window.silos.pojo.dto;
 
+import lombok.Data;
+
 import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
@@ -11,6 +13,7 @@ import java.util.Date;
  * email: e-jiangxiaowei@outlook.com
  * date: 2025-11-04 17:46:32
  */
+@Data
 public class ContentsDTO implements Serializable {
     @Serial
     private static final long serialVersionUID = 1L;
@@ -21,7 +24,7 @@ public class ContentsDTO implements Serializable {
     /**
      * 关联的图书信息ID
      */
-    private Long bookInfoId;
+    private String bookInfoId;
     /**
      * 父级内容ID
      */
@@ -107,187 +110,4 @@ public class ContentsDTO implements Serializable {
      */
     private String remark;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getBookInfoId() {
-        return bookInfoId;
-    }
-
-    public void setBookInfoId(Long bookInfoId) {
-        this.bookInfoId = bookInfoId;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-
-    public Integer getChapterLevel() {
-        return chapterLevel;
-    }
-
-    public void setChapterLevel(Integer chapterLevel) {
-        this.chapterLevel = chapterLevel;
-    }
-
-    public String getChapterNumber() {
-        return chapterNumber;
-    }
-
-    public void setChapterNumber(String chapterNumber) {
-        this.chapterNumber = chapterNumber;
-    }
-
-    public String getChapterTitle() {
-        return chapterTitle;
-    }
-
-    public void setChapterTitle(String chapterTitle) {
-        this.chapterTitle = chapterTitle;
-    }
-
-    public Long getPageNumber() {
-        return pageNumber;
-    }
-
-    public void setPageNumber(Long pageNumber) {
-        this.pageNumber = pageNumber;
-    }
-
-    public String getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getContentText() {
-        return contentText;
-    }
-
-    public void setContentText(String contentText) {
-        this.contentText = contentText;
-    }
-
-    public String getContentHtml() {
-        return contentHtml;
-    }
-
-    public void setContentHtml(String contentHtml) {
-        this.contentHtml = contentHtml;
-    }
-
-    public String getMediaUrl() {
-        return mediaUrl;
-    }
-
-    public void setMediaUrl(String mediaUrl) {
-        this.mediaUrl = mediaUrl;
-    }
-
-    public Integer getWordCount() {
-        return wordCount;
-    }
-
-    public void setWordCount(Integer wordCount) {
-        this.wordCount = wordCount;
-    }
-
-    public Integer getReadingTime() {
-        return readingTime;
-    }
-
-    public void setReadingTime(Integer readingTime) {
-        this.readingTime = readingTime;
-    }
-
-    public Long getSortOrder() {
-        return sortOrder;
-    }
-
-    public void setSortOrder(Long sortOrder) {
-        this.sortOrder = sortOrder;
-    }
-
-    public Integer getIsPublic() {
-        return isPublic;
-    }
-
-    public void setIsPublic(Integer isPublic) {
-        this.isPublic = isPublic;
-    }
-
-    public Integer getHasChildren() {
-        return hasChildren;
-    }
-
-    public void setHasChildren(Integer hasChildren) {
-        this.hasChildren = hasChildren;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
 }

+ 4 - 184
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/po/ContentsParamVO.java

@@ -1,5 +1,7 @@
 package top.imwork.window.silos.pojo.po;
 
+import lombok.Data;
+
 import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
@@ -11,6 +13,7 @@ import java.util.Date;
  * email: e-jiangxiaowei@outlook.com
  * date: 2025-11-04 17:46:32
  */
+@Data
 public class ContentsParamVO implements Serializable {
     @Serial
     private static final long serialVersionUID = 1L;
@@ -21,7 +24,7 @@ public class ContentsParamVO implements Serializable {
     /**
      * 关联的图书信息ID
      */
-    private Long bookInfoId;
+    private String bookInfoId;
     /**
      * 父级内容ID
      */
@@ -107,187 +110,4 @@ public class ContentsParamVO implements Serializable {
      */
     private String remark;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getBookInfoId() {
-        return bookInfoId;
-    }
-
-    public void setBookInfoId(Long bookInfoId) {
-        this.bookInfoId = bookInfoId;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-
-    public Integer getChapterLevel() {
-        return chapterLevel;
-    }
-
-    public void setChapterLevel(Integer chapterLevel) {
-        this.chapterLevel = chapterLevel;
-    }
-
-    public String getChapterNumber() {
-        return chapterNumber;
-    }
-
-    public void setChapterNumber(String chapterNumber) {
-        this.chapterNumber = chapterNumber;
-    }
-
-    public String getChapterTitle() {
-        return chapterTitle;
-    }
-
-    public void setChapterTitle(String chapterTitle) {
-        this.chapterTitle = chapterTitle;
-    }
-
-    public Long getPageNumber() {
-        return pageNumber;
-    }
-
-    public void setPageNumber(Long pageNumber) {
-        this.pageNumber = pageNumber;
-    }
-
-    public String getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getContentText() {
-        return contentText;
-    }
-
-    public void setContentText(String contentText) {
-        this.contentText = contentText;
-    }
-
-    public String getContentHtml() {
-        return contentHtml;
-    }
-
-    public void setContentHtml(String contentHtml) {
-        this.contentHtml = contentHtml;
-    }
-
-    public String getMediaUrl() {
-        return mediaUrl;
-    }
-
-    public void setMediaUrl(String mediaUrl) {
-        this.mediaUrl = mediaUrl;
-    }
-
-    public Integer getWordCount() {
-        return wordCount;
-    }
-
-    public void setWordCount(Integer wordCount) {
-        this.wordCount = wordCount;
-    }
-
-    public Integer getReadingTime() {
-        return readingTime;
-    }
-
-    public void setReadingTime(Integer readingTime) {
-        this.readingTime = readingTime;
-    }
-
-    public Long getSortOrder() {
-        return sortOrder;
-    }
-
-    public void setSortOrder(Long sortOrder) {
-        this.sortOrder = sortOrder;
-    }
-
-    public Integer getIsPublic() {
-        return isPublic;
-    }
-
-    public void setIsPublic(Integer isPublic) {
-        this.isPublic = isPublic;
-    }
-
-    public Integer getHasChildren() {
-        return hasChildren;
-    }
-
-    public void setHasChildren(Integer hasChildren) {
-        this.hasChildren = hasChildren;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
 }

+ 4 - 184
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/vo/ContentsVO.java

@@ -1,5 +1,7 @@
 package top.imwork.window.silos.pojo.vo;
 
+import lombok.Data;
+
 import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
@@ -12,6 +14,7 @@ import java.util.Date;
  * email: e-jiangxiaowei@outlook.com
  * date: 2025-11-04 17:46:32
  */
+@Data
 public class ContentsVO implements Serializable{
     @Serial
     private static final long serialVersionUID = 1L;
@@ -22,7 +25,7 @@ public class ContentsVO implements Serializable{
     /**
      * 关联的图书信息ID
      */
-    private Long bookInfoId;
+    private String bookInfoId;
     /**
      * 父级内容ID
      */
@@ -108,187 +111,4 @@ public class ContentsVO implements Serializable{
      */
     private String remark;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getBookInfoId() {
-        return bookInfoId;
-    }
-
-    public void setBookInfoId(Long bookInfoId) {
-        this.bookInfoId = bookInfoId;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-
-    public Integer getChapterLevel() {
-        return chapterLevel;
-    }
-
-    public void setChapterLevel(Integer chapterLevel) {
-        this.chapterLevel = chapterLevel;
-    }
-
-    public String getChapterNumber() {
-        return chapterNumber;
-    }
-
-    public void setChapterNumber(String chapterNumber) {
-        this.chapterNumber = chapterNumber;
-    }
-
-    public String getChapterTitle() {
-        return chapterTitle;
-    }
-
-    public void setChapterTitle(String chapterTitle) {
-        this.chapterTitle = chapterTitle;
-    }
-
-    public Long getPageNumber() {
-        return pageNumber;
-    }
-
-    public void setPageNumber(Long pageNumber) {
-        this.pageNumber = pageNumber;
-    }
-
-    public String getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getContentText() {
-        return contentText;
-    }
-
-    public void setContentText(String contentText) {
-        this.contentText = contentText;
-    }
-
-    public String getContentHtml() {
-        return contentHtml;
-    }
-
-    public void setContentHtml(String contentHtml) {
-        this.contentHtml = contentHtml;
-    }
-
-    public String getMediaUrl() {
-        return mediaUrl;
-    }
-
-    public void setMediaUrl(String mediaUrl) {
-        this.mediaUrl = mediaUrl;
-    }
-
-    public Integer getWordCount() {
-        return wordCount;
-    }
-
-    public void setWordCount(Integer wordCount) {
-        this.wordCount = wordCount;
-    }
-
-    public Integer getReadingTime() {
-        return readingTime;
-    }
-
-    public void setReadingTime(Integer readingTime) {
-        this.readingTime = readingTime;
-    }
-
-    public Long getSortOrder() {
-        return sortOrder;
-    }
-
-    public void setSortOrder(Long sortOrder) {
-        this.sortOrder = sortOrder;
-    }
-
-    public Integer getIsPublic() {
-        return isPublic;
-    }
-
-    public void setIsPublic(Integer isPublic) {
-        this.isPublic = isPublic;
-    }
-
-    public Integer getHasChildren() {
-        return hasChildren;
-    }
-
-    public void setHasChildren(Integer hasChildren) {
-        this.hasChildren = hasChildren;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
 }

+ 1 - 0
imwork-windows/imwork-silos/src/main/resources/static/business/cms/base/pagination.js

@@ -123,6 +123,7 @@ document.addEventListener('DOMContentLoaded', function () {
             const optionElement = document.createElement('div');
             optionElement.className = `option-item ${isSelected ? 'selected' : ''}`;
             optionElement.innerHTML = `
+                        <input type="hidden" id="bookInfoId" value="${option.id}">
                         <div>${option.name}</div>
                         <small style="color: #7f8c8d;">${option.category}</small>
                     `;

+ 15 - 14
imwork-windows/imwork-silos/src/main/resources/static/business/cms/book/contents/edit.js

@@ -30,7 +30,8 @@ layui.use(['form', 'layer'], function () {
             });
         }
     });
-// 更新字数统计
+
+    // 更新字数统计
     function updateWordCount() {
         const content = tinymce.activeEditor.getContent({format: 'text'});
         const wordCount = content.length;
@@ -41,17 +42,18 @@ layui.use(['form', 'layer'], function () {
     form.on("submit(save)", function (data) {
         //弹出loading
         const index = top.layer.msg('数据提交中,请稍候', {icon: 16, time: false, shade: 0.8});
-        const contentHtml= tinymce.get('contentText').getContent();
-        const contentText= tinymce.activeEditor.getContent({ format: 'text' });
+        const contentHtml = tinymce.get('contentText').getContent();
+        const contentText = tinymce.activeEditor.getContent({format: 'text'});
         //实际使用时的提交信息
-        $.ajax( {
-            url : "/cms/book/contents/save",
-            type : "POST",
-            dataType:"json",
-            contentType:'application/json;charset=UTF-8',
-            data:JSON.stringify({id:$("#id").val(),
-                bookInfoId:$("#bookInfoId").val(),
-                chapterLevel:$("#chapterLevel").val(),
+        $.ajax({
+            url: "/cms/book/contents/save",
+            type: "POST",
+            dataType: "json",
+            contentType: 'application/json;charset=UTF-8',
+            data: JSON.stringify({
+                id: $("#id").val(),
+                bookInfoId: $("#bookInfoId").val(),
+                chapterLevel: $("#chapterLevel").val(),
                 chapterNumber: $("#chapterNumber").val(),
                 chapterTitle: $("#chapterTitle").val(),
                 contentType: $("#contentType").val(),
@@ -62,15 +64,14 @@ layui.use(['form', 'layer'], function () {
                 contentText: contentText,
                 contentHtml: contentHtml,
             }),
-            success : function(res) {
-                console.log(res);
+            success: function (res) {
                 layer.close(index);
                 layer.msg(res.msg);
                 layer.closeAll("iframe");
                 //刷新父页面
                 parent.location.reload();
             },
-            error:function(e){
+            error: function (e) {
                 layer.close(index);
                 layer.msg("信息提交异常!");
                 layer.closeAll("iframe");

+ 77 - 0
imwork-windows/imwork-silos/src/main/resources/static/business/cms/book/info/edit.js

@@ -3,6 +3,35 @@ layui.use(['form', 'layer'], function () {
     layer = parent.layer === undefined ? layui.layer : top.layer,
         $ = layui.jquery;
 
+    // 配置常量
+    const CONFIG = {
+        table: {
+            elem: '#list',
+            url: '/cms/book/info/queryPage',
+            method: 'POST',
+            contentType: 'application/json;charset=utf-8',
+            page: true,
+            limits: [10, 15, 20, 25],
+            limit: 15,
+            id: "listTable",
+            request: {
+                pageName: "pageNo",
+                limitName: "pageRows"
+            },
+            response: {
+                statusName: 'code',
+                statusCode: 200,
+                msgName: 'msg',
+                countName: 'totalRows',
+                dataName: 'data'
+            }
+        },
+        grid: {
+            pageNo: 1,
+            pageRows: 100
+        }
+    };
+
     form.on("submit(save)", function (data) {
         //弹出loading
         const index = top.layer.msg('数据提交中,请稍候', {icon: 16, time: false, shade: 0.8});
@@ -51,4 +80,52 @@ layui.use(['form', 'layer'], function () {
         })
         return false;
     })
+
+    //初始化分类
+    function initCategory() {
+        var requestData = $.extend({}, CONFIG.grid);
+        $.ajax({
+            url: "/cms/book/categories/queryPage",
+            type: "POST",
+            dataType: "json",
+            contentType: 'application/json;charset=UTF-8',
+            data: JSON.stringify(requestData),
+            success: function (res) {
+                if (res.code === 200) {
+                    setCategory(res.data.dataList);
+                } else {
+                    showError("加载失败", res.msg);
+                }
+            },
+            error: function (xhr, status, error) {
+                console.error("请求失败:", error);
+                showError("请求失败", "网络错误或服务器异常");
+            }
+        });
+    }
+
+    function setCategory(categories){
+        if (!categories || categories.length === 0) {
+            return;
+        }
+        const staticData = [];
+        categories.forEach(category => {
+            staticData.push({value:category.categoryCode, text:category.categoryName}); // 使用id作为键,整个对象作为值
+        });
+        // 创建渲染器实例
+        var selectRenderer = new SelectRenderer({
+            placeholderText: '请选择',
+            valueField: 'id',
+            textField: 'name'
+        });
+        // 渲染单个select
+        selectRenderer.render('#categoryCode', staticData);
+    }
+    // 初始化
+    function init() {
+        initCategory();
+    }
+
+    // 启动初始化
+    init();
 })

+ 6 - 4
imwork-windows/imwork-silos/src/main/resources/templates/cms/book/contents/edit.html

@@ -38,7 +38,7 @@
 
                             <div class="dropdown-list">
                                 <div class="search-box">
-                                    <input type="text" id="bookInfoId" name="bookInfoId" class="search-input" placeholder="搜索选项...">
+                                    <input type="text" id="bookInfoValue" name="bookInfoId" class="search-input" placeholder="搜索选项...">
                                 </div>
 
                                 <div class="options-container">
@@ -74,9 +74,11 @@
                         <label for="chapterLevel" class="required">章节层级</label>
                         <select id="chapterLevel" name="chapterLevel" required>
                             <option value="">请选择层级</option>
-                            <option value="1">一级章节</option>
-                            <option value="2">二级章节</option>
-                            <option value="3">三级章节</option>
+                            <option value="0">丛级章节</option>
+                            <option value="1">部级章节</option>
+                            <option value="2">卷级章节</option>
+                            <option value="3">章级章节</option>
+                            <option value="4">节级章节</option>
                         </select>
                         <div class="error-message" id="levelError">请选择章节层级</div>
                     </div>

+ 1 - 0
imwork-windows/imwork-silos/src/main/resources/templates/cms/book/info/edit.html

@@ -231,6 +231,7 @@
 </div>
 <script src="../../../../static/assets/lib/jquery/jquery.js" th:src="@{/assets/lib/jquery/jquery.js}"></script>
 <script src="../../../../static/assets/lib/layui/layui.js" th:src="@{/assets/lib/layui/layui.js}"></script>
+<script src="../../../../static/assets/silos/js/SelectRenderer.js" th:src="@{/assets/silos/js/SelectRenderer.js}"></script>
 <script src="../../../../static/business/cms/book/info/edit.js" th:src="@{/business/cms/book/info/edit.js}"></script>
 </body>
 </html>