Compare commits

..

No commits in common. "646aa39239ab12c1d2da66d62ce0cf9b3879ed71" and "0e351c0f69cb3e6fb65fb7ae6f000c6da3d1ba41" have entirely different histories.

5 changed files with 328 additions and 352 deletions

View File

@ -4,7 +4,7 @@ import zd from '../../../assets/img/wait.png'
const Page = () => { const Page = () => {
return ( return (
<div style={{display:'flex',justifyContent:'center',alignItems:'center',backgroundColor:'#fff',height:'100%',padding:'20px'}}> <div style={{display:'flex',justifyContent:'center',alignItems:'center',backgroundColor:'#fff',height:'100%',padding:'20px'}}>
<Image src={zd} style={{margin:'auto',margin:'20px',height:'130px'}} preview={false}/> <Image src={zd} style={{margin:'auto',margin:'20px',height:'530px'}} preview={false}/>
</div> </div>
) )
} }

View File

@ -96,9 +96,9 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<Form.Item label="施行日期" name="implementationDate"> <Form.Item label="施行日期" name="implementationDate">
<RangePicker allowClear /> <RangePicker allowClear />
</Form.Item> </Form.Item>
{/* <Form.Item label="" name="uploadTime"> <Form.Item label="上传时间" name="uploadTime">
<RangePicker allowClear /> <RangePicker allowClear />
</Form.Item> */} </Form.Item>
</div>} </div>}
</Form> </Form>
</div> </div>

View File

@ -68,7 +68,7 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
if (mode == 'save') { if (mode == 'save') {
addBasic(params) addBasic(params)
} else if (mode == 'edit') { } else if (mode == 'edit') {
editBasic({...params,caseDate:record.caseDate ? dayjs(record.caseDate).format('YYYY-MM-DD HH:mm:ss'):''}) editBasic({...params})
} }
} }
const addBasic = (params) => { const addBasic = (params) => {

View File

@ -13,7 +13,7 @@ const { RangePicker } = DatePicker;
const { TextArea } = Input; const { TextArea } = Input;
const baseUrl = "http://223.75.53.141:9100/gs-tsg" const baseUrl = "http://223.75.53.141:9100/gs-tsg"
let dataList = [];
const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, formJsonData, typeUpload = 'dispatch', isModalOpen, fileType, footer = true, uploadUrl,TableZdyProps,downloadUrl, const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, formJsonData, typeUpload = 'dispatch', isModalOpen, fileType, footer = true, uploadUrl,TableZdyProps,downloadUrl,
onSave }) => { onSave }) => {
const [fileList, setFileList] = useState([]) const [fileList, setFileList] = useState([])
@ -23,7 +23,6 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [searchValue, setSearchValue] = useState(''); const [searchValue, setSearchValue] = useState('');
const treeRef = useRef();
// //
const [form] = Form.useForm(); const [form] = Form.useForm();
@ -163,48 +162,27 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
}, [type, formJsonData, isModalOpen]) }, [type, formJsonData, isModalOpen])
const handleTreeData = (treeData, searchValue = '') => { const handleTreeData = (treeData, searchValue = '') => {
const loop = (treeData) => const loop = (data) => {
treeData.map((item) => { return data.map((item) => {
const strTitle = item.legalName; const strTitle = item.title?.toString() || '';
const index = strTitle?.indexOf(searchValue); const matchValue = strTitle.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
const beforeStr = strTitle.substring(0, index);
const afterStr = strTitle.slice(index + searchValue?.length);
const title =
index > -1 ? (
<span key={item.id}>
{beforeStr}
<span className="site-tree-search-value" style={{ color: 'red' }}>{searchValue}</span>
{afterStr}
</span>
) : (
<span key={item.id}>{strTitle}</span>
);
if (item.children) {
return { title: title, key: item.id, children: loop(item.children), name: strTitle };
}
if (index > -1) {
console.log(index, strTitle, searchValue); const children = item.children ? loop(item.children) : [];
const hasChildren = children && children.length > 0;
dataList.push(item.id)
// setExpandedKeys(dataList);
if (dataList.length < 2) {
treeRef.current.scrollTo({ key: dataList[0].id });
}
}
return { return {
title: title, ...item,
key: item.id, disabled: hasChildren, // 有子节点的设为禁用
name: strTitle children: hasChildren ? children : undefined
}; };
}); });
};
return loop(treeData); 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) {
@ -307,16 +285,14 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
> >
<TreeSelect <TreeSelect
showSearch showSearch
ref={treeRef}
style={{ width: '100%' }} style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
allowClear allowClear
onSearch={setSearchValue} 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'}
// treeNodeFilterProp='legalName'
filterTreeNode={(inputValue, treeNode) => { filterTreeNode={(inputValue, treeNode) => {
return treeNode.legalName.toLowerCase().includes(inputValue.toLowerCase()); return treeNode.legalName.toLowerCase().includes(inputValue.toLowerCase());
}} }}