Browse Source

feat: (i18n) 多语言

gemercheung 2 năm trước cách đây
mục cha
commit
65b53a30c4

+ 19 - 0
src/locales/lang/zh-CN/antdLocale/DatePicker.ts

@@ -0,0 +1,19 @@
+export default {
+  lang: {
+    shortWeekDays: ['一', '二', '三', '四', '五', '六', '日'],
+    shortMonths: [
+      '1月',
+      '2月',
+      '3月',
+      '4月',
+      '5月',
+      '6月',
+      '7月',
+      '8月',
+      '9月',
+      '10月',
+      '11月',
+      '12月',
+    ],
+  },
+};

+ 10 - 10
src/locales/lang/zh_CN.ts

@@ -1,10 +1,10 @@
-import { genMessage } from '../helper';
-import antdLocale from 'ant-design-vue/es/locale/zh_CN';
-
-const modules = import.meta.globEager('./zh-CN/**/*.ts');
-export default {
-  message: {
-    ...genMessage(modules, 'zh-CN'),
-    antdLocale,
-  },
-};
+import { genMessage } from '../helper';
+import antdLocale from 'ant-design-vue/es/locale/zh_CN';
+
+const modules = import.meta.globEager('./zh-CN/**/*.ts');
+export default {
+  message: {
+    ...genMessage(modules, 'zh-CN'),
+    antdLocale,
+  },
+};

+ 1 - 2
src/views/dashboard/analysis/enterprise.vue

@@ -39,8 +39,7 @@
   import { listRoomsApi, ListApi as ListLiveApi } from '/@/api/scene/list';
   import { formatToDate } from '/@/utils/dateUtil';
   import dayjs from 'dayjs';
-  import 'dayjs/locale/zh-cn';
-  dayjs.locale('zh-cn');
+
   const loading = ref(true);
   // const { t } = useI18n();
 

+ 165 - 165
src/views/setting/data.ts

