index-b8b53bdb.js 3.7 KB

12345678910111213141516171819202122
  1. import{_ as K,__tla as Q}from"./Dialog-82c2009c.js";import{d as X,n as $,r as c,B as P,P as W,o as S,c as M,i as a,w as e,g as f,j as d,a as r,t as A,C as F,a2 as G,y as q,F as Y,du as Z,dX as aa,aW as ea,J as ta,E as la,s as ra,aQ as sa,_ as na,__tla as oa}from"./index-afaf388d.js";import{_ as ua,__tla as ia}from"./ContentWrap-abe0694e.js";import{E as ca,__tla as _a}from"./index.es-e701d955.js";import{H as g,j as ma,__tla as pa}from"./java-c2ca292a.js";import{u as fa,__tla as da}from"./useMessage-a290df31.js";import{__tla as ya}from"./el-card-9c18d881.js";let b,ga=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return ya}catch{}})()]).then(async()=>{function k(n){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},n.QUOTE_STRING_MODE,_,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}let v,h,O;v={class:"float-right mb-2"},h={key:0,ref:"editor"},O={class:"hljs"},b=na(X({name:"InfraBuild",__name:"index",setup(n){const{t:s}=$(),_=fa(),o=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=o.value.getRule()},x=()=>{y("\u751F\u6210 Options"),m.value=1,i.value=o.value.getOption()},j=()=>{y("\u751F\u6210\u7EC4\u4EF6"),m.value=2,i.value=w()},w=()=>{const t=o.value.getRule(),l=o.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>`},D=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",ma),g.registerLanguage("json",k)}),(t,l)=>{const p=ta,E=la,B=ra,R=ua,z=sa,L=K,T=W("dompurify-html");return S(),M(Y,null,[a(R,null,{default:e(()=>[a(B,null,{default:e(()=>[a(E,null,{default:e(()=>[f("div",v,[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(ca),{ref_key:"designer",ref:o,height:"780px"},null,512)]),_:1})]),_:1})]),_:1}),a(L,{modelValue:r(u),"onUpdate:modelValue":l[1]||(l[1]=N=>q(u)?u.value=N:null),title:r(C),"max-height":"600"},{default:e(()=>[r(u)?(S(),M("div",h,[a(p,{style:{float:"right"},onClick:l[0]||(l[0]=N=>(async U=>{const{copy:I,copied:V,isSupported:H}=aa({source:U});H?(await I(),r(V)&&_.success(s("common.copySuccess"))):_.error(s("common.copyError"))})(r(i)))},{default:e(()=>[d(A(r(s)("common.copy")),1)]),_:1}),a(z,{height:"580"},{default:e(()=>[f("div",null,[f("pre",null,[F(f("code",O,null,512),[[T,D(r(i))]])])])]),_:1})],512)):G("",!0)]),_:1},8,["modelValue","title"])],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/build/index.vue"]])});export{ga as __tla,b as default};