Commit 4de9847f authored by 杨子龙's avatar 杨子龙

- 修复操作栏样式映射的bug

parent 69f85fbe
......@@ -103,7 +103,7 @@ const DataTable = props => {
const optionCode = json[field]?.code;
let otherProps;
let otherProps = {};
if (type === 'icon') {
const Icon = AntdIcon[json[field]?.label];
if(Icon){
......
......@@ -39,6 +39,7 @@ const OptionRender = (props) => {
const [loading, setLoading] = useState(true)
const [currentColor, setCurrentColor] = useState('')
const [visible , setVisible] = useState(false);
const [parseIndex , setParseIndex] = useState(null);
const [parseObj , setParseObj] = useState(`{"key": {"color": "" , "label": ""}}`);
......@@ -156,6 +157,7 @@ const OptionRender = (props) => {
_.isMapped && (
<Button type={"text"} onClick={() => {
setVisible(true);
setParseIndex(i);
setParseObj(_.parseStr || `{"key": {"color": "" , "label": ""}}`)
}} icon={<SettingOutlined />} />
)
......@@ -287,8 +289,10 @@ const OptionRender = (props) => {
const onOk = () => {
const list = [...value];
list.forEach(item => {
item.parseStr = parseObj
list.forEach((item , index) => {
if(index === parseIndex){
item.parseStr = parseObj
}
});
onChange(list);
......
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