index-edf8ca51.js 3.6 KB

12345678910111213141516171819202122
  1. import{_ as K,__tla as A}from"./Dialog-c2716df6.js";import{d as F,h as G,r as c,k as H,P,o as S,c as M,f as a,w as t,g as f,m as d,a as r,t as Q,v as q,O as W,N as X,F as Y,dp as Z,d$ as aa,ay as ta,B as ea,E as la,i as ra,bn as sa,__tla as oa}from"./index-2eab2d23.js";import{_ as na,__tla as ua}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5a63038a.js";import{E as ia,__tla as ca}from"./index.es-f3906ef8.js";import{H as g,j as _a,__tla as ma}from"./java-8a1b58d5.js";import{u as pa,__tla as fa}from"./useMessage-171aa63e.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as da}from"./el-card-c558f0ec.js";let k,ya=Promise.all([(()=>{try{return A}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 b(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=F({name:"InfraBuild",__name:"index",setup(o){const{t:s}=G(),_=pa(),n=c(),u=c(!1),C=c(""),m=c(-1),i=c(""),y=e=>{u.value=!0,C.value=e},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 e=n.value.getRule(),l=n.value.getOption();return`<template>
  2. <form-create
  3. v-model="fapi"
  4. :rule="rule"
  5. :option="option"
  6. @submit="onSubmit"
  7. ></form-create>
  8. </template>
  9. <script setup lang=ts>
  10. import formCreate from "@form-create/element-ui";
  11. const faps = ref(null)
  12. const rule = ref('')
  13. const option = ref('')
  14. const init = () => {
  15. rule.value = formCreate.parseJson('${Z.toJson(e).replaceAll("\\","\\\\")}')
  16. option.value = formCreate.parseJson('${JSON.stringify(l)}')
  17. }
  18. const onSubmit = (formData) => {
  19. //todo \u63D0\u4EA4\u8868\u5355
  20. }
  21. init()
  22. <\/script>`},L=e=>{let l="json";return m.value===2&&(l="xml"),ta(e)||(e=JSON.stringify(e)),g.highlight(l,e,!0).value||"&nbsp;"};return H(async()=>{g.registerLanguage("xml",_a),g.registerLanguage("json",b)}),(e,l)=>{const p=ea,N=la,w=ra,B=na,R=sa,T=K,z=P("dompurify-html");return S(),M(Y,null,[a(B,null,{default:t(()=>[a(w,null,{default:t(()=>[a(N,null,{default:t(()=>[f("div",h,[a(p,{size:"small",type:"primary",onClick:J},{default:t(()=>[d("\u751F\u6210 JSON")]),_:1}),a(p,{size:"small",type:"success",onClick:x},{default:t(()=>[d("\u751F\u6210 Options")]),_:1}),a(p,{size:"small",type:"danger",onClick:j},{default:t(()=>[d("\u751F\u6210\u7EC4\u4EF6")]),_:1})])]),_:1}),a(N,null,{default:t(()=>[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]=E=>X(u)?u.value=E:null),title:r(C),"max-height":"600"},{default:t(()=>[r(u)?(S(),M("div",v,[a(p,{style:{float:"right"},onClick:l[0]||(l[0]=E=>(async I=>{const{copy:U,copied:V,isSupported:$}=aa({source:I});$?(await U(),r(V)&&_.success(s("common.copySuccess"))):_.error(s("common.copyError"))})(r(i)))},{default:t(()=>[d(Q(r(s)("common.copy")),1)]),_:1}),a(R,{height:"580"},{default:t(()=>[f("div",null,[f("pre",null,[q(f("code",O,null,512),[[z,L(r(i))]])])])]),_:1})],512)):W("",!0)]),_:1},8,["modelValue","title"])],64)}}})});export{ya as __tla,k as default};