diff --git a/config/config.dev.ts b/config/config.dev.ts index 39134a4..bb4d66e 100644 --- a/config/config.dev.ts +++ b/config/config.dev.ts @@ -13,7 +13,7 @@ export default defineConfig({ // changeOrigin: true, // }, '/api': { - target: 'http://192.168.0.50:7602/api', + target: 'http://192.168.10.11:7602/api', changeOrigin: true, pathRewrite: { '^/api': '', diff --git a/src/pages/atdTable/components/antdTable.tsx b/src/pages/atdTable/components/antdTable.tsx index 0b1b42f..0407489 100644 --- a/src/pages/atdTable/components/antdTable.tsx +++ b/src/pages/atdTable/components/antdTable.tsx @@ -37,7 +37,7 @@ const AntdTable: FC = (props) => { }, []); const getPCDataList = (params: any = {}) => { - let { type, listType, ...extraParams } = params; + let { type, listType, hasOperate = true, ...extraParams } = params; setLoading({ query: true }); setTab(type); setUsertab(listType); @@ -60,7 +60,7 @@ const AntdTable: FC = (props) => { } else { const { columns = [], pageInfo = {} } = dataCopy; const { list = [], total, pageSize: size, pageNum } = pageInfo; - setColumns(getColumns(columns)); + setColumns(getColumns(columns, hasOperate)); setDataSource(list); setPageParams({ ...pageParams, total, size, pageNum }); const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" }); @@ -99,10 +99,33 @@ const AntdTable: FC = (props) => { ); } }]; + tmpColumns = _.map(tmpColumns, (item) => { + if (item.dataIndex === "costCenter") { + return { + ...item, + width: 110, + render: (text: string, r: any) => { + const { costCenter } = r; + return ( + { + window.parent.postMessage( + { + type: "PC", + data: { id: "COSTCENTER", data: costCenter } + }, + "*" + ); + }}>{costCenter.name || ""} + ); + } + }; + } + return { ...item }; + }); return tmpColumns; }; //薪资核算页面列表 - const getColumns = (column: any) => { + const getColumns = (column: any, hasOperate: boolean = true) => { let tmpColumns = [...column]; tmpColumns = tmpColumns.filter(item => item.hide == "FALSE").map((item, index) => { let result = { ...item }; @@ -153,6 +176,26 @@ const AntdTable: FC = (props) => { result.oldWidth = result.width; result.width = "150px"; result.ellipsis = true; + result.render = (text: string, r: any) => { + if (item.column === "costCenter") { + const { costCenter } = r; + return { + window.parent.postMessage( + { + type: "PR", + data: { id: "COSTCENTER", data: costCenter } + }, + "*" + ); + }}>{!_.isEmpty(costCenter) ? costCenter.name : ""}; + } + return + {text} + { + result.lockStatus === "LOCK" ? : null + } + ; + }; if (result.children) { result.width = (result.children.length * 150) + "px"; result.children.map((child: any) => { @@ -225,7 +268,7 @@ const AntdTable: FC = (props) => { return result; }); - tmpColumns.push({ + hasOperate && tmpColumns.push({ title: "操作", key: "cz", width: "100px", @@ -313,7 +356,6 @@ const AntdTable: FC = (props) => { { _.isEmpty(sumRow) ? : _.map([{}, ...totalColumns], (item, index) => { - console.log(sumRow[item.dataIndex]); if (index === 0) { return 总计; }