Browse Source
* [Feature][UI Next][V1.0.0-Alpha] Adjust all table column widths in this project. * [Fix][UI Next][V1.0.0-Alpha] Fix workflow delete handle (#9057) * [Fix][UI Next][V1.0.0-Alpha] User Manage Queue display error (#9060) * fix package bug (#9051) * [Fix][UI Next][V1.0.0-Alpha] Fix the monitoring center does not support multiple worker. (#9061) * [Fix][UI Next][V1.0.0-Alpha] Remove the unused Ref. * [Fix-9025] [UI Next] Rectify this issue about failing to save a process when the user is ordinary user. (#9063) * modify the back-edn api * fix this issue * [Fix][UI Next][V1.0.0-Alpha]Change the column-config file name to column-width-config and COLUMN_CONFIG to COLUMN_WIDTH_CONFIG. * [Bug][UI Next] Fix style errors (#9067) * [Feature][UI Next][V1.0.0-Alpha] Adjust all table column widths in this project. * [Fix][UI Next][V1.0.0-Alpha] Remove the unused Ref. * [Fix][UI Next][V1.0.0-Alpha]Change the column-config file name to column-width-config and COLUMN_CONFIG to COLUMN_WIDTH_CONFIG. Co-authored-by: Devosend <devosend@gmail.com> Co-authored-by: zixi0825 <sunzhaohe0825@gmail.com> Co-authored-by: songjianet <1778651752@qq.com> Co-authored-by: calvin <jianghuachinacom@163.com> Co-authored-by: labbomb <739955946@qq.com>3.0.0/version-upgrade
Amy0104
3 years ago
committed by
GitHub
36 changed files with 673 additions and 180 deletions
@ -0,0 +1,94 @@ |
|||||||
|
/* |
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
* contributor license agreements. See the NOTICE file distributed with |
||||||
|
* this work for additional information regarding copyright ownership. |
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
* (the "License"); you may not use this file except in compliance with |
||||||
|
* the License. You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
|
||||||
|
import { isNumber, sumBy } from 'lodash' |
||||||
|
import type { |
||||||
|
TableColumns, |
||||||
|
CommonColumnInfo |
||||||
|
} from 'naive-ui/es/data-table/src/interface' |
||||||
|
|
||||||
|
export const COLUMN_WIDTH_CONFIG = { |
||||||
|
selection: { |
||||||
|
width: 50 |
||||||
|
}, |
||||||
|
index: { |
||||||
|
width: 50 |
||||||
|
}, |
||||||
|
name: { |
||||||
|
width: 200, |
||||||
|
ellipsis: { |
||||||
|
tooltip: true |
||||||
|
} |
||||||
|
}, |
||||||
|
state: { |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
type: { |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
version: { |
||||||
|
width: 80 |
||||||
|
}, |
||||||
|
time: { |
||||||
|
width: 180 |
||||||
|
}, |
||||||
|
operation: (number: number): CommonColumnInfo => ({ |
||||||
|
fixed: 'right', |
||||||
|
width: Math.max(30 * number + 12 * (number - 1) + 24, 100) |
||||||
|
}), |
||||||
|
userName: { |
||||||
|
width: 120, |
||||||
|
ellipsis: { |
||||||
|
tooltip: true |
||||||
|
} |
||||||
|
}, |
||||||
|
ruleType: { |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
note: { |
||||||
|
width: 180, |
||||||
|
ellipsis: { |
||||||
|
tooltip: true |
||||||
|
} |
||||||
|
}, |
||||||
|
dryRun: { |
||||||
|
width: 140 |
||||||
|
}, |
||||||
|
times: { |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
duration: { |
||||||
|
width: 120 |
||||||
|
}, |
||||||
|
yesOrNo: { |
||||||
|
width: 100, |
||||||
|
ellipsis: { |
||||||
|
tooltip: true |
||||||
|
} |
||||||
|
}, |
||||||
|
size: { |
||||||
|
width: 100 |
||||||
|
}, |
||||||
|
tag: { |
||||||
|
width: 160 |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export const calculateTableWidth = (columns: TableColumns) => |
||||||
|
sumBy(columns, (column) => (isNumber(column.width) ? column.width : 0)) |
||||||
|
|
||||||
|
export const DefaultTableWidth = 1800 |
Loading…
Reference in new issue