删除不用组件
parent
f6e2869087
commit
98e23c8600
|
|
@ -1,3 +0,0 @@
|
|||
import GoLangSelect from './index.vue';
|
||||
|
||||
export { GoLangSelect };
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<template>
|
||||
<n-dropdown
|
||||
trigger="hover"
|
||||
@select="handleSelect"
|
||||
:show-arrow="true"
|
||||
:options="[]"
|
||||
>
|
||||
<n-button quaternary>
|
||||
<n-icon size="20" :depth="1">
|
||||
<language-icon></language-icon>
|
||||
</n-icon>
|
||||
</n-button>
|
||||
</n-dropdown>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useLangStore } from '@/store/modules/langStore/langStore'
|
||||
import { LangEnum } from '@/enums/styleEnum'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const { LanguageIcon } = icon.ionicons5
|
||||
const { locale } = useI18n();
|
||||
const langStore = useLangStore()
|
||||
|
||||
const handleSelect = (key: LangEnum) => {
|
||||
locale.value = key;
|
||||
langStore.changeLang(key)
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import GoSkeleton from './index.vue';
|
||||
|
||||
export { GoSkeleton };
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<template>
|
||||
<div v-show="load" class="go-skeleton">
|
||||
<div v-show="repeat == 1">
|
||||
<n-skeleton class="item" v-bind="$attrs"></n-skeleton>
|
||||
</div>
|
||||
<div v-show="repeat == 2">
|
||||
<n-skeleton class="item" v-bind="$attrs"></n-skeleton>
|
||||
<n-skeleton class="item" v-bind="$attrs" style="width: 60%"></n-skeleton>
|
||||
</div>
|
||||
<div v-show="repeat > 2">
|
||||
<n-skeleton class="item" v-bind="$attrs" :repeat="repeat - 2"></n-skeleton>
|
||||
<n-skeleton class="item" v-bind="$attrs" style="width: 60%"></n-skeleton>
|
||||
<n-skeleton class="item" v-bind="$attrs" style="width: 50%"></n-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
repeat: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
load: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@include go('skeleton') {
|
||||
.item {
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import GoSystemInfo from './index.vue';
|
||||
|
||||
export { GoSystemInfo };
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
<template>
|
||||
<n-modal v-model:show="modelShowRef" @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 class="go-my-2" :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-space class="go-my-2" :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-space class="go-mt-2" :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 { ref, watch } from 'vue'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const props = defineProps({
|
||||
modelShow: Boolean
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelShow'])
|
||||
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
|
||||
const modelShowRef = ref(false)
|
||||
|
||||
watch(() => props.modelShow, (newValue) => {
|
||||
modelShowRef.value = newValue
|
||||
})
|
||||
|
||||
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>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
export type ListType = {
|
||||
key: any
|
||||
type: string
|
||||
name: string
|
||||
desc: string
|
||||
value: any
|
||||
suffix?: string
|
||||
step?: number
|
||||
min?: number
|
||||
tip?: string
|
||||
options?: { label: string; value: any }[]
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import GoSystemSet from './index.vue';
|
||||
|
||||
export { GoSystemSet };
|
||||
|
|
@ -1,207 +0,0 @@
|
|||
<template>
|
||||
<n-modal v-model:show="modelShowRef" @afterLeave="closeHandle">
|
||||
<n-list bordered class="go-system-setting">
|
||||
<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 v-for="item in list" :key="item.key">
|
||||
<!-- 分割线 -->
|
||||
<n-divider v-if="item.type === 'divider'" style="margin: 0;" />
|
||||
<n-space v-else :size="40">
|
||||
<n-space>
|
||||
<!-- 左侧标题 -->
|
||||
<n-text class="item-left">{{ item.name }}</n-text>
|
||||
|
||||
<!-- 数据操作 -->
|
||||
<template v-if="item.type === 'switch'">
|
||||
<n-switch
|
||||
v-model:value="item.value"
|
||||
size="small"
|
||||
@update:value="handleChange($event, item)"
|
||||
></n-switch>
|
||||
</template>
|
||||
|
||||
<template v-else-if="item.type === 'number'">
|
||||
<n-input-number
|
||||
v-model:value="item.value"
|
||||
class="input-num-width"
|
||||
size="small"
|
||||
:step="item.step || null"
|
||||
:suffix="item.suffix || null"
|
||||
:min="item.min || 0"
|
||||
@update:value="handleChange($event, item)"
|
||||
></n-input-number>
|
||||
</template>
|
||||
|
||||
<template v-else-if="item.type === 'select'">
|
||||
<n-select
|
||||
class="select-min-width"
|
||||
v-model:value="item.value"
|
||||
size="small"
|
||||
:options="item.options"
|
||||
@update:value="handleChange($event, item)"
|
||||
/>
|
||||
</template>
|
||||
</n-space>
|
||||
|
||||
<!-- 右侧描述 -->
|
||||
<n-space>
|
||||
<n-text class="item-right">{{ item.desc }}</n-text>
|
||||
<n-tooltip v-if="item.tip" trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon size="21">
|
||||
<help-outline-icon></help-outline-icon>
|
||||
</n-icon>
|
||||
</template>
|
||||
<span>{{ item.tip }}</span>
|
||||
</n-tooltip>
|
||||
</n-space>
|
||||
</n-space>
|
||||
</n-list-item>
|
||||
</n-list>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<script script lang="ts" setup>
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { ListType } from './index.d'
|
||||
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
|
||||
import { SettingStoreEnums, ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const props = defineProps({
|
||||
modelShow: Boolean
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelShow'])
|
||||
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
|
||||
const settingStore = useSettingStore()
|
||||
const modelShowRef = ref(false)
|
||||
|
||||
const list = reactive<ListType[]>([
|
||||
{
|
||||
key: SettingStoreEnums.ASIDE_ALL_COLLAPSED,
|
||||
value: settingStore.getAsideAllCollapsed,
|
||||
type: 'switch',
|
||||
name: '菜单折叠',
|
||||
desc: '首页菜单折叠时隐藏至界面外'
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.HIDE_PACKAGE_ONE_CATEGORY,
|
||||
value: settingStore.getHidePackageOneCategory,
|
||||
type: 'switch',
|
||||
name: '隐藏分类',
|
||||
desc: '工作空间表单分类只有单项时隐藏'
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.CHANGE_LANG_RELOAD,
|
||||
value: settingStore.getChangeLangReload,
|
||||
type: 'switch',
|
||||
name: '切换语言',
|
||||
desc: '切换语言重新加载页面',
|
||||
tip: '若遇到部分区域语言切换失败,则建议开启'
|
||||
},
|
||||
{
|
||||
key: 'divider1',
|
||||
type: 'divider',
|
||||
name: '',
|
||||
desc: '',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.CHART_TOOLS_STATUS_HIDE,
|
||||
value: settingStore.getChartToolsStatusHide,
|
||||
type: 'switch',
|
||||
name: '隐藏工具栏',
|
||||
desc: '鼠标移入时,会展示切换到展开模式',
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.CHART_TOOLS_STATUS,
|
||||
value: settingStore.getChartToolsStatus,
|
||||
type: 'select',
|
||||
name: '工具栏展示',
|
||||
desc: '工作空间工具栏展示方式',
|
||||
options: [
|
||||
{
|
||||
label: '侧边栏',
|
||||
value: ToolsStatusEnum.ASIDE
|
||||
},
|
||||
{
|
||||
label: '底部 Dock',
|
||||
value: ToolsStatusEnum.DOCK
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'divider0',
|
||||
type: 'divider',
|
||||
name: '',
|
||||
desc: '',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.CHART_MOVE_DISTANCE,
|
||||
value: settingStore.getChartMoveDistance,
|
||||
type: 'number',
|
||||
name: '移动距离',
|
||||
min: 1,
|
||||
step: 1,
|
||||
suffix: 'px',
|
||||
desc: '工作空间方向键控制移动距离'
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.CHART_ALIGN_RANGE,
|
||||
value: settingStore.getChartAlignRange,
|
||||
type: 'number',
|
||||
name: '吸附距离',
|
||||
min: 10,
|
||||
step: 2,
|
||||
suffix: 'px',
|
||||
desc: '工作空间移动图表时的吸附距离'
|
||||
}
|
||||
])
|
||||
|
||||
watch(() => props.modelShow, (newValue) => {
|
||||
modelShowRef.value = newValue
|
||||
})
|
||||
|
||||
const closeHandle = () => {
|
||||
emit('update:modelShow', false)
|
||||
}
|
||||
|
||||
const handleChange = (e: MouseEvent, item: ListType) => {
|
||||
settingStore.setItem(item.key, item.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@include go("system-setting") {
|
||||
@extend .go-background-filter;
|
||||
min-width: 100px;
|
||||
max-width: 60vw;
|
||||
padding-bottom: 20px;
|
||||
.item-left {
|
||||
width: 200px;
|
||||
}
|
||||
.input-num-width {
|
||||
width: 100px;
|
||||
}
|
||||
.select-min-width {
|
||||
width: 115px;
|
||||
}
|
||||
@include deep() {
|
||||
.n-list-item {
|
||||
border-bottom: 0!important;
|
||||
}
|
||||
.n-list-item__divider {
|
||||
display: none!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import GoThemeSelect from './index.vue';
|
||||
|
||||
export { GoThemeSelect };
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<template>
|
||||
<n-button quaternary @click="changeTheme" title="主题">
|
||||
<n-icon size="20" :depth="1">
|
||||
<moon-icon v-if="designStore.darkTheme"></moon-icon>
|
||||
<sunny-icon v-else></sunny-icon>
|
||||
</n-icon>
|
||||
</n-button>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
||||
import { setHtmlTheme } from '@/utils'
|
||||
import { icon } from '@/plugins'
|
||||
const { MoonIcon, SunnyIcon } = icon.ionicons5
|
||||
const designStore = useDesignStore()
|
||||
|
||||
// 改变样式
|
||||
const changeTheme = () => {
|
||||
designStore.changeTheme()
|
||||
setHtmlTheme()
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import GoUserInfo from './index.vue';
|
||||
|
||||
export { GoUserInfo };
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
<template>
|
||||
<n-dropdown
|
||||
trigger="hover"
|
||||
@select="handleSelect"
|
||||
:show-arrow="true"
|
||||
:options="options"
|
||||
>
|
||||
<div class="user-info-box">
|
||||
<person-icon v-if="fallback"></person-icon>
|
||||
<n-avatar
|
||||
v-if="!fallback"
|
||||
round
|
||||
object-fit="cover"
|
||||
size="medium"
|
||||
:src="Person"
|
||||
@error="errorHandle"
|
||||
></n-avatar>
|
||||
</div>
|
||||
</n-dropdown>
|
||||
|
||||
<!-- 系统设置 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 { 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'
|
||||
const {
|
||||
ChatboxEllipsesIcon,
|
||||
PersonIcon,
|
||||
LogOutOutlineIcon,
|
||||
SettingsSharpIcon
|
||||
} = icon.ionicons5
|
||||
|
||||
const t = window['$t']
|
||||
|
||||
const modelShowInfo = ref(false)
|
||||
const modelShow = ref(false)
|
||||
|
||||
// 是否失败
|
||||
const fallback = ref(false)
|
||||
|
||||
// 用户图标渲染
|
||||
const renderUserInfo = () => {
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
style: 'display: flex; align-items: center; padding: 8px 12px;'
|
||||
},
|
||||
[
|
||||
h(NAvatar, {
|
||||
round: true,
|
||||
style: 'margin-right: 12px;',
|
||||
src: Person
|
||||
}),
|
||||
h('div', null, [
|
||||
h('div', null, [
|
||||
h(NText, { depth: 2 }, { default: () => '奔跑的面条' })
|
||||
])
|
||||
])
|
||||
]
|
||||
)
|
||||
}
|
||||
const options = ref([
|
||||
{
|
||||
label: '我的信息',
|
||||
key: 'info',
|
||||
type: 'render',
|
||||
render: renderUserInfo
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
key: 'd1'
|
||||
},
|
||||
{
|
||||
label: renderLang('global.sys_set'),
|
||||
key: 'sysSet',
|
||||
icon: renderIcon(SettingsSharpIcon)
|
||||
},
|
||||
{
|
||||
label: renderLang('global.contact'),
|
||||
key: 'contact',
|
||||
icon: renderIcon(ChatboxEllipsesIcon)
|
||||
},
|
||||
{
|
||||
type: 'divider',
|
||||
key: 'd3'
|
||||
},
|
||||
{
|
||||
label: renderLang('global.logout'),
|
||||
key: 'logout',
|
||||
icon: renderIcon(LogOutOutlineIcon)
|
||||
}
|
||||
])
|
||||
|
||||
// 图片渲染错误
|
||||
const errorHandle = (e: Event) => {
|
||||
fallback.value = true
|
||||
}
|
||||
|
||||
// 系统设置
|
||||
const sysSetHandle = () => {
|
||||
modelShow.value = true
|
||||
}
|
||||
|
||||
// 系统设置
|
||||
const sysInfoHandle = () => {
|
||||
modelShowInfo.value = true
|
||||
}
|
||||
|
||||
const handleSelect = (key: string) => {
|
||||
switch (key) {
|
||||
case 'contact':
|
||||
sysInfoHandle()
|
||||
break
|
||||
case 'sysSet':
|
||||
sysSetHandle()
|
||||
break
|
||||
case 'logout':
|
||||
logout()
|
||||
break
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.user-info-box {
|
||||
cursor: pointer;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.7 KiB |
|
|
@ -12,10 +12,6 @@
|
|||
<div class="header-item right">
|
||||
<n-space>
|
||||
<slot name="ri-left"> </slot>
|
||||
<!-- <go-lang-select></go-lang-select> -->
|
||||
<!-- <theme-color-select></theme-color-select> -->
|
||||
<!-- <go-theme-select></go-theme-select> -->
|
||||
<!-- <slot name="ri-right"> </slot> -->
|
||||
</n-space>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -25,8 +21,6 @@
|
|||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { GoThemeSelect } from '@/components/GoThemeSelect';
|
||||
import { GoLangSelect } from '@/components/GoLangSelect';
|
||||
import { ThemeColorSelect } from '@/components/Pages/ThemeColorSelect';
|
||||
import { PageEnum } from '@/enums/pageEnum';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import type { App } from 'vue'
|
||||
import { GoSkeleton } from '@/components/GoSkeleton'
|
||||
import { GoLoading } from '@/components/GoLoading'
|
||||
import { SketchRule } from 'vue3-sketch-ruler'
|
||||
|
||||
|
|
@ -8,7 +7,6 @@ import { SketchRule } from 'vue3-sketch-ruler'
|
|||
* @param app
|
||||
*/
|
||||
export function setupCustomComponents(app: App) {
|
||||
app.component('GoSkeleton', GoSkeleton)
|
||||
app.component('GoLoading', GoLoading)
|
||||
app.component('SketchRule', SketchRule)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@
|
|||
import { EditEnum } from '@/enums/pageEnum';
|
||||
import { StorageEnum } from '@/enums/storageEnum';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { GoSystemSet } from '@/components/GoSystemSet/index';
|
||||
import { exportHandle } from './utils';
|
||||
import { useFile } from './hooks/useFile.hooks';
|
||||
import { useSyncUpdate } from './hooks/useSyncUpdate.hook';
|
||||
|
|
|
|||
Loading…
Reference in New Issue