perf: 优化设置

This commit is contained in:
奔跑的面条 2022-08-30 12:13:58 +08:00
parent 96a41f8ebc
commit 199c6abcb1
5 changed files with 97 additions and 9 deletions

View File

@ -0,0 +1,3 @@
import GoSystemInfo from './index.vue';
export { GoSystemInfo };

View File

@ -0,0 +1,76 @@
<template>
<n-modal v-model:show="modelShow" @afterLeave="closeHandle">
<n-list bordered class="go-system-info">
<template #header>
<n-space justify="space-between">
<n-h3 class="go-mb-0">关于我们</n-h3>
<n-icon size="20" class="go-cursor-pointer" @click="closeHandle">
<close-icon></close-icon>
</n-icon>
</n-space>
</template>
<n-list-item>
<n-space :size="20">
<n-text class="item-left">版权声明</n-text>
<n-text>
GoView 版权属于
<n-a href="https://gitee.com/MTrun/go-view" target="_blank">https://gitee.com/MTrun/go-view</n-a>
</n-text>
</n-space>
</n-list-item>
<n-list-item>
<n-divider style="margin-top: 0" />
<n-space :size="20">
<n-text class="item-left">协议备注</n-text>
<n-text>
请遵守开源 MIT 协议以上声明 <n-text type="error">不可删除</n-text>
</n-text>
</n-space>
</n-list-item>
<n-list-item>
<n-divider style="margin-top: 0" />
<n-space :size="20">
<n-text class="item-left">商业授权</n-text>
<n-text>
若不想保留版权声明请通过仓库/交流群 联系项目作者进行授权
</n-text>
</n-space>
</n-list-item>
</n-list>
</n-modal>
</template>
<script lang="ts" setup>
import { icon } from '@/plugins'
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
const emit = defineEmits(['update:modelShow'])
defineProps({
modelShow: Boolean
})
const closeHandle = () => {
emit('update:modelShow', false)
}
</script>
<style lang="scss" scoped>
@include go('system-info') {
@extend .go-background-filter;
min-width: 100px;
max-width: 60vw;
padding-bottom: 20px;
.item-left {
width: 200px;
}
@include deep() {
.n-list-item:not(:last-child) {
border-bottom: 0;
}
}
}
</style>

View File

@ -20,14 +20,17 @@
<!-- 系统设置 model -->
<go-system-set v-model:modelShow="modelShow"></go-system-set>
<!-- 关于软件 model -->
<go-system-info v-model:modelShow="modelShowInfo"></go-system-info>
</template>
<script lang="ts" setup>
import { h, ref } from 'vue'
import { NAvatar, NText } from 'naive-ui'
import { renderIcon } from '@/utils'
import { openDoc, logout, renderLang } from '@/utils'
import { logout, renderLang } from '@/utils'
import { GoSystemSet } from '@/components/GoSystemSet/index'
import { GoSystemInfo } from '@/components/GoSystemInfo/index'
import Person from './person.png'
import { icon } from '@/plugins'
@ -40,6 +43,7 @@ const {
const t = window['$t']
const modelShowInfo = ref(false)
const modelShow = ref(false)
//
@ -77,16 +81,16 @@ const options = ref([
type: 'divider',
key: 'd1'
},
{
label: renderLang('global.contact'),
key: 'contact',
icon: renderIcon(ChatboxEllipsesIcon)
},
{
label: renderLang('global.sys_set'),
key: 'sysSet',
icon: renderIcon(SettingsSharpIcon)
},
{
label: renderLang('global.contact'),
key: 'contact',
icon: renderIcon(ChatboxEllipsesIcon)
},
{
type: 'divider',
key: 'd3'
@ -108,10 +112,15 @@ const sysSetHandle = () => {
modelShow.value = true
}
//
const sysInfoHandle = () => {
modelShowInfo.value = true
}
const handleSelect = (key: string) => {
switch (key) {
case 'contact':
openDoc()
sysInfoHandle()
break
case 'sysSet':
sysSetHandle()

View File

@ -9,7 +9,7 @@ const global = {
// header
doc: 'Document',
help: 'Help',
contact: 'Contact Us',
contact: 'About Software',
logout: 'Logout',
// system setting
sys_set: 'System Setting',

View File

@ -9,7 +9,7 @@ const global = {
// 头部
doc: '说明文档',
help: '帮助中心',
contact: '联系我们',
contact: '关于软件',
logout: '退出登录',
// 系统设置
sys_set: '系统设置',