story操作权限限制
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -12,13 +12,13 @@ import useStyles from './index.style';
|
||||
// 格式化时间数组为易读格式
|
||||
const formatTimeArray = (time: string | number[] | undefined): string => {
|
||||
if (!time) return '';
|
||||
|
||||
|
||||
// 如果是数组格式 [2025, 12, 23, 8, 55, 39]
|
||||
if (Array.isArray(time)) {
|
||||
const [year, month, day, hour, minute, second] = time;
|
||||
return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')} ${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}:${String(second).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
|
||||
// 如果已经是字符串格式,直接返回
|
||||
return String(time);
|
||||
};
|
||||
@@ -27,7 +27,8 @@ const TimelineItem: React.FC<{
|
||||
item: StoryItem;
|
||||
handleOption: (item: StoryItem, option: 'add' | 'edit' | 'addSubItem' | 'editSubItem') => void;
|
||||
refresh: () => void;
|
||||
}> = ({ item, handleOption, refresh }) => {
|
||||
disableEdit?: boolean;
|
||||
}> = ({ item, handleOption, refresh, disableEdit }) => {
|
||||
const { styles } = useStyles();
|
||||
const intl = useIntl();
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
@@ -97,7 +98,7 @@ const TimelineItem: React.FC<{
|
||||
}}
|
||||
extra={
|
||||
<div className={styles.actions}>
|
||||
{showActions && (
|
||||
{showActions && !disableEdit && (
|
||||
<>
|
||||
<Button
|
||||
type="text"
|
||||
@@ -212,10 +213,11 @@ const TimelineItem: React.FC<{
|
||||
open={openDetail}
|
||||
setOpen={setOpenDetail}
|
||||
handleDelete={handleDelete}
|
||||
disableEdit={disableEdit}
|
||||
handOption={handleOption}
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default TimelineItem;
|
||||
export default TimelineItem;
|
||||
|
||||
Reference in New Issue
Block a user