fix(): 修复考核模版
parent
582a6cf4cd
commit
9192da11cf
|
|
@ -103,6 +103,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
||||||
<Form.Item label="监测时间" name="tm">
|
<Form.Item label="监测时间" name="tm">
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
|
showTime
|
||||||
style={{ width: "350px" }}
|
style={{ width: "350px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
onChange={(v)=>{
|
onChange={(v)=>{
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
||||||
<Form.Item label="监测时间" name="tm">
|
<Form.Item label="监测时间" name="tm">
|
||||||
<RangePicker
|
<RangePicker
|
||||||
allowClear
|
allowClear
|
||||||
|
showTime
|
||||||
style={{ width: "350px" }}
|
style={{ width: "350px" }}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
onChange={(v)=>{
|
onChange={(v)=>{
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,13 @@ const EditableRow = ({ index, ...props }) => {
|
||||||
// assessScore
|
// assessScore
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
setTableData(handleData(checkList, "name"))
|
const res = checkList.map(item => {
|
||||||
|
if (item.rowSpan == 0 || item.rowSpan) {
|
||||||
|
item.rowSpan = undefined
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
setTableData(handleData(res, "name"))
|
||||||
} else {
|
} else {
|
||||||
setCheckList(tableData)
|
setCheckList(tableData)
|
||||||
const newData = tabs == 2 ? tableData.filter(item => item.standardScore > item.indicatorScore) :
|
const newData = tabs == 2 ? tableData.filter(item => item.standardScore > item.indicatorScore) :
|
||||||
|
|
@ -671,7 +677,7 @@ const EditableRow = ({ index, ...props }) => {
|
||||||
|
|
||||||
<Row gutter={[16]}>
|
<Row gutter={[16]}>
|
||||||
{
|
{
|
||||||
loading ? <span>文件正在上传中,请等待</span> :
|
// loading ? <span>文件正在上传中,请等待</span> :
|
||||||
imgfileList.length > 0 && imgfileList.map(file => {
|
imgfileList.length > 0 && imgfileList.map(file => {
|
||||||
return (
|
return (
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
|
||||||
const [url, setUrl] = useState('')
|
const [url, setUrl] = useState('')
|
||||||
const [isModal, setIsModal] = useState(false)
|
const [isModal, setIsModal] = useState(false)
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
|
const [searchValue, setSearchValue] = useState('');
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -161,7 +161,28 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
|
||||||
|
|
||||||
}, [type, formJsonData, isModalOpen])
|
}, [type, formJsonData, isModalOpen])
|
||||||
|
|
||||||
|
const handleTreeData = (treeData, searchValue = '') => {
|
||||||
|
const loop = (data) => {
|
||||||
|
return data.map((item) => {
|
||||||
|
const strTitle = item.title?.toString() || '';
|
||||||
|
const matchValue = strTitle.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
||||||
|
|
||||||
|
const children = item.children ? loop(item.children) : [];
|
||||||
|
const hasChildren = children && children.length > 0;
|
||||||
|
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
disabled: hasChildren, // 有子节点的设为禁用
|
||||||
|
children: hasChildren ? children : undefined
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return loop(treeData);
|
||||||
|
};
|
||||||
|
|
||||||
const disableParentNodes = (treeData) => {
|
const disableParentNodes = (treeData) => {
|
||||||
|
debugger
|
||||||
return treeData.map(node => {
|
return treeData.map(node => {
|
||||||
const newNode = { ...node };
|
const newNode = { ...node };
|
||||||
if (node.children && node.children.length > 0) {
|
if (node.children && node.children.length > 0) {
|
||||||
|
|
@ -267,10 +288,14 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||||
allowClear
|
allowClear
|
||||||
|
onSearch={setSearchValue}
|
||||||
fieldNames={item.fieldNames}
|
fieldNames={item.fieldNames}
|
||||||
treeData={disableParentNodes(item.treeData)}
|
treeData={handleTreeData(item.treeData,searchValue)}
|
||||||
treeCheckable={item.multiple}
|
treeCheckable={item.multiple}
|
||||||
disabled={type == 'view'}
|
disabled={type == 'view'}
|
||||||
|
filterTreeNode={(inputValue, treeNode) => {
|
||||||
|
return treeNode.legalName.toLowerCase().includes(inputValue.toLowerCase());
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Form.Item>}
|
</Form.Item>}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue