Commit deafd8a8 authored by 杨子龙's avatar 杨子龙

修复字段样式配置项

parent 2ad668c8
......@@ -171,6 +171,7 @@ const DataTable = props => {
// 字段栏显示模式渲染
const getFieldRender = (_, row, index , item) => {
let ele;
switch (item.type) {
case "文本":
if(!item.isMapped){
......@@ -202,6 +203,18 @@ const DataTable = props => {
download={true}
preview={true} />;
break;
default:
if(!item.isMapped){
ele = <span style={{color: item.color}}>{_}</span>
} else {
if(item.parseStr){
const json = JSON.parse(item.parseStr);
ele = <span style={{color: json[_]?.color}}>{json[_]?.label}</span>
} else {
ele = <span>调试中...</span>
}
}
break;
}
return ele
......
......@@ -57,15 +57,14 @@ const StatusOption = (props) => {
const current = data.find(d => d.FieldName === item.fieldName);
if(currentItem){
item.type = currentItem.type;
item.color = currentItem.color;
item.parseStr = currentItem.parseStr;
item.type = showType(current?.Widget) ? current?.Widget : "文本";
item.editType = current?.Widget || "文本";
item.isMapped = currentItem?.isMapped || false;
item.isMapped = currentItem.isMapped || false;
item.width = currentItem.width || 120;
} else {
item.type = "文本";
item.editType = "文本";
item.type = showType(current.Widget) ? current.Widget : "文本";
item.editType = current.Widget;
item.color = "rgb(65,68,69)";
item.isMapped = false;
item.width = 120;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment