← Back
Editing: default-page.js
import{c as e,r as a,p as l,G as t,q as s,v as o,e as u,A as n,x as r,P as d,y as i,B as m,C as p,F as c,a_ as v,M as f,H as j,aA as _,ax as x,T as y,ai as b,aj as g,D as h}from"./base-lib.js?v=VERSION_NUMBER";import{B as V}from"./index140.js?v=VERSION_NUMBER";import{jd as C,K as w,je as B,jf as q,al as k,b as G}from"./utils-lib.js?v=VERSION_NUMBER";import{p as U}from"./useController4.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./ace.js?v=VERSION_NUMBER";import"./validator.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";import"./useController5.js?v=VERSION_NUMBER";import"./site.js?v=VERSION_NUMBER";import"./useStore4.js?v=VERSION_NUMBER";import"./useController6.js?v=VERSION_NUMBER";import"./useMethod5.js?v=VERSION_NUMBER";const z={class:"flex flex-col"},H={class:"flex items-center justify-between mb-[8px]"},A={key:0},E={class:"h-[44rem] w-full"},F=e({__name:"default-page",setup(e,{expose:F}){const K=G(),M=a("index"),O=a(""),S=a(),D=a("utf-8"),I=a(["utf-8","GBK","GB2312","BIG5"]),P=a(!1),R=a(!1),T=async()=>{try{R.value=!0;const{data:e}=await C({default_type:M.value});O.value=e.data[M.value].data,D.value=e.data[M.value].encoding||"utf-8","404"===M.value&&(P.value=Boolean(e.data.auto_create_404)),R.value=!1}catch(e){}},J=async e=>{R.value=!0,M.value=e,await T(),R.value=!1},L=e=>{w({loading:"正在设置,请稍后...",request:B({auto_create:e?"1":"0"}),message:!0})},N=async()=>{const e=await q({default_type:M.value,default_body:O.value,encoding:D.value});K.request(e)};return l((()=>{T()})),F({onRefresh:()=>{M.value="index",T()}}),(e,a)=>{const l=_,C=k,w=x,B=y,q=b,G=g,F=V,K=h,T=t("bt-loading");return s(),o("div",z,[u(C,{type:"card",modelValue:r(M),"onUpdate:modelValue":a[0]||(a[0]=e=>d(M)?M.value=e:null),onChange:J},{default:n((()=>[u(l,{label:"新建网站默认页面",name:"index"}),u(l,{label:"404错误页",name:"404",lazy:!0}),u(l,{label:"网站不存在页",name:"not_found",lazy:!0}),u(l,{label:"网站停用后的提示页",name:"stop",lazy:!0})])),_:1},8,["modelValue"]),u(w,{placement:"top",width:"320","popper-class":"white-popover",trigger:"hover",content:"创建网站时会使用页面模板,不会影响已经存在的网站"},{reference:n((()=>a[4]||(a[4]=[i("i",{class:"absolute right-[2rem] top-[2.4rem] svgtofont-el-question-filled text-warning !text-[16px]"},null,-1)]))),_:1}),i("div",H,["404"===r(M)?(s(),o("div",A,[u(B,{modelValue:r(P),"onUpdate:modelValue":a[1]||(a[1]=e=>d(P)?P.value=e:null),onChange:L},{default:n((()=>a[5]||(a[5]=[m("创建网站时自动创建404.html页面")]))),_:1},8,["modelValue"])])):p("",!0),a[6]||(a[6]=m(" 提示:Ctrl+F 搜索关键字,Ctrl+S 保存,Ctrl+H 查找替换 ")),u(G,{class:"!w-[16rem]",modelValue:r(D),"onUpdate:modelValue":a[2]||(a[2]=e=>d(D)?D.value=e:null),onChange:N},{default:n((()=>[(s(!0),o(c,null,v(r(I),(e=>(s(),f(q,{key:e,value:e,label:e},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])]),j((s(),o("div",E,[u(F,{ref_key:"aceEditor",ref:S,"is-request":!1,modelValue:r(O),"onUpdate:modelValue":a[3]||(a[3]=e=>d(O)?O.value=e:null),editorOption:r(U)(),saveEvent:N,class:"h-[40rem] w-full"},null,8,["modelValue","editorOption"]),u(K,{class:"flex !mt-[12px]",type:"primary",onClick:N},{default:n((()=>a[7]||(a[7]=[m("保存")]))),_:1})])),[[T,r(R)]])])}}});export{F as default};
Save File
Cancel