Просмотр исходного кода

update: 开放发布bo、def新版本功能,增加操作确认提示

cfort 2 лет назад
Родитель
Сommit
e20df40326
2 измененных файлов с 1536 добавлено и 1512 удалено
  1. 837 817
      src/views/platform/bo/boDef/edit/index.vue
  2. 699 695
      src/views/platform/bpmn/bpmDef/design.vue

+ 837 - 817
src/views/platform/bo/boDef/edit/index.vue

@@ -1,89 +1,89 @@
 <template>
-  <el-dialog
-    ref="defDialog"
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    class="bo-def-dialog"
-    append-to-body
-    fullscreen
-    top="0"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <div slot="title" style="padding-left: 20px;" class="el-dialog--left">
-      <el-button icon="el-icon-circle-close" @click="closeDialog()">关闭</el-button>
-      <el-button v-if="!readonly" type="primary" icon="ibps-icon-save" @click="handleSave('save')">保存</el-button>
-      <!-- <el-button v-if="formId&&!readonly&&entrance!=='moreVersions'" icon="ibps-icon-release" type="primary" @click="handleSave('deploy')">发布新版本</el-button> -->
-    </div>
-    <ibps-layout ref="layout">
-      <div slot="west">
-        <ibps-tree
-          ref="tree"
-          v-loading="treeLoading"
-          :element-loading-text="$t('common.loading')"
-          :width="width"
-          :height="height"
-          :custom-zindex="customZindex"
-          :data="treeData"
-          :options="treeOptions"
-          :show-icon="true"
-          :contextmenus="treeContextmenus"
-          title="业务对象管理"
-          @action-event="handleTreeAction"
-          @node-click="handleNodeClick"
-          @expand-collapse="handleExpandCollapse"
-        />
-      </div>
-      <ibps-container style="margin-left: 10px;" class="page">
-        <div
-          v-if="show==='step'"
-          class="bo-content-detail"
-        >
-          <step
-            ref="step"
-            :action="action"
-            @step-action="handleStepAction"
-            @complete="complete"
-          />
+    <el-dialog
+        ref="defDialog"
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        class="bo-def-dialog"
+        append-to-body
+        fullscreen
+        top="0"
+        @open="getFormData"
+        @close="closeDialog"
+    >
+        <div slot="title" style="padding-left: 20px;" class="el-dialog--left">
+            <el-button icon="el-icon-circle-close" @click="closeDialog()">关闭</el-button>
+            <el-button v-if="!readonly" type="primary" icon="ibps-icon-save" @click="handleSave('save')">保存</el-button>
+            <el-button v-if="formId&&!readonly&&entrance!=='moreVersions'" icon="ibps-icon-release" type="primary" @click="handleSave('deploy')">发布新版本</el-button>
         </div>
-        <div
-          v-else-if="show==='detail'"
-        >
-          <detail
-            :id="formId"
-            ref="detail"
-            v-loading.fullscreen.lock="dialogLoading"
-            :element-loading-text="$t('common.loading')"
-            :form-data="curData"
-            :parent-data="parentData"
-            :action="action"
-            :bo-type="state"
-            :code="getcode"
-            :readonly="readonly"
-            :is-master="isMaster"
-            :toolbars="toolbars"
-            :tree-data="treeData"
-            :is-create-table="isCreateTable"
-            @change="changeData"
-            @check="checkCode"
-          />
-        </div>
-        <div
-          v-else
-        >
-          <el-alert
-            :closable="false"
-            title="请选择左边树进行左键或右键操作!"
-            type="warning"
-            show-icon
-            style="height:50px;"
-          />
-        </div>
-      </ibps-container>
-    </ibps-layout>
-  </el-dialog>
+        <ibps-layout ref="layout">
+            <div slot="west">
+                <ibps-tree
+                    ref="tree"
+                    v-loading="treeLoading"
+                    :element-loading-text="$t('common.loading')"
+                    :width="width"
+                    :height="height"
+                    :custom-zindex="customZindex"
+                    :data="treeData"
+                    :options="treeOptions"
+                    :show-icon="true"
+                    :contextmenus="treeContextmenus"
+                    title="业务对象管理"
+                    @action-event="handleTreeAction"
+                    @node-click="handleNodeClick"
+                    @expand-collapse="handleExpandCollapse"
+                />
+            </div>
+            <ibps-container style="margin-left: 10px;" class="page">
+                <div
+                    v-if="show==='step'"
+                    class="bo-content-detail"
+                >
+                    <step
+                        ref="step"
+                        :action="action"
+                        @step-action="handleStepAction"
+                        @complete="complete"
+                    />
+                </div>
+                <div
+                    v-else-if="show==='detail'"
+                >
+                    <detail
+                        :id="formId"
+                        ref="detail"
+                        v-loading.fullscreen.lock="dialogLoading"
+                        :element-loading-text="$t('common.loading')"
+                        :form-data="curData"
+                        :parent-data="parentData"
+                        :action="action"
+                        :bo-type="state"
+                        :code="getcode"
+                        :readonly="readonly"
+                        :is-master="isMaster"
+                        :toolbars="toolbars"
+                        :tree-data="treeData"
+                        :is-create-table="isCreateTable"
+                        @change="changeData"
+                        @check="checkCode"
+                    />
+                </div>
+                <div
+                    v-else
+                >
+                    <el-alert
+                        :closable="false"
+                        title="请选择左边树进行左键或右键操作!"
+                        type="warning"
+                        show-icon
+                        style="height:50px;"
+                    />
+                </div>
+            </ibps-container>
+        </ibps-layout>
+    </el-dialog>
 </template>
 
 <script>
@@ -94,774 +94,794 @@ import ActionUtils from '@/utils/action'
 import detail from './detail/index'
 import step from './detail/step'
 
