import{d as j,l as B,m as A,r as x,o,x as d,b as a,a as t,A as h,B as i,F as g,D as H,X as u,z as _,a0 as r,c as f,t as p,u as N}from"./vue.1703796278973.js";import{I as S,a9 as T,a5 as E,Y as z,aK as F}from"./index.17037962789732.js";import"./index.1703796278973305.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import{_ as O}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";const J={class:"table-wrapper"},K={key:0},Q={class:"error-text"},X={key:0},Y=j({__name:"VariableDefinitions",props:{variableDefinitions:{type:Array,default:()=>[]}},emits:["update:variableDefinitions"],setup(I,{emit:y}){const k=I,D=[{title:"变量",dataIndex:"id",width:80},{title:"名称",dataIndex:"name",width:160},{title:"类型",dataIndex:"type"},{title:"格式",dataIndex:"format",width:150}],c=B({get:()=>k.variableDefinitions,set:n=>y("update:variableDefinitions",n)});A(()=>c.value,n=>{y("update:variableDefinitions",n)},{deep:!0});const C=n=>{switch(n.type){case"string":n.format="%s";break;case"date":n.format="timestamp";break;case"double":n.format="%.2f";break}};return(n,$)=>{const v=S,l=T,b=E,w=x("Ellipsis"),M=x("AIcon"),U=z,V=F;return o(),d("div",J,[a(V,{columns:D,"data-source":N(c),bordered:"",pagination:!1},{bodyCell:t(({column:m,text:q,record:e})=>[m.dataIndex==="id"?(o(),d("span",K,h(e[m.dataIndex]),1)):i("",!0),m.dataIndex==="name"?(o(),d(g,{key:1},[a(v,{value:e.name,"onUpdate:value":s=>e.name=s,class:H(!e.name||e.name.length>64?"has-error":"")},null,8,["value","onUpdate:value","class"]),u(_("div",Q,[u(_("span",null," 该字段是必填字段 ",512),[[r,!e.name]]),u(_("span",null," 最多可输入64个字符 ",512),[[r,e.name.length>64]])],512),[[r,!e.name||e.name.length>64]])],64)):i("",!0),m.dataIndex==="type"?(o(),f(b,{key:2,value:e.type,"onUpdate:value":s=>e.type=s,onChange:s=>C(e)},{default:t(()=>[a(l,{value:"string"},{default:t(()=>[p("字符串")]),_:1}),a(l,{value:"date"},{default:t(()=>[p("时间")]),_:1}),a(l,{value:"double"},{default:t(()=>[p("数字")]),_:1})]),_:2},1032,["value","onUpdate:value","onChange"])):i("",!0),m.dataIndex==="format"?(o(),d(g,{key:3},[e.type==="string"?(o(),d("span",X,h(e.format),1)):i("",!0),e.type==="date"?(o(),f(b,{key:1,value:e.format,"onUpdate:value":s=>e.format=s},{default:t(()=>[a(l,{value:"timestamp"},{default:t(()=>[p(" timestamp ")]),_:1}),a(l,{value:"yyyy-MM-dd"},{default:t(()=>[p(" yyyy-MM-dd ")]),_:1}),a(l,{value:"yyyy-MM-dd HH:mm:ss"},{default:t(()=>[a(w,null,{default:t(()=>[p("yyyy-MM-dd HH:mm:ss")]),_:1})]),_:1})]),_:2},1032,["value","onUpdate:value"])):i("",!0),e.type==="double"?(o(),f(v,{key:2,value:e.format,"onUpdate:value":s=>e.format=s},{suffix:t(()=>[a(U,{title:"格式为：%.xf x代表数字保留的小数位数。当x=0时,代表格式为整数"},{default:t(()=>[a(M,{type:"QuestionCircleOutlined"})]),_:1})]),_:2},1032,["value","onUpdate:value"])):i("",!0)],64)):i("",!0)]),_:1},8,["data-source"])])}}});const fe=O(Y,[["__scopeId","data-v-edbf38ed"]]);export{fe as default};
