Commit cbfbd076 by zhaochengxiang

服务

parent 93fe8351
......@@ -608,6 +608,9 @@ const ModelTable = (props) => {
let newCols = [...cols];
if ((visibleColNames||[]).length > 0) {
newCols = newCols.filter(col => visibleColNames.indexOf(col.title)!==-1 || col.title==='序号' || col.title==='操作');
if ((visibleColNames||[]).indexOf('服务描述') === -1) {
newCols[newCols.length-2].width = null;
}
}
if (modelId) {
newCols.filter(col => col.title !=='序号');
......@@ -935,6 +938,7 @@ const ModelTable = (props) => {
<Table
rowSelection={view!=='grant'?rowSelection:undefined}
rowKey={'id'}
extraColWidth={80}
columns={columns||[]}
dataSource={modelId?(subData||[]):(filterData||[])}
pagination={false}
......
......@@ -36,7 +36,7 @@ const ResizeableHeaderCell = props => {
};
const ResizeableTable = (props) => {
const { columns, ...restProps } = props
const { columns, extraColWidth, ...restProps } = props
const [tableWidth, setTableWidth] = useState(0)
......@@ -61,7 +61,7 @@ const ResizeableTable = (props) => {
useEffect(() => {
if (!!columns && tableWidth > 0) {
const contentWidth = getWidth(tableWidth)
const contentWidth = getWidth(tableWidth, extraColWidth)
setDefaultWidth(columns, contentWidth)
paddingCol.current.width = 0
......@@ -80,7 +80,7 @@ const ResizeableTable = (props) => {
})
setCols(cols)
}
}, [columns, tableWidth])
}, [columns, tableWidth, extraColWidth])
const cols1 = useMemo(() => !!cols ? [...cols, paddingCol.current] : undefined, [cols])
......@@ -105,9 +105,9 @@ const ResizeableTable = (props) => {
export default ResizeableTable;
function getWidth(tableWidth) {
function getWidth(tableWidth, extraColWidth) {
// FIXME 判断没有选择列时,32为0
return tableWidth - scrollbarWidth - 32 // scrollbar width, checkbox column
return tableWidth - scrollbarWidth - extraColWidth // scrollbar width, checkbox column
}
function setDefaultWidth(columns, width) {
......
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