Commit 14c46338 by zhaochengxiang

固定序号

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