Ben Lin
2024-07-02 04259fe9c84d819791cab926b959cab8dc6584b6
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts
@@ -4,10 +4,13 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-22 23:00:34
 * @LastEditTime: 2024-06-28 10:51:56
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
function _default() {
  const ActionColumn: BasicColumn = {
@@ -18,28 +21,72 @@
    fixed: undefined,
  };
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
     * @return {*}
     */
    CreateAction: () => {
    CreateAction: (fnName: string) => {
      return {
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
    },
    /**
     * @description: 产品绑定工艺路线操作字段自定义按钮
     * @description: 操作字段自定义按钮
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      return data;
    },
    GetSelectSuccess:(d, u) => {
    /**
     * @description: 选择过程变量弹出选择框成功返回赋值方法
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
    GetSelectSuccess: (d, u) => {
      return {
        ITEM_CODE: d.values['val'],
        VAR_VALUE: d.values['val'],
      };
    }
    },
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      openItemModal(true, {
        title: '过程变量列表',
        schemas: [
          {
            field: 'VAR_CODE',
            component: 'Input',
            label: '过程变量编码',
            colProps: {
              span: 12,
            },
          },
        ],
        ItemColumns: [
          {
            title: t('过程变量编码'),
            dataIndex: 'VAR_CODE',
            resizable: true,
            sorter: true,
            width: 200,
          },
          {
            title: t('过程变量名称'),
            dataIndex: 'VAR_NAME',
            resizable: true,
            sorter: true,
            width: 180,
          },
        ],
        tableName: 'BAS_LABEL_PV',
        rowKey: 'VAR_CODE',
        searchInfo: { TABLE_NAME: 'BAS_LABEL_PV' },
      });
    },
  };
  return [methods, ActionColumn];