Skip to content

字典管理

1. 获取字典列表(getDictionaryListByCode)

typescript
//! 注意,TS版本4^
import type { GetDictionaryListByCodeReq, GetDictionaryListByCodeRes } from '@homing/web'

try {
    const data: GetDictionaryListByCodeRes[] = await client.getDictionaryListByCode({
        dictionaryCodes: 'DICT_CODE1,DICT_CODE2',
        state: 1
    } as GetDictionaryListByCodeReq);
    console.log('调用成功', data);
} catch (error: any) {
    console.log(error, '调用失败' + error?.message);
}

参数说明

参数名类型必填说明备注/枚举值
dictionaryCodesstring字典标识返回当前租户字典(如未配置则返回平台)多个编号以英文逗号间隔
statenumber状态0-禁用,1-启用

响应说明

字段名类型说明
dictionaryIdnumber字典ID
dictionaryCodestring字典类型编号
dictionaryTypestring类型
dictionaryNamestring名称
descriptionstring描述
sortValuenumber排序
readonlynumber内置
categorystring分类
scopestring配置权限
statenumber状态
tenantCodestring租户编码
createdBystring创建人
createdTimestring创建时间
updatedBystring更新人
updatedTimestring更新时间
itemsArray字典项列表

字典项字段(items 数组中的每个对象)

字段名类型说明
dictionaryItemIdnumber字典项ID
dictionaryItemCodestring
dictionaryItemNamestring
iconstring图标
cssStylestringcss样式/回显样式
cssClassstringcss类型
descriptionstring描述
sortValuestring排序
readonlynumber是否内置
statenumber状态
tenantCodestring租户编码
createdBystring创建人
createdTimenumber创建时间
updatedBystring更新人
updatedTimenumber更新时间

基于 MIT 许可证发布