Browse Source

完成登录流程等功能

master
前端-胡立永 8 months ago
parent
commit
af5dd1be44
78 changed files with 5589 additions and 63 deletions
  1. +17
    -6
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiProductServiceImpl.java
  2. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/controller/AppletBannerController.java
  3. +5
    -5
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/entity/AppletBanner.java
  4. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/mapper/AppletBannerMapper.java
  5. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/service/IAppletBannerService.java
  6. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/service/impl/AppletBannerServiceImpl.java
  7. +2
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp/AppletBannerForm.vue
  8. +2
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerData.ts
  9. +5
    -5
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/uniapp3/AppletBannerForm.vue
  10. +5
    -5
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/AppletBanner.data.ts
  11. +7
    -7
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/V20250722_1__menu_insert_AppletBanner.sql
  12. +6
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/controller/AppletConfigController.java
  13. +3
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/entity/AppletConfig.java
  14. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/mapper/AppletConfigMapper.java
  15. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/service/IAppletConfigService.java
  16. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/service/impl/AppletConfigServiceImpl.java
  17. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/uniapp3/AppletConfigData.ts
  18. +8
    -11
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/uniapp3/AppletConfigForm.vue
  19. +27
    -3
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/vue3/AppletConfig.data.ts
  20. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/vue3/V20250722_1__menu_insert_AppletConfig.sql
  21. +6
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProduct/entity/AppletProduct.java
  22. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/controller/AppletProductSpecController.java
  23. +76
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/entity/AppletProductSpec.java
  24. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/mapper/AppletProductSpecMapper.java
  25. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/mapper/xml/AppletProductSpecMapper.xml
  26. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/service/IAppletProductSpecService.java
  27. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/service/impl/AppletProductSpecServiceImpl.java
  28. +107
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp/AppletProductSpecForm.vue
  29. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp/AppletProductSpecList.vue
  30. +29
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp3/AppletProductSpecData.ts
  31. +263
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp3/AppletProductSpecForm.vue
  32. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp3/AppletProductSpecList.vue
  33. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/AppletProductSpec.api.ts
  34. +89
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/AppletProductSpec.data.ts
  35. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/AppletProductSpecList.vue
  36. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/V20250722_1__menu_insert_AppletProductSpec.sql
  37. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/components/AppletProductSpecForm.vue
  38. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/components/AppletProductSpecModal.vue
  39. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/controller/AppletShippingAddressController.java
  40. +84
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/entity/AppletShippingAddress.java
  41. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/mapper/AppletShippingAddressMapper.java
  42. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/mapper/xml/AppletShippingAddressMapper.xml
  43. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/service/IAppletShippingAddressService.java
  44. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/service/impl/AppletShippingAddressServiceImpl.java
  45. +119
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp/AppletShippingAddressForm.vue
  46. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp/AppletShippingAddressList.vue
  47. +39
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp3/AppletShippingAddressData.ts
  48. +288
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp3/AppletShippingAddressForm.vue
  49. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp3/AppletShippingAddressList.vue
  50. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/AppletShippingAddress.api.ts
  51. +111
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/AppletShippingAddress.data.ts
  52. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/AppletShippingAddressList.vue
  53. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/V20250722_1__menu_insert_AppletShippingAddress.sql
  54. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/components/AppletShippingAddressForm.vue
  55. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/components/AppletShippingAddressModal.vue
  56. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/controller/AppletSubscribeDetectionController.java
  57. +117
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/entity/AppletSubscribeDetection.java
  58. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/AppletSubscribeDetectionMapper.java
  59. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/xml/AppletSubscribeDetectionMapper.xml
  60. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/IAppletSubscribeDetectionService.java
  61. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/service/impl/AppletSubscribeDetectionServiceImpl.java
  62. +156
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionForm.vue
  63. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionList.vue
  64. +74
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionData.ts
  65. +374
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionForm.vue
  66. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionList.vue
  67. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.api.ts
  68. +195
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.data.ts
  69. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetectionList.vue
  70. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/V20250722_1__menu_insert_AppletSubscribeDetection.sql
  71. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/components/AppletSubscribeDetectionForm.vue
  72. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/components/AppletSubscribeDetectionModal.vue
  73. +5
    -5
      jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  74. +64
    -0
      jeecgboot-vue3/src/views/applet/config/AppletConfig.api.ts
  75. +135
    -0
      jeecgboot-vue3/src/views/applet/config/AppletConfig.data.ts
  76. +268
    -0
      jeecgboot-vue3/src/views/applet/config/AppletConfigList.vue
  77. +70
    -0
      jeecgboot-vue3/src/views/applet/config/components/AppletConfigForm.vue
  78. +117
    -0
      jeecgboot-vue3/src/views/applet/config/components/AppletConfigModal.vue

+ 17
- 6
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiProductServiceImpl.java View File

