qzc-dev-demo
秦子超 2025-04-10 17:01:01 +08:00
commit 5c7622aa52
5 changed files with 352 additions and 328 deletions

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@ const { RangePicker } = DatePicker;
const { TextArea } = Input;
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,
onSave }) => {
const [fileList, setFileList] = useState([])
@ -23,6 +23,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
const [loading, setLoading] = useState(false)
const [searchValue, setSearchValue] = useState('');
const treeRef = useRef();
//
const [form] = Form.useForm();
@ -162,27 +163,48 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
}, [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 loop = (treeData) =>
treeData.map((item) => {
const strTitle = item.legalName;
const index = strTitle?.indexOf(searchValue);
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) {
const children = item.children ? loop(item.children) : [];
const hasChildren = children && children.length > 0;
console.log(index, strTitle, searchValue);
dataList.push(item.id)
// setExpandedKeys(dataList);
if (dataList.length < 2) {
treeRef.current.scrollTo({ key: dataList[0].id });
}
}
return {
...item,
disabled: hasChildren, // 有子节点的设为禁用
children: hasChildren ? children : undefined
title: title,
key: item.id,
name: strTitle
};
});
};
return loop(treeData);
};
const disableParentNodes = (treeData) => {
debugger
return treeData.map(node => {
const newNode = { ...node };
if (node.children && node.children.length > 0) {
@ -285,14 +307,16 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
>
<TreeSelect
showSearch
ref={treeRef}
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
allowClear
onSearch={setSearchValue}
fieldNames={item.fieldNames}
treeData={handleTreeData(item.treeData,searchValue)}
treeData={disableParentNodes(item.treeData)}
treeCheckable={item.multiple}
disabled={type == 'view'}
// treeNodeFilterProp='legalName'
filterTreeNode={(inputValue, treeNode) => {
return treeNode.legalName.toLowerCase().includes(inputValue.toLowerCase());
}}