bug
parent
252ef55a6c
commit
d6a4dc7d11
|
@ -8,13 +8,16 @@
|
||||||
<el-tooltip effect="light" placement="bottom">
|
<el-tooltip effect="light" placement="bottom">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div style="color: #409eff">
|
<div style="color: #409eff">
|
||||||
<el-button link @click="downloadProcessAsXml()">下载为XML文件</el-button>
|
<!-- <el-button link @click="downloadProcessAsXml()">下载为XML文件</el-button> -->
|
||||||
|
<XTextButton title="下载为XML文件" @click="downloadProcessAsXml()" />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<el-button link @click="downloadProcessAsSvg()">下载为SVG文件</el-button>
|
<!-- <el-button link @click="downloadProcessAsSvg()">下载为SVG文件</el-button> -->
|
||||||
|
<XTextButton title="下载为SVG文件" @click="downloadProcessAsSvg()" />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<el-button link @click="downloadProcessAsBpmn()">下载为BPMN文件</el-button>
|
<!-- <el-button link @click="downloadProcessAsBpmn()">下载为BPMN文件</el-button> -->
|
||||||
|
<XTextButton title="下载为BPMN文件" @click="downloadProcessAsBpmn()" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<XButton title="下载文件" preIcon="ep:download" />
|
<XButton title="下载文件" preIcon="ep:download" />
|
||||||
|
@ -22,9 +25,11 @@
|
||||||
<el-tooltip effect="light">
|
<el-tooltip effect="light">
|
||||||
<XButton preIcon="ep:view" title="浏览" />
|
<XButton preIcon="ep:view" title="浏览" />
|
||||||
<template #content>
|
<template #content>
|
||||||
<el-button link @click="previewProcessXML">预览XML</el-button>
|
<!-- <el-button link @click="previewProcessXML">预览XML</el-button> -->
|
||||||
|
<XTextButton title="预览XML" @click="previewProcessXML" />
|
||||||
<br />
|
<br />
|
||||||
<el-button link @click="previewProcessJson">预览JSON</el-button>
|
<!-- <el-button link @click="previewProcessJson">预览JSON</el-button> -->
|
||||||
|
<XTextButton title="预览JSON" @click="previewProcessJson" />
|
||||||
</template>
|
</template>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
|
@ -236,7 +241,7 @@ import flowableModdleExtension from './plugins/extension-moddle/flowable'
|
||||||
// 引入json转换与高亮
|
// 引入json转换与高亮
|
||||||
// import xml2js from 'xml-js'
|
// import xml2js from 'xml-js'
|
||||||
import xml2js from 'fast-xml-parser'
|
import xml2js from 'fast-xml-parser'
|
||||||
|
import { XmlNode, XmlNodeType, parseXmlString } from 'steady-xml'
|
||||||
// 代码高亮插件
|
// 代码高亮插件
|
||||||
// import hljs from 'highlight.js/lib/highlight'
|
// import hljs from 'highlight.js/lib/highlight'
|
||||||
// import 'highlight.js/styles/github-gist.css'
|
// import 'highlight.js/styles/github-gist.css'
|
||||||
|
@ -630,6 +635,13 @@ const previewProcessXML = () => {
|
||||||
const previewProcessJson = () => {
|
const previewProcessJson = () => {
|
||||||
bpmnModeler.saveXML({ format: true }).then(({ xml }) => {
|
bpmnModeler.saveXML({ format: true }).then(({ xml }) => {
|
||||||
console.log(xml, 'xml')
|
console.log(xml, 'xml')
|
||||||
|
|
||||||
|
const rootNode = parseXmlString(xml)
|
||||||
|
console.log(rootNode, 'rootNoderootNode')
|
||||||
|
const rootNodes = new XmlNode(XmlNodeType.Root)
|
||||||
|
rootNodes.toJsObject()
|
||||||
|
console.log(JSON.stringify(rootNodes), ';;;;;;;;;;;;;;;')
|
||||||
|
|
||||||
const parser = new xml2js.XMLParser()
|
const parser = new xml2js.XMLParser()
|
||||||
let jObj = parser.parse(xml)
|
let jObj = parser.parse(xml)
|
||||||
// console.log(jObj, 'jObjjObjjObjjObjjObj')
|
// console.log(jObj, 'jObjjObjjObjjObjjObj')
|
||||||
|
|
|
@ -39,6 +39,10 @@ const props = defineProps({
|
||||||
|
|
||||||
provide('configGlobal', props)
|
provide('configGlobal', props)
|
||||||
|
|
||||||
|
const emit = defineEmits(['destroy'])
|
||||||
|
|
||||||
|
let bpmnModeler
|
||||||
|
|
||||||
const xml = ref('')
|
const xml = ref('')
|
||||||
const activityList = ref([])
|
const activityList = ref([])
|
||||||
const processInstance = ref(undefined)
|
const processInstance = ref(undefined)
|
||||||
|
|
Loading…
Reference in New Issue