File: /www/server/panel/BTPanel/static/js/dialog.js
import{r as _,c as y,j as w,k as v,q as C,e as r,v as m,x as p,p as k,z as b,m as x}from"./base-lib.js?v=1777008528";import{k as c,eR as i,f as A,c as M,cQ as H,w as h,d_ as E}from"./utils-lib.js?v=1777008528";import{g,M as f}from"./useStore.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./config.js?v=1777008528";const P=_([]),u=A(),q=async e=>{try{const a={[e.key]:!e.show};await c({request:i(a),message:!0,success:()=>{const{getAdHideConfigEvent:t}=g();t(),Promise.resolve(),u.success("模块状态已更新")}})}catch(a){Promise.resolve()}},B=async()=>{try{await c({request:i({all:!0}),message:!0,success:()=>{Promise.resolve(),u.success("模块状态已更新")}})}catch(e){}},T=async()=>{try{await c({request:i({all:!1}),message:!0,success:()=>{Promise.resolve(),u.success("模块状态已更新")}})}catch(e){}},V=async()=>{try{const{getAdHideConfigEvent:e}=g();await e();const{adHideInfo:a}=M(),t=a.value||{},o=[];for(const n in f){if(!(n in t))continue;const s=t[n]===!0;o.push({key:n,title:f[n],show:!s})}return P.value=o,{data:o,total:o.length,other:{}}}catch(e){return{data:[],total:0,other:{}}}},z={class:"p-[16px]"},D={class:"mb-[12px]"},j=y({__name:"dialog",setup(e){const{BtTable:a,refresh:t}=H({request:V,columns:[{label:"模块名称",prop:"title"},{label:"是否显示",showOverflowTooltip:!1,align:"right",width:"80px",render:s=>r(E,x({modelValue:s.show,"onUpdate:modelValue":l=>s.show=l,size:"small"},{onChange:()=>q(s)}),null)}]}),o=async()=>{try{await h({content:"确认隐藏所有高级模块?\n隐藏后当前产品的使用体验及功能推荐将受影响,是否继续?"}),await B(),t()}catch(s){}},n=async()=>{try{await h({content:"显示所有高级模块,是否继续?"}),await T(),t()}catch(s){}};return(s,l)=>{const d=b;return w(),v("div",z,[C("div",D,[r(d,{type:"default",size:"small",onClick:o},{default:m(()=>[...l[0]||(l[0]=[p("一键隐藏",-1)])]),_:1}),r(d,{type:"default",size:"small",onClick:n},{default:m(()=>[...l[1]||(l[1]=[p("一键显示",-1)])]),_:1})]),r(k(a),{class:"module-set-table","row-key":"key","max-height":"360"})])}}});export{j as default};