Ben Lin
2024-11-25 6e6fec028ffc9a27b3c8d30eb484cd361a119d76
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-27 20:40:25
 * @LastEditTime: 2024-07-31 08:26:33
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -21,12 +21,16 @@
    fixed: undefined,
  };
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
     * @return {*}
     */
    CreateAction: (fnName: string) => {
    CreateAction: (type: string) => {
      return {
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
@@ -36,6 +40,18 @@
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      data.map((x) => {
        if (
          (x.name == 'Delete' || x.name == 'Edit') &&
          (params['record']['VAR_CODE'] == 'PV-WorkOrder-Plan' ||
            params['record']['VAR_CODE'] == 'PV-CUSTOMER' ||
            params['record']['VAR_CODE'] == 'PV-ITEM' ||
            params['record']['VAR_CODE'] == 'PV-SN')
        ) {
          x.disabled = true;
          x.tooltip = '删除';
        }
      });
      return data;
    },
    /**
@@ -49,40 +65,43 @@
        VAR_VALUE: d.values['val'],
      };
    },
    OpenSelectItem:(openItemModal: Fn, ...args) => {
        openItemModal(true, {
          title: '过程变量列表',
          schemas: [
            {
              field: 'VAR_CODE',
              component: 'Input',
              label: '过程变量编码',
              colProps: {
                span: 12,
              },
    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'}
        });
      }
          },
        ],
        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' },
      });
    },
    GetUseForm: () => {
      return {};
    },
  };
  return [methods, ActionColumn];