选煤厂安全管理系统前端代码
houzhongjian
2024-11-25 37b2044f04a09e89f82f8484279b5f06b7194481
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import{_ as w}from"./Dialog.vue_vue_type_style_index_0_lang-DH0TiLYN.js";import{d as z,J as A,Q as U,r as c,b as F,aA as K,a1 as Q,o as h,c as C,k as e,B as l,C as d,O as g,a as n,D as $,P as G,h as H,I as P,F as q,dB as W,dC as X,aT as Y,V as Z,am as ee,ap as ae,b3 as te}from"./index-CHTXMeh8.js";import{_ as le}from"./ContentWrap.vue_vue_type_script_setup_true_lang-BjvrLlUT.js";import{u as ne}from"./useFormCreateDesigner-DjCKROXR.js";import{H as v,j as se}from"./java-DtAu0jvG.js";import"./el-card-Bdk9qx7q.js";import"./dict.type-DwbQoim0.js";function oe(r){const s=["true","false","null"],m={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},r.QUOTE_STRING_MODE,m,r.C_NUMBER_MODE,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const re={class:"float-right mb-2"},ie={key:0,ref:"editor"},ue={class:"hljs"},ce=z({name:"InfraBuild",__name:"index",setup(r){const{t:s}=A(),m=U(),o=c(),i=c(!1),y=c(""),p=c(-1),u=c("");ne(o);const _=a=>{i.value=!0,y.value=a},N=()=>{_("\u751F\u6210 JSON"),p.value=0,u.value=o.value.getRule()},S=()=>{_("\u751F\u6210 Options"),p.value=1,u.value=o.value.getOption()},E=()=>{_("\u751F\u6210\u7EC4\u4EF6"),p.value=2,u.value=M()},M=()=>{const a=o.value.getRule(),t=o.value.getOption();return`<template>
    <form-create
      v-model:api="fApi"
      :rule="rule"
      :option="option"
      @submit="onSubmit"
    ></form-create>
  </template>
  <script setup lang=ts>
    const faps = ref(null)
    const rule = ref('')
    const option = ref('')
    const init = () => {
      rule.value = formCreate.parseJson('${W.toJson(a).replaceAll("\\","\\\\")}')
      option.value = formCreate.parseJson('${JSON.stringify(t)}')
    }
    const onSubmit = (formData) => {
      //todo \u63D0\u4EA4\u8868\u5355
    }
    init()
  <\/script>`},b=a=>{let t="json";return p.value===2&&(t="xml"),Y(a)||(a=JSON.stringify(a)),v.highlight(t,a,!0).value||"&nbsp;"};return F(async()=>{v.registerLanguage("xml",se),v.registerLanguage("json",oe)}),(a,t)=>{const f=Z,k=ee,J=ae,D=K("FcDesigner"),j=le,x=te,B=w,L=Q("dompurify-html");return h(),C(q,null,[e(j,null,{default:l(()=>[e(J,null,{default:l(()=>[e(k,null,{default:l(()=>[d("div",re,[e(f,{size:"small",type:"primary",onClick:N},{default:l(()=>[g("\u751F\u6210 JSON")]),_:1}),e(f,{size:"small",type:"success",onClick:S},{default:l(()=>[g("\u751F\u6210 Options")]),_:1}),e(f,{size:"small",type:"danger",onClick:E},{default:l(()=>[g("\u751F\u6210\u7EC4\u4EF6")]),_:1})])]),_:1})]),_:1}),e(D,{ref_key:"designer",ref:o,height:"780px"},null,512)]),_:1}),e(B,{modelValue:n(i),"onUpdate:modelValue":t[1]||(t[1]=O=>P(i)?i.value=O:null),title:n(y),"max-height":"600"},{default:l(()=>[n(i)?(h(),C("div",ie,[e(f,{style:{float:"right"},onClick:t[0]||(t[0]=O=>(async T=>{const{copy:I,copied:R,isSupported:V}=X({source:T});V?(await I(),n(R)&&m.success(s("common.copySuccess"))):m.error(s("common.copyError"))})(n(u)))},{default:l(()=>[g($(n(s)("common.copy")),1)]),_:1}),e(x,{height:"580"},{default:l(()=>[d("div",null,[d("pre",null,[G(d("code",ue,null,512),[[L,b(n(u))]])])])]),_:1})],512)):H("",!0)]),_:1},8,["modelValue","title"])],64)}}});export{ce as default};