|
|
@@ -1,5 +1,6 @@
|
|
|
import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
|
import { useNavigate } from 'react-router-dom';
|
|
|
+import { useTranslation } from 'react-i18next';
|
|
|
import { Plus, Search, Edit2, Trash2, MoreVertical, FileText, Eye, Play, CheckCircle, RefreshCw, Workflow, Hand } from 'lucide-react';
|
|
|
import { Button, Input, Space, Select, Table as AntdTable, message, Modal, Form, Row, Col, Tabs, Radio, DatePicker, Checkbox, Tooltip } from 'antd';
|
|
|
import { Button as UIButton } from './ui/button';
|
|
|
@@ -399,6 +400,7 @@ const edgeTypes: EdgeTypes = {
|
|
|
};
|
|
|
|
|
|
export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
+ const { t, i18n } = useTranslation();
|
|
|
const navigate = useNavigate();
|
|
|
const [searchTerm, setSearchTerm] = useState('');
|
|
|
const [showAddModal, setShowAddModal] = useState(false);
|
|
|
@@ -2475,13 +2477,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
return {
|
|
|
data: filtered,
|
|
|
columns: [
|
|
|
- { key: 'name', label: '名称', width: '20%' },
|
|
|
- { key: 'creator', label: '创建人', width: '10%' },
|
|
|
- { key: 'createTime', label: '创建时间', width: '15%' },
|
|
|
- { key: 'version', label: '版本', width: '10%' },
|
|
|
- { key: 'status', label: '状态', width: '10%' },
|
|
|
- { key: 'description', label: '描述', width: '25%' },
|
|
|
- { key: 'useCount', label: '使用次数', width: '10%' },
|
|
|
+ { key: 'name', label: t('table.formName'), width: '20%' },
|
|
|
+ { key: 'status', label: t('table.status'), width: '10%' },
|
|
|
+ { key: 'description', label: t('table.remark'), width: '25%' },
|
|
|
+ { key: 'createTime', label: t('table.createTime'), width: '15%' },
|
|
|
],
|
|
|
};
|
|
|
} else if (subMenu === '流程设计') {
|
|
|
@@ -2495,28 +2494,28 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
return {
|
|
|
data: filtered,
|
|
|
columns: [
|
|
|
- { key: 'name', label: '名称', width: '20%' },
|
|
|
- { key: 'designer', label: '设计人', width: '10%' },
|
|
|
- { key: 'designTime', label: '设计时间', width: '15%' },
|
|
|
- { key: 'nodeCount', label: '任务数量', width: '10%' },
|
|
|
- { key: 'description', label: '描述', width: '25%' },
|
|
|
- { key: 'status', label: '状态', width: '10%' },
|
|
|
+ { key: 'name', label: t('table.name') || '名称', width: '20%' },
|
|
|
+ { key: 'designer', label: t('table.designer'), width: '10%' },
|
|
|
+ { key: 'designTime', label: t('table.designTime'), width: '15%' },
|
|
|
+ { key: 'nodeCount', label: t('table.nodeCount'), width: '10%' },
|
|
|
+ { key: 'description', label: t('table.description'), width: '25%' },
|
|
|
+ { key: 'status', label: t('table.status'), width: '10%' },
|
|
|
],
|
|
|
};
|
|
|
} else if (subMenu === '流程模板') {
|
|
|
return {
|
|
|
data: templateData,
|
|
|
columns: [
|
|
|
- { key: 'code', label: '模板编号', width: '10%' },
|
|
|
- { key: 'name', label: '模板名称', width: '15%' },
|
|
|
- { key: 'type', label: '类型', width: '10%' },
|
|
|
- { key: 'category', label: '分类', width: '10%' },
|
|
|
- { key: 'steps', label: '步骤数', width: '8%' },
|
|
|
- { key: 'approvalLevel', label: '审批层级', width: '10%' },
|
|
|
- { key: 'creator', label: '创建人', width: '8%' },
|
|
|
- { key: 'status', label: '状态', width: '8%' },
|
|
|
- { key: 'useCount', label: '使用次数', width: '9%' },
|
|
|
- { key: 'createTime', label: '创建时间', width: '12%' },
|
|
|
+ { key: 'code', label: t('table.templateCode'), width: '10%' },
|
|
|
+ { key: 'name', label: t('table.templateName'), width: '15%' },
|
|
|
+ { key: 'type', label: t('table.templateType'), width: '10%' },
|
|
|
+ { key: 'category', label: t('table.templateCategory'), width: '10%' },
|
|
|
+ { key: 'steps', label: t('table.stepCount'), width: '8%' },
|
|
|
+ { key: 'approvalLevel', label: t('table.approvalLevel'), width: '10%' },
|
|
|
+ { key: 'creator', label: t('table.creator'), width: '8%' },
|
|
|
+ { key: 'status', label: t('table.status'), width: '8%' },
|
|
|
+ { key: 'useCount', label: t('table.useCount'), width: '9%' },
|
|
|
+ { key: 'createTime', label: t('table.createTime'), width: '12%' },
|
|
|
],
|
|
|
};
|
|
|
} else if (subMenu === 'SOP管理') {
|
|
|
@@ -2861,61 +2860,46 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
|
|
|
// 表单管理表格列配置
|
|
|
- const formManagementColumns: ColumnsType<TableRow> = [
|
|
|
+ const formManagementColumns: ColumnsType<TableRow> = useMemo(() => [
|
|
|
{
|
|
|
- title: '序号',
|
|
|
+ title: t('table.formId'),
|
|
|
width: '5%',
|
|
|
render: (_: any, __: TableRow, index: number) => index + 1,
|
|
|
},
|
|
|
{
|
|
|
- title: '名称',
|
|
|
+ title: t('table.formName'),
|
|
|
dataIndex: 'name',
|
|
|
width: '20%',
|
|
|
},
|
|
|
{
|
|
|
- title: '创建人',
|
|
|
- dataIndex: 'creator',
|
|
|
- width: '10%',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '创建时间',
|
|
|
- dataIndex: 'createTime',
|
|
|
- width: '15%',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '版本',
|
|
|
- dataIndex: 'version',
|
|
|
- width: '10%',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
+ title: t('table.status'),
|
|
|
dataIndex: 'status',
|
|
|
width: '10%',
|
|
|
render: (status: string) => (
|
|
|
<span
|
|
|
className={`inline-flex px-3 py-1 rounded-lg text-xs ${
|
|
|
- status === '启用'
|
|
|
+ status === '启用' || status === t('common.enabled')
|
|
|
? 'bg-green-100 text-green-700'
|
|
|
: 'bg-gray-100 text-gray-700'
|
|
|
}`}
|
|
|
>
|
|
|
- {status}
|
|
|
+ {status === '启用' ? t('common.enabled') : status === '停用' ? t('common.disabled') : status}
|
|
|
</span>
|
|
|
),
|
|
|
},
|
|
|
{
|
|
|
- title: '描述',
|
|
|
+ title: t('table.remark'),
|
|
|
dataIndex: 'description',
|
|
|
width: '25%',
|
|
|
ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
- title: '使用次数',
|
|
|
- dataIndex: 'useCount',
|
|
|
- width: '10%',
|
|
|
+ title: t('table.createTime'),
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ width: '15%',
|
|
|
},
|
|
|
{
|
|
|
- title: '操作',
|
|
|
+ title: t('table.operation'),
|
|
|
width: '15%',
|
|
|
align: 'center',
|
|
|
render: (_: any, record: TableRow) => (
|
|
|
@@ -2938,7 +2922,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
>
|
|
|
<Edit2 className="w-4 h-4" style={{ color: '#000000' }} />
|
|
|
- <span className="ml-1">编辑</span>
|
|
|
+ <span className="ml-1">{t('common.edit')}</span>
|
|
|
</UIButton>
|
|
|
<UIButton
|
|
|
variant="ghost"
|
|
|
@@ -2958,54 +2942,54 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
>
|
|
|
<Trash2 className="w-4 h-4" style={{ color: '#000000' }} />
|
|
|
- <span className="ml-1">删除</span>
|
|
|
+ <span className="ml-1">{t('common.delete')}</span>
|
|
|
</UIButton>
|
|
|
</div>
|
|
|
),
|
|
|
},
|
|
|
- ];
|
|
|
+ ], [t, i18n.language]);
|
|
|
|
|
|
// 流程设计表格列配置
|
|
|
- const processDesignColumns: ColumnsType<WorkflowDesignVO> = [
|
|
|
+ const processDesignColumns: ColumnsType<WorkflowDesignVO> = useMemo(() => [
|
|
|
{
|
|
|
- title: '序号',
|
|
|
+ title: t('table.processDesignId'),
|
|
|
width: '5%',
|
|
|
render: (_: any, __: WorkflowDesignVO, index: number) =>
|
|
|
(processDesignPagination.pageNo - 1) * processDesignPagination.pageSize + index + 1,
|
|
|
},
|
|
|
{
|
|
|
- title: '名称',
|
|
|
+ title: t('table.name') || '名称',
|
|
|
dataIndex: 'name',
|
|
|
width: '15%',
|
|
|
},
|
|
|
{
|
|
|
- title: '任务数量',
|
|
|
+ title: t('table.nodeCount'),
|
|
|
dataIndex: 'nodeCount',
|
|
|
width: '10%',
|
|
|
render: (count: number) => count ?? 0,
|
|
|
},
|
|
|
{
|
|
|
- title: '状态',
|
|
|
+ title: t('table.status'),
|
|
|
dataIndex: 'status',
|
|
|
width: '10%',
|
|
|
render: (status: number) => {
|
|
|
if (status === 1) {
|
|
|
return (
|
|
|
<span className="inline-flex px-3 py-1 rounded-lg text-xs bg-green-100 text-green-700">
|
|
|
- 启用
|
|
|
+ {t('common.enabled')}
|
|
|
</span>
|
|
|
);
|
|
|
} else {
|
|
|
return (
|
|
|
<span className="inline-flex px-3 py-1 rounded-lg text-xs bg-gray-100 text-gray-700">
|
|
|
- 停用
|
|
|
+ {t('common.disabled')}
|
|
|
</span>
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '创建时间',
|
|
|
+ title: t('table.createTime'),
|
|
|
dataIndex: 'createTime',
|
|
|
width: '15%',
|
|
|
render: (time: string | Date | number) => {
|
|
|
@@ -3018,7 +3002,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
} else {
|
|
|
date = time;
|
|
|
}
|
|
|
- return date.toLocaleString('zh-CN', {
|
|
|
+ return date.toLocaleString(i18n.language === 'en' ? 'en-US' : 'zh-CN', {
|
|
|
year: 'numeric',
|
|
|
month: '2-digit',
|
|
|
day: '2-digit',
|
|
|
@@ -3029,7 +3013,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '更新时间',
|
|
|
+ title: t('table.updateTime'),
|
|
|
dataIndex: 'updateTime',
|
|
|
width: '15%',
|
|
|
render: (time: string | Date | number) => {
|
|
|
@@ -3042,7 +3026,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
} else {
|
|
|
date = time;
|
|
|
}
|
|
|
- return date.toLocaleString('zh-CN', {
|
|
|
+ return date.toLocaleString(i18n.language === 'en' ? 'en-US' : 'zh-CN', {
|
|
|
year: 'numeric',
|
|
|
month: '2-digit',
|
|
|
day: '2-digit',
|
|
|
@@ -3053,7 +3037,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '描述',
|
|
|
+ title: t('table.description'),
|
|
|
dataIndex: 'description',
|
|
|
width: '18%',
|
|
|
render: (desc: string) => {
|
|
|
@@ -3070,7 +3054,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '操作',
|
|
|
+ title: t('table.operation'),
|
|
|
width: '20%',
|
|
|
align: 'center',
|
|
|
render: (_: any, record: WorkflowDesignVO) => (
|
|
|
@@ -3133,12 +3117,12 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
>
|
|
|
<Trash2 className="w-4 h-4" style={{ color: '#000000' }} />
|
|
|
- <span className="ml-0.5">删除</span>
|
|
|
+ <span className="ml-0.5">{t('common.delete')}</span>
|
|
|
</UIButton>
|
|
|
</div>
|
|
|
),
|
|
|
},
|
|
|
- ];
|
|
|
+ ], [t, i18n.language, processDesignPagination]);
|
|
|
|
|
|
// 获取作业状态样式
|
|
|
const getWorkJobStatusStyle = (status: string | number | undefined): React.CSSProperties => {
|
|
|
@@ -3273,15 +3257,15 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
|
|
|
// 作业管理表格列配置
|
|
|
- const workJobColumns: ColumnsType<WorkJobVO> = [
|
|
|
+ const workJobColumns: ColumnsType<WorkJobVO> = useMemo(() => [
|
|
|
{
|
|
|
- title: '作业编号',
|
|
|
+ title: t('table.workOrderNo'),
|
|
|
dataIndex: 'orderNo',
|
|
|
width: '12%',
|
|
|
render: (orderNo: string, record: WorkJobVO) => orderNo || record.code || '-',
|
|
|
},
|
|
|
{
|
|
|
- title: '作业名称',
|
|
|
+ title: t('table.workName'),
|
|
|
dataIndex: 'name',
|
|
|
width: '18%',
|
|
|
render: (name: string, record: WorkJobVO) => {
|
|
|
@@ -3300,7 +3284,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '作业状态',
|
|
|
+ title: t('table.workStatus'),
|
|
|
dataIndex: 'status',
|
|
|
width: '10%',
|
|
|
render: (status: string | number) => {
|
|
|
@@ -3317,13 +3301,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '当前任务',
|
|
|
+ title: t('table.currentTask'),
|
|
|
dataIndex: 'currentNodeName',
|
|
|
width: '12%',
|
|
|
render: (currentNodeName: string, record: WorkJobVO) => currentNodeName || record.currentNode || '-',
|
|
|
},
|
|
|
{
|
|
|
- title: '作业内容',
|
|
|
+ title: t('table.workContent'),
|
|
|
dataIndex: 'description',
|
|
|
width: '20%',
|
|
|
render: (description: string, record: WorkJobVO) => {
|
|
|
@@ -3342,13 +3326,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '发起人',
|
|
|
+ title: t('table.initiator'),
|
|
|
dataIndex: 'initiatorName',
|
|
|
width: '10%',
|
|
|
render: (initiatorName: string, record: WorkJobVO) => initiatorName || record.initiator || '-',
|
|
|
},
|
|
|
{
|
|
|
- title: '发起时间',
|
|
|
+ title: t('table.initiationTime'),
|
|
|
dataIndex: 'initiationTime',
|
|
|
width: '16%',
|
|
|
render: (time: string | Date | number, record: WorkJobVO) => {
|
|
|
@@ -3362,7 +3346,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
} else {
|
|
|
date = actualTime;
|
|
|
}
|
|
|
- return date.toLocaleString('zh-CN', {
|
|
|
+ return date.toLocaleString(i18n.language === 'en' ? 'en-US' : 'zh-CN', {
|
|
|
year: 'numeric',
|
|
|
month: '2-digit',
|
|
|
day: '2-digit',
|
|
|
@@ -3373,7 +3357,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '紧急程度',
|
|
|
+ title: t('table.urgencyLevel'),
|
|
|
dataIndex: 'urgencyLevel',
|
|
|
minWidth: '180px',
|
|
|
align: 'center',
|
|
|
@@ -3399,7 +3383,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: '操作',
|
|
|
+ title: t('table.operation'),
|
|
|
width: '20%',
|
|
|
align: 'center',
|
|
|
fixed: 'right',
|
|
|
@@ -3431,7 +3415,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
>
|
|
|
<Eye className="w-4 h-4" style={{ color: '#000000' }} />
|
|
|
- <span className="ml-0.5">查看</span>
|
|
|
+ <span className="ml-0.5">{t('table.view')}</span>
|
|
|
</UIButton>
|
|
|
{canEdit ? (
|
|
|
<UIButton
|
|
|
@@ -3452,7 +3436,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
>
|
|
|
<Edit2 className="w-4 h-4" style={{ color: '#000000' }} />
|
|
|
- <span className="ml-0.5">编辑</span>
|
|
|
+ <span className="ml-0.5">{t('common.edit')}</span>
|
|
|
</UIButton>
|
|
|
) : (
|
|
|
<UIButton
|
|
|
@@ -3460,10 +3444,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
size="sm"
|
|
|
disabled
|
|
|
className="h-8 px-2 opacity-50 cursor-not-allowed"
|
|
|
- title="只有未发布状态才能编辑"
|
|
|
+ title={t('common.editDisabled') || '只有未发布状态才能编辑'}
|
|
|
>
|
|
|
<Edit2 className="w-4 h-4" />
|
|
|
- <span className="ml-0.5">编辑</span>
|
|
|
+ <span className="ml-0.5">{t('common.edit')}</span>
|
|
|
</UIButton>
|
|
|
)}
|
|
|
<UIButton
|
|
|
@@ -3484,13 +3468,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
>
|
|
|
<Trash2 className="w-4 h-4" style={{ color: '#000000' }} />
|
|
|
- <span className="ml-0.5">删除</span>
|
|
|
+ <span className="ml-0.5">{t('common.delete')}</span>
|
|
|
</UIButton>
|
|
|
</div>
|
|
|
);
|
|
|
},
|
|
|
},
|
|
|
- ];
|
|
|
+ ], [t, i18n.language, jobStatusDictList, urgencyLevelDictList]);
|
|
|
|
|
|
// 如果是表单管理页面,使用特殊的布局
|
|
|
if (subMenu === '表单管理') {
|
|
|
@@ -3511,27 +3495,27 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
{/* 搜索输入框 */}
|
|
|
<div className="flex items-center gap-2 lg:gap-3 flex-wrap flex-1 min-w-0">
|
|
|
<div className="flex items-center gap-2 lg:gap-3 flex-shrink-0">
|
|
|
- <label className="text-sm font-medium text-gray-700 whitespace-nowrap">名称:</label>
|
|
|
+ <label className="text-sm font-medium text-gray-700 whitespace-nowrap">{t('form.formName')}:</label>
|
|
|
<Input
|
|
|
value={formManagementQuery.name}
|
|
|
onChange={(e) => setFormManagementQuery({ ...formManagementQuery, name: e.target.value })}
|
|
|
onPressEnter={handleFormManagementQuery}
|
|
|
- placeholder="请输入名称"
|
|
|
+ placeholder={t('form.formNamePlaceholder')}
|
|
|
className="min-w-[150px] max-w-[200px]"
|
|
|
allowClear
|
|
|
/>
|
|
|
</div>
|
|
|
<div className="flex items-center gap-2 lg:gap-3 flex-shrink-0">
|
|
|
- <label className="text-sm font-medium text-gray-700 whitespace-nowrap">状态:</label>
|
|
|
+ <label className="text-sm font-medium text-gray-700 whitespace-nowrap">{t('form.status')}:</label>
|
|
|
<Select
|
|
|
value={formManagementQuery.status}
|
|
|
onChange={(value) => setFormManagementQuery({ ...formManagementQuery, status: value })}
|
|
|
- placeholder="请选择状态"
|
|
|
+ placeholder={t('form.statusPlaceholder') || t('common.pleaseSelect')}
|
|
|
className="min-w-[150px] max-w-[200px]"
|
|
|
allowClear
|
|
|
>
|
|
|
- <Select.Option value="启用">启用</Select.Option>
|
|
|
- <Select.Option value="停用">停用</Select.Option>
|
|
|
+ <Select.Option value="启用">{t('common.enabled')}</Select.Option>
|
|
|
+ <Select.Option value="停用">{t('common.disabled')}</Select.Option>
|
|
|
</Select>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -3543,7 +3527,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
icon={<Search className="w-4 h-4" />}
|
|
|
onClick={handleFormManagementQuery}
|
|
|
>
|
|
|
- 搜索
|
|
|
+ {t('common.search')}
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
@@ -3553,7 +3537,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
setFormManagementPagination({ pageNo: 1, pageSize: 10 });
|
|
|
}}
|
|
|
>
|
|
|
- 重置
|
|
|
+ {t('common.reset')}
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
@@ -3564,7 +3548,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
setShowAddModal(true);
|
|
|
}}
|
|
|
>
|
|
|
- 新建表单
|
|
|
+ {t('form.addForm')}
|
|
|
</Button>
|
|
|
</Space>
|
|
|
</div>
|
|
|
@@ -3587,14 +3571,14 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="bg-white rounded-lg border border-gray-200 px-6 py-4">
|
|
|
<div className="flex items-center justify-between">
|
|
|
<div className="text-sm text-gray-600">
|
|
|
- 共 <span className="text-blue-600 font-medium">{formManagementTotal}</span> 条记录
|
|
|
+ {t('common.total')} <span className="text-blue-600 font-medium">{formManagementTotal}</span> {t('common.records')}
|
|
|
</div>
|
|
|
<div className="flex gap-2">
|
|
|
<Button
|
|
|
onClick={() => setFormManagementPagination({ ...formManagementPagination, pageNo: formManagementPagination.pageNo - 1 })}
|
|
|
disabled={formManagementPagination.pageNo <= 1}
|
|
|
>
|
|
|
- 上一页
|
|
|
+ {t('common.prevPage')}
|
|
|
</Button>
|
|
|
<span className="px-4 py-2 text-sm text-gray-600 flex items-center">
|
|
|
{formManagementPagination.pageNo} / {formManagementTotalPages}
|
|
|
@@ -3603,7 +3587,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
onClick={() => setFormManagementPagination({ ...formManagementPagination, pageNo: formManagementPagination.pageNo + 1 })}
|
|
|
disabled={formManagementPagination.pageNo >= formManagementTotalPages}
|
|
|
>
|
|
|
- 下一页
|
|
|
+ {t('common.nextPage')}
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -3616,7 +3600,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="bg-white rounded-2xl shadow-2xl w-full max-w-3xl mx-4 max-h-[90vh] overflow-y-auto animate-in zoom-in duration-200">
|
|
|
<div className="px-6 py-4 border-b border-gray-200 flex items-center justify-between sticky top-0 bg-white z-10">
|
|
|
<h3 className="text-lg text-gray-900">
|
|
|
- {editingItem ? '编辑表单管理' : '新建表单管理'}
|
|
|
+ {editingItem ? t('common.editFormManagement') : t('common.addFormManagement')}
|
|
|
</h3>
|
|
|
<button
|
|
|
onClick={() => setShowAddModal(false)}
|
|
|
@@ -3715,12 +3699,12 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
{/* 搜索输入框 */}
|
|
|
<div className="flex items-center gap-2 lg:gap-3 flex-wrap flex-1 min-w-0">
|
|
|
<div className="flex items-center gap-2 lg:gap-3 flex-shrink-0">
|
|
|
- <label className="text-sm font-medium text-gray-700 whitespace-nowrap">名称:</label>
|
|
|
+ <label className="text-sm font-medium text-gray-700 whitespace-nowrap">{t('form.processDesignName')}:</label>
|
|
|
<Input
|
|
|
value={processDesignQuery.name}
|
|
|
onChange={(e) => setProcessDesignQuery({ ...processDesignQuery, name: e.target.value })}
|
|
|
onPressEnter={handleProcessDesignQuery}
|
|
|
- placeholder="请输入名称"
|
|
|
+ placeholder={t('form.processDesignNamePlaceholder')}
|
|
|
className="min-w-[150px] max-w-[200px]"
|
|
|
allowClear
|
|
|
/>
|
|
|
@@ -3736,7 +3720,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
icon={<Search className="w-4 h-4" />}
|
|
|
onClick={handleProcessDesignQuery}
|
|
|
>
|
|
|
- 搜索
|
|
|
+ {t('common.search')}
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
@@ -3745,7 +3729,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
resetProcessDesignQuery();
|
|
|
}}
|
|
|
>
|
|
|
- 重置
|
|
|
+ {t('common.reset')}
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
@@ -3757,7 +3741,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
setShowAddModal(true);
|
|
|
}}
|
|
|
>
|
|
|
- 新建流程
|
|
|
+ {t('form.addProcess')}
|
|
|
</Button>
|
|
|
</Space>
|
|
|
</div>
|
|
|
@@ -3781,7 +3765,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="bg-white rounded-lg border border-gray-200 px-6 py-4">
|
|
|
<div className="flex items-center justify-between">
|
|
|
<div className="text-sm text-gray-600">
|
|
|
- 共 <span className="text-blue-600 font-medium">{processDesignTotal}</span> 条记录
|
|
|
+ {t('common.total')} <span className="text-blue-600 font-medium">{processDesignTotal}</span> {t('common.records')}
|
|
|
</div>
|
|
|
<div className="flex gap-2">
|
|
|
<Button
|
|
|
@@ -3790,7 +3774,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
disabled={processDesignPagination.pageNo <= 1}
|
|
|
>
|
|
|
- 上一页
|
|
|
+ {t('common.prevPage')}
|
|
|
</Button>
|
|
|
<span className="px-4 py-2 text-sm text-gray-600 flex items-center">
|
|
|
{processDesignPagination.pageNo} / {processDesignTotalPages}
|
|
|
@@ -3801,7 +3785,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
}}
|
|
|
disabled={processDesignPagination.pageNo >= processDesignTotalPages}
|
|
|
>
|
|
|
- 下一页
|
|
|
+ {t('common.nextPage')}
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -4006,22 +3990,22 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="flex flex-wrap items-center justify-between gap-3 lg:gap-4">
|
|
|
<div className="flex flex-wrap items-center gap-3 lg:gap-4">
|
|
|
<div className="flex items-center gap-2">
|
|
|
- <label className="text-sm font-medium text-gray-700 whitespace-nowrap">作业名称:</label>
|
|
|
+ <label className="text-sm font-medium text-gray-700 whitespace-nowrap">{t('form.workName')}:</label>
|
|
|
<Input
|
|
|
value={workJobQuery.name}
|
|
|
onChange={(e) => setWorkJobQuery({ ...workJobQuery, name: e.target.value })}
|
|
|
onPressEnter={handleWorkJobQuery}
|
|
|
- placeholder="请输入作业名称"
|
|
|
+ placeholder={t('form.workNamePlaceholder')}
|
|
|
allowClear
|
|
|
className="min-w-[200px] max-w-[300px]"
|
|
|
/>
|
|
|
</div>
|
|
|
<div className="flex items-center gap-2">
|
|
|
- <label className="text-sm font-medium text-gray-700 whitespace-nowrap">作业状态:</label>
|
|
|
+ <label className="text-sm font-medium text-gray-700 whitespace-nowrap">{t('form.workStatus')}:</label>
|
|
|
<Select
|
|
|
value={workJobQuery.status ?? ''}
|
|
|
onChange={(value) => setWorkJobQuery({ ...workJobQuery, status: value || undefined })}
|
|
|
- placeholder="请选择作业状态"
|
|
|
+ placeholder={t('form.workStatusPlaceholder')}
|
|
|
allowClear
|
|
|
className="w-32"
|
|
|
>
|
|
|
@@ -4039,7 +4023,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
icon={<Search className="w-4 h-4" />}
|
|
|
onClick={handleWorkJobQuery}
|
|
|
>
|
|
|
- 搜索
|
|
|
+ {t('common.search')}
|
|
|
</Button>
|
|
|
<Button
|
|
|
icon={<RefreshCw className="w-4 h-4" />}
|
|
|
@@ -4048,7 +4032,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
getWorkJobList();
|
|
|
}}
|
|
|
>
|
|
|
- 重置
|
|
|
+ {t('common.reset')}
|
|
|
</Button>
|
|
|
<Button
|
|
|
type="primary"
|
|
|
@@ -4064,7 +4048,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
getWorkflowTemplateList();
|
|
|
}}
|
|
|
>
|
|
|
- 发起作业
|
|
|
+ {t('form.initiateWork')}
|
|
|
</Button>
|
|
|
</Space>
|
|
|
</div>
|
|
|
@@ -4088,14 +4072,14 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="bg-white rounded-lg border border-gray-200 px-6 py-4">
|
|
|
<div className="flex items-center justify-between">
|
|
|
<div className="text-sm text-gray-600">
|
|
|
- 共 <span className="text-blue-600 font-medium">{workJobTotal}</span> 条记录
|
|
|
+ {t('common.total')} <span className="text-blue-600 font-medium">{workJobTotal}</span> {t('common.records')}
|
|
|
</div>
|
|
|
<div className="flex gap-2">
|
|
|
<Button
|
|
|
onClick={() => setWorkJobPagination({ ...workJobPagination, pageNo: workJobPagination.pageNo - 1 })}
|
|
|
disabled={workJobPagination.pageNo <= 1}
|
|
|
>
|
|
|
- 上一页
|
|
|
+ {t('common.prevPage')}
|
|
|
</Button>
|
|
|
<span className="px-4 py-2 text-sm text-gray-600 flex items-center">
|
|
|
{workJobPagination.pageNo} / {Math.ceil(workJobTotal / workJobPagination.pageSize) || 1}
|
|
|
@@ -4104,7 +4088,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
onClick={() => setWorkJobPagination({ ...workJobPagination, pageNo: workJobPagination.pageNo + 1 })}
|
|
|
disabled={workJobPagination.pageNo >= Math.ceil(workJobTotal / workJobPagination.pageSize)}
|
|
|
>
|
|
|
- 下一页
|
|
|
+ {t('common.nextPage')}
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -6028,7 +6012,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" />
|
|
|
<input
|
|
|
type="text"
|
|
|
- placeholder={`搜索${subMenu}...`}
|
|
|
+ placeholder={subMenu === '流程模板' ? t('form.searchTemplate') : `搜索${subMenu}...`}
|
|
|
value={searchTerm}
|
|
|
onChange={(e) => setSearchTerm(e.target.value)}
|
|
|
className="w-full h-10 pl-10 pr-4 bg-gray-50 border border-gray-200 rounded-xl outline-none focus:border-blue-400 focus:ring-4 focus:ring-blue-100 transition-all text-sm"
|
|
|
@@ -6044,7 +6028,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
>
|
|
|
<Plus className="w-4 h-4" strokeWidth={2.5} />
|
|
|
<span className="text-sm">
|
|
|
- {subMenu === '流程模板' && '新增模板'}
|
|
|
+ {subMenu === '流程模板' && t('common.addTemplate')}
|
|
|
{subMenu === 'SOP管理' && '新增SOP'}
|
|
|
{subMenu === '作业管理' && '新建作业'}
|
|
|
</span>
|
|
|
@@ -6058,7 +6042,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<thead>
|
|
|
<tr className="bg-gradient-to-r from-gray-50 to-gray-100/50 border-b border-gray-200">
|
|
|
<th className="px-6 py-4 text-left text-xs text-gray-600 uppercase tracking-wider" style={{ width: '5%' }}>
|
|
|
- 序号
|
|
|
+ {t('common.serialNumber')}
|
|
|
</th>
|
|
|
{columns.map((column) => (
|
|
|
<th
|
|
|
@@ -6070,7 +6054,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
</th>
|
|
|
))}
|
|
|
<th className="px-6 py-4 text-center text-xs text-gray-600 uppercase tracking-wider" style={{ width: '10%' }}>
|
|
|
- 操作
|
|
|
+ {t('table.operation')}
|
|
|
</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
@@ -6124,7 +6108,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
className="h-8 px-2"
|
|
|
>
|
|
|
<Eye className="w-4 h-4" />
|
|
|
- <span className="ml-1">查看</span>
|
|
|
+ <span className="ml-1">{t('table.view')}</span>
|
|
|
</Button>
|
|
|
<Button
|
|
|
variant="ghost"
|
|
|
@@ -6133,7 +6117,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
className="h-8 px-2"
|
|
|
>
|
|
|
<Edit2 className="w-4 h-4" />
|
|
|
- <span className="ml-1">编辑</span>
|
|
|
+ <span className="ml-1">{t('common.edit')}</span>
|
|
|
</Button>
|
|
|
<Button
|
|
|
variant="ghost"
|
|
|
@@ -6142,7 +6126,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
className="h-8 px-2 text-red-600 hover:text-red-700"
|
|
|
>
|
|
|
<Trash2 className="w-4 h-4" />
|
|
|
- <span className="ml-1">删除</span>
|
|
|
+ <span className="ml-1">{t('common.delete')}</span>
|
|
|
</Button>
|
|
|
</div>
|
|
|
</td>
|
|
|
@@ -6159,13 +6143,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="bg-white rounded-lg border border-gray-200 px-6 py-4">
|
|
|
<div className="flex items-center justify-between">
|
|
|
<div className="text-sm text-gray-600">
|
|
|
- 共 <span className="text-blue-600 font-medium">{filteredData.length}</span> 条记录
|
|
|
+ {t('common.total')} <span className="text-blue-600 font-medium">{filteredData.length}</span> {t('common.records')}
|
|
|
</div>
|
|
|
<div className="flex gap-2">
|
|
|
<Button
|
|
|
disabled={true}
|
|
|
>
|
|
|
- 上一页
|
|
|
+ {t('common.prevPage')}
|
|
|
</Button>
|
|
|
<span className="px-4 py-2 text-sm text-gray-600 flex items-center">
|
|
|
1 / 1
|
|
|
@@ -6173,7 +6157,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<Button
|
|
|
disabled={true}
|
|
|
>
|
|
|
- 下一页
|
|
|
+ {t('common.nextPage')}
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -6188,8 +6172,8 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div className="px-6 py-4 border-b border-gray-200 flex items-center justify-between sticky top-0 bg-white z-10">
|
|
|
<h3 className="text-lg text-gray-900">
|
|
|
{editingItem
|
|
|
- ? (subMenu === '流程模板' ? '编辑流程模板' : subMenu === 'SOP管理' ? '编辑SOP' : subMenu === '作业管理' ? '编辑作业' : subMenu === '表单管理' ? '编辑表单管理' : subMenu === '流程设计' ? '编辑流程设计' : '编辑')
|
|
|
- : (subMenu === '流程模板' ? '新增流程模板' : subMenu === 'SOP管理' ? '新增SOP' : subMenu === '作业管理' ? '新建作业' : subMenu === '表单管理' ? '新建表单管理' : subMenu === '流程设计' ? '新建流程设计' : '新建')
|
|
|
+ ? (subMenu === '流程模板' ? t('common.editTemplate') : subMenu === 'SOP管理' ? '编辑SOP' : subMenu === '作业管理' ? t('common.editWork') : subMenu === '表单管理' ? t('common.editFormManagement') : subMenu === '流程设计' ? t('common.editProcessDesign') : t('common.edit'))
|
|
|
+ : (subMenu === '流程模板' ? t('common.addTemplateTitle') : subMenu === 'SOP管理' ? '新增SOP' : subMenu === '作业管理' ? t('common.addWork') : subMenu === '表单管理' ? t('common.addFormManagement') : subMenu === '流程设计' ? t('common.addProcessDesign') : t('common.addNew'))
|
|
|
}
|
|
|
</h3>
|
|
|
<button
|