diff --git a/public/css/iconfont/demo_index.html b/public/css/iconfont/demo_index.html index 9986cd4..962184c 100644 --- a/public/css/iconfont/demo_index.html +++ b/public/css/iconfont/demo_index.html @@ -38,7 +38,7 @@

- +

    - +
  • 批量分配
    
  • - +
  • 操作日志
    
  • - +
  • 警告
    
  • - +
  • 应急处理
    
  • - +
  • 批量解锁
    
  • - +
  • 批量锁定
    
  • - +

Unicode 引用

@@ -135,7 +135,7 @@
    - +
  • @@ -144,7 +144,7 @@
    .icon-piliangfenpei
  • - +
  • @@ -153,7 +153,7 @@
    .icon-caozuorizhi32
  • - +
  • @@ -162,7 +162,7 @@
    .icon-jinggao
  • - +
  • @@ -171,7 +171,7 @@
    .icon-yingjichuli
  • - +
  • @@ -180,7 +180,7 @@
    .icon-piliangjiesuo
  • - +
  • @@ -189,7 +189,7 @@
    .icon-piliangsuoding
  • - +

font-class 引用

@@ -216,7 +216,7 @@
    - +
  • 批量分配
    #icon-piliangfenpei
  • - +
  • 操作日志
    #icon-caozuorizhi32
  • - +
  • 警告
    #icon-jinggao
  • - +
  • 应急处理
    #icon-yingjichuli
  • - +
  • 批量解锁
    #icon-piliangjiesuo
  • - +
  • 批量锁定
    #icon-piliangsuoding
  • - +

Symbol 引用

