Commit 850ab064 authored by 田翔's avatar 田翔

fix: 增加选项bug修复

parent bc7d44ea
{
"name": "panda-xform",
"version": "6.10.9",
"description": "6.10.9 台账选择器触发多个计算规则问题",
"version": "6.10.10",
"description": "6.10.10 复选框手动添加选项bug",
"keywords": [
"panda-xform"
],
......
......@@ -63,22 +63,11 @@ const DraggableBodyRow = ({
const DragTable = props => {
const { columns, dataSource, dragCallBack, ItemTypes } = props;
// const [data, setData] = useState(null); // 分组后的数组
const components = {
body: {
row: DraggableBodyRow,
},
};
// useEffect(() => {
// if (dataSource.length > 0) {
// setData(dataSource);
// }
// }, [dataSource]);
// 每次拖拽后返回
// useEffect(() => {
// dragCallBack(data);
// }, [data]);
// 移动数组元素到指定位置
const moveInArray = (arr, from, to) => {
// 确保是有效数组
if (Object.prototype.toString.call(arr) !== '[object Array]') {
......@@ -96,11 +85,6 @@ const DragTable = props => {
};
// 拖拽表格
const moveRow = (dragIndex, hoverIndex) => {
// setData(val => {
// let newData = JSON.parse(JSON.stringify(val));
// newData = moveInArray(newData, dragIndex, hoverIndex);
// return newData;
// });
let newData = JSON.parse(JSON.stringify(dataSource))
newData = moveInArray(newData, dragIndex, hoverIndex)
dragCallBack(newData)
......
......@@ -256,7 +256,7 @@ const Coordinate = (props) => {
addons?.setSchemaByPath(addons.dataPath, { ...schema, width: '67%' })
}
if (screenShot && disabled) {
let time = Math.round(Math.random() * 1000)
let time = Math.round(Math.random() * 2000)
setTimeout(() => {
setScreenShotShow(true)
}, time)
......
......@@ -53,6 +53,28 @@ const CheckBox = (props) => {
}
}, [presetValue])
const getChildren = () => {
let children = []
if (Array.isArray(enums)) {
enums.forEach(v => {
if (sourceType === '站点') {
children.push(<Checkbox key={isStoreID ? v.stationID : v.stationName} value={isStoreID ? v.stationID : v.stationName}>{v.stationName}</Checkbox>)
} else if (sourceType === '手动输入') {
children.push(
<Checkbox key={v.value} value={v.value}>
{
color ? <TagPack color={v.color} text={v.value} /> : v.value
}
</Checkbox>
)
} else {
children.push(<Checkbox key={v} value={v}>{v}</Checkbox>)
}
})
}
return children
}
const onFocus = async () => {
if (addons) {
if (sourceType === '数据字典') {
......@@ -106,7 +128,7 @@ const CheckBox = (props) => {
onChange={checkChange}
value={value ? value.split(',') : []}
>
{children}
{getChildren()}
</Checkbox.Group>
)
}
......
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