mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-05 19:42:07 +08:00
2 lines
6.8 KiB
JavaScript
2 lines
6.8 KiB
JavaScript
import{l as S,e as W,a3 as V,v as w,a4 as y,a5 as N,a6 as L,u as M,a7 as I}from"./hooks-yKQIzKXx.js";import"./currency.js@2.0.4-9OAR_aOO.js";import"./dayjs@1.11.10-C8LoRVP6.js";import"./print-js@1.6.0-BdoEj60G.js";import"./vue-hooks-plus@2.2.1_vue@3.5.12_typescript@5.6.3_--wFVw10U.js";import"./lodash@4.17.21-Cw59kuJw.js";import"./js-cookie@3.0.5-Z_8Sd105.js";import"./screenfull@5.2.0-DmMZCkhi.js";import"./jsbarcode@3.11.6-DGNGFp02.js";import"./@logicflow_core@2.0.6-CHqfytjt.js";import"./mobx-preact@3.0.0_mobx@5.15.7_preact@10.22.0-q-IhwcFu.js";import"./preact@10.22.0-D1_UwAj3.js";import{N as i,c as a,L as T,O as t}from"./naive-ui@2.40.1_vue@3.5.12_typescript@5.6.3_-D3cUk1tG.js";import{l as R,b as u,I as e}from"./@vue_runtime-core@3.5.12-rIgKm_Vg.js";import{k as b}from"./@vue_reactivity@3.5.12-Bs6EYLxJ.js";import"./lodash-es@4.17.21-B-5kLwAl.js";import"./@vueuse_core@11.1.0_vue@3.5.12_typescript@5.6.3_-ZDBD96r1.js";import"./@vueuse_shared@11.1.0_vue@3.5.12_typescript@5.6.3_-DnrABUGp.js";import"./utils-DJWgFDlo.js";import"./pinia-plugin-persistedstate@4.1.1_pinia@2.2.4_typescript@5.6.3_vue@3.5.12_typescript@5.6.3____dh65odvamx6uymfx32yexjadga-_Zka_ujQ.js";import"./destr@2.0.3-CVtkxrq9.js";import"./deep-pick-omit@1.2.1-CegYQlcN.js";import"./pinia@2.2.4_typescript@5.6.3_vue@3.5.12_typescript@5.6.3_-BdVsFNKX.js";import"./vue-demi@0.14.10_vue@3.5.12_typescript@5.6.3_-Dq6ymT-8.js";import"./html-to-image@1.11.11-BOFdlgi9.js";import"./vue-router@4.3.2_vue@3.5.12_typescript@5.6.3_-Brd4YmBy.js";import"./vue-i18n@9.13.1_vue@3.5.12_typescript@5.6.3_-DVUVmCuN.js";import"./@intlify_shared@9.13.1-BxU0OzX2.js";import"./@intlify_core-base@9.13.1-C6DqbPB6.js";import"./@intlify_message-compiler@9.13.1-GrLDMuy_.js";import"./echarts@5.5.0-CezqL3m-.js";import"./zrender@5.5.0-DW8ownf1.js";import"./tslib@2.3.0-BDyQ-Jie.js";import"./@vue_runtime-dom@3.5.12-BKraWVUW.js";import"./@vue_shared@3.5.12--5_uv9t5.js";import"./interactjs@1.10.26-DZL_TZzP.js";import"./call-bind@1.0.7-Cpj98o6Y.js";import"./mobx@5.15.7-CEMJDQot.js";import"./uuid@9.0.1-CQkTLCs1.js";import"./classnames@2.5.1-nUTIn1-D.js";import"./mousetrap@1.6.5-BTGDluHR.js";import"./mobx-utils@5.6.2_mobx@5.15.7-C1xBETkd.js";import"./date-fns@3.6.0-q9PkOyxq.js";import"./seemly@0.3.8-DjGKl9dV.js";import"./vueuc@0.4.64_vue@3.5.12_typescript@5.6.3_-BcAtcaHt.js";import"./evtd@0.2.4-CI_DDEu_.js";import"./@css-render_vue3-ssr@0.15.14_vue@3.5.12_typescript@5.6.3_-BZYDXyJG.js";import"./vooks@0.2.12_vue@3.5.12_typescript@5.6.3_--iLh4DJ5.js";import"./vdirs@0.1.8_vue@3.5.12_typescript@5.6.3_-C0KV5pCE.js";import"./@juggle_resize-observer@3.4.0-C8OzoCMD.js";import"./css-render@0.15.14-C5toWlUr.js";import"./@emotion_hash@0.8.0-WldOFDRm.js";import"./treemate@0.3.11-DKekKYbv.js";import"./date-fns-tz@3.1.3_date-fns@3.6.0-ztskLDQQ.js";import"./async-validator@4.2.5-DKvM95Vc.js";import"./@css-render_plugin-bem@0.15.14_css-render@0.15.14-Be8eOoM-.js";const Ou=R({name:"TemplateHooks",setup(){const m=b(""),r=S("layoutContentMaximize"),n=b(W().getWatermarkConfig.value.content),F=b("new"),{navigationTo:p}=y(),{maximize:s,isLayoutContentMaximized:d}=V(),{reload:C,openSpin:B,closeSpin:D}=N(),{showWatermark:h,hiddenWatermark:A,setWatermarkContent:E,toggleWatermark:c}=L(),{darkTheme:f,lightTheme:k,toggleTheme:l,getAppTheme:g,syncSystemTheme:o}=M(),{hidden:v,show:x,update:z}=I();return{navigationTo:p,reload:C,currentMenuOption:m,maximize:s,maximizeRef:r,openSpin:B,closeSpin:D,showWatermark:h,hiddenWatermark:A,setWatermarkContent:E,watermark:n,toggleWatermark:c,darkTheme:f,lightTheme:k,toggleTheme:l,getAppTheme:g,isLayoutContentMaximized:d,badgeHidden:v,badgeShow:x,badgeUpdateLabel:z,badgeValue:F,syncSystemTheme:o}},render(){const{navigationTo:m,reload:r,maximize:n,openSpin:F,closeSpin:p,showWatermark:s,hiddenWatermark:d,setWatermarkContent:C,toggleWatermark:B,darkTheme:D,lightTheme:h,toggleTheme:A,getAppTheme:E,isLayoutContentMaximized:c,badgeHidden:f,badgeShow:k,badgeUpdateLabel:l,syncSystemTheme:g}=this;return u(a,{vertical:!0},{default:()=>[u(i,{title:"接口说明"},{default:()=>[u("h3",null,[e("hooks/template 包存放模板专属 hook 方法。这里不做过多的赘述,可以查看文档具体描述。")])]}),u(i,{title:"useBadge 菜单标记"},{default:()=>[u(a,{vertical:!0},{default:()=>[u(T,{value:this.badgeValue,"onUpdate:value":o=>this.badgeValue=o},null),u(a,null,{default:()=>[u(t,{onClick:()=>f("/template-hooks")},{default:()=>[e("隐藏当前菜单标记")]}),u(t,{onClick:()=>k("/template-hooks",{label:this.badgeValue})},{default:()=>[e("显示当前菜单标记")]}),u(t,{onClick:()=>l("/template-hooks",{label:this.badgeValue})},{default:()=>[e("更新当前菜单标记")]}),u(t,{onClick:()=>{l("/template-hooks",{label:this.badgeValue,icon:u(w,{name:"error",size:"18"},null)})}},{default:()=>[e("添加标记图标")]}),u(t,{onClick:()=>{l("/template-hooks",{label:this.badgeValue,icon:void 0})}},{default:()=>[e("隐藏标记图标")]})]})]})]}),u(i,{title:"useTheme 主题"},{default:()=>[u(a,{vertical:!0},{default:()=>[u("h3",null,[e("getAppTheme 获取当前主题色: "),E().themeLabel]),u(a,null,{default:()=>[u(t,{onClick:()=>D()},{default:()=>[e("切换暗黑主题")]}),u(t,{onClick:()=>h()},{default:()=>[e("切换明亮主题")]}),u(t,{onClick:()=>g()},{default:()=>[e("跟随主题")]}),u(t,{onClick:()=>A()},{default:()=>[e("切换主题")]})]})]})]}),u(i,{title:"useWatermark 水印"},{default:()=>[u(a,{vertical:!0},{default:()=>[u(T,{value:this.watermark,"onUpdate:value":o=>this.watermark=o,onInput:o=>{C(o)}},null),u(a,null,{default:()=>[u(t,{onClick:()=>s()},{default:()=>[e("显示水印")]}),u(t,{onClick:()=>d()},{default:()=>[e("隐藏水印")]}),u(t,{onClick:()=>B()},{default:()=>[e("切换水印")]})]})]})]}),u(i,{title:"useSpinning"},{default:()=>[u("h3",null,[e("手动刷新内容区域,会使得当前路由页面内容强制重新加载(会执行完整的 vue 生命周期)。默认 800ms 延迟。")]),u("br",null,null),u(a,null,{default:()=>[u(t,{onClick:()=>{r()}},{default:()=>[e("刷新(强制刷新)")]}),u(t,{onClick:()=>{F(),setTimeout(()=>{p()},800)}},{default:()=>[e("触发加载动画(不强制刷新)")]})]})]}),u(i,{title:"useMaximize 内容区域最大化"},{default:()=>[u("h3",null,[e("isLayoutContentMaximized 检测当前内容区域是否最大化:"),c?"最大化":"正常尺寸"]),u(t,{onClick:()=>{n(!this.maximizeRef,{scrollToOptions:{left:0,top:0}})}},{default:()=>[e("最大化内容区域,并且滚动至顶部")]})]}),u(i,{title:"useAppNavigation 导航方法"},{default:()=>[u("h3",null,[e("navigationTo 参数为正整数时,会更具当前的菜单顺序进行自动导航匹配。但是此方法仅能导航一级菜单。并且如果导航菜单非根菜单项,会自动递归导航至一子菜单。 支持传入完整的菜单路径,如:/multi/multi-menu-one。")]),u("br",null,null),u(t,{onClick:()=>m("/multi/multi-menu-one")},{default:()=>[e("跳转至多级菜单")]})]})]})}});export{Ou as default};
|