12345678910111213141516171819202122 |
- import{_ as G,__tla as H}from"./Dialog-4d17ac25.js";import{d as Q,Q as $,r as c,b as F,a3 as A,o as S,c as b,f as a,B as e,C as f,E as d,a as r,G as P,k as q,D as W,a2 as X,F as Y,dj as Z,e4 as aa,aH as ea,K as ta,I as la,L as ra,b1 as sa,__tla as oa}from"./index-e8bff8cb.js";import{_ as na,__tla as ua}from"./ContentWrap.vue_vue_type_script_setup_true_lang-33dea697.js";import{E as ia,__tla as ca}from"./index.es-d0d2c2c0.js";import{H as g,j as _a,__tla as ma}from"./java-d2d0587c.js";import{u as pa,__tla as fa}from"./useMessage-de42a595.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as da}from"./el-card-f9558d99.js";let k,ya=Promise.all([(()=>{try{return H}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return da}catch{}})()]).then(async()=>{function M(o){const s=["true","false","null"],_={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",keywords:{literal:s},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},o.QUOTE_STRING_MODE,_,o.C_NUMBER_MODE,o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}let h,v,O;h={class:"float-right mb-2"},v={key:0,ref:"editor"},O={class:"hljs"},k=Q({name:"InfraBuild",__name:"index",setup(o){const{t:s}=$(),_=pa(),n=c(),u=c(!1),C=c(""),m=c(-1),i=c(""),y=t=>{u.value=!0,C.value=t},J=()=>{y("\u751F\u6210 JSON"),m.value=0,i.value=n.value.getRule()},x=()=>{y("\u751F\u6210 Options"),m.value=1,i.value=n.value.getOption()},j=()=>{y("\u751F\u6210\u7EC4\u4EF6"),m.value=2,i.value=D()},D=()=>{const t=n.value.getRule(),l=n.value.getOption();return`<template>
- <form-create
- v-model="fapi"
- :rule="rule"
- :option="option"
- @submit="onSubmit"
- ></form-create>
- </template>
- <script setup lang=ts>
- import formCreate from "@form-create/element-ui";
- const faps = ref(null)
- const rule = ref('')
- const option = ref('')
- const init = () => {
- rule.value = formCreate.parseJson('${Z.toJson(t).replaceAll("\\","\\\\")}')
- option.value = formCreate.parseJson('${JSON.stringify(l)}')
- }
- const onSubmit = (formData) => {
- //todo \u63D0\u4EA4\u8868\u5355
- }
- init()
- <\/script>`},I=t=>{let l="json";return m.value===2&&(l="xml"),ea(t)||(t=JSON.stringify(t)),g.highlight(l,t,!0).value||" "};return F(async()=>{g.registerLanguage("xml",_a),g.registerLanguage("json",M)}),(t,l)=>{const p=ta,E=la,L=ra,B=na,R=sa,T=G,w=A("dompurify-html");return S(),b(Y,null,[a(B,null,{default:e(()=>[a(L,null,{default:e(()=>[a(E,null,{default:e(()=>[f("div",h,[a(p,{size:"small",type:"primary",onClick:J},{default:e(()=>[d("\u751F\u6210 JSON")]),_:1}),a(p,{size:"small",type:"success",onClick:x},{default:e(()=>[d("\u751F\u6210 Options")]),_:1}),a(p,{size:"small",type:"danger",onClick:j},{default:e(()=>[d("\u751F\u6210\u7EC4\u4EF6")]),_:1})])]),_:1}),a(E,null,{default:e(()=>[a(r(ia),{ref_key:"designer",ref:n,height:"780px"},null,512)]),_:1})]),_:1})]),_:1}),a(T,{modelValue:r(u),"onUpdate:modelValue":l[1]||(l[1]=N=>X(u)?u.value=N:null),title:r(C),"max-height":"600"},{default:e(()=>[r(u)?(S(),b("div",v,[a(p,{style:{float:"right"},onClick:l[0]||(l[0]=N=>(async z=>{const{copy:K,copied:U,isSupported:V}=aa({source:z});V?(await K(),r(U)&&_.success(s("common.copySuccess"))):_.error(s("common.copyError"))})(r(i)))},{default:e(()=>[d(P(r(s)("common.copy")),1)]),_:1}),a(R,{height:"580"},{default:e(()=>[f("div",null,[f("pre",null,[q(f("code",O,null,512),[[w,I(r(i))]])])])]),_:1})],512)):W("",!0)]),_:1},8,["modelValue","title"])],64)}}})});export{ya as __tla,k as default};
|