Bläddra i källkod

新增流程图绘制页面

王涛 3 år sedan
förälder
incheckning
7a1ab54c15

+ 9 - 0
src/api/business/Middleware/bpmn.js

@@ -49,6 +49,15 @@ export function getBpmnZkReNodeProcdefCheckedTreeList(data) { //获取流程选
         params: data
     })
 }
+export function getBpmnZkReNodeProcdefListByPorcedfId(data) { //获取选中的节点信息
+    return request({
+        url: "/zkReNodeProcdef/listByPorcedfId",
+        method: 'get',
+        params: data
+    })
+}
+
+
 
 // 流程定义表(以后可能会扩张流程部署表和资源信息表)
 

+ 9 - 78
src/mock/xmlStrPreview2.js

@@ -5,107 +5,38 @@ export var xmlStr = `<?xml version="1.0" encoding="UTF-8"?>
       <outgoing>Flow_0bh3hrz</outgoing>
     </startEvent>
     <sequenceFlow id="Flow_0bh3hrz" sourceRef="StartEvent_1y45yut" targetRef="Activity_069tygh" run_state="3" />
-    <serviceTask id="Activity_03zljea" name="服务节点" run_state="3">
-      <incoming>Flow_03eotay</incoming>
-      <outgoing>Flow_0gm581s</outgoing>
-    </serviceTask>
-    <exclusiveGateway id="Gateway_0wt35op" run_state="8">
-      <incoming>Flow_0v31lbg</incoming>
-      <outgoing>Flow_0epzve3</outgoing>
-    </exclusiveGateway>
     <endEvent id="Event_169etvv">
-      <incoming>Flow_0epzve3</incoming>
+      <incoming>Flow_03eotay</incoming>
     </endEvent>
-    <sequenceFlow id="Flow_0epzve3" sourceRef="Gateway_0wt35op" targetRef="Event_169etvv" run_state="0" />
-    <exclusiveGateway id="Gateway_1m2lvzc" run_state="2">
-      <incoming>Flow_0gm581s</incoming>
-      <outgoing>Flow_03gklst</outgoing>
-    </exclusiveGateway>
-    <sequenceFlow id="Flow_0gm581s" sourceRef="Activity_03zljea" targetRef="Gateway_1m2lvzc" run_state="3" />
     <serviceTask id="Activity_069tygh">
       <incoming>Flow_0bh3hrz</incoming>
       <outgoing>Flow_03eotay</outgoing>
     </serviceTask>
-    <sequenceFlow id="Flow_03eotay" sourceRef="Activity_069tygh" targetRef="Activity_03zljea" />
-    <serviceTask id="Activity_0g4sll9">
-      <incoming>Flow_03gklst</incoming>
-      <outgoing>Flow_1n7y07c</outgoing>
-    </serviceTask>
-    <serviceTask id="Activity_011af3h">
-      <incoming>Flow_1n7y07c</incoming>
-      <outgoing>Flow_0v31lbg</outgoing>
-    </serviceTask>
-    <sequenceFlow id="Flow_1n7y07c" sourceRef="Activity_0g4sll9" targetRef="Activity_011af3h" />
-    <sequenceFlow id="Flow_0v31lbg" sourceRef="Activity_011af3h" targetRef="Gateway_0wt35op" />
-    <sequenceFlow id="Flow_03gklst" sourceRef="Gateway_1m2lvzc" targetRef="Activity_0g4sll9" />
+    <sequenceFlow id="Flow_03eotay" sourceRef="Activity_069tygh" targetRef="Event_169etvv" />
   </process>
   <bpmndi:BPMNDiagram id="BpmnDiagram_1">
     <bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">
-      <bpmndi:BPMNEdge id="Flow_0gm581s_di" bpmnElement="Flow_0gm581s">
-        <omgdi:waypoint x="620" y="120" />
-        <omgdi:waypoint x="725" y="120" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_0epzve3_di" bpmnElement="Flow_0epzve3">
-        <omgdi:waypoint x="570" y="635" />
-        <omgdi:waypoint x="570" y="782" />
+      <bpmndi:BPMNEdge id="Flow_03eotay_di" bpmnElement="Flow_03eotay">
+        <omgdi:waypoint x="410" y="120" />
+        <omgdi:waypoint x="652" y="120" />
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="Flow_0bh3hrz_di" bpmnElement="Flow_0bh3hrz">
         <omgdi:waypoint x="188" y="120" />
         <omgdi:waypoint x="310" y="120" />
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_03eotay_di" bpmnElement="Flow_03eotay">
-        <omgdi:waypoint x="410" y="120" />
-        <omgdi:waypoint x="520" y="120" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_1n7y07c_di" bpmnElement="Flow_1n7y07c">
-        <omgdi:waypoint x="710" y="280" />
-        <omgdi:waypoint x="665" y="280" />
-        <omgdi:waypoint x="665" y="400" />
-        <omgdi:waypoint x="620" y="400" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_0v31lbg_di" bpmnElement="Flow_0v31lbg">
-        <omgdi:waypoint x="570" y="470" />
-        <omgdi:waypoint x="570" y="585" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_03gklst_di" bpmnElement="Flow_03gklst">
-        <omgdi:waypoint x="750" y="145" />
-        <omgdi:waypoint x="750" y="193" />
-        <omgdi:waypoint x="760" y="193" />
-        <omgdi:waypoint x="760" y="240" />
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="StartEvent_1y45yut_di" bpmnElement="StartEvent_1y45yut">
         <omgdc:Bounds x="152" y="102" width="36" height="36" />
         <bpmndi:BPMNLabel>
           <omgdc:Bounds x="134" y="145" width="73" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_0m5xx5e_di" bpmnElement="Activity_03zljea">
-        <omgdc:Bounds x="520" y="80" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Gateway_0wt35op_di" bpmnElement="Gateway_0wt35op" isMarkerVisible="true">
-        <omgdc:Bounds x="545" y="585" width="50" height="50" />
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds x="491" y="603" width="44" height="14" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Event_169etvv_di" bpmnElement="Event_169etvv">
-        <omgdc:Bounds x="552" y="782" width="36" height="36" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Gateway_1m2lvzc_di" bpmnElement="Gateway_1m2lvzc" isMarkerVisible="true">
-        <omgdc:Bounds x="725" y="95" width="50" height="50" />
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds x="588" y="71" width="44" height="14" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="Activity_069tygh_di" bpmnElement="Activity_069tygh">
         <omgdc:Bounds x="310" y="80" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_0g4sll9_di" bpmnElement="Activity_0g4sll9">
-        <omgdc:Bounds x="710" y="240" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="Activity_011af3h_di" bpmnElement="Activity_011af3h">
-        <omgdc:Bounds x="520" y="390" width="100" height="80" />
+      <bpmndi:BPMNShape id="Event_169etvv_di" bpmnElement="Event_169etvv">
+        <omgdc:Bounds x="652" y="102" width="36" height="36" />
       </bpmndi:BPMNShape>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
-</definitions>`;
+</definitions>
+`;

+ 15 - 1
src/store/modules/permission.js

@@ -74,9 +74,23 @@ const permission = {
               path: "/",
               children:[
                 {
-                  component: "business/Middleware/bpmn/customModeler",
+                  component: "business/Middleware/bpmn/index",
                   hidden: false,
                   meta: {title: "流程图", icon: "international", noCache: true, link: null},
+                  name: "business/Middleware/bpmn/index",
+                  path: "business/Middleware/bpmn/index",
+                }
+              ]
+            },
+            {
+              component: "Layout",
+              hidden: false,
+              path: "/",
+              children:[
+                {
+                  component: "business/Middleware/bpmn/customModeler",
+                  hidden: false,
+                  meta: {title: "流程图绘制", icon: "international", noCache: true, link: null},
                   name: "business/Middleware/bpmn/customModeler",
                   path: "business/Middleware/bpmn/customModeler",
                 }

+ 2 - 2
src/views/bpmnModeler.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="containers">
     <!-- 面板 -->
-      <div class="canvas" ref="canvas"></div>
+      <!-- <div class="canvas" ref="canvas"></div>
       <ul class="buttons">
         <li>
           <a href="javascript:" @click="$refs.refFile.click()">加载本地BPMN文件</a>
@@ -28,7 +28,7 @@
         <li>
           <a href="javascript:" class="active" @click="handlerZoom(0)" title="还原">还原</a>
         </li>
-      </ul>
+      </ul> -->
   </div>
 </template>
 

+ 228 - 48
src/views/business/Middleware/bpmn/customModeler.vue

@@ -59,15 +59,14 @@
                     >
                 </li>
                 <li>
-                    <a href="javascript:" class="active"  title="提交流程图"
-                    >提交</a
-                    >
+                    <el-button type="primary" @click="submitBpmn" v-if="!loading" title="提交流程图">提 交</el-button>
+                    <el-button :loading="loading" type="primary" @click="submitBpnm" v-else>提交中...</el-button>
                 </li>
             </ul>
         
         </div>
-         <!-- 添加或修改参数配置对话框 -->
-        <el-dialog  title="修改" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+         <!-- 添加或修改节点参数配置对话框 -->
+        <el-dialog  title="修改" :visible.sync="serviceTask" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
             <el-form ref="form" :model="formData" :rules="rules" label-width="120px" >
                 <el-row :gutter="20">
                     <el-col :span="24" >
@@ -81,8 +80,8 @@
                         </el-form-item>
                     </el-col> -->
                     <el-col :span="24">
-                        <el-form-item label="执行场景" prop="scence">
-                        <treeselect v-model="formData.scence" :options="dataOptions" :show-count="true" placeholder="请选择执行场景" />
+                        <el-form-item label="执行场景" prop="nodeId">
+                        <treeselect v-model="formData.nodeId" :options="dataOptions" :show-count="true" placeholder="请选择执行场景" />
                         </el-form-item>
                     </el-col>
                 </el-row>
@@ -93,6 +92,29 @@
                 <el-button @click="cancel">取 消</el-button>
             </div>
         </el-dialog>
+
+        <!-- 添加或修改流程图参数配置对话框 -->
+        <el-dialog  title="修改" :visible.sync="openBpmn" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+            <el-form ref="form2" :model="formData2" :rules="rules2" label-width="120px" >
+                <el-row :gutter="20">
+                    <el-col :span="24" >
+                        <el-form-item label="流程图名称" prop="name" >
+                        <el-input v-model.trim="formData2.name" placeholder="请输入流程图名称"  @input="onInput" maxlength="30" show-word-limit  />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24" >
+                        <el-form-item label="流程图描述" prop="procdefDescribe" >
+                        <el-input type="textarea" v-model.trim="formData2.procdefDescribe" placeholder="请输入流程图描述"  @input="onInput" maxlength="60" show-word-limit  />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitBpnmForm" v-if="!loading">确 定</el-button>
+                <el-button :loading="loading" type="primary" @click="submitBpnmForm" v-else>提交中...</el-button>
+                <el-button @click="cancelBpnm">取 消</el-button>
+            </div>
+        </el-dialog>
     </div>
 </template>
 
@@ -104,15 +126,10 @@ import Treeselect from "@riophae/vue-treeselect";
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { getBpmnZkNodeList, getBpmnZkNodeTreeList, addBpmnZkNode, updataBpmnZkNode, 
 getBpmnZkReNodeProcdefTreeList, getBpmnZkReNodeProcdefCheckedTreeList, 
-getBpmnZkReProcdefList, addBpmnZkReProcdef, updataBpmnZkReProcdef, delBpmnZkReProcdef} from "@/api/business/Middleware/bpmn";
+getBpmnZkReProcdefList, addBpmnZkReProcdef, updataBpmnZkReProcdef, delBpmnZkReProcdef, getBpmnZkReNodeProcdefListByPorcedfId} from "@/api/business/Middleware/bpmn";
 export default {
   name: "",
   components: { Treeselect },
-  created() {},
-  mounted() {
-    this.getNodeTree()
-    this.init();
-  },
   data() {
     return {
       bpmnModeler: null,
@@ -126,7 +143,7 @@ export default {
       formData: {
         name: "",
         type: "",
-        scence:undefined,
+        nodeId:undefined,
         // order:undefined
     
       },
@@ -134,8 +151,8 @@ export default {
       dataOptions: [],
 
       data:undefined,
-      open:false,
-      // 表单校验
+      openBpmn:false,
+      // 节点表单校验
       rules: {
         name: [
           { required: true, message: "节点名称不能为空", trigger: "blur" }
@@ -143,16 +160,53 @@ export default {
         // order: [
         //   { required: true, message: "执行顺序不能为空", trigger: "blur" }
         // ],
-        scence: [
+        nodeId: [
           { required: true, message: "场景不能为空", trigger: ["blur",'change'] }
         ],
       },
+      formData2: {
+        name: undefined,
+        procdefDescribe:undefined,
+      },
+      // 流程图表单校验
+      rules2: {
+        name: [
+          { required: true, message: "流程描述名称不能为空", trigger: "blur" }
+        ],
+        procdefDescribe: [
+          { required: true, message: "流程图描述不能为空", trigger: ["blur",'change'] }
+        ],
+      },
       loading:false,
       bpmnData:[], //待提交数据,
       bpmnTitle:undefined,//待提交流程图名称
-      bpmnSencen:undefined,// 弹框打开时节点Id
+      bpmnNodeId:undefined,// 弹框打开时节点Id
+      xml:undefined,
+      serviceTaskStatus:false,
+      checkedKeys:[],//流程图返回节点
+      bpmnDataFH:[],//流程图返回信息
     };
   },
+  created(){
+
+    
+  },
+  mounted() {
+    this.getNodeTree()
+
+    if(this.$route.query.name){
+      getBpmnZkReProcdefList({name:this.$route.query.name,current: 1,size: 20}).then(res=>{
+        this.bpmnDataFH = res.data.records[0]
+        this.init()
+      })
+      getBpmnZkReNodeProcdefListByPorcedfId({procdefId:this.$route.query.id}).then(res=>{
+        this.checkedKeys = res.data
+      })
+    }else{
+      this.init()
+    }
+  },
+  
   // 方法集合
   methods: {
       //强制el-input刷新
@@ -173,10 +227,18 @@ export default {
         ]
       });
       this.createNewDiagram();
+      
     },
     async createNewDiagram() {
+      let that = this
       try {
-        const result = await this.bpmnModeler.importXML(xmlStr);
+        //编辑或默认视图
+        if(that.bpmnDataFH.resourceName){
+          var result = await this.bpmnModeler.importXML(that.bpmnDataFH.resourceName);
+        }else{
+          var result = await this.bpmnModeler.importXML(xmlStr);
+        }
+        
         // 上传
         console.log(result)
         const { warnings } = result;
@@ -215,6 +277,7 @@ export default {
     },
     // 下载
     async addBpmnListener() {
+      console.log(11111)
       const that = this;
       const downloadLink = this.$refs.saveXML;
       console.log(downloadLink)
@@ -254,7 +317,8 @@ export default {
     async saveXML(done) {
       try {
         const result = await this.bpmnModeler.saveXML({ format: true }, done);
-        console.log(result)
+        this.xml = result
+        // console.log(this.xml)
         return result;
       } catch (err) {
         console.log(err);
@@ -293,12 +357,12 @@ export default {
         //   e.element.businessObject.$type,
         //   e.element.businessObject.name,that.data
         // );
-        e.element.businessObject.scence = that.formData.scence 
-        e.element.businessObject.order = that.formData.order
+        e.element.businessObject.nodeId = that.formData.nodeId 
+        // e.element.businessObject.order = that.formData.order
         console.log(
           "点击了element",
           e,e.element.businessObject.name,
-          e.element.businessObject.scence
+          e.element.businessObject.nodeId
         );
 
         if (e.element.businessObject.$type == "bpmn:SequenceFlow") {
@@ -314,10 +378,9 @@ export default {
         }
       });
     },
-    // 取消按钮
+    // 节点取消按钮
     cancel() {
-        this.serviceTask = this.$store.state.bpmn.nodeVisible
-        this.open = false
+        this.serviceTask = false
         // this.reset();
     },
     // 表单重置
@@ -330,31 +393,29 @@ export default {
       };
       this.resetForm("form");
     },
-    /** 提交按钮 */
+    /** 节点提交按钮 */
     submitForm(row) {
+      let that = this
       this.$refs["form"].validate(valid => {
         if (valid) {
             this.msgSuccess("节点属性保存成功");
-            this.loading = false,
-            this.open = false
-            this.serviceTask = this.$store.state.bpmn.nodeVisible;
+            this.loading = false
             let data = this.dataOptions
-            console.log(data)
             for(let a = 0; a<Object.keys(data).length; a++){
-                if(data[a].id == this.formData.scence){
-                    this.formData.params = data[a].params
+                if(data[a].id == this.formData.nodeId){
+                    this.formData.param =  data[a].params
                 }
                 if(data[a].children){
                     if(Object.keys(data[a].children).length>0){
                         for(let b = 0; b<Object.keys(data[a].children).length; b++){
-                            if(data[a].children[b].id == this.formData.scence){
-                                this.formData.params = data[a].children[b].params
+                            if(data[a].children[b].id == this.formData.nodeId){
+                                this.formData.param = data[a].children[b].params
                             }
                             if(data[a].children[b].children){
                                 if(Object.keys(data[a].children[b].children).length>0){
                                     for(let c = 0; c<Object.keys(data[a].children[b].children).length; c++){
-                                        if(data[a].children[b].children[c].id == this.formData.scence){
-                                            this.formData.params = data[a].children[b].children[c].params
+                                        if(data[a].children[b].children[c].id == this.formData.nodeId){
+                                            this.formData.param = data[a].children[b].children[c].params
                                         }
                                     }
                                 }
@@ -363,10 +424,103 @@ export default {
                     }
                 }
             } 
-            console.log(this.formData)
+            this.formData.procedefKey = this.$store.state.bpmn.nodeInfo.businessObject.id
+            delete this.formData.type
+            let arr = JSON.parse(JSON.stringify(this.bpmnData))
+            if(arr.length>0){
+              let num = 0
+              for(let i =0;i<arr.length;i++){
+                if(this.$store.state.bpmn.nodeInfo.businessObject.id == arr[i].procedefKey){
+                  arr[i] = this.formData
+                }else{
+                  num +=1
+                  if(num == arr.length){
+                    this.bpmnData.push(this.formData)
+                  }
+                }
+              }
+            }else{
+              this.bpmnData.push(this.formData)
+            }
+            //异步避免需要二次关闭
+            setTimeout(()=>{
+              that.serviceTask = false
+            },1)
         }
       });
     },
+    /** 流程图提交按钮 */
+    submitBpmn(){
+      if(this.bpmnDataFH.name){
+        this.formData2.procdefDescribe = this.bpmnDataFH.procdefDescribe
+        this.formData2.name = this.bpmnDataFH.name
+      }
+      this.openBpmn = true
+    },
+    /** 流程图提交数据 */
+    submitBpnmForm(){
+      this.$refs["form2"].validate(valid => {
+        if (valid) {
+            if(this.bpmnData.length<2 && this.checkedKeys.length<2){
+              this.msgError("流程图节点数据个数小于2");
+            }else{
+             
+              if(this.checkedKeys.length>1){
+                let arr = {}
+                arr.name = this.formData2.name
+                arr.procdefDescribe = this.formData2.procdefDescribe
+                arr.procedefKey = this.formData2.procedefKey
+                arr.nodes = []
+                for(let i = 0; i<this.checkedKeys.length;i++){
+                  arr.nodes[i] = {}
+                  arr.nodes[i].param = this.checkedKeys[i].param
+                  arr.nodes[i].procedefKey = this.checkedKeys[i].procedefKey
+                  arr.nodes[i].nodeId = this.checkedKeys[i].id
+                  if(this.bpmnData.length>0){
+                   for(let n=0;n<this.bpmnData.length;n++){
+                      if(this.bpmnData[n].procedefKey){
+                        if(this.bpmnData[n].procedefKey == arr.nodes[i].procedefKey){
+                          arr.nodes[i].param = this.bpmnData[n].param
+                          arr.nodes[i].nodeId = this.bpmnData[n].nodeId
+                        }
+                      }
+                    }
+                  }
+                }
+                arr.resourceName =  this.xml.xml;
+                arr.id = this.bpmnDataFH.id
+                console.log(arr)
+                updataBpmnZkReProcdef(arr).then(res=>{
+                  this.msgSuccess("流程图修改成功");
+                  this.loading = false
+                  this.openBpmn = false
+                  this.$router.push('/business/Middleware/bpmn/index')
+                })
+              }else if(this.bpmnData.length>1){
+                let arr = {}
+                arr.name = this.formData2.name
+                arr.procdefDescribe = this.formData2.procdefDescribe
+                arr.procedefKey = this.formData2.procedefKey
+                arr.nodes = this.bpmnData
+                arr.resourceName =  this.xml.xml;
+                console.log(arr)
+                addBpmnZkReProcdef(arr).then(res=>{
+                  this.msgSuccess("流程图保存成功");
+                  this.loading = false
+                  this.openBpmn = false
+                  this.$router.push('/business/Middleware/bpmn/index')
+                })
+              }
+              
+              
+            }
+        }
+      });
+    },
+    /** 流程图取消按钮 */
+    cancelBpnm(){
+      this.openBpmn = false
+    },
     getNodeTree(){
         getBpmnZkNodeTreeList().then(res =>{
             if(res.data){
@@ -399,7 +553,7 @@ export default {
                     }
                     }
                 }
-                console.log(this.dataOptions)
+                // console.log(this.dataOptions)
             }
         })
     },
@@ -414,11 +568,11 @@ export default {
         const that = this;
         const element = this.$store.state.bpmn.nodeInfo;
         if (element.businessObject) {
-          console.log(
-            element.businessObject.id,
-            element.businessObject.name,
-            element.businessObject.$type
-          );
+          // console.log(
+          //   element.businessObject.id,
+          //   element.businessObject.name,
+          //   element.businessObject.$type
+          // );
 
         //   if (element.businessObject.$type === "bpmn:UserTask") {
         //     that.formData.type = "用户任务1";
@@ -427,10 +581,36 @@ export default {
         //   }
 
           if (element.businessObject.$type === "bpmn:ServiceTask") {
-            that.formData.type = "服务任务1";
+            that.formData = {
+              name: "",
+              type: "",
+              nodeId:undefined,
+              
+            }
             that.formData.name = element.businessObject.name;
-            that.open = true
+            let data = that.bpmnData
+            
+            if(that.checkedKeys.length>0){
+              for(let i = 0; i<that.checkedKeys.length;i++){
+                if(element.businessObject.id == that.checkedKeys[i].procedefKey){
+                  this.formData.nodeId = that.checkedKeys[i].id
+                }
+              }
+            }
+            if(data.length>0){
+              for(let i = 0; i<data.length;i++){
+                if(element.businessObject.id == data[i].procedefKey){
+                  this.formData.nodeId = data[i].nodeId
+                }
+              }
+            }
+            // if(that.serviceTaskStatus == false){
+            //   that.serviceTask = true
+            // }else{
+            //   that.serviceTask = false
+            // }
             that.serviceTask = this.$store.state.bpmn.nodeVisible;
+            console.log(data,this.formData)
           }
 
         //   if (element.businessObject.$type === "bpmn:ScriptTask") {
@@ -453,7 +633,7 @@ export default {
     }
   },
   watch: {
-    'formData.scence': 'currDeptChange',
+    'formData.nodeId': 'currDeptChange',
     task(val) {},
     userTask(val) {
       this.$store.state.bpmn.nodeVisible = val;
@@ -476,7 +656,7 @@ export default {
         modeling.updateLabel(element, val);
       },
       deep: true
-    }
+    },
   }
 };
 </script>

+ 241 - 0
src/views/business/Middleware/bpmn/index.vue

@@ -0,0 +1,241 @@
+<template>
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+        <el-form-item label="流程图名称">
+          <el-input
+            v-model.trim="queryParams.name"
+            placeholder="请输入流程图名称"
+            clearable
+            size="small"
+            style="width: 160px"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+          <el-button
+            type="primary"
+            plain
+            icon="el-icon-plus"
+            size="mini"
+            @click="handleAdd"
+          >新增</el-button>
+        </el-form-item>
+      </el-form>
+    <el-table v-loading="loading" :data="adminList"  height="calc(100vh - 30vh)">
+      <el-table-column label="流程图名称" align="center" prop="name" show-overflow-tooltip />
+      <el-table-column label="描述" align="center" prop="procdefDescribe"  show-overflow-tooltip />
+      <el-table-column label="查看" align="center" prop="resourceName"  show-overflow-tooltip >
+         <template slot-scope="scope"><span class="getBpmn" @click="getBpmn(scope.row)">查看流程图</span></template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime"  show-overflow-tooltip />
+      <el-table-column label="操作" align="center">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="primary"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+          >编辑</el-button>
+          <el-button
+            size="mini"
+            type="danger"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 查看bpmn对话框 -->
+    <el-dialog  :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+      <div class="canvas" ref="canvas"></div>
+    </el-dialog>
+
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+
+
+    </div>
+</template>
+
+<script>
+// 引入相关的依赖
+import BpmnViewer from "bpmn-js/lib/Viewer";
+import { xmlStr } from "@/mock/xmlStrPreview2";
+import { getBpmnZkNodeList, getBpmnZkNodeTreeList, addBpmnZkNode, updataBpmnZkNode, 
+getBpmnZkReNodeProcdefTreeList, getBpmnZkReNodeProcdefCheckedTreeList, 
+getBpmnZkReProcdefList, addBpmnZkReProcdef, updataBpmnZkReProcdef, delBpmnZkReProcdef} from "@/api/business/Middleware/bpmn";
+export default {
+  name: "",
+  created() {},
+  mounted() {
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 导出遮罩层
+      exportLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 参数表格数据
+      adminList: [],
+      
+      // 弹出层标题
+      title: "查看流程图",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 20,
+        name:undefined
+      },
+      // 表单参数
+      form: {},
+      bpmnViewer: null,
+      container: null,
+      canvas: null,
+      xml:undefined,
+     
+    };
+  },
+  created(){
+    this.getList()
+  },
+  // 方法集合
+  methods: {
+     /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.$router.push({path:'/business/Middleware/bpmn/customModeler',query:{name:row.name,id:row.id}})
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id
+      this.$confirm('是否确认删除', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delBpmnZkReProcdef(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.$router.push('/business/Middleware/bpmn/customModeler')
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = false;
+      getBpmnZkReProcdefList(this.queryParams).then(response => {
+          this.adminList = response.data.records;
+          this.total = response.data.total;
+          this.loading = false;
+        }
+      );
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.name = undefined
+      this.handleQuery();
+    },
+
+
+    // 流程图关闭
+    cancel() {
+        this.open = false
+        // this.reset();
+    },
+    //流程图查看
+    getBpmn(row){
+      this.loading = false
+      this.xml = row.resourceName
+      this.open = true
+      const canvas = this.$refs.canvas;
+      this.bpmnViewer = new BpmnViewer({
+        container: canvas
+      });
+      this.createNewDiagram(row.resourceName);
+    },
+    async createNewDiagram(xml) {
+      let that = this
+      try {
+        const result = await this.bpmnViewer.importXML(xml);
+        const { warnings } = result;
+        console.log(warnings);
+        // 屏幕自适应
+        const canvas = this.bpmnViewer.get("canvas");
+        canvas.zoom("fit-viewport", true);
+      } catch (err) {
+        console.log(err.message, err.warnings);
+      }
+    }
+
+  },
+
+};
+</script>
+
+<style scoped>
+
+.canvas {
+  width: 100%;
+  height: 400px;
+}
+.panel {
+  position: absolute;
+  right: 0;
+  top: 0;
+  width: 300px;
+}
+.buttons {
+  position: absolute;
+  left: 80px;
+  bottom: 20px;
+}
+.buttons li {
+  display: inline-block;
+  margin: 5px;
+}
+.buttons li a {
+  color: #999;
+  background: #eee;
+  cursor: not-allowed;
+  padding: 8px;
+  border: 1px solid #ccc;
+  text-decoration: none;
+}
+.buttons li a.active {
+  color: #333;
+  background: #fff;
+  cursor: pointer;
+}
+.demo-drawer-footer {
+  width: 100%;
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  border-top: 1px solid #e8e8e8;
+  padding: 10px 16px;
+  text-align: right;
+  background: #fff;
+}
+</style>

+ 2 - 2
src/views/business/Middleware/functionalInterface/index.vue

@@ -38,14 +38,14 @@
           size="mini"
           @click="handleAdd"
         >新增</el-button>
-        <el-button
+        <!-- <el-button
           type="warning"
           plain
           icon="el-icon-download"
           size="mini"
           :loading="exportLoading"
           @click="handleExport"
-        >导出</el-button>
+        >导出</el-button> -->
       </el-form-item>
     </el-form>
     <el-table v-loading="loading" :data="adminList" @selection-change="handleSelectionChange" height="calc(100vh - 30vh)">

+ 2 - 2
src/views/business/Middleware/hostEquipment/index.vue

@@ -38,14 +38,14 @@
           size="mini"
           @click="handleAdd"
         >新增</el-button>
-        <el-button
+        <!-- <el-button
           type="warning"
           plain
           icon="el-icon-download"
           size="mini"
           :loading="exportLoading"
           @click="handleExport"
-        >导出</el-button>
+        >导出</el-button> -->
       </el-form-item>
     </el-form>
     <el-table v-loading="loading" :data="adminList" @selection-change="handleSelectionChange" height="calc(100vh - 30vh)">

+ 2 - 2
src/views/business/Middleware/subsystem/index.vue

@@ -22,7 +22,7 @@
           @click="handleAdd"
           v-hasPermi="['system:admin:add']"
         >新增</el-button>
-        <el-button
+        <!-- <el-button
           type="warning"
           plain
           icon="el-icon-download"
@@ -30,7 +30,7 @@
           :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:admin:export']"
-        >导出</el-button>
+        >导出</el-button> -->
       </el-form-item>
     </el-form>
     <el-table v-loading="loading" :data="adminList" @selection-change="handleSelectionChange" height="calc(100vh - 30vh)">

+ 5 - 0
接口.md

@@ -0,0 +1,5 @@
+1.流程图新增接口  zkReProcdef
+   msg: "Internal system error-BadSqlGrammarException-\n### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag ' at line 1\n### The error may exist in com/usky/dm/persistence/mapper/ZkReProcdefMapper.java (best guess)\n### The error may involve defaultParameterMap\n### The error occurred while setting parameters\n### SQL: SELECT  id,name,describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag  FROM zk_re_procdef     WHERE (name = ? AND del_flag = ?)\n### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag ' at line 1\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag ' at line 1"
+
+2.流程图查询 zkReProcdef/list
+  msg: "Internal system error-BadSqlGrammarException-\n### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag ' at line 1\n### The error may exist in com/usky/dm/persistence/mapper/ZkReProcdefMapper.java (best guess)\n### The error may involve defaultParameterMap\n### The error occurred while setting parameters\n### SQL: SELECT  id,name,describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag  FROM zk_re_procdef     WHERE (del_flag = ?) ORDER BY id DESC LIMIT ?,?\n### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag ' at line 1\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe,key,resource_name,create_time,create_by,update_time,update_by,del_flag ' at line 1"

BIN
相关文档/中控原型.pdf