index-a5ab4c67.js 3.6 KB

12345678910111213141516171819202122
  1. import{_ as V,__tla as $}from"./Dialog-f354f369.js";import{d as A,P as F,r as c,b as P,a3 as q,o as S,c as J,f as a,A as e,B as f,D as d,a as r,E as G,k as Q,a2 as W,a1 as X,F as Y,dj as Z,e2 as aa,aH as ea,J as ta,H as la,K as ra,a$ as sa,__tla as oa}from"./index-a9d538d5.js";import{_ as na,__tla as ua}from"./ContentWrap.vue_vue_type_script_setup_true_lang-6b7b4656.js";import{E as ia,__tla as ca}from"./index.es-41c8c639.js";import{H as g,j as _a,__tla as ma}from"./java-95a5bc2f.js";import{u as pa,__tla as fa}from"./useMessage-d5cbbfad.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as da}from"./el-card-0ea446a3.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 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"},b=A({name:"InfraBuild",__name:"index",setup(o){const{t:s}=F(),_=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>`},R=t=>{let l="json";return m.value===2&&(l="xml"),ea(t)||(t=JSON.stringify(t)),g.highlight(l,t,!0).value||"&nbsp;"};return P(async()=>{g.registerLanguage("xml",_a),g.registerLanguage("json",M)}),(t,l)=>{const p=ta,E=la,B=ra,L=na,T=sa,w=V,z=q("dompurify-html");return S(),J(Y,null,[a(L,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(),J("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(G(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,R(r(i))]])])])]),_:1})],512)):W("",!0)]),_:1},8,["modelValue","title"])],64)}}})});export{ya as __tla,b as default};