renshen 26b83bd8e7 钉钉入口单页模式扩到整个「财务经营风险管控」目录
上一版只对店铺违规信息预警单页;在钉钉里点该目录的另一个页签(流程统计)又会
冒出整排菜单。改成:只要属于 financial-risk-control 目录、且来自钉钉容器
(或显式 ?focus=1),就隐藏全局菜单,只保留该目录自己的页签。
2026-10-13 13:53:49 +08:00

113 lines
4.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html dir="{{ language()->direction() }}" lang="{{ app()->getLocale() }}">
@php
// 钉钉工作台「财务系统」入口:在「财务经营风险管控」目录下隐藏全局菜单,
// 只保留该目录自己的页签(店铺违规信息预警 / 流程统计…),
// 让钉钉里点进来就只是这一块内容;网页端登录(非钉钉容器)不受影响。
// 也支持显式 ?focus=1,便于以后给别的入口做同样的单页模式。
// 路由参数在部分上下文取不到时退回按路径段判断(与目录表同一套兼容写法)。
$focusSection = (string) (request()->route('section') ?: request()->segment(3));
$focusEntry = in_array($focusSection, ['financial-risk-control'], true)
&& (request()->boolean('focus') || str_contains((string) request()->userAgent(), 'DingTalk'));
@endphp
<x-layouts.admin.head>
@if (! empty($metaTitle))
<x-slot name="metaTitle">
{!! !empty($metaTitle->attributes->has('title')) ? $metaTitle->attributes->get('title') : $metaTitle !!}
</x-slot>
@endif
<x-slot name="title">
{!! !empty($title->attributes->has('title')) ? $title->attributes->get('title') : $title !!}
</x-slot>
</x-layouts.admin.head>
@mobile
<body class="bg-body">
@elsemobile
<body class="bg-body overflow-y-overlay">
@endmobile
@stack('body_start')
@unless ($focusEntry)
<x-layouts.admin.menu />
@endunless
<!-- loading component will add this line -->
<div class="main-content {{ $focusEntry ? '' : 'xl:ltr:ml-64 xl:rtl:mr-64' }} transition-all ease-in-out" id="panel">
<div id="main-body">
<div class="container">
<x-layouts.admin.header>
<x-slot name="title">
{!! ! empty($title->attributes->has('title')) ? $title->attributes->get('title') : $title !!}
</x-slot>
@if (! empty($status))
<x-slot name="status">
{!! $status !!}
</x-slot>
@endif
@if (! empty($info))
<x-slot name="info">
{!! $info !!}
</x-slot>
@endif
@if (! empty($favorite) || (! empty($favorite) && $favorite->attributes->has('title')))
@if (! $favorite->attributes->has('title'))
<x-slot name="favorite">
{!! $favorite !!}
</x-slot>
@else
@php
$favorite = [
'title' => $favorite->attributes->get('title'),
'icon' => $favorite->attributes->get('icon'),
'route' => !empty($favorite->attributes->has('route')) ? $favorite->attributes->get('route') : '',
'url' => !empty($favorite->attributes->has('url')) ? $favorite->attributes->get('url') : '',
];
@endphp
<x-slot name="favorite">
<x-menu.favorite
:title="$favorite['title']"
:icon="$favorite['icon']"
:route="$favorite['route']"
:url="$favorite['url']"
/>
</x-slot>
@endif
@endif
<x-slot name="buttons">
{!! $buttons ?? '' !!}
</x-slot>
<x-slot name="moreButtons">
{!! $moreButtons ?? '' !!}
</x-slot>
</x-layouts.admin.header>
<x-layouts.admin.content>
<livewire:notification.browser />
<x-layouts.admin.notifications />
{!! $content !!}
</x-layouts.admin.content>
<x-layouts.admin.footer />
</div>
</div>
</div>
@stack('body_end')
<x-layouts.admin.scripts />
</body>
</html>