2 Commits

Author SHA1 Message Date
  Bobi 9e72d82af6 接口 8 months ago
  Bobi 50dc1e7fe7 接口 8 months ago
133 changed files with 10542 additions and 216 deletions
Split View
  1. +4
    -9
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/AppletUser.java
  2. +97
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java
  3. +59
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiIndexController.java
  4. +16
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/query/AppletBookQuery.java
  5. +36
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiBooksService.java
  6. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiIndexService.java
  7. +83
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java
  8. +40
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiIndexServiceImpl.java
  9. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/controller/AppletBannerController.java
  10. +68
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/entity/AppletBanner.java
  11. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/mapper/AppletBannerMapper.java
  12. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/mapper/xml/AppletBannerMapper.xml
  13. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/service/IAppletBannerService.java
  14. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/service/impl/AppletBannerServiceImpl.java
  15. +89
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp/AppletBannerForm.vue
  16. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp/AppletBannerList.vue
  17. +15
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerData.ts
  18. +218
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerForm.vue
  19. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerList.vue
  20. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBanner.api.ts
  21. +63
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBanner.data.ts
  22. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBannerList.vue
  23. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBannerForm.vue
  24. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBannerModal.vue
  25. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBooksForm.vue
  26. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBooksModal.vue
  27. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/controller/AppletBookStandController.java
  28. +67
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/entity/AppletBookStand.java
  29. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/mapper/AppletBookStandMapper.java
  30. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/mapper/xml/AppletBookStandMapper.xml
  31. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/service/IAppletBookStandService.java
  32. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/service/impl/AppletBookStandServiceImpl.java
  33. +89
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp/AppletBookStandForm.vue
  34. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp/AppletBookStandList.vue
  35. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp3/AppletBookStandData.ts
  36. +222
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp3/AppletBookStandForm.vue
  37. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp3/AppletBookStandList.vue
  38. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/AppletBookStand.api.ts
  39. +56
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/AppletBookStand.data.ts
  40. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/AppletBookStandList.vue
  41. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/V20250910_1__menu_insert_AppletBookStand.sql
  42. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/components/AppletBookStandForm.vue
  43. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/components/AppletBookStandModal.vue
  44. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/controller/AppletBooksController.java
  45. +91
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/entity/AppletBooks.java
  46. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/mapper/AppletBooksMapper.java
  47. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/mapper/xml/AppletBooksMapper.xml
  48. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/IAppletBooksService.java
  49. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/impl/AppletBooksServiceImpl.java
  50. +125
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp/AppletBooksForm.vue
  51. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp/AppletBooksList.vue
  52. +48
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksData.ts
  53. +304
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksForm.vue
  54. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksList.vue
  55. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooks.api.ts
  56. +131
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooks.data.ts
  57. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooksList.vue
  58. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/V20250909_1__menu_insert_AppletBooks.sql
  59. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/components/AppletBooksForm.vue
  60. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/components/AppletBooksModal.vue
  61. +179
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/controller/AppletCategorizeController.java
  62. +63
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/entity/AppletCategorize.java
  63. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/mapper/AppletCategorizeMapper.java
  64. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/mapper/xml/AppletCategorizeMapper.xml
  65. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/service/IAppletCategorizeService.java
  66. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/service/impl/AppletCategorizeServiceImpl.java
  67. +83
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp/AppletCategorizeForm.vue
  68. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp/AppletCategorizeList.vue
  69. +9
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp3/AppletCategorizeData.ts
  70. +209
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp3/AppletCategorizeForm.vue
  71. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp3/AppletCategorizeList.vue
  72. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/AppletCategorize.api.ts
  73. +45
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/AppletCategorize.data.ts
  74. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/AppletCategorizeList.vue
  75. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/V20250909_1__menu_insert_AppletCategorize.sql
  76. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/components/AppletCategorizeForm.vue
  77. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/components/AppletCategorizeModal.vue
  78. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/controller/AppletLabelController.java
  79. +63
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/entity/AppletLabel.java
  80. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/mapper/AppletLabelMapper.java
  81. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/mapper/xml/AppletLabelMapper.xml
  82. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/service/IAppletLabelService.java
  83. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/service/impl/AppletLabelServiceImpl.java
  84. +83
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp/AppletLabelForm.vue
  85. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp/AppletLabelList.vue
  86. +9
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp3/AppletLabelData.ts
  87. +209
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp3/AppletLabelForm.vue
  88. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp3/AppletLabelList.vue
  89. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/AppletLabel.api.ts
  90. +45
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/AppletLabel.data.ts
  91. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/AppletLabelList.vue
  92. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/V20250910_1__menu_insert_AppletLabel.sql
  93. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/components/AppletLabelForm.vue
  94. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/components/AppletLabelModal.vue
  95. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/controller/AppletLinkController.java
  96. +72
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/entity/AppletLink.java
  97. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/mapper/AppletLinkMapper.java
  98. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/mapper/xml/AppletLinkMapper.xml
  99. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/service/IAppletLinkService.java
  100. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/service/impl/AppletLinkServiceImpl.java

+ 4
- 9
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/AppletUser.java View File

@ -68,17 +68,12 @@ public class AppletUser implements Serializable {
@Excel(name = "手机号", width = 15)
@Schema(description = "手机号")
private java.lang.String phone;
/**体总指数*/
@Excel(name = "体总指数", width = 15)
@Schema(description = "体总指数")
private java.math.BigDecimal bmi;
/**脂肪*/
@Excel(name = "脂肪", width = 15)
@Schema(description = "脂肪")
private java.math.BigDecimal fat;
/**头像*/
@Excel(name = "头像", width = 15)
@Schema(description = "头像")
private java.lang.String avatar;
/**佣金*/
@Excel(name = "佣金", width = 15)
@Schema(description = "佣金")
private java.math.BigDecimal commission;
}

+ 97
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java View File

@ -0,0 +1,97 @@
package org.jeecg.modules.applet.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.IgnoreAuth;
import org.jeecg.modules.applet.service.AppletApiBooksService;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description: 书籍管理
* @Author: jeecg-boot
* @Date: 2025-01-XX
* @Version: V1.0
*/
@Tag(name = "书籍", description = "书籍")
@RestController
@RequestMapping("/appletApi/books")
@Slf4j
public class AppletApiBooksController {
@Autowired
private AppletApiBooksService appletApiBooksService;
/**
* 查询书籍列表
*
* @return 查询书籍列表
*/
@Operation(summary = "查询书籍列表", description = "查询书籍列表")
@GetMapping(value = "/list")
@IgnoreAuth
public Result<IPage<AppletBooks>> list(@Parameter(description = "搜素关键字") String title,
@Parameter(description = "搜素关键字") String category,
@Parameter(description = "搜素关键字") String label,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
log.info("查询书籍列表");
Page<AppletBooks> booksPage = new Page<>(pageNo, pageSize);
IPage<AppletBooks> list = appletApiBooksService
.getBooks(booksPage, title, category, label);
return Result.OK(list);
}
/**
* 查询书桌列表
*
* @return 查询书桌列表
*/
@Operation(summary = "查询书桌列表", description = "查询书桌列表")
@GetMapping(value = "/stand")
public Result<IPage<AppletBooks>> stand(@Parameter(description = "搜素关键字") String title,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
log.info("查询书桌列表");
Page<AppletBooks> booksPage = new Page<>(pageNo, pageSize);
IPage<AppletBooks> list = appletApiBooksService
.getBooksStand(booksPage, title);
return Result.OK(list);
}
/**
* 加入书桌
*
* @return 加入书桌
*/
@Operation(summary = "加入书桌", description = "加入书桌")
@PostMapping(value = "/addStand")
public Result<?> addStand(@Parameter(description = "书籍id") String id) {
appletApiBooksService.addStand(id);
return Result.OK();
}
/**
* 删除书桌
*
* @return 删除书桌
*/
@Operation(summary = "删除书桌", description = "删除书桌,批量删除用,分割")
@PostMapping(value = "/delStand")
public Result<?> delStand(@Parameter(description = "书籍id") String id) {
appletApiBooksService.delStand(id);
return Result.OK();
}
}

