Browse Source

Merge branch 'develop' of http://192.168.0.253:3000/bozzysadmb/ISCS-Client-V1.0 into develop

pm 4 months ago
parent
commit
50dbbd7c26
3 changed files with 20 additions and 8 deletions
  1. 8 8
      src/components/PostManagement.tsx
  2. 6 0
      src/locales/en.json
  3. 6 0
      src/locales/zh.json

+ 8 - 8
src/components/PostManagement.tsx

@@ -152,11 +152,11 @@ export default function PostManagement() {
   // 导出岗位
   // 导出岗位
   const handleExport = async () => {
   const handleExport = async () => {
     Modal.confirm({
     Modal.confirm({
-      title: '确认导出',
+      title: t('common.exportPostConfirm'),
       icon: <ExclamationCircleOutlined />,
       icon: <ExclamationCircleOutlined />,
-      content: '确定要导出岗位数据吗?',
-      okText: '确定导出',
-      cancelText: '取消',
+      content: t('common.exportPostConfirmText'),
+      okText: t('common.exportPostConfirmButton'),
+      cancelText: t('common.cancel'),
       onOk: async () => {
       onOk: async () => {
         setExportLoading(true);
         setExportLoading(true);
         try {
         try {
@@ -165,14 +165,14 @@ export default function PostManagement() {
           const url = window.URL.createObjectURL(blob);
           const url = window.URL.createObjectURL(blob);
           const link = document.createElement('a');
           const link = document.createElement('a');
           link.href = url;
           link.href = url;
-          link.download = '岗位列表.xls';
+          link.download = t('common.postDataFileName');
           document.body.appendChild(link);
           document.body.appendChild(link);
           link.click();
           link.click();
           document.body.removeChild(link);
           document.body.removeChild(link);
           window.URL.revokeObjectURL(url);
           window.URL.revokeObjectURL(url);
-          toast.success('导出成功');
+          toast.success(t('common.exportPostSuccess'));
         } catch (error: any) {
         } catch (error: any) {
-          toast.error(error.message || '导出失败');
+          toast.error(error.message || t('common.exportPostFailed'));
         } finally {
         } finally {
           setExportLoading(false);
           setExportLoading(false);
         }
         }
@@ -287,7 +287,7 @@ export default function PostManagement() {
                 onClick={handleExport}
                 onClick={handleExport}
                 loading={exportLoading}
                 loading={exportLoading}
               >
               >
-                导出
+                {t('common.export')}
               </Button>
               </Button>
             </PermissionWrapper>
             </PermissionWrapper>
           </Space>
           </Space>

+ 6 - 0
src/locales/en.json

@@ -267,6 +267,12 @@
     "exportUserSuccess": "Export successful",
     "exportUserSuccess": "Export successful",
     "exportUserFailed": "Export failed",
     "exportUserFailed": "Export failed",
     "userDataFileName": "User Data.xls",
     "userDataFileName": "User Data.xls",
+    "exportPostConfirm": "Confirm Export",
+    "exportPostConfirmText": "Are you sure you want to export post data?",
+    "exportPostConfirmButton": "Confirm Export",
+    "exportPostSuccess": "Export successful",
+    "exportPostFailed": "Export failed",
+    "postDataFileName": "Post List.xls",
     "resetPasswordTitle": "Reset Password",
     "resetPasswordTitle": "Reset Password",
     "resetPasswordPrompt": "Please enter a new password for user",
     "resetPasswordPrompt": "Please enter a new password for user",
     "resetPasswordNewPassword": ":",
     "resetPasswordNewPassword": ":",

+ 6 - 0
src/locales/zh.json

@@ -269,6 +269,12 @@
     "exportUserSuccess": "导出成功",
     "exportUserSuccess": "导出成功",
     "exportUserFailed": "导出失败",
     "exportUserFailed": "导出失败",
     "userDataFileName": "用户数据.xls",
     "userDataFileName": "用户数据.xls",
+    "exportPostConfirm": "确认导出",
+    "exportPostConfirmText": "确定要导出岗位数据吗?",
+    "exportPostConfirmButton": "确定导出",
+    "exportPostSuccess": "导出成功",
+    "exportPostFailed": "导出失败",
+    "postDataFileName": "岗位列表.xls",
     "resetPasswordTitle": "重置密码",
     "resetPasswordTitle": "重置密码",
     "resetPasswordPrompt": "请输入用户",
     "resetPasswordPrompt": "请输入用户",
     "resetPasswordNewPassword": "的新密码:",
     "resetPasswordNewPassword": "的新密码:",