fjl
fujunling
2023-07-18 515aea3f9ee31d26ec93bf471b2491caf8ac16ed
Source/UBCS-WEB/src/views/modeling/cycle.vue
@@ -103,12 +103,7 @@
  components: { CycleFlow },
  data() {
    return {
      form: {
        // 'contionMap[id]': 'qwe'
        // contionMap: [
        //   {id: 'qwe'}
        // ]
      },
      form: {},
      page: {
        pageSize: 10,
        total: 0,
@@ -286,10 +281,138 @@
      });
    },
    async submit() {
      // const data = {
      //   startStatus: "Auditing",
      //   name: "22",
      //   id: "asas",
      //   nodes: [
      //     {
      //       type: "node",
      //       size: "80*48",
      //       shape: "flow-rect",
      //       color: "#1890FF",
      //       label: "Auditing",
      //       x: 278.60856031183397,
      //       y: 84.12841612613737,
      //       id: "Auditing",
      //       change: true,
      //       index: 0,
      //       name: "Auditing",
      //       indexNum: 0,
      //     },
      //     {
      //       type: "node",
      //       size: "80*48",
      //       shape: "flow-rect",
      //       color: "#1890FF",
      //       label: "Editing",
      //       x: 294.17388658989535,
      //       y: 299.9676071819219,
      //       id: "Editing",
      //       change: true,
      //       index: 1,
      //       name: "Editing",
      //       indexNum: 1,
      //     },
      //     {
      //       type: "node",
      //       size: "80*48",
      //       shape: "flow-rect",
      //       color: "#1890FF",
      //       label: "drg",
      //       x: 278.60856031183397,
      //       y: 463.92237731083515,
      //       id: "drg",
      //       change: true,
      //       index: 3,
      //       name: "drg",
      //       indexNum: 3,
      //     },
      //   ],
      //   edges: [
      //     {
      //       source: "Auditing",
      //       sourceAnchor: 2,
      //       target: "Editing",
      //       targetAnchor: 0,
      //       id: "3083896f",
      //       index: 2,
      //       indexNum: 2,
      //       events: [
      //         {
      //           eventFullName:
      //             "plm.bs.omd.lifecycle.server.pubimpl.TransationEvente",
      //           eventShowName: "TransationEventE",
      //           description: "",
      //           bizDomain: "mdm",
      //           oid: "5",
      //           creator: "",
      //           createTime: "",
      //           lastModifier: "",
      //           lastModifyTime: "",
      //           ts: "",
      //         },
      //       ],
      //     },
      //     {
      //       source: "Editing",
      //       sourceAnchor: 2,
      //       target: "drg",
      //       targetAnchor: 0,
      //       id: "b941a21d",
      //       index: 4,
      //       indexNum: 4,
      //       events: [
      //         {
      //           eventFullName:
      //             "plm.bs.omd.lifecycle.server.pubimpl.TransationEventf",
      //           eventShowName: "TransationEventF",
      //           description: "",
      //           bizDomain: "mdm",
      //           oid: "6",
      //           creator: "",
      //           createTime: "",
      //           lastModifier: "",
      //           lastModifyTime: "",
      //           ts: "",
      //         },
      //         {
      //           eventFullName:
      //             "plm.bs.omd.lifecycle.server.pubimpl.TransationEvente",
      //           eventShowName: "TransationEventE",
      //           description: "",
      //           bizDomain: "mdm",
      //           oid: "5",
      //           creator: "",
      //           createTime: "",
      //           lastModifier: "",
      //           lastModifyTime: "",
      //           ts: "",
      //         },
      //       ],
      //     },
      //   ],
      // };
      // API.add(data)
      //   .then((res) => {
      //     this.submitLoading = false;
      //     if (res.data.code === 200) {
      //       this.$message.success(
      //         this.type === "edit" ? "修改成功!" : "新增成功!"
      //       );
      //       this.visible = false;
      //       this.search();
      //     }
      //   })
      //   .catch(() => {
      //     this.submitLoading = false;
      //   });
      // return;
      const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData();
      if (!newRowData) {
        return;
      }
      // const edgeEvents = this.$refs.vueFlowchartEditor.getEdgesEvents();
      const flowData = await this.$refs.vueFlowchartEditor.getFlowData();
      if (Array.isArray(flowData.nodes)) {
        flowData.nodes = flowData.nodes.map((item) => {
@@ -302,6 +425,7 @@
        flowData.edges = flowData.edges.map((item) => {
          item.name = item.label;
          item.indexNum = item.index;
          // item.events = edgeEvents[item.id] || [];
          return item;
        });
      }
@@ -309,7 +433,7 @@
        ...newRowData,
        ...flowData,
      };
      debugger;
      this.submitLoading = true;
      let APIFun = API.add;
      if (this.type === "edit") {