diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index cf2476e..af55289 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -45,7 +45,7 @@
"file-saver": "2.0.4",
"form-gen-parser": "^1.0.3",
"fuse.js": "6.4.3",
- "highlight.js": "9.18.5",
+ "highlight.js": "^9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "2.2.1",
"jsencrypt": "3.0.0-rc.1",
@@ -53,6 +53,7 @@
"quill": "1.3.7",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
+ "vkbeautify": "^0.99.3",
"vue": "2.6.12",
"vue-bpmn-modeler": "^1.2.0",
"vue-count-to": "1.0.13",
diff --git a/ruoyi-ui/src/components/Process/index.vue b/ruoyi-ui/src/components/Process/index.vue
index 8008a35..211fd38 100644
--- a/ruoyi-ui/src/components/Process/index.vue
+++ b/ruoyi-ui/src/components/Process/index.vue
@@ -29,7 +29,7 @@
-
查看xml
+
查看xml
下载xml
下载svg
保存模型
@@ -45,9 +45,6 @@
-
-
-
@@ -70,9 +67,6 @@ export default {
type: String,
default: ''
},
- xmlTitle: "",
- xmlOpen: false,
- xmlContent: "",
users: {
type: Array,
default: () => []
@@ -296,10 +290,7 @@ export default {
async showXML() {
try {
const { xml } = await this.modeler.saveXML({ format: true })
- this.xmlOpen = true;
- this.xmlTitle = 'xml查看';
- debugger
- // this.xmlContent = this.parseXml(xml);
+ this.$emit('showXML',xml)
} catch (err) {
console.log(err)
}
@@ -338,50 +329,6 @@ export default {
a.download = filename
a.click()
window.URL.revokeObjectURL(url)
- },
- parseXml(content) {
- let xml_doc = null
- try {
- xml_doc = (new DOMParser()).parseFromString(content.replace(/[\n\r\s]/g, ''), 'text/xml')
- } catch (e) {
- return false
- }
- let flag = 0
-
- function build_xml(index, list, element) {
- let t = []
- for (let i = 0; i < flag; i++) {
- t.push(' ')
- }
- t = t.join('')
- list.push(t + '<' + element.nodeName + '>
')
- for (let i = 0; i < element.childNodes.length; i++) {
- const nodeName = element.childNodes[i].nodeName
- if (element.childNodes[i].childNodes.length === 0) {
- const value_txt = ''
- const item = t + ' <' + nodeName +
- '>' + value_txt + '</' + nodeName + '>
'
- list.push(item)
- } else if ((element.childNodes[i].childNodes.length === 1 && element.childNodes[i].childNodes[0].nodeValue != null)) {
- const value = element.childNodes[i].childNodes[0].nodeValue
- const value_color = !isNaN(Number(value)) ? 'code-number' : 'code-string'
- const value_txt = '' + value + ''
- const item = t + ' <' + nodeName +
- '>' + value_txt + '</' + nodeName + '>
'
- list.push(item)
- } else {
- flag++
- build_xml(++index, list, element.childNodes[i])
- flag--
- }
- }
- list.push(t + '</' + element.nodeName + '>
')
- }
-
- const list = []
- build_xml(0, list, xml_doc.documentElement)
-
- return list.join('')
}
}
}
@@ -435,12 +382,6 @@ export default {
min-height: 650px;
}
- .code-string{color:#993300;}
- .code-number{color:#cc00cc;}
- .code-boolean{color:#000033;}
- .code-null{color:magenta;}
- .code-key{color:#003377;font-weight:bold;}
-
// .highlight.djs-shape .djs-visual > :nth-child(1) {
// fill: green !important;
// stroke: green !important;
diff --git a/ruoyi-ui/src/views/flowable/definition/model.vue b/ruoyi-ui/src/views/flowable/definition/model.vue
index 4bb3939..18e1c75 100644
--- a/ruoyi-ui/src/views/flowable/definition/model.vue
+++ b/ruoyi-ui/src/views/flowable/definition/model.vue
@@ -8,22 +8,47 @@
:categorys="categorys"
:is-view="false"
@save="save"
+ @showXML="showXML"
/>
+
+
+
+
+
+ {{xmlContent}}
+
+
+
+
-
diff --git a/ruoyi-ui/src/views/flowable/task/record/index.vue b/ruoyi-ui/src/views/flowable/task/record/index.vue
index c8b8db2..78d973e 100644
--- a/ruoyi-ui/src/views/flowable/task/record/index.vue
+++ b/ruoyi-ui/src/views/flowable/task/record/index.vue
@@ -7,7 +7,7 @@
-
+