fix(): 修改上传附件
parent
3a4153f941
commit
a3aa86f1f7
|
|
@ -74,6 +74,9 @@ const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox
|
|||
setTreeData(adcdTreedata);
|
||||
setLoading(false);
|
||||
setOrderMax(Math.max(...adcdTreedata.map((item:any) => item?.orderIndex)))
|
||||
}else {
|
||||
setLoading(false);
|
||||
setTreeData([])
|
||||
}
|
||||
};
|
||||
// @ts-ignore
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox
|
|||
setTreeData(adcdTreedata);
|
||||
setLoading(false);
|
||||
setOrderMax(Math.max(...adcdTreedata.map((item:any) => item?.orderIndex)))
|
||||
} else {
|
||||
setLoading(false);
|
||||
setTreeData([])
|
||||
}
|
||||
};
|
||||
// @ts-ignore
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [filesParams, setFilesParams] = useState([])
|
||||
const [fileUploading, setFileUploading] = useState(false) // 新增文件上传状态
|
||||
|
||||
const onfinish = (values) => {
|
||||
const userId = localStorage.getItem("userId");
|
||||
const userName = localStorage.getItem("userName");
|
||||
|
|
@ -105,8 +107,9 @@ useEffect(() => {
|
|||
mode={mode}
|
||||
fileNum={999}
|
||||
uploadUrl={apiurl.zsk.gcaq.upload}
|
||||
onChange={(v) => { setFilesParams(v)}}
|
||||
value={filesParams}
|
||||
onChange={(v) => { setFilesParams(v)}}
|
||||
value={filesParams}
|
||||
onLoadingChange={(isLoading) => setFileUploading(isLoading)}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -115,8 +118,8 @@ useEffect(() => {
|
|||
mode === 'view' ? null : (
|
||||
<>
|
||||
<Form.Item {...btnItemLayout}>
|
||||
<Button type="primary" htmlType="submit" loading={loading}>
|
||||
{mode === 'save' ? '提交' : '修改'}
|
||||
<Button type="primary" htmlType="submit" loading={loading} disabled={fileUploading}>
|
||||
{fileUploading ? '文件上传中...' : (mode === 'save' ? '提交' : '修改')}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [filesParams, setFilesParams] = useState([])
|
||||
const [fileUploading, setFileUploading] = useState(false) // 新增文件上传状态
|
||||
const onfinish = (values) => {
|
||||
const userId = localStorage.getItem("userId");
|
||||
const userName = localStorage.getItem("userName");
|
||||
|
|
@ -121,9 +122,10 @@ useEffect(() => {
|
|||
mode={mode}
|
||||
fileNum={999}
|
||||
uploadUrl={apiurl.zsk.ywgz.upload}
|
||||
onChange={(v) => { setFilesParams(v);console.log("vvvv",v);
|
||||
onChange={(v) => { setFilesParams(v);console.log("vvvv",v);
|
||||
}}
|
||||
value={filesParams}
|
||||
onLoadingChange={(isLoading) => setFileUploading(isLoading)}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -132,8 +134,8 @@ useEffect(() => {
|
|||
mode === 'view' ? null : (
|
||||
<>
|
||||
<Form.Item {...btnItemLayout}>
|
||||
<Button type="primary" htmlType="submit" loading={loading}>
|
||||
{mode === 'save' ? '提交' : '修改'}
|
||||
<Button type="primary" htmlType="submit" loading={loading} disabled={fileUploading}>
|
||||
{fileUploading ? '文件上传中...' : (mode === 'save' ? '提交' : '修改')}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</>
|
||||
|
|
|
|||
Loading…
Reference in New Issue