<template>
  <div>
    <bpmn-modeler
      ref="refNode"
      :xml="xml"
      :users="users"
      :groups="groups"
      :categorys="categorys"
      :exps="exps"
      :is-view="false" />
<!--      @save="save"
      @showXML="showXML"-->

  </div>
</template>
<script>
import 'highlight.js/styles/atelier-savanna-dark.css'
import bpmnModeler from '@/components/Process/index'
import vkBeautify from 'vkbeautify'
import hljs from 'highlight.js'
export default {
  name: 'ProcessDesign',
  components: {
    bpmnModeler,
    vkBeautify
  },
  // 自定义指令
  directives: {
    deep: true,
    highlight: {
      deep: true,
      bind: function bind(el, binding) {
        const targets = el.querySelectorAll('code')
        let target
        let i
        for (i = 0; i < targets.length; i += 1) {
          target = targets[i]
          if (typeof binding.value === 'string') {
            target.textContent = binding.value
          }
          hljs.highlightBlock(target)
        }
      },
      componentUpdated: function componentUpdated(el, binding) {
        const targets = el.querySelectorAll('code')
        let target
        let i
        for (i = 0; i < targets.length; i += 1) {
          target = targets[i]
          if (typeof binding.value === 'string') {
            target.textContent = binding.value
            hljs.highlightBlock(target)
          }
        }
      }
    }
  },
  data() {
    return {
      xml: undefined, // 后端查询到的xml
      modeler: '',
      xmlOpen: false,
      xmlTitle: '',
      xmlData: '',
      users: [],
      groups: [],
      categorys: [],
      exps: []

    }
  },
  created() {
  },
  methods: {}
}
</script>
