Browse Source

feat(device): 国际化

tangning 3 years ago
parent
commit
b1b6e38583
3 changed files with 32 additions and 15 deletions
  1. 6 0
      src/locales/lang/zh-CN/common.ts
  2. 11 0
      src/locales/lang/zh-CN/routes/staff.ts
  3. 15 15
      src/views/staff/list.vue

+ 6 - 0
src/locales/lang/zh-CN/common.ts

@@ -19,17 +19,23 @@ export default {
   light: '亮色主题',
   dark: '黑暗主题',
   unbind: '解绑',
+  details: '详情',
   bind: '绑定',
   yes: '是',
   no: '否',
+  roleName: '角色',
   unusual: '异常',
   operation: '操作',
+  normal: '正常',
+  unNormal: '非正常',
   state: '状态',
   fullName: '姓名',
+  print: '打印',
   optSuccess: '操作成功',
   optFail: '操作失败',
   notConnect: '暂未接入',
   delConfirm: '是否确认删除',
+  mobile: '手机',
   phone: '请填写您的手机号码!',
   phoneError: '请正确填写您的手机号码!',
 };

+ 11 - 0
src/locales/lang/zh-CN/routes/staff.ts

@@ -0,0 +1,11 @@
+export default {
+  deptName: '所属公司',
+  username: '员工名称',
+  mobile: '手机',
+  createTime: '创建时间',
+  staffList: '员工列表',
+  roleType: {
+    0: '公司管理员',
+    1: '公司员工',
+  },
+};

+ 15 - 15
src/views/staff/list.vue

@@ -16,17 +16,17 @@
           :actions="[
             {
               icon: 'mdi:information-outline',
-              label: '详情',
+              label: t('common.details'),
               onClick: () => {
                 go(`/order/list/detail/${record.orderNo}`);
               },
             },
             {
               icon: 'mdi:printer-outline',
-              label: '打印',
+              label: t('common.print'),
               color: 'error',
               onClick: () => {
-                createMessage.info(`暂未接入`);
+                createMessage.info(t('common.notConnect'));
               },
             },
           ]"
@@ -62,29 +62,29 @@
           width: 60,
         },
         {
-          title: '所属公司',
+          title: t('routes.staff.deptName'),
           dataIndex: 'deptName',
           width: 160,
         },
         {
-          title: '员工名称',
+          title: t('routes.staff.username'),
           dataIndex: 'username',
           width: 80,
         },
         {
-          title: '手机',
+          title: t('common.mobile'),
           dataIndex: 'mobile',
           width: 80,
         },
         {
-          title: '角色',
+          title: t('common.roleName'),
           dataIndex: 'roleName',
           // slots: { customRender: 'role' },
           sorter: true,
           width: 80,
         },
         {
-          title: '状态',
+          title: t('common.state'),
           dataIndex: 'status',
           slots: { customRender: 'status' },
           sorter: true,
@@ -92,7 +92,7 @@
         },
 
         {
-          title: '创建时间',
+          title: t('routes.staff.createTime'),
           dataIndex: 'createTime',
           slots: { customRender: 'createTime' },
           width: 130,
@@ -111,7 +111,7 @@
         schemas: [
           {
             field: 'phone',
-            label: '手机号',
+            label: t('routes.corporation.phone'),
             component: 'Input',
             colProps: {
               xl: 5,
@@ -122,7 +122,7 @@
       };
 
       const [registerTable] = useTable({
-        title: '员工列表',
+        title: t('routes.staff.staffList'),
         api: ListApi,
         columns: columns,
         useSearchForm: true,
@@ -144,9 +144,9 @@
       function renderRoleType(type: number): string {
         switch (type) {
           case 0:
-            return '公司管理员';
+            return t('routes.staff.roleType.0');
           case 1:
-            return '公司员工';
+            return t('routes.staff.roleType.1');
           default:
             return '';
         }
@@ -154,9 +154,9 @@
       function renderStatus(type: number): string {
         switch (type) {
           case 1:
-            return '正常';
+            return t('common.normal');
           case 0:
-            return '非正常';
+            return t('common.unNormal');
           default:
             return '';
         }