+ 59
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiIndexController.java View File

@ -0,0 +1,59 @@
package org.jeecg.modules.applet.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.IgnoreAuth;
import org.jeecg.modules.applet.service.AppletApiConfigService;
import org.jeecg.modules.applet.service.AppletApiIndexService;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import org.jeecg.modules.demo.appletConfig.entity.AppletConfig;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Description: 小程序首页
* @Author: jeecg-boot
* @Date: 2025-01-XX
* @Version: V1.0
*/
@Tag(name="小程序首页", description="小程序首页")
@RestController
@RequestMapping("/appletApi/index")
@Slf4j
public class AppletApiIndexController {
@Autowired
private AppletApiIndexService appletApiIndexService;
/**
* 查询轮播图
* @return 查询轮播图
*/
@Operation(summary = "查询轮播图", description = "查询轮播图")
@GetMapping(value = "/banner")
@IgnoreAuth
public Result<List<AppletBanner>> banner() {
log.info("查询轮播图");
List<AppletBanner> list = appletApiIndexService.getBanner();
return Result.OK(list);
}
@Operation(summary = "首页底部内容链接", description = "首页底部内容链接")
@GetMapping(value = "/link")
@IgnoreAuth
public Result<List<AppletLink>> link() {
log.info("查询首页底部内容链接");
List<AppletLink> list = appletApiIndexService.getLink();
return Result.OK(list);
}
}

+ 16
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/query/AppletBookQuery.java View File

@ -0,0 +1,16 @@
package org.jeecg.modules.applet.query;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AppletBookQuery {
private String title;
}

+ 36
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiBooksService.java View File

@ -0,0 +1,36 @@
package org.jeecg.modules.applet.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import java.util.List;
public interface AppletApiBooksService {
/**
* 分页列表查询
*
*/
IPage<AppletBooks> getBooks(Page<AppletBooks> page, String title, String category, String label);
/**
* 查询书桌列表
*
* @return 查询书桌列表
*/
IPage<AppletBooks> getBooksStand(Page<AppletBooks> booksPage, String title);
/**
* 加入书桌
*
* @return 加入书桌
*/
void addStand(String id);
/**
* 删除书桌
*
* @return 删除书桌
*/
void delStand(String id);
}

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiIndexService.java View File

@ -0,0 +1,26 @@
package org.jeecg.modules.applet.service;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import java.util.List;
/**
* 小程序首页
*/
public interface AppletApiIndexService {
/**
* 轮播图
*
* @return
*/
List<AppletBanner> getBanner();
/**
* 首页底部内容链接
*
* @return
*/
List<AppletLink> getLink();
}

+ 83
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java View File

@ -0,0 +1,83 @@
package org.jeecg.modules.applet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jodd.util.StringUtil;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.util.AppletUserUtil;
import org.jeecg.modules.applet.query.AppletBookQuery;
import org.jeecg.modules.applet.service.AppletApiBooksService;
import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand;
import org.jeecg.modules.demo.appletBookStand.service.IAppletBookStandService;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import org.jeecg.modules.demo.appletBooks.service.IAppletBooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class AppletApiBooksServiceImpl implements AppletApiBooksService {
@Autowired
private IAppletBooksService appletBooksService;
@Autowired
private IAppletBookStandService appletBookStandService;
@Override
public IPage<AppletBooks> getBooks(Page<AppletBooks> page, String title, String category, String label) {
return appletBooksService
.lambdaQuery()
.like(StringUtil.isNotEmpty(title), AppletBooks::getBooksName, title)
.eq(StringUtil.isNotEmpty(category), AppletBooks::getBooksClassification, category)
.like(StringUtil.isNotEmpty(label), AppletBooks::getBooksLabel, label)
.page(page);
}
@Override
public IPage<AppletBooks> getBooksStand(Page<AppletBooks> booksPage, String title) {
String userId = AppletUserUtil.getCurrentAppletUserId();
List<String> bookIds = appletBookStandService
.lambdaQuery()
.eq(AppletBookStand::getUserId, userId)
.list().stream()
.map(AppletBookStand::getBookId)
.collect(Collectors.toList());
return appletBooksService
.lambdaQuery()
.in(AppletBooks::getId)
.like(StringUtil.isNotEmpty(title), AppletBooks::getBooksName, title)
.page(booksPage);
}
@Override
public void addStand(String id) {
String userId = AppletUserUtil.getCurrentAppletUserId();
AppletBookStand one = appletBookStandService.lambdaQuery()
.eq(AppletBookStand::getUserId, userId)
.eq(AppletBookStand::getBookId, id).one();
if (one == null){
AppletBookStand appletBookStand = new AppletBookStand();
appletBookStand.setUserId(userId);
appletBookStand.setBookId(id);
appletBookStandService.save(appletBookStand);
}
}
@Override
public void delStand(String id) {
if (StringUtil.isBlank(id)){
throw new JeecgBootException("id不能为空");
}
String userId = AppletUserUtil.getCurrentAppletUserId();
appletBookStandService.remove(Wrappers.<AppletBookStand>lambdaQuery()
.eq(AppletBookStand::getUserId, userId)
.in(AppletBookStand::getBookId, Arrays.asList(id.split(","))));
}
}

+ 40
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiIndexServiceImpl.java View File

@ -0,0 +1,40 @@
package org.jeecg.modules.applet.service.impl;
import org.jeecg.modules.applet.service.AppletApiIndexService;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import org.jeecg.modules.demo.appletBanner.service.IAppletBannerService;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import org.jeecg.modules.demo.appletLink.service.IAppletLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AppletApiIndexServiceImpl implements AppletApiIndexService {
@Autowired
private IAppletBannerService appletBannerService;
@Autowired
private IAppletLinkService appletLinkService;
/***
* 轮播图
* @return
*/
@Override
public List<AppletBanner> getBanner() {
return appletBannerService.list();
}
/**
* 首页底部内容链接
*
* @return
*/
@Override
public List<AppletLink> getLink() {
return appletLinkService.list();
}
}

