BPMN.js学习

查看流程图

复制代码
processView: {
  title: '',
  open: false,
  index: undefined,
  xmlData:"",
},
复制代码
<el-table-column label="模型名称" align="center" :show-overflow-tooltip="true">
   <template slot-scope="scope">
       <el-button type="text" @click="handleProcessView(scope.row)">
            <span>{{ scope.row.modelName }}</span>
       </el-button>
   </template>
</el-table-column>

   <!-- 流程图 -->
 <el-dialog :title="processView.title" :visible.sync="processView.open" width="70%" append-to-body>
      <!-- 传递了key和xml -->
      <process-viewer :key="`designer-${processView.index}`" :xml="processView.xmlData" :style="{height: '400px'}" />
 </el-dialog>
----------------------------------------------------------------------------------------
 /** 查看流程图 */
    handleProcessView(row) {
      let modelId = row.modelId;
      this.processView.title = "流程图";
      this.processView.index = modelId;
      // 发送请求,获取xml
      getBpmnXml(modelId).then(response => {
        this.processView.xmlData = response.data;
      })
      this.processView.open = true;
    },
----------------------------------------------------------------------------------------

启动流程

复制代码
    submit(data) {
      if (data && this.definitionId) {
        // 启动流程并将表单数据加入流程变量
        startProcess(this.definitionId, JSON.stringify(data.valData))
          .then(
            this.$tab.closeOpenPage({path: '/run/own' })
          // this.pollForResult();
        ).catch(err =>console.error("发生错误:",error))
      }
    },

获取是否有开始表单数据

复制代码
      this.deployId = this.$route.params && this.$route.params.deployId;
      this.definitionId = this.$route.query && this.$route.query.definitionId;
      this.procInsId = this.$route.query && this.$route.query.procInsId;
      getProcessForm({
        definitionId: this.definitionId,
        deployId: this.deployId,
        procInsId: this.procInsId
      }).then(res => {
        if (res.data) {
          this.formData = res.data;
          this.formOpen = true
        }
      })
相关推荐
海宇AI5 小时前
零信任架构实战:基于海宇柠檬查出险-登记证构建自动化车抵贷核保网关
java·人工智能·架构·自动化
计算机魔术师6 小时前
Dario Amodei 发文呼吁为前沿 AI 降速并提出三点计划
前端
计算机魔术师6 小时前
OpenAI的AI代理偷偷给RubyGems下毒,我们却毫无察觉
前端
cfm_29146 小时前
单例模式详解
java
甲维斯7 小时前
0代码,0建模,3句话开发一个3D游戏!
前端·游戏·游戏开发
我叫张土豆7 小时前
本体论、DDD、SDD、TDD:AI 编程时代的四层认知栈
java·人工智能
IT_陈寒7 小时前
Vue的响应式更新把我坑惨了,原来问题出在这
前端·人工智能·后端
白远山7 小时前
家政服务家政社区派单实战:调度系统架构设计与实现指南
java·开发语言·小程序·架构·需求分析
tingke7 小时前
别再堆 AGENTS.md 了:前端团队的 Agent 上下文分层落地指南
前端
海南java第二人7 小时前
从诞生到回收:JVM对象生命周期与垃圾回收全链路解析
java