Ben Lin
2025-03-05 40b2854875f492a0f2ed3e67e765846806253ae5
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-03 21:37:02
 * @LastEditTime: 2024-07-04 11:21:28
 */
import { Ref, h, unref } from 'vue';
@@ -17,7 +17,7 @@
import { Tag } from 'ant-design-vue';
import { useLocale } from '/@/locales/useLocale';
import { useDrawer } from '/@/components/Drawer';
import { EditOperation, Search } from '../data';
import { EditOperation, Search, custDel } from '../data';
const { getLocale } = useLocale();
function _default() {
@@ -28,7 +28,7 @@
    slots: { customRender: 'action' },
    fixed: undefined,
  };
  /**
   * @description: 些自定义方法
   * @return {*}
@@ -38,7 +38,7 @@
     * @description: 获取新增按钮的行为
     * @return {*}
     */
    CreateAction: (fnName: string) => {
    CreateAction: (type: string) => {
      return {
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
@@ -49,7 +49,7 @@
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      if (!isNullOrUnDef(data[1])) {
        data[1].popConfirm.confirm = DftGrpDel.bind(null, args, params);
        data[1].popConfirm.confirm = custDel.bind(null, args, params);
      }
      return data;
    },
@@ -58,7 +58,12 @@
     * @return {*}
     */
    GetHomeUrl: () => {
      const param = { ID: 'BAS_DEFECT_GRP', colSlots: [], crudColSlots: [] };
      const param = {
        ID: 'BAS_DEFECT_GRP',
        EntityName: 'BAS_DEFECT_GRP',
        colSlots: [],
        crudColSlots: [],
      };
      return `/BAS_DEFECT_GRP/LC/${encodeURI(JSON.stringify(param))}`;
    },
    GetBaseColumns: (type: string) => {
@@ -112,7 +117,7 @@
    /**
     * @description: 获取卡片内配置列表,以循环显示多个卡片并配置多个插槽
     * @return {*}
     */
     */
    GetBaseCards: (type: string) => {
      return [
        {
@@ -134,18 +139,20 @@
    /**
     * @description: 获取右侧边框use方法
     * @return {*}
     */
     */
    GetUseDrawers: () => {
      return [{
        'BAS_DEFECT': useDrawer(),
      }];
      return [
        {
          BAS_DEFECT: useDrawer(),
        },
      ];
    },
    /**
     * @description: 获取表格use列表
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
     */
    GetUseTables: (data: Ref<{}>, ...args) => {
      return {
        BAS_DEFECT: useTable({
@@ -158,7 +165,7 @@
            submitFunc: () => Search('BAS_DEFECT', data, args[0]), //自定义查询提交按钮的方法,触发查询提交事件
          },
          useSearchForm: true,
          showTableSetting: true,
          showTableSetting: false,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
@@ -169,7 +176,7 @@
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        })
        }),
      };
    },
    /**
@@ -214,7 +221,7 @@
          };
        return item;
      });
      EditOperation(data,d, u, item, _data);
      EditOperation(data, d, u, item, _data);
    },
    /**
     * @description: 获取标题信息
@@ -227,37 +234,15 @@
        pageContent: '这里可以添加和修改不良代码组和不良代码。',
        tableTitle: {
          BAS_DEFECT: '不良代码管理',
        }
        },
      };
    },
    GetUseForm: () => {
      return {};
    },
  };
  /**
   * @description: 自定义删除方法
   * @param {Fn} args
   * @param {*} params
   * @return {*}
   */
  function DftGrpDel(args: Fn[], params: {}) {
    const name = params['name'];
    if (!isNullOrEmpty(params['data'])) {
      var _data = params['data'].value[name].filter((item) => item['ID'] != params['record']['ID']);
      params['data'].value[name] = _data;
      args[6]({
        dataSource: [],
      });
      args[6]({
        dataSource: params['data'].value[name],
      });
      args[1]();
    } else {
      DeleteEntity(params['record'], params['entityName']).then((action) => {
        if (action.IsSuccessed) {
          args[1]();
        }
      });
    }
  }
  /* 以下是内部方法,不export,供上面的方法调用 */
  const baseColumns = {
    BAS_DEFECT: [
@@ -310,8 +295,8 @@
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ]
  }
    ],
  };
  const searchForms = {
    BAS_DEFECT: [
@@ -332,7 +317,7 @@
        },
      },
    ] as FormSchema[],
  }
  };
  const crudForms = {
    BAS_DEFECT: [
@@ -406,7 +391,7 @@
        show: false,
      },
    ] as FormSchema[],
  }
  };
  return [methods, ActionColumn];
}