diff --git a/public/css/iconfont/iconfont.js b/public/css/iconfont/iconfont.js index a70d938..8b78202 100644 --- a/public/css/iconfont/iconfont.js +++ b/public/css/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_4257468='',function(e){var c=(c=document.getElementsByTagName("script"))[c.length-1],t=c.getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,i,n,o,a,l=function(c,t){t.parentNode.insertBefore(c,t)};if(t&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}h=function(){var c,t=document.createElement("div");t.innerHTML=e._iconfont_svg_string_4257468,(t=t.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",t=t,(c=document.body).firstChild?l(t,c.firstChild):c.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(n=h,o=e.document,a=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,d())})}function d(){a||(a=!0,n())}function s(){try{o.documentElement.doScroll("left")}catch(c){return void setTimeout(s,50)}d()}}(window); \ No newline at end of file +window._iconfont_svg_string_4257468='',function(e){var c=(c=document.getElementsByTagName("script"))[c.length-1],t=c.getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,i,n,o,a,l=function(c,t){t.parentNode.insertBefore(c,t)};if(t&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}h=function(){var c,t=document.createElement("div");t.innerHTML=e._iconfont_svg_string_4257468,(t=t.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",t=t,(c=document.body).firstChild?l(t,c.firstChild):c.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(n=h,o=e.document,a=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,d())})}function d(){a||(a=!0,n())}function s(){try{o.documentElement.doScroll("left")}catch(c){return void setTimeout(s,50)}d()}}(window); diff --git a/src/layouts/BlankLayout/index.tsx b/src/layouts/BlankLayout/index.tsx index 039bcd2..d2f27fe 100644 --- a/src/layouts/BlankLayout/index.tsx +++ b/src/layouts/BlankLayout/index.tsx @@ -23,8 +23,9 @@ export default ({ children, style = {} }: any) => { window.location.hash.indexOf("atdTable") !== -1 || window.location.hash.indexOf("standingbookTable") !== -1 || window.location.hash.indexOf("previewTable") !== -1 || - window.location.hash.indexOf("calcTable") !== -1 - ) ? "#f6f6f6" : "#FFF", + window.location.hash.indexOf("calcTable") !== -1 || + window.location.hash.indexOf("welfareArchiveTable") !== -1 + ) ? "rgb(241,241,241)" : "#FFF", ...style }} > diff --git a/src/layouts/config.js b/src/layouts/config.js index c5e3d2d..5031a0d 100644 --- a/src/layouts/config.js +++ b/src/layouts/config.js @@ -18,6 +18,7 @@ module.exports = { "/welfareLedgerTable.*": "blank", "/payrollFilesTable.*": "blank", "/employeeDeclareTable.*": "blank", + "/welfareArchiveTable.*": "blank", "/manage.*": "manage", "/portal.*": "template", "/passport/oauth-in": "blank", diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less index 5783b2c..2a80fca 100644 --- a/src/pages/atdTable/components/index.less +++ b/src/pages/atdTable/components/index.less @@ -159,6 +159,10 @@ } :global { + .ant-btn-link { + height: inherit !important; + } + .ant-btn-link, .ant-dropdown-trigger { padding: 0; font-size: 12px; @@ -293,6 +297,17 @@ } :global { + .ant-dropdown-placement-bottomRight { + .ant-dropdown-menu { + max-height: inherit !important; + } + } + + .ant-dropdown-menu-item { + font-size: 12px; + color: #333; + } + .rankMapWrapper { .ant-table-thead > tr > th { background: #ED7D31; diff --git a/src/pages/reportTable/index.tsx b/src/pages/reportTable/index.tsx index ab77c3b..61c14c0 100644 --- a/src/pages/reportTable/index.tsx +++ b/src/pages/reportTable/index.tsx @@ -63,7 +63,7 @@ const ReportTable: FC = (props) => { if (!showSumrow) return; let totalColumns: any[] = []; _.forEach(columns, it => { - if (!it.children) { + if (_.isEmpty(it.children)) { totalColumns.push(it); } else { totalColumns = [...totalColumns, ...it.children]; @@ -73,11 +73,7 @@ const ReportTable: FC = (props) => { { - _.map([{}, ...totalColumns], (item, index) => { - if (index === 0) { - return 总计; - } + _.map(totalColumns, (item, index) => { return {!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"} ; diff --git a/src/pages/welfareArchiveTable/index.tsx b/src/pages/welfareArchiveTable/index.tsx new file mode 100644 index 0000000..50c09f9 --- /dev/null +++ b/src/pages/welfareArchiveTable/index.tsx @@ -0,0 +1,191 @@ +/* + * Author: 黎永顺 + * name: 社保福利档案列表 + * Description: + * Date: 2023/11/1 + */ +import React, { FunctionComponent, useEffect, useMemo, useState } from "react"; +import { ColumnType } from "antd/lib/table"; +import { PaginationData } from "rc-pagination"; +import styles from "@/pages/atdTable/components/index.less"; +import { exceptStr, paginationAction } from "@/utils/common"; +import type { MenuProps } from "antd"; +import { Button, Dropdown, Space, Table } from "antd"; +import { MoreOutlined } from "@ant-design/icons"; + +interface OwnProps { +} + +type Props = OwnProps; + +const Index: FunctionComponent = (props) => { + const [columns, setColumns] = useState[]>([]); + const [dataSource, setDataSource] = useState([]); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [pageInfo, setPageInfo] = useState>({}); + const [i18n, setI18n] = useState({}); + const [runStatuses, setRunStatuses] = useState(""); + const [showOperateBtn, setShowOperateBtn] = useState(false); + + useEffect(() => { + window.parent.postMessage({ type: "init" }, "*"); + window.addEventListener("message", receiveMessageFromIndex, false); + return () => { + window.removeEventListener("message", receiveMessageFromIndex, false); + }; + }, []); + + const receiveMessageFromIndex = (event: any) => { + const data: any = exceptStr(event.data); + if (!_.isEmpty(data)) { + const { + columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {}, + runStatuses, showOperateBtn + } = data; + setShowOperateBtn(showOperateBtn); + setRunStatuses(runStatuses); + setI18n(i18nRes); + setPageInfo(pageInfo); + setDataSource(dataSource); + setSelectedRowKeys(selectedRowKeys); + setColumns(columns); + } + }; + const onChange = (current: number, pageSize: number) => { + setPageInfo((prevState) => { + const { pageSize: size } = prevState; + window.parent.postMessage( + { + type: "turn", + payload: { id: "PAGEINFO", params: { ...pageInfo, current: size === pageSize ? current : 1, pageSize } } + }, + "*" + ); + return { ...pageInfo, current: size === pageSize ? current : 1, pageSize }; + }); + }; + const rowSelection = { + columnWidth: 60, + selectedRowKeys: selectedRowKeys, + onChange: (selectedRowKeys: React.Key[]) => { + setSelectedRowKeys(selectedRowKeys); + window.parent.postMessage( + { + type: "turn", + payload: { id: "CHECKBOX", params: { selectedRowKeys } } + }, + "*" + ); + } + }; + const handleWelfareOperate = (type: string, record: any, interfaceParams?: any) => { + window.parent.postMessage( + { + type: "turn", + payload: { id: type, params: { record, interfaceParams } } + }, + "*" + ); + }; + const cols: any = useMemo(() => { + let opts: any = { title: i18n["操作"], dataIndex: "operate", fixed: "right", width: 185 }; + switch (runStatuses) { + case "1": + opts = { + ...opts, + render: (__: any, record: any) => { + const items: MenuProps["items"] = [ + { + key: "DeleteFiles", + label: i18n["删除档案"], + onClick: () => handleWelfareOperate("DEL-ARCHIVE", record) + }, + { + key: "DeleteTodoList", + label: i18n["删除待办"], + onClick: () => handleWelfareOperate("DEL-TO-DO", record, { runStatus: "4" }) + } + ]; + return ( + + + + ) + }; + break; + case "3": + opts = { + ...opts, + render: (__: any, record: any) => { + const downsizingItems: MenuProps["items"] = [ + { + key: "DeleteTodoList", + label: i18n["删除待办"], + onClick: () => handleWelfareOperate("DEL-TO-DO-STAY", record, { runStatus: "3" }) + } + ]; + return ( + + + + + + + ) + }]; + }, [columns, runStatuses, i18n, showOperateBtn]); + return (); +}; + +export default Index; diff --git a/src/utils/common.js b/src/utils/common.js index 891bb42..5fcaa49 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -72,14 +72,21 @@ export const exceptStr = (str) => { export const paginationFun = (tableListPageObj, sizeChange, onChange, i18n = {}) => { return { - current: tableListPageObj.pageNum, - pageSize: tableListPageObj.size, + current: tableListPageObj.pageNum || tableListPageObj.current, + pageSize: tableListPageObj.size || tableListPageObj.pageSize, total: tableListPageObj.total, showTotal: total => `${i18n["共"] ? i18n["共"] : "共"} ${total} ${i18n["条"] ? i18n["条"] : "条"}`, showQuickJumper: true, showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], - onShowSizeChange: () => sizeChange(), + onShowSizeChange: (page, size) => { + const { total } = tableListPageObj; + sizeChange({ + pageNum: page, + size, + total + }); + }, onChange: (page, size) => { const { total } = tableListPageObj; onChange({ @@ -90,3 +97,16 @@ export const paginationFun = (tableListPageObj, sizeChange, onChange, i18n = {}) } }; }; + +export const paginationAction = (pageInfo = {}, i18n = {}, onChange, onShowSizeChange) => { + return { + pageSize: pageInfo.pageSize || 10, + current: pageInfo.current || 1, + total: pageInfo.total || 0, + pageSizeOptions: ["10", "20", "50", "100"], + showTotal: total => `${i18n["共"] ? i18n["共"] : "共"} ${total} ${i18n["条"] ? i18n["条"] : "条"}`, + onChange, onShowSizeChange, + showQuickJumper: true, + showSizeChanger: true + }; +};