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

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

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