فهرست منبع

节点展示组件

lph 1 سال پیش
والد
کامیت
6c6b2eceaa
2فایلهای تغییر یافته به همراه247 افزوده شده و 7 حذف شده
  1. 234 0
      zkqy-ui/src/views/bussiness/dialogCompments/Mec/NodeShow.vue
  2. 13 7
      zkqy-ui/src/views/bussiness/processMange.vue

+ 234 - 0
zkqy-ui/src/views/bussiness/dialogCompments/Mec/NodeShow.vue

@@ -0,0 +1,234 @@
+<template>
+  <div class="form-wrap">
+    <div class="cardwrap">
+      <div class="title-area">
+        <span><i class="el-icon-help mr5"></i>工序</span>
+      </div>
+      <div class="node-list">
+        <div
+          :class="{
+            node: true,
+            currentNode: item.nodeId == currentNodeKey,
+          }"
+          v-for="(item, index) of nodeList"
+          :key="item.num"
+        >
+          <!-- @click="shiftNode(item)" -->
+          <span class="num">>{{ index + 1 }}</span>
+          <span class="title">{{ item.nodeInfo.name }}</span>
+          <span class="time">1分钟</span>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import getNodeSequence from "@/utils/bpmn/getNodeSequence";
+import { xmlStr2XmlObj } from "@/utils/bpmn/xml";
+export default {
+  name: "NodeShow",
+  props: ["formData", "row"],
+  components: {},
+  data() {
+    return {
+      search: "",
+      nodeList: [],
+      currentNodeKey: "",
+      resFormData: {},
+      columns: [
+        {
+          label: "编号",
+          prop: "id",
+        },
+        {
+          label: "编者",
+          prop: "editor",
+        },
+        {
+          label: "时间",
+          prop: "time",
+        },
+      ],
+      material: [
+        {
+          label: "名称",
+          prop: "name",
+        },
+        {
+          label: "尺寸",
+          prop: "size",
+        },
+        {
+          label: "规格",
+          prop: "model",
+        },
+        {
+          label: "数量",
+          prop: "num",
+        },
+        {
+          label: "备注",
+          prop: "note",
+        },
+      ],
+    };
+  },
+  watch: {
+    myFormData: {
+      handler(val) {},
+      deep: true,
+      immediate: true,
+    },
+    myRow: {
+      handler(val) {
+        this.currentNodeKey = val.benTaskNodeKey;
+        if (val?.bepTaskProcessXmlContent) {
+          let nodeSequence = getNodeSequence(
+            xmlStr2XmlObj(val.bepTaskProcessXmlContent)
+          );
+          this.nodeList = nodeSequence
+            .slice(0, this.getIndexByNodeId(nodeSequence, this.currentNodeKey))
+            ?.filter((item) => item.nodeInfo.localName != "exceptionTask");
+          // this.nodeList = getNodeSequence(
+          //   xmlStr2XmlObj(val.bepTaskProcessXmlContent)
+          // )?.filter((item) => item.nodeInfo.localName != "exceptionTask");
+
+          //去掉开始和结束节点
+          this.nodeList.shift();
+          this.nodeList[this.nodeList.length - 1]?.nodeInfo.localName ==
+            "endEvent" && this.nodeList.pop();
+          console.log(this.nodeList);
+        }
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+    myFormData() {
+      return this.formData;
+    },
+    myRow() {
+      return this.row;
+    },
+  },
+  methods: {
+    async getFormData() {
+      let formData = {
+        flag: false,
+        msg: "",
+      };
+
+      return {
+        flag: true,
+        data: this.resFormData,
+      };
+      // if(){}
+      // try {
+      //   let valid = await this.$refs.form.validate();
+      //   if (valid) {
+      //     formData.flag = true;
+      //     formData.data = this.form;
+      //     return formData;
+      //   } else {
+      //     formData.msg = "表单校验异常,请规范填写表单数据";
+      //     return formData;
+      //   }
+      // } catch (error) {
+      //   // console.log(error);
+      //   formData.msg = "表单校验异常,请规范填写表单数据";
+      //   return formData;
+      // }
+    },
+    async shiftNode(item) {
+      if (item.nodeId == this.currentNodeKey) return;
+      this.resFormData = {
+        taskProcessKey: this.row.bepTaskKey,
+        taskNodeKey: this.currentNodeKey,
+        taskBackNodeKey: item.nodeId,
+      };
+      this.currentNodeKey = item.nodeId;
+      // try {
+      //   let res = await this.$modal.confirm(
+      //     "是否确认切换流程至<" + item.nodeInfo.name + ">异常?"
+      //   );
+      //   console.log(res, item, this.row);
+      //   let payLoad = {
+      //     taskProcessKey: this.row.bepTaskKey,
+      //     taskNodeKey: this.currentNodeKey,
+      //     taskBackNodeKey: item.nodeId,
+      //   };
+      // } catch (error) {
+      //   this.$message.info("取消成功");
+      // }
+    },
+
+    getIndexByNodeId(nodeSequence, nodeId) {
+      return nodeSequence.findIndex((item) => item.nodeId == nodeId);
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.form-wrap {
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+
+  .cardwrap {
+    display: flex;
+    flex-direction: column;
+    width: 100%;
+    padding-bottom: 20px;
+    .title-area {
+      display: flex;
+      align-items: center;
+      padding-bottom: 5px;
+      font-size: 16px;
+      border-bottom: 2px solid rgba(0, 0, 0, 0.404);
+      box-sizing: border-box;
+    }
+    .table-area {
+      padding-top: 10px;
+    }
+    .node-list {
+      display: flex;
+      flex-wrap: wrap;
+      padding-top: 10px;
+      .node {
+        width: 33.3333%;
+        height: 50px;
+        display: flex;
+        align-items: center;
+        border-bottom: 1px dotted gray;
+        padding: 0 5px;
+        // &:hover {
+        //   border: 1px dotted rgb(0, 195, 255);
+        //   background-color: rgba(70, 194, 231, 0.63);
+        // }
+        .num {
+          color: #40c3a8;
+          font-size: 16px;
+          margin-right: 5px;
+        }
+        .title {
+          /* // color: #ececee34; */
+          font-size: 14px;
+          flex: 1;
+          /* // ma */
+        }
+        .time {
+          font-size: 12px;
+          color: rgba(48, 44, 44, 0.247);
+          margin-right: 10px;
+        }
+      }
+      .currentNode {
+        background-color: #7dec8f !important;
+      }
+    }
+  }
+}
+</style>

+ 13 - 7
zkqy-ui/src/views/bussiness/processMange.vue

@@ -186,13 +186,14 @@
             @addList="() => {}"
           ></DialogTemplate> -->
           <!-- ></DialogTemplate> -->
-          <component
+          <!-- <component
             :is="myForm"
             :formData="formData"
             :row="row"
             ref="myFormRef"
             v-if="myForm"
-          ></component>
+          ></component> -->
+          <NodeShow ref="myFormRef" :formData="formData" :row="row"></NodeShow>
           <!-- <CG1 ref="myFormRef"></CG1>
           <KC1 ref="myFormRef"></KC1> -->
           <!-- <GY06 ref="myFormRef" :formData="formData" :row="row"></GY06> -->
@@ -217,7 +218,7 @@ import { triggerExceptionNode } from "@/api/bpmprocess/process";
 
 import getNodeSequence from "@/utils/bpmn/getNodeSequence";
 import GY02 from "./dialogCompments/GongYi/GY02.vue";
-import ZL1 from "./dialogCompments/ZhiLiang/ZL1.vue";
+import ZL01 from "./dialogCompments/ZhiLiang/ZL1.vue";
 import { getForm } from "@/api/dragform/form";
 import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
 
@@ -225,13 +226,16 @@ import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
 import GY01 from "./dialogCompments/GongYi/GY01.vue";
 import GY03 from "./dialogCompments/GongYi/GY03.vue";
 import CG1 from "./dialogCompments/test-component/CaiGou/CG1.vue";
-import CG2 from "./dialogCompments/test-component/CaiGou/CG02.vue";
-import KC1 from "./dialogCompments/test-component/KuCun/KC1.vue";
+import CG02 from "./dialogCompments/test-component/CaiGou/CG02.vue";
+import KC01 from "./dialogCompments/test-component/KuCun/KC1.vue";
 import KC02 from "./dialogCompments/test-component/KuCun/KC02.vue";
 import GY06 from "./dialogCompments/GongYi/GY06.vue";
 import KB01 from "./dialogCompments/KongBai/KB01.vue"; //空白提示组件
 import SC01 from "./dialogCompments/ShengChan/SC01.vue"; //空白提示组件
 
+// Mec组件
+import NodeShow from "./dialogCompments/Mec/NodeShow.vue";
+
 export default {
   name: "processMange",
   props: [],
@@ -239,14 +243,16 @@ export default {
     GY01,
     DialogTemplate,
     CG1,
-    CG2,
-    KC1,
+    CG02,
+    KC01,
     GY06,
     GY03,
     KC02,
     GY02,
     KB01,
     SC01,
+    ZL01,
+    NodeShow,
   },
   dicts: ["bpm_type", "task_process_state"],
   data() {