From 3efcd38c47c327dcd8bd22cd523381d79d08770e Mon Sep 17 00:00:00 2001 From: dminyi <1301963064@qq.com> Date: Sat, 07 Sep 2024 16:56:44 +0800 Subject: [PATCH] 上传附件 --- gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx | 34 +++++++++++++++++++++++++--------- gz-customerSystem/src/views/filesCheck/newFileCheck.jsx | 2 +- gz-customerSystem/src/api/appUrl.js | 4 ++-- gz-customerSystem/src/api/apiHandler.js | 15 +++++++++++++-- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/gz-customerSystem/src/api/apiHandler.js b/gz-customerSystem/src/api/apiHandler.js index dd29b23..a18c67e 100644 --- a/gz-customerSystem/src/api/apiHandler.js +++ b/gz-customerSystem/src/api/apiHandler.js @@ -2,7 +2,7 @@ * @Company: hugeInfo * @Author: ldh * @Date: 2022-02-16 11:28:12 - * @LastEditTime: 2024-08-29 14:25:03 + * @LastEditTime: 2024-09-07 16:45:38 * @LastEditors: dminyi 1301963064@qq.com * @Version: 1.0.0 * @Description: axios处理方法 @@ -70,7 +70,18 @@ networkException(err); return { type: false }; }); - } else { + } else if (value.type === 'delete') { + return ax + .delete(url, { params: data, headers: { 'Authorization': token } }) + .then((response) => { + return resHandle(response.data); + }) + .catch((err) => { + networkException(err); + return { type: false }; + }); + } + else { return ax .post(url, data, { headers: { 'Authorization': token } }) .then((response) => { diff --git a/gz-customerSystem/src/api/appUrl.js b/gz-customerSystem/src/api/appUrl.js index 0a06d79..2cf0ece 100644 --- a/gz-customerSystem/src/api/appUrl.js +++ b/gz-customerSystem/src/api/appUrl.js @@ -2,7 +2,7 @@ * @Company: hugeInfo * @Author: ldh * @Date: 2022-02-16 11:25:57 - * @LastEditTime: 2024-09-07 16:09:36 + * @LastEditTime: 2024-09-07 16:35:00 * @LastEditors: dminyi 1301963064@qq.com * @Version: 1.0.0 * @Description: api地址 @@ -18,7 +18,7 @@ // fileUrl: 'http://gz.hugeinfo.com.cn', // 文件查看url 后面接附件编号 - fileShowUrl: "/dyh-sys/api/web/fileInfo/show/", + fileShowUrl: "/dyh-sys/api/v1/fileInfo/show/", // 文件下载url 后面接附件编号 fileDownUrl: "/dyh-sys/api/v1/fileInfo/down/", // 在线文档编辑链接 diff --git a/gz-customerSystem/src/views/filesCheck/newFileCheck.jsx b/gz-customerSystem/src/views/filesCheck/newFileCheck.jsx index ee9ddb3..8636736 100644 --- a/gz-customerSystem/src/views/filesCheck/newFileCheck.jsx +++ b/gz-customerSystem/src/views/filesCheck/newFileCheck.jsx @@ -349,7 +349,7 @@ </Tooltip> </div> </div> - {files[fileIndex]?.ownerCat === "22_00014-1" ? ( + {files[fileIndex]?.ownerCat === '22_00014_1' ? ( <div className="filesCheck-main-imgBg" ref={imgBgRef}> <img ref={imgRef} diff --git a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx index fd11eb0..0d9db5b 100644 --- a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx +++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx @@ -29,12 +29,16 @@ const InputSearch = Input.Search; const appUrl = $$.appUrl; -function delFile(id) { - return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } }); +function delFile(ids) { + return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'delete', service: 'sys', data: { ids } }); } function listIdTypeInfoApi(data) { return $$.ax.request({ url: `fileInfo/listIdTypeInfo`, type: 'post', service: 'sys', data }); +} + +function deleteFileByIdApi(data) { + return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'delete', service: 'sys', data }); } const VisitorRegister = (props) => { @@ -132,6 +136,16 @@ } } + //批量删除文件 + const deleteFileById = async (data) => { + const res = await deleteFileByIdApi(data) + if (res.type) { + $$.infoSuccess({ content: '删除成功!' }); + } + } + + + const listIdTypeInfo = async () => { const res = await listIdTypeInfoApi({ @@ -147,8 +161,8 @@ } } - // console.log(fakeData1,'fakeData1') - + console.log(fakeData1,'fakeData1') + @@ -163,7 +177,6 @@ action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&&ownerId=${props.mainId}&ownerType=22_00018-101`, }} field='file' - handleChangeFile={handleChangeFile} label='' editData={props.editData} handleDelFile={handleDelFile} @@ -184,14 +197,13 @@ action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.mainId}&&ownerId=${props.mainId}&ownerType=22_00018-102`, }} field='file1' - handleChangeFile={handleChangeFile1} label='' editData={props.editData} handleDelFile={handleDelFile} onFileListChange={(v) => { SetEvidenceLength(v); console.log(v, 'vvsetFileLength') }} /> - {evidenceLength?.length > 0 && <div style={{ position: 'absolute', top: '198px', left: '16px', color: '#86909C' }}>申请材料累计上传:<span style={{ color: '#1A6FB8' }}>{evidenceLength?.length}</span></div>} + {evidenceLength?.length > 0 && <div style={{ position: 'absolute', top: '198px', left: '16px', color: '#86909C' }}>证据材料累计上传:<span style={{ color: '#1A6FB8' }}>{evidenceLength?.length}</span></div>} </Col> </> ) @@ -335,12 +347,16 @@ setEditData(value) } + + + + const uploadQuery = { mainId: props.mainId, ownerCat: null, createStart: null, createEnd: null, - uploaderType:null + uploaderType: null } // console.log(sourceType, 'sourceType') @@ -642,7 +658,7 @@ <Modal style={{ width: '1200px' }} visible={filesCheck} onCancel={() => setFilesCheck(false)} footer={null} title='查看事件材料' centered> {/* <div className="mediationWindow-modal-main" style={{ display: 'flex' }}> */} <div style={{ marginTop: '-16px' }}> - <NewFileCheck /> + <NewFileCheck /> </div> {/* </div> */} </Modal> -- Gitblit v1.8.0