Ben Lin
2024-07-02 04259fe9c84d819791cab926b959cab8dc6584b6
高级表单多子表更新
已修改17个文件
2492 ■■■■■ 文件已修改
src/api/tigerapi/model/basModel.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/Config.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/detail/detail.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts 347 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts 357 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts 699 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts 482 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/dtl.vue 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/mainTable.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/model/basModel.ts
@@ -122,17 +122,17 @@
export interface EntityCustFunctionType {
  CreateAction: (fnName: string) => {};
  ActionItem: (params: Recordable<any>, data, ...args) => ActionItem[];
  EditOperation: (data: Ref<any[]>, d, u) => void;
  EditOperation: (data: Ref<any[]>, d, u, item: string | undefined) => void;
  OpenSelectItem: (openItemModal: Fn, ...args) => void;
  GetSelectSuccess: (d, u, ...args) => {};
  GetHomeUrl: () => string;
  GetBaseColumns: () => [];
  GetSearchForm: () => [];
  GetCrudForm: (type: string) => [];
  GetBaseForm: () => [];
  GetBaseColumns: (type: string | undefined) => [] | {};
  GetSearchForm: (type: string | undefined) => [] | {};
  GetCrudForm: (type: string | undefined,) => [] | {};
  GetBaseForm: () => [] | {};
  GetBaseCards: (type: string | undefined) => [];
  OthersValues: (val: string, id: string) => {};
  GetTitle: (type: string) => {};
  GetTitle: (type: string | undefined) => {};
  GetCrudColSlots: () => [];
  nodeChange: ({}) => void;
  CreateIcon: (params: Recordable<any>) => string;
@@ -140,6 +140,8 @@
  GetNavItems: (type: string) => NavItem[];
  navChangeItem: (action: any, ...args) => void;
  GetUseModals: () => {};
  GetUseDrawers: () => [];
  GetUseTables: (data: Ref<Recordable[]>, ...args) => [];
  SubmitFunc: (values: Recordable<any>, type: string, emit) => void;
  GetSlots: (type: string | undefined) => {};
  GenerateHtml: (type: string | null) => HTMLElement | null;
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-20 12:13:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-30 13:04:00
 * @LastEditTime: 2024-07-01 16:49:22
-->
<template>
  <Card :title="GetTitle(props.configType)['navTitle']">
@@ -62,7 +62,7 @@
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
      GetTitle(type: string) {},
      GetTitle(type: string | undefined) {},
      GetNavItems(type: string) {},
      navChangeItem(action: any, ...args) {},
      GetUseModals() {},
src/views/tigerprojects/system/lowcode/composition/Config.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-24 23:44:31
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-27 22:52:24
 * @LastEditTime: 2024-07-01 16:49:12
-->
<template>
  <Card :title="GetTitle(props.configType)['configTitle']">
@@ -45,11 +45,11 @@
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
      GetCrudForm(type: string) {},
      GetCrudForm(type: string | undefined) {},
      GetCrudColSlots(val, id) {},
      OpenSelectItem(openItemModal: Fn, ...args) {},
      GetSelectSuccess(d, u, ...args) {},
      GetTitle(type: string) {},
      GetTitle(type: string | undefined) {},
      nodeChange(params: {
        resetFields: any;
        setFieldsValue: any;
src/views/tigerprojects/system/lowcode/detail/detail.vue
@@ -61,9 +61,9 @@
    {
      ActionItem(params, data, ...args) {},
      EditOperation(data, d, u) {},
      GetBaseColumns() {},
      GetSearchForm() {},
      GetCrudForm(type: string) {},
      GetBaseColumns(type: string | undefined) {},
      GetSearchForm(type: string | undefined) {},
      GetCrudForm(type: string | undefined, ...args) {},
      OthersValues(val, id) {},
      GetSelectSuccess(d, u, ...args) {},
      OpenSelectItem(openItemModal: Fn, ...args) {},
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts
@@ -4,18 +4,19 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-28 14:21:49
 * @LastEditTime: 2024-07-01 17:04:43
 */
import { Ref, h, unref } from 'vue';
import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { ActionItem, BasicColumn, useTable } from '/@/components/Table';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { Tag } from 'ant-design-vue';
import { useLocale } from '/@/locales/useLocale';
import { useDrawer } from '/@/components/Drawer';
const { getLocale } = useLocale();
function _default() {
@@ -59,151 +60,14 @@
      const param = { ID: 'BAS_DEFECT_GRP', colSlots: [], crudColSlots: [] };
      return `/BAS_DEFECT_GRP/LC/${encodeURI(JSON.stringify(param))}`;
    },
    GetBaseColumns: () => {
      return [
        {
          title: '不良代码编码',
          dataIndex: 'DFT_CODE',
          // ifShow: false,
          width: 180,
        },
        {
          title: '不良代码名称',
          dataIndex: 'DFT_NAME',
        },
        {
          title: '缺陷等级',
          dataIndex: 'DFT_LEVEL',
          customRender: ({ record }) => {
            const type = record.DFT_LEVEL;
            var text = '';
            var color = 'green';
            switch (type) {
              case 0:
                text = '轻微缺陷';
                break;
              case 1:
                color = 'blue';
                text = '严重缺陷';
                break;
              case 2:
                color = 'red';
                text = '致命缺陷';
                break;
            }
            return h(Tag, { color: color }, () => text);
          },
        },
        {
          title: '不良代码组编码',
          dataIndex: 'DFTG_CODE',
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
        },
        {
          title: '更新时间',
          dataIndex: 'UPDATE_TIME',
        },
        {
          title: '更新人',
          dataIndex: 'UPDATE_USER',
        },
      ];
    GetBaseColumns: (type: string) => {
      return baseColumns[type];
    },
    GetSearchForm: () => {
      return [
        {
          field: 'DFT_CODE',
          label: '不良代码编码',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
        {
          label: '不良代码名称',
          field: 'DFT_NAME',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
      ];
    GetSearchForm: (type: string) => {
      return searchForms[type];
    },
    GetCrudForm: () => {
      return [
        {
          field: 'DFT_CODE',
          label: '不良代码编码',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '不良代码名称',
          field: 'DFT_NAME',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '不良代码组编码',
          field: 'DFTG_CODE',
          component: 'ApiSelect',
          colProps: {
            span: 24,
          },
          componentProps: {
            api: getEntity,
            params: { entityName: 'BAS_DEFECT_GRP', sqlcmd: ' 1=1 ' },
            resultField: 'Data.Items',
            labelField: 'DFTG_NAME',
            valueField: 'DFTG_CODE',
          },
          dynamicDisabled: ({ values }) => {
            return true;
          },
        },
        {
          label: '缺陷等级',
          field: 'DFT_LEVEL',
          component: 'ApiSelect',
          required: true,
          colProps: {
            span: 24,
          },
          componentProps: {
            api: GetEnum,
            params: { name: 'BAS_DEFECT+DFT_LEVELs' },
            resultField: 'Data',
            labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
            valueField: 'Value',
          },
        },
        {
          label: '备注',
          field: 'REMARK',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: 'ID',
          field: 'ID',
          component: 'Input',
          colProps: {
            span: 24,
          },
          show: false,
        },
      ];
    GetCrudForm: (type: string) => {
      return crudForms[type];
    },
    GetBaseForm: () => {
      return [
@@ -266,6 +130,46 @@
        // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '工艺信息' },
      ];
    },
    /**
     * @description: 获取右侧边框use方法
     * @return {*}
     */
    GetUseDrawers: () => {
      return [{
        'BAS_DEFECT': useDrawer(),
      }];
    },
    /**
     * @description: 获取表格use列表
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    GetUseTables: (data: any[], ...args) => {
      return {
        BAS_DEFECT: useTable({
          title: '列表信息',
          dataSource: data,
          columns: baseColumns['BAS_DEFECT'],
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['BAS_DEFECT'],
          },
          useSearchForm: true,
          showTableSetting: true,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        })
      };
    },
    OthersValues: (val: string, id: string) => {
      return { DFTG_CODE: val };
    } /**
@@ -315,7 +219,9 @@
      return {
        pageTitle: '不良代码组管理',
        pageContent: '这里可以添加和修改不良代码组和不良代码。',
        baseTableTitle: '不良代码管理',
        tableTitle: {
          BAS_DEFECT: '不良代码管理',
        }
      };
    },
  };
@@ -346,6 +252,155 @@
    }
  }
  const baseColumns = {
    BAS_DEFECT: [
      {
        title: '不良代码编码',
        dataIndex: 'DFT_CODE',
        // ifShow: false,
        width: 180,
      },
      {
        title: '不良代码名称',
        dataIndex: 'DFT_NAME',
      },
      {
        title: '缺陷等级',
        dataIndex: 'DFT_LEVEL',
        customRender: ({ record }) => {
          const type = record.DFT_LEVEL;
          var text = '';
          var color = 'green';
          switch (type) {
            case 0:
              text = '轻微缺陷';
              break;
            case 1:
              color = 'blue';
              text = '严重缺陷';
              break;
            case 2:
              color = 'red';
              text = '致命缺陷';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '不良代码组编码',
        dataIndex: 'DFTG_CODE',
      },
      {
        title: '备注',
        dataIndex: 'REMARK',
      },
      {
        title: '更新时间',
        dataIndex: 'UPDATE_TIME',
      },
      {
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ]
  }
  const searchForms = {
    BAS_DEFECT: [
      {
        field: 'DFT_CODE',
        label: '不良代码编码',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
      {
        label: '不良代码名称',
        field: 'DFT_NAME',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
    ]
  }
  const crudForms = {
    BAS_DEFECT: [
      {
        field: 'DFT_CODE',
        label: '不良代码编码',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '不良代码名称',
        field: 'DFT_NAME',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '不良代码组编码',
        field: 'DFTG_CODE',
        component: 'ApiSelect',
        colProps: {
          span: 24,
        },
        componentProps: {
          api: getEntity,
          params: { entityName: 'BAS_DEFECT_GRP', sqlcmd: ' 1=1 ' },
          resultField: 'Data.Items',
          labelField: 'DFTG_NAME',
          valueField: 'DFTG_CODE',
        },
        dynamicDisabled: ({ values }) => {
          return true;
        },
      },
      {
        label: '缺陷等级',
        field: 'DFT_LEVEL',
        component: 'ApiSelect',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          api: GetEnum,
          params: { name: 'BAS_DEFECT+DFT_LEVELs' },
          resultField: 'Data',
          labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
          valueField: 'Value',
        },
      },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: 'ID',
        field: 'ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        show: false,
      },
    ]
  }
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-28 10:52:16
 * @LastEditTime: 2024-07-01 20:14:03
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -21,10 +21,10 @@
    slots: { customRender: 'action' },
    fixed: 'right',
  };
 /**
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -39,8 +39,9 @@
          ID: buildUUID(),
          Name: 'BAS_DEFECT',
          Title: '新增不良代码组',
          pCode: 'DFTG_CODE',
          // pCode: 'DFTG_CODE',
          IsID: false,
          drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE' }], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -59,7 +60,7 @@
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
     */
    GetSelectSuccess: (d, u) => {
      return {
        ITEM_CODE: d.values['val'],
@@ -69,7 +70,7 @@
     * @description: 弹出选择框打开方法
     * @param {Fn} openItemModal
     * @return {*}
     */
     */
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      openItemModal(true, {
        title: '物料列表',
@@ -107,7 +108,7 @@
  };
  /* 以下是内部方法,不export,供上面的方法调用 */
  /**
   * @description: 自定义编辑方法
   * @param {Fn} args
@@ -122,6 +123,7 @@
      Title: `编辑不良代码组:${params['record']['DFTG_CODE']}`,
      pCode: 'DFTG_CODE',
      IsID: false,
      drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE' }], //drawers是右边弹出增改侧框的名字列表
    };
    args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`);
  }
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts
@@ -4,16 +4,17 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-26 03:14:01
 * @LastEditTime: 2024-07-01 17:08:25
 */
import { Ref } from 'vue';
import { DeleteEntity, getEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { ActionItem, BasicColumn, useTable } from '/@/components/Table';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { useDrawer } from '/@/components/Drawer';
function _default(): any[] {
  const ActionColumn: BasicColumn = {
@@ -27,7 +28,7 @@
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -91,7 +92,7 @@
    /**
     * @description: 高级表单和详情页面返回主页面的url
     * @return {*}
     */
     */
    GetHomeUrl: () => {
      return `/BAS_PKG_RULE/LC/${encodeURI(JSON.stringify({ ID: 'BAS_PKG_RULE', colSlots: [], crudColSlots: [] }))}`;
    },
@@ -99,125 +100,22 @@
     * @description: 高级表单明细表格字段
     * @return {*}
     */
    GetBaseColumns: () => {
      return [
        {
          title: '包装/载具编码',
          dataIndex: 'PKG_CODE',
          // ifShow: false,
          width: 180,
        },
        {
          title: '包装层级',
          dataIndex: 'PKG_LEVEL',
        },
        {
          title: '包装数量',
          dataIndex: 'PKG_QTY',
        },
        {
          title: '包装规则ID',
          dataIndex: 'PKG_RULE_ID',
          ifShow: false,
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
        },
        {
          title: '更新时间',
          dataIndex: 'UPDATE_TIME',
        },
        {
          title: '更新人',
          dataIndex: 'UPDATE_USER',
        },
      ];
    GetBaseColumns: (type: string) => {
      return baseColumns[type];
    },
    /**
     * @description: 高级表单查询条件字段
     * @return {*}
     */
    GetSearchForm: () => {
      return [
        {
          field: 'PKG_CODE',
          label: '包装规则编码',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
      ];
    GetSearchForm: (type: string) => {
      return searchForms[type];
    },
    /**
     * @description: 高级表单增删改表单字段
     * @return {*}
     */
    GetCrudForm: () => {
      return [
        {
          field: 'PKG_CODE',
          label: '包装/载具编码',
          component: 'ApiSelect',
          required: true,
          colProps: {
            span: 24,
          },
          componentProps: {
            api: getEntity,
            params: { entityName: 'BAS_PKG_TYPE', sqlcmd: ' 1=1 ' },
            resultField: 'Data.Items',
            labelField: 'PKG_NAME',
            valueField: 'PKG_CODE',
          },
        },
        {
          label: '包装层级',
          field: 'PKG_LEVEL',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '包装规则ID',
          field: 'PKG_RULE_ID',
          component: 'Input',
          colProps: {
            span: 24,
          },
          dynamicDisabled: ({ values }) => {
            return true;
          },
        },
        {
          label: '包装数量',
          field: 'PKG_QTY',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: '备注',
          field: 'REMARK',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: 'ID',
          field: 'ID',
          component: 'Input',
          colProps: {
            span: 24,
          },
          show: false,
        },
      ];
    GetCrudForm: (type: string) => {
      return crudForms[type];
    },
    OthersValues: (val: string, id: string) => {
      return { PKG_RULE_ID: id };
@@ -291,7 +189,7 @@
    /**
     * @description: 高级表单主信息卡片生成,可以多个
     * @return {*}
     */
     */
    GetBaseCards: () => {
      return [
        {
@@ -304,6 +202,48 @@
      ];
    },
    /**
     * @description: 获取右侧边框use方法
     * @return {*}
     */
    GetUseDrawers: () => {
      return [
        {
          BAS_PKG_DTL: useDrawer(),
        },
      ];
    },
    /**
     * @description: 获取表格use列表
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    GetUseTables: (data: any[], ...args) => {
      return {
        BAS_PKG_DTL: useTable({
          title: '列表信息',
          dataSource: data,
          columns: baseColumns['BAS_PKG_DTL'],
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['BAS_PKG_DTL'],
          },
          useSearchForm: true,
          showTableSetting: true,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        }),
      };
    },
    /**
     * @description: 获取标题信息
     * @param {string} type
     * @return {*}
@@ -312,13 +252,15 @@
      return {
        pageTitle: '包装规则管理',
        pageContent: '这里可以添加和修改包装规则和包装信息。',
        baseTableTitle: '包装信息管理',
        tableTitle: {
          BAS_PKG_DTL: '包装信息管理',
        },
      };
    },
  };
  /* 以下是内部方法,不export,供上面的方法调用 */
  /**
   * @description: 自定义删除方法
   * @param {Fn} args
@@ -345,6 +287,120 @@
    }
  }
  const searchForms = {
    BAS_PKG_DTL: [
      {
        field: 'PKG_CODE',
        label: '包装规则编码',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
    ],
  };
  const baseColumns = {
    BAS_PKG_DTL: [
      {
        title: '包装/载具编码',
        dataIndex: 'PKG_CODE',
        // ifShow: false,
        width: 180,
      },
      {
        title: '包装层级',
        dataIndex: 'PKG_LEVEL',
      },
      {
        title: '包装数量',
        dataIndex: 'PKG_QTY',
      },
      {
        title: '包装规则ID',
        dataIndex: 'PKG_RULE_ID',
        ifShow: false,
      },
      {
        title: '备注',
        dataIndex: 'REMARK',
      },
      {
        title: '更新时间',
        dataIndex: 'UPDATE_TIME',
      },
      {
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ],
  };
  const crudForms = {
    BAS_PKG_DTL: [
      {
        field: 'PKG_CODE',
        label: '包装/载具编码',
        component: 'ApiSelect',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          api: getEntity,
          params: { entityName: 'BAS_PKG_TYPE', sqlcmd: ' 1=1 ' },
          resultField: 'Data.Items',
          labelField: 'PKG_NAME',
          valueField: 'PKG_CODE',
        },
      },
      {
        label: '包装层级',
        field: 'PKG_LEVEL',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '包装规则ID',
        field: 'PKG_RULE_ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        dynamicDisabled: ({ values }) => {
          return true;
        },
      },
      {
        label: '包装数量',
        field: 'PKG_QTY',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: 'ID',
        field: 'ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        show: false,
      },
    ],
  };
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-25 18:31:56
 * @LastEditTime: 2024-07-01 20:14:42
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -23,7 +23,7 @@
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -40,6 +40,7 @@
          Title: '新增包装规则',
          pCode: 'PKG_RULE_ID',
          IsID: true,
          drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -71,6 +72,7 @@
      Title: `编辑包装规则:${params['record']['RULE_CODE']}`,
      pCode: 'PKG_RULE_ID',
      IsID: true,
      drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers是右边弹出增改侧框的名字列表
    };
    go(`/BAS_PKG_DTL/High/${encodeURI(JSON.stringify(param))}`);
  }
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts
@@ -4,16 +4,17 @@
 * @version:
 * @Date: 2024-06-22 00:58:43
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-26 03:13:26
 * @LastEditTime: 2024-07-01 17:13:16
 */
import { Ref, h } from 'vue';
import { DeleteEntity, getEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { ActionItem, BasicColumn, useTable } from '/@/components/Table';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { Tag } from 'ant-design-vue';
import { useDrawer } from '/@/components/Drawer';
function _default() {
  const ActionColumn: BasicColumn = {
@@ -27,7 +28,7 @@
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -93,154 +94,14 @@
    GetHomeUrl: () => {
      return `/BAS_REASON_GRP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_REASON_GRP', colSlots: [], crudColSlots: [] }))}`;
    },
    GetBaseColumns: () => {
      return [
        {
          title: '不良原因编码',
          dataIndex: 'RSN_CODE',
          // ifShow: false,
          width: 180,
        },
        {
          title: '不良原因名称',
          dataIndex: 'RSN_NAME',
        },
        {
          title: '是否必须更换零件',
          dataIndex: 'NEED_REPLACE',
          customRender: ({ record }) => {
            const type = record.NEED_REPLACE;
            var text = '';
            var color = 'green';
            switch (type) {
              case 'Y':
                text = '更换';
                break;
              case 'N':
                color = 'blue';
                text = '不更换';
                break;
            }
            return h(Tag, { color: color }, () => text);
          },
        },
        {
          title: '不良原因组编码',
          dataIndex: 'RSNG_CODE',
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
        },
        {
          title: '更新时间',
          dataIndex: 'UPDATE_TIME',
        },
        {
          title: '更新人',
          dataIndex: 'UPDATE_USER',
        },
      ];
    GetBaseColumns: (type) => {
      return baseColumns[type];
    },
    GetSearchForm: () => {
      return [
        {
          field: 'RSN_CODE',
          label: '不良原因编码',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
        {
          label: '不良原因名称',
          field: 'RSN_NAME',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
      ];
    GetSearchForm: (type: string) => {
      return searchForms[type];
    },
    GetCrudForm: () => {
      return [
        {
          field: 'RSN_CODE',
          label: '不良原因编码',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '不良原因名称',
          field: 'RSN_NAME',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '不良原因组编码',
          field: 'RSNG_CODE',
          component: 'ApiSelect',
          colProps: {
            span: 24,
          },
          componentProps: {
            api: getEntity,
            params: { entityName: 'BAS_REASON_GRP', sqlcmd: ' 1=1 ' },
            resultField: 'Data.Items',
            labelField: 'RSNG_NAME',
            valueField: 'RSNG_CODE',
          },
          dynamicDisabled: ({ values }) => {
            return true;
          },
        },
        {
          label: '是否必须更换零件',
          field: 'NEED_REPLACE',
          component: 'Select',
          required: true,
          colProps: {
            span: 24,
          },
          componentProps: {
            options: [
              {
                label: '更换',
                value: 'Y',
                key: 'Y',
              },
              {
                label: '不更换',
                value: 'N',
                key: 'N',
              },
            ],
          },
        },
        {
          label: '备注',
          field: 'REMARK',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: 'ID',
          field: 'ID',
          component: 'Input',
          colProps: {
            span: 24,
          },
          show: false,
        },
      ];
    GetCrudForm: (type: string) => {
      return crudForms[type];
    },
    GetBaseForm: () => {
      return [
@@ -292,6 +153,48 @@
        },
      ];
    },
    /**
     * @description: 获取右侧边框use方法
     * @return {*}
     */
    GetUseDrawers: () => {
      return [
        {
          BAS_REASON: useDrawer(),
        },
      ];
    },
    /**
     * @description: 获取表格use列表
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    GetUseTables: (data: any[], ...args) => {
      return {
        BAS_REASON: useTable({
          title: '列表信息',
          dataSource: data,
          columns: baseColumns['BAS_REASON'],
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['BAS_REASON'],
          },
          useSearchForm: true,
          showTableSetting: true,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        }),
      };
    },
    OthersValues: (val: string, id: string) => {
      return { RSNG_CODE: val };
    },
@@ -304,7 +207,9 @@
      return {
        pageTitle: '不良原因组管理',
        pageContent: '这里可以添加和修改不良原因组和不良代码。',
        baseTableTitle: '不良原因管理',
        tableTitle: {
          BAS_REASON: '不良原因管理',
        }
      };
    },
  };
@@ -337,6 +242,158 @@
    }
  }
  const baseColumns = {
    BAS_REASON: [
      {
        title: '不良原因编码',
        dataIndex: 'RSN_CODE',
        // ifShow: false,
        width: 180,
      },
      {
        title: '不良原因名称',
        dataIndex: 'RSN_NAME',
      },
      {
        title: '是否必须更换零件',
        dataIndex: 'NEED_REPLACE',
        customRender: ({ record }) => {
          const type = record.NEED_REPLACE;
          var text = '';
          var color = 'green';
          switch (type) {
            case 'Y':
              text = '更换';
              break;
            case 'N':
              color = 'blue';
              text = '不更换';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '不良原因组编码',
        dataIndex: 'RSNG_CODE',
      },
      {
        title: '备注',
        dataIndex: 'REMARK',
      },
      {
        title: '更新时间',
        dataIndex: 'UPDATE_TIME',
      },
      {
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ],
  };
  const searchForms = {
    BAS_REASON: [
      {
        field: 'RSN_CODE',
        label: '不良原因编码',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
      {
        label: '不良原因名称',
        field: 'RSN_NAME',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
    ],
  };
  const crudForms = {
    BAS_REASON: [
      {
        field: 'RSN_CODE',
        label: '不良原因编码',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '不良原因名称',
        field: 'RSN_NAME',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '不良原因组编码',
        field: 'RSNG_CODE',
        component: 'ApiSelect',
        colProps: {
          span: 24,
        },
        componentProps: {
          api: getEntity,
          params: { entityName: 'BAS_REASON_GRP', sqlcmd: ' 1=1 ' },
          resultField: 'Data.Items',
          labelField: 'RSNG_NAME',
          valueField: 'RSNG_CODE',
        },
        dynamicDisabled: ({ values }) => {
          return true;
        },
      },
      {
        label: '是否必须更换零件',
        field: 'NEED_REPLACE',
        component: 'Select',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          options: [
            {
              label: '更换',
              value: 'Y',
              key: 'Y',
            },
            {
              label: '不更换',
              value: 'N',
              key: 'N',
            },
          ],
        },
      },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: 'ID',
        field: 'ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        show: false,
      },
    ],
  };
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-25 18:32:20
 * @LastEditTime: 2024-07-01 20:15:46
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -26,7 +26,7 @@
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -43,6 +43,7 @@
          Title: '新增不良原因组',
          pCode: 'RSNG_CODE',
          IsID: false,
          drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE' }], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -113,6 +114,7 @@
      Title: `编辑不良原因组:${params['record']['RSNG_CODE']}`,
      pCode: 'RSNG_CODE',
      IsID: false,
      drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE' }], //drawers是右边弹出增改侧框的名字列表
    };
    args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`);
  }
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts
@@ -4,21 +4,42 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-01 12:33:25
 * @LastEditTime: 2024-07-02 03:40:15
 */
import { Ref, h, unref } from 'vue';
import { Ref, h, ref, unref } from 'vue';
import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { ActionItem, BasicColumn, useTable } from '/@/components/Table';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { Tag } from 'ant-design-vue';
import { useLocale } from '/@/locales/useLocale';
import { useDrawer } from '/@/components/Drawer';
const { getLocale } = useLocale();
function _default() {
  let _data = ref([
    {
      SFT_CODE: '1',
      SFT_NAME: '1',
      SFTS_CODE: '1',
      SFT_BEGIN: 1,
      SFT_END: 1,
      IS_ACROSS_DAY: 'N',
      REMARK: '1',
      AUTH_ORG: '1',
      AUTH_PROD: '1',
      AUTH_WH: '1',
      GHOST_ROW: false,
      CREATE_TIME: '2024-07-01 12:34:29',
      CREATE_USER: '1',
      UPDATE_TIME: '2024-07-01 12:34:29',
      UPDATE_USER: '1',
      ID: '6632a14fec8c470c9216f5c7354baa22',
    },
  ] as Recordable<any>[]);
  const ActionColumn: BasicColumn = {
    width: 80,
    title: '操作',
@@ -59,186 +80,15 @@
      const param = { ID: 'MES_SHIFT_SYS', colSlots: [], crudColSlots: [] };
      return `/MES_SHIFT_SYS/LC/${encodeURI(JSON.stringify(param))}`;
    },
    GetBaseColumns: () => {
      return [
        {
          title: '班次编码',
          dataIndex: 'SFT_CODE',
          // ifShow: false,
          width: 180,
        },
        {
          title: '班次名称',
          dataIndex: 'SFT_NAME',
        },
        {
          title: '班制编码',
          dataIndex: 'SFTS_CODE',
        },
        {
          title: '班次开始时间',
          dataIndex: 'SFT_BEGIN',
        },
        {
          title: '班次结束时间',
          dataIndex: 'SFT_END',
        },
        {
          title: '是否跨天',
          dataIndex: 'IS_ACROSS_DAY',
          customRender: ({ record }) => {
            const type = record.IS_ACROSS_DAY;
            var text = '';
            var color = 'green';
            switch (type) {
              case 'Y':
                text = '是';
                break;
              case 'N':
                color = 'blue';
                text = '否';
                break;
            }
            return h(Tag, { color: color }, () => text);
          },
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
        },
        {
          title: '更新时间',
          dataIndex: 'UPDATE_TIME',
        },
        {
          title: '更新人',
          dataIndex: 'UPDATE_USER',
        },
      ];
    GetBaseColumns: (type: string) => {
      return baseColumns[type];
    },
    GetSearchForm: () => {
      return [
        {
          field: 'SFT_CODE',
          label: '班次编码',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
        {
          label: '班次名称',
          field: 'SFT_NAME',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
      ];
    GetSearchForm: (type: string) => {
      return searchForms[type];
    },
    GetCrudForm: () => {
      return [
        {
          field: 'SFT_CODE',
          label: '班次编码',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '班次名称',
          field: 'SFT_NAME',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '班制编码',
          field: 'SFTS_CODE',
          component: 'ApiSelect',
          colProps: {
            span: 24,
          },
          componentProps: {
            api: getEntity,
            params: { entityName: 'MES_SHIFT_SYS', sqlcmd: ' 1=1 ' },
            resultField: 'Data.Items',
            labelField: 'SFTS_NAME',
            valueField: 'SFTS_CODE',
          },
          dynamicDisabled: ({ values }) => {
            return true;
          },
        },
        {
          label: '班次开始时间',
          field: 'SFT_BEGIN',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: '班次结束时间',
          field: 'SFT_END',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: '是否跨天',
          field: 'IS_ACROSS_DAY',
          component: 'Select',
          required: true,
          colProps: {
            span: 24,
          },
          componentProps: {
            options: [
              {
                label: '是',
                value: 'Y',
                key: 'Y',
              },
              {
                label: '否',
                value: 'N',
                key: 'N',
              },
            ],
          },
        },
        // {
        //   field: 'LOGIN_TIME',
        //   label: '登录时间',
        //   defaultValue: '',
        //   component: 'RangePicker',
        //   ifShow: true,
        //   colProps: { span: 8 },
        // },
        {
          label: '备注',
          field: 'REMARK',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: 'ID',
          field: 'ID',
          component: 'Input',
          colProps: {
            span: 24,
          },
          show: false,
        },
      ];
    GetCrudForm: (type: string, ...args) => {
      _data = args[0];
      return crudForms[type];
    },
    /**
     * @description: 获取主信息
@@ -328,6 +178,71 @@
        // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '工艺信息' },
      ];
    },
    /**
     * @description: 获取右侧边框use方法
     * @return {*}
     */
    GetUseDrawers: () => {
      return [
        {
          MES_SHIFT: useDrawer(),
        },
        { MES_SHIFT_PRD: useDrawer() },
      ];
    },
    /**
     * @description: 获取表格use列表
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    GetUseTables: (data: Ref<{}>, ...args) => {
      // _data = data;
      return {
        MES_SHIFT: useTable({
          title: '列表信息',
          dataSource: data.value['MES_SHIFT'],
          columns: baseColumns['MES_SHIFT'],
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['MES_SHIFT'],
          },
          useSearchForm: true,
          showTableSetting: true,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        }),
        MES_SHIFT_PRD: useTable({
          title: '列表信息',
          dataSource: data.value['MES_SHIFT_PRD'],
          columns: baseColumns['MES_SHIFT_PRD'],
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['MES_SHIFT_PRD'],
          },
          useSearchForm: true,
          showTableSetting: true,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        }),
      };
    },
    OthersValues: (val: string, id: string) => {
      return { SFTS_CODE: val };
    } /**
@@ -337,7 +252,7 @@
     * @param {*} u
     * @return {*}
     */,
    EditOperation: (data: Ref<any[]>, d, u) => {
    EditOperation: (data: Ref<any[]>, d, u, item) => {
      if (u.isUpdate) {
        //更新
        var _data = data.value.map((item) => {
@@ -361,13 +276,13 @@
        d.UPDATE_TIME = formatToDateTime(new Date());
        d.UPDATE_USER = useUserStore().getUserInfo.userId as string;
        var _data2: any[] = [];
        if (!isNullOrEmpty(data.value)) {
          _data2 = data.value.map((item) => {
        if (!isNullOrEmpty(data.value[item])) {
          _data2 = data.value[item].map((item) => {
            return item;
          });
        }
        _data2.push(d);
        data.value = _data2;
        data.value[item] = _data2;
      }
    },
    /**
@@ -379,10 +294,15 @@
      return {
        pageTitle: '班制管理',
        pageContent: '这里可以添加和修改班制和班次及时段。',
        baseTableTitle: '班次管理',
        tableTitle: {
          MES_SHIFT: '班次管理',
          MES_SHIFT_PRD: '时段管理',
        },
      };
    },
  };
  /* 以下是内部方法,不export */
  /**
   * @description: 自定义删除方法
@@ -410,6 +330,413 @@
    }
  }
  /**
   * @description: 表格基本字段
   * @return {*}
   */
  const baseColumns = {
    MES_SHIFT: [
      {
        title: '班次编码',
        dataIndex: 'SFT_CODE',
        // ifShow: false,
        width: 180,
      },
      {
        title: '班次名称',
        dataIndex: 'SFT_NAME',
      },
      {
        title: '班制编码',
        dataIndex: 'SFTS_CODE',
      },
      {
        title: '班次开始时间',
        dataIndex: 'SFT_BEGIN',
      },
      {
        title: '班次结束时间',
        dataIndex: 'SFT_END',
      },
      {
        title: '是否跨天',
        dataIndex: 'IS_ACROSS_DAY',
        customRender: ({ record }) => {
          const type = record.IS_ACROSS_DAY;
          var text = '';
          var color = 'green';
          switch (type) {
            case 'Y':
              text = '是';
              break;
            case 'N':
              color = 'blue';
              text = '否';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '备注',
        dataIndex: 'REMARK',
      },
      {
        title: '更新时间',
        dataIndex: 'UPDATE_TIME',
      },
      {
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ],
    MES_SHIFT_PRD: [
      {
        title: '时段编码',
        dataIndex: 'PRD_CODE',
        // ifShow: false,
        width: 180,
      },
      {
        title: '时段名称',
        dataIndex: 'PRD_NAME',
      },
      {
        title: '班次编码',
        dataIndex: 'SFT_CODE',
      },
      {
        title: '时段开始时间',
        dataIndex: 'PRD_BEGIN',
      },
      {
        title: '时段结束时间',
        dataIndex: 'PRD_END',
      },
      {
        title: '是否跨天',
        dataIndex: 'IS_ACROSS',
        customRender: ({ record }) => {
          const type = record.IS_ACROSS;
          var text = '';
          var color = 'green';
          switch (type) {
            case 'Y':
              text = '是';
              break;
            case 'N':
              color = 'blue';
              text = '否';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '是否休息时段',
        dataIndex: 'IS_REST',
        customRender: ({ record }) => {
          const type = record.IS_REST;
          var text = '';
          var color = 'green';
          switch (type) {
            case 'Y':
              text = '是';
              break;
            case 'N':
              color = 'blue';
              text = '否';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '时段排序',
        dataIndex: 'SEQ',
      },
      {
        title: '备注',
        dataIndex: 'REMARK',
      },
      {
        title: '更新时间',
        dataIndex: 'UPDATE_TIME',
      },
      {
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ],
  };
  /**
   * @description: 查询字段
   * @return {*}
   */
  const searchForms = {
    MES_SHIFT: [
      {
        field: 'SFT_CODE',
        label: '班次编码',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
      {
        label: '班次名称',
        field: 'SFT_NAME',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
    ],
    MES_SHIFT_PRD: [
      {
        field: 'PRD_CODE',
        label: '时段编码',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
      {
        label: '时段名称',
        field: 'PRD_NAME',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
    ],
  };
  const crudForms = {
    MES_SHIFT: [
      {
        field: 'SFT_CODE',
        label: '班次编码',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '班次名称',
        field: 'SFT_NAME',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '班制编码',
        field: 'SFTS_CODE',
        component: 'ApiSelect',
        colProps: {
          span: 24,
        },
        componentProps: {
          api: getEntity,
          params: { entityName: 'MES_SHIFT_SYS', sqlcmd: ' 1=1 ' },
          resultField: 'Data.Items',
          labelField: 'SFTS_NAME',
          valueField: 'SFTS_CODE',
        },
        dynamicDisabled: ({ values }) => {
          return true;
        },
      },
      {
        label: '班次开始时间',
        field: 'SFT_BEGIN',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '班次结束时间',
        field: 'SFT_END',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '是否跨天',
        field: 'IS_ACROSS_DAY',
        component: 'Select',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          options: [
            {
              label: '是',
              value: 'Y',
              key: 'Y',
            },
            {
              label: '否',
              value: 'N',
              key: 'N',
            },
          ],
        },
      },
      // {
      //   field: 'LOGIN_TIME',
      //   label: '登录时间',
      //   defaultValue: '',
      //   component: 'RangePicker',
      //   ifShow: true,
      //   colProps: { span: 8 },
      // },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: 'ID',
        field: 'ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        show: false,
      },
    ],
    MES_SHIFT_PRD: [
      {
        field: 'PRD_CODE',
        label: '时段编码',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '时段名称',
        field: 'PRD_NAME',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '班次编码',
        field: 'SFT_CODE',
        component: 'Select',
        colProps: {
          span: 24,
        },
        componentProps: () => {
          const options = _data.map((entity) => ({
            value: entity.SFT_CODE,
            label: entity.SFT_NAME,
          }));
          return {
            options: options,
          };
        },
        // dynamicDisabled: ({ values }) => {
        //   return true;
        // },
      },
      {
        label: '时段开始时间',
        field: 'PRD_BEGIN',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '时段结束时间',
        field: 'PRD_END',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '是否跨天',
        field: 'IS_ACROSS',
        component: 'Select',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          options: [
            {
              label: '是',
              value: 'Y',
              key: 'Y',
            },
            {
              label: '否',
              value: 'N',
              key: 'N',
            },
          ],
        },
      },
      {
        label: '是否休息时段',
        field: 'IS_REST',
        component: 'Select',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          options: [
            {
              label: '是',
              value: 'Y',
              key: 'Y',
            },
            {
              label: '否',
              value: 'N',
              key: 'N',
            },
          ],
        },
      },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: 'ID',
        field: 'ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        show: false,
      },
    ],
  };
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-01 12:17:23
 * @LastEditTime: 2024-07-02 03:29:35
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -21,10 +21,10 @@
    slots: { customRender: 'action' },
    fixed: 'right',
  };
 /**
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -37,10 +37,14 @@
        params: {
          CODE: '0',
          ID: buildUUID(),
          Name: 'MES_SHIFT',
          Title: '新增班制',
          pCode: 'SFTS_CODE',
          IsID: false,
          Name: 'MES_SHIFT', //实体名
          Title: '新增班制', //标题
          pCode: 'SFTS_CODE', //主信息关键字段CODE
          IsID: false, //是否带过去侧边框的是ID,false就是CODE,true是ID
          drawers: [
            { name: 'MES_SHIFT', code: 'SFTS_CODE' },
            { name: 'MES_SHIFT_PRD', code: 'SFT_CODE' },
          ], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -59,7 +63,7 @@
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
     */
    GetSelectSuccess: (d, u) => {
      return {
        ITEM_CODE: d.values['val'],
@@ -69,7 +73,7 @@
     * @description: 弹出选择框打开方法
     * @param {Fn} openItemModal
     * @return {*}
     */
     */
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      openItemModal(true, {
        title: '物料列表',
@@ -107,7 +111,7 @@
  };
  /* 以下是内部方法,不export,供上面的方法调用 */
  /**
   * @description: 自定义编辑方法
   * @param {Fn} args
@@ -116,12 +120,16 @@
   */
  function Edit(args: Fn[], params: {}) {
    const param = {
      CODE: params['record']['SFTS_CODE'],
      ID: params['record']['ID'],
      Name: 'MES_SHIFT',
      Title: `编辑班制:${params['record']['SFTS_CODE']}`,
      pCode: 'SFTS_CODE',
      IsID: false,
      CODE: params['record']['SFTS_CODE'], //CODE的值
      ID: params['record']['ID'], //ID值
      Name: 'MES_SHIFT', //实体名
      Title: `编辑班制:${params['record']['SFTS_CODE']}`, //标题
      // pCode: 'SFTS_CODE', //主信息关键字段CODE,高级表单用下面drawers里的code
      IsID: false, //是否带过去侧边框的是ID,false就是CODE,true是ID
      drawers: [
        { name: 'MES_SHIFT', code: 'SFTS_CODE' },
        { name: 'MES_SHIFT_PRD', code: 'SFT_CODE' },
      ], //drawers是右边弹出增改侧框的名字列表
    };
    args[5](`/MES_SHIFT/High/${encodeURI(JSON.stringify(param))}`);
  }
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts
@@ -4,18 +4,19 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-28 10:57:44
 * @LastEditTime: 2024-07-01 17:17:58
 */
import { Ref, h, unref } from 'vue';
import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { ActionItem, BasicColumn, useTable } from '/@/components/Table';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { Tag } from 'ant-design-vue';
import { useLocale } from '/@/locales/useLocale';
import { useDrawer } from '/@/components/Drawer';
const { getLocale } = useLocale();
function _default() {
@@ -30,9 +31,9 @@
  /**
   * @description: 一些自定义方法
   * @return {*}
   */
   */
  const methods = {
    EditOperation: ( data: Ref<any[]>, d, u) => {
    EditOperation: (data: Ref<any[]>, d, u) => {
      if (u.isUpdate) {
        //更新
        var _data = data.value.map((item) => {
@@ -79,224 +80,25 @@
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      if (!isNullOrUnDef(data[1])) {
        data[1].popConfirm.confirm = Del.bind(null, args, params);
    }
      }
      return data;
    },
    /**
     * @description: 高级表单和详情页面返回主页面的url
     * @return {*}
     */
     */
    GetHomeUrl: () => {
      const param = { ID: 'QMS_INS_STD', colSlots: [], crudColSlots: [] };
      return `/QMS_INS_STD/LC/${encodeURI(JSON.stringify(param))}`;
    },
    GetBaseColumns: () => {
      return [
        {
          title: '检验项目编码',
          dataIndex: 'INS_CODE',
          // ifShow: false,
          width: 180,
        },
        {
          title: '检验项目名称',
          dataIndex: 'INS_NAME',
        },
        {
          title: '检验类别编码',
          dataIndex: 'CTGY_CODE',
        },
        {
          title: '检验方式',
          dataIndex: 'INS_MODE',
          customRender: ({ record }) => {
            const type = record.INS_MODE;
            var text = '';
            var color = 'green';
            switch (type) {
              case 0:
                text = '定量检测';
                break;
              case 1:
                color = 'blue';
                text = '定性检测';
                break;
            }
            return h(Tag, { color: color }, () => text);
          },
        },
        {
          title: '检验标准编码',
          dataIndex: 'TECH_STD',
        },
        {
          title: '是否必检',
          dataIndex: 'IS_NECESSARY',
          customRender: ({ record }) => {
            const type = record.IS_NECESSARY;
            var text = '';
            var color = 'green';
            switch (type) {
              case 'Y':
                text = '是';
                break;
              case 'N':
                color = 'blue';
                text = '否';
                break;
            }
            return h(Tag, { color: color }, () => text);
          },
        },
        {
          title: '是否判定结果',
          dataIndex: 'IS_JUDGE',
          customRender: ({ record }) => {
            const type = record.IS_JUDGE;
            var text = '';
            var color = 'green';
            switch (type) {
              case 'Y':
                text = '是';
                break;
              case 'N':
                color = 'blue';
                text = '否';
                break;
            }
            return h(Tag, { color: color }, () => text);
          },
        },
        {
          title: '检验工具',
          dataIndex: 'INS_TOOL',
        },
        {
          title: '测试值单位',
          dataIndex: 'QNTV_UNIT',
        },
        {
          title: '测试次数',
          dataIndex: 'QNTV_TIMES',
        },
        {
          title: '偏差值',
          dataIndex: 'QNTV_DEVIATION',
        },
        {
          title: '备注',
          dataIndex: 'REMARK',
        },
        {
          title: '更新时间',
          dataIndex: 'UPDATE_TIME',
        },
        {
          title: '更新人',
          dataIndex: 'UPDATE_USER',
        },
      ];
    GetBaseColumns: (type: string) => {
      return baseColumns[type];
    },
    GetSearchForm: () => {
      return [
        {
          field: 'INS_CODE',
          label: '检验项目编码',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
        {
          label: '检验项目名称',
          field: 'INS_NAME',
          component: 'Input',
          colProps: {
            span: 8,
          },
        },
      ];
    GetSearchForm: (type: string) => {
      return searchForms[type];
    },
    GetCrudForm: () => {
      return [
        {
          field: 'INS_CODE',
          label: '检验项目编码',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '检验项目名称',
          field: 'INS_NAME',
          component: 'Input',
          required: true,
          colProps: {
            span: 24,
          },
        },
        {
          label: '检验类别编码',
          field: 'CTGY_CODE',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: '检验标准',
          field: 'TECH_STD',
          component: 'ApiSelect',
          colProps: {
            span: 24,
          },
          componentProps: {
            api: getEntity,
            params: { entityName: 'QMS_INS_STD', sqlcmd: ' 1=1 ' },
            resultField: 'Data.Items',
            labelField: 'STD_NAME',
            valueField: 'STD_CODE',
          },
          dynamicDisabled: ({ values }) => {
            return true;
          },
        },
        {
          label: '检验方式',
          field: 'INS_MODE',
          component: 'ApiSelect',
          required: true,
          colProps: {
            span: 24,
          },
          componentProps: {
            api: GetEnum,
            params: { name: 'QMS_INS_ITEM+INS_MODEs' },
            resultField: 'Data',
            labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
            valueField: 'Value',
          },
        },
        {
          label: '备注',
          field: 'REMARK',
          component: 'Input',
          colProps: {
            span: 24,
          },
        },
        {
          label: 'ID',
          field: 'ID',
          component: 'Input',
          colProps: {
            span: 24,
          },
          show: false,
        },
      ];
    GetCrudForm: (type: string) => {
      return crudForms[type];
    },
    GetBaseForm: () => {
      return [
@@ -364,6 +166,49 @@
        // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '工艺信息' },
      ];
    },
    /**
     * @description: 获取右侧边框use方法
     * @return {*}
     */
    GetUseDrawers: () => {
      return [
        {
          QMS_INS_ITEM: useDrawer(),
        },
      ];
    },
    /**
     * @description: 获取表格use列表
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    GetUseTables: (data: any[], ...args) => {
      return {
        QMS_INS_ITEM: useTable({
          title: '列表信息',
          dataSource: data,
          columns: baseColumns['QMS_INS_ITEM'],
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['QMS_INS_ITEM'],
          },
          useSearchForm: true,
          showTableSetting: true,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        }),
        MES_SHIFT_PRD: useTable(),
      };
    },
    OthersValues: (val: string, id: string) => {
      return { TECH_STD: val };
    },
@@ -376,7 +221,9 @@
      return {
        pageTitle: '检验标准管理',
        pageContent: '这里可以添加和修改检验标准和检验项目。',
        baseTableTitle: '检验项目管理',
        tableTitle: {
          QMS_INS_ITEM: '检验项目管理',
        },
      };
    },
  };
@@ -407,6 +254,217 @@
    }
  }
  const baseColumns = {
    QMS_INS_ITEM: [
      {
        title: '检验项目编码',
        dataIndex: 'INS_CODE',
        // ifShow: false,
        width: 180,
      },
      {
        title: '检验项目名称',
        dataIndex: 'INS_NAME',
      },
      {
        title: '检验类别编码',
        dataIndex: 'CTGY_CODE',
      },
      {
        title: '检验方式',
        dataIndex: 'INS_MODE',
        customRender: ({ record }) => {
          const type = record.INS_MODE;
          var text = '';
          var color = 'green';
          switch (type) {
            case 0:
              text = '定量检测';
              break;
            case 1:
              color = 'blue';
              text = '定性检测';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '检验标准编码',
        dataIndex: 'TECH_STD',
      },
      {
        title: '是否必检',
        dataIndex: 'IS_NECESSARY',
        customRender: ({ record }) => {
          const type = record.IS_NECESSARY;
          var text = '';
          var color = 'green';
          switch (type) {
            case 'Y':
              text = '是';
              break;
            case 'N':
              color = 'blue';
              text = '否';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '是否判定结果',
        dataIndex: 'IS_JUDGE',
        customRender: ({ record }) => {
          const type = record.IS_JUDGE;
          var text = '';
          var color = 'green';
          switch (type) {
            case 'Y':
              text = '是';
              break;
            case 'N':
              color = 'blue';
              text = '否';
              break;
          }
          return h(Tag, { color: color }, () => text);
        },
      },
      {
        title: '检验工具',
        dataIndex: 'INS_TOOL',
      },
      {
        title: '测试值单位',
        dataIndex: 'QNTV_UNIT',
      },
      {
        title: '测试次数',
        dataIndex: 'QNTV_TIMES',
      },
      {
        title: '偏差值',
        dataIndex: 'QNTV_DEVIATION',
      },
      {
        title: '备注',
        dataIndex: 'REMARK',
      },
      {
        title: '更新时间',
        dataIndex: 'UPDATE_TIME',
      },
      {
        title: '更新人',
        dataIndex: 'UPDATE_USER',
      },
    ],
  };
  const searchForms = {
    QMS_INS_ITEM: [
      {
        field: 'INS_CODE',
        label: '检验项目编码',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
      {
        label: '检验项目名称',
        field: 'INS_NAME',
        component: 'Input',
        colProps: {
          span: 8,
        },
      },
    ],
  };
  const crudForms = {
    QMS_INS_ITEM: [
      {
        field: 'INS_CODE',
        label: '检验项目编码',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '检验项目名称',
        field: 'INS_NAME',
        component: 'Input',
        required: true,
        colProps: {
          span: 24,
        },
      },
      {
        label: '检验类别编码',
        field: 'CTGY_CODE',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '检验标准',
        field: 'TECH_STD',
        component: 'ApiSelect',
        colProps: {
          span: 24,
        },
        componentProps: {
          api: getEntity,
          params: { entityName: 'QMS_INS_STD', sqlcmd: ' 1=1 ' },
          resultField: 'Data.Items',
          labelField: 'STD_NAME',
          valueField: 'STD_CODE',
        },
        dynamicDisabled: ({ values }) => {
          return true;
        },
      },
      {
        label: '检验方式',
        field: 'INS_MODE',
        component: 'ApiSelect',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          api: GetEnum,
          params: { name: 'QMS_INS_ITEM+INS_MODEs' },
          resultField: 'Data',
          labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
          valueField: 'Value',
        },
      },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: 'ID',
        field: 'ID',
        component: 'Input',
        colProps: {
          span: 24,
        },
        show: false,
      },
    ],
  };
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-26 18:33:23
 * @LastEditTime: 2024-07-01 20:16:53
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -25,7 +25,7 @@
  /**
   * @description: 一些自定方法
   * @return {*}
   */
   */
  const methods = {
    /**
     * @description: 获取新增按钮的行为
@@ -43,6 +43,7 @@
          pCode: 'TECH_STD', //跳转到高级表单的关键字段名
          mCode: 'STD_CODE', //跳转到高级表单的关键字段名映射字段
          IsID: false,
          drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE' }], //IfShow: true:高级表单是否显示子表格增删改,drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -125,6 +126,7 @@
      pCode: 'TECH_STD', //跳转到高级表单的关键字段名
      mCode: 'STD_CODE', //跳转到高级表单的关键字段名映射字段
      IsID: false,
      drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE' }], //drawers是右边弹出增改侧框的名字列表
    };
    args[5](`/QMS_INS_ITEM/High/${encodeURI(JSON.stringify(param))}`);
  }
src/views/tigerprojects/system/lowcode/high/dtl.vue
@@ -1,35 +1,46 @@
<template>
  <div>
    <BasicTable @register="registerTable">
      <template #toolbar>
        <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> 新增 </a-button>
      </template>
      <template #action="{ record }">
        <TableAction :actions="createActions(record)" />
      </template>
      <template #[item]="{ field }" v-for="item in colSlots" :key="item">
        <!-- <template #form-BAS_REASON3aadd="{ field }"> -->
        <a-button
          v-if="field"
          class="mt-1 ml-1"
          size="small"
          @click="handleSelectItem(item)"
          preIcon="search|svg"
        />
        <GeneralModal
          @register="registerItemAdd"
          @success="(d, u) => handleItemSuccess(d, u, item)"
        />
      </template>
    </BasicTable>
    <normalDrawer @register="registerDrawer" @success="handleSuccess" />
    <a-card
      :title="GetTitle()['tableTitle'][item.name]"
      :bordered="false"
      class="!mt-5"
      v-for="(item, index) in drawers"
    >
      <BasicTable @register="useTables[item.name]">
        <template #toolbar>
          <a-button type="primary" @click="handleCreate(index, item.name)" preIcon="add_02|svg">
            新增
          </a-button>
        </template>
        <template #action="{ record }">
          <TableAction :actions="createActions(record, index, item.name)" />
        </template>
        <template #[item]="{ field }" v-for="item in colSlots" :key="item">
          <!-- <template #form-BAS_REASON3aadd="{ field }"> -->
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="handleSelectItem(item)"
            preIcon="search|svg"
          />
          <GeneralModal
            @register="registerItemAdd"
            @success="(d, u) => handleItemSuccess(d, u, item)"
          />
        </template>
      </BasicTable>
      <normalDrawer
        @register="useDrawers[index][item.name]"
        @success="(d, u) => handleSuccess(d, u, item.name)"
      />
    </a-card>
  </div>
</template>
<script lang="ts" setup>
  import { Ref, inject, nextTick, onMounted, ref, watch } from 'vue';
  import { BasicTable, useTable, TableAction } from '/@/components/Table';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { useDrawer } from '/@/components/Drawer';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import normalDrawer from '../normalDrawer.vue';
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
@@ -37,9 +48,11 @@
  import { useGo } from '/@/hooks/web/usePage';
  import { DeleteEntity, getEntity } from '/@/api/tigerapi/system';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { Card } from 'ant-design-vue';
  import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
  const { t } = useI18n();
  const ACard = Card;
  const props = defineProps({
    colSlots: { type: Array as PropType<any[]> },
    useTableData: { type: Object as PropType<{}>, default: { table: [] } },
@@ -47,43 +60,53 @@
    crudColSlots: { type: Object as PropType<any> },
  });
  const objParams = inject('objParams') as Ref<any>;
  const data = inject('data') as Ref<Recordable[]>;
  const data = inject('data') as Ref<any>;
  const useFormData = inject('useFormData') as Ref<{}>;
  const others = inject('others') as Ref<Recordable[]>;
  const go = useGo();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const cType = ref('');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const baseCards = ref([] as any[]);
  const otherCards = ref([] as any[]);
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const custImport = ref<any[]>(await import(`../entityts/${props.entityName}.ts`));
  const [{ EditOperation, GetBaseColumns, GetSearchForm, GetCrudForm, OthersValues }] =
    custImport.value['default']();
  others.value = OthersValues(objParams['CODE'], objParams['ID']);
  const [registerTable, { getForm, reload, setProps }] = useTable({
    title: '列表信息',
    dataSource: data,
    columns: GetBaseColumns(),
    formConfig: {
      labelWidth: 140,
      schemas: GetSearchForm(),
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
      ActionItem(params, data, ...args) {},
      EditOperation(data, d, u, item) {},
      GetBaseColumns(type: string | undefined) {},
      GetSearchForm(type: string | undefined) {},
      GetCrudForm(type: string | undefined, ...args) {},
      OthersValues(val, id) {},
      GetTitle(type: string | undefined) {},
      GetUseTables(data: Ref<Recordable[]>, ...args) {},
      GetUseDrawers() {},
    } as EntityCustFunctionType,
  ]);
  /* 动态import实体名.ts的自定义方法 */
  try {
    custImport.value = await import(`../entityts/${props.entityName}.ts`);
  } catch (e) {}
  const [
    {
      ActionItem: nActionItem,
      EditOperation,
      GetBaseColumns,
      GetSearchForm,
      GetCrudForm,
      OthersValues,
      GetTitle,
      GetUseTables,
      GetUseDrawers,
    },
    useSearchForm: true,
    showTableSetting: true,
    bordered: true,
    canResize: true,
    showIndexColumn: false,
    actionColumn: {
      width: 130,
      title: '操作',
      dataIndex: 'action',
      slots: { customRender: 'action' },
      fixed: 'right',
    }, //自定义操作列
  });
  ] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
    : custImport.value['default']();
  others.value = OthersValues(objParams['CODE'], objParams['ID']);
  const drawers = ref<any[]>(objParams['drawers']);
  const useTables = GetUseTables(data);
  const useDrawers = GetUseDrawers();
  // watch(
  //   () => props.dataSource,
  //   (newVal, oldVal) => {
@@ -100,15 +123,27 @@
  //   { deep: true, immediate: true },
  // );
  onMounted(() => {
    getEntity({
      sqlcmd: ` ${objParams['pCode']} = '${others.value[objParams['pCode']]}'`,
      entityName: props.entityName as string,
    }).then((res) => {
      if (!isNullOrEmpty(res.Data.Items)) {
        data.value = res.Data.Items;
  onMounted(async () => {
    for (const i in drawers.value) {
      let sqlcmd = ' 1 =1 ';
      if (!isNullOrEmpty(others.value[drawers.value[i].code])) {
        sqlcmd += ` And ${drawers.value[i].code} = '${others.value[drawers.value[i].code]}'`;
      }
    });
      const list = await getEntity({
        sqlcmd: sqlcmd,
        entityName: drawers.value[i].name,
      });
      if (!isNullOrEmpty(list.Data) && !isNullOrEmpty(list.Data.Items)) {
        data.value[drawers.value[i].name] = list.Data.Items;
        useTables[drawers.value[i].name][1].setProps({
          dataSource: [],
        });
        useTables[drawers.value[i].name][1].setProps({
          dataSource: data.value[drawers.value[i].name],
        });
        useTables[drawers.value[i].name][1].reload();
      }
    }
  });
  /**
@@ -116,13 +151,13 @@
   * @param {*} record
   * @return {*}
   */
  function createActions(record) {
  function createActions(record,index, item) {
    const params = {
      record,
      isUpdate: true,
      ifSave: true,
      entityName: props.entityName,
      formJson: GetCrudForm(), //getFormSchema(`${entityName.value}_Crud`),
      formJson: GetCrudForm(item), //getFormSchema(`${entityName.value}_Crud`),
      cType,
      dtlSlots,
      useModalData,
@@ -133,7 +168,7 @@
    const actionItem = [
      {
        icon: 'clarity:note-edit-line',
        onClick: editRecord.bind(null, openDrawer, params),
        onClick: editRecord.bind(null, useDrawers[index][item][1].openDrawer, params),
      },
      {
        icon: 'ant-design:delete-outlined',
@@ -141,7 +176,7 @@
        popConfirm: {
          title: '是否确认删除?',
          placement: 'left',
          confirm: deleteRecord.bind(null, reload, params),
          confirm: deleteRecord.bind(null, useTables[item][1].reload, params),
        },
      },
    ];
@@ -152,13 +187,13 @@
    return ActionItem(
      params,
      actionItem,
      openDrawer,
      reload,
      useDrawers[index][item][1].openDrawer,
      useTables[item][1].reload,
      null,
      useForm,
      useModal,
      go,
      setProps,
      useTables[item][1].setProps,
    );
  }
@@ -202,7 +237,7 @@
    return validates;
  }
  function handleCreate() {
  function handleCreate(index, item) {
    validate().then((res) => {
      const Keys = Object.getOwnPropertyNames(useFormData.value);
      let i;
@@ -214,11 +249,11 @@
            ? res[Keys[i]][objParams['mCode']]
            : res[Keys[i]][objParams['pCode']];
      }
      openDrawer(true, {
      useDrawers[index][item][1].openDrawer(true, {
        isUpdate: false,
        ifSave: true,
        entityName: props.entityName,
        formJson: GetCrudForm(), //getFormSchema(`${entityName.value}_Crud`),
        formJson: GetCrudForm(item), //getFormSchema(`${entityName.value}_Crud`),
        crudColSlots: props.crudColSlots,
        others: others.value,
      });
@@ -231,17 +266,17 @@
   * @param {*} u
   * @return {*}
   */
  function handleSuccess(d, u) {
  function handleSuccess(d, u, item) {
    if (!isNullOrUnDef(custImport.value)) {
      /* 自定义编辑方法,根据实体名去调用 */
      EditOperation(data, d, u);
      setProps({
      EditOperation(data, d, u, item);
      useTables[item][1].setProps({
        dataSource: [],
      });
      setProps({
        dataSource: data,
      useTables[item][1].setProps({
        dataSource: data.value[item],
      });
      reload();
      useTables[item][1].reload();
    }
  }
@@ -256,14 +291,14 @@
    /* 动态import实体名.ts的自定义方法 */
    try {
      import(
        `../entityts/${getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}.ts`
        `../entityts/${useTables[item][1].getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}.ts`
      )
        .then((m) => {
          const [{ GetSelectSuccess }] = m.default();
          getForm().setFieldsValue(GetSelectSuccess(d, u));
          useTables[item][1].getForm().setFieldsValue(GetSelectSuccess(d, u));
        })
        .catch(() => {
          getForm().setFieldsValue({
          useTables[item][1].getForm().setFieldsValue({
            ITEM_CODE: d.values['val'],
          });
        });
src/views/tigerprojects/system/lowcode/high/index.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-18 15:09:48
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-26 03:14:29
 * @LastEditTime: 2024-07-02 03:42:25
-->
<!--
 *                        _oo0oo_
@@ -51,11 +51,11 @@
    <Suspense>
      <baseForm />
    </Suspense>
    <a-card :title="titleInfo['baseTableTitle']" :bordered="false" class="!mt-5">
    <!-- <a-card :title="titleInfo['baseTableTitle']" :bordered="false" class="!mt-5"> -->
      <Suspense>
        <dtl :entityName="entityName" />
      </Suspense>
    </a-card>
    <!-- </a-card> -->
    <a-card
      :title="item.title"
      :bordered="false"
@@ -99,7 +99,7 @@
  </PageWrapper>
</template>
<script lang="ts" setup>
  import { Ref, h, nextTick, onMounted, provide, ref, unref } from 'vue';
  import { Ref, h, nextTick, onMounted, provide, reactive, ref, unref } from 'vue';
  import { Card } from 'ant-design-vue';
  import { PageWrapper } from '/@/components/Page';
  import dtl from './dtl.vue';
@@ -119,6 +119,7 @@
  import { buildUUID } from '/@/utils/uuid';
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
  import { useI18n } from '/@/hooks/web/useI18n';
import { Reactified } from '@vueuse/core';
  const { t } = useI18n();
@@ -151,9 +152,12 @@
  const isMounted = ref(false);
  const custImport = ref<any[]>([]);
  const others = ref<any>(null);
  const data = ref<Recordable[]>([]);
  const data = ref<any>({});
  for(const i in objParams.value['drawers']){
    data.value[objParams.value['drawers'][i]['name']] = ref<Recordable[]>([]);
  }
  provide<Ref<any>>('objParams', objParams.value);
  provide<Ref<Recordable[]>>('data', data);
  provide<Ref<any>>('data', data);
  provide<Ref<any>>('others', others);
  provide<Ref<{}>>('useFormData', useFormData);
  provide<Ref<any>>('baseCards', baseCards);
src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -85,9 +85,9 @@
    {
      ActionItem(params, data, ...args) {},
      EditOperation(data, d, u) {},
      GetBaseColumns() {},
      GetSearchForm() {},
      GetCrudForm(type: string) {},
      GetBaseColumns(type: string | undefined) {},
      GetSearchForm(type: string | undefined) {},
      GetCrudForm(type: string | undefined, ...args) {},
      OthersValues(val, id) {},
    } as EntityCustFunctionType,
  ]);