企业类型 字典回显
This commit is contained in:
@ -27,6 +27,7 @@ const SupplierMessage: React.FC = () => {
|
||||
const [viewVisible, setViewVisible] = useState(false); // 弹窗显隐
|
||||
//下拉数据
|
||||
const [categoryOptions, setCategoryOptions] = useState<CategoryOption[]>([]);
|
||||
const [typeMap, setTypeMap] = useState<{ [code: string]: string }>({});
|
||||
|
||||
// 获取数据
|
||||
const getList = async (pageNo = 1, pageSize = 10) => {
|
||||
@ -62,6 +63,11 @@ const SupplierMessage: React.FC = () => {
|
||||
getDictList('message_type').then((res: any) => {
|
||||
const { code, data } = res;
|
||||
if (code == 200) {
|
||||
const map: { [code: string]: string } = {};
|
||||
res.data.forEach((item: { code: string, dicName: string }) => {
|
||||
map[item.code] = item.dicName;
|
||||
});
|
||||
setTypeMap(map);
|
||||
setCategoryOptions(data)
|
||||
}
|
||||
})
|
||||
@ -87,9 +93,10 @@ const SupplierMessage: React.FC = () => {
|
||||
},
|
||||
{
|
||||
title: '业务类型',
|
||||
dataIndex: 'typeCn',
|
||||
key: 'typeCn',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align: 'center',
|
||||
render: (code: string) => typeMap[code] || code
|
||||
},
|
||||
{
|
||||
title: '接收时间',
|
||||
|
Reference in New Issue
Block a user