From 85176991f992810c624558c29a0dd6044bc56c0b Mon Sep 17 00:00:00 2001 From: wanghx Date: Mon, 8 Jan 2024 17:47:11 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E7=BB=9F=E4=B8=80=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/icon-download-list.png | Bin 0 -> 4946 bytes src/components/layout/Header/downloadModal.jsx | 179 ++++++++++++++++++++- src/components/layout/Header/index.jsx | 4 +- src/components/layout/Header/index.scss | 71 +++++++- .../SystemMgm/MessageMgm/ConfMes/loadable.jsx | 8 +- .../MessageMgm/DeviceAlarmMes/loadable.jsx | 8 +- .../MessageMgm/MonitorCarAlarmMes/loadable.jsx | 8 +- .../MessageMgm/NotificationMes/loadable.jsx | 8 +- src/services/common.js | 18 +++ 9 files changed, 287 insertions(+), 17 deletions(-) create mode 100644 src/assets/images/icon-download-list.png diff --git a/src/assets/images/icon-download-list.png b/src/assets/images/icon-download-list.png new file mode 100644 index 0000000000000000000000000000000000000000..53b764886f5ec5a4c4f90062326d5186e03d588c GIT binary patch literal 4946 zcmdUT`8U*U`2Wl_qxaYv2JvJWW2YjNCEExy)|hM=+hfhXC;J#nWN9J_A=#J6Qj)c- zQDL%^C~MX%W9K{1=ll65K0n;|>zr#lulqW$b6w}$@rDLiCi;KqK_C#5HckUi!=C>R zKu5b@n^)%00PKgys)H)OaW8{FNJec9jPV2OwQM+&E>UA{%2z z*TTf|UBf)-XVsYRwG_JNIk2dB*4j(w$KRu7%msyS6amo9k1U2RPS3VJc~(K<1O!u_ zWLPJpF#+gQHE!-s@i#0nnBKL->aZbkqR|w!Z zR4gBzW4{f2rY?R0_34-Tx0dluj<@NOq z8{<7EQDIwAJmB*uf@`{RYfBR`-}77FJOTBa3$B_k9!$?eMgBD%m>SeTv@a5BQIkiZ z4?ikvii8x;dPqpvK#gJ*Gc*F|rL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Orl6;b=kePkN!c8k`o-wIvt%ce+%OpKRkTeOKs*4lBQ* z$p6#EpwSfNCqMt+o!_e9cu`}|D`elXIK@CH9&wMTW=EQmt6Ru7 zsXVnS%Piw|knF8LVj8+ah$gZ^;^BDSvQTcle*KY{(AVV-Eh&QN$PVc8C2kd=mzxT| zkS%j=KjNZN*IWTXVVrq*&_D!F^ew8pX3L0)jOAz6Y}#WVoW2GHPn#5lN z?G6F6bVQ43CrtoxsEGkxJ0uN-^|W1wwA7%3vDU0vYHHAH|LWlLZ$Qv-H+E9SpfrTv zN%`mP{|O3IF`Ua%cd^Bn?sH06@yw13=YX+A6%QV5JANrRnC^Mp4diw?sF@9MQt;f3 zpv?XTeqqNk>U5AJ?@}~F+k+~^MTovGag&a750*IDxJ5lwKAO@cTlb$Sp3}|bh?5nD z3iH3wj}?M-w|MTI9axcen3*K)7hWOQAg^_ZaXK-UMQ+Y#jkFn*mIXd6H-!m=F+~1k znITw;glO*n{7rh=JSzhZ*F(U;{BKsKe9~7Oc=;|CjBfKe&oD*`K%?94L!igHAFKNd zwgxt@*@k1<09xdE@GJXL*(FKgPx=rn07M2NZM&Ye%izx5$@HlIPnxwe`KWaDU z-^Kz_x0QtSKP0(B=0<%LCX^;3!vCE1`^Bk>D|KS8sZ6M>&~_y^EX&e4Zn)dm8#jtO;_J?JAd;Zjmw z-C@<@s^^wUG6Q?n`3H8O`CYd?L4+8 zGvM)5tZ{O#sURXpL4M5lvw;GY)j{OxTCVoK?$*a<_6w<|s~I*91FEsP3e?r`UTkSn z1ni4E4~Kzm7dL~v@l{=y&T}O}!OW6;aH3iKW-jn19e$gQCuG=x=Tvp$z&S (pageInfo.pn - 1) * pageInfo.length + index + 1 + dataIndex: 'name' + }, + { + title: '进度', + width: 200, + align: 'center', + dataIndex: 'progress', + render: (progress) => ((progress || 0) * 100) + '%' + }, + { + title: '文件大小', + width: 200, + align: 'center', + dataIndex: 'size' + }, + { + title: '排队位置', + width: 150, + align: 'center', + dataIndex: 'queue' + }, + { + title: '状态', + width: 100, + align: 'center', + dataIndex: 'status', + render: (status) => { + if (status == 1) { + return ( +
导出中
+ ) + } else if (status == 2) { + return ( +
已完成
+ ) + } else if (status == 3) { + return ( +
等待中
+ ) + } + } + }, + { + title: '创建时间', + width: 200, + align: 'center', + dataIndex: 'create_time' + }, + { + title: "操作", + // width: 60, + align: 'center', + render: (text, record, index) => { + return ( +
+ { + record.status == 2 ? ( +
handleDownload(record.url)}>下载
+ ) : null + } +
handleDel(record)}>删除
+
+ ) + } }, ] + const paginationProps = { + className: "pagination-common", + showQuickJumper: true, + showSizeChanger: true, + current: formData.pn, + total: resultData?.total, + pageSize: formData.length, + pageSizeOptions: dictionary.pageSizeOptions, + onChange: (current, size) => { + setFormData({ + ...formData, + ...{ pn: current == formData.pn ? 1 : current, length: size } + }) + ajaxGetDownloadList({ + ...formData, + ...{ pn: current == formData.pn ? 1 : current, length: size } + }) + }, + onShowSizeChange: (current, size) => { + setFormData({ + ...formData, + ...{ pn: current == formData.pn ? 1 : current, length: size } + }) + ajaxGetDownloadList({ + ...formData, + ...{ pn: current == formData.pn ? 1 : current, length: size } + }) + } + } + + const handleDownload = (url) => { + window.open(url) + } + + const ajaxGetDownloadList = (params=formData) => { + ajax.getDownloadList(params).then(e => { + if (e.status == 20000 && e.data.list.length) { + setResultDate({ + list: [...e.data.list], + total: e.data.total + }) + } else { + setResultDate({ + list: [], + total: 0 + }) + } + }) + } + + const ajaxDownloadDel = (id) => { + return new Promise((resolved, rejected) => { + ajax.delDownload({id: id}).then(e => { + if (e.status == 20000) { + resolved(e.message) + } else { + message.error(e.message) + } + }).catch(err => { + message.error(err) + rejected(err) + }) + }) + } + + const handleDel = (data) => { + Modal.confirm({ + title: `确认删除`, + content: `是否确认删除文件 ${data.name}?`, + onOk: () => { + ajaxDownloadDel(data.id).then(msg => { + ajaxGetDownloadList() + message.success('下载任务删除成功') + }) + } + }) + } + const handleTabChange = (v) => { setFormData({ ...formData, type: v, pn: 1 }) + ajaxGetDownloadList({ + ...formData, + type: v, + pn: 1 + }) } + useEffect(() => { + if (visible) { + setFormData({ + type: '0', + pn: 1, + length: 20 + }) + ajaxGetDownloadList({ + type: '0', + pn: 1, + length: 20 + }) + } + }, [visible]) + return (
-
+
+ +
diff --git a/src/components/layout/Header/index.jsx b/src/components/layout/Header/index.jsx index 7abb5cd..386f532 100644 --- a/src/components/layout/Header/index.jsx +++ b/src/components/layout/Header/index.jsx @@ -243,8 +243,8 @@ export default function Header(props) { -
  • setDownloadVisible(true)}> - {/* */} +
  • setDownloadVisible(true)}> +
  • {/*
  • diff --git a/src/components/layout/Header/index.scss b/src/components/layout/Header/index.scss index c754977..d461162 100644 --- a/src/components/layout/Header/index.scss +++ b/src/components/layout/Header/index.scss @@ -1,3 +1,19 @@ +$color-user-list-bg : var(--color-user-list-bg); +@mixin scrollBar($back, $item) { + &::-webkit-scrollbar-track-piece, + &::-webkit-scrollbar-corner, + &::-webkit-scrollbar-track { + background: #000; + } + &::-webkit-scrollbar { + width: 4px; + height: 4px; + } + &::-webkit-scrollbar-thumb { + background: #9da2ab; + border-radius: 2px; + } +} .cc-header-actions { > ul { display: flex; @@ -296,11 +312,36 @@ } .modal-export { .ant-modal-body { - max-height: 860px; - min-height: 400px; + height: 700px; + min-height: 0; border-radius: 4px; - box-shadow: 0px 3px 8px 0px rgba(0,0,0,0.16); + box-shadow: 0px 3px 8px 0px rgba(0,0,0,0.16); + .ant-table-body { + // @include scrollBar(var(--color-user-list-bg), #3B97FF); + } + .export-table-wrapper { + &::before { + content: ""; + width: 4px; + height: 56px; + background: #616b83; + position: absolute; + right: 19px; + top: 100px; + z-index: 2; + } + } .modal-export-container { + display: flex; + flex-direction: column; + min-height: 0; + height: 100%; + .modal-export-content { + flex: 1; + min-height: 0; + display: flex; + flex-direction: column; + } .ant-tabs .ant-tabs-nav-wrap .ant-tabs-nav-list .ant-tabs-tab { width: unset; padding: 12px 5px; @@ -325,5 +366,27 @@ } } } - + .export-table-wrapper { + flex: 1; + min-height: 0; + overflow-y: auto; + @include scrollBar(var(--color-user-list-bg), #3B97FF); + } + .download-list-action { + display: flex; + justify-content: center; + > div { + margin: 0 10px; + &:hover { + cursor: pointer; + } + } + } +} + +.icon-download { + .icon { + background: url('../../../assets/images/icon-download-list.png') no-repeat 100% 100%; + background-size: 100% 100%; + } } \ No newline at end of file diff --git a/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx b/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx index c16d562..53d5ff8 100644 --- a/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx +++ b/src/pages/SystemMgm/MessageMgm/ConfMes/loadable.jsx @@ -133,8 +133,14 @@ function ConfMes(props) { onChange: (current, size) => { setPageInfo({ ...pageInfo, - ...{ pn: current, length: size } + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } }); + }, + onShowSizeChange: (current, size) => { + setPageInfo({ + ...pageInfo, + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } + }); } } const toDeftime = (v) => { diff --git a/src/pages/SystemMgm/MessageMgm/DeviceAlarmMes/loadable.jsx b/src/pages/SystemMgm/MessageMgm/DeviceAlarmMes/loadable.jsx index b4b0125..2e0175f 100644 --- a/src/pages/SystemMgm/MessageMgm/DeviceAlarmMes/loadable.jsx +++ b/src/pages/SystemMgm/MessageMgm/DeviceAlarmMes/loadable.jsx @@ -105,8 +105,14 @@ function NotificationMes(props) { onChange: (current, size) => { setPageInfo({ ...pageInfo, - ...{ pn: current, length: size } + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } }); + }, + onShowSizeChange: (current, size) => { + setPageInfo({ + ...pageInfo, + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } + }); } } const toDeftime = (v) => { diff --git a/src/pages/SystemMgm/MessageMgm/MonitorCarAlarmMes/loadable.jsx b/src/pages/SystemMgm/MessageMgm/MonitorCarAlarmMes/loadable.jsx index fd5bf4a..9892d58 100644 --- a/src/pages/SystemMgm/MessageMgm/MonitorCarAlarmMes/loadable.jsx +++ b/src/pages/SystemMgm/MessageMgm/MonitorCarAlarmMes/loadable.jsx @@ -104,8 +104,14 @@ function MonitorCarAlarmMes(props) { onChange: (current, size) => { setPageInfo({ ...pageInfo, - ...{ pn: current, length: size } + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } }); + }, + onShowSizeChange: (current, size) => { + setPageInfo({ + ...pageInfo, + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } + }); } } const toDeftime = (v) => { diff --git a/src/pages/SystemMgm/MessageMgm/NotificationMes/loadable.jsx b/src/pages/SystemMgm/MessageMgm/NotificationMes/loadable.jsx index 61b44a6..011f11b 100644 --- a/src/pages/SystemMgm/MessageMgm/NotificationMes/loadable.jsx +++ b/src/pages/SystemMgm/MessageMgm/NotificationMes/loadable.jsx @@ -146,8 +146,14 @@ function NotificationMes(props) { onChange: (current, size) => { setPageInfo({ ...pageInfo, - ...{ pn: current, length: size } + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } }); + }, + onShowSizeChange: (current, size) => { + setPageInfo({ + ...pageInfo, + ...{ pn: current == pageInfo.pn ? 1 : current, length: size } + }); } } const toDeftime = (v) => { diff --git a/src/services/common.js b/src/services/common.js index c1c517f..12c97f4 100644 --- a/src/services/common.js +++ b/src/services/common.js @@ -129,6 +129,22 @@ const getPlateSearch = (params) => { data: params, }); }; +//下载列表 +const getDownloadList = (params) => { + return ajax({ + url: "/api/com/common/download_list", + type: 'get', + data: params + }) +} +//下载列表 - 删除 +const delDownload = (params) => { + return ajax({ + url: "/api/com/common/download_del", + type: 'post', + data: params + }) +} export default { getSysConfig, getRoadSearch, @@ -146,4 +162,6 @@ export default { updateCache, getAreaTree, getLocationNameByLngLat, + getDownloadList, + delDownload };