Browse Source

1.添加图书管理模块

1 1 month ago
parent
commit
e8528c86fa
16 changed files with 449 additions and 959 deletions
  1. 3 0
      imwork-commons/imwork-commons-core/src/main/java/top/imwork/commons/core/constants/Constants.java
  2. 6 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/convert/ContentsConvert.java
  3. 1 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/entity/Contents.java
  4. 1 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/bo/ContentsBO.java
  5. 1 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/dto/ContentsDTO.java
  6. 5 0
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/dto/ContentsListDTO.java
  7. 6 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/po/ContentsListParamVO.java
  8. 1 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/po/ContentsParamVO.java
  9. 1 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/vo/ContentsVO.java
  10. 21 1
      imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/service/impl/ContentsServiceImpl.java
  11. 1 0
      imwork-windows/imwork-silos/src/main/resources/database/说明.txt
  12. 2 2
      imwork-windows/imwork-silos/src/main/resources/mapper/cms/books/ContentsDao.xml
  13. 39 36
      imwork-windows/imwork-silos/src/main/resources/static/business/cms/books/contents/edit.js
  14. 192 291
      imwork-windows/imwork-silos/src/main/resources/static/business/cms/books/contents/list.css
  15. 103 532
      imwork-windows/imwork-silos/src/main/resources/static/business/cms/books/contents/list.js
  16. 66 90
      imwork-windows/imwork-silos/src/main/resources/templates/cms/books/contents/list.html

+ 3 - 0
imwork-commons/imwork-commons-core/src/main/java/top/imwork/commons/core/constants/Constants.java

@@ -36,4 +36,7 @@ public class Constants {
 
     public static final String ERROR = "error:";
 
+    public static final String DEL_FLAG_N = "N";
+    public static final String DEL_FLAG_Y = "Y";
+
 }

+ 6 - 1
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/convert/ContentsConvert.java

