UNPKG

@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.67 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./style/index.css");const o=require("@javaguns/utils"),y=require("@javaguns/ui"),x=require("../utils/injection-key.js"),B=require("../hooks/useData.js"),b={class:"guns-header-container"},E={class:"guns-header-name"},M={class:"guns-header-nav"},z={class:"guns-header-button-order"},q={class:"sub-header-container"},S={class:"handle-container"},T=e.defineComponent({name:"flow-nav"}),G=e.defineComponent({...T,props:{node:{},nav:{type:Boolean,default:!0},name:{default:""},datas:{default:()=>[]}},emits:["click","preview","close","refresh","publish","upgrade"],setup(d,{emit:p}){o.pluginManager.getComponent("Container");const f=o.pluginManager.getComponent("Header"),n=o.pluginManager.getComponent("Button"),m=o.pluginManager.getComponent("Affix"),h=o.pluginManager.getComponent("Row"),r=o.pluginManager.getComponent("Col"),t=d,s=e.inject(x.NodeModifyKey,e.ref(!1)),i=e.ref(1),{navDatas:g}=B.default(),C=e.computed(()=>t.datas&&t.datas.length>0?t.datas:g),a=p,_=c=>{i.value=c,a("click",c)},u=()=>{a("close")},N=()=>{a("preview")},k=()=>{a("publish"),s.value=!1},V=()=>{a("refresh"),s.value=!1},v=()=>{a("upgrade"),s.value=!1};return(c,j)=>t.nav?(e.openBlock(),e.createBlock(e.unref(m),{key:0,"offset-top":0,offset:0,class:"guns-page-flow-container"},{default:e.withCtx(()=>[e.createVNode(e.unref(f),{class:"guns-page-flow-header",style:{height:"50px"}},{default:e.withCtx(()=>[e.createElementVNode("div",b,[e.createVNode(e.unref(h),null,{default:e.withCtx(()=>[e.createVNode(e.unref(r),{span:6},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"guns-header-icon"},[e.createElementVNode("span",{class:"flowfont icon-jiantou-zuo-cuxiantiao",onClick:u})]),e.createElementVNode("div",E,[e.createElementVNode("span",null,"正在编辑: "+e.toDisplayString(t.name),1)])]),_:1}),e.createVNode(e.unref(r),{span:12},{default:e.withCtx(()=>[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,w)=>(e.openBlock(),e.createBlock(e.unref(n),{key:w,onClick:D=>_(l.value),class:e.normalizeClass({"nav-active":i.value==l.value})},{default:e.withCtx(()=>[e.createElementVNode("span",z,e.toDisplayString(l.value),1),e.createElementVNode("span",null,e.toDisplayString(l.name),1)]),_:2},1032,["onClick","class"]))),128))])]),_:1}),e.createVNode(e.unref(r),{span:6},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createElementVNode("div",S,[e.createVNode(e.unref(y.GunsSpace),{size:"ss"},{default:e.withCtx(()=>[e.createVNode(e.unref(n),{type:"primary",size:"small",class:"main-hollow-btn",onClick:u},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1}),e.createVNode(e.unref(n),{type:"primary",size:"small",class:"main-hollow-btn",onClick:N},{default:e.withCtx(()=>[e.createTextVNode("预览表单")]),_:1}),t.node.update?(e.openBlock(),e.createBlock(e.unref(n),{key:0,type:"primary",size:"small",class:"main-hollow-btn",onClick:V},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})):e.createCommentVNode("",!0),t.node&&!t.node.update?(e.openBlock(),e.createBlock(e.unref(n),{key:1,type:"primary",size:"small",class:"main-solid-btn",onClick:k},{default:e.withCtx(()=>[e.createTextVNode("发布")]),_:1})):e.createCommentVNode("",!0),e.unref(s)&&t.node&&t.node.update?(e.openBlock(),e.createBlock(e.unref(n),{key:2,type:"primary",size:"small",class:"main-solid-btn",onClick:v},{default:e.withCtx(()=>[e.createTextVNode("升级")]),_:1})):e.createCommentVNode("",!0)]),_:1})])])]),_:1})]),_:1})])]),_:1})]),_:1})):e.createCommentVNode("",!0)}});exports.default=G;