Ben Lin
2024-06-26 d78bfcfe33940427c68033511f9adc35ca2f79d7
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
@@ -4,12 +4,15 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-22 22:33:52
 * @LastEditTime: 2024-06-25 11:28:25
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
import { buildUUID } from '/@/utils/uuid';
import { useI18n } from '/@/hooks/web/useI18n';
import { isNullOrUnDef } from '/@/utils/is';
const { t } = useI18n();
function _default() {
  /**
   * @description: 自定义编辑方法
@@ -42,7 +45,7 @@
     * @description: 获取新增按钮的行为
     * @return {*}
     */
    CreateAction: () => {
    CreateAction: (fnName: string) => {
      return {
        action: 'go', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
        url: 'BAS_DEFECT/High',
@@ -57,18 +60,65 @@
      };
    },
    /**
     * @description: 产品绑定工艺路线操作字段自定义按钮
     * @description: 操作字段自定义按钮
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      data[0].onClick = DftGrpEdit.bind(null, args, params);
      if (!isNullOrUnDef(data[0])) {
        data[0].onClick = DftGrpEdit.bind(null, args, params);
      }
      return data;
    },
    GetSelectSuccess:(d, u) => {
    /**
     * @description: 弹出选择框成功返回方法
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
    GetSelectSuccess: (d, u) => {
      return {
        ITEM_CODE: d.values['val'],
      };
    }
    },
    /**
     * @description: 弹出选择框打开方法
     * @param {Fn} openItemModal
     * @return {*}
     */
    OpenSelectItem: (openItemModal: Fn) => {
      openItemModal(true, {
        title: '物料列表',
        schemas: [
          {
            field: 'ITEM_CODE',
            component: 'Input',
            label: '物料编码',
            colProps: {
              span: 12,
            },
          },
        ],
        ItemColumns: [
          {
            title: t('物料编码'),
            dataIndex: 'ITEM_CODE',
            resizable: true,
            sorter: true,
            width: 200,
          },
          {
            title: t('物料名称'),
            dataIndex: 'ITEM_NAME',
            resizable: true,
            sorter: true,
            width: 180,
          },
        ],
        tableName: 'BAS_ITEM',
        rowKey: 'ITEM_CODE',
        searchInfo: { TABLE_NAME: 'BAS_ITEM' },
      });
    },
  };
  return [methods, ActionColumn];