@@ -162,10 +162,15 @@ public class ContentsConvert {
 
     public static ContentsListDTO contentsListParamVoToDTO(ContentsListParamVO contentsListParamVO) {
         if (contentsListParamVO == null) {
-            return new ContentsListDTO();
+            return null;
         }
         ContentsListDTO contentsListDTO = new ContentsListDTO();
         contentsListDTO.setContentsName(contentsListParamVO.getContentsName());
+        contentsListDTO.setBookInfoId(contentsListParamVO.getBookInfoId());
+        contentsListDTO.setContentType(contentsListParamVO.getContentType());
+        contentsListDTO.setIsPublic(contentsListParamVO.getIsPublic());
+        contentsListDTO.setVersion(contentsListParamVO.getVersion());
+        contentsListDTO.setCreateBeginTime(contentsListParamVO.getCreateBeginTime());
         contentsListDTO.setPageNo(contentsListParamVO.getPageNo());
         contentsListDTO.setPageRows(contentsListParamVO.getPageRows());
         contentsListDTO.setDelFlag(contentsListParamVO.getDelFlag());

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

@@ -88,7 +88,7 @@ public class Contents implements Serializable {
     /**
      * 内容版本
      */
-    private Integer version;
+    private String version;
     /**
      * 是否删除默认N.未删除,Y已删除
      */

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

@@ -84,7 +84,7 @@ public class ContentsBO implements Serializable {
     /**
      * 内容版本
      */
-    private Integer version;
+    private String version;
     /**
      * 是否删除默认N.未删除,Y已删除
      */

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

@@ -84,7 +84,7 @@ public class ContentsDTO implements Serializable {
     /**
      * 内容版本
      */
-    private Integer version;
+    private String version;
     /**
      * 是否删除默认N.未删除,Y已删除
      */

+ 5 - 0
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/dto/ContentsListDTO.java

@@ -15,4 +15,9 @@ import top.imwork.commons.core.pojo.BaseParams;
 @Data
 public class ContentsListDTO extends BaseParams {
     private String contentsName;
+    private String bookInfoId;
+    private String contentType;
+    private String isPublic;
+    private String version;
+    private String createBeginTime;
 }

+ 6 - 1
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/pojo/po/ContentsListParamVO.java

@@ -14,5 +14,10 @@ import top.imwork.commons.core.pojo.BaseParams;
 @EqualsAndHashCode(callSuper = true)
 @Data
 public class ContentsListParamVO extends BaseParams {
-    private String ContentsName;
+    private String contentsName;
+    private String bookInfoId;
+    private String contentType;
+    private String isPublic;
+    private String version;
+    private String createBeginTime;
 }

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

@@ -84,7 +84,7 @@ public class ContentsParamVO implements Serializable {
     /**
      * 内容版本
      */
-    private Integer version;
+    private String version;
     /**
      * 是否删除默认N.未删除,Y已删除
      */

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

@@ -85,7 +85,7 @@ public class ContentsVO implements Serializable{
     /**
      * 内容版本
      */
-    private Integer version;
+    private String version;
     /**
      * 是否删除默认N.未删除,Y已删除
      */

+ 21 - 1
imwork-windows/imwork-silos/src/main/java/top/imwork/window/silos/service/impl/ContentsServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import top.imwork.commons.core.constants.Constants;
 import top.imwork.commons.core.utils.StringUtils;
 import top.imwork.window.silos.dao.ContentsDao;
 import top.imwork.window.silos.entity.Contents;
@@ -19,6 +20,8 @@ import top.imwork.window.silos.pojo.dto.ContentsListDTO;
 import top.imwork.window.silos.service.IContentsService;
 import top.imwork.window.silos.convert.ContentsConvert;
 
+import java.util.Date;
+
 @Service("contentsService")
 public class ContentsServiceImpl extends ServiceImpl<ContentsDao,Contents> implements IContentsService {
     @Resource
@@ -44,8 +47,11 @@ public class ContentsServiceImpl extends ServiceImpl<ContentsDao,Contents> imple
     public ContentsBO save(ContentsDTO contentsDTO) {
         Contents contents = ContentsConvert.contentsDtoToDo(contentsDTO);
         if (ObjectUtils.isEmpty(contents.getId())) {
+            contents.setDelFlag(Constants.DEL_FLAG_N);
+            contents.setCreateTime(new Date());
             contentsDao.insert(contents);
         } else {
+            contents.setUpdateTime(new Date());
             contentsDao.updateById(contents);
         }
         return ContentsConvert.contentsDoToBo(contents);
@@ -71,7 +77,21 @@ public class ContentsServiceImpl extends ServiceImpl<ContentsDao,Contents> imple
         QueryWrapper<Contents> queryWrapper = new QueryWrapper<>();
 
         if (!StringUtils.isEmpty(contentsListDTO.getContentsName())) {
-            queryWrapper.like("contents_name", contentsListDTO.getContentsName());
+            queryWrapper.like("chapter_title", contentsListDTO.getContentsName()).or()
+                    .like("book_info_id", contentsListDTO.getContentsName()).or()
+                    .like("chapter_number", contentsListDTO.getContentsName());
+        }
+        if (!StringUtils.isEmpty(contentsListDTO.getContentType())) {
+            queryWrapper.like("content_type", contentsListDTO.getContentType());
+        }
+        if (!StringUtils.isEmpty(contentsListDTO.getVersion())) {
+            queryWrapper.like("version", contentsListDTO.getVersion());
+        }
+        if (!StringUtils.isEmpty(contentsListDTO.getIsPublic())) {
+            queryWrapper.like("is_public", contentsListDTO.getIsPublic());
+        }
+        if (!StringUtils.isEmpty(contentsListDTO.getBookInfoId())) {
+            queryWrapper.like("book_info_id", contentsListDTO.getBookInfoId());
         }
 
         if (!StringUtils.isEmpty(contentsListDTO.getCreateBeginTime())) {

+ 1 - 0
imwork-windows/imwork-silos/src/main/resources/database/说明.txt

@@ -0,0 +1 @@
+存储上传文件

+ 2 - 2
imwork-windows/imwork-silos/src/main/resources/mapper/cms/books/ContentsDao.xml

@@ -11,8 +11,8 @@
             <result property="chapterTitle" column="chapter_title"/>
             <result property="pageNumber" column="page_number"/>
             <result property="contentType" column="content_type"/>
-            <result property="contentText" column="content_text"/>
-            <result property="contentHtml" column="content_html"/>
+            <result property="contentText" column="content_text" jdbcType="LONGVARCHAR"/>
+            <result property="contentHtml" column="content_html" jdbcType="LONGVARCHAR"/>
             <result property="mediaUrl" column="media_url"/>
             <result property="wordCount" column="word_count"/>
             <result property="readingTime" column="reading_time"/>

+ 39 - 36
imwork-windows/imwork-silos/src/main/resources/static/business/cms/books/contents/edit.js

@@ -1,46 +1,48 @@
-// 初始化TinyMCE
-tinymce.init({
-    selector: '#contentText',
-    license_key: 'gpl',
-    height: 400,
-    menubar: 'file edit view insert format tools table help',
-    plugins: [
-        'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
-        'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
-        'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
-    ],
-    toolbar: 'undo redo | blocks | bold italic underline | ' +
-        'alignleft aligncenter alignright alignjustify | ' +
-        'bullist numlist outdent indent | link image | ' +
-        'removeformat | code | help',
-    content_style: 'body { font-family: "Microsoft YaHei", sans-serif; font-size: 14px }',
-    language: 'zh_CN',
-    // 字数统计回调
-    setup: function (editor) {
-        editor.on('keyup', function () {
-            updateWordCount();
-        });
-        editor.on('change', function () {
-            updateWordCount();
-        });
-    }
-});
-// 更新字数统计
-function updateWordCount() {
-    const content = tinymce.activeEditor.getContent({format: 'text'});
-    const wordCount = content.length;
-    document.getElementById('wordCount').value = wordCount;
-    document.getElementById('wordCountDisplay').textContent = `${wordCount} 字`;
-}
-
 layui.use(['form', 'layer'], function () {
     var form = layui.form
     layer = parent.layer === undefined ? layui.layer : top.layer,
         $ = layui.jquery;
 
+    // 初始化TinyMCE
+    tinymce.init({
+        selector: '#contentText',
+        license_key: 'gpl',
+        height: 400,
+        menubar: 'file edit view insert format tools table help',
+        plugins: [
+            'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
+            'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
+            'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
+        ],
+        toolbar: 'undo redo | blocks | bold italic underline | ' +
+            'alignleft aligncenter alignright alignjustify | ' +
+            'bullist numlist outdent indent | link image | ' +
+            'removeformat | code | help',
+        content_style: 'body { font-family: "Microsoft YaHei", sans-serif; font-size: 14px }',
+        language: 'zh_CN',
+        // 字数统计回调
+        setup: function (editor) {
+            editor.on('keyup', function () {
+                updateWordCount();
+            });
+            editor.on('change', function () {
+                updateWordCount();
+            });
+        }
+    });
+// 更新字数统计
+    function updateWordCount() {
+        const content = tinymce.activeEditor.getContent({format: 'text'});
+        const wordCount = content.length;
+        document.getElementById('wordCount').value = wordCount;
+        document.getElementById('wordCountDisplay').textContent = `${wordCount} 字`;
+    }
+
     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' });
         //实际使用时的提交信息
         $.ajax( {
             url : "/silos/cms/books/contents/save",
@@ -57,7 +59,8 @@ layui.use(['form', 'layer'], function () {
                 isPublic: $("#isPublic").val(),
                 version: $("#version").val(),
                 parentId: $("#parentId").val(),
-                contentText: $("#contentText").val(),
+                contentText: contentText,
+                contentHtml: contentHtml,
             }),
             success : function(res) {
                 console.log(res);

+ 192 - 291
imwork-windows/imwork-silos/src/main/resources/static/business/cms/books/contents/list.css

@@ -48,38 +48,29 @@ header {
     box-shadow: var(--shadow);
 }
 
-.book-info {
+.logo {
     display: flex;
     align-items: center;
-    gap: 20px;
+    gap: 15px;
 }
 
-.book-cover {
-    width: 80px;
-    height: 100px;
-    background: linear-gradient(135deg, #4f46e5, #7c3aed);
-    border-radius: 8px;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    color: white;
-    font-weight: bold;
-    font-size: 1.2rem;
-    box-shadow: var(--shadow);
+.logo-icon {
+    font-size: 2.2rem;
+    color: var(--primary-color);
 }
 
-.book-details h1 {
-    font-size: 1.6rem;
+.logo-text h1 {
+    font-size: 1.8rem;
     color: var(--text-primary);
     margin-bottom: 5px;
 }
 
-.book-details p {
+.logo-text p {
     color: var(--text-secondary);
-    font-size: 1rem;
+    font-size: 0.9rem;
 }
 
-.header-actions {
+.user-actions {
     display: flex;
     gap: 15px;
 }
@@ -116,260 +107,148 @@ header {
     background-color: var(--secondary-hover);
 }
 
-.content {
-    display: grid;
-    grid-template-columns: 1fr 400px;
-    gap: 25px;
+.btn-sm {
+    padding: 6px 12px;
+    font-size: 0.85rem;
 }
 
-.chapters-section {
-    background: var(--bg-white);
+.search-section {
+    background-color: var(--bg-white);
+    padding: 25px;
     border-radius: var(--radius-lg);
     box-shadow: var(--shadow);
-    overflow: hidden;
+    margin-bottom: 30px;
 }
 
-.section-header {
-    padding: 20px 25px;
-    border-bottom: 1px solid var(--secondary-color);
+.search-bar {
     display: flex;
-    justify-content: space-between;
-    align-items: center;
-}
-
-.section-title {
-    font-size: 1.3rem;
-    font-weight: 700;
-    color: var(--text-primary);
-}
-
-.chapters-count {
-    color: var(--text-secondary);
-    font-size: 0.9rem;
+    gap: 15px;
+    margin-bottom: 20px;
 }
 
-.chapters-list {
-    padding: 0;
-    max-height: 600px;
-    overflow-y: auto;
+.search-input {
+    flex: 1;
+    position: relative;
 }
 
-.chapter-item {
-    display: flex;
-    align-items: center;
-    padding: 18px 25px;
-    border-bottom: 1px solid var(--secondary-color);
+.search-input input {
+    width: 100%;
+    padding: 14px 20px 14px 45px;
+    border: 1px solid var(--border-color);
+    border-radius: var(--radius);
+    font-size: 1rem;
     transition: all 0.3s;
-    cursor: pointer;
 }
 
-.chapter-item:hover {
-    background-color: var(--bg-light);
-}
-
-.chapter-item.active {
-    background-color: #e0e7ff;
-    border-left: 4px solid var(--primary-color);
+.search-input input:focus {
+    outline: none;
+    border-color: var(--primary-color);
+    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
 }
 
-.chapter-drag {
+.search-icon {
+    position: absolute;
+    left: 15px;
+    top: 50%;
+    transform: translateY(-50%);
     color: var(--text-light);
-    margin-right: 15px;
-    cursor: grab;
 }
 
-.chapter-drag:active {
-    cursor: grabbing;
+.filters {
+    display: grid;
+    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+    gap: 15px;
 }
 
-.chapter-number {
-    width: 32px;
-    height: 32px;
-    border-radius: 50%;
-    background-color: var(--secondary-color);
+.filter-group {
     display: flex;
-    align-items: center;
-    justify-content: center;
+    flex-direction: column;
+    gap: 8px;
+}
+
+.filter-group label {
+    font-size: 0.9rem;
     font-weight: 600;
     color: var(--text-secondary);
-    margin-right: 15px;
-    flex-shrink: 0;
 }
 
-.chapter-content {
-    flex: 1;
+.filter-group select, .filter-group input {
+    padding: 10px 15px;
+    border: 1px solid var(--border-color);
+    border-radius: var(--radius);
+    background-color: var(--bg-white);
 }
 
-.chapter-title {
-    font-weight: 600;
-    color: var(--text-primary);
-    margin-bottom: 5px;
+.chapters-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
 }
 
-.chapter-meta {
-    display: flex;
-    gap: 15px;
-    font-size: 0.85rem;
+.chapters-count {
+    font-size: 1.1rem;
     color: var(--text-secondary);
 }
 
-.chapter-actions {
+.view-options {
     display: flex;
     gap: 10px;
-    opacity: 0;
-    transition: opacity 0.3s;
 }
 
-.chapter-item:hover .chapter-actions {
-    opacity: 1;
-}
-
-.action-btn {
-    width: 32px;
-    height: 32px;
+.view-btn {
+    padding: 8px 12px;
     border-radius: 6px;
-    display: flex;
-    align-items: center;
-    justify-content: center;
+    background-color: var(--secondary-color);
+    color: var(--text-secondary);
     cursor: pointer;
     transition: all 0.3s;
-    background-color: var(--bg-light);
-    color: var(--text-light);
-    border: none;
-}
-
-.action-btn:hover {
-    background-color: var(--secondary-color);
-}
-
-.edit-btn:hover {
-    color: var(--primary-color);
 }
 
-.delete-btn:hover {
-    color: var(--danger-color);
+.view-btn.active {
+    background-color: var(--primary-color);
+    color: white;
 }
 
-.sub-chapters {
-    margin-left: 60px;
-    border-left: 2px solid var(--border-color);
+/* 表格视图样式 */
+.chapters-table {
+    width: 100%;
+    background-color: var(--bg-white);
+    border-radius: var(--radius-lg);
+    box-shadow: var(--shadow);
+    overflow: hidden;
 }
 
-.sub-chapter-item {
-    display: flex;
-    align-items: center;
+.table-header {
+    display: grid;
+    grid-template-columns: 80px 120px 1fr 120px 100px 100px 120px 120px 120px 120px 120px;
+    gap: 15px;
     padding: 15px 20px;
-    border-bottom: 1px solid var(--secondary-color);
-    transition: all 0.3s;
-    cursor: pointer;
-}
-
-.sub-chapter-item:hover {
     background-color: var(--bg-light);
-}
-
-.sub-chapter-item.active {
-    background-color: #e0e7ff;
-}
-
-.sub-chapter-number {
-    width: 24px;
-    height: 24px;
-    border-radius: 50%;
-    background-color: var(--secondary-color);
-    display: flex;
-    align-items: center;
-    justify-content: center;
     font-weight: 600;
     color: var(--text-secondary);
-    margin-right: 15px;
-    flex-shrink: 0;
-    font-size: 0.8rem;
-}
-
-.sub-chapter-content {
-    flex: 1;
-}
-
-.sub-chapter-title {
-    font-weight: 500;
-    color: var(--text-primary);
-    margin-bottom: 3px;
-    font-size: 0.95rem;
+    border-bottom: 1px solid var(--border-color);
 }
 
-.sub-chapter-meta {
-    display: flex;
+.table-row {
+    display: grid;
+    grid-template-columns: 80px 120px 1fr 120px 100px 100px 120px 120px 120px 120px 120px;
     gap: 15px;
-    font-size: 0.8rem;
-    color: var(--text-secondary);
-}
-
-.empty-state {
-    text-align: center;
-    padding: 60px 20px;
-    color: var(--text-secondary);
-}
-
-.empty-state i {
-    font-size: 3rem;
-    margin-bottom: 20px;
-    color: #cbd5e1;
-}
-
-.empty-state h3 {
-    font-size: 1.3rem;
-    margin-bottom: 10px;
-    color: var(--text-secondary);
-}
-
-.chapter-detail {
-    background: var(--bg-white);
-    border-radius: var(--radius-lg);
-    box-shadow: var(--shadow);
-    padding: 25px;
-    height: fit-content;
-    position: sticky;
-    top: 20px;
-}
-
-.detail-header {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 20px;
-    padding-bottom: 15px;
+    padding: 15px 20px;
     border-bottom: 1px solid var(--secondary-color);
+    transition: all 0.3s;
 }
 
-.detail-title {
-    font-size: 1.2rem;
-    font-weight: 700;
-    color: var(--text-primary);
-}
-
-.detail-content {
-    margin-bottom: 25px;
-}
-
-.detail-item {
-    margin-bottom: 15px;
-}
-
-.detail-label {
-    font-weight: 600;
-    color: var(--text-secondary);
-    margin-bottom: 5px;
-    font-size: 0.9rem;
-}
-
-.detail-value {
-    color: var(--text-primary);
+.table-row:hover {
+    background-color: var(--bg-light);
 }
 
-.detail-actions {
+.table-cell {
     display: flex;
-    gap: 10px;
+    align-items: center;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
 }
 
 .status-badge {
@@ -428,94 +307,119 @@ header {
     font-size: 0.9rem;
 }
 
-.modal {
-    display: none;
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background-color: rgba(0, 0, 0, 0.5);
-    z-index: 1000;
+.chapter-actions {
+    display: flex;
+    gap: 8px;
+}
+
+.action-btn {
+    width: 32px;
+    height: 32px;
+    border-radius: 6px;
+    display: flex;
     align-items: center;
     justify-content: center;
-    padding: 20px;
+    cursor: pointer;
+    transition: all 0.3s;
+    background-color: var(--bg-light);
+    color: var(--text-light);
+    border: none;
 }
 
-.modal-content {
-    background-color: var(--bg-white);
-    border-radius: var(--radius-lg);
-    width: 100%;
-    max-width: 600px;
-    max-height: 90vh;
-    overflow-y: auto;
-    padding: 30px;
-    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
+.action-btn:hover {
+    background-color: var(--secondary-color);
 }
 
-.modal-header {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    margin-bottom: 20px;
+.edit-btn:hover {
+    color: var(--primary-color);
 }
 
-.modal-title {
-    font-size: 1.3rem;
-    font-weight: 700;
-    color: var(--text-primary);
+.delete-btn:hover {
+    color: var(--danger-color);
 }
 
-.close-btn {
-    background: none;
-    border: none;
-    font-size: 1.5rem;
-    cursor: pointer;
+.empty-state {
+    grid-column: 1 / -1;
+    text-align: center;
+    padding: 60px 20px;
     color: var(--text-secondary);
 }
 
-.form-group {
+.empty-state i {
+    font-size: 3rem;
     margin-bottom: 20px;
+    color: #cbd5e1;
 }
 
-.form-group label {
-    display: block;
-    margin-bottom: 8px;
-    font-weight: 600;
+.empty-state h3 {
+    font-size: 1.5rem;
+    margin-bottom: 10px;
     color: var(--text-secondary);
 }
 
-.form-group input, .form-group textarea, .form-group select {
-    width: 100%;
-    padding: 12px 15px;
-    border: 1px solid var(--border-color);
+.pagination {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    gap: 10px;
+    margin-top: 30px;
+}
+
+.pagination-btn {
+    padding: 8px 12px;
     border-radius: var(--radius);
-    font-size: 1rem;
+    background-color: var(--bg-white);
+    color: var(--text-secondary);
+    cursor: pointer;
     transition: all 0.3s;
+    border: 1px solid var(--border-color);
 }
 
-.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
-    outline: none;
-    border-color: var(--primary-color);
-    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
+.pagination-btn:hover {
+    background-color: var(--secondary-color);
 }
 
-.modal-actions {
-    display: flex;
-    gap: 15px;
-    margin-top: 25px;
-    justify-content: flex-end;
+.pagination-btn.active {
+    background-color: var(--primary-color);
+    color: white;
+    border-color: var(--primary-color);
 }
 
 /* 响应式设计 */
-@media (max-width: 968px) {
-    .content {
-        grid-template-columns: 1fr;
+@media (max-width: 1400px) {
+    .table-header, .table-row {
+        grid-template-columns: 80px 120px 1fr 120px 100px 100px 120px 120px 120px;
+    }
+
+    .table-header .hide-on-large,
+    .table-row .hide-on-large {
+        display: none;
+    }
+}
+
+@media (max-width: 1200px) {
+    .table-header, .table-row {
+        grid-template-columns: 80px 120px 1fr 120px 100px 120px 120px 120px;
     }
 
-    .chapter-detail {
-        order: -1;
-        position: static;
+    .table-header .hide-on-medium,
+    .table-row .hide-on-medium {
+        display: none;
+    }
+}
+
+@media (max-width: 992px) {
+    .table-header, .table-row {
+        grid-template-columns: 80px 1fr 120px 100px 120px 120px;
+    }
+
+    .table-header .hide-on-small,
+    .table-row .hide-on-small {
+        display: none;
+    }
+
+    .search-bar {
+        flex-direction: column;
     }
 }
 
@@ -526,39 +430,36 @@ header {
         gap: 20px;
     }
 
-    .header-actions {
-        width: 100%;
-        justify-content: space-between;
-    }
-
-    .chapter-item {
-        padding: 15px;
+    .table-header, .table-row {
+        grid-template-columns: 1fr 1fr 1fr;
+        gap: 10px;
     }
 
-    .chapter-meta {
-        flex-direction: column;
-        gap: 5px;
+    .table-header .hide-on-mobile,
+    .table-row .hide-on-mobile {
+        display: none;
     }
 
-    .sub-chapters {
-        margin-left: 40px;
+    .user-actions {
+        width: 100%;
+        justify-content: space-between;
     }
 }
 
-@media (max-width: 480px) {
+@media (max-width: 576px) {
     .container {
         padding: 10px;
     }
 
-    .chapter-item {
-        padding: 12px 15px;
+    .table-header, .table-row {
+        grid-template-columns: 1fr 1fr;
     }
 
-    .sub-chapters {
-        margin-left: 30px;
+    .view-options {
+        flex-direction: column;
     }
 
-    .modal-content {
-        padding: 20px;
+    .filters {
+        grid-template-columns: 1fr;
     }
 }

+ 103 - 532
imwork-windows/imwork-silos/src/main/resources/static/business/cms/books/contents/list.js

@@ -7,6 +7,108 @@ layui.config({
         laytpl = layui.laytpl,
         table = layui.table,
         treeTable = layui.treeTable;
+    //用户列表
+    var tableIns = table.render({
+        elem: '#list',
+        url: '/silos/cms/books/contents/queryPage',
+        method: 'POST',
+        dataType: 'json',
+        contentType: 'application/json;charset=utf-8',
+        headers: {token: ''},
+        cellMinWidth: 95,
+        page: true,
+        height: "full-125",
+        limits: [10, 15, 20, 25],
+        limit: 15,
+        id: "listTable",
+        request: {
+            pageName: "pageNo",//重新定义当前页码参数名称
+            limitName: "pageRows"//重新定义每页大小参数名称
+        },
+        response: {
+            statusName: 'code', //数据状态的字段名称,默认:code
+            statusCode: 200, //成功的状态码,默认:0
+            msgName: 'msg',  //状态信息的字段名称,默认:msg
+            countName: 'totalRows',  //数据总数的字段名称,默认:count
+            dataName: 'data' //数据列表的字段名称,默认:data
+        },
+        where: {
+            //请求的参数写在where
+        },
+        parseData: function (res) {
+            return {
+                "code": res.code,
+                "msg": res.msg, //解析提示文本
+                "totalRows": res.data.totalRows, //解析数据长度
+                "data": res.data.dataList, //解析数据列表
+            };
+        },
+        cols: [[
+            {type: "checkbox", fixed: "left", width: 50},
+            {field: 'bookInfoId', title: '关联图书', minWidth: 100, align: "center"},
+            {field: 'chapterLevel', title: '章节层级', minWidth: 100, align: "center"},
+            {field: 'chapterNumber', title: '章节编号', minWidth: 100, align: "center"},
+            {field: 'chapterTitle', title: '章节标题', minWidth: 100, align: "center"},
+            {field: 'contentType', title: '内容类型', minWidth: 100, align: "center"},
+            {field: 'wordCount', title: '字数统计', align: 'center'},
+
+            {field: 'isPublic', title: '是否公开', minWidth: 100, align: "center"},
+            /*{field: 'userAvatar', title: '用户头像', minWidth:100, align:"center",templet:function(d){
+                    return "<img src='"+d.userAvatar+"' style='width: 30px;height: 30px'>";
+            }},*/
+            {field: 'version', title: '内容版本', minWidth: 100, align: "center"},
+            {field: 'parentId', title: '父级章节', minWidth: 100, align: "center"},
+            {field: 'coverImage', title: '封面图片路径', minWidth: 100, align: "center"},
+            {
+                field: 'createTime', title: '创建时间', minWidth: 100, align: "center", templet: function (d) {
+                    return showTime(d.createTime);
+                }
+            },
+            {
+                field: 'updateTime', title: '修改时间', minWidth: 100, align: "center", templet: function (d) {
+                    return showTime(d.updateTime);
+                }
+            },
+            {title: '操作', minWidth: 200, templet: '#listBar', fixed: "right", align: "center", toolBar: '#listBar'}
+        ]]
+    });
+    //时间转换函数
+    function showTime(tempDate) {
+        var d = new Date(tempDate);
+        var year = d.getFullYear();
+        var month = d.getMonth();
+        month++;
+        var day = d.getDate();
+        var hours = d.getHours();
+
+        var minutes = d.getMinutes();
+        var seconds = d.getSeconds();
+        month = month < 10 ? "0" + month : month;
+        day = day < 10 ? "0" + day : day;
+        hours = hours < 10 ? "0" + hours : hours;
+        minutes = minutes < 10 ? "0" + minutes : minutes;
+        seconds = seconds < 10 ? "0" + seconds : seconds;
+
+
+        var time = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
+        return time;
+    }
+    $(".search_btn").click(function () {
+        const searchInput = $("#searchInput").val();
+        table.reload("listTable", {
+            page: {
+                curr: 1 //重新从第 1 页开始
+            },
+            where: {
+                contentsName: searchInput,
+                contentType: $("#contentType").val(),
+                isPublic: $("#isPublic").val(),
+                version: $("#version").val(),
+                createBeginTime: $("#createTime").val(),
+                bookInfoId: $("#bookInfoId").val(),
+            }
+        })
+    })
     $(".add_btn").click(function () {
         edit();
     })
@@ -53,535 +155,4 @@ layui.config({
             layui.layer.full(window.sessionStorage.getItem("index"));
         })
     }
-})
-// 示例章节数据
-const chapters = [
-    {
-        id: 1,
-        number: "1",
-        title: "HTML基础",
-        description: "学习HTML标签和文档结构",
-        parentId: null,
-        contentType: "mixed",
-        wordCount: 5200,
-        isPublic: true,
-        version: "v1.2",
-        subChapters: [
-            {
-                id: 101,
-                number: "1.1",
-                title: "HTML文档结构",
-                description: "HTML文档的基本结构",
-                parentId: 1,
-                contentType: "text",
-                wordCount: 1200,
-                isPublic: true,
-                version: "v1.0"
-            },
-            {
-                id: 102,
-                number: "1.2",
-                title: "常用HTML标签",
-                description: "常用HTML标签的使用方法",
-                parentId: 1,
-                contentType: "mixed",
-                wordCount: 2500,
-                isPublic: true,
-                version: "v1.1"
-            },
-            {
-                id: 103,
-                number: "1.3",
-                title: "表单元素",
-                description: "HTML表单元素的使用",
-                parentId: 1,
-                contentType: "code",
-                wordCount: 1500,
-                isPublic: false,
-                version: "v1.0"
-            }
-        ]
-    },
-    {
-        id: 2,
-        number: "2",
-        title: "CSS样式",
-        description: "掌握CSS选择器和样式规则",
-        parentId: null,
-        contentType: "mixed",
-        wordCount: 6800,
-        isPublic: true,
-        version: "v1.3",
-        subChapters: [
-            {
-                id: 201,
-                number: "2.1",
-                title: "CSS选择器",
-                description: "CSS选择器的使用方法",
-                parentId: 2,
-                contentType: "text",
-                wordCount: 1800,
-                isPublic: true,
-                version: "v1.0"
-            },
-            {
-                id: 202,
-                number: "2.2",
-                title: "盒模型",
-                description: "CSS盒模型的理解和应用",
-                parentId: 2,
-                contentType: "mixed",
-                wordCount: 2200,
-                isPublic: true,
-                version: "v1.1"
-            },
-            {
-                id: 203,
-                number: "2.3",
-                title: "Flexbox布局",
-                description: "Flexbox布局的详细讲解",
-                parentId: 2,
-                contentType: "code",
-                wordCount: 2800,
-                isPublic: true,
-                version: "v1.2"
-            }
-        ]
-    },
-    {
-        id: 3,
-        number: "3",
-        title: "JavaScript编程",
-        description: "学习JavaScript基础语法和DOM操作",
-        parentId: null,
-        contentType: "code",
-        wordCount: 7500,
-        isPublic: true,
-        version: "v1.0",
-        subChapters: []
-    },
-    {
-        id: 4,
-        number: "4",
-        title: "响应式设计",
-        description: "创建适应不同设备的网页",
-        parentId: null,
-        contentType: "mixed",
-        wordCount: 4200,
-        isPublic: false,
-        version: "v0.8",
-        subChapters: [
-            {
-                id: 401,
-                number: "4.1",
-                title: "媒体查询",
-                description: "CSS媒体查询的使用",
-                parentId: 4,
-                contentType: "code",
-                wordCount: 1500,
-                isPublic: true,
-                version: "v1.0"
-            },
-            {
-                id: 402,
-                number: "4.2",
-                title: "移动优先设计",
-                description: "移动优先的设计理念",
-                parentId: 4,
-                contentType: "text",
-                wordCount: 2700,
-                isPublic: false,
-                version: "v0.5"
-            }
-        ]
-    }
-];
-
-let selectedChapterId = null;
-let editingChapterId = null;
-
-// 内容类型映射
-const contentTypeMap = {
-    "text": { text: "纯文本", class: "type-text" },
-    "code": { text: "代码示例", class: "type-code" },
-    "mixed": { text: "混合内容", class: "type-mixed" }
-};
-
-// 生成章节列表
-function renderChapters() {
-    const chaptersList = document.getElementById('chaptersList');
-
-    if (chapters.length === 0) {
-        chaptersList.innerHTML = `
-                    <div class="empty-state">
-                        <i class="fas fa-book-open"></i>
-                        <h3>暂无章节</h3>
-                        <p>点击"添加章节"按钮开始创建章节</p>
-                    </div>
-                `;
-        return;
-    }
-
-    let chaptersHTML = '';
-
-    chapters.forEach(chapter => {
-        const isActive = selectedChapterId === chapter.id;
-
-        chaptersHTML += `
-                    <div class="chapter-item ${isActive ? 'active' : ''}" data-id="${chapter.id}">
-                        <div class="chapter-drag">
-                            <i class="fas fa-grip-vertical"></i>
-                        </div>
-                        <div class="chapter-number">${chapter.number}</div>
-                        <div class="chapter-content">
-                            <div class="chapter-title">${chapter.title}</div>
-                            <div class="chapter-meta">
-                                <span class="content-type-badge ${contentTypeMap[chapter.contentType].class}">
-                                    ${contentTypeMap[chapter.contentType].text}
-                                </span>
-                                <span class="word-count">
-                                    <i class="fas fa-file-word"></i> ${chapter.wordCount}字
-                                </span>
-                                <span class="status-badge ${chapter.isPublic ? 'status-public' : 'status-private'}">
-                                    ${chapter.isPublic ? '公开' : '不公开'}
-                                </span>
-                                <span class="version-badge">${chapter.version}</span>
-                            </div>
-                        </div>
-                        <div class="chapter-actions">
-                            <button class="action-btn edit-btn" data-id="${chapter.id}">
-                                <i class="fas fa-edit"></i>
-                            </button>
-                            <button class="action-btn delete-btn" data-id="${chapter.id}">
-                                <i class="fas fa-trash"></i>
-                            </button>
-                        </div>
-                    </div>
-                `;
-
-        // 添加子章节
-        if (chapter.subChapters && chapter.subChapters.length > 0) {
-            chaptersHTML += `<div class="sub-chapters">`;
-
-            chapter.subChapters.forEach(subChapter => {
-                const isSubActive = selectedChapterId === subChapter.id;
-
-                chaptersHTML += `
-                            <div class="sub-chapter-item ${isSubActive ? 'active' : ''}" data-id="${subChapter.id}">
-                                <div class="chapter-drag">
-                                    <i class="fas fa-grip-vertical"></i>
-                                </div>
-                                <div class="sub-chapter-number">${subChapter.number}</div>
-                                <div class="sub-chapter-content">
-                                    <div class="sub-chapter-title">${subChapter.title}</div>
-                                    <div class="sub-chapter-meta">
-                                        <span class="content-type-badge ${contentTypeMap[subChapter.contentType].class}">
-                                            ${contentTypeMap[subChapter.contentType].text}
-                                        </span>
-                                        <span class="word-count">
-                                            <i class="fas fa-file-word"></i> ${subChapter.wordCount}字
-                                        </span>
-                                        <span class="status-badge ${subChapter.isPublic ? 'status-public' : 'status-private'}">
-                                            ${subChapter.isPublic ? '公开' : '不公开'}
-                                        </span>
-                                    </div>
-                                </div>
-                                <div class="chapter-actions">
-                                    <button class="action-btn edit-btn" data-id="${subChapter.id}">
-                                        <i class="fas fa-edit"></i>
-                                    </button>
-                                    <button class="action-btn delete-btn" data-id="${subChapter.id}">
-                                        <i class="fas fa-trash"></i>
-                                    </button>
-                                </div>
-                            </div>
-                        `;
-            });
-
-            chaptersHTML += `</div>`;
-        }
-    });
-
-    chaptersList.innerHTML = chaptersHTML;
-}
-
-// 显示章节详情
-function showChapterDetail(chapterId) {
-    const chapterDetailContent = document.getElementById('chapterDetailContent');
-    let chapter = null;
-
-    // 查找章节(包括子章节)
-    for (const parentChapter of chapters) {
-        if (parentChapter.id === chapterId) {
-            chapter = parentChapter;
-            break;
-        }
-
-        for (const subChapter of parentChapter.subChapters) {
-            if (subChapter.id === chapterId) {
-                chapter = subChapter;
-                break;
-            }
-        }
-
-        if (chapter) break;
-    }
-
-    if (!chapter) return;
-
-    selectedChapterId = chapterId;
-
-    chapterDetailContent.innerHTML = `
-                <div class="detail-item">
-                    <div class="detail-label">章节标题</div>
-                    <div class="detail-value">${chapter.title}</div>
-                </div>
-                <div class="detail-item">
-                    <div class="detail-label">章节编号</div>
-                    <div class="detail-value">${chapter.number}</div>
-                </div>
-                <div class="detail-item">
-                    <div class="detail-label">内容类型</div>
-                    <div class="detail-value">
-                        <span class="content-type-badge ${contentTypeMap[chapter.contentType].class}">
-                            ${contentTypeMap[chapter.contentType].text}
-                        </span>
-                    </div>
-                </div>
-                <div class="detail-item">
-                    <div class="detail-label">字数统计</div>
-                    <div class="detail-value">
-                        <span class="word-count">
-                            <i class="fas fa-file-word"></i> ${chapter.wordCount} 字
-                        </span>
-                    </div>
-                </div>
-                <div class="detail-item">
-                    <div class="detail-label">公开状态</div>
-                    <div class="detail-value">
-                        <span class="status-badge ${chapter.isPublic ? 'status-public' : 'status-private'}">
-                            ${chapter.isPublic ? '公开' : '不公开'}
-                        </span>
-                    </div>
-                </div>
-                <div class="detail-item">
-                    <div class="detail-label">内容版本</div>
-                    <div class="detail-value">
-                        <span class="version-badge">${chapter.version}</span>
-                    </div>
-                </div>
-                <div class="detail-item">
-                    <div class="detail-label">章节描述</div>
-                    <div class="detail-value">${chapter.description || '暂无描述'}</div>
-                </div>
-            `;
-
-    renderChapters();
-}
-
-// 初始化页面
-document.addEventListener('DOMContentLoaded', function() {
-    renderChapters();
-
-    // 章节点击事件
-    document.addEventListener('click', function(e) {
-        const chapterItem = e.target.closest('.chapter-item, .sub-chapter-item');
-        if (chapterItem) {
-            const chapterId = parseInt(chapterItem.getAttribute('data-id'));
-            showChapterDetail(chapterId);
-        }
-    });
-
-    // 添加章节按钮
-    // document.getElementById('addChapterBtn').addEventListener('click', function() {
-    //     editingChapterId = null;
-    //     document.getElementById('modalTitle').textContent = '添加新章节';
-    //     document.getElementById('chapterForm').reset();
-    //     document.getElementById('chapterModal').style.display = 'flex';
-    // });
-
-    // 编辑章节按钮
-    document.addEventListener('click', function(e) {
-        if (e.target.closest('.edit-btn')) {
-            const chapterId = parseInt(e.target.closest('.edit-btn').getAttribute('data-id'));
-            editingChapterId = chapterId;
-
-            // 查找章节数据
-            let chapter = null;
-            for (const parentChapter of chapters) {
-                if (parentChapter.id === chapterId) {
-                    chapter = parentChapter;
-                    break;
-                }
-
-                for (const subChapter of parentChapter.subChapters) {
-                    if (subChapter.id === chapterId) {
-                        chapter = subChapter;
-                        break;
-                    }
-                }
-
-                if (chapter) break;
-            }
-
-            if (chapter) {
-                document.getElementById('modalTitle').textContent = '编辑章节';
-                document.getElementById('chapterTitle').value = chapter.title;
-                document.getElementById('chapterNumber').value = chapter.number;
-                document.getElementById('chapterDescription').value = chapter.description || '';
-                document.getElementById('chapterContentType').value = chapter.contentType;
-                document.getElementById('chapterWordCount').value = chapter.wordCount;
-                document.getElementById('chapterPublic').value = chapter.isPublic ? 'true' : 'false';
-                document.getElementById('chapterVersion').value = chapter.version;
-
-                // 设置父级章节(如果是子章节)
-                if (chapter.parentId) {
-                    document.getElementById('chapterParent').value = chapter.parentId;
-                } else {
-                    document.getElementById('chapterParent').value = '';
-                }
-
-                document.getElementById('chapterModal').style.display = 'flex';
-            }
-        }
-    });
-
-    // 关闭模态框
-    document.getElementById('closeModal').addEventListener('click', function() {
-        document.getElementById('chapterModal').style.display = 'none';
-    });
-
-    document.getElementById('cancelBtn').addEventListener('click', function() {
-        document.getElementById('chapterModal').style.display = 'none';
-    });
-
-    // 章节表单提交
-    document.getElementById('chapterForm').addEventListener('submit', function(e) {
-        e.preventDefault();
-
-        const title = document.getElementById('chapterTitle').value;
-        const number = document.getElementById('chapterNumber').value;
-        const description = document.getElementById('chapterDescription').value;
-        const contentType = document.getElementById('chapterContentType').value;
-        const wordCount = parseInt(document.getElementById('chapterWordCount').value);
-        const isPublic = document.getElementById('chapterPublic').value === 'true';
-        const version = document.getElementById('chapterVersion').value;
-        const parentId = document.getElementById('chapterParent').value ?
-            parseInt(document.getElementById('chapterParent').value) : null;
-
-        if (!title || !number) {
-            alert('请输入章节标题和编号');
-            return;
-        }
-
-        if (editingChapterId) {
-            // 编辑现有章节
-            for (const parentChapter of chapters) {
-                if (parentChapter.id === editingChapterId) {
-                    parentChapter.title = title;
-                    parentChapter.number = number;
-                    parentChapter.description = description;
-                    parentChapter.contentType = contentType;
-                    parentChapter.wordCount = wordCount;
-                    parentChapter.isPublic = isPublic;
-                    parentChapter.version = version;
-                    break;
-                }
-
-                for (const subChapter of parentChapter.subChapters) {
-                    if (subChapter.id === editingChapterId) {
-                        subChapter.title = title;
-                        subChapter.number = number;
-                        subChapter.description = description;
-                        subChapter.contentType = contentType;
-                        subChapter.wordCount = wordCount;
-                        subChapter.isPublic = isPublic;
-                        subChapter.version = version;
-                        break;
-                    }
-                }
-            }
-
-            alert('章节更新成功!');
-        } else {
-            // 添加新章节
-            const newChapter = {
-                id: chapters.length > 0 ? Math.max(...chapters.map(c => c.id)) + 1 : 1,
-                number,
-                title,
-                description,
-                contentType,
-                wordCount,
-                isPublic,
-                version,
-                parentId,
-                subChapters: []
-            };
-
-            if (parentId) {
-                // 添加到父章节的子章节中
-                for (const chapter of chapters) {
-                    if (chapter.id === parentId) {
-                        chapter.subChapters.push(newChapter);
-                        break;
-                    }
-                }
-            } else {
-                chapters.push(newChapter);
-            }
-
-            alert('章节添加成功!');
-        }
-
-        document.getElementById('chapterModal').style.display = 'none';
-        renderChapters();
-
-        // 如果正在查看详情,更新详情视图
-        if (selectedChapterId) {
-            showChapterDetail(selectedChapterId);
-        }
-    });
-
-    // 删除章节
-    document.addEventListener('click', function(e) {
-        if (e.target.closest('.delete-btn')) {
-            const chapterId = parseInt(e.target.closest('.delete-btn').getAttribute('data-id'));
-
-            if (confirm('确定要删除这个章节吗?此操作不可恢复。')) {
-                let deleted = false;
-
-                // 查找并删除章节
-                for (let i = 0; i < chapters.length; i++) {
-                    if (chapters[i].id === chapterId) {
-                        chapters.splice(i, 1);
-                        deleted = true;
-                        break;
-                    }
-
-                    for (let j = 0; j < chapters[i].subChapters.length; j++) {
-                        if (chapters[i].subChapters[j].id === chapterId) {
-                            chapters[i].subChapters.splice(j, 1);
-                            deleted = true;
-                            break;
-                        }
-                    }
-
-                    if (deleted) break;
-                }
-
-                if (deleted) {
-                    renderChapters();
-                    document.getElementById('chapterDetailContent').innerHTML = `
-                                <div class="empty-state">
-                                    <i class="fas fa-file-alt"></i>
-                                    <h3>选择章节查看详情</h3>
-                                    <p>点击左侧章节列表中的项目查看详细信息</p>
-                                </div>
-                            `;
-                    selectedChapterId = null;
-                    alert('章节已删除!');
-                }
-            }
-        }
-    });
-});
+})

+ 66 - 90
imwork-windows/imwork-silos/src/main/resources/templates/cms/books/contents/list.html

@@ -12,115 +12,91 @@
 </head>
 <body>
 <div class="container">
-    <header>
-        <div class="book-info">
-            <div class="book-cover">设计</div>
-            <div class="book-details">
-                <h1>网页设计与开发实战</h1>
-                <p>作者:张明 | 总章节:12章 | 状态:编写中</p>
+    <section class="search-section">
+        <div class="search-bar">
+            <div class="search-input">
+                <i class="fas fa-search search-icon"></i>
+                <input type="text" id="searchInput" placeholder="搜索章节标题、章节编号...">
             </div>
-        </div>
-        <div class="header-actions">
+            <button class="btn btn-primary search_btn" id="searchBtn">
+                <i class="fas fa-search"></i> 搜索
+            </button>
             <button class="btn btn-secondary">
-                <i class="fas fa-arrow-left"></i> 返回图书
+                <i class="fas fa-sync-alt"></i> 刷新
             </button>
             <button class="btn btn-primary add_btn">
                 <i class="fas fa-plus"></i> 添加章节
             </button>
         </div>
-    </header>
-
-    <div class="content">
-        <section class="chapters-section">
-            <div class="section-header">
-                <h2 class="section-title">章节列表</h2>
-                <div class="chapters-count">共 8 个章节</div>
-            </div>
 
-            <div class="chapters-list" id="chaptersList">
-                <!-- 章节列表将通过JavaScript动态生成 -->
-            </div>
-        </section>
-
-        <section class="chapter-detail">
-            <div class="detail-header">
-                <h3 class="detail-title">章节详情</h3>
-                <div class="detail-actions">
-                    <button class="action-btn edit-btn" id="editDetailBtn">
-                        <i class="fas fa-edit"></i>
-                    </button>
-                </div>
-            </div>
-
-            <div class="detail-content" id="chapterDetailContent">
-                <div class="empty-state">
-                    <i class="fas fa-file-alt"></i>
-                    <h3>选择章节查看详情</h3>
-                    <p>点击左侧章节列表中的项目查看详细信息</p>
-                </div>
-            </div>
-        </section>
-    </div>
-</div>
-
-<!-- 添加/编辑章节模态框 -->
-<div class="modal" id="chapterModal">
-    <div class="modal-content">
-        <div class="modal-header">
-            <h3 class="modal-title" id="modalTitle">添加新章节</h3>
-            <button class="close-btn" id="closeModal">&times;</button>
-        </div>
-        <form id="chapterForm">
-            <div class="form-group">
-                <label for="chapterTitle">章节标题</label>
-                <input type="text" id="chapterTitle" placeholder="请输入章节标题">
-            </div>
-            <div class="form-group">
-                <label for="chapterNumber">章节编号</label>
-                <input type="text" id="chapterNumber" placeholder="如: 1.1">
-            </div>
-            <div class="form-group">
-                <label for="chapterParent">父级章节</label>
-                <select id="chapterParent">
-                    <option value="">无(顶级章节)</option>
-                    <option value="1">第一章:HTML基础</option>
-                    <option value="2">第二章:CSS样式</option>
-                    <option value="3">第三章:JavaScript编程</option>
-                </select>
-            </div>
-            <div class="form-group">
-                <label for="chapterContentType">内容类型</label>
-                <select id="chapterContentType">
+        <div class="filters">
+            <div class="filter-group">
+                <label>内容类型</label>
+                <select id="contentType">
+                    <option value="">全部</option>
                     <option value="text">纯文本</option>
                     <option value="code">代码示例</option>
                     <option value="mixed">混合内容</option>
                 </select>
             </div>
-            <div class="form-group">
-                <label for="chapterWordCount">字数统计</label>
-                <input type="number" id="chapterWordCount" placeholder="请输入字数">
+
+            <div class="filter-group">
+                <label>是否公开</label>
+                <select id="isPublic">
+                    <option value="">全部</option>
+                    <option value="0">公开</option>
+                    <option value="1">不公开</option>
+                </select>
             </div>
-            <div class="form-group">
-                <label for="chapterPublic">是否公开</label>
-                <select id="chapterPublic">
-                    <option value="true">公开</option>
-                    <option value="false">不公开</option>
+
+            <div class="filter-group">
+                <label>内容版本</label>
+                <select id="version">
+                    <option value="">全部</option>
+                    <option value="v1.0">v1.0</option>
+                    <option value="v1.1">v1.1</option>
+                    <option value="v1.2">v1.2</option>
+                    <option value="v2.0">v2.0</option>
                 </select>
             </div>
-            <div class="form-group">
-                <label for="chapterVersion">内容版本</label>
-                <input type="text" id="chapterVersion" placeholder="如: v1.0" value="v1.0">
+
+            <div class="filter-group">
+                <label>创建时间</label>
+                <input type="date" id="createDateTime">
             </div>
-            <div class="form-group">
-                <label for="chapterDescription">章节描述</label>
-                <textarea id="chapterDescription" rows="3" placeholder="请输入章节描述(可选)"></textarea>
+
+            <div class="filter-group">
+                <label>图书</label>
+                <select id="bookInfoId">
+                    <option value="">全部</option>
+                    <option value="1">网页设计与开发实战</option>
+                    <option value="2">JavaScript高级程序设计</option>
+                    <option value="3">CSS权威指南</option>
+                </select>
             </div>
-            <div class="modal-actions">
-                <button type="button" class="btn btn-secondary" id="cancelBtn">取消</button>
-                <button type="submit" class="btn btn-primary">保存章节</button>
+        </div>
+    </section>
+
+    <section class="chapters-section">
+        <!-- 列表视图 -->
+        <div class="chapters-table" id="chaptersTable">
+            <div id="chaptersTableBody">
+                <!-- 章节列表将通过JavaScript动态生成 -->
+                <table id="list" lay-filter="list" class="table-header"></table>
+                <!--操作-->
+                <script type="text/html" id="listBar">
+                    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
+                    <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="usable">已启用</a>
+                    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
+                </script>
             </div>
-        </form>
-    </div>
+        </div>
+
+        <!-- 分页 -->
+        <div class="pagination" id="pagination">
+            <!-- 分页按钮将通过JavaScript动态生成 -->
+        </div>
+    </section>
 </div>
 
 <script src="../../../../static/assets/lib/jquery/jquery.js" th:src="@{/assets/lib/jquery/jquery.js}"></script>