From 58db52cea8dc3c5cb547f3234b8b9e05a175969e Mon Sep 17 00:00:00 2001 From: xingyuv Date: Sat, 18 Mar 2023 21:47:59 +0800 Subject: [PATCH] feat(view): base view init --- src/views/{sys => base}/about/index.vue | 0 .../{sys => base}/exception/Exception.vue | 0 src/views/{sys => base}/exception/index.ts | 0 src/views/{sys => base}/iframe/FrameBlank.vue | 0 src/views/{sys => base}/iframe/index.vue | 0 src/views/{sys => base}/lock/LockPage.vue | 0 src/views/{sys => base}/lock/index.vue | 0 src/views/{sys => base}/lock/useNow.ts | 0 .../login/ForgetPasswordForm.vue | 0 src/views/{sys => base}/login/Login.vue | 0 src/views/{sys => base}/login/LoginForm.vue | 0 .../{sys => base}/login/LoginFormTitle.vue | 0 src/views/{sys => base}/login/MobileForm.vue | 0 src/views/{sys => base}/login/QrCodeForm.vue | 0 .../{sys => base}/login/RegisterForm.vue | 0 .../login/SessionTimeoutLogin.vue | 0 src/views/{sys => base}/login/useLogin.ts | 0 src/views/base/profile/AccountBind.vue | 64 ++++++ src/views/base/profile/BaseSetting.vue | 80 ++++++++ src/views/base/profile/MsgNotify.vue | 34 ++++ src/views/base/profile/PasswordModel.vue | 43 ++++ src/views/base/profile/SecureSetting.vue | 55 +++++ src/views/base/profile/data.ts | 189 ++++++++++++++++++ src/views/base/profile/index.vue | 40 ++++ src/views/{sys => base}/redirect/index.vue | 0 .../workbench/components/WorkbenchHeader.vue | 4 +- src/views/sys/error-log/DetailModal.vue | 26 --- src/views/sys/error-log/data.tsx | 67 ------- src/views/sys/error-log/index.vue | 97 --------- 29 files changed, 507 insertions(+), 192 deletions(-) rename src/views/{sys => base}/about/index.vue (100%) rename src/views/{sys => base}/exception/Exception.vue (100%) rename src/views/{sys => base}/exception/index.ts (100%) rename src/views/{sys => base}/iframe/FrameBlank.vue (100%) rename src/views/{sys => base}/iframe/index.vue (100%) rename src/views/{sys => base}/lock/LockPage.vue (100%) rename src/views/{sys => base}/lock/index.vue (100%) rename src/views/{sys => base}/lock/useNow.ts (100%) rename src/views/{sys => base}/login/ForgetPasswordForm.vue (100%) rename src/views/{sys => base}/login/Login.vue (100%) rename src/views/{sys => base}/login/LoginForm.vue (100%) rename src/views/{sys => base}/login/LoginFormTitle.vue (100%) rename src/views/{sys => base}/login/MobileForm.vue (100%) rename src/views/{sys => base}/login/QrCodeForm.vue (100%) rename src/views/{sys => base}/login/RegisterForm.vue (100%) rename src/views/{sys => base}/login/SessionTimeoutLogin.vue (100%) rename src/views/{sys => base}/login/useLogin.ts (100%) create mode 100644 src/views/base/profile/AccountBind.vue create mode 100644 src/views/base/profile/BaseSetting.vue create mode 100644 src/views/base/profile/MsgNotify.vue create mode 100644 src/views/base/profile/PasswordModel.vue create mode 100644 src/views/base/profile/SecureSetting.vue create mode 100644 src/views/base/profile/data.ts create mode 100644 src/views/base/profile/index.vue rename src/views/{sys => base}/redirect/index.vue (100%) delete mode 100644 src/views/sys/error-log/DetailModal.vue delete mode 100644 src/views/sys/error-log/data.tsx delete mode 100644 src/views/sys/error-log/index.vue diff --git a/src/views/sys/about/index.vue b/src/views/base/about/index.vue similarity index 100% rename from src/views/sys/about/index.vue rename to src/views/base/about/index.vue diff --git a/src/views/sys/exception/Exception.vue b/src/views/base/exception/Exception.vue similarity index 100% rename from src/views/sys/exception/Exception.vue rename to src/views/base/exception/Exception.vue diff --git a/src/views/sys/exception/index.ts b/src/views/base/exception/index.ts similarity index 100% rename from src/views/sys/exception/index.ts rename to src/views/base/exception/index.ts diff --git a/src/views/sys/iframe/FrameBlank.vue b/src/views/base/iframe/FrameBlank.vue similarity index 100% rename from src/views/sys/iframe/FrameBlank.vue rename to src/views/base/iframe/FrameBlank.vue diff --git a/src/views/sys/iframe/index.vue b/src/views/base/iframe/index.vue similarity index 100% rename from src/views/sys/iframe/index.vue rename to src/views/base/iframe/index.vue diff --git a/src/views/sys/lock/LockPage.vue b/src/views/base/lock/LockPage.vue similarity index 100% rename from src/views/sys/lock/LockPage.vue rename to src/views/base/lock/LockPage.vue diff --git a/src/views/sys/lock/index.vue b/src/views/base/lock/index.vue similarity index 100% rename from src/views/sys/lock/index.vue rename to src/views/base/lock/index.vue diff --git a/src/views/sys/lock/useNow.ts b/src/views/base/lock/useNow.ts similarity index 100% rename from src/views/sys/lock/useNow.ts rename to src/views/base/lock/useNow.ts diff --git a/src/views/sys/login/ForgetPasswordForm.vue b/src/views/base/login/ForgetPasswordForm.vue similarity index 100% rename from src/views/sys/login/ForgetPasswordForm.vue rename to src/views/base/login/ForgetPasswordForm.vue diff --git a/src/views/sys/login/Login.vue b/src/views/base/login/Login.vue similarity index 100% rename from src/views/sys/login/Login.vue rename to src/views/base/login/Login.vue diff --git a/src/views/sys/login/LoginForm.vue b/src/views/base/login/LoginForm.vue similarity index 100% rename from src/views/sys/login/LoginForm.vue rename to src/views/base/login/LoginForm.vue diff --git a/src/views/sys/login/LoginFormTitle.vue b/src/views/base/login/LoginFormTitle.vue similarity index 100% rename from src/views/sys/login/LoginFormTitle.vue rename to src/views/base/login/LoginFormTitle.vue diff --git a/src/views/sys/login/MobileForm.vue b/src/views/base/login/MobileForm.vue similarity index 100% rename from src/views/sys/login/MobileForm.vue rename to src/views/base/login/MobileForm.vue diff --git a/src/views/sys/login/QrCodeForm.vue b/src/views/base/login/QrCodeForm.vue similarity index 100% rename from src/views/sys/login/QrCodeForm.vue rename to src/views/base/login/QrCodeForm.vue diff --git a/src/views/sys/login/RegisterForm.vue b/src/views/base/login/RegisterForm.vue similarity index 100% rename from src/views/sys/login/RegisterForm.vue rename to src/views/base/login/RegisterForm.vue diff --git a/src/views/sys/login/SessionTimeoutLogin.vue b/src/views/base/login/SessionTimeoutLogin.vue similarity index 100% rename from src/views/sys/login/SessionTimeoutLogin.vue rename to src/views/base/login/SessionTimeoutLogin.vue diff --git a/src/views/sys/login/useLogin.ts b/src/views/base/login/useLogin.ts similarity index 100% rename from src/views/sys/login/useLogin.ts rename to src/views/base/login/useLogin.ts diff --git a/src/views/base/profile/AccountBind.vue b/src/views/base/profile/AccountBind.vue new file mode 100644 index 00000000..e0cdf789 --- /dev/null +++ b/src/views/base/profile/AccountBind.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/views/base/profile/BaseSetting.vue b/src/views/base/profile/BaseSetting.vue new file mode 100644 index 00000000..e08a1282 --- /dev/null +++ b/src/views/base/profile/BaseSetting.vue @@ -0,0 +1,80 @@ + + + + diff --git a/src/views/base/profile/MsgNotify.vue b/src/views/base/profile/MsgNotify.vue new file mode 100644 index 00000000..8979a135 --- /dev/null +++ b/src/views/base/profile/MsgNotify.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/views/base/profile/PasswordModel.vue b/src/views/base/profile/PasswordModel.vue new file mode 100644 index 00000000..1ff14eab --- /dev/null +++ b/src/views/base/profile/PasswordModel.vue @@ -0,0 +1,43 @@ + + diff --git a/src/views/base/profile/SecureSetting.vue b/src/views/base/profile/SecureSetting.vue new file mode 100644 index 00000000..74c4a786 --- /dev/null +++ b/src/views/base/profile/SecureSetting.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/views/base/profile/data.ts b/src/views/base/profile/data.ts new file mode 100644 index 00000000..406d84e0 --- /dev/null +++ b/src/views/base/profile/data.ts @@ -0,0 +1,189 @@ +import { FormSchema } from '@/components/Form/index' +import { useI18n } from '@/hooks/web/useI18n' + +const { t } = useI18n() + +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: 'nickname', + component: 'Input', + label: t('profile.user.nickname'), + colProps: { span: 18 } + }, + { + field: 'mobile', + component: 'Input', + label: t('profile.user.mobile'), + colProps: { span: 18 } + }, + { + field: 'email', + component: 'Input', + label: t('profile.user.email'), + colProps: { span: 18 } + }, + { + field: 'sex', + component: 'RadioGroup', + componentProps: { + options: [ + { label: '男', value: 1 }, + { label: '女', value: 2 } + ] + }, + label: t('profile.user.sex'), + 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: '20', + title: '钉钉', + description: '当前未绑定钉钉账号', + extra: '绑定', + avatar: 'ri:dingding-fill', + color: '#2eabff' + }, + { + key: '30', + title: '企业微信', + description: '当前未绑定企业微信', + extra: '绑定', + avatar: 'ri:wechat-line', + color: '#2eabff' + } +] + +// 新消息通知 list +export const msgNotifyList: ListItem[] = [ + { + key: '1', + title: '账户密码', + description: '其他用户的消息将以站内信的形式通知' + }, + { + key: '2', + title: '系统消息', + description: '系统消息将以站内信的形式通知' + }, + { + key: '3', + title: '待办任务', + description: '待办任务将以站内信的形式通知' + } +] + +export const passwordSchema: FormSchema[] = [ + { + field: 'oldPassword', + label: '当前密码', + component: 'InputPassword', + required: true + }, + { + field: 'newPassword', + label: '新密码', + component: 'StrengthMeter', + componentProps: { + placeholder: '新密码' + }, + rules: [ + { + required: true, + message: '请输入新密码' + } + ] + }, + { + field: 'confirmPassword', + label: '确认密码', + component: 'InputPassword', + + dynamicRules: ({ values }) => { + return [ + { + required: true, + validator: (_, value) => { + if (!value) { + return Promise.reject('密码不能为空') + } + if (value !== values.newPassword) { + return Promise.reject('两次输入的密码不一致!') + } + return Promise.resolve() + } + } + ] + } + } +] diff --git a/src/views/base/profile/index.vue b/src/views/base/profile/index.vue new file mode 100644 index 00000000..b8d8c354 --- /dev/null +++ b/src/views/base/profile/index.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/views/sys/redirect/index.vue b/src/views/base/redirect/index.vue similarity index 100% rename from src/views/sys/redirect/index.vue rename to src/views/base/redirect/index.vue diff --git a/src/views/dashboard/workbench/components/WorkbenchHeader.vue b/src/views/dashboard/workbench/components/WorkbenchHeader.vue index 5fe095e2..1c41b6ac 100644 --- a/src/views/dashboard/workbench/components/WorkbenchHeader.vue +++ b/src/views/dashboard/workbench/components/WorkbenchHeader.vue @@ -1,8 +1,8 @@