Browse Source

1.关联图书设置为后台获取

1 4 weeks ago
parent
commit
d0861eac86

+ 11 - 0
imwork-assist/imwork-generator-service/src/main/java/top/imwork/assist/generator/config/GeneratorDTO.java

@@ -17,6 +17,9 @@ import org.springframework.stereotype.Component;
 @PropertySource({"classpath:db.properties"})
 @EnableConfigurationProperties
 public class GeneratorDTO {
+    @Value("${commonsPath}")
+    private String commonsPath;
+
     @Value("${mainPath}")
     private String mainPath;
 
@@ -44,6 +47,14 @@ public class GeneratorDTO {
     @Value("${mediumint}")
     private String mediumint;
 
+    public String getCommonsPath() {
+        return commonsPath;
+    }
+
+    public void setCommonsPath(String commonsPath) {
+        this.commonsPath = commonsPath;
+    }
+
     public String getMainPath() {
         return mainPath;
     }

+ 1 - 0
imwork-assist/imwork-generator-service/src/main/java/top/imwork/assist/generator/service/GeneratorService.java

@@ -179,6 +179,7 @@ public class GeneratorService {
         map.put("columns", tb.getColumns());
         map.put("hasBigDecimal", hasBigDecimal);
         map.put("mainPath", mainPath);
+        map.put("commonsPath", generatorDTO.getCommonsPath());
         map.put("package", generatorDTO.getPackages());
         map.put("moduleName", generatorDTO.getModuleName());
         map.put("author", generatorDTO.getAuthor());

+ 1 - 0
imwork-assist/imwork-generator-service/src/main/resources/db.properties

@@ -1,5 +1,6 @@
 imwork.database= mysql
 
+commonsPath=top.imwork
 mainPath=top.imwork.window
 packages=top.imwork.window
 moduleName=silos

+ 1 - 1
imwork-assist/imwork-generator-service/src/main/resources/moudle/Dao.ftl

@@ -1,6 +1,6 @@
 package ${package}.${moduleName}.dao;
 
-import ${package}.commons.dao.base.BaseDao;
+import ${commonsPath}.commons.dao.base.BaseDao;
 import ${package}.${moduleName}.entity.${className};
 
 /**

+ 0 - 4
imwork-commons/imwork-commons-core/pom.xml

@@ -23,10 +23,6 @@
     </properties>
 
     <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-log4j2</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>

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

@@ -1,22 +1,32 @@
-document.addEventListener('DOMContentLoaded', function() {
+document.addEventListener('DOMContentLoaded', function () {
     // 模拟数据 - 实际应用中可能来自API
-    const allOptions = Array.from({length: 100}, (_, i) => ({
-        id: i + 1,
-        name: `选项 ${i + 1}`,
-        category: i % 5 === 0 ? '热门' : '常规'
-    }));
-
-    // 添加一些特殊选项
-    allOptions.push(
-        {id: 101, name: 'JavaScript', category: '技术'},
-        {id: 102, name: 'Python', category: '技术'},
-        {id: 103, name: 'Java', category: '技术'},
-        {id: 104, name: 'React', category: '前端'},
-        {id: 105, name: 'Vue', category: '前端'},
-        {id: 106, name: 'Angular', category: '前端'},
-        {id: 107, name: 'Node.js', category: '后端'},
-        {id: 108, name: 'Express', category: '后端'}
-    );
+    const allOptions = [];
+
+    $.ajax({
+        url: "/silos/cms/books/info/queryPage",
+        type: "POST",
+        dataType: "json",
+        contentType: 'application/json;charset=UTF-8',
+        data: JSON.stringify({
+            contentsName: $("#bookInfoId").val(),
+            pageNo: 1,
+            pageRows: 10,
+        }),
+        success: function (res) {
+            const data = res.data.dataList;
+            for (let i = 0; i < data.length; i++) {
+                let newObj = {
+                    id: data[i].isbn,
+                    name: data[i].title,
+                    category: data[i].categoryCode
+                };
+                allOptions.push(newObj);
+                filteredOptions =allOptions;
+            }
+        },
+        error: function (e) {
+        }
+    })
 
     // DOM元素
     const dropdownHeader = document.querySelector('.dropdown-header');
@@ -48,7 +58,7 @@ document.addEventListener('DOMContentLoaded', function() {
     nextBtn.addEventListener('click', goToNextPage);
 
     // 点击外部关闭下拉框
-    document.addEventListener('click', function(e) {
+    document.addEventListener('click', function (e) {
         if (!dropdownHeader.contains(e.target) && !dropdownList.contains(e.target)) {
             closeDropdown();
         }
@@ -174,7 +184,7 @@ document.addEventListener('DOMContentLoaded', function() {
 
         // 添加移除标签事件监听
         document.querySelectorAll('.remove-tag').forEach(btn => {
-            btn.addEventListener('click', function(e) {
+            btn.addEventListener('click', function (e) {
                 e.stopPropagation();
                 const id = parseInt(this.getAttribute('data-id'));
                 removeOption(id);

+ 1 - 1
imwork-windows/imwork-silos/src/main/resources/templates/cms/books/contents/edit.html

@@ -38,7 +38,7 @@
 
                             <div class="dropdown-list">
                                 <div class="search-box">
-                                    <input type="text" class="search-input" placeholder="搜索选项...">
+                                    <input type="text" id="bookInfoId" name="bookInfoId" class="search-input" placeholder="搜索选项...">
                                 </div>
 
                                 <div class="options-container">