Commit 14c46338 by zhaochengxiang

固定序号

parent 4b095cf8
......@@ -99,12 +99,23 @@ const FC = (props) => {
}
}
const indexCol = {
title: '序号',
dataIndex: 'key',
fixed: 'left',
render: (text, record, index) => ((pagination.pageNum-1)*pagination.pageSize+index+1),
width: 60,
ellipsis: true,
filter: false,
}
const fixedCols = [
{
title: '修改类型',
dataIndex: 'draftOperation',
ellipsis: true,
width: 120,
fixed: 'right',
render: (text, record) => {
if (text === 'release') return '新增'
if (text === 'change') return '修改'
......@@ -118,6 +129,7 @@ const FC = (props) => {
dataIndex: 'draftState',
ellipsis: true,
width: 120,
fixed: 'right',
render: (text, record) => {
if (text === 'draft') return '待提交'
if (text === 'auditing') return '审批中'
......@@ -199,9 +211,9 @@ const FC = (props) => {
}
}
return [[pathCol, ...newColumns, ...fixedCols]
return [[indexCol, pathCol, ...newColumns, ...fixedCols]
, newTableData, data?.total??0]
}, [filterElements, data, loadingFilterElements, users, fixedCols, keyword, pathCol])
}, [filterElements, data, loadingFilterElements, users, fixedCols, keyword, pathCol, indexCol])
const getAdmin = () => {
dispatch({
......
......@@ -150,6 +150,16 @@ const AssetTable = (props) => {
const app = useContext(AppContext)
const indexCol = {
title: '序号',
dataIndex: 'key',
fixed: 'left',
render: (text, record, index) => ((pagination.pageNum-1)*pagination.pageSize+index+1),
width: 60,
ellipsis: true,
filter: false,
}
const actionCol = {
title: '操作',
dataIndex: 'action',
......@@ -1208,7 +1218,7 @@ const AssetTable = (props) => {
return classNames.join(' ');
}}
loading={loading}
columns={[...columns, actionCol]}
columns={[indexCol, ...columns, actionCol]}
rowKey='id'
dataSource={realAssets}
pagination={false}
......
......@@ -173,9 +173,8 @@ const ModelTable = (props) => {
const indexCol = {
title: '序号',
dataIndex: 'key',
render: (text, record, index) => {
return (index+1).toString();
},
fixed: 'left',
render: (text, record, index) => ((pagination.pageNum-1)*pagination.pageSize+index+1),
width: 60,
ellipsis: true,
filter: false,
......@@ -584,7 +583,7 @@ const ModelTable = (props) => {
}
return newCols;
}, [visibleColNames, attrs, indexCol, actionCol, modelId, detailItem, users])
}, [visibleColNames, attrs, indexCol, actionCol, modelId, detailItem, users, pagination])
const modelEventChange = (e) => {
if (e.key === 'modelChange') {
......
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