|  | @@ -17,6 +17,7 @@ import {
 | 
											
												
													
														|  |  import dayjs from 'dayjs';
 |  |  import dayjs from 'dayjs';
 | 
											
												
													
														|  |  import { PageContainer, ProCard } from '@ant-design/pro-components';
 |  |  import { PageContainer, ProCard } from '@ant-design/pro-components';
 | 
											
												
													
														|  |  import { useRequest, useModel } from '@umijs/max';
 |  |  import { useRequest, useModel } from '@umijs/max';
 | 
											
												
													
														|  | 
 |  | +import axios from 'axios';
 | 
											
												
													
														|  |  import {
 |  |  import {
 | 
											
												
													
														|  |    queryDirCreate,
 |  |    queryDirCreate,
 | 
											
												
													
														|  |    queryDirList,
 |  |    queryDirList,
 | 
											
										
											
												
													
														|  | @@ -32,6 +33,7 @@ import { PlusCircleOutlined } from '@ant-design/icons';
 | 
											
												
													
														|  |  import AddFileModal from './components/model';
 |  |  import AddFileModal from './components/model';
 | 
											
												
													
														|  |  import PerModal from './components/PreModal';
 |  |  import PerModal from './components/PreModal';
 | 
											
												
													
														|  |  import { queryAuditList, createAduit } from '@/services/boom';
 |  |  import { queryAuditList, createAduit } from '@/services/boom';
 | 
											
												
													
														|  | 
 |  | +import {stringify} from 'qs'
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  const tempData = [
 |  |  const tempData = [
 | 
											
												
													
														|  |    { name: '文件1', upload_user: '管理员', upload_time: '2023-04-08 11:00:00' },
 |  |    { name: '文件1', upload_user: '管理员', upload_time: '2023-04-08 11:00:00' },
 | 
											
										
											
												
													
														|  | @@ -157,16 +159,15 @@ function FileManagement(props) {
 | 
											
												
													
														|  |    });
 |  |    });
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    //下载文件
 |  |    //下载文件
 | 
											
												
													
														|  | -  const { data: fileData, run:runDownload } = useRequest((data) => queryFileDownload(data), {
 |  | 
 | 
											
												
													
														|  | -    manual: true,
 |  | 
 | 
											
												
													
														|  | -    onSuccess: (data) => {
 |  | 
 | 
											
												
													
														|  | -      console.log("==================", data)
 |  | 
 | 
											
												
													
														|  | -      message.success('文件下载成功')
 |  | 
 | 
											
												
													
														|  | -    },
 |  | 
 | 
											
												
													
														|  | -    onError: (data) => {
 |  | 
 | 
											
												
													
														|  | -      message.error('文件下载失败')
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -  })
 |  | 
 | 
											
												
													
														|  | 
 |  | +  // const { data: fileData, run:runDownload } = useRequest((data) => queryFileDownload(data), {
 | 
											
												
													
														|  | 
 |  | +  //   manual: true,
 | 
											
												
													
														|  | 
 |  | +  //   onSuccess: (data) => {
 | 
											
												
													
														|  | 
 |  | +  //     message.success('文件下载成功')
 | 
											
												
													
														|  | 
 |  | +  //   },
 | 
											
												
													
														|  | 
 |  | +  //   onError: (data) => {
 | 
											
												
													
														|  | 
 |  | +  //     message.error('文件下载失败')
 | 
											
												
													
														|  | 
 |  | +  //   }
 | 
											
												
													
														|  | 
 |  | +  // })
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    const [expandedKeys, setExpandedKeys] = useState([]);
 |  |    const [expandedKeys, setExpandedKeys] = useState([]);
 | 
											
												
													
														|  |    const [searchValue, setSearchValue] = useState('');
 |  |    const [searchValue, setSearchValue] = useState('');
 | 
											
										
											
												
													
														|  | @@ -186,7 +187,7 @@ function FileManagement(props) {
 | 
											
												
													
														|  |        title: '操作',
 |  |        title: '操作',
 | 
											
												
													
														|  |        render: (_, record) => (
 |  |        render: (_, record) => (
 | 
											
												
													
														|  |          <Space>
 |  |          <Space>
 | 
											
												
													
														|  | -          <a onClick={()=>{}}>查看</a>
 |  | 
 | 
											
												
													
														|  | 
 |  | +          <a onClick={()=>handleSeeClick(record)}>查看</a>
 | 
											
												
													
														|  |            <a onClick={() => onDownload(record)}>下载</a>
 |  |            <a onClick={() => onDownload(record)}>下载</a>
 | 
											
												
													
														|  |            {node?.dir_type == 0 && <a>删除</a>}
 |  |            {node?.dir_type == 0 && <a>删除</a>}
 | 
											
												
													
														|  |          </Space>
 |  |          </Space>
 | 
											
										
											
												
													
														|  | @@ -278,7 +279,7 @@ function FileManagement(props) {
 | 
											
												
													
														|  |        run({ dir_id:node.id })
 |  |        run({ dir_id:node.id })
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | + cons
 | 
											
												
													
														|  |    const handleSelect = (SelectKeys, e) => {
 |  |    const handleSelect = (SelectKeys, e) => {
 | 
											
												
													
														|  |      console.log(e, SelectKeys)
 |  |      console.log(e, SelectKeys)
 | 
											
												
													
														|  |      const node = e.node;
 |  |      const node = e.node;
 | 
											
										
											
												
													
														|  | @@ -288,24 +289,23 @@ function FileManagement(props) {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    const onDownload = (record) => {
 |  |    const onDownload = (record) => {
 | 
											
												
													
														|  | -    runDownload({file_id:record.id, path:record.path, file_type:node.dir_type })
 |  | 
 | 
											
												
													
														|  | 
 |  | +    // runDownload({file_id:record.id, path:record.path, file_type:node.dir_type })
 | 
											
												
													
														|  |      // const token = getToken();
 |  |      // const token = getToken();
 | 
											
												
													
														|  | -    // downloadFile(
 |  | 
 | 
											
												
													
														|  | -    //   `/api/archive/v1/file/download?file_id=${record.id}&JWT-TOKEN=${token}`,
 |  | 
 | 
											
												
													
														|  | -    //   record.file_name,
 |  | 
 | 
											
												
													
														|  | -    //   false,
 |  | 
 | 
											
												
													
														|  | -    // );
 |  | 
 | 
											
												
													
														|  | -    // downloadFile(
 |  | 
 | 
											
												
													
														|  | -    //   `http://47.96.12.136:8888/api/archive/v1/file/download?file_id=${record.id}&JWT-TOKEN=${token}`,
 |  | 
 | 
											
												
													
														|  | -    //   record.file_name,
 |  | 
 | 
											
												
													
														|  | -    //   false,
 |  | 
 | 
											
												
													
														|  | -    // );
 |  | 
 | 
											
												
													
														|  | 
 |  | +    const data = {file_id:record.id, path:record.path, file_type:node.dir_type }
 | 
											
												
													
														|  | 
 |  | +    window.downloadFile(`/api/archive/v1/file/download?${stringify(data)}`, record.dir_name, false);
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const onDownloadOA = (record) => {
 |  | 
 | 
											
												
													
														|  | 
 |  | +  const handleSeeClick = (record) => {
 | 
											
												
													
														|  |      const token = getToken();
 |  |      const token = getToken();
 | 
											
												
													
														|  | -    downloadFile(record.url, record.name);
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | 
 |  | +    const data = {file_id:record.id, path:record.path, file_type:node.dir_type,'JWT-TOKEN':token }
 | 
											
												
													
														|  | 
 |  | +    axios.get(`/api/archive/v1/file/download?${stringify(data)}`)
 | 
											
												
													
														|  | 
 |  | +      .then(function (response) {
 | 
											
												
													
														|  | 
 |  | +        console.log(response);
 | 
											
												
													
														|  | 
 |  | +      })
 | 
											
												
													
														|  | 
 |  | +      .catch(function (error) {
 | 
											
												
													
														|  | 
 |  | +        console.log(error);
 | 
											
												
													
														|  | 
 |  | +      });
 | 
											
												
													
														|  | 
 |  | +  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    const handleFilesChange = () => {
 |  |    const handleFilesChange = () => {
 | 
											
												
													
														|  |      const inputDom = document.getElementById('files');
 |  |      const inputDom = document.getElementById('files');
 | 
											
										
											
												
													
														|  | @@ -372,7 +372,7 @@ function FileManagement(props) {
 | 
											
												
													
														|  |                <Button type="primary" onClick={ ()=>document.getElementById('files')?.click()} disabled={node ? false : true}>上传</Button>
 |  |                <Button type="primary" onClick={ ()=>document.getElementById('files')?.click()} disabled={node ? false : true}>上传</Button>
 | 
											
												
													
														|  |              </Form.Item>
 |  |              </Form.Item>
 | 
											
												
													
														|  |              <Form.Item>
 |  |              <Form.Item>
 | 
											
												
													
														|  | -              <Button type="primary" onClick={() => setPerOpen(true)} disabled={node ? false : true}>
 |  | 
 | 
											
												
													
														|  | 
 |  | +              <Button type="primary" onClick={() => setPerOpen(true)} disabled={selectedRowKeys ? false : true}>
 | 
											
												
													
														|  |                  申请权限
 |  |                  申请权限
 | 
											
												
													
														|  |                </Button>
 |  |                </Button>
 | 
											
												
													
														|  |              </Form.Item>
 |  |              </Form.Item>
 | 
											
										
											
												
													
														|  | @@ -382,10 +382,12 @@ function FileManagement(props) {
 | 
											
												
													
														|  |                columns={columns}
 |  |                columns={columns}
 | 
											
												
													
														|  |                dataSource={tableData}
 |  |                dataSource={tableData}
 | 
											
												
													
														|  |                rowSelection={{
 |  |                rowSelection={{
 | 
											
												
													
														|  | -                selectedRowKeys,
 |  | 
 | 
											
												
													
														|  | -                onChange: (e) => {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                selectedRowKeys ,
 | 
											
												
													
														|  | 
 |  | +                type:'radio',
 | 
											
												
													
														|  | 
 |  | +                onChange: (e,fileNode) => {
 | 
											
												
													
														|  |                    console.log(e)
 |  |                    console.log(e)
 | 
											
												
													
														|  |                    setSelectedRowKeys(e)
 |  |                    setSelectedRowKeys(e)
 | 
											
												
													
														|  | 
 |  | +                    // (fileNode[0])
 | 
											
												
													
														|  |                }}}
 |  |                }}}
 | 
											
												
													
														|  |                loading={OAloading || contractLoading || loading}
 |  |                loading={OAloading || contractLoading || loading}
 | 
											
												
													
														|  |                style={{ overflowY: 'auto' }}
 |  |                style={{ overflowY: 'auto' }}
 | 
											
										
											
												
													
														|  | @@ -444,6 +446,7 @@ function FileManagement(props) {
 | 
											
												
													
														|  |        />
 |  |        />
 | 
											
												
													
														|  |        <PerModal
 |  |        <PerModal
 | 
											
												
													
														|  |          node={node}
 |  |          node={node}
 | 
											
												
													
														|  | 
 |  | +        fileNode={tableData?.find(item => item.key == selectedRowKeys[0])}
 | 
											
												
													
														|  |          auditList={auditList}
 |  |          auditList={auditList}
 | 
											
												
													
														|  |          visible={permissionOpen}
 |  |          visible={permissionOpen}
 | 
											
												
													
														|  |          handleCancel={() => setPerOpen(false)}
 |  |          handleCancel={() => setPerOpen(false)}
 |