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,17 +12,18 @@ import { useParams } from 'react-router';
|
||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||
import { VariableSizeList as List } from 'react-window';
|
||||
import './index.css';
|
||||
import {judgePermission} from "@/pages/story/utils/utils";
|
||||
|
||||
// 格式化时间数组为易读格式
|
||||
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);
|
||||
};
|
||||
@@ -274,6 +275,7 @@ const Index = () => {
|
||||
setCurrentOption(option);
|
||||
setOpenAddItemModal(true);
|
||||
}}
|
||||
disableEdit={!judgePermission(detail.permissionType, 'edit')}
|
||||
refresh={() => {
|
||||
// 刷新当前页数据
|
||||
setPagination((prev) => ({ ...prev, current: 1 }));
|
||||
@@ -480,6 +482,7 @@ const Index = () => {
|
||||
<Button
|
||||
type="primary"
|
||||
size="large"
|
||||
disabled={!judgePermission(detail.permissionType, 'edit')}
|
||||
onClick={() => {
|
||||
setCurrentOption('add');
|
||||
setCurrentItem(undefined);
|
||||
@@ -500,6 +503,7 @@ const Index = () => {
|
||||
setOpenAddItemModal(true);
|
||||
}}
|
||||
icon={<PlusOutlined />}
|
||||
disabled={!judgePermission(detail.permissionType, 'edit')}
|
||||
type="primary"
|
||||
style={{
|
||||
right: 24,
|
||||
@@ -530,4 +534,4 @@ const Index = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Index;
|
||||
export default Index;
|
||||
|
||||
Reference in New Issue
Block a user