@ -9,6 +9,8 @@ import org.jeecg.modules.demo.appletProduct.entity.AppletProduct;
import org.jeecg.modules.demo.appletProduct.service.IAppletProductService;
import org.jeecg.modules.demo.appletProductCategory.entity.AppletProductCategory;
import org.jeecg.modules.demo.appletProductCategory.service.IAppletProductCategoryService;
import org.jeecg.modules.demo.appletProductSpec.entity.AppletProductSpec;
import org.jeecg.modules.demo.appletProductSpec.service.IAppletProductSpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,15 +31,16 @@ public class AppletApiProductServiceImpl implements AppletApiProductService {
@Autowired
private IAppletProductCategoryService appletProductCategoryService;
@Autowired
private IAppletProductSpecService appletProductSpecService;
@Override
public IPage<AppletProduct> getProductPage(Page<AppletProduct> page, String type, String classId, String keyword) {
LambdaQueryWrapper<AppletProduct> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AppletProduct::getType, type);
if (StringUtils.isNotBlank(classId)) {
queryWrapper.eq(AppletProduct::getClassId, classId);
}
queryWrapper.eq(StringUtils.isNotBlank(classId), AppletProduct::getClassId, classId);
if (StringUtils.isNotBlank(keyword)) {
queryWrapper.and(wrapper -> wrapper
.like(AppletProduct::getName, keyword)
@ -54,7 +57,15 @@ public class AppletApiProductServiceImpl implements AppletApiProductService {
@Override
public AppletProduct getProductById(String id) {
return appletProductService.getById(id);
AppletProduct byId = appletProductService.getById(id);
byId.setSpecs(appletProductSpecService
.lambdaQuery()
.eq(AppletProductSpec::getProductId, id)
.list());
return byId;
}
@Override
@ -65,4 +76,4 @@ public class AppletApiProductServiceImpl implements AppletApiProductService {
return appletProductCategoryService.list(queryWrapper);
}
}
}

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

@ -41,7 +41,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: banner表
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
@Tag(name="banner表")


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

@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
/**
* @Description: banner表
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
@Data
@ -57,10 +57,10 @@ public class AppletBanner implements Serializable {
@Excel(name = "图片", width = 15)
@Schema(description = "图片")
private java.lang.String imageUrl;
/**跳转链接*/
@Excel(name = "跳转链接", width = 15)
@Schema(description = "跳转链接")
private java.lang.String linkUrl;
/**颜色*/
@Excel(name = "颜色", width = 15)
@Schema(description = "颜色")
private java.lang.String color;
/**排序*/
@Excel(name = "排序", width = 15)
@Schema(description = "排序")


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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: banner表
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface AppletBannerMapper extends BaseMapper<AppletBanner> {


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

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: banner表
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface IAppletBannerService extends IService<AppletBanner> {


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

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: banner表
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
@Service


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

@ -16,8 +16,8 @@
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">跳转链接</text></view>
<input placeholder="请输入跳转链接" v-model="model.linkUrl"/>
<view class="title"><text space="ensp">颜色</text></view>
<input placeholder="请输入颜色" v-model="model.color"/>
</view>
</view>
<view class="cu-form-group">


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

@ -8,9 +8,9 @@ export const columns = [
customRender:render.renderImage,
},
{
title: '跳转链接',
title: '颜色',
align:"center",
dataIndex: 'linkUrl'
dataIndex: 'color'
},
{
title: '排序',


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

@ -28,11 +28,11 @@ navigationBarTitleText: 'banner表',
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['linkUrl']"
:label="get4Label('跳转链接')"
name='linkUrl'
prop='linkUrl'
placeholder="请选择跳转链接"
v-model="myFormData['color']"
:label="get4Label('颜色')"
name='color'
prop='color'
placeholder="请选择颜色"
:rules="[
]"
clearable


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

@ -12,9 +12,9 @@ export const columns: BasicColumn[] = [
customRender:render.renderImage,
},
{
title: '跳转链接',
title: '颜色',
align:"center",
dataIndex: 'linkUrl'
dataIndex: 'color'
},
{
title: '排序',
@ -41,8 +41,8 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '跳转链接',
field: 'linkUrl',
label: '颜色',
field: 'color',
component: 'Input',
},
{
@ -67,7 +67,7 @@ export const formSchema: FormSchema[] = [
// 高级查询数据
export const superQuerySchema = {
imageUrl: {title: '图片',order: 0,view: 'image', type: 'string',},
linkUrl: {title: '跳转链接',order: 1,view: 'text', type: 'string',},
color: {title: '颜色',order: 1,view: 'text', type: 'string',},
sortOrder: {title: '排序',order: 2,view: 'number', type: 'number',},
type: {title: '类型',order: 3,view: 'text', type: 'string',},
};


jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/V20250721_1__menu_insert_AppletBanner.sql → jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBanner/vue3/V20250722_1__menu_insert_AppletBanner.sql View File

@ -3,24 +3,24 @@
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 ('2025072111545010460', NULL, 'banner表', '/appletBanner/appletBannerList', 'appletBanner/AppletBannerList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0);
VALUES ('2025072202489280360', NULL, 'banner表', '/appletBanner/appletBannerList', 'appletBanner/AppletBannerList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-22 14:48:36', 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 ('2025072111545010461', '2025072111545010460', '添加banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0, 0, '1', 0);
VALUES ('2025072202489280361', '2025072202489280360', '添加banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:36', 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 ('2025072111545010462', '2025072111545010460', '编辑banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0, 0, '1', 0);
VALUES ('2025072202489280362', '2025072202489280360', '编辑banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:36', 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 ('2025072111545010463', '2025072111545010460', '删除banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0, 0, '1', 0);
VALUES ('2025072202489280363', '2025072202489280360', '删除banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:36', 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 ('2025072111545010464', '2025072111545010460', '批量删除banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0, 0, '1', 0);
VALUES ('2025072202489280364', '2025072202489280360', '批量删除banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:36', 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 ('2025072111545010465', '2025072111545010460', '导出excel_banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0, 0, '1', 0);
VALUES ('2025072202489280365', '2025072202489280360', '导出excel_banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:36', 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 ('2025072111545010466', '2025072111545010460', '导入excel_banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-21 11:54:46', NULL, NULL, 0, 0, '1', 0);
VALUES ('2025072202489280366', '2025072202489280360', '导入excel_banner表', NULL, NULL, 0, NULL, NULL, 2, 'appletBanner:applet_banner:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:36', NULL, NULL, 0, 0, '1', 0);

+ 6
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/controller/AppletConfigController.java View File

@ -41,7 +41,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 小程序配置
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
@Tag(name="小程序配置")
@ -70,7 +70,11 @@ public class AppletConfigController extends JeecgController<AppletConfig, IApple
HttpServletRequest req) {
QueryWrapper<AppletConfig> queryWrapper = QueryGenerator.initQueryWrapper(appletConfig, req.getParameterMap());
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为LIKE_WITH_OR
customeRuleMap.put("type", QueryRuleEnum.LIKE_WITH_OR);
QueryWrapper<AppletConfig> queryWrapper = QueryGenerator.initQueryWrapper(appletConfig, req.getParameterMap(),customeRuleMap);
Page<AppletConfig> page = new Page<AppletConfig>(pageNo, pageSize);
IPage<AppletConfig> pageList = appletConfigService.page(page, queryWrapper);
return Result.OK(pageList);


+ 3
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/entity/AppletConfig.java View File

@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 小程序配置
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
@Data
@ -69,7 +69,8 @@ public class AppletConfig implements Serializable {
@Schema(description = "内容")
private java.lang.String content;
/**类型*/
@Excel(name = "类型", width = 15)
@Excel(name = "类型", width = 15, dicCode = "applett_config_type")
@Dict(dicCode = "applett_config_type")
@Schema(description = "类型")
private java.lang.String type;
}

+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/mapper/AppletConfigMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 小程序配置
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface AppletConfigMapper extends BaseMapper<AppletConfig> {


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/service/IAppletConfigService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 小程序配置
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface IAppletConfigService extends IService<AppletConfig> {


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/service/impl/AppletConfigServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 小程序配置
* @Author: jeecg-boot
* @Date: 2025-07-21
* @Date: 2025-07-22
* @Version: V1.0
*/
@Service


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/uniapp3/AppletConfigData.ts View File

@ -19,6 +19,6 @@ export const columns = [
{
title: '类型',
align:"center",
dataIndex: 'type'
dataIndex: 'type_dictText'
},
];

+ 8
- 11
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/uniapp3/AppletConfigForm.vue View File

@ -53,17 +53,14 @@ navigationBarTitleText: '小程序配置',
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['type']"
:label="get4Label('类型')"
name='type'
prop='type'
placeholder="请选择类型"
:rules="[
]"
clearable
/>
<online-select
:label="get4Label('类型')"
labelWidth="100px"
type="list"
name='type'
dict="applett_config_type"
v-model="myFormData['type']"
></online-select>
</view>
</wd-cell-group>
</wd-form>


+ 27
- 3
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletConfig/vue3/AppletConfig.data.ts View File

@ -23,11 +23,32 @@ export const columns: BasicColumn[] = [
{
title: '类型',
align:"center",
dataIndex: 'type'
dataIndex: 'type_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "编码",
field: 'code',
component: 'Input',
//colProps: {span: 6},
},
{
label: "描述",
field: 'info',
component: 'Input',
//colProps: {span: 6},
},
{
label: "类型",
field: 'type',
component: 'JSelectMultiple',
componentProps:{
dictCode:"applett_config_type"
},
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -49,7 +70,10 @@ export const formSchema: FormSchema[] = [
{
label: '类型',
field: 'type',
component: 'Input',
component: 'JDictSelectTag',
componentProps:{
dictCode:"applett_config_type"
},
},
// TODO 主键隐藏字段,目前写死为ID
{
@ -65,7 +89,7 @@ export const superQuerySchema = {
code: {title: '编码',order: 0,view: 'text', type: 'string',},
info: {title: '描述',order: 1,view: 'text', type: 'string',},
content: {title: '内容',order: 2,view: 'text', type: 'string',},
type: {title: '类型',order: 3,view: 'text', type: 'string',},
type: {title: '类型',order: 3,view: 'list', type: 'string',dictCode: 'applett_config_type',},
};
/**


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

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletConfig文件夹下
-- 如果你想更改到其他目录,请修改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 ('2025072204037970240', NULL, '小程序配置', '/appletConfig/appletConfigList', 'appletConfig/AppletConfigList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-22 16:03:24', 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 ('2025072204037970241', '2025072204037970240', '添加小程序配置', NULL, NULL, 0, NULL, NULL, 2, 'appletConfig:applet_config:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 16:03:24', 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 ('2025072204037970242', '2025072204037970240', '编辑小程序配置', NULL, NULL, 0, NULL, NULL, 2, 'appletConfig:applet_config:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 16:03:24', 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 ('2025072204037970243', '2025072204037970240', '删除小程序配置', NULL, NULL, 0, NULL, NULL, 2, 'appletConfig:applet_config:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 16:03:24', 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 ('2025072204037970244', '2025072204037970240', '批量删除小程序配置', NULL, NULL, 0, NULL, NULL, 2, 'appletConfig:applet_config:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 16:03:24', 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 ('2025072204037970245', '2025072204037970240', '导出excel_小程序配置', NULL, NULL, 0, NULL, NULL, 2, 'appletConfig:applet_config:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 16:03:24', 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 ('2025072204037970246', '2025072204037970240', '导入excel_小程序配置', NULL, NULL, 0, NULL, NULL, 2, 'appletConfig:applet_config:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 16:03:24', NULL, NULL, 0, 0, '1', 0);

+ 6
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProduct/entity/AppletProduct.java View File

@ -4,6 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@ -12,6 +14,7 @@ import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.appletProductSpec.entity.AppletProductSpec;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
@ -95,4 +98,7 @@ public class AppletProduct implements Serializable {
@Excel(name = "产品内容", width = 15)
@Schema(description = "产品内容")
private java.lang.String content;
private List<AppletProductSpec> specs;
}

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

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletProductSpec.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.appletProductSpec.entity.AppletProductSpec;
import org.jeecg.modules.demo.appletProductSpec.service.IAppletProductSpecService;
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-07-22
* @Version: V1.0
*/
@Tag(name="产品规格表")
@RestController
@RequestMapping("/appletProductSpec/appletProductSpec")
@Slf4j
public class AppletProductSpecController extends JeecgController<AppletProductSpec, IAppletProductSpecService> {
@Autowired
private IAppletProductSpecService appletProductSpecService;
/**
* 分页列表查询
*
* @param appletProductSpec
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "产品规格表-分页列表查询")
@Operation(summary="产品规格表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletProductSpec>> queryPageList(AppletProductSpec appletProductSpec,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletProductSpec> queryWrapper = QueryGenerator.initQueryWrapper(appletProductSpec, req.getParameterMap());
Page<AppletProductSpec> page = new Page<AppletProductSpec>(pageNo, pageSize);
IPage<AppletProductSpec> pageList = appletProductSpecService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletProductSpec
* @return
*/
@AutoLog(value = "产品规格表-添加")
@Operation(summary="产品规格表-添加")
@RequiresPermissions("appletProductSpec:applet_product_spec:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletProductSpec appletProductSpec) {
appletProductSpecService.save(appletProductSpec);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletProductSpec
* @return
*/
@AutoLog(value = "产品规格表-编辑")
@Operation(summary="产品规格表-编辑")
@RequiresPermissions("appletProductSpec:applet_product_spec:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletProductSpec appletProductSpec) {
appletProductSpecService.updateById(appletProductSpec);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "产品规格表-通过id删除")
@Operation(summary="产品规格表-通过id删除")
@RequiresPermissions("appletProductSpec:applet_product_spec:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletProductSpecService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "产品规格表-批量删除")
@Operation(summary="产品规格表-批量删除")
@RequiresPermissions("appletProductSpec:applet_product_spec:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletProductSpecService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "产品规格表-通过id查询")
@Operation(summary="产品规格表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletProductSpec> queryById(@RequestParam(name="id",required=true) String id) {
AppletProductSpec appletProductSpec = appletProductSpecService.getById(id);
if(appletProductSpec==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletProductSpec);
}
/**
* 导出excel
*
* @param request
* @param appletProductSpec
*/
@RequiresPermissions("appletProductSpec:applet_product_spec:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletProductSpec appletProductSpec) {
return super.exportXls(request, appletProductSpec, AppletProductSpec.class, "产品规格表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletProductSpec:applet_product_spec:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletProductSpec.class);
}
}

+ 76
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/entity/AppletProductSpec.java View File

@ -0,0 +1,76 @@
package org.jeecg.modules.demo.appletProductSpec.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-07-22
* @Version: V1.0
*/
@Data
@TableName("applet_product_spec")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="产品规格表")
public class AppletProductSpec 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;
/**规格名称*/
@Excel(name = "规格名称", width = 15)
@Schema(description = "规格名称")
private java.lang.String specName;
/**规格值*/
@Excel(name = "规格值", width = 15)
@Schema(description = "规格值")
private java.lang.String specValue;
/**排序*/
@Excel(name = "排序", width = 15)
@Schema(description = "排序")
private java.lang.Integer sortOrder;
/**产品*/
@Excel(name = "产品", width = 15)
@Schema(description = "产品")
private java.lang.String productId;
/**价格*/
@Excel(name = "价格", width = 15)
@Schema(description = "价格")
private java.math.BigDecimal price;
}

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

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletProductSpec.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletProductSpec.entity.AppletProductSpec;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 产品规格表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface AppletProductSpecMapper extends BaseMapper<AppletProductSpec> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/mapper/xml/AppletProductSpecMapper.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.appletProductSpec.mapper.AppletProductSpecMapper">
</mapper>

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

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletProductSpec.service;
import org.jeecg.modules.demo.appletProductSpec.entity.AppletProductSpec;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 产品规格表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface IAppletProductSpecService extends IService<AppletProductSpec> {
}

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

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletProductSpec.service.impl;
import org.jeecg.modules.demo.appletProductSpec.entity.AppletProductSpec;
import org.jeecg.modules.demo.appletProductSpec.mapper.AppletProductSpecMapper;
import org.jeecg.modules.demo.appletProductSpec.service.IAppletProductSpecService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 产品规格表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
@Service
public class AppletProductSpecServiceImpl extends ServiceImpl<AppletProductSpecMapper, AppletProductSpec> implements IAppletProductSpecService {
}

+ 107
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp/AppletProductSpecForm.vue View File

@ -0,0 +1,107 @@
<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.specName"/>
</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.specValue"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">排序</text></view>
<input type="number" placeholder="请输入排序" v-model="model.sortOrder"/>
</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.productId"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">价格</text></view>
<input type="number" placeholder="请输入价格" v-model="model.price"/>
</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: "AppletProductSpecForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletProductSpec/appletProductSpec/queryById",
add: "/appletProductSpec/appletProductSpec/add",
edit: "/appletProductSpec/appletProductSpec/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/appletProductSpec/uniapp/AppletProductSpecList.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: "/appletProductSpec/appletProductSpec/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 29
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp3/AppletProductSpecData.ts View File

@ -0,0 +1,29 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '规格名称',
align:"center",
dataIndex: 'specName'
},
{
title: '规格值',
align:"center",
dataIndex: 'specValue'
},
{
title: '排序',
align:"center",
dataIndex: 'sortOrder'
},
{
title: '产品',
align:"center",
dataIndex: 'productId'
},
{
title: '价格',
align:"center",
dataIndex: 'price'
},
];

+ 263
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/uniapp3/AppletProductSpecForm.vue View File

@ -0,0 +1,263 @@
<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['specName']"
:label="get4Label('规格名称')"
name='specName'
prop='specName'
placeholder="请选择规格名称"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['specValue']"
:label="get4Label('规格值')"
name='specValue'
prop='specValue'
placeholder="请选择规格值"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sortOrder']"
:label="get4Label('排序')"
name='sortOrder'
prop='sortOrder'
placeholder="请选择排序"
inputMode="numeric"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['productId']"
:label="get4Label('产品')"
name='productId'
prop='productId'
placeholder="请选择产品"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['price']"
:label="get4Label('价格')"
name='price'
prop='price'
placeholder="请选择价格"
inputMode="numeric"
: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: 'AppletProductSpecForm',
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('AppletProductSpecList')
// 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("/appletProductSpec/appletProductSpec/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_product_spec',
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?'/appletProductSpec/appletProductSpec/edit':'/appletProductSpec/appletProductSpec/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/appletProductSpec/uniapp3/AppletProductSpecList.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 './AppletProductSpecData';
defineOptions({
name: 'AppletProductSpecList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletProductSpec/appletProductSpec/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletProductSpec/appletProductSpec/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletProductSpecForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletProductSpecForm',
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/appletProductSpec/vue3/AppletProductSpec.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 = '/appletProductSpec/appletProductSpec/list',
save='/appletProductSpec/appletProductSpec/add',
edit='/appletProductSpec/appletProductSpec/edit',
deleteOne = '/appletProductSpec/appletProductSpec/delete',
deleteBatch = '/appletProductSpec/appletProductSpec/deleteBatch',
importExcel = '/appletProductSpec/appletProductSpec/importExcel',
exportXls = '/appletProductSpec/appletProductSpec/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});
}

+ 89
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/AppletProductSpec.data.ts View File

@ -0,0 +1,89 @@
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: 'specName'
},
{
title: '规格值',
align:"center",
dataIndex: 'specValue'
},
{
title: '排序',
align:"center",
dataIndex: 'sortOrder'
},
{
title: '产品',
align:"center",
dataIndex: 'productId'
},
{
title: '价格',
align:"center",
dataIndex: 'price'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '规格名称',
field: 'specName',
component: 'Input',
},
{
label: '规格值',
field: 'specValue',
component: 'Input',
},
{
label: '排序',
field: 'sortOrder',
component: 'InputNumber',
},
{
label: '产品',
field: 'productId',
component: 'Input',
},
{
label: '价格',
field: 'price',
component: 'InputNumber',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
specName: {title: '规格名称',order: 0,view: 'text', type: 'string',},
specValue: {title: '规格值',order: 1,view: 'text', type: 'string',},
sortOrder: {title: '排序',order: 2,view: 'number', type: 'number',},
productId: {title: '产品',order: 3,view: 'text', type: 'string',},
price: {title: '价格',order: 4,view: 'number', type: 'number',},
};
/**
* 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/appletProductSpec/vue3/AppletProductSpecList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletProductSpec:applet_product_spec:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletProductSpec:applet_product_spec:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletProductSpec:applet_product_spec: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="'appletProductSpec:applet_product_spec: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>
<!-- 表单区域 -->
<AppletProductSpecModal @register="registerModal" @success="handleSuccess"></AppletProductSpecModal>
</div>
</template>
<script lang="ts" name="appletProductSpec-appletProductSpec" 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 AppletProductSpecModal from './components/AppletProductSpecModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletProductSpec.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletProductSpec.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: 'appletProductSpec:applet_product_spec:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletProductSpec:applet_product_spec: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/appletProductSpec/vue3/V20250722_1__menu_insert_AppletProductSpec.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletProductSpec文件夹下
-- 如果你想更改到其他目录,请修改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 ('202507220255460380', NULL, '产品规格表', '/appletProductSpec/appletProductSpecList', 'appletProductSpec/AppletProductSpecList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-22 14:55:38', 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 ('202507220255460381', '202507220255460380', '添加产品规格表', NULL, NULL, 0, NULL, NULL, 2, 'appletProductSpec:applet_product_spec:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:55:38', 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 ('202507220255460382', '202507220255460380', '编辑产品规格表', NULL, NULL, 0, NULL, NULL, 2, 'appletProductSpec:applet_product_spec:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:55:38', 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 ('202507220255460383', '202507220255460380', '删除产品规格表', NULL, NULL, 0, NULL, NULL, 2, 'appletProductSpec:applet_product_spec:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:55:38', 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 ('202507220255460384', '202507220255460380', '批量删除产品规格表', NULL, NULL, 0, NULL, NULL, 2, 'appletProductSpec:applet_product_spec:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:55:38', 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 ('202507220255460385', '202507220255460380', '导出excel_产品规格表', NULL, NULL, 0, NULL, NULL, 2, 'appletProductSpec:applet_product_spec:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:55:38', 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 ('202507220255460386', '202507220255460380', '导入excel_产品规格表', NULL, NULL, 0, NULL, NULL, 2, 'appletProductSpec:applet_product_spec:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:55:38', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletProductSpec/vue3/components/AppletProductSpecForm.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 '../AppletProductSpec.data';
import {saveOrUpdate} from '../AppletProductSpec.api';
export default defineComponent({
name: "AppletProductSpecForm",
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 = '/appletProductSpec/appletProductSpec/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/appletProductSpec/vue3/components/AppletProductSpecModal.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="AppletProductSpecForm" />
</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 '../AppletProductSpec.data';
import {saveOrUpdate} from '../AppletProductSpec.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/appletShippingAddress/controller/AppletShippingAddressController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletShippingAddress.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.appletShippingAddress.entity.AppletShippingAddress;
import org.jeecg.modules.demo.appletShippingAddress.service.IAppletShippingAddressService;
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-07-22
* @Version: V1.0
*/
@Tag(name="小程序收货地址")
@RestController
@RequestMapping("/appletShippingAddress/appletShippingAddress")
@Slf4j
public class AppletShippingAddressController extends JeecgController<AppletShippingAddress, IAppletShippingAddressService> {
@Autowired
private IAppletShippingAddressService appletShippingAddressService;
/**
* 分页列表查询
*
* @param appletShippingAddress
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "小程序收货地址-分页列表查询")
@Operation(summary="小程序收货地址-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletShippingAddress>> queryPageList(AppletShippingAddress appletShippingAddress,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletShippingAddress> queryWrapper = QueryGenerator.initQueryWrapper(appletShippingAddress, req.getParameterMap());
Page<AppletShippingAddress> page = new Page<AppletShippingAddress>(pageNo, pageSize);
IPage<AppletShippingAddress> pageList = appletShippingAddressService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletShippingAddress
* @return
*/
@AutoLog(value = "小程序收货地址-添加")
@Operation(summary="小程序收货地址-添加")
@RequiresPermissions("appletShippingAddress:applet_shipping_address:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletShippingAddress appletShippingAddress) {
appletShippingAddressService.save(appletShippingAddress);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletShippingAddress
* @return
*/
@AutoLog(value = "小程序收货地址-编辑")
@Operation(summary="小程序收货地址-编辑")
@RequiresPermissions("appletShippingAddress:applet_shipping_address:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletShippingAddress appletShippingAddress) {
appletShippingAddressService.updateById(appletShippingAddress);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "小程序收货地址-通过id删除")
@Operation(summary="小程序收货地址-通过id删除")
@RequiresPermissions("appletShippingAddress:applet_shipping_address:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletShippingAddressService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "小程序收货地址-批量删除")
@Operation(summary="小程序收货地址-批量删除")
@RequiresPermissions("appletShippingAddress:applet_shipping_address:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletShippingAddressService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "小程序收货地址-通过id查询")
@Operation(summary="小程序收货地址-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletShippingAddress> queryById(@RequestParam(name="id",required=true) String id) {
AppletShippingAddress appletShippingAddress = appletShippingAddressService.getById(id);
if(appletShippingAddress==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletShippingAddress);
}
/**
* 导出excel
*
* @param request
* @param appletShippingAddress
*/
@RequiresPermissions("appletShippingAddress:applet_shipping_address:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletShippingAddress appletShippingAddress) {
return super.exportXls(request, appletShippingAddress, AppletShippingAddress.class, "小程序收货地址");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletShippingAddress:applet_shipping_address:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletShippingAddress.class);
}
}

+ 84
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/entity/AppletShippingAddress.java View File

@ -0,0 +1,84 @@
package org.jeecg.modules.demo.appletShippingAddress.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-07-22
* @Version: V1.0
*/
@Data
@TableName("applet_shipping_address")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="小程序收货地址")
public class AppletShippingAddress 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;
/**收货人姓名*/
@Excel(name = "收货人姓名", width = 15)
@Schema(description = "收货人姓名")
private java.lang.String name;
/**收货人电话*/
@Excel(name = "收货人电话", width = 15)
@Schema(description = "收货人电话")
private java.lang.String phone;
/**省份*/
@Excel(name = "省份", width = 15)
@Schema(description = "省份")
private java.lang.String province;
/**城市*/
@Excel(name = "城市", width = 15)
@Schema(description = "城市")
private java.lang.String city;
/**区县*/
@Excel(name = "区县", width = 15)
@Schema(description = "区县")
private java.lang.String district;
/**详细地址*/
@Excel(name = "详细地址", width = 15)
@Schema(description = "详细地址")
private java.lang.String detail;
/**是否默认*/
@Excel(name = "是否默认", width = 15)
@Schema(description = "是否默认")
private java.lang.Integer defaultFlag;
}

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

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletShippingAddress.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletShippingAddress.entity.AppletShippingAddress;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 小程序收货地址
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface AppletShippingAddressMapper extends BaseMapper<AppletShippingAddress> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/mapper/xml/AppletShippingAddressMapper.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.appletShippingAddress.mapper.AppletShippingAddressMapper">
</mapper>

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

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletShippingAddress.service;
import org.jeecg.modules.demo.appletShippingAddress.entity.AppletShippingAddress;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 小程序收货地址
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface IAppletShippingAddressService extends IService<AppletShippingAddress> {
}

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

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletShippingAddress.service.impl;
import org.jeecg.modules.demo.appletShippingAddress.entity.AppletShippingAddress;
import org.jeecg.modules.demo.appletShippingAddress.mapper.AppletShippingAddressMapper;
import org.jeecg.modules.demo.appletShippingAddress.service.IAppletShippingAddressService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 小程序收货地址
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
@Service
public class AppletShippingAddressServiceImpl extends ServiceImpl<AppletShippingAddressMapper, AppletShippingAddress> implements IAppletShippingAddressService {
}

+ 119
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp/AppletShippingAddressForm.vue View File

@ -0,0 +1,119 @@
<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.name"/>
</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.phone"/>
</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.province"/>
</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.city"/>
</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.district"/>
</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.detail"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">是否默认</text></view>
<input type="number" placeholder="请输入是否默认" v-model="model.defaultFlag"/>
</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: "AppletShippingAddressForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletShippingAddress/appletShippingAddress/queryById",
add: "/appletShippingAddress/appletShippingAddress/add",
edit: "/appletShippingAddress/appletShippingAddress/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/appletShippingAddress/uniapp/AppletShippingAddressList.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: "/appletShippingAddress/appletShippingAddress/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 39
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp3/AppletShippingAddressData.ts View File

@ -0,0 +1,39 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '收货人姓名',
align:"center",
dataIndex: 'name'
},
{
title: '收货人电话',
align:"center",
dataIndex: 'phone'
},
{
title: '省份',
align:"center",
dataIndex: 'province'
},
{
title: '城市',
align:"center",
dataIndex: 'city'
},
{
title: '区县',
align:"center",
dataIndex: 'district'
},
{
title: '详细地址',
align:"center",
dataIndex: 'detail'
},
{
title: '是否默认',
align:"center",
dataIndex: 'defaultFlag'
},
];

+ 288
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/uniapp3/AppletShippingAddressForm.vue View File

@ -0,0 +1,288 @@
<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['name']"
:label="get4Label('收货人姓名')"
name='name'
prop='name'
placeholder="请选择收货人姓名"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['phone']"
:label="get4Label('收货人电话')"
name='phone'
prop='phone'
placeholder="请选择收货人电话"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['province']"
:label="get4Label('省份')"
name='province'
prop='province'
placeholder="请选择省份"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['city']"
:label="get4Label('城市')"
name='city'
prop='city'
placeholder="请选择城市"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['district']"
:label="get4Label('区县')"
name='district'
prop='district'
placeholder="请选择区县"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['detail']"
:label="get4Label('详细地址')"
name='detail'
prop='detail'
placeholder="请选择详细地址"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['defaultFlag']"
:label="get4Label('是否默认')"
name='defaultFlag'
prop='defaultFlag'
placeholder="请选择是否默认"
inputMode="numeric"
: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: 'AppletShippingAddressForm',
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('AppletShippingAddressList')
// 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("/appletShippingAddress/appletShippingAddress/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_shipping_address',
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?'/appletShippingAddress/appletShippingAddress/edit':'/appletShippingAddress/appletShippingAddress/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/appletShippingAddress/uniapp3/AppletShippingAddressList.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 './AppletShippingAddressData';
defineOptions({
name: 'AppletShippingAddressList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletShippingAddress/appletShippingAddress/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletShippingAddress/appletShippingAddress/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletShippingAddressForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletShippingAddressForm',
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/appletShippingAddress/vue3/AppletShippingAddress.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 = '/appletShippingAddress/appletShippingAddress/list',
save='/appletShippingAddress/appletShippingAddress/add',
edit='/appletShippingAddress/appletShippingAddress/edit',
deleteOne = '/appletShippingAddress/appletShippingAddress/delete',
deleteBatch = '/appletShippingAddress/appletShippingAddress/deleteBatch',
importExcel = '/appletShippingAddress/appletShippingAddress/importExcel',
exportXls = '/appletShippingAddress/appletShippingAddress/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});
}

+ 111
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/AppletShippingAddress.data.ts View File

@ -0,0 +1,111 @@
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: 'name'
},
{
title: '收货人电话',
align:"center",
dataIndex: 'phone'
},
{
title: '省份',
align:"center",
dataIndex: 'province'
},
{
title: '城市',
align:"center",
dataIndex: 'city'
},
{
title: '区县',
align:"center",
dataIndex: 'district'
},
{
title: '详细地址',
align:"center",
dataIndex: 'detail'
},
{
title: '是否默认',
align:"center",
dataIndex: 'defaultFlag'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '收货人姓名',
field: 'name',
component: 'Input',
},
{
label: '收货人电话',
field: 'phone',
component: 'Input',
},
{
label: '省份',
field: 'province',
component: 'Input',
},
{
label: '城市',
field: 'city',
component: 'Input',
},
{
label: '区县',
field: 'district',
component: 'Input',
},
{
label: '详细地址',
field: 'detail',
component: 'Input',
},
{
label: '是否默认',
field: 'defaultFlag',
component: 'InputNumber',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
name: {title: '收货人姓名',order: 0,view: 'text', type: 'string',},
phone: {title: '收货人电话',order: 1,view: 'text', type: 'string',},
province: {title: '省份',order: 2,view: 'text', type: 'string',},
city: {title: '城市',order: 3,view: 'text', type: 'string',},
district: {title: '区县',order: 4,view: 'text', type: 'string',},
detail: {title: '详细地址',order: 5,view: 'text', type: 'string',},
defaultFlag: {title: '是否默认',order: 6,view: 'number', type: 'number',},
};
/**
* 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/appletShippingAddress/vue3/AppletShippingAddressList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletShippingAddress:applet_shipping_address:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletShippingAddress:applet_shipping_address:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletShippingAddress:applet_shipping_address: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="'appletShippingAddress:applet_shipping_address: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>
<!-- 表单区域 -->
<AppletShippingAddressModal @register="registerModal" @success="handleSuccess"></AppletShippingAddressModal>
</div>
</template>
<script lang="ts" name="appletShippingAddress-appletShippingAddress" 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 AppletShippingAddressModal from './components/AppletShippingAddressModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletShippingAddress.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletShippingAddress.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: 'appletShippingAddress:applet_shipping_address:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletShippingAddress:applet_shipping_address: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/appletShippingAddress/vue3/V20250722_1__menu_insert_AppletShippingAddress.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletShippingAddress文件夹下
-- 如果你想更改到其他目录,请修改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 ('2025072202483670510', NULL, '小程序收货地址', '/appletShippingAddress/appletShippingAddressList', 'appletShippingAddress/AppletShippingAddressList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-22 14:48:51', 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 ('2025072202483690511', '2025072202483670510', '添加小程序收货地址', NULL, NULL, 0, NULL, NULL, 2, 'appletShippingAddress:applet_shipping_address:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:51', 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 ('2025072202483690512', '2025072202483670510', '编辑小程序收货地址', NULL, NULL, 0, NULL, NULL, 2, 'appletShippingAddress:applet_shipping_address:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:51', 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 ('2025072202483690513', '2025072202483670510', '删除小程序收货地址', NULL, NULL, 0, NULL, NULL, 2, 'appletShippingAddress:applet_shipping_address:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:51', 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 ('2025072202483690514', '2025072202483670510', '批量删除小程序收货地址', NULL, NULL, 0, NULL, NULL, 2, 'appletShippingAddress:applet_shipping_address:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:51', 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 ('2025072202483690515', '2025072202483670510', '导出excel_小程序收货地址', NULL, NULL, 0, NULL, NULL, 2, 'appletShippingAddress:applet_shipping_address:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:51', 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 ('2025072202483690516', '2025072202483670510', '导入excel_小程序收货地址', NULL, NULL, 0, NULL, NULL, 2, 'appletShippingAddress:applet_shipping_address:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:48:51', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletShippingAddress/vue3/components/AppletShippingAddressForm.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 '../AppletShippingAddress.data';
import {saveOrUpdate} from '../AppletShippingAddress.api';
export default defineComponent({
name: "AppletShippingAddressForm",
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 = '/appletShippingAddress/appletShippingAddress/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/appletShippingAddress/vue3/components/AppletShippingAddressModal.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="AppletShippingAddressForm" />
</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 '../AppletShippingAddress.data';
import {saveOrUpdate} from '../AppletShippingAddress.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/appletSubscribeDetection/controller/AppletSubscribeDetectionController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletSubscribeDetection.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.appletSubscribeDetection.entity.AppletSubscribeDetection;
import org.jeecg.modules.demo.appletSubscribeDetection.service.IAppletSubscribeDetectionService;
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-07-22
* @Version: V1.0
*/
@Tag(name="预约检测")
@RestController
@RequestMapping("/appletSubscribeDetection/appletSubscribeDetection")
@Slf4j
public class AppletSubscribeDetectionController extends JeecgController<AppletSubscribeDetection, IAppletSubscribeDetectionService> {
@Autowired
private IAppletSubscribeDetectionService appletSubscribeDetectionService;
/**
* 分页列表查询
*
* @param appletSubscribeDetection
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "预约检测-分页列表查询")
@Operation(summary="预约检测-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletSubscribeDetection>> queryPageList(AppletSubscribeDetection appletSubscribeDetection,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletSubscribeDetection> queryWrapper = QueryGenerator.initQueryWrapper(appletSubscribeDetection, req.getParameterMap());
Page<AppletSubscribeDetection> page = new Page<AppletSubscribeDetection>(pageNo, pageSize);
IPage<AppletSubscribeDetection> pageList = appletSubscribeDetectionService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletSubscribeDetection
* @return
*/
@AutoLog(value = "预约检测-添加")
@Operation(summary="预约检测-添加")
@RequiresPermissions("appletSubscribeDetection:applet_subscribe_detection:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletSubscribeDetection appletSubscribeDetection) {
appletSubscribeDetectionService.save(appletSubscribeDetection);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletSubscribeDetection
* @return
*/
@AutoLog(value = "预约检测-编辑")
@Operation(summary="预约检测-编辑")
@RequiresPermissions("appletSubscribeDetection:applet_subscribe_detection:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletSubscribeDetection appletSubscribeDetection) {
appletSubscribeDetectionService.updateById(appletSubscribeDetection);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "预约检测-通过id删除")
@Operation(summary="预约检测-通过id删除")
@RequiresPermissions("appletSubscribeDetection:applet_subscribe_detection:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletSubscribeDetectionService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "预约检测-批量删除")
@Operation(summary="预约检测-批量删除")
@RequiresPermissions("appletSubscribeDetection:applet_subscribe_detection:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletSubscribeDetectionService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "预约检测-通过id查询")
@Operation(summary="预约检测-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletSubscribeDetection> queryById(@RequestParam(name="id",required=true) String id) {
AppletSubscribeDetection appletSubscribeDetection = appletSubscribeDetectionService.getById(id);
if(appletSubscribeDetection==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletSubscribeDetection);
}
/**
* 导出excel
*
* @param request
* @param appletSubscribeDetection
*/
@RequiresPermissions("appletSubscribeDetection:applet_subscribe_detection:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletSubscribeDetection appletSubscribeDetection) {
return super.exportXls(request, appletSubscribeDetection, AppletSubscribeDetection.class, "预约检测");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletSubscribeDetection:applet_subscribe_detection:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletSubscribeDetection.class);
}
}

+ 117
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/entity/AppletSubscribeDetection.java View File

@ -0,0 +1,117 @@
package org.jeecg.modules.demo.appletSubscribeDetection.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-07-22
* @Version: V1.0
*/
@Data
@TableName("applet_subscribe_detection")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="预约检测")
public class AppletSubscribeDetection 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;
/**客户姓名*/
@Excel(name = "客户姓名", width = 15)
@Schema(description = "客户姓名")
private java.lang.String name;
/**预约时间*/
@Excel(name = "预约时间", width = 15)
@Schema(description = "预约时间")
private java.lang.String subscribeTime;
/**客户电话*/
@Excel(name = "客户电话", width = 15)
@Schema(description = "客户电话")
private java.lang.String phone;
/**价格*/
@Excel(name = "价格", width = 15)
@Schema(description = "价格")
private java.lang.String price;
/**类型(自采、上门、到店)*/
@Excel(name = "类型(自采、上门、到店)", width = 15)
@Schema(description = "类型(自采、上门、到店)")
private java.lang.String type;
/**寄送地址id*/
@Excel(name = "寄送地址id", width = 15)
@Schema(description = "寄送地址id")
private java.lang.String sendAddressId;
/**寄送地址(省)*/
@Excel(name = "寄送地址(省)", width = 15)
@Schema(description = "寄送地址(省)")
private java.lang.String sendAddressProvince;
/**详细地址*/
@Excel(name = "详细地址", width = 15)
@Schema(description = "详细地址")
private java.lang.String sendAddressDetail;
/**寄送地址(市)*/
@Excel(name = "寄送地址(市)", width = 15)
@Schema(description = "寄送地址(市)")
private java.lang.String sendAddressCity;
/**寄送地址(区)*/
@Excel(name = "寄送地址(区)", width = 15)
@Schema(description = "寄送地址(区)")
private java.lang.String sendAddressDistrict;
/**预约日期*/
@Excel(name = "预约日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@Schema(description = "预约日期")
private java.util.Date subscribeDate;
/**医院*/
@Excel(name = "医院", width = 15)
@Schema(description = "医院")
private java.lang.String hospital;
/**医院id*/
@Excel(name = "医院id", width = 15)
@Schema(description = "医院id")
private java.lang.String hospitalId;
}

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

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletSubscribeDetection.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 预约检测
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface AppletSubscribeDetectionMapper extends BaseMapper<AppletSubscribeDetection> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/mapper/xml/AppletSubscribeDetectionMapper.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.appletSubscribeDetection.mapper.AppletSubscribeDetectionMapper">
</mapper>

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

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletSubscribeDetection.service;
import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 预约检测
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
public interface IAppletSubscribeDetectionService extends IService<AppletSubscribeDetection> {
}

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

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletSubscribeDetection.service.impl;
import org.jeecg.modules.demo.appletSubscribeDetection.entity.AppletSubscribeDetection;
import org.jeecg.modules.demo.appletSubscribeDetection.mapper.AppletSubscribeDetectionMapper;
import org.jeecg.modules.demo.appletSubscribeDetection.service.IAppletSubscribeDetectionService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 预约检测
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Version: V1.0
*/
@Service
public class AppletSubscribeDetectionServiceImpl extends ServiceImpl<AppletSubscribeDetectionMapper, AppletSubscribeDetection> implements IAppletSubscribeDetectionService {
}

+ 156
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp/AppletSubscribeDetectionForm.vue View File

@ -0,0 +1,156 @@
<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="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">客户姓名</text></view>
<input placeholder="请输入客户姓名" v-model="model.name"/>
</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.subscribeTime"/>
</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.phone"/>
</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.price"/>
</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.type"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">寄送地址id</text></view>
<input placeholder="请输入寄送地址id" v-model="model.sendAddressId"/>
</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.sendAddressProvince"/>
</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.sendAddressDetail"/>
</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.sendAddressCity"/>
</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.sendAddressDistrict"/>
</view>
</view>
<my-date label="预约日期:" fields="day" v-model="model.subscribeDate" placeholder="请输入预约日期"></my-date>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">医院</text></view>
<input placeholder="请输入医院" v-model="model.hospital"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">医院id</text></view>
<input placeholder="请输入医院id" v-model="model.hospitalId"/>
</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: "AppletSubscribeDetectionForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletSubscribeDetection/appletSubscribeDetection/queryById",
add: "/appletSubscribeDetection/appletSubscribeDetection/add",
edit: "/appletSubscribeDetection/appletSubscribeDetection/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/appletSubscribeDetection/uniapp/AppletSubscribeDetectionList.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: "/appletSubscribeDetection/appletSubscribeDetection/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 74
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionData.ts View File

@ -0,0 +1,74 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '标题',
align:"center",
dataIndex: 'title'
},
{
title: '客户姓名',
align:"center",
dataIndex: 'name'
},
{
title: '预约时间',
align:"center",
dataIndex: 'subscribeTime'
},
{
title: '客户电话',
align:"center",
dataIndex: 'phone'
},
{
title: '价格',
align:"center",
dataIndex: 'price'
},
{
title: '类型(自采、上门、到店)',
align:"center",
dataIndex: 'type'
},
{
title: '寄送地址id',
align:"center",
dataIndex: 'sendAddressId'
},
{
title: '寄送地址(省)',
align:"center",
dataIndex: 'sendAddressProvince'
},
{
title: '详细地址',
align:"center",
dataIndex: 'sendAddressDetail'
},
{
title: '寄送地址(市)',
align:"center",
dataIndex: 'sendAddressCity'
},
{
title: '寄送地址(区)',
align:"center",
dataIndex: 'sendAddressDistrict'
},
{
title: '预约日期',
align:"center",
dataIndex: 'subscribeDate',
},
{
title: '医院',
align:"center",
dataIndex: 'hospital'
},
{
title: '医院id',
align:"center",
dataIndex: 'hospitalId'
},
];

+ 374
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionForm.vue View File

@ -0,0 +1,374 @@
<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>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['name']"
:label="get4Label('客户姓名')"
name='name'
prop='name'
placeholder="请选择客户姓名"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['subscribeTime']"
:label="get4Label('预约时间')"
name='subscribeTime'
prop='subscribeTime'
placeholder="请选择预约时间"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['phone']"
:label="get4Label('客户电话')"
name='phone'
prop='phone'
placeholder="请选择客户电话"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['price']"
:label="get4Label('价格')"
name='price'
prop='price'
placeholder="请选择价格"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['type']"
:label="get4Label('类型(自采、上门、到店)')"
name='type'
prop='type'
placeholder="请选择类型(自采、上门、到店)"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sendAddressId']"
:label="get4Label('寄送地址id')"
name='sendAddressId'
prop='sendAddressId'
placeholder="请选择寄送地址id"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sendAddressProvince']"
:label="get4Label('寄送地址(省)')"
name='sendAddressProvince'
prop='sendAddressProvince'
placeholder="请选择寄送地址(省)"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sendAddressDetail']"
:label="get4Label('详细地址')"
name='sendAddressDetail'
prop='sendAddressDetail'
placeholder="请选择详细地址"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sendAddressCity']"
:label="get4Label('寄送地址(市)')"
name='sendAddressCity'
prop='sendAddressCity'
placeholder="请选择寄送地址(市)"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sendAddressDistrict']"
:label="get4Label('寄送地址(区)')"
name='sendAddressDistrict'
prop='sendAddressDistrict'
placeholder="请选择寄送地址(区)"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<online-date
:label="get4Label('预约日期')"
labelWidth="100px"
type="date"
name='subscribeDate'
v-model:value="myFormData['subscribeDate']"
></online-date>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['hospital']"
:label="get4Label('医院')"
name='hospital'
prop='hospital'
placeholder="请选择医院"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['hospitalId']"
:label="get4Label('医院id')"
name='hospitalId'
prop='hospitalId'
placeholder="请选择医院id"
: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: 'AppletSubscribeDetectionForm',
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('AppletSubscribeDetectionList')
// 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("/appletSubscribeDetection/appletSubscribeDetection/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_subscribe_detection',
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?'/appletSubscribeDetection/appletSubscribeDetection/edit':'/appletSubscribeDetection/appletSubscribeDetection/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/appletSubscribeDetection/uniapp3/AppletSubscribeDetectionList.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 './AppletSubscribeDetectionData';
defineOptions({
name: 'AppletSubscribeDetectionList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletSubscribeDetection/appletSubscribeDetection/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletSubscribeDetection/appletSubscribeDetection/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletSubscribeDetectionForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletSubscribeDetectionForm',
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/appletSubscribeDetection/vue3/AppletSubscribeDetection.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 = '/appletSubscribeDetection/appletSubscribeDetection/list',
save='/appletSubscribeDetection/appletSubscribeDetection/add',
edit='/appletSubscribeDetection/appletSubscribeDetection/edit',
deleteOne = '/appletSubscribeDetection/appletSubscribeDetection/delete',
deleteBatch = '/appletSubscribeDetection/appletSubscribeDetection/deleteBatch',
importExcel = '/appletSubscribeDetection/appletSubscribeDetection/importExcel',
exportXls = '/appletSubscribeDetection/appletSubscribeDetection/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});
}

+ 195
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/AppletSubscribeDetection.data.ts View File

@ -0,0 +1,195 @@
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'
},
{
title: '客户姓名',
align:"center",
dataIndex: 'name'
},
{
title: '预约时间',
align:"center",
dataIndex: 'subscribeTime'
},
{
title: '客户电话',
align:"center",
dataIndex: 'phone'
},
{
title: '价格',
align:"center",
dataIndex: 'price'
},
{
title: '类型(自采、上门、到店)',
align:"center",
dataIndex: 'type'
},
{
title: '寄送地址id',
align:"center",
dataIndex: 'sendAddressId'
},
{
title: '寄送地址(省)',
align:"center",
dataIndex: 'sendAddressProvince'
},
{
title: '详细地址',
align:"center",
dataIndex: 'sendAddressDetail'
},
{
title: '寄送地址(市)',
align:"center",
dataIndex: 'sendAddressCity'
},
{
title: '寄送地址(区)',
align:"center",
dataIndex: 'sendAddressDistrict'
},
{
title: '预约日期',
align:"center",
dataIndex: 'subscribeDate',
customRender:({text}) =>{
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
return text;
},
},
{
title: '医院',
align:"center",
dataIndex: 'hospital'
},
{
title: '医院id',
align:"center",
dataIndex: 'hospitalId'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'title',
component: 'Input',
},
{
label: '客户姓名',
field: 'name',
component: 'Input',
},
{
label: '预约时间',
field: 'subscribeTime',
component: 'Input',
},
{
label: '客户电话',
field: 'phone',
component: 'Input',
},
{
label: '价格',
field: 'price',
component: 'Input',
},
{
label: '类型(自采、上门、到店)',
field: 'type',
component: 'Input',
},
{
label: '寄送地址id',
field: 'sendAddressId',
component: 'Input',
},
{
label: '寄送地址(省)',
field: 'sendAddressProvince',
component: 'Input',
},
{
label: '详细地址',
field: 'sendAddressDetail',
component: 'Input',
},
{
label: '寄送地址(市)',
field: 'sendAddressCity',
component: 'Input',
},
{
label: '寄送地址(区)',
field: 'sendAddressDistrict',
component: 'Input',
},
{
label: '预约日期',
field: 'subscribeDate',
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD'
},
},
{
label: '医院',
field: 'hospital',
component: 'Input',
},
{
label: '医院id',
field: 'hospitalId',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
title: {title: '标题',order: 0,view: 'text', type: 'string',},
name: {title: '客户姓名',order: 1,view: 'text', type: 'string',},
subscribeTime: {title: '预约时间',order: 2,view: 'text', type: 'string',},
phone: {title: '客户电话',order: 3,view: 'text', type: 'string',},
price: {title: '价格',order: 4,view: 'text', type: 'string',},
type: {title: '类型(自采、上门、到店)',order: 5,view: 'text', type: 'string',},
sendAddressId: {title: '寄送地址id',order: 6,view: 'text', type: 'string',},
sendAddressProvince: {title: '寄送地址(省)',order: 7,view: 'text', type: 'string',},
sendAddressDetail: {title: '详细地址',order: 8,view: 'text', type: 'string',},
sendAddressCity: {title: '寄送地址(市)',order: 9,view: 'text', type: 'string',},
sendAddressDistrict: {title: '寄送地址(区)',order: 10,view: 'text', type: 'string',},
subscribeDate: {title: '预约日期',order: 11,view: 'date', type: 'string',},
hospital: {title: '医院',order: 12,view: 'text', type: 'string',},
hospitalId: {title: '医院id',order: 13,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/appletSubscribeDetection/vue3/AppletSubscribeDetectionList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletSubscribeDetection:applet_subscribe_detection:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletSubscribeDetection:applet_subscribe_detection:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletSubscribeDetection:applet_subscribe_detection: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="'appletSubscribeDetection:applet_subscribe_detection: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>
<!-- 表单区域 -->
<AppletSubscribeDetectionModal @register="registerModal" @success="handleSuccess"></AppletSubscribeDetectionModal>
</div>
</template>
<script lang="ts" name="appletSubscribeDetection-appletSubscribeDetection" 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 AppletSubscribeDetectionModal from './components/AppletSubscribeDetectionModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletSubscribeDetection.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletSubscribeDetection.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: 'appletSubscribeDetection:applet_subscribe_detection:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletSubscribeDetection:applet_subscribe_detection: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/appletSubscribeDetection/vue3/V20250722_1__menu_insert_AppletSubscribeDetection.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletSubscribeDetection文件夹下
-- 如果你想更改到其他目录,请修改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 ('2025072202502600010', NULL, '预约检测', '/appletSubscribeDetection/appletSubscribeDetectionList', 'appletSubscribeDetection/AppletSubscribeDetectionList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-22 14:50:01', 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 ('2025072202502600011', '2025072202502600010', '添加预约检测', NULL, NULL, 0, NULL, NULL, 2, 'appletSubscribeDetection:applet_subscribe_detection:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:50:01', 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 ('2025072202502600012', '2025072202502600010', '编辑预约检测', NULL, NULL, 0, NULL, NULL, 2, 'appletSubscribeDetection:applet_subscribe_detection:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:50:01', 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 ('2025072202502600013', '2025072202502600010', '删除预约检测', NULL, NULL, 0, NULL, NULL, 2, 'appletSubscribeDetection:applet_subscribe_detection:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:50:01', 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 ('2025072202502600014', '2025072202502600010', '批量删除预约检测', NULL, NULL, 0, NULL, NULL, 2, 'appletSubscribeDetection:applet_subscribe_detection:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:50:01', 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 ('2025072202502600015', '2025072202502600010', '导出excel_预约检测', NULL, NULL, 0, NULL, NULL, 2, 'appletSubscribeDetection:applet_subscribe_detection:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:50:01', 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 ('2025072202502600016', '2025072202502600010', '导入excel_预约检测', NULL, NULL, 0, NULL, NULL, 2, 'appletSubscribeDetection:applet_subscribe_detection:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-22 14:50:01', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletSubscribeDetection/vue3/components/AppletSubscribeDetectionForm.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 '../AppletSubscribeDetection.data';
import {saveOrUpdate} from '../AppletSubscribeDetection.api';
export default defineComponent({
name: "AppletSubscribeDetectionForm",
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 = '/appletSubscribeDetection/appletSubscribeDetection/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/appletSubscribeDetection/vue3/components/AppletSubscribeDetectionModal.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="AppletSubscribeDetectionForm" />
</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 '../AppletSubscribeDetection.data';
import {saveOrUpdate} from '../AppletSubscribeDetection.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>

+ 5
- 5
jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml View File

@ -212,7 +212,7 @@ jeecg:
#签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys,/sys/sendChangePwdSms,/sys/user/sendChangePhoneSms,/sys/sms,/desform/api/sendVerifyCode
# 本地:local、Minio:minio、阿里云:alioss
uploadType: local
uploadType: alioss
# 前端访问地址
domainUrl:
pc: http://localhost:3100
@ -226,10 +226,10 @@ jeecg:
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置
oss:
accessKey: ??
secretKey: ??
endpoint: oss-cn-beijing.aliyuncs.com
bucketName: jeecgdev
accessKey: LTAI5tQSs47izVy8DLVdwUU9
secretKey: qHI7C3PaXYZySr84HTToviC71AYlFq
endpoint: oss-cn-shenzhen.aliyuncs.com
bucketName: hanhaiimage
# 短信模板
sms-template:
# 签名


+ 64
- 0
jeecgboot-vue3/src/views/applet/config/AppletConfig.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 = '/appletConfig/appletConfig/list',
save='/appletConfig/appletConfig/add',
edit='/appletConfig/appletConfig/edit',
deleteOne = '/appletConfig/appletConfig/delete',
deleteBatch = '/appletConfig/appletConfig/deleteBatch',
importExcel = '/appletConfig/appletConfig/importExcel',
exportXls = '/appletConfig/appletConfig/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});
}

+ 135
- 0
jeecgboot-vue3/src/views/applet/config/AppletConfig.data.ts View File

@ -0,0 +1,135 @@
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: 'code'
},
{
title: '描述',
align: "center",
dataIndex: 'info'
},
{
title: '内容',
align: "center",
dataIndex: 'content'
},
{
title: '类型',
align: "center",
dataIndex: 'type_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "编码",
field: 'code',
component: 'Input',
//colProps: {span: 6},
},
{
label: "描述",
field: 'info',
component: 'Input',
//colProps: {span: 6},
},
{
label: "类型",
field: 'type',
component: 'JSelectMultiple',
componentProps: {
dictCode: "applett_config_type"
},
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '编码',
field: 'code',
component: 'Input',
},
{
label: '描述',
field: 'info',
component: 'Input',
},
{
label: '类型',
field: 'type',
component: 'JDictSelectTag',
componentProps: {
dictCode: "applett_config_type"
},
},
{
label: '内容',
field: 'content',
component: 'Input',
componentProps: {
placeholder: '请输入内容',
},
show: ({ values }) => {
return values.type === '0' || values.type === 0;
},
},
{
label: '富文本内容',
field: 'content',
component: 'JEditor',
componentProps: {
placeholder: '请输入富文本内容',
height: 400,
menubar: true,
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help',
},
show: ({ values }) => {
return values.type === '1' || values.type === 1;
},
},
{
label: '图片',
field: 'content',
component: 'JImageUpload',
componentProps: {
fileMax: 1,
accept: ['image/*'],
helpText: '支持jpg、png、gif等图片格式',
},
show: ({ values }) => {
return values.type === '2' || values.type === 2;
},
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
code: { title: '编码', order: 0, view: 'text', type: 'string', },
info: { title: '描述', order: 1, view: 'text', type: 'string', },
content: { title: '内容', order: 2, view: 'text', type: 'string', },
type: { title: '类型', order: 3, view: 'list', type: 'string', dictCode: 'applett_config_type', },
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 268
- 0
jeecgboot-vue3/src/views/applet/config/AppletConfigList.vue View File

@ -0,0 +1,268 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletConfig:applet_config:add'" @click="handleAdd"
preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletConfig:applet_config:exportXls'"
preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletConfig:applet_config: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="'appletConfig:applet_config: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 }">
<template v-if="column.dataIndex === 'content'">
<div v-html="renderContent(record)"></div>
</template>
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletConfigModal @register="registerModal" @success="handleSuccess"></AppletConfigModal>
</div>
</template>
<script lang="ts" name="appletConfig-appletConfig" 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 AppletConfigModal from './components/AppletConfigModal.vue'
import { columns, searchFormSchema, superQuerySchema } from './AppletConfig.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AppletConfig.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 renderContent(record) {
const type = record.type;
const content = record.content;
if (!content) return '-';
//
if (type == '1' || type == 1) {
return '<span style="color: #999;">富文本内容</span>';
}
//
if (type == '2' || type == 2) {
try {
const imageList = content ? content.split(',') : [];
if (Array.isArray(imageList) && imageList.length > 0) {
const firstImage = imageList[0];
return `<img src="${firstImage}" style="max-width: 60px; max-height: 40px; object-fit: cover; border-radius: 4px;" />`;
}
} catch (e) {
//
return content;
}
return '<span style="color: #999;">图片内容</span>';
}
//
if (type == '0' || type == 0) {
const displayText = content.length > 20 ? content.substring(0, 20) + '...' : content;
return `<span title="${content}">${displayText}</span>`;
}
return content;
}
/**
* 高级查询事件
*/
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: 'appletConfig:applet_config:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletConfig:applet_config:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
/** 表格内容样式 */
:deep(.ant-table-tbody) {
.ant-table-cell {
vertical-align: middle;
}
}
/** 图片样式 */
:deep(.ant-table-tbody img) {
border: 1px solid #f0f0f0;
transition: all 0.3s;
&:hover {
transform: scale(1.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
}
</style>

+ 70
- 0
jeecgboot-vue3/src/views/applet/config/components/AppletConfigForm.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 '../AppletConfig.data';
import {saveOrUpdate} from '../AppletConfig.api';
export default defineComponent({
name: "AppletConfigForm",
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 = '/appletConfig/appletConfig/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>

+ 117
- 0
jeecgboot-vue3/src/views/applet/config/components/AppletConfigModal.vue View File

@ -0,0 +1,117 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" :height="600" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletConfigForm" />
</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 '../AppletConfig.data';
import {saveOrUpdate} from '../AppletConfig.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 (error: any) {
const errorFields = error?.errorFields;
if (errorFields && errorFields.length > 0) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth' });
}
}
return Promise.reject(error);
} 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%;
}
/** 增加表单容器的高度 */
:deep(.ant-modal-body) {
max-height: 500px;
overflow-y: auto;
}
/** 富文本编辑器高度调整 */
:deep(.tox-tinymce) {
min-height: 300px !important;
}
/** 上传组件样式调整 */
:deep(.ant-upload-list) {
max-height: 200px;
overflow-y: auto;
}
</style>

Loading…
Cancel
Save