例如:返回数值 1为新增 0为提交审核,2审核通过需要展示审批状态
![](https://i-blog.csdnimg.cn/direct/5c427b015d3a4633a67b04a156f0b456.png)
处理方法代码展示:
1、没有数据字典直接使用循环赋值
![](https://i-blog.csdnimg.cn/direct/2f98403e0f9c4a399f4da7a77bf147cb.png)
效果展示:
![](https://i-blog.csdnimg.cn/direct/fba7be74fe1b44aa99d41036e100771a.png)
2、有数据字典直接赋值并添加样式,注意(attendance_fake_range)为数据字典名称
TypeScript
customRender: ({ text }) => {
const color = text == '0' ? 'green' : text == '-1' ? 'red' : 'gray';
return render.renderTag(render.renderDict(text, 'attendance_fake_range'), color);
},
效果展示
![](https://i-blog.csdnimg.cn/direct/657add80c602495ea55b20f4890c61ae.png)
3、如果后端有返回bmpStatus_dictText的中文值可以直接替换字段如图
![](https://i-blog.csdnimg.cn/direct/969f7c07f19e457a8320e0dce3fff6f0.png)