Ben Lin
2024-06-14 509366a157059aeaf6daa2492cf32e108a8ca104
src/views/tigerprojects/mes/eng/route/index.vue
@@ -175,12 +175,8 @@
  var _nodes = unref(lf).getGraphData().nodes as node[];
  var _edges = unref(lf).getGraphData().edges as edge[];
  var _num = 1;
  const diffnodes = routeConfig.routeData.nodes.filter((itemA) =>
    _nodes.some((itemB) => itemB.id === itemA.ID),
  );
  const diffacts = routeConfig.routeData.acts.filter((itemA) =>
    _nodes.some((itemB) => itemB.id === itemA.ID),
  );
  const diffnodes = routeConfig.routeData.nodes.filter((itemA) => _nodes.some((itemB) => itemB.id === itemA.ID));
  const diffacts = routeConfig.routeData.acts.filter((itemA) => _nodes.some((itemB) => itemB.id === itemA.ID),);
  _nodes.forEach((n) => {
    if (n.properties.operType && n.properties.operType == 'Action') {
      var _diffacts = diffacts.length > 0 ? diffacts : routeConfig.routeData.acts;
@@ -432,12 +428,47 @@
    routeConfig.routeData.nodes.push(_node);
  }
  //是行为
  if (selectnode.value.properties.operType && selectnode.value.properties.operType == 'Action') {
  if (selectnode.value.properties['operType'] && selectnode.value.properties['operType'] == 'Action') {
    var _act = routeConfig.routeData.acts.filter((x) => x.ID == selectnode.value.id)[0];
    routeConfig.activeKey = 2;
    IsOperation.value = false;
    title.value = '行为';
    posttitle.value = '';
    if (isNullOrUnDef(_act)) {
      _act = {
        ID: selectnode.value.id,
        CREATE_TIME: currRoute.value.CREATE_TIME,
        CREATE_USER: useUserStore().getUserInfo.userId as string,
        UPDATE_TIME: currRoute.value.UPDATE_TIME,
        UPDATE_USER: useUserStore().getUserInfo.userId as string,
        GHOST_ROW: false,
        AUTH_ORG: '',
        AUTH_PROD: '',
        AUTH_WH: '',
        ACT_NAME: `${routeConfig.routeData.route.ROT_CODE}_${selectnode.value.text.value}_0`,
        ROT_ID: currRoute.value.ID,
        NODE_ID: '',
        ACT_TYPE: 0,
        GPH_TYPE: selectnode.value.type,
        GPH_X: selectnode.value.x,
        GPH_Y: selectnode.value.y,
        GPH_PROP: JSON.stringify(selectnode.value.properties),
        GPH_TEXT: selectnode.value.text.value,
        DO_TYPE: 0,
        DO_METHOD: '',
        DO_IF_PASS: '',
        DO_IF_FAIL: '',
        IS_ACTIVE: '',
        OPTION_1: '',
        OPTION_2: '',
        OPTION_3: '',
        OPTION_4: '',
        OPTION_5: '',
        REMARK: '',
        node: {} as node,
      }
      routeConfig.routeData.acts.push(_act);
    }
    routeConfig.currentAct = {
      ID: selectnode.value.id,
      CREATE_TIME: currRoute.value.CREATE_TIME,
@@ -506,7 +537,7 @@
      IsOperation.value = true;
      title.value = '工序';
      posttitle.value = '岗位';
    }, 50);
    }, 100);
  }
}