-const uuid =()=>{
-  return  require('uuid').v1()
+const uuid = () => {
+    return require('uuid').v1()
 }
 
 export default {
-  components: {
-    step,
-    detail
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
+    components: {
+        step,
+        detail
     },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    entrance: String,
-    typeId: String,
-    id: String,
-    code: String,
-    title: String
-  },
-  data() {
-    return {
-      dialogVisible: false,
-      dialogLoading: false,
-      isMaster: true,
-      isAdd: false,
-      sameCode: false,
-      treeLoading: false,
-      isSame: {
-        boolean: false,
-        code: ''
-      },
-      isCreateTable: 'N',
-      toolbars: '',
-      tabName: '',
-      getcode: '',
-      height: 550,
-      width: 250,
-      customZindex: 2003,
-      treeData: [],
-      childrenKey: 'subBoDefs',
-      treeOptions: { 'rootPId': '0', showIcon: true, props: { children: 'subBoDefs', label: 'name' }},
-      treeContextmenus: [
-        {
-          icon: 'add',
-          label: '添加主业务对象',
-          value: 'add',
-          rights: function(menu, data, isRoot) {
-            if (data.subBoDefs && data.subBoDefs.length > 0) return false
-            if (data.id === '0') return true
-            return false
-          }
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-        { icon: 'add',
-          label: '添加下级业务对象',
-          value: 'addSub',
-          rights: (menu, data, isRoot) => {
-            if (this.nodeStatus(data, 'rights')) return true
-            if (isRoot) return true
-            if (data.id === '0') return false
-            if (data.level) return false
-            return false
-          } },
-        { icon: 'edit',
-          label: '编辑当前业务对象',
-          value: 'edit',
-          rights: function(menu, data, isRoot) {
-            if (isRoot) return true
-            if (data.id === '0') return false
-            return true
-          } },
-        { icon: 'remove',
-          label: '删除当前业务对象',
-          value: 'remove',
-          rights: function(menu, data, isRoot) {
-            if (isRoot) return true
-            if (data.id === '0') return false
-            return true
-          } }
-      ],
-      show: 'step', // 控制按钮
-      boType: '',
-      state: '',
-      tempTreeData: [],
-      action: 'add',
-      parentData: {},
-      curId: uuid(),
-      curData: {},
-
-      level: 0,
-      rootIndex: '',
-      defaultBoDef: {
-        name: '',
-        code: '',
-        boType: 'object',
-        dsName: '',
-        dsAlias: '',
-        tblName: '',
-        state: 'new',
-        status: '',
-        dataFormat: 'json',
-        pk: 'id',
-        id: uuid(),
-        fk: null,
-        fromAttr: null,
-        relation: 'one2many',
-        desc: '',
-        options: {
-          struType: 'list',
-          idKey: 'id',
-          pIdKey: 'id',
-          key: 'id'
+        readonly: {
+            type: Boolean,
+            default: false
         },
-        isMain: 'Y',
-        isMaster: 'Y',
-        attrs: defaultAttrs,
-        edit: true
-      }
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
+        entrance: String,
+        typeId: String,
+        id: String,
+        code: String,
+        title: String
     },
-    sameCodes() {
-      return this.sameCode
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
+    data () {
+        return {
+            dialogVisible: false,
+            dialogLoading: false,
+            isMaster: true,
+            isAdd: false,
+            sameCode: false,
+            treeLoading: false,
+            isSame: {
+                boolean: false,
+                code: ''
+            },
+            isCreateTable: 'N',
+            toolbars: '',
+            tabName: '',
+            getcode: '',
+            height: 550,
+            width: 250,
+            customZindex: 2003,
+            treeData: [],
+            childrenKey: 'subBoDefs',
+            treeOptions: { 'rootPId': '0', showIcon: true, props: { children: 'subBoDefs', label: 'name' }},
+            treeContextmenus: [
+                {
+                    icon: 'add',
+                    label: '添加主业务对象',
+                    value: 'add',
+                    rights: function (menu, data, isRoot) {
+                        if (data.subBoDefs && data.subBoDefs.length > 0) return false
+                        if (data.id === '0') return true
+                        return false
+                    }
+                },
+                {
+                    icon: 'add',
+                    label: '添加下级业务对象',
+                    value: 'addSub',
+                    rights: (menu, data, isRoot) => {
+                        if (this.nodeStatus(data, 'rights')) return true
+                        if (isRoot) return true
+                        if (data.id === '0') return false
+                        if (data.level) return false
+                        return false
+                    }
+                },
+                {
+                    icon: 'edit',
+                    label: '编辑当前业务对象',
+                    value: 'edit',
+                    rights: function (menu, data, isRoot) {
+                        if (isRoot) return true
+                        if (data.id === '0') return false
+                        return true
+                    }
+                },
+                {
+                    icon: 'remove',
+                    label: '删除当前业务对象',
+                    value: 'remove',
+                    rights: function (menu, data, isRoot) {
+                        if (isRoot) return true
+                        if (data.id === '0') return false
+                        return true
+                    }
+                }
+            ],
+            show: 'step', // 控制按钮
+            boType: '',
+            state: '',
+            tempTreeData: [],
+            action: 'add',
+            parentData: {},
+            curId: uuid(),
+            curData: {},
+
+            level: 0,
+            rootIndex: '',
+            defaultBoDef: {
+                name: '',
+                code: '',
+                boType: 'object',
+                dsName: '',
+                dsAlias: '',
+                tblName: '',
+                state: 'new',
+                status: '',
+                dataFormat: 'json',
+                pk: 'id',
+                id: uuid(),
+                fk: null,
+                fromAttr: null,
+                relation: 'one2many',
+                desc: '',
+                options: {
+                    struType: 'list',
+                    idKey: 'id',
+                    pIdKey: 'id',
+                    key: 'id'
+                },
+                isMain: 'Y',
+                isMaster: 'Y',
+                attrs: defaultAttrs,
+                edit: true
+            }
+        }
     },
-    typeId: {
-      handler: function(val) {
-        this.defaultBoDef.typeId = val
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.treeData = JSON.parse(JSON.stringify(rootData))
-    this.tempTreeData = JSON.parse(JSON.stringify(this.treeData))
-    this.contextmenus = this.treeContextmenus
-    // this.height = document.body.offsetHeight - 55
-  },
-  methods: {
-    // 树右键
-    handleTreeAction(command, position, selection, data) {
-      // if (this.sameCodes) {
-      //   this.$message({
-      //     message: '存在已有的业务对象标识,请重新填写!',
-      //     type: 'warning'
-      //   })
-      //   return
-      // }
-      // const validate = this.$refs['detail'] ? this.$refs['detail'].validate() : true
-      // if (!validate) {
-      //   ActionUtils.saveErrorMessage()
-      //   return
-      // }
-      if (position === 'toolbar') {
-        if (command === 'refresh') {
-          this.treeData = this.tempTreeData
+    computed: {
+        formId () {
+            return this.id
+        },
+        sameCodes () {
+            return this.sameCode
         }
-      } else {
-        this.isAdd = false
-        if (command === 'add') { // 添加主业务对象
-          this.show = 'step'
-          this.action = command
-          this.parentData = {}
-          if (this.$refs['step']) this.$refs['step'].resetFields()
-        } else if (command === 'addSub') { // 添加下级业务对象
-          this.sameCode = false
-          this.isAdd = true
-          this.show = 'step'
-          this.action = command
-          this.parentData = data // 父节点数据
-          if (this.$refs['step']) this.$refs['step'].resetFields()
-        } else if (command === 'edit') { // 编辑当前业务对象
-          this.show = 'detail'
-          this.action = command
-
-          this.getCurData(data.id)
-        } else if (command === 'remove') { // 删除当前业务对象
-          this.action = 'remove'
-          this.sameCode = false
-          this.$confirm('确定是否删除该业务对象?', '信息', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }).then(() => {
-            this.remove(data.id)
-            this.removeNode(data)
-          }).catch(() => {})
+    },
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        },
+        typeId: {
+            handler: function (val) {
+                this.defaultBoDef.typeId = val
+            },
+            immediate: true
         }
-      }
     },
+    created () {
+        this.treeData = JSON.parse(JSON.stringify(rootData))
+        this.tempTreeData = JSON.parse(JSON.stringify(this.treeData))
+        this.contextmenus = this.treeContextmenus
+    // this.height = document.body.offsetHeight - 55
+    },
+    methods: {
+        // 树右键
+        handleTreeAction (command, position, selection, data) {
+            // if (this.sameCodes) {
+            //     this.$message({
+            //         message: '存在已有的业务对象标识,请重新填写!',
+            //         type: 'warning'
+            //     })
+            //     return
+            // }
+            // const validate = this.$refs['detail'] ? this.$refs['detail'].validate() : true
+            // if (!validate) {
+            //     ActionUtils.saveErrorMessage()
+            //     return
+            // }
+            if (position === 'toolbar') {
+                if (command === 'refresh') {
+                    this.treeData = this.tempTreeData
+                }
+            } else {
+                this.isAdd = false
+                if (command === 'add') { // 添加主业务对象
+                    this.show = 'step'
+                    this.action = command
+                    this.parentData = {}
+                    if (this.$refs['step']) this.$refs['step'].resetFields()
+                } else if (command === 'addSub') { // 添加下级业务对象
+                    this.sameCode = false
+                    this.isAdd = true
+                    this.show = 'step'
+                    this.action = command
+                    this.parentData = data // 父节点数据
+                    if (this.$refs['step']) this.$refs['step'].resetFields()
+                } else if (command === 'edit') { // 编辑当前业务对象
+                    this.show = 'detail'
+                    this.action = command
 
-    // 节点状态
-    nodeStatus(value, use) {
-      const arr = []
-      let show = true
-      let isMaster = false
-      const childrenKey = this.childrenKey
-      if (value.id === '0') return
-      var filter = function(data) {
-        data.find(item => {
-          if (item[childrenKey] && item[childrenKey] !== []) {
-            if (item.code === undefined) {
-              item.code = '业务对象管理'
+                    this.getCurData(data.id)
+                } else if (command === 'remove') { // 删除当前业务对象
+                    this.action = 'remove'
+                    this.sameCode = false
+                    this.$confirm('确定是否删除该业务对象?', '信息', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        this.remove(data.id)
+                        this.removeNode(data)
+                    }).catch(() => {})
+                }
             }
-            arr.push(item[childrenKey])
-            filter(item[childrenKey])
-          }
-        })
-      }
-      filter(this.treeData)
-      let target = ''
-      if (this.$utils.isNotEmpty(value)) {
-        arr.forEach((p, i) => {
-          p.forEach((v, l) => {
-            if (v.id === value.id) {
-              target = i
+        },
+        // 节点状态
+        nodeStatus (value, use) {
+            const arr = []
+            let show = true
+            let isMaster = false
+            const childrenKey = this.childrenKey
+            if (value.id === '0') return
+            var filter = function (data) {
+                data.find(item => {
+                    if (item[childrenKey] && item[childrenKey] !== []) {
+                        if (item.code === undefined) {
+                            item.code = '业务对象管理'
+                        }
+                        arr.push(item[childrenKey])
+                        filter(item[childrenKey])
+                    }
+                })
             }
-          })
-        })
-        show = target <= 1
-        if (target === 0 || target === -1) {
-          isMaster = true
-        }
-      }
-      if (use === 'rights') {
-        return show
-      } else {
-        return isMaster
-      }
-    },
-    // 检测树是否存在重复节点。
-    checkSameNode(value, params) {
-      let isSame = false
-      this.isSame = {
-        boolean: false,
-        code: value.code
-      }
-      const childrenKey = this.childrenKey
-      const sanmeNode = (data, param) => {
-        data.find(item => {
-          if (param === 'boDef') {
-            if (item.id === value) {
-              isSame = true
-            } else {
-              if (item[childrenKey] && item[childrenKey] !== []) {
-                sanmeNode(item[childrenKey], 'boDef')
-              }
+            filter(this.treeData)
+            let target = ''
+            if (this.$utils.isNotEmpty(value)) {
+                arr.forEach((p, i) => {
+                    p.forEach((v, l) => {
+                        if (v.id === value.id) {
+                            target = i
+                        }
+                    })
+                })
+                show = target <= 1
+                if (target === 0 || target === -1) {
+                    isMaster = true
+                }
             }
-          } else if (param === 'external') {
-            if (item.code === value[0].tableName) {
-              isSame = true
+            if (use === 'rights') {
+                return show
             } else {
-              if (item[childrenKey] && item[childrenKey] !== []) {
-                sanmeNode(item[childrenKey], 'external')
-              }
+                return isMaster
+            }
+        },
+        // 检测树是否存在重复节点。
+        checkSameNode (value, params) {
+            let isSame = false
+            this.isSame = {
+                boolean: false,
+                code: value.code
+            }
+            const childrenKey = this.childrenKey
+            const sanmeNode = (data, param) => {
+                data.find(item => {
+                    if (param === 'boDef') {
+                        if (item.id === value) {
+                            isSame = true
+                        } else {
+                            if (item[childrenKey] && item[childrenKey] !== []) {
+                                sanmeNode(item[childrenKey], 'boDef')
+                            }
+                        }
+                    } else if (param === 'external') {
+                        if (item.code === value[0].tableName) {
+                            isSame = true
+                        } else {
+                            if (item[childrenKey] && item[childrenKey] !== []) {
+                                sanmeNode(item[childrenKey], 'external')
+                            }
+                        }
+                    } else {
+                        if ((item.code === value.code && item.id !== value.id) && (value.edit && value.status === '')) {
+                            isSame = true
+                            this.isSame.boolean = true
+                        } else {
+                            if (item[childrenKey] && item[childrenKey] !== []) {
+                                sanmeNode(item[childrenKey], 'new')
+                            }
+                        }
+                    }
+                })
+            }
+            sanmeNode(this.treeData, params)
+            return isSame
+        },
+        // Bo类型事件
+        handleStepAction (boType, value) {
+            this.boType = boType
+            this.toolbars = false
+            if (boType === 'external') {
+                this.toolbars = true
             }
-          } else {
-            if ((item.code === value.code && item.id !== value.id) && (value.edit && value.status === '')) {
-              isSame = true
-              this.isSame.boolean = true
+            let level = 1
+            if (this.parentData && this.parentData.isMain === 'Y') {
+                level = 2
+            } else if (this.parentData && this.parentData.isMain === 'N') {
+                level = 3
+            }
+            this.getCurData(null, level)
+            if (boType === 'new') {
+                this.show = 'detail'
             } else {
-              if (item[childrenKey] && item[childrenKey] !== []) {
-                sanmeNode(item[childrenKey], 'new')
-              }
+                if (boType === 'boDef') {
+                    if (this.checkSameNode(value, 'boDef')) {
+                        ActionUtils.warning('BO定义存在循环引用或层次混乱!')
+                        return
+                    }
+                    this.getBindForm(value, () => {
+                        this.show = 'detail'
+                    })
+                } else {
+                    this.show = 'step'
+                }
             }
-          }
-        })
-      }
-      sanmeNode(this.treeData, params)
-      return isSame
-    },
-    // Bo类型事件
-    handleStepAction(boType, value) {
-      this.boType = boType
-      this.toolbars = false
-      if (boType === 'external') {
-        this.toolbars = true
-      }
-      let level = 1
-      if (this.parentData && this.parentData.isMain === 'Y') {
-        level = 2
-      } else if (this.parentData && this.parentData.isMain === 'N') {
-        level = 3
-      }
-      this.getCurData(null, level)
-      if (boType === 'new') {
-        this.show = 'detail'
-      } else {
-        if (boType === 'boDef') {
-          if (this.checkSameNode(value, 'boDef')) {
-            ActionUtils.warning('BO定义存在循环引用或层次混乱!')
-            return
-          }
-          this.getBindForm(value, () => {
-            this.show = 'detail'
-          })
-        } else {
-          this.show = 'step'
-        }
-      }
-    },
-    // 现有BO
-    getBindForm(id, callback) {
-      getJson({ boDefId: id }).then(response => {
-        const data = response.data
-        data.options = JSON.parse(response.data.options)
-        const getJson = JSON.parse(JSON.stringify(this.defaultBoDef))
-        for (var i in getJson) {
-          getJson[i] = data[i]
-        }
-        getJson.attrs = data.attrList
-        getJson.relation = response.data.relation === null ? 'one2many' : response.data.relation
-        getJson.isMain = 'N'
-        getJson.isMaster = 'N'
-        getJson.edit = true
-        this.getcode = getJson.code
-        this.parentData[this.childrenKey] = getJson
-        this.changeData(getJson)
+        },
+        // 现有BO
+        getBindForm (id, callback) {
+            getJson({ boDefId: id }).then(response => {
+                const data = response.data
+                data.options = JSON.parse(response.data.options)
+                const getJson = JSON.parse(JSON.stringify(this.defaultBoDef))
+                for (var i in getJson) {
+                    getJson[i] = data[i]
+                }
+                getJson.attrs = data.attrList
+                getJson.relation = response.data.relation === null ? 'one2many' : response.data.relation
+                getJson.isMain = 'N'
+                getJson.isMaster = 'N'
+                getJson.edit = true
+                this.getcode = getJson.code
+                this.parentData[this.childrenKey] = getJson
+                this.changeData(getJson)
 
-        this.getCurData(getJson.id)
-        callback()
-      })
-    },
-    // 外部数据完成按钮
-    complete(paramArr) {
-      const arr = JSON.parse(paramArr)
-      const outCode = {}
-      outCode.boCode = arr[0].tableName
-      outCode.boDefId = uuid()
-      outCode.isMain = 'Y'
-      checkCode(outCode).then(response => {
-        if (response.data === true) {
-          if (this.checkSameNode(JSON.parse(paramArr), 'external')) {
+                this.getCurData(getJson.id)
+                callback()
+            })
+        },
+        // 外部数据完成按钮
+        complete (paramArr) {
             const arr = JSON.parse(paramArr)
-            ActionUtils.warning('业务对象的标识[' + arr[0].tableName + ']已存在了,请重新填写!')
-            return
-          }
+            const outCode = {}
+            outCode.boCode = arr[0].tableName
+            outCode.boDefId = uuid()
+            outCode.isMain = 'Y'
+            checkCode(outCode).then(response => {
+                if (response.data === true) {
+                    if (this.checkSameNode(JSON.parse(paramArr), 'external')) {
+                        const arr = JSON.parse(paramArr)
+                        ActionUtils.warning('业务对象的标识[' + arr[0].tableName + ']已存在了,请重新填写!')
+                        return
+                    }
 
-          getJsonByTbl({
-            boDefs: paramArr
-          }).then(response => {
-            const data = response.data
-            this.getcode = data.code
-            const temp = {
-              name: data.name,
-              tblName: arr[0].tableName,
-              code: data.code,
-              boType: 'out',
-              dataFormat: data.dataFormat,
-              dsName: data.dsName,
-              state: data.state,
-              status: data.status,
-              pk: data.pk,
-              fk: data.fk,
-              fromAttr: null,
-              desc: data.desc,
-              attrs: data.attrList,
-              options: {
-                struType: 'list',
-                idKey: 'id',
-                pIdKey: 'id',
-                key: 'id'
-              },
-              isMain: data.isMain ? data.isMain : this.$utils.isEmpty(this.treeData[0].subBoDefs) ? 'Y' : 'N',
-              isMaster: data.isMaster ? data.isMaster : 'Y',
-              relation: data.relation ? data.relation : 'one2many',
-              id: uuid(),
-              subBoDefs: [],
-              edit: true
+                    getJsonByTbl({
+                        boDefs: paramArr
+                    }).then(response => {
+                        const data = response.data
+                        this.getcode = data.code
+                        const temp = {
+                            name: data.name,
+                            tblName: arr[0].tableName,
+                            code: data.code,
+                            boType: 'out',
+                            dataFormat: data.dataFormat,
+                            dsName: data.dsName,
+                            state: data.state,
+                            status: data.status,
+                            pk: data.pk,
+                            fk: data.fk,
+                            fromAttr: null,
+                            desc: data.desc,
+                            attrs: data.attrList,
+                            options: {
+                                struType: 'list',
+                                idKey: 'id',
+                                pIdKey: 'id',
+                                key: 'id'
+                            },
+                            isMain: data.isMain ? data.isMain : this.$utils.isEmpty(this.treeData[0].subBoDefs) ? 'Y' : 'N',
+                            isMaster: data.isMaster ? data.isMaster : 'Y',
+                            relation: data.relation ? data.relation : 'one2many',
+                            id: uuid(),
+                            subBoDefs: [],
+                            edit: true
+                        }
+                        this.changeData(temp)
+                        this.getCurData(temp.id)
+                        this.show = 'detail'
+                    })
+                } else {
+                    ActionUtils.warning('业务对象的标识[' + arr[0].tableName + ']已存在了,请使用现有BO的方式添加!')
+                }
+            })
+        },
+        // 递归函数
+        getCurNode (id, level = -1) {
+            let curData = {}
+            let curId = id
+            const childrenKey = this.childrenKey
+            const findData = function (treeData) {
+                level++
+                treeData.find(data => {
+                    if (data.id === id) {
+                        curData = cloneDeep(data)
+                    } else {
+                        const children = data[childrenKey]
+                        if (children && children.length > 0) {
+                            findData(children)
+                        }
+                    }
+                })
             }
-            this.changeData(temp)
-            this.getCurData(temp.id)
-            this.show = 'detail'
-          })
-        } else {
-          ActionUtils.warning('业务对象的标识[' + arr[0].tableName + ']已存在了,请使用现有BO的方式添加!')
-        }
-      })
-    },
-    // 递归函数
-    getCurNode(id, level = -1) {
-      let curData = {}
-      let curId = id
-      const childrenKey = this.childrenKey
-      const findData = function(treeData) {
-        level++
-        treeData.find(data => {
-          if (data.id === id) {
-            curData = cloneDeep(data)
-          } else {
-            const children = data[childrenKey]
-            if (children && children.length > 0) {
-              findData(children)
+            if (this.$utils.isNotEmpty(id)) {
+                findData(this.treeData)
+                curId = id
+            } else {
+                curId = uuid()
+                const data = cloneDeep(this.defaultBoDef)
+                if (level === 1) {
+                    data.isMain = 'Y'
+                } else {
+                    data.isMain = 'N'
+                    data.attrs.splice(1, 0, subBoDefsAttrs)
+                }
+                data.id = curId
+                curData = data
             }
-          }
-        })
-      }
-      if (this.$utils.isNotEmpty(id)) {
-        findData(this.treeData)
-        curId = id
-      } else {
-        curId = uuid()
-        const data = cloneDeep(this.defaultBoDef)
-        if (level === 1) {
-          data.isMain = 'Y'
-        } else {
-          data.isMain = 'N'
-          data.attrs.splice(1, 0, subBoDefsAttrs)
-        }
-        data.id = curId
-        curData = data
-      }
-      return {
-        curData: curData,
-        curId: curId,
-        level: level
-      }
-    },
-    getCurData(id, level = -1) {
-      const obj = this.getCurNode(id, level)
-      this.isMaster = obj.level === 1 ? true : this.nodeStatus(obj.curData)
-      this.curData = obj.curData
-      this.curId = obj.curId
-      this.level = obj.level
-    },
-    remove(id) {
-      this.getCurData(id) // 删除属性的方法
-      this.handleNodeClick({ id: '0' }) // 回归提示状态
-    },
-    // 添加、编辑
-    handleNodeData(nodes, id, value) {
-      const curIndex = nodes.findIndex(i => i.id === id)
-      if (this.$utils.isEmpty(value)) {
-        nodes.splice(curIndex, 1)
-      } else {
-        if (curIndex > -1) {
-          nodes.splice(curIndex, 1, value)
-        } else {
-          if (value.name !== '') {
-            nodes.push(value)
-          }
-        }
-      }
-      return nodes
-    },
-    // 节点删除
-    removeNode(value) {
-      const childrenKey = this.childrenKey
-      var arr = function(data) {
-        data.find(item => {
-          if (item[childrenKey] && item[childrenKey] !== []) {
-            item[childrenKey].forEach((v, i) => {
-              if (v.id !== value.id) {
-                arr(item[childrenKey])
-              } else {
-                if (item[childrenKey].length === 1) {
-                  delete item[childrenKey]
+            return {
+                curData: curData,
+                curId: curId,
+                level: level
+            }
+        },
+        getCurData (id, level = -1) {
+            const obj = this.getCurNode(id, level)
+            this.isMaster = obj.level === 1 ? true : this.nodeStatus(obj.curData)
+            this.curData = obj.curData
+            this.curId = obj.curId
+            this.level = obj.level
+        },
+        remove (id) {
+            this.getCurData(id) // 删除属性的方法
+            this.handleNodeClick({ id: '0' }) // 回归提示状态
+        },
+        // 添加、编辑
+        handleNodeData (nodes, id, value) {
+            const curIndex = nodes.findIndex(i => i.id === id)
+            if (this.$utils.isEmpty(value)) {
+                nodes.splice(curIndex, 1)
+            } else {
+                if (curIndex > -1) {
+                    nodes.splice(curIndex, 1, value)
                 } else {
-                  item[childrenKey].splice(i, 1)
+                    if (value.name !== '') {
+                        nodes.push(value)
+                    }
                 }
-              }
-            })
-          }
-        })
-        return data
-      }
-      // arr(this.treeData)
-      this.tempTreeData = arr(this.treeData)
-      this.treeData = JSON.parse(JSON.stringify(this.tempTreeData))
-    },
-    // 添加数据
-    changeData(value, tabName) {
-      this.tabName = tabName
-      if (value.code === '' && value) {
-        return
-      } else if (this.checkSameNode(value, 'new') && this.tabName === 'basic-info') {
-        ActionUtils.warning('业务对象的标识[' + value.code + ']已存在了,请重新填写!')
-        return
-      }
-      const tempTreeData = JSON.parse(JSON.stringify(this.treeData))
-      const first = 0
-      let second = ''
-      // 第一级
-      if (this.level === 1) {
-        const childrens = tempTreeData[0][this.childrenKey] || []
-        tempTreeData[0][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
-      } else if (this.level === 2) {
-      // 第二级
+            }
+            return nodes
+        },
+        // 节点删除
+        removeNode (value) {
+            const childrenKey = this.childrenKey
+            var arr = function (data) {
+                data.find(item => {
+                    if (item[childrenKey] && item[childrenKey] !== []) {
+                        item[childrenKey].forEach((v, i) => {
+                            if (v.id !== value.id) {
+                                arr(item[childrenKey])
+                            } else {
+                                if (item[childrenKey].length === 1) {
+                                    delete item[childrenKey]
+                                } else {
+                                    item[childrenKey].splice(i, 1)
+                                }
+                            }
+                        })
+                    }
+                })
+                return data
+            }
+            // arr(this.treeData)
+            this.tempTreeData = arr(this.treeData)
+            this.treeData = JSON.parse(JSON.stringify(this.tempTreeData))
+        },
+        // 添加数据
+        changeData (value, tabName) {
+            this.tabName = tabName
+            if (value.code === '' && value) {
+                return
+            } else if (this.checkSameNode(value, 'new') && this.tabName === 'basic-info') {
+                ActionUtils.warning('业务对象的标识[' + value.code + ']已存在了,请重新填写!')
+                return
+            }
+            const tempTreeData = JSON.parse(JSON.stringify(this.treeData))
+            const first = 0
+            let second = ''
+            // 第一级
+            if (this.level === 1) {
+                const childrens = tempTreeData[0][this.childrenKey] || []
+                tempTreeData[0][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
+            } else if (this.level === 2) {
+                // 第二级
 
-        const childrens = tempTreeData[0][this.childrenKey][first][this.childrenKey] || []
-        tempTreeData[0][this.childrenKey][first][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
-      } else if (this.level === 3) {
-      // 第三级
-        if (value !== undefined) {
-          second = tempTreeData[0][this.childrenKey][first][this.childrenKey].findIndex(i => i.id === this.parentData.id)
-          const index = tempTreeData[0][this.childrenKey][first][this.childrenKey].findIndex(i => i.id === value.id)
-          if (index > -1) {
-            const rootData = tempTreeData[0][this.childrenKey][first][this.childrenKey]
-            tempTreeData[0][this.childrenKey][first][this.childrenKey] = this.handleNodeData(rootData, this.curId, value)
-          } else {
-            const childrens = tempTreeData[0][this.childrenKey][first][this.childrenKey][second][this.childrenKey] || []
-            tempTreeData[0][this.childrenKey][first][this.childrenKey][second][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
-          }
-        }
-      } else if (this.level >= 4) {
-      // 第 N 级
-        if (value !== undefined) {
-          const arr = tempTreeData[0][this.childrenKey][first][this.childrenKey]
-          let index
-          arr.forEach((v, i) => {
-            if (v[this.childrenKey] && v[this.childrenKey].length > 0) {
-              v[this.childrenKey].forEach(l => {
-                if (l.id === value.id) {
-                  index = i
+                const childrens = tempTreeData[0][this.childrenKey][first][this.childrenKey] || []
+                tempTreeData[0][this.childrenKey][first][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
+            } else if (this.level === 3) {
+                // 第三级
+                if (value !== undefined) {
+                    second = tempTreeData[0][this.childrenKey][first][this.childrenKey].findIndex(i => i.id === this.parentData.id)
+                    const index = tempTreeData[0][this.childrenKey][first][this.childrenKey].findIndex(i => i.id === value.id)
+                    if (index > -1) {
+                        const rootData = tempTreeData[0][this.childrenKey][first][this.childrenKey]
+                        tempTreeData[0][this.childrenKey][first][this.childrenKey] = this.handleNodeData(rootData, this.curId, value)
+                    } else {
+                        const childrens = tempTreeData[0][this.childrenKey][first][this.childrenKey][second][this.childrenKey] || []
+                        tempTreeData[0][this.childrenKey][first][this.childrenKey][second][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
+                    }
+                }
+            } else if (this.level >= 4) {
+                // 第 N 级
+                if (value !== undefined) {
+                    const arr = tempTreeData[0][this.childrenKey][first][this.childrenKey]
+                    let index
+                    arr.forEach((v, i) => {
+                        if (v[this.childrenKey] && v[this.childrenKey].length > 0) {
+                            v[this.childrenKey].forEach(l => {
+                                if (l.id === value.id) {
+                                    index = i
+                                }
+                            })
+                        }
+                    })
+                    if (index > -1) {
+                        const childrens = tempTreeData[0][this.childrenKey][first][this.childrenKey][index][this.childrenKey] || []
+                        tempTreeData[0][this.childrenKey][first][this.childrenKey][index][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
+                    } else {
+                        const rootData = tempTreeData[0][this.childrenKey][first][this.childrenKey]
+                        tempTreeData[0][this.childrenKey][first][this.childrenKey] = this.handleNodeData(rootData, this.curId, value)
+                    }
                 }
-              })
             }
-          })
-          if (index > -1) {
-            const childrens = tempTreeData[0][this.childrenKey][first][this.childrenKey][index][this.childrenKey] || []
-            tempTreeData[0][this.childrenKey][first][this.childrenKey][index][this.childrenKey] = this.handleNodeData(childrens, this.curId, value)
-          } else {
-            const rootData = tempTreeData[0][this.childrenKey][first][this.childrenKey]
-            tempTreeData[0][this.childrenKey][first][this.childrenKey] = this.handleNodeData(rootData, this.curId, value)
-          }
-        }
-      }
-      this.treeData = JSON.parse(JSON.stringify(tempTreeData))
-      this.tempTreeData = JSON.parse(JSON.stringify(tempTreeData))
-    },
-    // 点击节点
-    handleNodeClick(data) {
-      // if ((this.sameCodes || this.isSame.boolean) && this.tabName === 'basic-info') {
-      //   this.$message({
-      //     message: '业务对象的标识[' + this.isSame.code + ']已存在了,请重新填写!',
-      //     type: 'warning'
-      //   })
-      //   return
-      // }
-      // const validate = this.$refs['detail'] ? this.$refs['detail'].validate() : true
-      // if (!validate) {
-      //   ActionUtils.saveErrorMessage()
-      //   return
-      // }
-      this.state = data.state
-      this.getParentObjAttr(data)
-      this.isMaster = this.nodeStatus(data)
-      if (data.id === '0') {
-        this.show = 'none'
-        this.curId = ''
-        this.curData = {}
-        this.level = -1
-      } else {
-        this.show = 'none'
-        if (this.$utils.isEmpty(data.dsName)) {
-          this.toolbars = false
-        } else {
-          this.toolbars = true
-        }
-        setTimeout(() => {
-          this.show = 'detail'
-          this.action = 'edit'
+            this.treeData = JSON.parse(JSON.stringify(tempTreeData))
+            this.tempTreeData = JSON.parse(JSON.stringify(tempTreeData))
+        },
+        // 点击节点
+        handleNodeClick (data) {
+            // if ((this.sameCodes || this.isSame.boolean) && this.tabName === 'basic-info') {
+            //     this.$message({
+            //         message: '业务对象的标识[' + this.isSame.code + ']已存在了,请重新填写!',
+            //         type: 'warning'
+            //     })
+            //     return
+            // }
+            // const validate = this.$refs['detail'] ? this.$refs['detail'].validate() : true
+            // if (!validate) {
+            //     ActionUtils.saveErrorMessage()
+            //     return
+            // }
+            this.state = data.state
+            this.getParentObjAttr(data)
+            this.isMaster = this.nodeStatus(data)
+            if (data.id === '0') {
+                this.show = 'none'
+                this.curId = ''
+                this.curData = {}
+                this.level = -1
+            } else {
+                this.show = 'none'
+                if (this.$utils.isEmpty(data.dsName)) {
+                    this.toolbars = false
+                } else {
+                    this.toolbars = true
+                }
+                setTimeout(() => {
+                    this.show = 'detail'
+                    this.action = 'edit'
 
-          this.getCurData(data.id)
-          if (data.isMain === undefined) {
-            this.toolbars = true
-          } else {
-            this.toolbars = this.readonly
-          }
-        }, 0)
-      }
-    },
-    // 获取父节点对象属性
-    getParentObjAttr(value) {
-      const arr = []
-      const childrenKey = this.childrenKey
-      var filter = function(data) {
-        data.find(item => {
-          if (item[childrenKey] && item[childrenKey] !== []) {
-            arr.push(item)
-            filter(item[childrenKey])
-          }
-        })
-      }
-      filter(this.treeData)
-      arr.forEach((v, i) => {
-        v.subBoDefs.forEach((p, l) => {
-          if (p.id === value.id) {
-            this.parentData = arr[i]
-          }
-        })
-      })
-    },
-    handleExpandCollapse(isExpand) {
-      this.width = isExpand ? 250 : 30
-    },
-    // 保存数据
-    handleSave(saveType) {
-      this.saveData(saveType)
-    },
-    checkCode(boolean, sameNode) {
-      this.sameCode = boolean
-      if (this.sameCode) {
-        this.removeNode(sameNode)
-      }
-    },
-    // 提交保存数据
-    saveData(saveType) {
-      if (this.$utils.isEmpty(this.treeData[0].subBoDefs)) {
-        ActionUtils.warning('请设置主对象')
-        return
-      }
-      if (this.treeData[0].subBoDefs !== undefined || this.treeData[0].subBoDefs.length === 1) {
-        this.sameCode = false
-      }
-      if (this.sameCodes) {
-        ActionUtils.warning('业务对象标识已存在')
-        return
-      }
-      const validate = this.$refs['detail'] ? this.$refs['detail'].validate() : true
-      if (!validate) {
-        ActionUtils.saveErrorMessage()
-        return
-      }
-      this.isAddSub = false
-      const index = this.treeData[0].subBoDefs.findIndex(i => i.isMain === 'Y')
-      const obj = this.treeData[0].subBoDefs[index]
-      if (saveType === 'deploy') {
-        obj.attrs.forEach(v => {
-          masterAttrs.desc = v.name
-          Object.assign(v, masterAttrs)
-        })
-      }
-      const data = JSON.stringify(this.treeData[0].subBoDefs)
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      save({
-        boDefs: data,
-        saveType: saveType
-      }).then(response => {
-        ActionUtils.successMessage(response.message)
-        loading.close()
-        this.$emit('callback', this)
-        this.closeDialog()
-      }).catch((err) => {
-        loading.close()
-        console.error(err)
-      })
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.showBo = false
-      this.tip = 'tip'
-      this.action = 'add'
-      this.tabName = ''
-      this.treeContextmenus = this.contextmenus
-      this.tempTreeData = JSON.parse(JSON.stringify(rootData))
-      this.$emit('close', false)
-      if (this.$refs['step']) this.$refs['step'].resetFields()
-      if (this.$refs['detail']) this.$refs['detail'].initActive('basic-info')
-    },
-    getFormData() {
-      this.$nextTick(() => {
-        // 处理右键菜单层级问题
-        const dialogZindex = parseInt(this.$refs['defDialog'].$el.style['z-index'])
-        this.customZindex = dialogZindex + 1
-      })
-      if (this.$utils.isEmpty(this.formId)) {
-        this.show = 'step'
-        this.isCreateTable = 'N'
-        this.parentData = {}
-        this.treeData = JSON.parse(JSON.stringify(rootData))
-      } else {
-        this.show = 'detail'
-        this.dialogLoading = true
-        manage({
-          boDefId: this.id
-        }).then(response => {
-          this.toolbars = false
-          if (this.readonly) {
-            this.toolbars = true
-            this.treeContextmenus = []
-          }
-          const responseData = response.data
-          const data = this.$utils.parseJSON(responseData)
-          this.treeData[0][this.childrenKey] = [data]
-          this.isCreateTable = data ? data.isCreateTable : false
-          this.getCurData(this.id)
-          this.dialogLoading = false
-        }).catch(() => {
-          this.dialogLoading = false
-        })
-      }
+                    this.getCurData(data.id)
+                    if (data.isMain === undefined) {
+                        this.toolbars = true
+                    } else {
+                        this.toolbars = this.readonly
+                    }
+                }, 0)
+            }
+        },
+        // 获取父节点对象属性
+        getParentObjAttr (value) {
+            const arr = []
+            const childrenKey = this.childrenKey
+            var filter = function (data) {
+                data.find(item => {
+                    if (item[childrenKey] && item[childrenKey] !== []) {
+                        arr.push(item)
+                        filter(item[childrenKey])
+                    }
+                })
+            }
+            filter(this.treeData)
+            arr.forEach((v, i) => {
+                v.subBoDefs.forEach((p, l) => {
+                    if (p.id === value.id) {
+                        this.parentData = arr[i]
+                    }
+                })
+            })
+        },
+        handleExpandCollapse (isExpand) {
+            this.width = isExpand ? 250 : 30
+        },
+        // 保存数据
+        handleSave (saveType) {
+            this.saveData(saveType)
+        },
+        checkCode (boolean, sameNode) {
+            this.sameCode = boolean
+            if (this.sameCode) {
+                this.removeNode(sameNode)
+            }
+        },
+        // 提交保存数据
+        saveData (saveType) {
+            if (this.$utils.isEmpty(this.treeData[0].subBoDefs)) {
+                ActionUtils.warning('请设置主对象')
+                return
+            }
+            if (this.treeData[0].subBoDefs !== undefined || this.treeData[0].subBoDefs.length === 1) {
+                this.sameCode = false
+            }
+            if (this.sameCodes) {
+                ActionUtils.warning('业务对象标识已存在')
+                return
+            }
+            const validate = this.$refs['detail'] ? this.$refs['detail'].validate() : true
+            if (!validate) {
+                ActionUtils.saveErrorMessage()
+                return
+            }
+            this.isAddSub = false
+            const index = this.treeData[0].subBoDefs.findIndex(i => i.isMain === 'Y')
+            const obj = this.treeData[0].subBoDefs[index]
+            if (saveType === 'deploy') {
+                let isConfirm = false
+                this.$confirm(`<span style="color:#f56c6c; font-size: 18px; font-weight: 600;">请确保您不是误操作并知晓发布新版将会导致的后果!</span>`, '提示', {
+                    confirmButtonText: '我已确认',
+                    cancelButtonText: '取消',
+                    showClose: false,
+                    closeOnClickModal: false,
+                    dangerouslyUseHTMLString: true
+                }).then(() => {
+                    isConfirm = true
+                    obj.attrs.forEach(v => {
+                        masterAttrs.desc = v.name
+                        Object.assign(v, masterAttrs)
+                    })
+                }).catch(() => {
+                    return
+                })
+                if (!isConfirm) {
+                    return
+                }
+            }
+            const data = JSON.stringify(this.treeData[0].subBoDefs)
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
+            })
+            save({
+                boDefs: data,
+                saveType: saveType
+            }).then(response => {
+                ActionUtils.successMessage(response.message)
+                loading.close()
+                this.$emit('callback', this)
+                this.closeDialog()
+            }).catch((err) => {
+                loading.close()
+                console.error(err)
+            })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.showBo = false
+            this.tip = 'tip'
+            this.action = 'add'
+            this.tabName = ''
+            this.treeContextmenus = this.contextmenus
+            this.tempTreeData = JSON.parse(JSON.stringify(rootData))
+            this.$emit('close', false)
+            if (this.$refs['step']) this.$refs['step'].resetFields()
+            if (this.$refs['detail']) this.$refs['detail'].initActive('basic-info')
+        },
+        getFormData () {
+            this.$nextTick(() => {
+                // 处理右键菜单层级问题
+                const dialogZindex = parseInt(this.$refs['defDialog'].$el.style['z-index'])
+                this.customZindex = dialogZindex + 1
+            })
+            if (this.$utils.isEmpty(this.formId)) {
+                this.show = 'step'
+                this.isCreateTable = 'N'
+                this.parentData = {}
+                this.treeData = JSON.parse(JSON.stringify(rootData))
+            } else {
+                this.show = 'detail'
+                this.dialogLoading = true
+                manage({
+                    boDefId: this.id
+                }).then(response => {
+                    this.toolbars = false
+                    if (this.readonly) {
+                        this.toolbars = true
+                        this.treeContextmenus = []
+                    }
+                    const responseData = response.data
+                    const data = this.$utils.parseJSON(responseData)
+                    this.treeData[0][this.childrenKey] = [data]
+                    this.isCreateTable = data ? data.isCreateTable : false
+                    this.getCurData(this.id)
+                    this.dialogLoading = false
+                }).catch(() => {
+                    this.dialogLoading = false
+                })
+            }
+        }
     }
-  }
 }
 </script>
 <style lang="scss">
-$rootBorder:1px solid #ebeef5;
-.bo-def-dialog{
-  .el-dialog__header{
-    padding: 5px;
-    background-color: #f5f5f7;
-  }
-  .el-dialog--left{
-      position: relative;
-    .shade{
-    position: absolute;
-    display: inline-block;
-    width: 185px;
-    height: 35px;
-    left: 100px;
-    }
-  }
-  .ibps-tree-main{
-    border:1px solid #e0e3e9;
-  }
-  .el-scrollbar{
-    border-bottom: $rootBorder;
-  }
-  .el-dialog__body{
-    padding:9px 20px !important;
-    height: 94%;
-    .ibps-layout{
-      height: 100%;
-      .ibps-layout_west{
-        div{
-          .ibps-tree{
-            height: 100%;
-            .ibps-tree-main{
-              height:calc(100vh - 140px) !important;;
+$rootBorder: 1px solid #ebeef5;
+    .bo-def-dialog {
+        .el-dialog__header {
+            padding: 5px;
+            background-color: #f5f5f7;
+        }
+        .el-dialog--left {
+            position: relative;
+            .shade {
+                position: absolute;
+                display: inline-block;
+                width: 185px;
+                height: 35px;
+                left: 100px;
+            }
+        }
+        .ibps-tree-main {
+            border: 1px solid #e0e3e9;
+        }
+        .el-scrollbar {
+            border-bottom: $rootBorder;
+        }
+        .el-dialog__body {
+            padding: 9px 20px !important;
+            height: 94%;
+            .ibps-layout {
+                height: 100%;
+                .ibps-layout_west {
+                    div {
+                        .ibps-tree {
+                            height: 100%;
+                            .ibps-tree-main {
+                                height: calc(100vh - 140px) !important;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        .el-steps--horizontal {
+            border-bottom: $rootBorder;
+        }
+        .bo-content-detail-form {
+            margin-top: 15px;
+            .el-form-item {
+                margin-bottom: 0;
+            }
+            .formFooter {
+                width: 185px;
+                margin: 0 auto;
+                .rightBottom {
+                    margin-left: 5px;
+                }
             }
-          }
         }
-      }
-    }
-  }
-  .el-steps--horizontal{
-    border-bottom: $rootBorder;
-  }
-  .bo-content-detail-form{
-     margin-top: 15px;
-    .el-form-item{
-      margin-bottom: 0;
-    }
-    .formFooter{
-      width: 185px;
-      margin: 0 auto;
-      .rightBottom{
-        margin-left: 5px;
-      }
     }
-  }
-}
 </style>

+ 699 - 695
src/views/platform/bpmn/bpmDef/design.vue

@@ -1,119 +1,119 @@
 <template>
-  <el-dialog
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    fullscreen
-    append-to-body
-    class="bpmn-def-design-dialog"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <div slot="title" class="ibps-pl-5">
-      <el-button icon="el-icon-circle-close" class="ibps-ml-5" @click="closeDialog()">关闭</el-button>
-      <template v-if="$utils.isEmpty(id)||status==='draft'">
-        <el-button type="primary" icon="ibps-icon-save" class="ibps-ml-5" @click="handleSave(true,false)">发布</el-button>
-        <el-button type="primary" icon="ibps-icon-clipboard" class="ibps-ml-5" @click="handleSave(false,false)">保存草稿</el-button>
-      </template>
-      <template v-else>
-        <el-button type="primary" icon="ibps-icon-save" class="ibps-ml-5" @click="handleSave(true,false)">保存</el-button>
-        <!-- <el-button type="primary" icon="ibps-icon-clipboard" class="ibps-ml-5" @click="handleSave(true,true)">发布新版本</el-button> -->
-      </template>
-      <el-upload
-        ref="upload"
-        :auto-upload="false"
-        :show-file-list="false"
-        :on-change="handleImport"
-        style="display: inline-block;"
-        class="ibps-ml-5"
-        action="http://www.bpmhome.cn/posts/"
-      >
-        <el-button slot="trigger" type="primary" icon="ibps-icon-import">导入BPMN</el-button>
-      </el-upload>
-      <el-button type="primary" icon="ibps-icon-export" class="ibps-ml-5" @click="handleExportBPMN()">导出BPMN</el-button>
-      <el-button type="primary" icon="ibps-icon-file-code-o" class="ibps-ml-5" @click="handleExportSVG()">导出SVG</el-button>
-
-      <i class=" el-icon-warning" style="font-size:12px;margin-left:5px;color:#E6A23C;">点击空白处设置流程定义。</i>
-    </div>
-    <div
-      v-if="dialogVisible"
-      id="js-drop-zone"
-      v-loading.fullscreen.lock="dialogLoading"
-      :element-loading-text="$t('common.loading')"
-      class="content with-diagram"
+    <el-dialog
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        fullscreen
+        append-to-body
+        class="bpmn-def-design-dialog"
+        @open="getFormData"
+        @close="closeDialog"
     >
-      <div class="message intro">
-        <div class="note">
-          从你的桌面拖拽或
-          <a id="js-create-diagram" href>新建</a>BPM 流程图.
+        <div slot="title" class="ibps-pl-5">
+            <el-button icon="el-icon-circle-close" class="ibps-ml-5" @click="closeDialog()">关闭</el-button>
+            <template v-if="$utils.isEmpty(id)||status==='draft'">
+                <el-button type="primary" icon="ibps-icon-save" class="ibps-ml-5" @click="handleSave(true,false)">发布</el-button>
+                <el-button type="primary" icon="ibps-icon-clipboard" class="ibps-ml-5" @click="handleSave(false,false)">保存草稿</el-button>
+            </template>
+            <template v-else>
+                <el-button type="primary" icon="ibps-icon-save" class="ibps-ml-5" @click="handleSave(true,false)">保存</el-button>
+                <el-button type="primary" icon="ibps-icon-clipboard" class="ibps-ml-5" @click="handleSave(true,true)">发布新版本</el-button>
+            </template>
+            <el-upload
+                ref="upload"
+                :auto-upload="false"
+                :show-file-list="false"
+                :on-change="handleImport"
+                style="display: inline-block;"
+                class="ibps-ml-5"
+                action="http://www.bpmhome.cn/posts/"
+            >
+                <el-button slot="trigger" type="primary" icon="ibps-icon-import">导入BPMN</el-button>
+            </el-upload>
+            <el-button type="primary" icon="ibps-icon-export" class="ibps-ml-5" @click="handleExportBPMN()">导出BPMN</el-button>
+            <el-button type="primary" icon="ibps-icon-file-code-o" class="ibps-ml-5" @click="handleExportSVG()">导出SVG</el-button>
+
+            <i class=" el-icon-warning" style="font-size:12px;margin-left:5px;color:#E6A23C;">点击空白处设置流程定义。</i>
         </div>
-      </div>
-
-      <div class="message error">
-        <div class="note">
-          <p>Ooops, we could not display the BPMN 2.0 diagram.</p>
-          <div class="details">
-            <span>Import Error Details</span>
-            <pre />
-          </div>
-        </div>
-      </div>
-      <div id="js-canvas" class="canvas" />
-      <!--属性面板-->
-      <div class="properties-container">
         <div
-          :style="{right:(propertiesVisible?'355px':'-45px')}"
-          class="toggle"
-          @click="handleProperties"
+            v-if="dialogVisible"
+            id="js-drop-zone"
+            v-loading.fullscreen.lock="dialogLoading"
+            :element-loading-text="$t('common.loading')"
+            class="content with-diagram"
         >
-          属性面板
+            <div class="message intro">
+                <div class="note">
+                    从你的桌面拖拽或
+                    <a id="js-create-diagram" href>新建</a>BPM 流程图.
+                </div>
+            </div>
+
+            <div class="message error">
+                <div class="note">
+                    <p>Ooops, we could not display the BPMN 2.0 diagram.</p>
+                    <div class="details">
+                        <span>Import Error Details</span>
+                        <pre />
+                    </div>
+                </div>
+            </div>
+            <div id="js-canvas" class="canvas" />
+            <!--属性面板-->
+            <div class="properties-container">
+                <div
+                    :style="{right:(propertiesVisible?'355px':'-45px')}"
+                    class="toggle"
+                    @click="handleProperties"
+                >
+                    属性面板
+                </div>
+                <div
+                    v-show="propertiesVisible"
+                    id="js-properties-panel"
+                    class="properties-panel-parent"
+                />
+            </div>
+
+            <!--工具栏-->
+            <div class="io-zoom-controls">
+                <ul class="io-zoom io-control io-control-list io-horizontal">
+                    <li>
+                        <button title="小地图" @click="handleMiniMap">
+                            <i class="ibps-icon-map-o " />
+                        </button>
+                    </li>
+                    <li>
+                        <button title="快捷键" @click="handleKeyboard">
+                            <i class="ibps-icon-keyboard-o " />
+                        </button>
+                    </li>
+                    <li class="hr">
+                        <button title="重置缩放" @click="handleZoomReset">
+                            <i class="ibps-icon-crosshairs " />
+                        </button>
+                    </li>
+                    <li>
+                        <button title="放大" @click="handleZoomIn">
+                            <i class="ibps-icon-plus" />
+                        </button>
+                    </li>
+                    <li>
+                        <button title="缩小" @click="handleZoomOut">
+                            <i class="ibps-icon-minus" />
+                        </button>
+                    </li>
+                </ul>
+            </div>
         </div>
-        <div
-          v-show="propertiesVisible"
-          id="js-properties-panel"
-          class="properties-panel-parent"
+        <bpmn-definition-selector-dialog
+            v-model="selectorValue"
+            :visible="selectorVisible"
+            :multiple="false"
+            @close="visible => selectorVisible = visible"
+            @action-event="handleSelectorActionEvent"
         />
-      </div>
-
-      <!--工具栏-->
-      <div class="io-zoom-controls">
-        <ul class="io-zoom io-control io-control-list io-horizontal">
-          <li>
-            <button title="小地图" @click="handleMiniMap">
-              <i class="ibps-icon-map-o " />
-            </button>
-          </li>
-          <li>
-            <button title="快捷键" @click="handleKeyboard">
-              <i class="ibps-icon-keyboard-o " />
-            </button>
-          </li>
-          <li class="hr">
-            <button title="重置缩放" @click="handleZoomReset">
-              <i class="ibps-icon-crosshairs " />
-            </button>
-          </li>
-          <li>
-            <button title="放大" @click="handleZoomIn">
-              <i class="ibps-icon-plus" />
-            </button>
-          </li>
-          <li>
-            <button title="缩小" @click="handleZoomOut">
-              <i class="ibps-icon-minus" />
-            </button>
-          </li>
-        </ul>
-      </div>
-    </div>
-    <bpmn-definition-selector-dialog
-      v-model="selectorValue"
-      :visible="selectorVisible"
-      :multiple="false"
-      @close="visible => selectorVisible = visible"
-      @action-event="handleSelectorActionEvent"
-    />
-  </el-dialog>
+    </el-dialog>
 </template>
 
 <script>
@@ -139,622 +139,626 @@ import PropertiesProviderModule from '@/business/platform/bpmn/bpmn-js/propertie
 import CamundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda'
 import Ids from 'ids'
 var ibpsBpmnDesign = window.ibpsBpmnDesign = {
-  canEdit: true
+    canEdit: true
 }
 
 export default {
-  components: {
-    BpmnDefinitionSelectorDialog
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
+    components: {
+        BpmnDefinitionSelectorDialog
     },
-    status: String,
-    id: String,
-    typeId: String,
-    title: String
-  },
-  data() {
-    return {
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      minimap: false,
-      propertiesVisible: true,
-      bpmnModeler: null,
-      selectorVisible: false,
-      selectorValue: {},
-      selectSubProcess: null
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    initUI() {
-      // 当前窗口高度
-      const height = window.innerHeight - 55
-      this.bpmnModeler = new BpmnModeler({
-        container: '#js-canvas',
-        height: height,
-        propertiesPanel: {
-          parent: '#js-properties-panel'
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-        keyboard: {
-          bindTo: document
+        readonly: {
+            type: Boolean,
+            default: false
         },
-        additionalModules: [
-          TranslateModule,
-          DiagramJsOrigin,
-          MinimapModule,
-          BpmnJsInColor,
-          PropertiesPanelModule,
-          PropertiesProviderModule
-        ],
-        moddleExtensions: {
-          camunda: CamundaModdleDescriptor
-        }
-      })
-
-      // check file api availability
-      if (!window.FileList || !window.FileReader) {
-        this.$alert('Looks like you use an older browser that does not support drag and drop. ' + 'Try using Chrome, Firefox or the Internet Explorer > 10.')
-      } else {
-        this.registerFileDrop(document.getElementById('js-canvas'), (xml) => {
-          return this.openDiagram(xml)
-        })
-      }
-      const container = document.getElementById('js-properties-panel')
-      container.addEventListener('click', (e) => {
-        if (e.target && e.target.id === 'selectSubProcess') {
-          this.selectorValue = {}
-          this.selectorVisible = true
-          this.selectSubProcess = e.target.parentNode.parentNode.childNodes[1].children[0]
-        }
-      })
-    },
-    registerFileDrop(container, callback) {
-      const _this = this
-      function handleFileSelect(e) {
-        e.stopPropagation()
-        e.preventDefault()
-        const files = e.dataTransfer.files
-        _this.handleImportFile(true, files[0], callback)
-      }
-      function handleDragOver(e) {
-        e.stopPropagation()
-        e.preventDefault()
-        e.dataTransfer.dropEffect = 'copy' // Explicitly show this is a copy.
-      }
-
-      container.addEventListener('dragover', handleDragOver, false)
-      container.addEventListener('drop', handleFileSelect, false)
+        status: String,
+        id: String,
+        typeId: String,
+        title: String
     },
-    handleImportFile(isConfirm, file, callback) {
-      if (!file) { return }
-      if (file.name.indexOf('.bpmn') === -1) {
-        this.$alert('请选择bpmn文件导入')
-        return
-      }
-      if (isConfirm) {
-        this.$confirm('是否加载导入的文件', '提示').then(() => {
-          this.importFile(file, callback)
-        }).catch(() => { })
-      } else {
-        this.importFile(file, callback)
-      }
-    },
-    importFile(file, callback) {
-      const reader = new FileReader()
-      const _this = this
-      reader.onload = function(e) {
-        const xml = e.target.result
-        if (callback) {
-          callback(xml)
-        } else {
-          _this.openDiagram(xml)
+    data () {
+        return {
+            dialogVisible: this.visible,
+            dialogLoading: false,
+            minimap: false,
+            propertiesVisible: true,
+            bpmnModeler: null,
+            selectorVisible: false,
+            selectorValue: {},
+            selectSubProcess: null
         }
-      }
-      if (file) { reader.readAsText(file) }
-    },
-    async openDiagram(xml) {
-      try {
-        await this.bpmnModeler.importXML(xml)
-      } catch (err) {
-        console.log(err.message, err.warnings)
-      }
-    },
-
-    async getBpmnXml(done) {
-      // 如果正在编辑
-      const directEditing = this.bpmnModeler.get('directEditing')
-      if (directEditing && directEditing.isActive()) {
-        directEditing.complete()
-      }
-      const options = { format: false }
-      try {
-        const result = await this.bpmnModeler.saveXML(options)
-        const { err, xml } = result
-        done(err, xml)
-      } catch (err) {
-        console.log(err)
-      }
-    },
-    setEncoded(name, data) {
-      if (data) {
-        const encodedData = encodeURIComponent(data)
-        const elink = document.createElement('a')
-        elink.download = name
-        elink.style.display = 'none'
-        elink.href = 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData
-        document.body.appendChild(elink)
-        elink.click()
-        URL.revokeObjectURL(elink.href) // 释放URL 对象
-        document.body.removeChild(elink)
-      }
-    },
-    getNowFormatDate() {
-      return fecha.formatDate('yyyyMMddHHmmss')
-    },
-    handleImport(file) {
-      this.handleImportFile(false, file.raw)
-    },
-    handleExportBPMN() {
-      this.getBpmnXml((err, xml) => {
-        this.setEncoded('diagram-' + this.getNowFormatDate() + '.bpmn', err ? null : xml)
-      })
-    },
-    async handleExportSVG() {
-      await this.bpmnModeler.saveSVG((err, svg) => {
-        this.setEncoded('diagram-' + this.getNowFormatDate() + '.svg', err ? null : svg)
-      })
-    },
-
-    handleMiniMap() {
-      if (this.minimap) {
-        this.bpmnModeler.get('minimap').close()
-      } else {
-        this.bpmnModeler.get('minimap').open()
-      }
-      this.minimap = !this.minimap
-    },
-    // 快捷键
-    handleKeyboard() {
-      this.$alert(`<table>
-        <tbody>
-          <tr>
-            <td>撤销</td>
-            <td class="binding"><code>ctrl + Z</code></td>
-          </tr>
-          <tr>
-            <td>恢复</td>
-            <td class="binding"><code>ctrl + ⇧ + Z</code></td>
-          </tr>
-          <tr>
-            <td>选择所有</td>
-            <td class="binding"><code>ctrl + A</code></td>
-          </tr>
-          <tr>
-            <td>滚动 (垂直)</td>
-            <td class="binding">ctrl + Scrolling</td>
-          </tr>
-          <tr>
-            <td>滚动 (水平)</td>
-            <td class="binding">ctrl + ⇧ + Scrolling</td>
-          </tr>
-          <tr>
-            <td>直接编辑</td>
-            <td class="binding">E</td>
-          </tr>
-          <tr>
-            <td>抓手工具</td>
-            <td class="binding">H</td>
-          </tr>
-          <tr>
-            <td>套索工具</td>
-            <td class="binding">L</td>
-          </tr>
-          <tr>
-            <td>坐标工具</td>
-            <td class="binding">S</td>
-          </tr>
-        </tbody>
-      </table>`, '快捷键', {
-        dangerouslyUseHTMLString: true,
-        closeOnClickModal: true,
-        closeOnPressEscape: true,
-        showConfirmButton: false
-      })
-    },
-    handleProperties() {
-      this.propertiesVisible = !this.propertiesVisible
-    },
-    handleZoomReset() {
-      this.bpmnModeler.get('zoomScroll').reset()
     },
-    handleZoomOut() {
-      this.bpmnModeler.get('zoomScroll').stepZoom(-1)
+    computed: {
+        formId () {
+            return this.id
+        }
     },
-    handleZoomIn() {
-      this.bpmnModeler.get('zoomScroll').stepZoom(1)
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        }
     },
+    methods: {
+        initUI () {
+            // 当前窗口高度
+            const height = window.innerHeight - 55
+            this.bpmnModeler = new BpmnModeler({
+                container: '#js-canvas',
+                height: height,
+                propertiesPanel: {
+                    parent: '#js-properties-panel'
+                },
+                keyboard: {
+                    bindTo: document
+                },
+                additionalModules: [
+                    TranslateModule,
+                    DiagramJsOrigin,
+                    MinimapModule,
+                    BpmnJsInColor,
+                    PropertiesPanelModule,
+                    PropertiesProviderModule
+                ],
+                moddleExtensions: {
+                    camunda: CamundaModdleDescriptor
+                }
+            })
+
+            // check file api availability
+            if (!window.FileList || !window.FileReader) {
+                this.$alert('Looks like you use an older browser that does not support drag and drop. ' + 'Try using Chrome, Firefox or the Internet Explorer > 10.')
+            } else {
+                this.registerFileDrop(document.getElementById('js-canvas'), (xml) => {
+                    return this.openDiagram(xml)
+                })
+            }
+            const container = document.getElementById('js-properties-panel')
+            container.addEventListener('click', (e) => {
+                if (e.target && e.target.id === 'selectSubProcess') {
+                    this.selectorValue = {}
+                    this.selectorVisible = true
+                    this.selectSubProcess = e.target.parentNode.parentNode.childNodes[1].children[0]
+                }
+            })
+        },
+        registerFileDrop (container, callback) {
+            const _this = this
+            function handleFileSelect (e) {
+                e.stopPropagation()
+                e.preventDefault()
+                const files = e.dataTransfer.files
+                _this.handleImportFile(true, files[0], callback)
+            }
+            function handleDragOver (e) {
+                e.stopPropagation()
+                e.preventDefault()
+                e.dataTransfer.dropEffect = 'copy' // Explicitly show this is a copy.
+            }
+
+            container.addEventListener('dragover', handleDragOver, false)
+            container.addEventListener('drop', handleFileSelect, false)
+        },
+        handleImportFile (isConfirm, file, callback) {
+            if (!file) { return }
+            if (file.name.indexOf('.bpmn') === -1) {
+                this.$alert('请选择bpmn文件导入')
+                return
+            }
+            if (isConfirm) {
+                this.$confirm('是否加载导入的文件', '提示').then(() => {
+                    this.importFile(file, callback)
+                }).catch(() => { })
+            } else {
+                this.importFile(file, callback)
+            }
+        },
+        importFile (file, callback) {
+            const reader = new FileReader()
+            const _this = this
+            reader.onload = function (e) {
+                const xml = e.target.result
+                if (callback) {
+                    callback(xml)
+                } else {
+                    _this.openDiagram(xml)
+                }
+            }
+            if (file) { reader.readAsText(file) }
+        },
+        async openDiagram (xml) {
+            try {
+                await this.bpmnModeler.importXML(xml)
+            } catch (err) {
+                console.log(err.message, err.warnings)
+            }
+        },
+        async getBpmnXml (done) {
+            // 如果正在编辑
+            const directEditing = this.bpmnModeler.get('directEditing')
+            if (directEditing && directEditing.isActive()) {
+                directEditing.complete()
+            }
+            const options = { format: false }
+            try {
+                const result = await this.bpmnModeler.saveXML(options)
+                const { err, xml } = result
+                done(err, xml)
+            } catch (err) {
+                console.log(err)
+            }
+        },
+        setEncoded (name, data) {
+            if (data) {
+                const encodedData = encodeURIComponent(data)
+                const elink = document.createElement('a')
+                elink.download = name
+                elink.style.display = 'none'
+                elink.href = 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData
+                document.body.appendChild(elink)
+                elink.click()
+                URL.revokeObjectURL(elink.href) // 释放URL 对象
+                document.body.removeChild(elink)
+            }
+        },
+        getNowFormatDate () {
+            return fecha.formatDate('yyyyMMddHHmmss')
+        },
+        handleImport (file) {
+            this.handleImportFile(false, file.raw)
+        },
+        handleExportBPMN () {
+            this.getBpmnXml((err, xml) => {
+                this.setEncoded('diagram-' + this.getNowFormatDate() + '.bpmn', err ? null : xml)
+            })
+        },
+        async handleExportSVG () {
+            await this.bpmnModeler.saveSVG((err, svg) => {
+                this.setEncoded('diagram-' + this.getNowFormatDate() + '.svg', err ? null : svg)
+            })
+        },
+        handleMiniMap () {
+            if (this.minimap) {
+                this.bpmnModeler.get('minimap').close()
+            } else {
+                this.bpmnModeler.get('minimap').open()
+            }
+            this.minimap = !this.minimap
+        },
+        // 快捷键
+        handleKeyboard () {
+            this.$alert(`<table>
+                <tbody>
+                    <tr>
+                        <td>撤销</td>
+                        <td class="binding"><code>ctrl + Z</code></td>
+                    </tr>
+                    <tr>
+                        <td>恢复</td>
+                        <td class="binding"><code>ctrl + ⇧ + Z</code></td>
+                    </tr>
+                    <tr>
+                        <td>选择所有</td>
+                        <td class="binding"><code>ctrl + A</code></td>
+                    </tr>
+                    <tr>
+                        <td>滚动 (垂直)</td>
+                        <td class="binding">ctrl + Scrolling</td>
+                    </tr>
+                    <tr>
+                        <td>滚动 (水平)</td>
+                        <td class="binding">ctrl + ⇧ + Scrolling</td>
+                    </tr>
+                    <tr>
+                        <td>直接编辑</td>
+                        <td class="binding">E</td>
+                    </tr>
+                    <tr>
+                        <td>抓手工具</td>
+                        <td class="binding">H</td>
+                    </tr>
+                    <tr>
+                        <td>套索工具</td>
+                        <td class="binding">L</td>
+                    </tr>
+                    <tr>
+                        <td>坐标工具</td>
+                        <td class="binding">S</td>
+                    </tr>
+                </tbody>
+            </table>`, '快捷键', {
+                dangerouslyUseHTMLString: true,
+                closeOnClickModal: true,
+                closeOnPressEscape: true,
+                showConfirmButton: false
+            })
+        },
+        handleProperties () {
+            this.propertiesVisible = !this.propertiesVisible
+        },
+        handleZoomReset () {
+            this.bpmnModeler.get('zoomScroll').reset()
+        },
+        handleZoomOut () {
+            this.bpmnModeler.get('zoomScroll').stepZoom(-1)
+        },
+        handleZoomIn () {
+            this.bpmnModeler.get('zoomScroll').stepZoom(1)
+        },
 
-    // 保存数据
-    handleSave(isDeploy, newDeploy) {
-      const name = this.bpmnModeler.getDefinitions().rootElements[0].name
-      if (this.$utils.isEmpty(name)) {
-        this.$confirm(`未填写流程定义名称!是否保存?`, '提示', {
-          confirmButtonText: '是',
-          cancelButtonText: '否'
-        }).then(() => {
-          this.saveXmlData(isDeploy, newDeploy)
-        }).catch(() => {
-        })
-      } else {
-        this.saveXmlData(isDeploy, newDeploy)
-      }
-    },
-    saveXmlData(isDeploy, newDeploy) {
-      this.getBpmnXml((err, xml) => {
-        if (err) {
-          this.$alert(err)
-          console.error(err.stack)
-          return
-        }
-        if (this.$utils.isNotEmpty(this.id) && isDeploy && !newDeploy) {
-          this.$confirm(`1.删除或修改节点会对结束/运行实例数据有影响,建议发布新版<br>
-          2.新增节点请及时配置新增节点数据,否则会影响运行实例及新发起的实例正常流转`, '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            dangerouslyUseHTMLString: true
-          }).then(() => {
-            this.saveData(isDeploy, newDeploy, xml)
-          }).catch(() => {
-          })
-        } else {
-          this.saveData(isDeploy, newDeploy, xml)
+        // 保存数据
+        handleSave (isDeploy, newDeploy) {
+            const name = this.bpmnModeler.getDefinitions().rootElements[0].name
+            if (this.$utils.isEmpty(name)) {
+                this.$confirm(`未填写流程定义名称!是否保存?`, '提示', {
+                    confirmButtonText: '是',
+                    cancelButtonText: '否'
+                }).then(() => {
+                    this.saveXmlData(isDeploy, newDeploy)
+                }).catch(() => {
+                })
+            } else {
+                this.saveXmlData(isDeploy, newDeploy)
+            }
+        },
+        saveXmlData (isDeploy, newDeploy) {
+            this.getBpmnXml((err, xml) => {
+                if (err) {
+                    this.$alert(err)
+                    console.error(err.stack)
+                    return
+                }
+                if (this.$utils.isNotEmpty(this.id) && isDeploy && !newDeploy) {
+                    this.$confirm(`1.删除或修改节点会对结束/运行实例数据有影响,建议发布新版<br>2.新增节点请及时配置新增节点数据,否则会影响运行实例及新发起的实例正常流转`, '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        dangerouslyUseHTMLString: true
+                    }).then(() => {
+                        this.saveData(isDeploy, newDeploy, xml)
+                    }).catch(() => {})
+                } else {
+                    this.$confirm(`<span style="color:#f56c6c; font-size: 18px; font-weight: 600;">请确保您不是误操作并知晓发布新版将会导致的后果!</span>`, '提示', {
+                        confirmButtonText: '我已确认',
+                        cancelButtonText: '取消',
+                        showClose: false,
+                        closeOnClickModal: false,
+                        dangerouslyUseHTMLString: true
+                    }).then(() => {
+                        this.saveData(isDeploy, newDeploy, xml)
+                    }).catch(() => {
+                        return
+                    })
+                }
+            })
+        },
+        saveData (isDeploy, newDeploy, xml) {
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
+            })
+            saveModeler({
+                deploy: isDeploy,
+                newDeploy: newDeploy,
+                typeId: this.typeId,
+                defId: this.id,
+                defXml: xml
+            }).then(response => {
+                loading.close()
+                this.$emit('callback', this)
+                ActionUtils.saveSuccessAlert(response.message, (rtn) => {
+                    this.closeDialog()
+                })
+            }).catch((err) => {
+                loading.close()
+                console.error(err)
+            })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
+        },
+        getFormData () {
+            this.$nextTick(() => {
+                this.initUI()
+                this.initDiagramData()
+            })
+        },
+        getInitialDiagram () {
+            var id = new Ids([32, 36, 1])
+            var processId = 'Process_' + id.next()
+            var startEventId = 'StartEvent_' + id.next()
+            /**
+             * 初始化的数据
+             */
+            var initialDiagram = `<?xml version="1.0" encoding="UTF-8"?>
+                <definitions
+                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+                    xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
+                    xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
+                    xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
+                    xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+                    targetNamespace="http://bpmn.io/schema/bpmn"
+                    id="Definitions_${id.next()}"
+                >
+                    <process id="${processId}" isExecutable="false">
+                        <startEvent id="${startEventId}" name="开始"/>
+                    </process>
+                    <bpmndi:BPMNDiagram id="BPMNDiagram_${id.next()}">
+                        <bpmndi:BPMNPlane id="BPMNPlane_${id.next()}" bpmnElement="${processId}">
+                            <bpmndi:BPMNShape id="_BPMNShape_${startEventId}" bpmnElement="${startEventId}">
+                                <dc:Bounds height="36.0" width="36.0" x="180.0" y="240.0"/>
+                            </bpmndi:BPMNShape>
+                        </bpmndi:BPMNPlane>
+                    </bpmndi:BPMNDiagram>
+                </definitions>`
+            return initialDiagram
+        },
+        async initDiagramData () {
+            if (this.$utils.isEmpty(this.formId)) {
+                ibpsBpmnDesign.canEdit = true
+                this.openDiagram(this.getInitialDiagram())
+            } else {
+                ibpsBpmnDesign.canEdit = false
+                this.dialogLoading = true
+                // 表单加载
+                getModeler({
+                    defId: this.formId,
+                    impBpmn: 'N'
+                }).then(response => {
+                    this.openDiagram(response.data)
+                    this.dialogLoading = false
+                }).catch(() => {
+                    this.dialogLoading = false
+                })
+            }
+        },
+        handleSelectorActionEvent (buttonKey, data) {
+            switch (buttonKey) {
+                case 'confirm':// 确定
+                    this.selectorVisible = false
+                    this.selectSubProcess.value = data.defKey
+                    var e = document.createEvent('MouseEvents')
+                    e.initEvent('change', true, true)
+                    this.selectSubProcess.dispatchEvent(e)
+
+                    break
+            }
         }
-      })
-    },
-    saveData(isDeploy, newDeploy, xml) {
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      saveModeler({
-        deploy: isDeploy,
-        newDeploy: newDeploy,
-        typeId: this.typeId,
-        defId: this.id,
-        defXml: xml
-      }).then(response => {
-        loading.close()
-        this.$emit('callback', this)
-        ActionUtils.saveSuccessAlert(response.message, (rtn) => {
-          this.closeDialog()
-        })
-      }).catch((err) => {
-        loading.close()
-        console.error(err)
-      })
-    },
 
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit('close', false)
-    },
-    getFormData() {
-      this.$nextTick(() => {
-        this.initUI()
-        this.initDiagramData()
-      })
-    },
-    getInitialDiagram() {
-      var id = new Ids([32, 36, 1])
-
-      var processId = 'Process_' + id.next()
-      var startEventId = 'StartEvent_' + id.next()
-      /**
- * 初始化的数据
- */
-      var initialDiagram =
-    `<?xml version="1.0" encoding="UTF-8"?>
-      <definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-                  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 
-                  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" 
-                  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" 
-                  xmlns:di="http://www.omg.org/spec/DD/20100524/DI" 
-                  xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" 
-                  targetNamespace="http://bpmn.io/schema/bpmn"
-                  id="Definitions_${id.next()}">
-        <process id="${processId}" isExecutable="false"> 
-          <startEvent id="${startEventId}" name="开始"/>
-        </process>
-        <bpmndi:BPMNDiagram id="BPMNDiagram_${id.next()}">
-          <bpmndi:BPMNPlane id="BPMNPlane_${id.next()}" bpmnElement="${processId}">
-            <bpmndi:BPMNShape id="_BPMNShape_${startEventId}" bpmnElement="${startEventId}">
-                <dc:Bounds height="36.0" width="36.0" x="180.0" y="240.0"/>
-            </bpmndi:BPMNShape>
-          </bpmndi:BPMNPlane>
-        </bpmndi:BPMNDiagram>
-      </definitions>
-    `
-      return initialDiagram
-    },
-    async initDiagramData() {
-      if (this.$utils.isEmpty(this.formId)) {
-        ibpsBpmnDesign.canEdit = true
-        this.openDiagram(this.getInitialDiagram())
-      } else {
-        ibpsBpmnDesign.canEdit = false
-        this.dialogLoading = true
-        // 表单加载
-        getModeler({
-          defId: this.formId,
-          impBpmn: 'N'
-        }).then(response => {
-          this.openDiagram(response.data)
-          this.dialogLoading = false
-        }).catch(() => {
-          this.dialogLoading = false
-        })
-      }
-    },
-    handleSelectorActionEvent(buttonKey, data) {
-      switch (buttonKey) {
-        case 'confirm':// 确定
-          this.selectorVisible = false
-          this.selectSubProcess.value = data.defKey
-          var e = document.createEvent('MouseEvents')
-          e.initEvent('change', true, true)
-          this.selectSubProcess.dispatchEvent(e)
-
-          break
-      }
     }
 
-  }
-
 }
 </script>
 <style lang="scss">
-.bjs-powered-by {
-  display: none;
-}
-.bpmn-def-design-dialog{
-  .el-dialog__header{
-    padding:5px;
-    background-color: #f5f5f7;
-  }
-   .el-dialog__footer{
-    padding: 0 ;
-    border: 0;
-  }
-  .el-dialog__body{
-    height:  calc(100vh - 45px) !important;
-    padding: 0px;
-  }
-
-a:link {
-  text-decoration: none;
-}
-
-.content {
-  position: relative;
-  width: 100%;
-  height: 100%;
+    .bjs-powered-by {
+        display: none;
+    }
+    .bpmn-def-design-dialog {
+        .el-dialog__header {
+            padding: 5px;
+            background-color: #f5f5f7;
+        }
+        .el-dialog__footer {
+            padding: 0;
+            border: 0;
+        }
+        .el-dialog__body {
+            height: calc(100vh - 45px) !important;
+            padding: 0px;
+        }
 
-  > .message {
-    width: 100%;
-    height: 100%;
-    text-align: center;
-    display: table;
+        a:link {
+            text-decoration: none;
+        }
 
-    font-size: 16px;
-    color: #111;
+        .content {
+            position: relative;
+            width: 100%;
+            height: 100%;
+
+            > .message {
+                width: 100%;
+                height: 100%;
+                text-align: center;
+                display: table;
+
+                font-size: 16px;
+                color: #111;
+
+                .note {
+                    vertical-align: middle;
+                    text-align: center;
+                    display: table-cell;
+                }
+
+                &.error {
+                    .details {
+                        max-width: 500px;
+                        font-size: 12px;
+                        margin: 20px auto;
+                        text-align: left;
+                        color: #bd2828;
+                    }
+
+                    pre {
+                        border: solid 1px #bd2828;
+                        background: #fefafa;
+                        padding: 10px;
+                        color: #bd2828;
+                    }
+                }
+            }
+            &:not(.with-error) .error,
+            &.with-error .intro,
+            &.with-diagram .intro {
+                display: none;
+            }
+
+            .canvas {
+                position: absolute;
+                top: 0;
+                left: 0;
+                right: 0;
+                bottom: 0;
+            }
+
+            .canvas,
+            .properties-panel-parent {
+                display: none;
+            }
+
+            &.with-diagram {
+                .canvas,
+                .properties-panel-parent {
+                    display: block;
+                }
+            }
+        }
 
-    .note {
-      vertical-align: middle;
-      text-align: center;
-      display: table-cell;
-    }
+        .buttons {
+            position: fixed;
+            bottom: 20px;
+            left: 20px;
+
+            padding: 0;
+            margin: 0;
+            list-style: none;
+
+            > li {
+                display: inline-block;
+                margin-right: 10px;
+
+                > a {
+                    background: #ddd;
+                    border: solid 1px #666;
+                    display: inline-block;
+                    padding: 5px;
+                }
+            }
+
+            a {
+                opacity: 0.3;
+            }
+
+            a.active {
+                opacity: 1;
+            }
+        }
 
-    &.error {
-      .details {
-        max-width: 500px;
-        font-size: 12px;
-        margin: 20px auto;
-        text-align: left;
-        color: #BD2828;
-      }
-
-      pre {
-        border: solid 1px #BD2828;
-        background: #fefafa;
-        padding: 10px;
-        color: #BD2828;
-      }
-    }
-  }
-  &:not(.with-error) .error,
-  &.with-error .intro,
-  &.with-diagram .intro {
-    display: none;
-  }
-
-  .canvas {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-  }
-
-  .canvas,
-  .properties-panel-parent {
-    display: none;
-  }
-
-  &.with-diagram {
-    .canvas,
-    .properties-panel-parent  {
-      display: block;
-    }
-  }
-}
+        .properties-container {
+            .toggle {
+                position: absolute;
+                top: 50%;
+                background: #f8f8f8;
+                padding: 7px 10px;
+                transform: rotate(-90deg);
+                white-space: nowrap;
+                font-size: 13px;
+                border: solid 1px #ccc;
+                border-bottom: none;
+                border-radius: 2px 2px 0 0;
+                transform-origin: top left;
+                z-index: 10;
+                cursor: pointer;
+                user-select: none;
+            }
+
+            .properties-panel-parent {
+                position: absolute;
+                top: 0;
+                bottom: 0;
+                right: 0;
+                width: 400px;
+                z-index: 10;
+                border-left: 1px solid #ccc;
+                overflow: auto;
+                background: #fff;
+                &:empty {
+                    display: none;
+                }
+                > .djs-properties-panel {
+                    padding-bottom: 70px;
+                    min-height: 100%;
+                }
+            }
+        }
 
-.buttons {
-  position: fixed;
-  bottom: 20px;
-  left: 20px;
+        //工具栏
+        .io-zoom-controls {
+            width: auto;
+            position: absolute;
+            bottom: 5px;
+            right: 20px;
+            z-index: 20;
+        }
+        .io-zoom-reset {
+            margin-bottom: 10px;
+        }
+        .io-control {
+            background: #fff;
+            border-radius: 2px;
+            border: solid 1px #e0e0e0;
+            padding: 5px;
+        }
 
-  padding: 0;
-  margin: 0;
-  list-style: none;
+        .io-control-list {
+            list-style: none;
+            padding: 5px;
+            margin: 0;
+        }
 
-  > li {
-    display: inline-block;
-    margin-right: 10px;
+        .io-control-list a,
+        .io-control-list a:visited,
+        .io-control-list button {
+            padding: 0;
+            outline: none;
+            cursor: pointer;
+            font-size: 16px;
+            line-height: 18px;
+            color: #555555;
+            background: none;
+            border: none;
+        }
 
-    > a {
-      background: #DDD;
-      border: solid 1px #666;
-      display: inline-block;
-      padding: 5px;
-    }
-  }
+        .io-control-list a:hover,
+        .io-control-list a:visited:hover,
+        .io-control-list button:hover {
+            color: #333333;
+        }
 
-  a {
-    opacity: 0.3;
-  }
+        .io-control-list a.inactive,
+        .io-control-list a:visited.inactive,
+        .io-control-list button.inactive {
+            color: #e0e0e0;
+            cursor: default;
+        }
 
-  a.active {
-    opacity: 1.0;
-  }
-}
+        .io-control-list.io-horizontal,
+        .io-control-list.io-horizontal li {
+            display: inline-block;
+        }
+        .io-control-list.io-horizontal li.hr {
+            border-left: solid 1px #eee;
+        }
 
-.properties-container{
-  .toggle {
-    position: absolute;
-    top: 50%;
-    background: #f8f8f8;
-    padding: 7px 10px;
-    transform: rotate(-90deg);
-    white-space: nowrap;
-    font-size: 13px;
-    border: solid 1px #CCC;
-    border-bottom: none;
-    border-radius: 2px 2px 0 0;
-    transform-origin: top left;
-    z-index: 10;
-    cursor: pointer;
-    user-select: none;
-  }
-
-.properties-panel-parent {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  right: 0;
-  width: 400px;
-  z-index: 10;
-  border-left: 1px solid #ccc;
-  overflow: auto;
-  background: #fff;
-  &:empty {
-    display: none;
-  }
-  > .djs-properties-panel {
-    padding-bottom: 70px;
-    min-height:100%;
-  }
-}
-}
+        .io-control-list.io-horizontal a {
+            padding: 2px;
+            margin: 0 5px;
+        }
 
-//工具栏
-  .io-zoom-controls {
-    width: auto;
-    position: absolute;
-    bottom: 5px;
-    right: 20px;
-    z-index: 20;
-  }
-  .io-zoom-reset {
-    margin-bottom: 10px;
-  }
-  .io-control {
-    background: #fff;
-    border-radius: 2px;
-    border: solid 1px #e0e0e0;
-    padding: 5px;
-  }
-
-  .io-control-list {
-    list-style: none;
-    padding: 5px;
-    margin: 0;
-  }
-
-  .io-control-list a,
-  .io-control-list a:visited,
-  .io-control-list button {
-    padding: 0;
-    outline: none;
-    cursor: pointer;
-    font-size: 16px;
-    line-height: 18px;
-    color: #555555;
-    background: none;
-    border: none;
-  }
-
-  .io-control-list a:hover,
-  .io-control-list a:visited:hover,
-  .io-control-list button:hover {
-    color: #333333;
-  }
-
-  .io-control-list a.inactive,
-  .io-control-list a:visited.inactive,
-  .io-control-list button.inactive {
-    color: #e0e0e0;
-    cursor: default;
-  }
-
-  .io-control-list.io-horizontal,
-  .io-control-list.io-horizontal li {
-    display: inline-block;
-  }
-    .io-control-list.io-horizontal li.hr{
-    border-left: solid 1px #eee;
+        .io-control-list.io-horizontal button {
+            margin: 0 5px;
+        }
+        .binding {
+            padding: 5px 10px;
+            font-family: monospace;
+        }
     }
-
-  .io-control-list.io-horizontal a {
-    padding: 2px;
-    margin: 0 5px;
-  }
-
-  .io-control-list.io-horizontal button {
-    margin: 0 5px;
-  }
- .binding {
-    padding: 5px 10px;
-    font-family: monospace;
-}
-}
 </style>