Commit 9a13bbfd authored by Bill's avatar Bill

fix: 修改考评列表

parent c95fe42b
......@@ -30,6 +30,7 @@
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage",
"start:cross": "cross-env SITE_ID=352 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.25:9400 yarn start",
"start:scm": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com yarn start",
"start:url": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-all.wg.shushangyun.com USE_ROUTE_CONFIG=true SOCKET_URL=ws://lingxi-all.wg.shushangyun.com yarn start",
......
......@@ -24,12 +24,7 @@ interface Iprops {};
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const { columns, fetchStatusOptions } = useEvaluateColumn<GetMemberAppraisalSummaryPageResponseDetail>(defaultColumns, [
{
title: "考评最终分",
dataIndex: "totalScore"
}
])
const { columns, fetchStatusOptions } = useEvaluateColumn<GetMemberAppraisalSummaryPageResponseDetail>(defaultColumns, [])
const controllerBtns = (
<div>
......
......@@ -18,7 +18,7 @@ import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const defaultColumns = setColumnsByLinks({
detail: "/memberCenter/memberAbility/memberEvaluate/createEvaluate/view"
});
}, ['totalScore']);
interface Iprops {};
const List: React.FC<Iprops> = (props: Iprops) => {
......
......@@ -40,6 +40,11 @@ const commonColumns = [
sorter: (_a, _b) => moment(_a.completeDay).valueOf() - moment(_b.completeDay).valueOf(),
},
{
title: '考评最终分',
dataIndex: 'totalScore',
sorter: (_a, _b) => _a.totalScore - _b.totalScore,
},
{
title: '内部状态',
dataIndex: 'status',
filters: [],
......@@ -53,7 +58,7 @@ const commonColumns = [
},
]
export const setColumnsByLinks = (link?: { [key: string]: string }) => {
export const setColumnsByLinks = (link?: { [key: string]: string }, blackList?: string[]) => {
const linksColumns: ColumnsType<any> = [
{
title: '考评单号/主题',
......@@ -75,7 +80,12 @@ export const setColumnsByLinks = (link?: { [key: string]: string }) => {
}
},
]
return linksColumns.concat(commonColumns);
const column = linksColumns.concat(commonColumns);
if (typeof blackList === 'undefined' || blackList.length === 0) {
return column
}
return column.filter((_item) => !blackList.includes((_item as any)?.dataIndex))
}
function useEvaluateColumn<T extends { [key: string]: any } = any>(defaultColumns: ColumnsType<T>, mergeColumn?: ColumnsType<T>) {
......
......@@ -15,7 +15,8 @@ interface Iprops {};
const defaultColumns = setColumnsByLinks(
{
detail: '/memberCenter/memberAbility/memberEvaluate/tobeEvaluate/detail'
}
},
['totalScore']
);
const List: React.FC<Iprops> = (props: Iprops) => {
......
......@@ -15,7 +15,7 @@ import { querySchema } from '../tobeEvaluate/schema';
const defaultColumns = setColumnsByLinks({
detail: '/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail',
});
}, ['totalScore']);
interface Iprops {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment