预见猿份
主题
首页面试题在线工具关于我们老苗一对一私教学员评价
实战项目
项目前置基础创新WMS项目Java微服务框架与实战云岚到家项目闪聚支付项目学成在线项目青橙电商项目JVM原理与实战调优分布式事务专题Java高频面试题MySQL从入门到精通Java数据结构与算法老苗一对一私教学员评价blog
blog
  • 创新WMS项目

    • 项目介绍
  • 创新WMS项目配置

    • 项目安装配置
    • MySQL 8 在 Windows 10 上安装指南
    • Redis在 Windows 10 上安装指南
    • nvm安装指南
  • 创新WMS项目第一章

    • 熟悉项目
    • 使用apifox
  • 创新WMS项目第二章

    • 入库管理
    • EasyExcel官方文档
  • 创新WMS项目第三章

    • 出库管理
    • 顺丰接口对接
  • 创新WMS项目第四章

    • 多租户管理
  • 创新WMS项目第五章

    • AI大模型应用开发
    • PostgreSQL安装
    • Dify安装部署
    • Dify研究
  • 创新WMS项目第六章

    • IOT物联网
    • IOT环境搭建
    • IOT服务端
  • 创新WMS项目第七章

    • 项目部署
    • 创新WMS需求规格说明书
    • 创新WMS面试题
    • 前端组件
    • Q&A







----- 到底线了 -----

×

欢迎来到预见猿份,本站项目均为站长原创,学习中有问题可直接提交给站长老苗解决(微信:mrt_0607)。

苗润土老师,20余年一线项目经验,2014年加入黑马,星辰wms、云岚到家、学成在线项目作者,历任高级讲师、教学主管及课程研究员。 b站老苗

前端组件 ​

说明 ​

本文档对本项目经常使用的前端组件进行说明,关于组件的详细使用方法及更多组件的说明请参数官方文档 https://help.jeecg.com/ui/

JDictSelectTag ​

文档:https://help.jeecg.com/ui/component/JDictSelectTag

表单使用 ​

功能:表单中下拉显示数据字典选项

效果如下:

JDictSelectTag表单效果

示例:下拉选择数据字典dict_item_status的选项

dictCode:指定数据字典code

表单下拉框中显示数据字典:

javascript
{
  label: '状态',
  field: 'status',
  component: 'JDictSelectTag',
  componentProps:{
    dictCode:"dict_item_status"
  },
  dynamicRules: ({model,schema}) => {
    return [
      { required: true, message: '请输入状态'},
    ];
  },
},
1
2
3
4
5
6
7
8
9
10
11
12
13

component: 'JDictSelectTag':指定使用JDictSelectTag组件

dict_item_status:数据字典的名称

注意:状态字段在数据库使用java.lang.String类型

列表显示数据字典:

JavaScript
{
  title: '状态',
  align:"center",
  dataIndex: 'status',
  customRender: ({text}) => {
    return render.renderDict(text, 'dict_item_status');
  }
}
1
2
3
4
5
6
7
8

列表使用数据字典 ​

在查询列表显示数据字典名称时需要前后端结合。

首先在后端实体类中使用@Dict(dicCode = "dict_item_status") 指定数据字典名称

Python
/**状态*/
@Excel(name = "状态", width = 15, dicCode = "dict_item_status")
@Dict(dicCode = "dict_item_status")
   @ApiModelProperty(value = "状态")
   private java.lang.String status;
1
2
3
4
5

在查询货主表时jeecgBoot会关联查询数据字典表得到字典名称,字段名称为“status_dictText”,即“原字段名称_dictText”,在前端就可以指定显示此字段名称的值即可。

Plain
{
  title: '状态',
  align:"center",
  dataIndex: 'status_dictText',
},
{
 title: '结算币种',
 align:"center",
 dataIndex: 'settlementCurrency_dictText'
},
1
2
3
4
5
6
7
8
9
10

ApiSelect ​

基于antd-design-vue的Select组件的二次封装,获取api数据生成Select组件所需的options。

文档:https://help.jeecg.com/ui/apiSelect

效果:

ApiSelect效果

示例代码:

YAML
{
  label: '仓库',
  field: 'warehouseId',
  component: 'ApiSelect',
  componentProps: {
    api: list,
    resultField: 'records',
    labelField: 'warehouseName',
    valueField: 'id',
    disabled: true
  },
  dynamicRules: ({model,schema}) => {
    return [
      { required: true, message: '请输入仓库!'},
    ];
  },
},
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

参数配置:

ApiSelect参数配置1

ApiSelect参数配置2

JSearchSelect ​

功能:下拉+搜索

文档:https://help.jeecg.com/ui/component/JSearchSelectTag

效果:

JSearchSelect效果

示例:下拉选择货主

代码如下:

yaml
{
  label: '货主',
  field: 'ownerId',
  component: 'JSearchSelect',
  componentProps: {
    dict: "wms_cargo_owners,owner_name,id",
    //是否为搜索模式
    showSearch: true,
    //是否禁用
    disabled: false
  },
}
1
2
3
4
5
6
7
8
9
10
11
12

dict:指定表名、下拉框架显示名称及下拉框value值

注意:JDictSelectTag 、JSearchSelect 和 JTreeSelect 除了可以配置数据字典外还支持配置数据库表,直接通过表获取数据。

dictCode格式说明:表名,文本字段,取值字段

参数配置:

JSearchSelect参数配置

JTreeSelect ​

功能:下拉+树

文档:https://help.jeecg.com/ui/component/JTreeSelect

效果:

JTreeSelect效果

示例代码:

Python
{
  label: '商品分类',
  field: 'categoryId',
  component: 'JTreeSelect',
  // helpMessage: ['component模式'],
  componentProps: {
    dict: 'wms_product_categories,category_name,id',
    pidField: 'parent_id',
    pidValue: '0'
  },
},
1
2
3
4
5
6
7
8
9
10
11

参数配置:

JTreeSelect参数配置1

JTreeSelect参数配置2

弹窗提示 ​

c
import {useMessage} from "@/hooks/web/useMessage";

const { createMessage } = useMessage();

/**
 * 审核入库单
 */
function handleAudit(record: Recordable) {
  //提交审核状态可以审核
  if(record.status != "SUBMITTED" ){
    createMessage.warn('提交审核状态可以审核')
    return;
  }
  openAuditModal(true, {
    record,
    isUpdate: true,
    showFooter: true,
  });
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

省市区联动 ​

Plain
{
  label: '收件人省市区',
  field: 'region',
  component: 'JAreaLinkage',
},
1
2
3
4
5

效果:

省市区联动效果

向后台提交省、市、区三级的编码,中间用逗号分隔,如:110000,110100,110101。

在后台处理建议:

首先保存收到省、市、区三级的编码,然后解析出省、市、区的编码,并使用JeecgBoot提供的ProvinceCityArea 获取编码对应的文本进行保存。

← 创新WMS面试题Q&A →








如果发现文档内容有错误或排版错乱,请及时联系站长老苗修改,不胜感激。联系方式
关于我们 | 隐私政策 | 豫ICP备2026003386号-4 | 豫公网安备41010202004008号
目录

本页无章节