基于jeecgboot-vue3的Flowable流程-集成仿钉钉流程(四)支持json和xml的显示

因为这个项目license问题无法开源,更多技术支持与服务请加入我的知识星球。

1、相应的界面前端代码

<template>
  <div class="formDesign">
    <FlowDesign :process="process" :fields="fields" :readOnly="readOnly">
    <el-switch
      inline-prompt
      size="large"
      active-text="正常模式"
      inactive-text="暗黑模式"
      @change="handleToggleDark"
      v-model="isDark"
    />
    <el-switch
      v-model="readOnly"
      size="large"
      active-text="只读模式"
      inactive-text="编辑模式"
      inline-prompt
      :active-value="true"
      :inactive-value="false"
    />
    <el-button-group>
      <el-button @click="viewJson" size="small" type="primary" round icon="View"> 查看Json</el-button>
    </el-button-group>
    <el-button-group>
      <el-button @click="viewXmlBpmn" size="small" type="primary" round icon="View"> 查看XML </el-button>
    </el-button-group>
    <el-button-group>
      <el-button @click="converterBpmn" size="small" type="primary" round icon="View"> 预览bpmn </el-button>
    </el-button-group>
  </FlowDesign>
  <el-dialog title="预览" width="60%" v-model="previewModelVisible" append-to-body destroy-on-close>
    <highlightjs :language="previewType" :code="previewResult" style="height: 80vh" />
  </el-dialog>
  <!-- Bpmn流程图 -->
  <el-dialog :title="processView.title" v-model="processView.open" width="70%" append-to-body>
    <process-viewer :key="`designer-${processView.title}`" :xml="processView.xmlData" :style="{height: '500px'}" />
  </el-dialog>
  </div>
  
</template>

2、相应的转换代码


const viewJson = () => {
  const processJson = JSON.stringify(process.value,undefined, 2); 
  previewResult.value = processJson; 
  previewType.value = 'json'
  previewModelVisible.value = true
}
const viewXmlBpmn = () => {
  const processModel = {
    code: 'test',
    name: '测试',
    icon: {
      name: 'el:HomeFilled',
      color: '#409EFF'
    },
    process: process.value,
    enable: true,
    version: 1,
    sort: 0,
    groupId: '',
    remark: ''
  }
  const xmlData = viewXml(processModel)
  xmlData.then((result) => {
    previewResult.value = result
    previewType.value = 'xml'
    previewModelVisible.value = true
  })
  

3、效果图

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-10 05:30:06       3 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-10 05:30:06       4 阅读
  3. 在Django里面运行非项目文件

    2024-07-10 05:30:06       2 阅读
  4. Python语言-面向对象

    2024-07-10 05:30:06       2 阅读

热门阅读

  1. 大模型/NLP/算法面试题总结4——bert参数量计算

    2024-07-10 05:30:06       13 阅读
  2. springsecurity(学习自用)

    2024-07-10 05:30:06       10 阅读
  3. 构建响应式CSS导航栏:实现优雅的用户体验

    2024-07-10 05:30:06       10 阅读
  4. debian或Ubuntu中开启ssh允许root远程ssh登录的方法

    2024-07-10 05:30:06       10 阅读
  5. 深入理解基本数据结构:链表详解

    2024-07-10 05:30:06       7 阅读
  6. 白骑士的C++教学基础篇 1.3 控制流

    2024-07-10 05:30:06       8 阅读
  7. Istio实战教程:Service Mesh部署与流量管理

    2024-07-10 05:30:06       8 阅读
  8. DHCP&IP、Lan IP&Lan Static IP

    2024-07-10 05:30:06       7 阅读
  9. 在Ubuntu 16.04上安装和配置VNC的方法

    2024-07-10 05:30:06       12 阅读
  10. Flink推测机制

    2024-07-10 05:30:06       8 阅读