feat(admin): strip SPA ops menus; redirect old hashes to native WP (Phase 4)

SPA shop/forum/payment/users sections now keep configuration pages only.
Operational workbenches were removed from the sidebar and loaders; legacy
hash routes open NativeOpsRedirect into the matching WP native admin page.
Admin SPA production build refreshed accordingly.
This commit is contained in:
kate522 committed 2026-07-15 02:10:05 +08:00
1 parent bf061f43ee
commit a3dde3874a
85 files changed
+15987 -249

No files matched your search

@@ -0,0 +1 @@
import{o as Y,X as w,a4 as t,a3 as a,Y as i,r as U,a1 as _,e as G,_ as K,W as f,f as d,a2 as F,a5 as H,F as Q,R as ee,N as I,c as M}from"./vendor-vue.Bykizn0M.js";import{a as S}from"./shared-api.D5_fnN32.js";import{P as te}from"./PageHeader.Di3JTPjc.js";import{_ as ae}from"./index.js";import{u as le}from"./vendor-naive.BuHWlEgf.js";import"./vendor-misc.1adHN6i_.js";const oe={class:"aksrt-page-container content-page"},se={style:{display:"flex","align-items":"center","justify-content":"space-between"}},ne={key:0,class:"homepage-settings__empty-tabs"},_e={class:"homepage-settings__tab-fields"},re={class:"aksrt-form-actions"},ie={__name:"HomepageSettings",setup(de){const A=K(),T=le(),v=U(!0),y=U(!1),$=U("stream"),B=U([]),C=[{label:"最近更新",value:"modified"},{label:"发布时间",value:"date"},{label:"浏览量",value:"views"},{label:"点赞数",value:"likes"},{label:"评论数",value:"comments"},{label:"收藏数",value:"favorites"},{label:"下载量",value:"downloads"},{label:"随机",value:"rand"}],l=G({home_posts_list_s:!0,home_list1_orderby_s:!0,home_list1_orderby_option:{orderby:"modified",options:["modified","date","views","likes","comments"]},index_list_title:"最新发布",home_exclude_posts:[],home_exclude_cats:[],home_lists:[],homepage_card_style:"default",homepage_multi_thumb_enabled:!0,homepage_multi_thumb_min_images:3,homepage_sidebar_mini_enabled:!0,homepage_default_view:"list",homepage_sort_ajax_enabled:!0,homepage_sticky_tabs_enabled:!0,home_list_sort_dropdown:!1,homepage_tab_posts_per_page:6,homepage_tab_limit:4}),N=M({get:()=>(l.home_exclude_posts||[]).join(","),set:s=>{l.home_exclude_posts=s.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>e>0)}}),V=M({get:()=>(l.home_exclude_cats||[]).join(","),set:s=>{l.home_exclude_cats=s.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>e>0)}});function R(){l.home_lists.push({term_id:0,title:"",orderby:"date",enabled:!0})}function X(s){l.home_lists.splice(s,1)}function h(s,e,n){l.home_lists[s][e]=n}async function Z(){try{const s=await S.getHomepageCategories(),e=(s==null?void 0:s.data)||[];B.value=e.map(n=>({label:`${n.taxonomy==="topics"?"[专题] ":""}${n.name} (${n.count})`,value:n.term_id||n.id}))}catch{}}async function q(){v.value=!0;try{const s=await S.getHomepageSettings(),e=(s==null?void 0:s.data)||{};l.home_posts_list_s=e.home_posts_list_s!==!1&&e.home_posts_list_enabled!==!1,l.home_list1_orderby_s=e.home_list1_orderby_s!==!1&&e.home_list_sort_enabled!==!1;const n=e.home_list1_orderby_option&&typeof e.home_list1_orderby_option=="object"?e.home_list1_orderby_option:{};l.home_list1_orderby_option={orderby:n.orderby||e.homepage_default_sort||"modified",options:Array.isArray(n.options)&&n.options.length?n.options:Array.isArray(e.home_list_sort_options)&&e.home_list_sort_options.length?e.home_list_sort_options:["modified","date","views","likes","comments"]},l.index_list_title=e.index_list_title||e.home_list_title||"最新发布",l.home_exclude_posts=Array.isArray(e.home_exclude_posts)?e.home_exclude_posts:Array.isArray(e.home_exclude_post_ids)?e.home_exclude_post_ids:[],l.home_exclude_cats=Array.isArray(e.home_exclude_cats)?e.home_exclude_cats:Array.isArray(e.home_exclude_category_ids)?e.home_exclude_category_ids:[],l.home_lists=Array.isArray(e.home_lists)?e.home_lists:Array.isArray(e.homepage_tabs)?e.homepage_tabs:[],l.homepage_card_style=e.homepage_card_style||"default",l.homepage_multi_thumb_enabled=e.homepage_multi_thumb_enabled!==!1,l.homepage_multi_thumb_min_images=e.homepage_multi_thumb_min_images||3,l.homepage_sidebar_mini_enabled=e.homepage_sidebar_mini_enabled!==!1,l.homepage_default_view=e.homepage_default_view||"list",l.homepage_sort_ajax_enabled=e.homepage_sort_ajax_enabled!==!1,l.homepage_sticky_tabs_enabled=e.homepage_sticky_tabs_enabled!==!1,l.home_list_sort_dropdown=!!e.home_list_sort_dropdown,l.homepage_tab_posts_per_page=e.homepage_tab_posts_per_page||6,l.homepage_tab_limit=e.homepage_tab_limit||4}catch(s){T.error(s.message||"加载设置失败")}finally{v.value=!1}}async function z(){y.value=!0;try{const s={...l},e=await S.saveHomepageSettings(s);if((e==null?void 0:e.code)==="success"){T.success("首页设置已保存");return}throw new Error((e==null?void 0:e.message)||"保存失败")}catch(s){T.error(s.message||"保存失败")}finally{y.value=!1}}return Y(()=>{Z(),q()}),(s,e)=>{const n=_("n-button"),x=_("n-alert"),r=_("n-form-item"),g=_("n-form"),u=_("n-card"),p=_("n-switch"),c=_("n-input"),k=_("n-select"),O=_("n-radio-button"),j=_("n-space"),J=_("n-radio-group"),P=_("n-input-number"),L=_("n-text"),D=_("n-spin"),E=_("n-tab-pane"),W=_("n-tabs");return f(),w("div",oe,[t(te,{title:"首页配置",desc:"配置首页主列表、分类 Tab 与基础交互。列表/卡片显示请在「文章列表」中设置。"},{actions:a(()=>[t(n,{type:"primary",loading:y.value,onClick:z},{default:a(()=>[...e[17]||(e[17]=[d("保存设置",-1)])]),_:1},8,["loading"])]),_:1}),t(W,{value:$.value,"onUpdate:value":e[16]||(e[16]=o=>$.value=o),tyLine truncated