index-a1d57d03.js 3.6 KB

12345678910111213141516171819202122
  1. import{_ as V,__tla as $}from"./Dialog-4c960d8c.js";import{d as A,P,r as c,b as F,a3 as G,o as S,c as M,f as a,A as e,B as f,D as d,a as r,E as Q,k as q,a2 as W,a1 as X,F as Y,dj as Z,e3 as aa,aH as ea,J as ta,H as la,K as ra,a$ as sa,__tla as oa}from"./index-1f518666.js";import{_ as na,__tla as ua}from"./ContentWrap.vue_vue_type_script_setup_true_lang-a4de6de9.js";import{E as ia,__tla as ca}from"./index.es-3771ff98.js";import{H as g,j as _a,__tla as ma}from"./java-014f1318.js";import{u as pa,__tla as fa}from"./useMessage-633c11d2.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as da}from"./el-card-955661ed.js";let b,ya=Promise.all([(()=>{try{return $}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 J(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"},b=A({name:"InfraBuild",__name:"index",setup(o){const{t:s}=P(),_=pa(),n=c(),u=c(!1),C=c(""),m=c(-1),i=c(""),y=t=>{u.value=!0,C.value=t},k=()=>{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>
  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(t).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=t=>{let l="json";return m.value===2&&(l="xml"),ea(t)||(t=JSON.stringify(t)),g.highlight(l,t,!0).value||"&nbsp;"};return F(async()=>{g.registerLanguage("xml",_a),g.registerLanguage("json",J)}),(t,l)=>{const p=ta,E=la,B=ra,R=na,T=sa,w=V,z=G("dompurify-html");return S(),M(Y,null,[a(R,null,{default:e(()=>[a(B,null,{default:e(()=>[a(E,null,{default:e(()=>[f("div",h,[a(p,{size:"small",type:"primary",onClick:k},{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(w,{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(),M("div",v,[a(p,{style:{float:"right"},onClick:l[0]||(l[0]=N=>(async H=>{const{copy:I,copied:K,isSupported:U}=aa({source:H});U?(await I(),r(K)&&_.success(s("common.copySuccess"))):_.error(s("common.copyError"))})(r(i)))},{default:e(()=>[d(Q(r(s)("common.copy")),1)]),_:1}),a(T,{height:"580"},{default:e(()=>[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,b as default};