增加完善基本配置中的系统状态开关

This commit is contained in:
Sun 2024-01-06 17:35:13 +08:00
parent c91eaf3e94
commit ffc378a38f
5 changed files with 37 additions and 4 deletions

View File

@ -114,6 +114,24 @@ function resetPanelConfig() {
</div>
</NCard>
<NCard style="border-radius:10px" class="mt-[10px]" size="small">
<div class="text-slate-500 mb-[5px] font-bold">
系统监控
</div>
<div class="flex items-center mt-[5px]">
<span class="mr-[10px]">显示</span>
<NSwitch v-model:value="panelState.panelConfig.systemMonitorShow" />
</div>
<div v-if="panelState.panelConfig.systemMonitorShow" class="flex items-center mt-[5px]">
<span class="mr-[10px]">显示标题</span>
<NSwitch v-model:value="panelState.panelConfig.systemMonitorShowTitle" />
</div>
<div v-if="panelState.panelConfig.systemMonitorShow" class="flex items-center mt-[5px]">
<span class="mr-[10px]">公开模式允许显示</span>
<NSwitch v-model:value="panelState.panelConfig.systemMonitorPublicVisitModeShow" />
</div>
</NCard>
<NCard style="border-radius:10px" class="mt-[10px]" size="small">
<div class="text-slate-500 mb-[5px] font-bold">
图标
@ -249,7 +267,6 @@ function resetPanelConfig() {
<NInput
v-model:value="panelState.panelConfig.footerHtml"
type="textarea"
placeholder="基本的 Textarea"
/>
</NCard>

View File

@ -8,4 +8,5 @@ export enum PanelStateNetworkModeEnum {
export enum PanelPanelConfigStyleEnum {
'icon' = 1, // 图标风格
'info' = 0, // 详情风格
'small' = 1, // 同icon
}

View File

@ -25,6 +25,10 @@ export function defaultStatePanelConfig(): Panel.panelConfig {
maxWidthUnit: 'px',
marginX: 5,
footerHtml: defaultFooterHtml,
systemMonitorShow: false,
systemMonitorShowTitle: true,
systemMonitorPublicVisitModeShow: false,
}
}

View File

@ -56,6 +56,9 @@ declare namespace Panel {
maxWidthUnit:string
marginX?:number
footerHtml?:string
systemMonitorShow?:boolean
systemMonitorShowTitle?:boolean
systemMonitorPublicVisitModeShow?:boolean
}
interface userConfig{

View File

@ -363,9 +363,17 @@ function handleAddItem(itemIconGroupId?: number) {
<!-- 应用盒子 -->
<div :style="{ marginLeft: `${panelState.panelConfig.marginX}px`, marginRight: `${panelState.panelConfig.marginX}px` }">
<!-- 系统状态 -->
<div v-if="panelState.panelConfig.searchBoxShow" class="flex mx-auto ">
<SystemMonitor allow-edit />
<!-- 系统监控状态 -->
<div
v-if="panelState.panelConfig.systemMonitorShow
&& ((panelState.panelConfig.systemMonitorPublicVisitModeShow && authStore.visitMode === VisitMode.VISIT_MODE_PUBLIC)
|| authStore.visitMode === VisitMode.VISIT_MODE_LOGIN)"
class="flex mx-auto"
>
<SystemMonitor
:allow-edit="authStore.visitMode === VisitMode.VISIT_MODE_LOGIN"
:show-title="panelState.panelConfig.systemMonitorShowTitle"
/>
</div>
<!-- 组纵向排列 -->