+ 182
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/controller/AppletBannerController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletBanner.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import org.jeecg.modules.demo.appletBanner.service.IAppletBannerService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 轮播图
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Tag(name="轮播图")
@RestController
@RequestMapping("/appletBanner/appletBanner")
@Slf4j
public class AppletBannerController extends JeecgController<AppletBanner, IAppletBannerService> {
@Autowired
private IAppletBannerService appletBannerService;
/**
* 分页列表查询
*
* @param appletBanner
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "轮播图-分页列表查询")
@Operation(summary="轮播图-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletBanner>> queryPageList(AppletBanner appletBanner,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletBanner> queryWrapper = QueryGenerator.initQueryWrapper(appletBanner, req.getParameterMap());
Page<AppletBanner> page = new Page<AppletBanner>(pageNo, pageSize);
IPage<AppletBanner> pageList = appletBannerService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletBanner
* @return
*/
@AutoLog(value = "轮播图-添加")
@Operation(summary="轮播图-添加")
@RequiresPermissions("appletBanner:applet_banner:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletBanner appletBanner) {
appletBannerService.save(appletBanner);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletBanner
* @return
*/
@AutoLog(value = "轮播图-编辑")
@Operation(summary="轮播图-编辑")
@RequiresPermissions("appletBanner:applet_banner:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletBanner appletBanner) {
appletBannerService.updateById(appletBanner);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "轮播图-通过id删除")
@Operation(summary="轮播图-通过id删除")
@RequiresPermissions("appletBanner:applet_banner:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletBannerService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "轮播图-批量删除")
@Operation(summary="轮播图-批量删除")
@RequiresPermissions("appletBanner:applet_banner:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletBannerService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "轮播图-通过id查询")
@Operation(summary="轮播图-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletBanner> queryById(@RequestParam(name="id",required=true) String id) {
AppletBanner appletBanner = appletBannerService.getById(id);
if(appletBanner==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletBanner);
}
/**
* 导出excel
*
* @param request
* @param appletBanner
*/
@RequiresPermissions("appletBanner:applet_banner:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletBanner appletBanner) {
return super.exportXls(request, appletBanner, AppletBanner.class, "轮播图");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletBanner:applet_banner:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletBanner.class);
}
}

+ 68
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/entity/AppletBanner.java View File

@ -0,0 +1,68 @@
package org.jeecg.modules.demo.appletBanner.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 轮播图
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Data
@TableName("applet_banner")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="轮播图")
public class AppletBanner implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**轮播图*/
@Excel(name = "轮播图", width = 15)
@Schema(description = "轮播图")
private java.lang.String img;
/**类型*/
@Excel(name = "类型", width = 15, dicCode = "applett_bnner_type")
@Dict(dicCode = "applett_bnner_type")
@Schema(description = "类型:0是富文本 1是课程")
private java.lang.String typ;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/mapper/AppletBannerMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletBanner.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 轮播图
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
public interface AppletBannerMapper extends BaseMapper<AppletBanner> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/mapper/xml/AppletBannerMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletBanner.mapper.AppletBannerMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/service/IAppletBannerService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletBanner.service;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 轮播图
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
public interface IAppletBannerService extends IService<AppletBanner> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/service/impl/AppletBannerServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletBanner.service.impl;
import org.jeecg.modules.demo.appletBanner.entity.AppletBanner;
import org.jeecg.modules.demo.appletBanner.mapper.AppletBannerMapper;
import org.jeecg.modules.demo.appletBanner.service.IAppletBannerService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 轮播图
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Service
public class AppletBannerServiceImpl extends ServiceImpl<AppletBannerMapper, AppletBanner> implements IAppletBannerService {
}

+ 89
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp/AppletBannerForm.vue View File

@ -0,0 +1,89 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">轮播图</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">轮播图</text></view>
<input placeholder="请输入轮播图" v-model="model.img"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">类型</text></view>
<input placeholder="请输入类型" v-model="model.typ"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletBannerForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletBanner/appletBanner/queryById",
add: "/appletBanner/appletBanner/add",
edit: "/appletBanner/appletBanner/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp/AppletBannerList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">轮播图</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '轮播图',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletBanner/appletBanner/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 15
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerData.ts View File

@ -0,0 +1,15 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '轮播图',
align:"center",
dataIndex: 'img',
customRender:render.renderImage,
},
{
title: '类型',
align:"center",
dataIndex: 'typ_dictText'
},
];

+ 218
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerForm.vue View File

