fix(ui): unify table controls and organization layouts
This commit is contained in:
@@ -132,6 +132,14 @@ const CustomTag = ({
|
||||
);
|
||||
};
|
||||
|
||||
const getTaskChannelColorKey = (value) => {
|
||||
const idNum = parseInt(value);
|
||||
const colorIndex = Number.isFinite(idNum)
|
||||
? ((idNum % colors.length) + colors.length) % colors.length
|
||||
: 0;
|
||||
return colors[colorIndex];
|
||||
};
|
||||
|
||||
// Render functions
|
||||
const renderTimestamp = (timestampInSeconds) => {
|
||||
const date = new Date(timestampInSeconds * 1000);
|
||||
@@ -417,11 +425,7 @@ export const getTaskLogsColumns = ({
|
||||
render: (text, record, index) => {
|
||||
if (!isAdminUser) return null;
|
||||
|
||||
const idNum = parseInt(text);
|
||||
const colorIndex = Number.isFinite(idNum)
|
||||
? ((idNum % colors.length) + colors.length) % colors.length
|
||||
: 0;
|
||||
const colorKey = colors[colorIndex];
|
||||
const colorKey = getTaskChannelColorKey(text);
|
||||
|
||||
// 若后端返回 channel_name 则在 Tooltip 中显示名称,便于管理员快速识别;否则回落为 ID
|
||||
const tooltipContent = record.channel_name || text;
|
||||
|
||||
Reference in New Issue
Block a user