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