Browse Source

压缩包固定名称

master
wenlele 2 years ago
parent
commit
021fd7414b
  1. 16
      web/client/src/sections/dataQuality/containers/documentLibrary.js
  2. 72
      web/client/src/sections/safetySpecification/containers/specificationLibrary.js

16
web/client/src/sections/dataQuality/containers/documentLibrary.js

@ -92,7 +92,7 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) {
}) })
Promise.all(result).then(() => { Promise.all(result).then(() => {
zip.generateAsync({ type: "blob" }).then((res) => { zip.generateAsync({ type: "blob" }).then((res) => {
saveAs(res, `${111}.zip`) saveAs(res, `标准文档.zip`)
}) })
}) })
} }
@ -170,13 +170,11 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) {
<Popconfirm <Popconfirm
title="是否删除文件夹或文件?当有创建的业务规则与标准文档关联时则不允许删除。" title="是否删除文件夹或文件?当有创建的业务规则与标准文档关联时则不允许删除。"
onConfirm={() => { onConfirm={() => {
console.log(folderId.current, fileId.current);
if (folderId.current?.length || fileId.current?.length) { if (folderId.current?.length || fileId.current?.length) {
dispatch(dataQuality.postFolderFile({ folderId: folderId.current, fileId: fileId.current })).then(res => { dispatch(dataQuality.postFolderFile({ folderId: folderId.current, fileId: fileId.current })).then(res => {
if (res.success) { if (res.success) {
resourceData(parent, keywords) resourceData(parent, keywords)
setCheckAll(false) setCheckAll(false)
console.log(res);
res.payload.data?.map(v => { res.payload.data?.map(v => {
RouteRequest.delete(RouteTable.cleanUpUploadTrash, { url: v }); RouteRequest.delete(RouteTable.cleanUpUploadTrash, { url: v });
}) })
@ -275,8 +273,8 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) {
}} > }} >
<CreditCardFilled style={{ fontSize: 96, color: 'rgb(238 200 44)', marginRight: 8 }} /> <CreditCardFilled style={{ fontSize: 96, color: 'rgb(238 200 44)', marginRight: 8 }} />
<div style={{ width: 200, display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' }}> <div style={{ width: 200, display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' }}>
<div style={{ <div title={v.name} style={{
width: 100, whiteSpace: 'nowrap', overflow: 'hidden', fontWeight: 400, width: 200, whiteSpace: 'nowrap', overflow: 'hidden', fontWeight: 400,
textOverflow: 'ellipsis', fontSize: 18, color: 'rgb(51 161 34)' textOverflow: 'ellipsis', fontSize: 18, color: 'rgb(51 161 34)'
}}> }}>
{v.name} {v.name}
@ -301,13 +299,15 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) {
}}> }}>
<FilePdfOutlined style={{ fontSize: 96, color: 'rgb(33 211 180)', marginRight: 8 }} /> <FilePdfOutlined style={{ fontSize: 96, color: 'rgb(33 211 180)', marginRight: 8 }} />
<div style={{ width: 200, display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' }}> <div style={{ width: 200, display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' }}>
<div style={{ <div title={v.docName} style={{
width: 100, whiteSpace: 'nowrap', overflow: 'hidden', fontWeight: 400, width: 200, whiteSpace: 'nowrap', overflow: 'hidden', fontWeight: 400,
textOverflow: 'ellipsis', fontSize: 18, color: 'rgb(51 161 34)' textOverflow: 'ellipsis', fontSize: 18, color: 'rgb(51 161 34)'
}}> }}>
{v.docName} {v.docName}
</div> </div>
<div>标签{v.tags || '--'}</div> <div title={v.tags} style={{
width: 200, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'
}}>标签{v.tags || '--'}</div>
<div>标准类型{v.standardType}</div> <div>标准类型{v.standardType}</div>
<div>创建时间{v.createAt && moment(v.createAt).format('YYYY-MM-DD HH:mm:ss') || '--'}</div> <div>创建时间{v.createAt && moment(v.createAt).format('YYYY-MM-DD HH:mm:ss') || '--'}</div>
</div> </div>

72
web/client/src/sections/safetySpecification/containers/specificationLibrary.js

@ -5,7 +5,7 @@ import { RouteRequest } from '@peace/utils';
import { RouteTable } from '$utils' import { RouteTable } from '$utils'
import SimpleBar from 'simplebar-react'; import SimpleBar from 'simplebar-react';
import FileModal from '../components/fileModal'; import FileModal from '../components/fileModal';
import { Input, Space, Button, message, Pagination } from 'antd'; import { Input, Space, Button, message, Pagination, Popconfirm } from 'antd';
const { Search } = Input; const { Search } = Input;
import { FilePdfOutlined } from '@ant-design/icons'; import { FilePdfOutlined } from '@ant-design/icons';
@ -69,7 +69,7 @@ function SpecificationLibrary ({ loading, clientHeight, actions, dispatch, }) {
}) })
Promise.all(result).then(() => { Promise.all(result).then(() => {
zip.generateAsync({ type: "blob" }).then((res) => { zip.generateAsync({ type: "blob" }).then((res) => {
saveAs(res, `${111}.zip`) saveAs(res, `数据安全规范.zip`)
}) })
}) })
@ -109,33 +109,39 @@ function SpecificationLibrary ({ loading, clientHeight, actions, dispatch, }) {
}); });
} }
}}>下载</Button> }}>下载</Button>
<Button type="primary" onClick={() => { <Popconfirm
if (fileId.current?.length) { title="确认删除选中的文件吗?"
dispatch(safetySpecification.delSpecifications(fileId.current)).then(res => { onConfirm={() => {
if (res.success) { if (fileId.current?.length) {
let url = [] dispatch(safetySpecification.delSpecifications(fileId.current)).then(res => {
fileData?.data?.map(f => { if (res.success) {
if (fileId.current?.includes(f.id)) { let url = []
url.push(f.path) fileData?.data?.map(f => {
} if (fileId.current?.includes(f.id)) {
}) url.push(f.path)
url.map(d => { }
RouteRequest.delete(RouteTable.cleanUpUploadTrash, { url: d }); })
}) url.map(d => {
resourceData({ page: 0, limit: 20, keyword: keyword }) RouteRequest.delete(RouteTable.cleanUpUploadTrash, { url: d });
fileId.current = [] })
setFileIds([]) resourceData({ page: 0, limit: 20, keyword: keyword })
setFileIds(false) fileId.current = []
setCheckAll(false) setFileIds([])
} setFileIds(false)
}) setCheckAll(false)
} else { }
message.warning({ })
duration: 1, } else {
content: '未选择文件', message.warning({
}); duration: 1,
} content: '未选择文件',
}}>删除</Button> });
}
}}
>
<Button type="primary" >删除</Button>
</Popconfirm>
</Space> </Space>
<Search <Search
@ -177,13 +183,15 @@ function SpecificationLibrary ({ loading, clientHeight, actions, dispatch, }) {
}}> }}>
<FilePdfOutlined style={{ fontSize: 96, color: 'rgb(33 211 180)', marginRight: 8 }} /> <FilePdfOutlined style={{ fontSize: 96, color: 'rgb(33 211 180)', marginRight: 8 }} />
<div style={{ width: 200, display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' }}> <div style={{ width: 200, display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' }}>
<div style={{ <div title={v.fileName} style={{
width: 100, whiteSpace: 'nowrap', overflow: 'hidden', fontWeight: 400, width: 200, whiteSpace: 'nowrap', overflow: 'hidden', fontWeight: 400,
textOverflow: 'ellipsis', fontSize: 18, color: 'rgb(51 161 34)' textOverflow: 'ellipsis', fontSize: 18, color: 'rgb(51 161 34)'
}}> }}>
{v.fileName} {v.fileName}
</div> </div>
<div>标签{v.tags || '--'}</div> <div title={v.tags} style={{
width: 200, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'
}}>标签{v.tags || '--'}</div>
<div>创建时间{v.createAt && moment(v.createAt).format('YYYY-MM-DD HH:mm:ss') || '--'}</div> <div>创建时间{v.createAt && moment(v.createAt).format('YYYY-MM-DD HH:mm:ss') || '--'}</div>
</div> </div>
</div> </div>

Loading…
Cancel
Save