From c1c6500df2ede08676fa087e00130c6d4c1996f3 Mon Sep 17 00:00:00 2001
From: TsMask <340112800@qq.com>
Date: Thu, 23 Nov 2023 15:04:46 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=B3=BB=E7=BB=9F?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3/?=
=?UTF-8?q?=E5=AE=98=E7=BD=91=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/i18n/locales/en-US.ts | 28 ++-
src/i18n/locales/zh-CN.ts | 28 ++-
src/layouts/BasicLayout.vue | 34 ++-
src/layouts/components/RightContent.vue | 15 +-
src/router/index.ts | 8 +-
src/store/modules/app.ts | 47 ++--
.../setting/components/change-copyright.vue | 4 +-
.../setting/components/change-help-doc.vue | 204 ++++++++++++++++++
.../setting/components/change-login-bg.vue | 2 +-
.../components/change-official-url.vue | 126 +++++++++++
.../setting/components/change-title.vue | 7 +-
src/views/system/setting/index.vue | 10 +
src/views/tool/help/index.vue | 35 ++-
13 files changed, 493 insertions(+), 55 deletions(-)
create mode 100644 src/views/system/setting/components/change-help-doc.vue
create mode 100644 src/views/system/setting/components/change-official-url.vue
diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts
index 36ba85b8..341561ef 100644
--- a/src/i18n/locales/en-US.ts
+++ b/src/i18n/locales/en-US.ts
@@ -128,6 +128,7 @@ export default {
register: 'Registrations',
page403: 'No Access',
page404: 'Match Page Not Found',
+ helpDoc: 'System User Documentation',
account: {
index: "Personal Center",
profile: "Personal Info",
@@ -155,8 +156,12 @@ export default {
// 布局
loayouts: {
+ basic: {
+ officialUrl: 'Official',
+ helpDoc: 'Doc',
+ },
rightContent: {
- helpDoc: "Help Documentation",
+ helpDoc: "System User Documentation",
fullscreen: "Full Screen",
logout: "Logout",
profile: "Profile",
@@ -1025,8 +1030,9 @@ export default {
saveSuccess: 'Submit ands Save Successful',
revert: 'Reset',
revertSuccess: 'Reset Successful',
- uploadFormat: 'Only the upload image format ({format}) is supported',
- uploadSize: 'Image file size must be less than {size}MB',
+ uploadFile: 'Upload File',
+ uploadFormat: 'Only the upload file format ({format}) is supported',
+ uploadSize: 'The file size must be less than {size}MB.',
uploadSuccess: 'File uploaded successfully, submit and save to take effect',
sysLogo: 'System Logo',
sysLogoBrand: 'Brand',
@@ -1040,11 +1046,9 @@ export default {
sysLogoInstruction3: 'Displayed as logo + system name to the system logo area.',
sysLogoInstruction4: 'Logo size ratio size',
sysName: 'System Name',
- sysNamePlease: 'Please enter the system name',
sysNameLimitation: 'System Name Restrictions',
sysNameTipContent: 'Confirm that you want to submit the current changed system name?',
sysCopyright: 'Copyright Notice',
- sysCopyrightPlease: 'Please enter copyright notice',
sysCopyrightLimitation: 'Copyright Notice Limitation',
sysCopyrightTipContent: 'Confirmation of submitting a copyright notice for the current change?',
sysLoginBg: 'Login screen background',
@@ -1056,6 +1060,20 @@ export default {
sysLoginBgInstruction: 'The background style of the system login interface is shown in the preview area, please refer to the actual display.',
sysLoginBgInstruction1: 'Please select the appropriate image for uploading.',
sysLoginBgInstruction2: 'Restore the background image to the initial system default background by clicking the Restore button.',
+ sysHelpDoc: 'System User Documentation',
+ sysHelpDocTipContentUpload: 'Are you sure you want to upload the system documentation?',
+ sysHelpDocTipContent: 'Confirm that you want to submit system usage documentation for the current change?',
+ sysHelpDocTipContentRevert: 'Are you sure you want to restore and clear the system usage files?',
+ sysHelpDocNo: 'No Documentation',
+ sysHelpDocOpen: 'Document Access',
+ sysHelpDocInstruction: 'Description of system functions and use, PDF document manual',
+ sysOfficialUrl: 'Official Link',
+ sysOfficialUrlErrTip: 'Please fill in a valid link address http(s)://',
+ sysOfficialUrlTipContent: 'Do you confirm that you want to submit the current change of the official website address?',
+ sysOfficialUrlNo: 'No link address',
+ sysOfficialUrlOpen: 'Open the official website.',
+ sysOfficialUrlInstruction: 'Official website link address',
+ sysOfficialUrlInstruction1: 'start, if you need to hide do not jump to fill in the',
},
role:{
allScopeOptions:'All data permissions',
diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts
index 53a8eb58..69f76e5d 100644
--- a/src/i18n/locales/zh-CN.ts
+++ b/src/i18n/locales/zh-CN.ts
@@ -128,6 +128,7 @@ export default {
register: '注册',
page403: '没有访问权限',
page404: '找不到匹配页面',
+ helpDoc: '系统使用文档',
account: {
index: "个人中心",
profile: "个人信息",
@@ -155,8 +156,12 @@ export default {
// 布局
loayouts: {
+ basic: {
+ officialUrl: '官网',
+ helpDoc: '使用手册',
+ },
rightContent: {
- helpDoc: "帮助手册",
+ helpDoc: "系统使用文档",
fullscreen: "全屏显示",
logout: "退出登录",
profile: "个人中心",
@@ -1025,8 +1030,9 @@ export default {
saveSuccess: '提交保存成功',
revert: '还原',
revertSuccess: '还原成功',
- uploadFormat: '只支持上传图片格式({format})',
- uploadSize: '图片文件大小必须小于 {size}MB',
+ uploadFile: '上传文件',
+ uploadFormat: '只支持上传文件格式({format})',
+ uploadSize: '文件大小必须小于 {size}MB',
uploadSuccess: '文件上传成功,提交保存生效',
sysLogo: '系统LOGO',
sysLogoBrand: '全图',
@@ -1040,11 +1046,9 @@ export default {
sysLogoInstruction3: '以LOGO+系统名称的形式展示到系统LOGO区域。',
sysLogoInstruction4: 'LOGO尺寸比例大小',
sysName: '系统名称',
- sysNamePlease: '请输入系统名称',
sysNameLimitation: '系统名称限制',
sysNameTipContent: '确认要提交当前变更的系统名称吗?',
sysCopyright: '版权声明',
- sysCopyrightPlease: '请输入版权声明',
sysCopyrightLimitation: '版权声明限制',
sysCopyrightTipContent: '确认要提交当前变更的版权声明吗?',
sysLoginBg: '登录界面背景',
@@ -1056,6 +1060,20 @@ export default {
sysLoginBgInstruction: '系统登录界面背景样式如预览区域所示,请以实际显示为准',
sysLoginBgInstruction1: '请将选择合适的图片进行进行上传。',
sysLoginBgInstruction2: '通过点击《还原》按钮,将背景图还原到系统初始默认的背景。',
+ sysHelpDoc: '系统使用文档',
+ sysHelpDocTipContentUpload: '确认要上传系统使用文档吗?',
+ sysHelpDocTipContent: '确认要提交当前变更的系统使用文档吗?',
+ sysHelpDocTipContentRevert: '确认要还原清空系统使用文档吗?',
+ sysHelpDocNo: '无文档',
+ sysHelpDocOpen: '文档查阅',
+ sysHelpDocInstruction: '系统功能及使用说明,PDF文档手册',
+ sysOfficialUrl: '官网链接',
+ sysOfficialUrlErrTip: '请填写有效的链接地址 http(s)://',
+ sysOfficialUrlTipContent: '确认要提交当前变更的官网地址吗?',
+ sysOfficialUrlNo: '无链接地址',
+ sysOfficialUrlOpen: '打开官网',
+ sysOfficialUrlInstruction: '官网链接地址',
+ sysOfficialUrlInstruction1: '开头,如需隐藏不跳转填写',
},
role:{
allScopeOptions:'全部数据权限',
diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue
index b87b2a58..30e281ee 100644
--- a/src/layouts/BasicLayout.vue
+++ b/src/layouts/BasicLayout.vue
@@ -8,7 +8,7 @@ import {
import RightContent from './components/RightContent.vue';
import Tabs from './components/Tabs.vue';
import { scriptUrl } from '@/assets/js/icon_font_8d5l8fzk5b87iudi';
-import { computed, reactive, ref, watch } from 'vue';
+import { computed, reactive, watch } from 'vue';
import useLayoutStore from '@/store/modules/layout';
import useRouterStore from '@/store/modules/router';
import useTabsStore from '@/store/modules/tabs';
@@ -268,16 +268,31 @@ document.addEventListener('visibilitychange', function () {
@@ -313,8 +328,7 @@ document.addEventListener('visibilitychange', function () {
z-index: 16;
margin: 0px;
width: auto;
- margin-top: 48px;
- padding: 4px 16px;
+ margin-top: 52px;
&-fixed {
position: fixed;
bottom: 0;
@@ -330,7 +344,7 @@ document.addEventListener('visibilitychange', function () {
transition: background 0.3s, width 0.2s;
}
- &-time {
+ & #serverTimeDom {
color: #00000085;
transition: all 0.3s;
}
diff --git a/src/layouts/components/RightContent.vue b/src/layouts/components/RightContent.vue
index ea4e4a1e..f9585c63 100644
--- a/src/layouts/components/RightContent.vue
+++ b/src/layouts/components/RightContent.vue
@@ -3,10 +3,12 @@ import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
import { useRouter } from 'vue-router';
import { toggle, isFullscreen } from '@/utils/fullscreen-utils';
import useI18n from '@/hooks/useI18n';
+import useAppStore from '@/store/modules/app';
import useUserStore from '@/store/modules/user';
import useAlarmStore from '@/store/modules/alarm';
const { t, changeLocale } = useI18n();
const userStore = useUserStore();
+const appStore = useAppStore();
const router = useRouter();
/**头像展开项点击 */
@@ -29,11 +31,6 @@ function fnClickAlarm() {
router.push({ path: '/faultManage/active-alarm' });
}
-/**帮助手册按钮提示跳转 */
-function fnClickHelpDoc() {
- router.push({ name: 'Help_118' });
-}
-
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
@@ -54,16 +51,16 @@ function fnChangeLocale(e: any) {
-
+
{{ t('loayouts.rightContent.helpDoc') }}
-
+
-
+
{{ t('loayouts.rightContent.fullscreen') }}
@@ -73,7 +70,7 @@ function fnChangeLocale(e: any) {
-
+
{{ t('i18n') }}
diff --git a/src/router/index.ts b/src/router/index.ts
index c8de03bd..1c0152e1 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -81,6 +81,12 @@ const constantRoutes: RouteRecordRaw[] = [
meta: { title: 'router.page403' },
component: () => import('@/views/error/403.vue'),
},
+ {
+ path: '/help',
+ name: 'HelpDoc',
+ meta: { title: 'router.helpDoc' },
+ component: () => import('@/views/tool/help/index.vue'),
+ },
{
path: '/redirect',
name: 'Redirect',
@@ -130,7 +136,7 @@ router.afterEach((to, from, failure) => {
});
/**无Token可访问页面地址白名单 */
-const WHITE_LIST: string[] = ['/login', '/auth-redirect', '/bind', '/register'];
+const WHITE_LIST: string[] = ['/login', '/auth-redirect', '/help', '/register'];
/**全局路由-前置守卫 */
router.beforeEach((to, from, next) => {
diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts
index aafed4b9..685873cc 100644
--- a/src/store/modules/app.ts
+++ b/src/store/modules/app.ts
@@ -25,6 +25,10 @@ type AppStore = {
registerUser: boolean;
/**登录界面背景 */
loginBackground: string;
+ /**系统使用手册 */
+ helpDoc: string;
+ /**官方网址 */
+ officialUrl: string;
};
const useAppStore = defineStore('app', {
@@ -32,12 +36,14 @@ const useAppStore = defineStore('app', {
appName: import.meta.env.VITE_APP_NAME,
appCode: import.meta.env.VITE_APP_CODE,
appVersion: import.meta.env.VITE_APP_VERSION,
- copyright: 'Copyright ©2023 For AGrandTech',
+ copyright: `Copyright ©2023 For ${import.meta.env.VITE_APP_NAME}`,
logoType: 'icon',
filePathIcon: '',
filePathBrand: '',
registerUser: false,
loginBackground: '',
+ helpDoc: '',
+ officialUrl: '',
}),
getters: {
/**
@@ -97,6 +103,25 @@ const useAppStore = defineStore('app', {
: import.meta.env.VITE_API_BASE_URL;
return `${baseUrl}${path}`;
},
+ /**
+ * 获取正确使用手册地址
+ * @param state 内部属性不用传入
+ * @returns 手册地址url
+ */
+ getHelpDoc(state) {
+ const path = state.helpDoc;
+ if (!path || path === '#') {
+ return '#';
+ }
+ if (validHttp(path)) {
+ return path;
+ }
+ // 兼容旧前端可改配置文件
+ const baseUrl = import.meta.env.PROD
+ ? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
+ : import.meta.env.VITE_API_BASE_URL;
+ return `${baseUrl}${path}`;
+ },
},
actions: {
/**设置网页标题 */
@@ -125,26 +150,22 @@ const useAppStore = defineStore('app', {
async fnSysConf() {
const res = await getSysConf();
if (res.code === RESULT_CODE_SUCCESS && res.data) {
- if (res.data.title) {
- this.appName = res.data.title;
- }
- if (res.data.copyright) {
- this.copyright = res.data.copyright;
- }
+ this.appName = res.data.title;
+ this.copyright = res.data.copyright;
+ this.logoType = res.data.logoType;
this.filePathIcon = res.data.filePathIcon;
this.filePathBrand = res.data.filePathBrand;
- if (res.data.logoType) {
- this.logoType = res.data.logoType;
- // 修改html内容-小图当作favicon.ico
+ // 修改html内容-小图当作favicon.ico
+ if (this.logoType) {
const iconDom = document.querySelector("link[rel~='icon']");
if (iconDom) {
iconDom.setAttribute('href', this.getLOGOIcon);
}
}
this.registerUser = res.data.registerUser === 'true';
- if (res.data.loginBackground) {
- this.loginBackground = res.data.loginBackground;
- }
+ this.loginBackground = res.data.loginBackground;
+ this.helpDoc = res.data.helpDoc;
+ this.officialUrl = res.data.officialUrl;
}
return res;
},
diff --git a/src/views/system/setting/components/change-copyright.vue b/src/views/system/setting/components/change-copyright.vue
index 3180f58d..b3f71400 100644
--- a/src/views/system/setting/components/change-copyright.vue
+++ b/src/views/system/setting/components/change-copyright.vue
@@ -72,14 +72,14 @@ onMounted(() => {
v-model:value="state.copyright"
allow-clear
:maxlength="40"
- :placeholder="t('views.system.setting.sysCopyrightPlease')"
+ :placeholder="t('common.ipnutPlease')"
>
{{ t('views.system.setting.saveSubmit') }}
diff --git a/src/views/system/setting/components/change-help-doc.vue b/src/views/system/setting/components/change-help-doc.vue
new file mode 100644
index 00000000..35f16112
--- /dev/null
+++ b/src/views/system/setting/components/change-help-doc.vue
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+
+
+ {{ t('views.system.setting.uploadFile') }}
+
+
+
+
+
+
+ {{ t('views.system.setting.saveSubmit') }}
+
+
+ {{ t('common.cancel') }}
+
+
+
+
+
+
+
+ {{ t('views.system.setting.sysHelpDocNo') }}
+
+
+
+
+ {{ t('views.system.setting.sysHelpDocOpen') }}
+
+
+
+
+
+ {{ t('common.editText') }}
+
+
+ {{ t('views.system.setting.revert') }}
+
+
+
+
+
+
+ {{ t('views.system.setting.sysHelpDocInstruction') }}
+
+
+
+
+
+
+
diff --git a/src/views/system/setting/components/change-login-bg.vue b/src/views/system/setting/components/change-login-bg.vue
index 24e57727..f883482a 100644
--- a/src/views/system/setting/components/change-login-bg.vue
+++ b/src/views/system/setting/components/change-login-bg.vue
@@ -169,7 +169,7 @@ onMounted(() => {
:custom-request="fnUpload"
>
- {{ t('views.system.setting.sysLoginBgUpload') }}
+ {{ t('views.system.setting.uploadFile') }}
diff --git a/src/views/system/setting/components/change-official-url.vue b/src/views/system/setting/components/change-official-url.vue
new file mode 100644
index 00000000..3e8fdaaf
--- /dev/null
+++ b/src/views/system/setting/components/change-official-url.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('views.system.setting.saveSubmit') }}
+
+
+ {{ t('common.cancel') }}
+
+
+
+
+
+
+
+ {{ t('views.system.setting.sysOfficialUrlNo') }}
+
+
+
+
+
+ {{ t('views.system.setting.sysOfficialUrlOpen') }}
+
+
+
+ {{ t('common.editText') }}
+
+
+
+
+
+
+ {{ t('views.system.setting.sysOfficialUrlInstruction') }}
+ http(s)://
+ {{ t('views.system.setting.sysOfficialUrlInstruction1') }}
+ #
+
+
+
+
+
+
+
diff --git a/src/views/system/setting/components/change-title.vue b/src/views/system/setting/components/change-title.vue
index 1936bede..715aa092 100644
--- a/src/views/system/setting/components/change-title.vue
+++ b/src/views/system/setting/components/change-title.vue
@@ -69,16 +69,15 @@ onMounted(() => {
{{ t('views.system.setting.saveSubmit') }}
diff --git a/src/views/system/setting/index.vue b/src/views/system/setting/index.vue
index f3f7bcbe..c0f8b0bc 100644
--- a/src/views/system/setting/index.vue
+++ b/src/views/system/setting/index.vue
@@ -4,6 +4,8 @@ import ChangeLogo from './components/change-logo.vue';
import ChangeLogoBG from './components/change-login-bg.vue';
import ChangeTitle from './components/change-title.vue';
import ChangeCopyright from './components/change-copyright.vue';
+import ChangeHelpDoc from './components/change-help-doc.vue';
+import ChangeOfficialUrl from './components/change-official-url.vue';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
@@ -27,6 +29,14 @@ const { t } = useI18n();
{{ t('views.system.setting.sysLoginBg') }}
+
+ {{ t('views.system.setting.sysHelpDoc') }}
+
+
+
+ {{ t('views.system.setting.sysOfficialUrl') }}
+
+
diff --git a/src/views/tool/help/index.vue b/src/views/tool/help/index.vue
index ce3e6689..9960e88b 100644
--- a/src/views/tool/help/index.vue
+++ b/src/views/tool/help/index.vue
@@ -1,13 +1,38 @@
-