@javaguns/flow-ui
Version:
``` <template> <a-spin :spinning="loading"> <FlowDesigner ref="flowDesigner" top="50px"> </FlowDesigner> </a-spin> </template> <script lang="ts" setup> import { ref, provide, onMounted } from 'vue'; import { FlowDesigner, LoadingKey } from '@j
2 lines (1 loc) • 3.35 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../style/option.css");const s=require("@javaguns/utils"),_={class:"flow-drawer-option-item"},x={class:"flow-drawer-option-item-left"},B=e.createElementVNode("img",{src:"https://foruda.gitee.com/images/1692100214237181251/57f637a4_9837676.png"},null,-1),E={class:"flow-drawer-option-desc"},y={class:"drawer-option-title"},S=["onClick"],T={class:"drawer-option-desc"},U={class:"flow-drawer-option-item-switch"},M={class:"dialog-footer"},D=e.defineComponent({name:"flow-drawer-option"}),$=e.defineComponent({...D,props:{activeText:{default:"开"},inactiveText:{default:"关"},node:{},datas:{}},emits:["change"],setup(v,{emit:f}){const g=s.pluginManager.getComponent("Switch"),k=s.pluginManager.getComponent("Dialog"),h=s.pluginManager.getComponent("Input"),r=s.pluginManager.getComponent("Button");s.pluginManager.getComponent("GunsSpace");const l=v,u=e.ref({}),n=e.ref(""),i=e.ref(!1),V=f,N=a=>{n.value=a.aliasName?a.aliasName:a.buttonName,u.value=a,i.value=!0},d=a=>{i.value=a},w=a=>{V("change",a)},m=()=>{u.value.aliasName=n.value,d(!1)};return(a,o)=>{var p;return e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((p=l.node)==null?void 0:p.buttons)||l.datas,(t,C)=>(e.openBlock(),e.createElementBlock("div",{class:"flow-drawer-option",key:C},[e.createElementVNode("div",_,[e.createElementVNode("div",x,[B,e.createElementVNode("div",E,[e.createElementVNode("p",y,[e.createElementVNode("span",null,e.toDisplayString(t.aliasName?t.aliasName:t.buttonName),1),t.checked?(e.openBlock(),e.createElementBlock("span",{key:0,class:"alias-set",onClick:c=>N(t)},"别名设置",8,S)):e.createCommentVNode("",!0)]),e.createElementVNode("p",T,e.toDisplayString(t.content),1)])]),e.createElementVNode("div",U,[e.renderSlot(a.$slots,"default",{item:t,slotData:l},()=>[e.createVNode(e.unref(g),{modelValue:t.checked,"onUpdate:modelValue":c=>t.checked=c,checked:t.checked,"onUpdate:checked":c=>t.checked=c,"checked-children":l.activeText,"un-checked-children":l.inactiveText,"active-text":l.activeText,"inactive-text":l.inactiveText,"inline-prompt":"",onChange:c=>w(t)},null,8,["modelValue","onUpdate:modelValue","checked","onUpdate:checked","checked-children","un-checked-children","active-text","inactive-text","onChange"])])])])]))),128)),i.value?(e.openBlock(),e.createBlock(e.unref(k),{key:0,modelValue:i.value,"onUpdate:modelValue":o[3]||(o[3]=t=>i.value=t),visible:i.value,width:600,title:"别名设置","body-style":{paddingBottom:"8px"},"onUpdate:visible":d,onClose:o[4]||(o[4]=t=>d(!1)),maskClosable:!0,onOk:m},{footer:e.withCtx(()=>[e.createElementVNode("div",M,[e.createVNode(e.unref(r),{onClick:o[2]||(o[2]=t=>d(!1))},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(e.unref(r),{type:"primary",onClick:m},{default:e.withCtx(()=>[e.createTextVNode(" 确定 ")]),_:1})])]),default:e.withCtx(()=>[e.createVNode(e.unref(h),{type:"text","allow-clear":"",modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),value:n.value,"onUpdate:value":o[1]||(o[1]=t=>n.value=t),autofocus:"autofocus"},null,8,["modelValue","value"])]),_:1},8,["modelValue","visible"])):e.createCommentVNode("",!0)],64)}}});exports.default=$;