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

修复字段样式配置项

parent 2ad668c8
...@@ -171,6 +171,7 @@ const DataTable = props => { ...@@ -171,6 +171,7 @@ const DataTable = props => {
// 字段栏显示模式渲染 // 字段栏显示模式渲染
const getFieldRender = (_, row, index , item) => { const getFieldRender = (_, row, index , item) => {
let ele; let ele;
switch (item.type) { switch (item.type) {
case "文本": case "文本":
if(!item.isMapped){ if(!item.isMapped){
...@@ -202,6 +203,18 @@ const DataTable = props => { ...@@ -202,6 +203,18 @@ const DataTable = props => {
download={true} download={true}
preview={true} />; preview={true} />;
break; 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 return ele
......
...@@ -57,15 +57,14 @@ const StatusOption = (props) => { ...@@ -57,15 +57,14 @@ const StatusOption = (props) => {
const current = data.find(d => d.FieldName === item.fieldName); const current = data.find(d => d.FieldName === item.fieldName);
if(currentItem){ if(currentItem){
item.type = currentItem.type;
item.color = currentItem.color; item.color = currentItem.color;
item.parseStr = currentItem.parseStr; item.parseStr = currentItem.parseStr;
item.type = showType(current?.Widget) ? current?.Widget : "文本"; item.isMapped = currentItem.isMapped || false;
item.editType = current?.Widget || "文本";
item.isMapped = currentItem?.isMapped || false;
item.width = currentItem.width || 120; item.width = currentItem.width || 120;
} else { } else {
item.type = "文本"; item.type = showType(current.Widget) ? current.Widget : "文本";
item.editType = "文本"; item.editType = current.Widget;
item.color = "rgb(65,68,69)"; item.color = "rgb(65,68,69)";
item.isMapped = false; item.isMapped = false;
item.width = 120; 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