Ben Lin
2024-07-06 e23fdf87e6c3bc6d42198b9309617195f2efd6c0
src/views/tigerprojects/system/lowcode/data.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-02 17:52:35
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-02 19:40:27
 * @LastEditTime: 2024-07-04 11:19:18
 */
import { ActionItem, FormSchema } from '/@/components/Table';
@@ -17,6 +17,7 @@
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { DeleteEntity } from '/@/api/tigerapi/system';
const { t } = useI18n();
/**
@@ -174,6 +175,8 @@
      routeData.value.nodes.push(act.node);
    });
    unref(lf).render(routeData.value);
    // lf.graphModel.translateCenter();
    // lf.graphModel.fitView();
  }
}
@@ -220,4 +223,32 @@
  }
}
/**
   * @description: 自定义删除方法
   * @param {Fn} args
   * @param {*} params
   * @return {*}
   */
export function custDel(args: Fn[], params: {}) {
  const name = params['name'];
  const useTables = args[1];
  if (!isNullOrEmpty(params['data'])) {
    var _data = params['data'].value[name].filter((item) => item['ID'] != params['record']['ID']);
    params['data'].value[name] = _data;
    useTables[name][1].setProps({
      dataSource: [],
    });
    useTables[name][1].setProps({
      dataSource: params['data'].value[name],
    });
    useTables[name][1].reload();
  } else {
    DeleteEntity(params['record'], params['entityName']).then((action) => {
      if (action.IsSuccessed) {
        useTables[name][1].reload();
      }
    });
  }
}
/* 高级表单公用方法 *********************************End */