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
        }
      })
相关推荐
Senar1 分钟前
Web端选择本地文件的几种方式
前端·javascript·html
iuyou️3 分钟前
Spring Boot知识点详解
java·spring boot·后端
北辰浮光5 分钟前
[Mybatis-plus]
java·开发语言·mybatis
一弓虽15 分钟前
SpringBoot 学习
java·spring boot·后端·学习
南客先生19 分钟前
互联网大厂Java面试:RocketMQ、RabbitMQ与Kafka的深度解析
java·面试·kafka·rabbitmq·rocketmq·消息中间件
烛阴19 分钟前
UV Coordinates & Uniforms -- OpenGL UV坐标和Uniform变量
前端·webgl
ai大佬22 分钟前
Java 开发玩转 MCP:从 Claude 自动化到 Spring AI Alibaba 生态整合
java·spring·自动化·api中转·apikey
姑苏洛言23 分钟前
扫码小程序实现仓库进销存管理中遇到的问题 setStorageSync 存储大小限制错误解决方案
前端·后端
烛阴34 分钟前
JavaScript 的 8 大“阴间陷阱”,你绝对踩过!99% 程序员崩溃瞬间
前端·javascript·面试
Mr__Miss1 小时前
面试踩过的坑
java·开发语言