1.0.0 • Published 1 year ago

@blueking/bkchat-workflow v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

在main.js全局定义组件(不然会报循环引用)

import NodeJudge from '@blueking/bkchat-workflow/src/components/node/node-judge';
import LogicTable from '@blueking/bkchat-workflow/src/components/common/logic-table';
import ApplicationTable from '@blueking/bkchat-workflow/src/components/common/application-table';

Vue.component('NodeJudge', NodeJudge);
Vue.component('LogicTable', LogicTable);
Vue.component('ApplicationTable', ApplicationTable);

在使用的地方:

<template>
  <div @click="getData">
    <Workflow :data="data"></Workflow>
  </div>
</template>

<script>
import Workflow from '@blueking/bkchat-workflow/src/components/main';

export default {
  components: {
    Workflow,
  },
  data() {
    return {
      data: {
        node: {
          name: '开始',
          nodeId: 'start',
          type: 'start',
          childrenNode: {},
        },
      },
    };
  },
  methods: {
    getData() {
      console.log(this.data);
    },
  },
};
</script>

<style scoped lang="postcss">
</style>

节点结构:

{
  nodeId: '', # 节点ID
  prevId: '', # 当前节点的前一个节点ID  
  childNode: {}, # 下一个节点内容
  name: '', # 节点名称
  type: '', # 节点属性
  properties: '', # 节点描述
  logicType: '', # 逻辑节点类型
  logicData: '', # 逻辑节点内容
  appType: '', # 应用节点类型
  appId: '', # 应用节点ID
  appData: '', # 应用节点内容  
}
1.0.0

1 year ago