fix: 新增组件
This commit is contained in:
parent
b7a372e50f
commit
d2fabeae5f
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<n-modal v-model:show="modelShow" @afterLeave="closeHandle">
|
||||
<n-list bordered class="go-system-setting">
|
||||
<template #header> 系统设置 </template>
|
||||
<template #header>
|
||||
<n-h3 class="go-mb-0">系统设置</n-h3>
|
||||
</template>
|
||||
|
||||
<n-list-item v-for="item in list" :key="item.name">
|
||||
<n-space :size="40">
|
||||
@ -23,9 +25,7 @@
|
||||
<HelpOutlineIcon />
|
||||
</n-icon>
|
||||
</template>
|
||||
<span>
|
||||
{{ item.tip }}
|
||||
</span>
|
||||
<span>{{ item.tip }}</span>
|
||||
</n-tooltip>
|
||||
</n-space>
|
||||
</n-space>
|
||||
@ -40,6 +40,8 @@ import { reactive } from 'vue'
|
||||
import { ListType } from './index.d'
|
||||
import { useLangStore } from '@/store/modules/langStore/langStore'
|
||||
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
||||
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
|
||||
import { SettingStoreEnums } from '@/store/modules/settingStore/settingStore.d'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const { HelpOutlineIcon } = icon.ionicons5
|
||||
@ -52,23 +54,31 @@ defineProps({
|
||||
|
||||
const langStore = useLangStore()
|
||||
const designStore = useDesignStore()
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const list = reactive<ListType[]>([
|
||||
{
|
||||
key: 'lang',
|
||||
value: langStore.getReload,
|
||||
type: 'switch',
|
||||
name: '切换语言',
|
||||
desc: '切换语言是否重新加载页面',
|
||||
tip: '不重载有较低可能性导致部分区域语言切换失败'
|
||||
},
|
||||
{
|
||||
key: 'aollapsed',
|
||||
value: designStore.asideAllCollapsed,
|
||||
type: 'switch',
|
||||
name: '菜单折叠',
|
||||
desc: '左侧菜单是否全部折叠',
|
||||
}
|
||||
desc: '左侧菜单全部折叠',
|
||||
},
|
||||
{
|
||||
key: SettingStoreEnums.HIDE_PACKAGE_ONE_CATEGORY,
|
||||
value: settingStore.getHidePackageOneCategory,
|
||||
type: 'switch',
|
||||
name: '隐藏分类',
|
||||
desc: '工作空间表单分类只有单项时隐藏',
|
||||
},
|
||||
{
|
||||
key: 'lang',
|
||||
value: langStore.getReload,
|
||||
type: 'switch',
|
||||
name: '切换语言',
|
||||
desc: '切换语言重新加载页面',
|
||||
tip: '若遇到部分区域语言切换失败,则开启'
|
||||
},
|
||||
])
|
||||
|
||||
const closeHandle = () => {
|
||||
@ -83,12 +93,15 @@ const handleChange = (e: Event, item: ListType) => {
|
||||
case 'aollapsed':
|
||||
designStore.changeAsideAllCollapsed()
|
||||
break
|
||||
case SettingStoreEnums.HIDE_PACKAGE_ONE_CATEGORY:
|
||||
settingStore.setItem(SettingStoreEnums.HIDE_PACKAGE_ONE_CATEGORY, item.value)
|
||||
break
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@include go('system-setting') {
|
||||
@include go("system-setting") {
|
||||
@extend .go-background-filter;
|
||||
min-width: 100px;
|
||||
max-width: 60vw;
|
||||
|
@ -1,4 +1,6 @@
|
||||
export enum StorageEnum {
|
||||
// 全局设置
|
||||
GO_SYSTEM_SETTING = 'GO-SYSTEM-SETTING',
|
||||
// 登录信息
|
||||
GO_LOGIN_STORE = 'GO-ACCESS-TOKEN',
|
||||
// 语言
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Bar from './Bar'
|
||||
import Pie from './Pie'
|
||||
import Bar from './Bars'
|
||||
import Pie from './Pies'
|
||||
|
||||
export const ChartList = [...Bar, ...Pie]
|
||||
|
@ -1,3 +1,3 @@
|
||||
import Border from './borders'
|
||||
import Borders from './Borders'
|
||||
|
||||
export const DecorateList = [...Border]
|
||||
export const DecorateList = [...Borders]
|
||||
|
@ -1,7 +1,7 @@
|
||||
import TextCommon from './index.vue'
|
||||
import image from '@/assets/images/chart/informations/text_static.png'
|
||||
import { ConfigType } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum } from '../index.d'
|
||||
import { ChatCategoryEnum } from '../../index.d'
|
||||
|
||||
export const textCommonConfig: ConfigType = {
|
||||
key: 'Text',
|
3
src/packages/components/Information/Texts/index.ts
Normal file
3
src/packages/components/Information/Texts/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { textCommonConfig } from './TextCommon/index'
|
||||
|
||||
export default [textCommonConfig]
|
@ -1,3 +1,3 @@
|
||||
import { textCommonConfig } from './textCommon/index'
|
||||
import Texts from './Texts'
|
||||
|
||||
export const InformationList = [textCommonConfig]
|
||||
export const InformationList = [...Texts]
|
||||
|
@ -37,18 +37,12 @@ export const theme = {
|
||||
// dialog 图标的大小
|
||||
export const dialogIconSize = '20'
|
||||
|
||||
// 弹窗是否可以通过点击遮罩关闭
|
||||
export const maskClosable = false
|
||||
|
||||
// 侧边栏宽度
|
||||
export const asideWidth = '270'
|
||||
|
||||
// 侧边栏折叠后的宽度,支持全部折叠会覆盖为 0
|
||||
export const asideCollapsedWidth = '60'
|
||||
|
||||
// 侧边栏是否支持全持全部折叠
|
||||
export const asideAllCollapsed = true
|
||||
|
||||
// 修改边框圆角
|
||||
export const borderRadius = '6px'
|
||||
|
||||
|
10
src/settings/systemSetting.ts
Normal file
10
src/settings/systemSetting.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// * 系统全局设置
|
||||
|
||||
// 侧边栏是否支持全持全部折叠
|
||||
export const asideAllCollapsed = true
|
||||
|
||||
// 弹窗是否可以通过点击遮罩关闭
|
||||
export const maskClosable = false
|
||||
|
||||
// 拖拽页面左侧表单分类只有一项的时候是否隐藏
|
||||
export const hidePackageOneCategory = true
|
@ -33,8 +33,8 @@ export const useChartLayoutStore = defineStore({
|
||||
// 对比度
|
||||
contrast: 100,
|
||||
// 不透明度
|
||||
unOpacity: 100
|
||||
}
|
||||
unOpacity: 100,
|
||||
},
|
||||
},
|
||||
getters: {
|
||||
getLayers(): boolean {
|
||||
@ -51,7 +51,7 @@ export const useChartLayoutStore = defineStore({
|
||||
},
|
||||
getFilter(): ChartLayoutFilterType {
|
||||
return this.filter
|
||||
}
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setItem(key: string, value: boolean): void {
|
||||
@ -61,8 +61,8 @@ export const useChartLayoutStore = defineStore({
|
||||
setFilter<T extends keyof ChartLayoutType>(key: T, value: boolean): void {
|
||||
;(this.filter as any)[key] = value
|
||||
setLocalStorage(GO_CHART_LAYOUT_STORE, this.$state)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
export function useChartLayoutSettingWithOut() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { store } from '@/store'
|
||||
import { theme, asideAllCollapsed, asideCollapsedWidth } from '@/settings/designSetting'
|
||||
import { theme, asideCollapsedWidth } from '@/settings/designSetting'
|
||||
import { asideAllCollapsed } from '@/settings/systemSetting'
|
||||
import { DesignStateType } from './designStore.d'
|
||||
import { setLocalStorage, getLocalStorage } from '@/utils'
|
||||
import { StorageEnum } from '@/enums/storageEnum'
|
||||
|
@ -10,6 +10,7 @@ const { GO_LANG_STORE } = StorageEnum
|
||||
|
||||
const storageLang: LangStateType = getLocalStorage(GO_LANG_STORE)
|
||||
|
||||
// 语言
|
||||
export const useLangStore = defineStore({
|
||||
id: 'useLangStore',
|
||||
state: (): LangStateType =>
|
||||
|
@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
|
||||
import { PackagesStoreType, PackagesType } from './packagesStore.d'
|
||||
import { packagesList } from '@/packages/index'
|
||||
|
||||
// 组件 pakages
|
||||
export const usePackagesStore = defineStore({
|
||||
id: 'usePackagesStore',
|
||||
state: (): PackagesStoreType => ({
|
||||
|
7
src/store/modules/settingStore/settingStore.d.ts
vendored
Normal file
7
src/store/modules/settingStore/settingStore.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export enum SettingStoreEnums {
|
||||
HIDE_PACKAGE_ONE_CATEGORY = 'hidePackageOneCategory',
|
||||
}
|
||||
|
||||
export interface SettingStoreType {
|
||||
[SettingStoreEnums.HIDE_PACKAGE_ONE_CATEGORY]: boolean
|
||||
}
|
28
src/store/modules/settingStore/settingStore.ts
Normal file
28
src/store/modules/settingStore/settingStore.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { hidePackageOneCategory } from '@/settings/systemSetting'
|
||||
import { SettingStoreType } from './settingStore.d'
|
||||
import { setLocalStorage, getLocalStorage } from '@/utils'
|
||||
import { StorageEnum } from '@/enums/storageEnum'
|
||||
const { GO_SYSTEM_SETTING } = StorageEnum
|
||||
|
||||
const storageSetting: SettingStoreType = getLocalStorage(GO_SYSTEM_SETTING)
|
||||
|
||||
// 全局设置
|
||||
export const useSettingStore = defineStore({
|
||||
id: 'useSettingStore',
|
||||
state: (): SettingStoreType =>
|
||||
storageSetting || {
|
||||
hidePackageOneCategory,
|
||||
},
|
||||
getters: {
|
||||
getHidePackageOneCategory(): boolean {
|
||||
return this.hidePackageOneCategory
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setItem(key: string, value: boolean): void {
|
||||
;(this as any)[key] = value
|
||||
setLocalStorage(GO_SYSTEM_SETTING, this.$state)
|
||||
},
|
||||
},
|
||||
})
|
@ -1,6 +1,7 @@
|
||||
import { icon } from '@/plugins'
|
||||
import { DialogEnum } from '@/enums/pluginEnum'
|
||||
import { dialogIconSize, maskClosable } from '@/settings/designSetting'
|
||||
import { dialogIconSize } from '@/settings/designSetting'
|
||||
import { maskClosable } from '@/settings/systemSetting'
|
||||
import { DialogReactive } from 'naive-ui'
|
||||
const { InformationCircleIcon } = icon.ionicons5
|
||||
import { renderIcon } from '@/utils'
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="go-chart-common">
|
||||
<!-- v-show="packages.categorysNum > 1" -->
|
||||
<n-menu
|
||||
v-show="hidePackageOneCategory"
|
||||
class="chart-menu-width"
|
||||
v-model:value="selectValue"
|
||||
:options="packages.menuOptions"
|
||||
@ -16,9 +16,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, markRaw,reactive } from 'vue'
|
||||
import { ref, watch, markRaw, reactive, computed } from 'vue'
|
||||
import { ItemBox } from '../ItemBox/index'
|
||||
import { ConfigType } from '@/packages/index.d'
|
||||
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
|
||||
|
||||
const props = defineProps({
|
||||
selectOptions: {
|
||||
@ -27,6 +28,14 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
// 隐藏设置
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const hidePackageOneCategory = computed(() => {
|
||||
if (packages.categorysNum > 1) return true
|
||||
return !settingStore.getHidePackageOneCategory
|
||||
})
|
||||
|
||||
// TODO 调试结束改成 markeRaw
|
||||
let packages = reactive<{
|
||||
[T: string]: any
|
||||
@ -91,13 +100,13 @@ const clickItemHandle = (key: string) => {
|
||||
/* 此高度与 ContentBox 组件关联*/
|
||||
$topHeight: 60px;
|
||||
$menuWidth: 65px;
|
||||
@include go('chart-common') {
|
||||
@include go("chart-common") {
|
||||
display: flex;
|
||||
height: calc(100vh - #{$--header-height} - #{$topHeight});
|
||||
.chart-menu-width {
|
||||
width: $menuWidth;
|
||||
flex-shrink: 0;
|
||||
@include filter-bg-color('background-color2-shallow');
|
||||
@include filter-bg-color("background-color2-shallow");
|
||||
}
|
||||
.chart-content-list {
|
||||
flex: 1;
|
||||
|
@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<div class="go-bg-point"></div>
|
||||
<div class="go-chart">
|
||||
<n-layout>
|
||||
<HeaderPro>
|
||||
@ -35,13 +34,9 @@ import { ContentDetails } from './components/ContentDetails/index'
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$height: 100vh;
|
||||
@include go('bg-point') {
|
||||
@include background-image('background-point');
|
||||
@extend .go-point-bg;
|
||||
}
|
||||
@include go('chart') {
|
||||
height: $height;
|
||||
@include go("chart") {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
@include background-image('background-image');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user