@ -0,0 +1,218 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '轮播图',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<!-- 图片 -->
<wd-cell
:title="get4Label('轮播图')"
title-width="100px"
>
<online-image
v-model:value="myFormData['img']"
name='img'
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<online-select
:label="get4Label('类型')"
labelWidth="100px"
type="list"
name='typ'
dict="applett_bnner_type"
v-model="myFormData['typ']"
></online-select>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletBannerForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletBannerList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletBanner/appletBanner/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_banner',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletBanner/appletBanner/edit':'/appletBanner/appletBanner/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '轮播图',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="轮播图" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletBannerData';
defineOptions({
name: 'AppletBannerList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletBanner/appletBanner/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletBanner/appletBanner/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletBannerForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletBannerForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBanner.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletBanner/appletBanner/list',
save='/appletBanner/appletBanner/add',
edit='/appletBanner/appletBanner/edit',
deleteOne = '/appletBanner/appletBanner/delete',
deleteBatch = '/appletBanner/appletBanner/deleteBatch',
importExcel = '/appletBanner/appletBanner/importExcel',
exportXls = '/appletBanner/appletBanner/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 63
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBanner.data.ts View File

@ -0,0 +1,63 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '轮播图',
align:"center",
dataIndex: 'img',
customRender:render.renderImage,
},
{
title: '类型',
align:"center",
dataIndex: 'typ_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '轮播图',
field: 'img',
component: 'JImageUpload',
componentProps:{
fileMax: 0
},
},
{
label: '类型',
field: 'typ',
component: 'JDictSelectTag',
componentProps:{
dictCode:"applett_bnner_type"
},
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
img: {title: '轮播图',order: 0,view: 'image', type: 'string',},
typ: {title: '类型',order: 1,view: 'list', type: 'string',dictCode: 'applett_bnner_type',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBannerList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletBanner:applet_banner:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletBanner:applet_banner:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletBanner:applet_banner:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletBanner:applet_banner:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletBannerModal @register="registerModal" @success="handleSuccess"></AppletBannerModal>
</div>
</template>
<script lang="ts" name="appletBanner-appletBanner" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletBannerModal from './components/AppletBannerModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletBanner.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletBanner.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '轮播图',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"轮播图",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletBanner:applet_banner:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletBanner:applet_banner:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBannerForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletBanner.data';
import {saveOrUpdate} from '../AppletBanner.api';
export default defineComponent({
name: "AppletBannerForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletBanner/appletBanner/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBannerModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletBannerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletBanner.data';
import {saveOrUpdate} from '../AppletBanner.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBooksForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletBooks.data';
import {saveOrUpdate} from '../AppletBooks.api';
export default defineComponent({
name: "AppletBooksForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletBanner/appletBooks/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/components/AppletBooksModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletBooksForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletBooks.data';
import {saveOrUpdate} from '../AppletBooks.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 182
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/controller/AppletBookStandController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletBookStand.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand;
import org.jeecg.modules.demo.appletBookStand.service.IAppletBookStandService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 书桌
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Tag(name="书桌")
@RestController
@RequestMapping("/appletBookStand/appletBookStand")
@Slf4j
public class AppletBookStandController extends JeecgController<AppletBookStand, IAppletBookStandService> {
@Autowired
private IAppletBookStandService appletBookStandService;
/**
* 分页列表查询
*
* @param appletBookStand
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "书桌-分页列表查询")
@Operation(summary="书桌-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletBookStand>> queryPageList(AppletBookStand appletBookStand,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletBookStand> queryWrapper = QueryGenerator.initQueryWrapper(appletBookStand, req.getParameterMap());
Page<AppletBookStand> page = new Page<AppletBookStand>(pageNo, pageSize);
IPage<AppletBookStand> pageList = appletBookStandService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletBookStand
* @return
*/
@AutoLog(value = "书桌-添加")
@Operation(summary="书桌-添加")
@RequiresPermissions("appletBookStand:applet_book_stand:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletBookStand appletBookStand) {
appletBookStandService.save(appletBookStand);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletBookStand
* @return
*/
@AutoLog(value = "书桌-编辑")
@Operation(summary="书桌-编辑")
@RequiresPermissions("appletBookStand:applet_book_stand:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletBookStand appletBookStand) {
appletBookStandService.updateById(appletBookStand);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "书桌-通过id删除")
@Operation(summary="书桌-通过id删除")
@RequiresPermissions("appletBookStand:applet_book_stand:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletBookStandService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "书桌-批量删除")
@Operation(summary="书桌-批量删除")
@RequiresPermissions("appletBookStand:applet_book_stand:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletBookStandService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "书桌-通过id查询")
@Operation(summary="书桌-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletBookStand> queryById(@RequestParam(name="id",required=true) String id) {
AppletBookStand appletBookStand = appletBookStandService.getById(id);
if(appletBookStand==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletBookStand);
}
/**
* 导出excel
*
* @param request
* @param appletBookStand
*/
@RequiresPermissions("appletBookStand:applet_book_stand:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletBookStand appletBookStand) {
return super.exportXls(request, appletBookStand, AppletBookStand.class, "书桌");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletBookStand:applet_book_stand:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletBookStand.class);
}
}

+ 67
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/entity/AppletBookStand.java View File

@ -0,0 +1,67 @@
package org.jeecg.modules.demo.appletBookStand.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 书桌
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Data
@TableName("applet_book_stand")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="书桌")
public class AppletBookStand implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**用户*/
@Excel(name = "用户", width = 15)
@Schema(description = "用户")
private java.lang.String userId;
/**书籍*/
@Excel(name = "书籍", width = 15)
@Schema(description = "书籍")
private java.lang.String bookId;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/mapper/AppletBookStandMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletBookStand.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 书桌
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
public interface AppletBookStandMapper extends BaseMapper<AppletBookStand> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/mapper/xml/AppletBookStandMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletBookStand.mapper.AppletBookStandMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/service/IAppletBookStandService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletBookStand.service;
import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 书桌
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
public interface IAppletBookStandService extends IService<AppletBookStand> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/service/impl/AppletBookStandServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletBookStand.service.impl;
import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand;
import org.jeecg.modules.demo.appletBookStand.mapper.AppletBookStandMapper;
import org.jeecg.modules.demo.appletBookStand.service.IAppletBookStandService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 书桌
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Service
public class AppletBookStandServiceImpl extends ServiceImpl<AppletBookStandMapper, AppletBookStand> implements IAppletBookStandService {
}

+ 89
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp/AppletBookStandForm.vue View File

@ -0,0 +1,89 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">书桌</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">用户</text></view>
<input placeholder="请输入用户" v-model="model.userId"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍</text></view>
<input placeholder="请输入书籍" v-model="model.bookId"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletBookStandForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletBookStand/appletBookStand/queryById",
add: "/appletBookStand/appletBookStand/add",
edit: "/appletBookStand/appletBookStand/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp/AppletBookStandList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">书桌</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '书桌',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletBookStand/appletBookStand/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp3/AppletBookStandData.ts View File

@ -0,0 +1,14 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '用户',
align:"center",
dataIndex: 'userId'
},
{
title: '书籍',
align:"center",
dataIndex: 'bookId'
},
];

+ 222
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp3/AppletBookStandForm.vue View File

@ -0,0 +1,222 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '书桌',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['userId']"
:label="get4Label('用户')"
name='userId'
prop='userId'
placeholder="请选择用户"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['bookId']"
:label="get4Label('书籍')"
name='bookId'
prop='bookId'
placeholder="请选择书籍"
:rules="[
]"
clearable
/>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletBookStandForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletBookStandList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletBookStand/appletBookStand/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_book_stand',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletBookStand/appletBookStand/edit':'/appletBookStand/appletBookStand/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/uniapp3/AppletBookStandList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '书桌',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="书桌" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletBookStandData';
defineOptions({
name: 'AppletBookStandList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletBookStand/appletBookStand/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletBookStand/appletBookStand/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletBookStandForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletBookStandForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/AppletBookStand.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletBookStand/appletBookStand/list',
save='/appletBookStand/appletBookStand/add',
edit='/appletBookStand/appletBookStand/edit',
deleteOne = '/appletBookStand/appletBookStand/delete',
deleteBatch = '/appletBookStand/appletBookStand/deleteBatch',
importExcel = '/appletBookStand/appletBookStand/importExcel',
exportXls = '/appletBookStand/appletBookStand/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 56
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/AppletBookStand.data.ts View File

@ -0,0 +1,56 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户',
align:"center",
dataIndex: 'userId'
},
{
title: '书籍',
align:"center",
dataIndex: 'bookId'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户',
field: 'userId',
component: 'Input',
},
{
label: '书籍',
field: 'bookId',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
userId: {title: '用户',order: 0,view: 'text', type: 'string',},
bookId: {title: '书籍',order: 1,view: 'text', type: 'string',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/AppletBookStandList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletBookStand:applet_book_stand:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletBookStand:applet_book_stand:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletBookStand:applet_book_stand:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletBookStand:applet_book_stand:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletBookStandModal @register="registerModal" @success="handleSuccess"></AppletBookStandModal>
</div>
</template>
<script lang="ts" name="appletBookStand-appletBookStand" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletBookStandModal from './components/AppletBookStandModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletBookStand.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletBookStand.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '书桌',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"书桌",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletBookStand:applet_book_stand:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletBookStand:applet_book_stand:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/V20250910_1__menu_insert_AppletBookStand.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletBookStand文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091011268240570', NULL, '书桌', '/appletBookStand/appletBookStandList', 'appletBookStand/AppletBookStandList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091011268240571', '2025091011268240570', '添加书桌', NULL, NULL, 0, NULL, NULL, 2, 'appletBookStand:applet_book_stand:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091011268240572', '2025091011268240570', '编辑书桌', NULL, NULL, 0, NULL, NULL, 2, 'appletBookStand:applet_book_stand:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091011268240573', '2025091011268240570', '删除书桌', NULL, NULL, 0, NULL, NULL, 2, 'appletBookStand:applet_book_stand:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091011268240574', '2025091011268240570', '批量删除书桌', NULL, NULL, 0, NULL, NULL, 2, 'appletBookStand:applet_book_stand:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091011268240575', '2025091011268240570', '导出excel_书桌', NULL, NULL, 0, NULL, NULL, 2, 'appletBookStand:applet_book_stand:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091011268240576', '2025091011268240570', '导入excel_书桌', NULL, NULL, 0, NULL, NULL, 2, 'appletBookStand:applet_book_stand:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 23:26:57', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/components/AppletBookStandForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletBookStand.data';
import {saveOrUpdate} from '../AppletBookStand.api';
export default defineComponent({
name: "AppletBookStandForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletBookStand/appletBookStand/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBookStand/vue3/components/AppletBookStandModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletBookStandForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletBookStand.data';
import {saveOrUpdate} from '../AppletBookStand.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 182
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/controller/AppletBooksController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletBooks.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import org.jeecg.modules.demo.appletBooks.service.IAppletBooksService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Tag(name="书籍表")
@RestController
@RequestMapping("/appletBooks/appletBooks")
@Slf4j
public class AppletBooksController extends JeecgController<AppletBooks, IAppletBooksService> {
@Autowired
private IAppletBooksService appletBooksService;
/**
* 分页列表查询
*
* @param appletBooks
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "书籍表-分页列表查询")
@Operation(summary="书籍表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletBooks>> queryPageList(AppletBooks appletBooks,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletBooks> queryWrapper = QueryGenerator.initQueryWrapper(appletBooks, req.getParameterMap());
Page<AppletBooks> page = new Page<AppletBooks>(pageNo, pageSize);
IPage<AppletBooks> pageList = appletBooksService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletBooks
* @return
*/
@AutoLog(value = "书籍表-添加")
@Operation(summary="书籍表-添加")
@RequiresPermissions("appletBooks:applet_books:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletBooks appletBooks) {
appletBooksService.save(appletBooks);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletBooks
* @return
*/
@AutoLog(value = "书籍表-编辑")
@Operation(summary="书籍表-编辑")
@RequiresPermissions("appletBooks:applet_books:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletBooks appletBooks) {
appletBooksService.updateById(appletBooks);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "书籍表-通过id删除")
@Operation(summary="书籍表-通过id删除")
@RequiresPermissions("appletBooks:applet_books:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletBooksService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "书籍表-批量删除")
@Operation(summary="书籍表-批量删除")
@RequiresPermissions("appletBooks:applet_books:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletBooksService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "书籍表-通过id查询")
@Operation(summary="书籍表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletBooks> queryById(@RequestParam(name="id",required=true) String id) {
AppletBooks appletBooks = appletBooksService.getById(id);
if(appletBooks==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletBooks);
}
/**
* 导出excel
*
* @param request
* @param appletBooks
*/
@RequiresPermissions("appletBooks:applet_books:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletBooks appletBooks) {
return super.exportXls(request, appletBooks, AppletBooks.class, "书籍表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletBooks:applet_books:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletBooks.class);
}
}

+ 91
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/entity/AppletBooks.java View File

@ -0,0 +1,91 @@
package org.jeecg.modules.demo.appletBooks.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Data
@TableName("applet_books")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="书籍表")
public class AppletBooks implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**书籍名称*/
@Excel(name = "书籍名称", width = 15)
@Schema(description = "书籍名称")
private java.lang.String booksName;
/**书籍封面*/
@Excel(name = "书籍封面", width = 15)
@Schema(description = "书籍封面")
private java.lang.String booksImg;
/**书籍作者*/
@Excel(name = "书籍作者", width = 15)
@Schema(description = "书籍作者")
private java.lang.String booksAuthor;
/**书籍简介*/
@Excel(name = "书籍简介", width = 15)
@Schema(description = "书籍简介")
private java.lang.String booksIntro;
/**书籍分类*/
@Excel(name = "书籍分类", width = 15)
@Schema(description = "书籍分类")
private java.lang.String booksClassification;
/**书籍标签*/
@Excel(name = "书籍标签", width = 15)
@Schema(description = "书籍标签")
private java.lang.String booksLabel;
/**上架*/
@Excel(name = "上架", width = 15,replace = {"上架_Y","下架_N"} )
@Schema(description = "上架")
private java.lang.String status;
/**会员*/
@Excel(name = "会员", width = 15)
@Schema(description = "会员")
private java.lang.String vip;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/mapper/AppletBooksMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletBooks.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
public interface AppletBooksMapper extends BaseMapper<AppletBooks> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/mapper/xml/AppletBooksMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletBooks.mapper.AppletBooksMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/IAppletBooksService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletBooks.service;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
public interface IAppletBooksService extends IService<AppletBooks> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/impl/AppletBooksServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletBooks.service.impl;
import org.jeecg.modules.demo.appletBooks.entity.AppletBooks;
import org.jeecg.modules.demo.appletBooks.mapper.AppletBooksMapper;
import org.jeecg.modules.demo.appletBooks.service.IAppletBooksService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Service
public class AppletBooksServiceImpl extends ServiceImpl<AppletBooksMapper, AppletBooks> implements IAppletBooksService {
}

+ 125
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp/AppletBooksForm.vue View File

@ -0,0 +1,125 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">书籍表</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍名称</text></view>
<input placeholder="请输入书籍名称" v-model="model.booksName"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍封面</text></view>
<input placeholder="请输入书籍封面" v-model="model.booksImg"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍作者</text></view>
<input placeholder="请输入书籍作者" v-model="model.booksAuthor"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍简介</text></view>
<input placeholder="请输入书籍简介" v-model="model.booksIntro"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍分类</text></view>
<input placeholder="请输入书籍分类" v-model="model.booksClassification"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍标签</text></view>
<input placeholder="请输入书籍标签" v-model="model.booksLabel"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">上架</text></view>
<input placeholder="请输入上架" v-model="model.status"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">会员</text></view>
<input placeholder="请输入会员" v-model="model.vip"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletBooksForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletBooks/appletBooks/queryById",
add: "/appletBooks/appletBooks/add",
edit: "/appletBooks/appletBooks/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp/AppletBooksList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">书籍表</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '书籍表',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletBooks/appletBooks/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 48
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksData.ts View File

@ -0,0 +1,48 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '书籍名称',
align:"center",
dataIndex: 'booksName'
},
{
title: '书籍封面',
align:"center",
dataIndex: 'booksImg',
customRender:render.renderImage,
},
{
title: '书籍作者',
align:"center",
dataIndex: 'booksAuthor'
},
{
title: '书籍简介',
align:"center",
dataIndex: 'booksIntro'
},
{
title: '书籍分类',
align:"center",
dataIndex: 'booksClassification'
},
{
title: '书籍标签',
align:"center",
dataIndex: 'booksLabel'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '会员',
align:"center",
dataIndex: 'vip'
},
];

+ 304
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksForm.vue View File

@ -0,0 +1,304 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '书籍表',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksName']"
:label="get4Label('书籍名称')"
name='booksName'
prop='booksName'
placeholder="请选择书籍名称"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<!-- 图片 -->
<wd-cell
:title="get4Label('书籍封面')"
title-width="100px"
>
<online-image
v-model:value="myFormData['booksImg']"
name='booksImg'
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksAuthor']"
:label="get4Label('书籍作者')"
name='booksAuthor'
prop='booksAuthor'
placeholder="请选择书籍作者"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksIntro']"
:label="get4Label('书籍简介')"
name='booksIntro'
prop='booksIntro'
placeholder="请选择书籍简介"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksClassification']"
:label="get4Label('书籍分类')"
name='booksClassification'
prop='booksClassification'
placeholder="请选择书籍分类"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksLabel']"
:label="get4Label('书籍标签')"
name='booksLabel'
prop='booksLabel'
placeholder="请选择书籍标签"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<!-- 开关 -->
<wd-cell
:label="get4Label('上架')"
name='status'
title-width="100px"
center
>
<wd-switch
:label="get4Label('上架')"
name='status'
size="18px"
v-model="myFormData['status']"
active-value="Y"
inactive-value="N"
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['vip']"
:label="get4Label('会员')"
name='vip'
prop='vip'
placeholder="请选择会员"
:rules="[
]"
clearable
/>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletBooksForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletBooksList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletBooks/appletBooks/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_books',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletBooks/appletBooks/edit':'/appletBooks/appletBooks/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '书籍表',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="书籍表" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletBooksData';
defineOptions({
name: 'AppletBooksList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletBooks/appletBooks/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletBooks/appletBooks/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletBooksForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletBooksForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooks.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletBooks/appletBooks/list',
save='/appletBooks/appletBooks/add',
edit='/appletBooks/appletBooks/edit',
deleteOne = '/appletBooks/appletBooks/delete',
deleteBatch = '/appletBooks/appletBooks/deleteBatch',
importExcel = '/appletBooks/appletBooks/importExcel',
exportXls = '/appletBooks/appletBooks/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 131
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooks.data.ts View File

@ -0,0 +1,131 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '书籍名称',
align:"center",
dataIndex: 'booksName'
},
{
title: '书籍封面',
align:"center",
dataIndex: 'booksImg',
customRender:render.renderImage,
},
{
title: '书籍作者',
align:"center",
dataIndex: 'booksAuthor'
},
{
title: '书籍简介',
align:"center",
dataIndex: 'booksIntro'
},
{
title: '书籍分类',
align:"center",
dataIndex: 'booksClassification'
},
{
title: '书籍标签',
align:"center",
dataIndex: 'booksLabel'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '会员',
align:"center",
dataIndex: 'vip'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '书籍名称',
field: 'booksName',
component: 'Input',
},
{
label: '书籍封面',
field: 'booksImg',
component: 'JImageUpload',
componentProps:{
fileMax: 0
},
},
{
label: '书籍作者',
field: 'booksAuthor',
component: 'Input',
},
{
label: '书籍简介',
field: 'booksIntro',
component: 'Input',
},
{
label: '书籍分类',
field: 'booksClassification',
component: 'Input',
},
{
label: '书籍标签',
field: 'booksLabel',
component: 'Input',
},
{
label: '上架',
field: 'status',
component: 'JSwitch',
componentProps:{
},
},
{
label: '会员',
field: 'vip',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
booksName: {title: '书籍名称',order: 0,view: 'text', type: 'string',},
booksImg: {title: '书籍封面',order: 1,view: 'image', type: 'string',},
booksAuthor: {title: '书籍作者',order: 2,view: 'text', type: 'string',},
booksIntro: {title: '书籍简介',order: 3,view: 'text', type: 'string',},
booksClassification: {title: '书籍分类',order: 4,view: 'text', type: 'string',},
booksLabel: {title: '书籍标签',order: 5,view: 'text', type: 'string',},
status: {title: '上架',order: 6,view: 'switch', type: 'string',},
vip: {title: '会员',order: 7,view: 'text', type: 'string',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooksList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletBooks:applet_books:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletBooks:applet_books:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletBooks:applet_books:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletBooks:applet_books:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletBooksModal @register="registerModal" @success="handleSuccess"></AppletBooksModal>
</div>
</template>
<script lang="ts" name="appletBooks-appletBooks" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletBooksModal from './components/AppletBooksModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletBooks.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletBooks.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '书籍表',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"书籍表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletBooks:applet_books:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletBooks:applet_books:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/V20250909_1__menu_insert_AppletBooks.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletBooks文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025090911258900260', NULL, '书籍表', '/appletBooks/appletBooksList', 'appletBooks/AppletBooksList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025090911258900261', '2025090911258900260', '添加书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025090911258900262', '2025090911258900260', '编辑书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025090911258900263', '2025090911258900260', '删除书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025090911258900264', '2025090911258900260', '批量删除书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025090911258900265', '2025090911258900260', '导出excel_书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025090911258900266', '2025090911258900260', '导入excel_书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:25:26', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/components/AppletBooksForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletBooks.data';
import {saveOrUpdate} from '../AppletBooks.api';
export default defineComponent({
name: "AppletBooksForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletBooks/appletBooks/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/components/AppletBooksModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletBooksForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletBooks.data';
import {saveOrUpdate} from '../AppletBooks.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 179
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/controller/AppletCategorizeController.java View File

@ -0,0 +1,179 @@
package org.jeecg.modules.demo.appletCategorize.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize;
import org.jeecg.modules.demo.appletCategorize.service.IAppletCategorizeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 分类表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Tag(name="分类表")
@RestController
@RequestMapping("/appletCategorize/appletCategorize")
@Slf4j
public class AppletCategorizeController extends JeecgController<AppletCategorize, IAppletCategorizeService> {
@Autowired
private IAppletCategorizeService appletCategorizeService;
/**
* 分页列表查询
*
* @param appletCategorize
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "分类表-分页列表查询")
@Operation(summary="分类表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletCategorize>> queryPageList(AppletCategorize appletCategorize,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletCategorize> queryWrapper = QueryGenerator.initQueryWrapper(appletCategorize, req.getParameterMap());
Page<AppletCategorize> page = new Page<AppletCategorize>(pageNo, pageSize);
IPage<AppletCategorize> pageList = appletCategorizeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletCategorize
* @return
*/
@AutoLog(value = "分类表-添加")
@Operation(summary="分类表-添加")
@RequiresPermissions("appletCategorize:applet_categorize:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletCategorize appletCategorize) {
appletCategorizeService.save(appletCategorize);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletCategorize
* @return
*/
@AutoLog(value = "分类表-编辑")
@Operation(summary="分类表-编辑")
@RequiresPermissions("appletCategorize:applet_categorize:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletCategorize appletCategorize) {
appletCategorizeService.updateById(appletCategorize);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "分类表-通过id删除")
@Operation(summary="分类表-通过id删除")
@RequiresPermissions("appletCategorize:applet_categorize:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletCategorizeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "分类表-批量删除")
@Operation(summary="分类表-批量删除")
@RequiresPermissions("appletCategorize:applet_categorize:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletCategorizeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "分类表-通过id查询")
@Operation(summary="分类表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletCategorize> queryById(@RequestParam(name="id",required=true) String id) {
AppletCategorize appletCategorize = appletCategorizeService.getById(id);
if(appletCategorize==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletCategorize);
}
/**
* 导出excel
*
* @param request
* @param appletCategorize
*/
@RequiresPermissions("appletCategorize:applet_categorize:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletCategorize appletCategorize) {
return super.exportXls(request, appletCategorize, AppletCategorize.class, "分类表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletCategorize:applet_categorize:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletCategorize.class);
}
}

+ 63
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/entity/AppletCategorize.java View File

@ -0,0 +1,63 @@
package org.jeecg.modules.demo.appletCategorize.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 分类表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Data
@TableName("applet_categorize")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="分类表")
public class AppletCategorize implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**标题*/
@Excel(name = "标题", width = 15)
@Schema(description = "标题")
private java.lang.String title;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/mapper/AppletCategorizeMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletCategorize.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 分类表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
public interface AppletCategorizeMapper extends BaseMapper<AppletCategorize> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/mapper/xml/AppletCategorizeMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletCategorize.mapper.AppletCategorizeMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/service/IAppletCategorizeService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletCategorize.service;
import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 分类表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
public interface IAppletCategorizeService extends IService<AppletCategorize> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/service/impl/AppletCategorizeServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletCategorize.service.impl;
import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize;
import org.jeecg.modules.demo.appletCategorize.mapper.AppletCategorizeMapper;
import org.jeecg.modules.demo.appletCategorize.service.IAppletCategorizeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 分类表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Version: V1.0
*/
@Service
public class AppletCategorizeServiceImpl extends ServiceImpl<AppletCategorizeMapper, AppletCategorize> implements IAppletCategorizeService {
}

+ 83
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp/AppletCategorizeForm.vue View File

@ -0,0 +1,83 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">分类表</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">标题</text></view>
<input placeholder="请输入标题" v-model="model.title"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletCategorizeForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletCategorize/appletCategorize/queryById",
add: "/appletCategorize/appletCategorize/add",
edit: "/appletCategorize/appletCategorize/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp/AppletCategorizeList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">分类表</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '分类表',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletCategorize/appletCategorize/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 9
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp3/AppletCategorizeData.ts View File

@ -0,0 +1,9 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '标题',
align:"center",
dataIndex: 'title'
},
];

+ 209
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp3/AppletCategorizeForm.vue View File

@ -0,0 +1,209 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '分类表',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['title']"
:label="get4Label('标题')"
name='title'
prop='title'
placeholder="请选择标题"
:rules="[
]"
clearable
/>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletCategorizeForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletCategorizeList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletCategorize/appletCategorize/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_categorize',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletCategorize/appletCategorize/edit':'/appletCategorize/appletCategorize/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/uniapp3/AppletCategorizeList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '分类表',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="分类表" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletCategorizeData';
defineOptions({
name: 'AppletCategorizeList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletCategorize/appletCategorize/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletCategorize/appletCategorize/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletCategorizeForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletCategorizeForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/AppletCategorize.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletCategorize/appletCategorize/list',
save='/appletCategorize/appletCategorize/add',
edit='/appletCategorize/appletCategorize/edit',
deleteOne = '/appletCategorize/appletCategorize/delete',
deleteBatch = '/appletCategorize/appletCategorize/deleteBatch',
importExcel = '/appletCategorize/appletCategorize/importExcel',
exportXls = '/appletCategorize/appletCategorize/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 45
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/AppletCategorize.data.ts View File

@ -0,0 +1,45 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '标题',
align:"center",
dataIndex: 'title'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'title',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
title: {title: '标题',order: 0,view: 'text', type: 'string',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/AppletCategorizeList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletCategorize:applet_categorize:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletCategorize:applet_categorize:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletCategorize:applet_categorize:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletCategorize:applet_categorize:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletCategorizeModal @register="registerModal" @success="handleSuccess"></AppletCategorizeModal>
</div>
</template>
<script lang="ts" name="appletCategorize-appletCategorize" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletCategorizeModal from './components/AppletCategorizeModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletCategorize.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletCategorize.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '分类表',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"分类表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletCategorize:applet_categorize:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletCategorize:applet_categorize:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/V20250909_1__menu_insert_AppletCategorize.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletCategorize文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('202509091113090110', NULL, '分类表', '/appletCategorize/appletCategorizeList', 'appletCategorize/AppletCategorizeList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202509091113090111', '202509091113090110', '添加分类表', NULL, NULL, 0, NULL, NULL, 2, 'appletCategorize:applet_categorize:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202509091113090112', '202509091113090110', '编辑分类表', NULL, NULL, 0, NULL, NULL, 2, 'appletCategorize:applet_categorize:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202509091113100113', '202509091113090110', '删除分类表', NULL, NULL, 0, NULL, NULL, 2, 'appletCategorize:applet_categorize:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202509091113100114', '202509091113090110', '批量删除分类表', NULL, NULL, 0, NULL, NULL, 2, 'appletCategorize:applet_categorize:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202509091113100115', '202509091113090110', '导出excel_分类表', NULL, NULL, 0, NULL, NULL, 2, 'appletCategorize:applet_categorize:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202509091113100116', '202509091113090110', '导入excel_分类表', NULL, NULL, 0, NULL, NULL, 2, 'appletCategorize:applet_categorize:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-09 23:13:11', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/components/AppletCategorizeForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletCategorize.data';
import {saveOrUpdate} from '../AppletCategorize.api';
export default defineComponent({
name: "AppletCategorizeForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletCategorize/appletCategorize/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCategorize/vue3/components/AppletCategorizeModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletCategorizeForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletCategorize.data';
import {saveOrUpdate} from '../AppletCategorize.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 182
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/controller/AppletLabelController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletLabel.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletLabel.entity.AppletLabel;
import org.jeecg.modules.demo.appletLabel.service.IAppletLabelService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 标签表
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Tag(name="标签表")
@RestController
@RequestMapping("/appletLabel/appletLabel")
@Slf4j
public class AppletLabelController extends JeecgController<AppletLabel, IAppletLabelService> {
@Autowired
private IAppletLabelService appletLabelService;
/**
* 分页列表查询
*
* @param appletLabel
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "标签表-分页列表查询")
@Operation(summary="标签表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletLabel>> queryPageList(AppletLabel appletLabel,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletLabel> queryWrapper = QueryGenerator.initQueryWrapper(appletLabel, req.getParameterMap());
Page<AppletLabel> page = new Page<AppletLabel>(pageNo, pageSize);
IPage<AppletLabel> pageList = appletLabelService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletLabel
* @return
*/
@AutoLog(value = "标签表-添加")
@Operation(summary="标签表-添加")
@RequiresPermissions("appletLabel:applet_label:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletLabel appletLabel) {
appletLabelService.save(appletLabel);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletLabel
* @return
*/
@AutoLog(value = "标签表-编辑")
@Operation(summary="标签表-编辑")
@RequiresPermissions("appletLabel:applet_label:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletLabel appletLabel) {
appletLabelService.updateById(appletLabel);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "标签表-通过id删除")
@Operation(summary="标签表-通过id删除")
@RequiresPermissions("appletLabel:applet_label:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletLabelService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "标签表-批量删除")
@Operation(summary="标签表-批量删除")
@RequiresPermissions("appletLabel:applet_label:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletLabelService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "标签表-通过id查询")
@Operation(summary="标签表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletLabel> queryById(@RequestParam(name="id",required=true) String id) {
AppletLabel appletLabel = appletLabelService.getById(id);
if(appletLabel==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletLabel);
}
/**
* 导出excel
*
* @param request
* @param appletLabel
*/
@RequiresPermissions("appletLabel:applet_label:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletLabel appletLabel) {
return super.exportXls(request, appletLabel, AppletLabel.class, "标签表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletLabel:applet_label:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletLabel.class);
}
}

+ 63
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/entity/AppletLabel.java View File

@ -0,0 +1,63 @@
package org.jeecg.modules.demo.appletLabel.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 标签表
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Data
@TableName("applet_label")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="标签表")
public class AppletLabel implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**标题*/
@Excel(name = "标题", width = 15)
@Schema(description = "标题")
private java.lang.String lable;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/mapper/AppletLabelMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletLabel.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletLabel.entity.AppletLabel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 标签表
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
public interface AppletLabelMapper extends BaseMapper<AppletLabel> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/mapper/xml/AppletLabelMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletLabel.mapper.AppletLabelMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/service/IAppletLabelService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletLabel.service;
import org.jeecg.modules.demo.appletLabel.entity.AppletLabel;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 标签表
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
public interface IAppletLabelService extends IService<AppletLabel> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/service/impl/AppletLabelServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletLabel.service.impl;
import org.jeecg.modules.demo.appletLabel.entity.AppletLabel;
import org.jeecg.modules.demo.appletLabel.mapper.AppletLabelMapper;
import org.jeecg.modules.demo.appletLabel.service.IAppletLabelService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 标签表
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Service
public class AppletLabelServiceImpl extends ServiceImpl<AppletLabelMapper, AppletLabel> implements IAppletLabelService {
}

+ 83
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp/AppletLabelForm.vue View File

@ -0,0 +1,83 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">标签表</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">标题</text></view>
<input placeholder="请输入标题" v-model="model.lable"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletLabelForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletLabel/appletLabel/queryById",
add: "/appletLabel/appletLabel/add",
edit: "/appletLabel/appletLabel/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp/AppletLabelList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">标签表</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '标签表',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletLabel/appletLabel/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 9
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp3/AppletLabelData.ts View File

@ -0,0 +1,9 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '标题',
align:"center",
dataIndex: 'lable'
},
];

+ 209
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp3/AppletLabelForm.vue View File

@ -0,0 +1,209 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '标签表',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['lable']"
:label="get4Label('标题')"
name='lable'
prop='lable'
placeholder="请选择标题"
:rules="[
]"
clearable
/>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletLabelForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletLabelList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletLabel/appletLabel/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_label',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletLabel/appletLabel/edit':'/appletLabel/appletLabel/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/uniapp3/AppletLabelList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '标签表',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="标签表" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletLabelData';
defineOptions({
name: 'AppletLabelList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletLabel/appletLabel/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletLabel/appletLabel/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletLabelForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletLabelForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/AppletLabel.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletLabel/appletLabel/list',
save='/appletLabel/appletLabel/add',
edit='/appletLabel/appletLabel/edit',
deleteOne = '/appletLabel/appletLabel/delete',
deleteBatch = '/appletLabel/appletLabel/deleteBatch',
importExcel = '/appletLabel/appletLabel/importExcel',
exportXls = '/appletLabel/appletLabel/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 45
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/AppletLabel.data.ts View File

@ -0,0 +1,45 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '标题',
align:"center",
dataIndex: 'lable'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'lable',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
lable: {title: '标题',order: 0,view: 'text', type: 'string',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/AppletLabelList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletLabel:applet_label:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletLabel:applet_label:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletLabel:applet_label:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletLabel:applet_label:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletLabelModal @register="registerModal" @success="handleSuccess"></AppletLabelModal>
</div>
</template>
<script lang="ts" name="appletLabel-appletLabel" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletLabelModal from './components/AppletLabelModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletLabel.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletLabel.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '标签表',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"标签表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletLabel:applet_label:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletLabel:applet_label:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/V20250910_1__menu_insert_AppletLabel.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletLabel文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091012294030070', NULL, '标签表', '/appletLabel/appletLabelList', 'appletLabel/AppletLabelList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091012294030071', '2025091012294030070', '添加标签表', NULL, NULL, 0, NULL, NULL, 2, 'appletLabel:applet_label:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091012294030072', '2025091012294030070', '编辑标签表', NULL, NULL, 0, NULL, NULL, 2, 'appletLabel:applet_label:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091012294030073', '2025091012294030070', '删除标签表', NULL, NULL, 0, NULL, NULL, 2, 'appletLabel:applet_label:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091012294030074', '2025091012294030070', '批量删除标签表', NULL, NULL, 0, NULL, NULL, 2, 'appletLabel:applet_label:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091012294030075', '2025091012294030070', '导出excel_标签表', NULL, NULL, 0, NULL, NULL, 2, 'appletLabel:applet_label:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091012294030076', '2025091012294030070', '导入excel_标签表', NULL, NULL, 0, NULL, NULL, 2, 'appletLabel:applet_label:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-10 12:29:07', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/components/AppletLabelForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletLabel.data';
import {saveOrUpdate} from '../AppletLabel.api';
export default defineComponent({
name: "AppletLabelForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletLabel/appletLabel/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLabel/vue3/components/AppletLabelModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletLabelForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletLabel.data';
import {saveOrUpdate} from '../AppletLabel.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 182
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/controller/AppletLinkController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletLink.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import org.jeecg.modules.demo.appletLink.service.IAppletLinkService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 首页底部内容链接
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Tag(name="首页底部内容链接")
@RestController
@RequestMapping("/appletLink/appletLink")
@Slf4j
public class AppletLinkController extends JeecgController<AppletLink, IAppletLinkService> {
@Autowired
private IAppletLinkService appletLinkService;
/**
* 分页列表查询
*
* @param appletLink
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "首页底部内容链接-分页列表查询")
@Operation(summary="首页底部内容链接-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletLink>> queryPageList(AppletLink appletLink,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletLink> queryWrapper = QueryGenerator.initQueryWrapper(appletLink, req.getParameterMap());
Page<AppletLink> page = new Page<AppletLink>(pageNo, pageSize);
IPage<AppletLink> pageList = appletLinkService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletLink
* @return
*/
@AutoLog(value = "首页底部内容链接-添加")
@Operation(summary="首页底部内容链接-添加")
@RequiresPermissions("appletLink:applet_link:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletLink appletLink) {
appletLinkService.save(appletLink);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletLink
* @return
*/
@AutoLog(value = "首页底部内容链接-编辑")
@Operation(summary="首页底部内容链接-编辑")
@RequiresPermissions("appletLink:applet_link:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletLink appletLink) {
appletLinkService.updateById(appletLink);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "首页底部内容链接-通过id删除")
@Operation(summary="首页底部内容链接-通过id删除")
@RequiresPermissions("appletLink:applet_link:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletLinkService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "首页底部内容链接-批量删除")
@Operation(summary="首页底部内容链接-批量删除")
@RequiresPermissions("appletLink:applet_link:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletLinkService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "首页底部内容链接-通过id查询")
@Operation(summary="首页底部内容链接-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletLink> queryById(@RequestParam(name="id",required=true) String id) {
AppletLink appletLink = appletLinkService.getById(id);
if(appletLink==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletLink);
}
/**
* 导出excel
*
* @param request
* @param appletLink
*/
@RequiresPermissions("appletLink:applet_link:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletLink appletLink) {
return super.exportXls(request, appletLink, AppletLink.class, "首页底部内容链接");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletLink:applet_link:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletLink.class);
}
}

+ 72
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/entity/AppletLink.java View File

@ -0,0 +1,72 @@
package org.jeecg.modules.demo.appletLink.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 首页底部内容链接
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Data
@TableName("applet_link")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="首页底部内容链接")
public class AppletLink implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**图片*/
@Excel(name = "图片", width = 15)
@Schema(description = "图片")
private java.lang.String img;
/**类型*/
@Excel(name = "类型", width = 15, dicCode = "applet_content_type")
@Dict(dicCode = "applet_content_type")
@Schema(description = "类型")
private java.lang.String type;
/**内容*/
@Excel(name = "内容", width = 15)
@Schema(description = "内容")
private java.lang.String content;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/mapper/AppletLinkMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletLink.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 首页底部内容链接
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
public interface AppletLinkMapper extends BaseMapper<AppletLink> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/mapper/xml/AppletLinkMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletLink.mapper.AppletLinkMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/service/IAppletLinkService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletLink.service;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 首页底部内容链接
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
public interface IAppletLinkService extends IService<AppletLink> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletLink/service/impl/AppletLinkServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletLink.service.impl;
import org.jeecg.modules.demo.appletLink.entity.AppletLink;
import org.jeecg.modules.demo.appletLink.mapper.AppletLinkMapper;
import org.jeecg.modules.demo.appletLink.service.IAppletLinkService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 首页底部内容链接
* @Author: jeecg-boot
* @Date: 2025-09-10
* @Version: V1.0
*/
@Service
public class AppletLinkServiceImpl extends ServiceImpl<AppletLinkMapper, AppletLink> implements IAppletLinkService {
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save