2023-10-23 19:26:32 +08:00

2 lines
3.2 KiB
JavaScript

import{d as D,r as v,R,w as F,e as g,f as I,g as r,B as m,u as n,Q as j,v as A,x as i,y as l,A as H}from"./base-06478700.js";/* empty css *//* empty css */import{a as M,E as O}from"./el-form-item-314d006d.js";/* empty css *//* empty css *//* empty css */import{t as a}from"./index-81ed253c.js";import{A as y,V as U}from"./index-981b0207.js";import{a3 as $}from"./event-10eba222.js";import{u as L}from"./vue-router-d09a2c28.js";import{a as h}from"./index-b52d0f2a.js";import{E as Q}from"./index-f84999b2.js";import{E as T}from"./index-b68e8463.js";import{E as z}from"./index-e10fccde.js";import{E as G}from"./index-c2f001d3.js";import{v as J}from"./directive-cb2d3366.js";import{_ as K}from"./_plugin-vue_export-helper-c27b6911.js";import"./index-2fcd1254.js";import"./common-92a35870.js";import"./index-adb89d14.js";import"./el-main-9a0960e7.js";import"./index-6b67c4ac.js";import"./el-overlay-42a687c6.js";import"./index-9fe5de95.js";import"./focus-trap-3e826cdc.js";import"./index-f27d6ce0.js";import"./index-818c0ce2.js";import"./el-tooltip-58212670.js";import"./index-2a269c7c.js";import"./index-e4abfaa5.js";import"./index-9ee9102c.js";import"./validator-6e9db238.js";function P(){return y.get("channel/h5/config")}function W(u){return y.put("channel/h5/config",u,{showSuccessMessage:!0})}const X={class:"main-container"},Y={class:"flex ml-[18px] justify-between items-center mt-[20px]"},Z={class:"text-[20px]"},ee={class:"fixed-footer-wrap"},te={class:"fixed-footer"},oe=D({__name:"config",setup(u){const w=L().meta.title,s=v(!0),e=R({is_open:!1,request_url:""}),_=v();P().then(t=>{Object.assign(e,t.data),e.is_open=Boolean(Number(e.is_open)),s.value=!1}),U().then(t=>{e.request_url=t.data.wap_url+"/"});const{copy:b,isSupported:x,copied:d}=$(),E=t=>{if(!x.value){h({message:a("notSupportCopy"),type:"warning"});return}b(t)};F(d,()=>{d.value&&h({message:a("copySuccess"),type:"success"})});const C=()=>{window.open(e.request_url)},k=async t=>{s.value||!t||await t.validate(async o=>{if(o){s.value=!0;let p={...e};p.is_open=Number(p.is_open),W(p).then(()=>{s.value=!1}).catch(()=>{s.value=!1})}})};return(t,o)=>{const p=Q,f=M,V=T,B=z,N=O,q=G,S=J;return g(),I("div",X,[r("div",Y,[r("span",Z,m(n(w)),1)]),j((g(),A(N,{model:e,"label-width":"150px",ref_key:"formRef",ref:_,class:"page-form"},{default:i(()=>[l(B,{class:"box-card !border-none",shadow:"never"},{default:i(()=>[l(f,{label:n(a)("isOpen")},{default:i(()=>[l(p,{modelValue:e.is_open,"onUpdate:modelValue":o[0]||(o[0]=c=>e.is_open=c)},null,8,["modelValue"])]),_:1},8,["label"]),l(f,{label:n(a)("h5DomainName")},{default:i(()=>[l(V,{"model-value":e.request_url,class:"input-width",readonly:!0},{append:i(()=>[r("div",{class:"cursor-pointer",onClick:o[1]||(o[1]=c=>E(e.request_url))},m(n(a)("copy")),1)]),_:1},8,["model-value"]),r("span",{class:"ml-2 cursor-pointer visit-btn",onClick:C},m(n(a)("clickVisit")),1)]),_:1},8,["label"])]),_:1})]),_:1},8,["model"])),[[S,s.value]]),r("div",ee,[r("div",te,[l(q,{type:"primary",loading:s.value,onClick:o[2]||(o[2]=c=>k(_.value))},{default:i(()=>[H(m(n(a)("save")),1)]),_:1},8,["loading"])])])])}}});const He=K(oe,[["__scopeId","data-v-16b8de7e"]]);export{He as default};