重构前端逻辑
This commit is contained in:
parent
e34248f3ea
commit
99161d3f7d
@ -12,7 +12,6 @@ import {
|
|||||||
AlertDialogAction,
|
AlertDialogAction,
|
||||||
AlertDialogCancel,
|
AlertDialogCancel,
|
||||||
AlertDialogContent,
|
AlertDialogContent,
|
||||||
AlertDialogDescription,
|
|
||||||
AlertDialogFooter,
|
AlertDialogFooter,
|
||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
@ -310,52 +309,52 @@ export const PendingApprovalModal: React.FC<PendingApprovalModalProps> = ({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
<AlertDialogDescription className="space-y-3">
|
|
||||||
{selectedTask && (
|
|
||||||
<>
|
|
||||||
<div className="text-sm text-foreground">
|
|
||||||
您即将{approvalResult === ApprovalResult.APPROVED ? '通过' : '拒绝'}以下部署申请:
|
|
||||||
</div>
|
|
||||||
<div className="p-3 bg-muted/50 rounded-md space-y-1.5 text-xs">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="text-muted-foreground min-w-[56px]">记录ID</span>
|
|
||||||
<span className="font-mono font-semibold">#{selectedTask.deployRecordId}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="text-muted-foreground min-w-[56px]">应用</span>
|
|
||||||
<span className="font-medium">{selectedTask.applicationName}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="text-muted-foreground min-w-[56px]">环境</span>
|
|
||||||
<span className="font-medium">{selectedTask.environmentName}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="text-muted-foreground min-w-[56px]">申请人</span>
|
|
||||||
<span className="font-medium">{selectedTask.deployBy}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<label className="text-sm font-medium text-foreground flex items-center gap-1">
|
|
||||||
审批意见
|
|
||||||
{selectedTask.requireComment && (
|
|
||||||
<span className="text-destructive text-xs">*必填</span>
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<Textarea
|
|
||||||
placeholder={selectedTask.requireComment ? "请填写审批意见(必填)" : "请填写审批意见(可选)"}
|
|
||||||
value={approvalComment}
|
|
||||||
onChange={(e) => setApprovalComment(e.target.value)}
|
|
||||||
rows={3}
|
|
||||||
className="resize-none"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</AlertDialogDescription>
|
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
|
<div className="space-y-3 px-6 py-4">
|
||||||
|
{selectedTask && (
|
||||||
|
<>
|
||||||
|
<div className="text-sm text-muted-foreground">
|
||||||
|
您即将{approvalResult === ApprovalResult.APPROVED ? '通过' : '拒绝'}以下部署申请:
|
||||||
|
</div>
|
||||||
|
<div className="p-3 bg-muted/50 rounded-md space-y-1.5 text-xs">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-muted-foreground min-w-[56px]">记录ID</span>
|
||||||
|
<span className="font-mono font-semibold">#{selectedTask.deployRecordId}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-muted-foreground min-w-[56px]">应用</span>
|
||||||
|
<span className="font-medium">{selectedTask.applicationName}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-muted-foreground min-w-[56px]">环境</span>
|
||||||
|
<span className="font-medium">{selectedTask.environmentName}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-muted-foreground min-w-[56px]">申请人</span>
|
||||||
|
<span className="font-medium">{selectedTask.deployBy}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-2">
|
||||||
|
<label className="text-sm font-medium text-foreground flex items-center gap-1">
|
||||||
|
审批意见
|
||||||
|
{selectedTask.requireComment && (
|
||||||
|
<span className="text-destructive text-xs">*必填</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<Textarea
|
||||||
|
placeholder={selectedTask.requireComment ? "请填写审批意见(必填)" : "请填写审批意见(可选)"}
|
||||||
|
value={approvalComment}
|
||||||
|
onChange={(e) => setApprovalComment(e.target.value)}
|
||||||
|
rows={3}
|
||||||
|
className="resize-none"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogCancel disabled={submitting}>取消</AlertDialogCancel>
|
<AlertDialogCancel>取消</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
onClick={handleSubmitApproval}
|
onClick={handleSubmitApproval}
|
||||||
disabled={submitting}
|
disabled={submitting}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ const Forbidden: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen w-screen flex-col items-center justify-center bg-slate-50 p-8">
|
<div className="fixed inset-0 flex flex-col items-center justify-center bg-slate-50 p-8 overflow-hidden">
|
||||||
<div className="max-w-md text-center">
|
<div className="max-w-md text-center">
|
||||||
{/* 403 图标 */}
|
{/* 403 图标 */}
|
||||||
<div className="mb-6 flex justify-center">
|
<div className="mb-6 flex justify-center">
|
||||||
|
|||||||
@ -18,7 +18,7 @@ const NotFound: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen w-screen flex-col items-center justify-center bg-slate-50 p-8">
|
<div className="fixed inset-0 flex flex-col items-center justify-center bg-slate-50 p-8 overflow-hidden">
|
||||||
<div className="max-w-md text-center">
|
<div className="max-w-md text-center">
|
||||||
{/* 404 图标 */}
|
{/* 404 图标 */}
|
||||||
<div className="mb-6 flex justify-center">
|
<div className="mb-6 flex justify-center">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user