Compare commits
No commits in common. "646aa39239ab12c1d2da66d62ce0cf9b3879ed71" and "0e351c0f69cb3e6fb65fb7ae6f000c6da3d1ba41" have entirely different histories.
646aa39239
...
0e351c0f69
|
|
@ -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:'130px'}} preview={false}/>
|
||||
<Image src={zd} style={{margin:'auto',margin:'20px',height:'530px'}} preview={false}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
|
|||
if (mode == 'save') {
|
||||
addBasic(params)
|
||||
} else if (mode == 'edit') {
|
||||
editBasic({...params,caseDate:record.caseDate ? dayjs(record.caseDate).format('YYYY-MM-DD HH:mm:ss'):''})
|
||||
editBasic({...params})
|
||||
}
|
||||
}
|
||||
const addBasic = (params) => {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ const Page = () => {
|
|||
|
||||
refModal.current.showSave();
|
||||
} else if (type === 'edit') {
|
||||
let obj = {}
|
||||
let obj={}
|
||||
if (params.caseDate) {
|
||||
obj.caseDate = params.caseDate ? dayjs(params.caseDate) :undefined
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import { TreeSelect, Table, Tag, DatePicker, Form, Select, Button, message, Upload, Input, Row, Col, Switch, Image, Radio } from 'antd';
|
||||
import { TreeSelect, Table, Tag, DatePicker, Form, Select, Button, message, Upload, Input, Row, Col, Switch, Image,Radio } from 'antd';
|
||||
import './ddForm.less'
|
||||
import dayjs from 'dayjs'
|
||||
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined, VerticalAlignBottomOutlined } from '@ant-design/icons'
|
||||
|
|
@ -13,8 +13,8 @@ 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,
|
||||
|
||||
const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, formJsonData, typeUpload = 'dispatch', isModalOpen, fileType, footer = true, uploadUrl,TableZdyProps,downloadUrl,
|
||||
onSave }) => {
|
||||
const [fileList, setFileList] = useState([])
|
||||
const [fileListUp, setFileLisUp] = useState([])
|
||||
|
|
@ -23,7 +23,6 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
const [loading, setLoading] = useState(false)
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
|
||||
const treeRef = useRef();
|
||||
|
||||
//
|
||||
const [form] = Form.useForm();
|
||||
|
|
@ -120,18 +119,18 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
}
|
||||
|
||||
/**
|
||||
* @description 文件下载
|
||||
* @param {String} params 文件fileId
|
||||
*/
|
||||
const download = async (id, name) => {
|
||||
* @description 文件下载
|
||||
* @param {String} params 文件fileId
|
||||
*/
|
||||
const download = async(id, name) => {
|
||||
var extension = name?.split('.').pop().toLowerCase();
|
||||
httpgetExport(downloadUrl + id).then(res => {
|
||||
exportFile(name, res.data)
|
||||
httpgetExport(downloadUrl+id).then(res => {
|
||||
exportFile(name,res.data)
|
||||
})
|
||||
}
|
||||
useEffect(() => {
|
||||
useEffect(()=>{
|
||||
form.resetFields()
|
||||
}, [])
|
||||
},[])
|
||||
useEffect(() => {
|
||||
|
||||
let formType = type
|
||||
|
|
@ -163,48 +162,27 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
}, [type, formJsonData, isModalOpen])
|
||||
|
||||
const handleTreeData = (treeData, searchValue = '') => {
|
||||
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 loop = (data) => {
|
||||
return data.map((item) => {
|
||||
const strTitle = item.title?.toString() || '';
|
||||
const matchValue = strTitle.toLowerCase().indexOf(searchValue.toLowerCase()) > -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 {
|
||||
title: title,
|
||||
key: item.id,
|
||||
name: strTitle
|
||||
...item,
|
||||
disabled: hasChildren, // 有子节点的设为禁用
|
||||
children: hasChildren ? children : undefined
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
return loop(treeData);
|
||||
};
|
||||
|
||||
const disableParentNodes = (treeData) => {
|
||||
|
||||
debugger
|
||||
return treeData.map(node => {
|
||||
const newNode = { ...node };
|
||||
if (node.children && node.children.length > 0) {
|
||||
|
|
@ -257,7 +235,7 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
name={item.key}
|
||||
rules={[{ required: item.required, message: '请输入' + item.label }]}
|
||||
>
|
||||
<Radio.Group disabled={type == 'view'} options={item.options} />
|
||||
<Radio.Group disabled={type == 'view'} options={item.options}/>
|
||||
</Form.Item>}
|
||||
|
||||
{/* {item.type == "Select" && <Select disabled={type == 1} options={item.options} />} */}
|
||||
|
|
@ -278,7 +256,7 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
rules={[{ required: item.required, message: '请输入' + item.label }]}
|
||||
>
|
||||
{/* {formJsonData[item.key]} */}
|
||||
<DatePicker disabled={type == 'view'} style={{ width: "100%" }} picker={item.picker} />
|
||||
<DatePicker disabled={type == 'view'} style={{ width: "100%" }} picker={item.picker}/>
|
||||
</Form.Item>}
|
||||
|
||||
{/* {item.type == "DatePicker" && <DatePicker disabled={type == 1} style={{ width: "100%" }} />} */}
|
||||
|
|
@ -307,16 +285,14 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
>
|
||||
<TreeSelect
|
||||
showSearch
|
||||
ref={treeRef}
|
||||
style={{ width: '100%' }}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
allowClear
|
||||
onSearch={setSearchValue}
|
||||
fieldNames={item.fieldNames}
|
||||
treeData={disableParentNodes(item.treeData)}
|
||||
treeData={handleTreeData(item.treeData,searchValue)}
|
||||
treeCheckable={item.multiple}
|
||||
disabled={type == 'view'}
|
||||
// treeNodeFilterProp='legalName'
|
||||
filterTreeNode={(inputValue, treeNode) => {
|
||||
return treeNode.legalName.toLowerCase().includes(inputValue.toLowerCase());
|
||||
}}
|
||||
|
|
@ -343,7 +319,7 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
</Dragger>}
|
||||
<div className='flex' >
|
||||
{fileList?.map((item) => {
|
||||
return <div className='flex align-center file-item' style={{ marginTop: 5, marginRight: '3%', width: '30%', minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
|
||||
return <div className='flex align-center file-item' style={{marginTop:5, marginRight:'3%',width:'30%',minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
|
||||
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
|
||||
{checkMediaType(item.fileName) == 'image' && <Image
|
||||
height={40}
|
||||
|
|
@ -375,7 +351,7 @@ const FormZdy = ({ fileKey, typeName = "ddForm", formJson, getFormInfo, type, fo
|
|||
<Button type="primary" onClick={getInfo} loading={loading}>确定</Button>
|
||||
</div>
|
||||
}
|
||||
<PdfView url={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/rescue/goods/file/download/${url}`)}`} isModal={isModal} setModalN={(e) => setIsModal(e)} />
|
||||
<PdfView url={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/rescue/goods/file/download/${url}`)}`} isModal={isModal} setModalN={(e)=>setIsModal(e)}/>
|
||||
|
||||
|
||||
</div >
|
||||
|
|
|
|||
Loading…
Reference in New Issue