@@ -1,165 +1,165 @@
-import { FormSchema } from '/@/components/Form/index';
-
-export interface ListItem {
-  key: string;
-  title: string;
-  description: string;
-  extra?: string;
-  avatar?: string;
-  color?: string;
-}
-
-// tab的list
-export const settingList = [
-  {
-    key: '1',
-    name: '基本设置',
-    component: 'BaseSetting',
-  },
-  // {
-  //   key: '2',
-  //   name: '安全设置',
-  //   component: 'SecureSetting',
-  // },
-  // {
-  //   key: '3',
-  //   name: '账号绑定',
-  //   component: 'AccountBind',
-  // },
-  // {
-  //   key: '4',
-  //   name: '新消息通知',
-  //   component: 'MsgNotify',
-  // },
-];
-
-// 基础设置 form
-export const baseSetschemas: FormSchema[] = [
-  {
-    field: 'password',
-    component: 'StrengthMeter',
-    label: '旧密码',
-    labelWidth: 60,
-    required: true,
-    // colProps: { span: 18 },
-  },
-  {
-    field: 'newPassword',
-    component: 'StrengthMeter',
-    label: '新密码',
-    labelWidth: 60,
-    required: true,
-    // colProps: { span: 18 },
-  },
-  // {
-  //   field: 'email',
-  //   component: 'Input',
-  //   label: '邮箱',
-  //   colProps: { span: 18 },
-  // },
-  // {
-  //   field: 'name',
-  //   component: 'Input',
-  //   label: '昵称',
-  //   colProps: { span: 18 },
-  // },
-  // {
-  //   field: 'introduction',
-  //   component: 'InputTextArea',
-  //   label: '个人简介',
-  //   colProps: { span: 18 },
-  // },
-  // {
-  //   field: 'phone',
-  //   component: 'Input',
-  //   label: '联系电话',
-  //   colProps: { span: 18 },
-  // },
-  // {
-  //   field: 'address',
-  //   component: 'Input',
-  //   label: '所在地区',
-  //   colProps: { span: 18 },
-  // },
-];
-
-// 安全设置 list
-export const secureSettingList: ListItem[] = [
-  {
-    key: '1',
-    title: '账户密码',
-    description: '当前密码强度::强',
-    extra: '修改',
-  },
-  {
-    key: '2',
-    title: '密保手机',
-    description: '已绑定手机::138****8293',
-    extra: '修改',
-  },
-  {
-    key: '3',
-    title: '密保问题',
-    description: '未设置密保问题,密保问题可有效保护账户安全',
-    extra: '修改',
-  },
-  {
-    key: '4',
-    title: '备用邮箱',
-    description: '已绑定邮箱::ant***sign.com',
-    extra: '修改',
-  },
-  {
-    key: '5',
-    title: 'MFA 设备',
-    description: '未绑定 MFA 设备,绑定后,可以进行二次确认',
-    extra: '修改',
-  },
-];
-
-// 账号绑定 list
-export const accountBindList: ListItem[] = [
-  {
-    key: '1',
-    title: '绑定淘宝',
-    description: '当前未绑定淘宝账号',
-    extra: '绑定',
-    avatar: 'ri:taobao-fill',
-    color: '#ff4000',
-  },
-  {
-    key: '2',
-    title: '绑定支付宝',
-    description: '当前未绑定支付宝账号',
-    extra: '绑定',
-    avatar: 'fa-brands:alipay',
-    color: '#2eabff',
-  },
-  {
-    key: '3',
-    title: '绑定钉钉',
-    description: '当前未绑定钉钉账号',
-    extra: '绑定',
-    avatar: 'ri:dingding-fill',
-    color: '#2eabff',
-  },
-];
-
-// 新消息通知 list
-export const msgNotifyList: ListItem[] = [
-  {
-    key: '1',
-    title: '账户密码',
-    description: '其他用户的消息将以站内信的形式通知',
-  },
-  {
-    key: '2',
-    title: '系统消息',
-    description: '系统消息将以站内信的形式通知',
-  },
-  {
-    key: '3',
-    title: '待办任务',
-    description: '待办任务将以站内信的形式通知',
-  },
-];
+import { FormSchema } from '/@/components/Form/index';
+
+export interface ListItem {
+  key: string;
+  title: string;
+  description: string;
+  extra?: string;
+  avatar?: string;
+  color?: string;
+}
+
+// tab的list
+export const settingList = [
+  {
+    key: '1',
+    name: '基本设置',
+    component: 'BaseSetting',
+  },
+  // {
+  //   key: '2',
+  //   name: '安全设置',
+  //   component: 'SecureSetting',
+  // },
+  // {
+  //   key: '3',
+  //   name: '账号绑定',
+  //   component: 'AccountBind',
+  // },
+  // {
+  //   key: '4',
+  //   name: '新消息通知',
+  //   component: 'MsgNotify',
+  // },
+];
+
+// 基础设置 form
+export const baseSetschemas: FormSchema[] = [
+  {
+    field: 'password',
+    component: 'StrengthMeter',
+    label: '旧密码',
+    labelWidth: 60,
+    required: true,
+    colProps: { span: 24 },
+  },
+  {
+    field: 'newPassword',
+    component: 'StrengthMeter',
+    label: '新密码',
+    labelWidth: 60,
+    required: true,
+    colProps: { span: 24 },
+  },
+  // {
+  //   field: 'email',
+  //   component: 'Input',
+  //   label: '邮箱',
+  //   colProps: { span: 18 },
+  // },
+  // {
+  //   field: 'name',
+  //   component: 'Input',
+  //   label: '昵称',
+  //   colProps: { span: 18 },
+  // },
+  // {
+  //   field: 'introduction',
+  //   component: 'InputTextArea',
+  //   label: '个人简介',
+  //   colProps: { span: 18 },
+  // },
+  // {
+  //   field: 'phone',
+  //   component: 'Input',
+  //   label: '联系电话',
+  //   colProps: { span: 18 },
+  // },
+  // {
+  //   field: 'address',
+  //   component: 'Input',
+  //   label: '所在地区',
+  //   colProps: { span: 18 },
+  // },
+];
+
+// 安全设置 list
+export const secureSettingList: ListItem[] = [
+  {
+    key: '1',
+    title: '账户密码',
+    description: '当前密码强度::强',
+    extra: '修改',
+  },
+  {
+    key: '2',
+    title: '密保手机',
+    description: '已绑定手机::138****8293',
+    extra: '修改',
+  },
+  {
+    key: '3',
+    title: '密保问题',
+    description: '未设置密保问题,密保问题可有效保护账户安全',
+    extra: '修改',
+  },
+  {
+    key: '4',
+    title: '备用邮箱',
+    description: '已绑定邮箱::ant***sign.com',
+    extra: '修改',
+  },
+  {
+    key: '5',
+    title: 'MFA 设备',
+    description: '未绑定 MFA 设备,绑定后,可以进行二次确认',
+    extra: '修改',
+  },
+];
+
+// 账号绑定 list
+export const accountBindList: ListItem[] = [
+  {
+    key: '1',
+    title: '绑定淘宝',
+    description: '当前未绑定淘宝账号',
+    extra: '绑定',
+    avatar: 'ri:taobao-fill',
+    color: '#ff4000',
+  },
+  {
+    key: '2',
+    title: '绑定支付宝',
+    description: '当前未绑定支付宝账号',
+    extra: '绑定',
+    avatar: 'fa-brands:alipay',
+    color: '#2eabff',
+  },
+  {
+    key: '3',
+    title: '绑定钉钉',
+    description: '当前未绑定钉钉账号',
+    extra: '绑定',
+    avatar: 'ri:dingding-fill',
+    color: '#2eabff',
+  },
+];
+
+// 新消息通知 list
+export const msgNotifyList: ListItem[] = [
+  {
+    key: '1',
+    title: '账户密码',
+    description: '其他用户的消息将以站内信的形式通知',
+  },
+  {
+    key: '2',
+    title: '系统消息',
+    description: '系统消息将以站内信的形式通知',
+  },
+  {
+    key: '3',
+    title: '待办任务',
+    description: '待办任务将以站内信的形式通知',
+  },
+];