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
        }
      })
相关推荐
龙谷情Sinoam几秒前
扩展若依@Excel注解,使其对字段的控制是否导出更加便捷
java
山河木马1 分钟前
前端学习C++之:.h(.hpp)与.cpp文件
前端·javascript·c++
用户9272472502192 分钟前
PHP + CSS + JS + JSON 数据采集与展示系统,支持伪静态
前端
努力只为躺平6 分钟前
一文搞懂 Promise 并发控制:批量执行 vs 最大并发数,实用场景全解析!
前端·javascript
Web小助手8 分钟前
大保剑:Promise的有趣体验
javascript
李大玄8 分钟前
Google浏览器拓展工具 "GU"->google Utils
前端·javascript·github
爱编程的喵8 分钟前
从DOM0到事件委托:揭秘JavaScript事件机制的性能密码
前端·javascript·dom
二十雨辰12 分钟前
[尚庭公寓]07-Knife快速入门
java·开发语言·spring
蓝倾14 分钟前
京东批量获取商品SKU操作指南
前端·后端·api
JSLove21 分钟前
常见 npm 报错问题
前端·npm