java数据字典tag,jeecgboot 数据字典下拉框j-dict-select-tag使用

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 17:41   4192   0

页面配置数据字典product_type

后端

@Dict(dicCode = "product_type")

private String type;

前端

:trigger-change="true" @change="getType"/>

引入依赖

import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'

在created()初始化方法执行字典配置方法

this.initDictConfig();

//加载数据字典

initDictConfig() {

//初始化字典 - 商品类型

initDictOptions('product_type').then((res) => {

if (res.success) {

this.typeDictOptions = res.result;

}

});

},

表格字段

{

title: '商品类型',

align: "center",

dataIndex: 'type',

customRender: (text, record, index) => {

//todo 字典值替换通用方法

return filterDictText(this.typeDictOptions, text);

}

},

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP