Ben Lin
2024-07-03 46c3d28c5633baaddad0da441185310b9360a45b
高级表单优化
已修改22个文件
250 ■■■■ 文件已修改
src/api/tigerapi/model/basModel.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/data.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/detail/detail.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/detail/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/dtl.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/index.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/mainTable.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normalDrawer.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/model/basModel.ts
@@ -131,7 +131,7 @@
  GetCrudForm: (type: string | undefined,) => [] | {};
  GetBaseForm: () => [] | {};
  GetBaseCards: (type: string | undefined) => [];
  OthersValues: (val: string, id: string) => {};
  KeyFieldValues: (val: string, id: string) => {};
  GetTitle: (type: string | undefined) => {};
  GetCrudColSlots: () => [];
  nodeChange: ({}) => void;
@@ -147,4 +147,5 @@
  GetSlots: (type: string | undefined) => {};
  GenerateHtml: (type: string | null) => HTMLElement | null;
  CustFunc: (type: string | undefined, ...args) => void | any;
  SubmitAll: (data: Ref<any[]>) => void | any;
}
src/views/tigerprojects/system/lowcode/data.ts
@@ -30,7 +30,7 @@
 *  5. 初始化表格 GetBasicColumnAndInit
 *  6. 设置返回 getHomeUrl
 *  7. 设置标题 getTitle
 *  8. 设置新增时就默认的值 getOthersValues
 *  8. 设置新增时就默认的值 getKeyFieldValues
 *  9. 替换删除方法 GetActionsData
 * @param {*} params
 * @param {array} args
src/views/tigerprojects/system/lowcode/detail/detail.vue
@@ -47,7 +47,7 @@
  });
  const objParams = inject('objParams') as Ref<any>;
  const data = inject('data') as Ref<Recordable[]>;
  const others = inject('others') as Ref<Recordable[]>;
  const keyFieldValues = inject('keyFieldValues') as Ref<Recordable[]>;
  const go = useGo();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
@@ -60,11 +60,11 @@
  const EntityCustFunction = ref([
    {
      ActionItem(params, data, ...args) {},
      EditOperation(data, d, u) {},
      EditOperation(data, d, u, item) {},
      GetBaseColumns(type: string | undefined) {},
      GetSearchForm(type: string | undefined) {},
      GetCrudForm(type: string | undefined, ...args) {},
      OthersValues(val, id) {},
      KeyFieldValues(val, id) {},
      GetSelectSuccess(d, u, ...args) {},
      OpenSelectItem(openItemModal: Fn, ...args) {},
    } as EntityCustFunctionType,
@@ -80,18 +80,18 @@
      GetBaseColumns,
      GetSearchForm,
      GetCrudForm,
      OthersValues,
      KeyFieldValues,
      GetSelectSuccess,
      OpenSelectItem,
    },
  ] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
    : custImport.value['default']();
  others.value = OthersValues(objParams['CODE'], objParams['ID']);
  keyFieldValues.value = KeyFieldValues(objParams['CODE'], objParams['ID']);
  const [registerTable, { getForm, reload, setProps }] = useTable({
    title: `${objParams['firstTitle']}列表`,
    api: getListByPage,
    searchInfo: { TABLE_NAME: objParams['Name'], ...objParams['others'] },
    searchInfo: { TABLE_NAME: objParams['Name'], ...objParams['keyFieldValues'] },
    columns: GetBaseColumns(),
    formConfig: {
      labelWidth: 140,
@@ -203,7 +203,7 @@
      entityName: props.entityName,
      formJson: GetCrudForm(), //getFormSchema(`${entityName.value}_Crud`),
      crudColSlots: colSlots.value,
      others: others.value,
      keyFieldValues: keyFieldValues.value,
      isExistSql: isExistSql,
    });
  }
src/views/tigerprojects/system/lowcode/detail/index.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-25 14:41:28
 * @LastEditTime: 2024-07-03 08:46:37
-->
<template>
  <PageWrapper :title="pageTitle" :content="contentStr" contentBackground @back="goBack">
@@ -94,9 +94,9 @@
  const cType = ref('');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const others = ref<any>(null);
  const keyFieldValues = ref<any>(null);
  provide<Ref<any>>('objParams', objParams.value);
  provide<Ref<any>>('others', others);
  provide<Ref<any>>('keyFieldValues', keyFieldValues);
  const [registerCust] = useModal();
  var currentKey = ref('detailfirst');
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts
@@ -192,7 +192,7 @@
      }
      return data;
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { DFTG_CODE: val };
    } /**
     * @description: 自定义明细表中编辑返回方法
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-07-02 21:06:18
 * @LastEditTime: 2024-07-03 11:42:26
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -41,7 +41,7 @@
          Title: '新增不良代码组',
          // pCode: 'DFTG_CODE',
          IsID: false,
          drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE' }], //drawers是右边弹出增改侧框的名字列表
          drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE', type: 'one' }], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -124,7 +124,7 @@
      Title: `编辑不良代码组:${params['record']['DFTG_CODE']}`,
      pCode: 'DFTG_CODE',
      IsID: false,
      drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE' }], //drawers是右边弹出增改侧框的名字列表
      drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE', type: 'one'  }], //drawers是右边弹出增改侧框的名字列表
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${param.SessionName}_params`);
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-28 10:52:45
 * @LastEditTime: 2024-07-03 08:52:24
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -69,7 +69,7 @@
      pageTitle: '标签模板变量', //详情页面标题
      contentStr: '这里是标签模板变量管理页面,可以管理标签的模板变量或者打印过程中的变量',
      detailName: `模板[${params['record'].LABEL_NAME}]`,
      others: { LABEL_ID: params['record'].ID },
      keyFieldValues: { LABEL_ID: params['record'].ID },
      colSlots: ['BAS_LABEL_PV1add'],
    };
    go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`);
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts
@@ -209,7 +209,7 @@
        },
      ];
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { LABEL_ID: id };
    },
  };
src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts
@@ -102,7 +102,7 @@
    GetCrudForm: (type: string) => {
      return crudForms[type];
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { PKG_RULE_ID: id };
    },
    /**
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-07-02 21:03:23
 * @LastEditTime: 2024-07-03 11:42:41
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -40,7 +40,7 @@
          Title: '新增包装规则',
          pCode: 'PKG_RULE_ID',
          IsID: true,
          drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers是右边弹出增改侧框的名字列表
          drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID', type: 'one' }], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -73,7 +73,7 @@
      Title: `编辑包装规则:${params['record']['RULE_CODE']}`,
      pCode: 'PKG_RULE_ID',
      IsID: true,
      drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers是右边弹出增改侧框的名字列表
      drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID', type: 'one' }], //drawers是右边弹出增改侧框的名字列表
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${param.SessionName}_params`);
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts
@@ -201,7 +201,7 @@
      }
      return data;
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { RSNG_CODE: val };
    },
    /**
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-07-02 21:29:04
 * @LastEditTime: 2024-07-03 11:42:48
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -43,7 +43,7 @@
          Title: '新增不良原因组',
          pCode: 'RSNG_CODE',
          IsID: false,
          drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE' }], //drawers是右边弹出增改侧框的名字列表
          drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one' }], //drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -115,7 +115,7 @@
      Title: `编辑不良原因组:${params['record']['RSNG_CODE']}`,
      pCode: 'RSNG_CODE',
      IsID: false,
      drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE' }], //drawers是右边弹出增改侧框的名字列表
      drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one' }], //drawers是右边弹出增改侧框的名字列表
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${param.SessionName}_params`);
src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-02 19:41:38
 * @LastEditTime: 2024-07-03 10:15:44
 */
import { Ref, h, ref, unref } from 'vue';
@@ -251,9 +251,10 @@
      }
      return data;
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { SFTS_CODE: val };
    } /**
    }
    /**
     * @description: 自定义明细表中编辑返回方法
     * @param {string} type
     * @param {*} d
@@ -303,14 +304,15 @@
   * @return {*}
   */
  function Del(args: Fn[], params: {}) {
    const name = params['name'];
    if (!isNullOrEmpty(params['data'])) {
      var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']);
      params['data'].value = _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'],
        dataSource: params['data'].value[name],
      });
      args[1]();
    } else {
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-02 21:28:53
 * @LastEditTime: 2024-07-03 11:42:15
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -42,8 +42,8 @@
          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' },
            { name: 'MES_SHIFT', code: 'SFTS_CODE', type: 'one' },
            { name: 'MES_SHIFT_PRD', code: 'SFT_CODE', type: 'all', keyName: 'MES_SHIFT' },
          ], //drawers是右边弹出增改侧框的名字列表
        },
      };
@@ -128,8 +128,8 @@
      // 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' },
        { name: 'MES_SHIFT', code: 'SFTS_CODE', type: 'one' }, //type: one-表示需要code: 'SFTS_CODE'只要唯一值
        { name: 'MES_SHIFT_PRD', code: 'SFT_CODE', type: 'all', keyName: 'MES_SHIFT' }, //type: all-表示需要code: 'SFT_CODE'所有的值,keyName:表示需要所有值的code的实体名
      ], //drawers是右边弹出增改侧框的名字列表
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts
@@ -215,7 +215,7 @@
      }
      return data;
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { TECH_STD: val };
    },
    /**
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-07-02 21:29:12
 * @LastEditTime: 2024-07-03 11:43:01
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -43,7 +43,7 @@
          pCode: 'TECH_STD', //跳转到高级表单的关键字段名
          mCode: 'STD_CODE', //跳转到高级表单的关键字段名映射字段
          IsID: false,
          drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE' }], //IfShow: true:高级表单是否显示子表格增删改,drawers是右边弹出增改侧框的名字列表
          drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE', type: 'one' }], //IfShow: true:高级表单是否显示子表格增删改,drawers是右边弹出增改侧框的名字列表
        },
      };
    },
@@ -127,7 +127,7 @@
      pCode: 'TECH_STD', //跳转到高级表单的关键字段名
      mCode: 'STD_CODE', //跳转到高级表单的关键字段名映射字段
      IsID: false,
      drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE' }], //drawers是右边弹出增改侧框的名字列表
      drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE', type: 'one' }], //drawers是右边弹出增改侧框的名字列表
    };
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${param.SessionName}_params`);
src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts
@@ -45,7 +45,7 @@
        },
      ];
    },
    OthersValues: (val: string, id: string) => {
    KeyFieldValues: (val: string, id: string) => {
      return { RSNG_CODE: val };
    },
  };
src/views/tigerprojects/system/lowcode/high/dtl.vue
@@ -16,7 +16,6 @@
          <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"
@@ -38,9 +37,9 @@
  </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 { Ref, inject, onMounted, ref, watch } from 'vue';
  import { BasicTable, TableAction } from '/@/components/Table';
  import { useForm } from '/@/components/Form/index';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import normalDrawer from '../normalDrawer.vue';
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
@@ -60,27 +59,25 @@
    entityName: { type: String },
    crudColSlots: { type: Object as PropType<any> },
  });
  /* 主页面注入的变量 */
  const objParams = inject('objParams') as Ref<any>;
  const data = inject('data') as Ref<any>;
  const _useTables = inject('useTables') as Ref<any>;
  const useFormData = inject('useFormData') as Ref<{}>;
  const others = inject('others') as Ref<Recordable[]>;
  const keyFieldValues = inject('keyFieldValues') as Ref<Recordable[]>;
  const go = useGo();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const cType = ref('');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const baseCards = ref([] as any[]);
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  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) {},
      KeyFieldValues(val, id) {},
      GetTitle(type: string | undefined) {},
      GetUseTables(data: Ref<Recordable[]>, ...args) {},
      GetUseDrawers() {},
@@ -94,10 +91,8 @@
    {
      ActionItem: nActionItem,
      EditOperation,
      GetBaseColumns,
      GetSearchForm,
      GetCrudForm,
      OthersValues,
      KeyFieldValues,
      GetTitle,
      GetUseTables,
      GetUseDrawers,
@@ -105,11 +100,11 @@
  ] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
    : custImport.value['default']();
  others.value = OthersValues(objParams.value['CODE'], objParams.value['ID']);
  const drawers = ref<any[]>(objParams.value['drawers']);
  const useTables = GetUseTables(data, emit);
  const useDrawers = GetUseDrawers();
  _useTables.value = useTables;
  keyFieldValues.value = KeyFieldValues(objParams.value['CODE'], objParams.value['ID']); //获取一些其他有需要提供的值,这里是主页面跳转过来时带的关键字段值
  const drawers = ref<any[]>(objParams.value['drawers']); //是右侧边框列表,里面的name表示是哪一个实体,也就是高级表单中表格的名字,很多方法需要以这个名字为key
  const useTables = GetUseTables(data, emit); //高级表单中各个表格(Table)的useTable方法实现列表
  const useDrawers = GetUseDrawers(); //高级表单中各个表格(Table)的右侧边框(Drawer)的useDrawer方法实现列表
  _useTables.value = useTables; //把useTable的列表响应到从主页面注入的_useTables,这样主页面能拿到useTable的结果,从而可以使用各个表格的内置方法
  // watch(
  //   () => props.dataSource,
  //   (newVal, oldVal) => {
@@ -126,11 +121,15 @@
  //   { deep: true, immediate: true },
  // );
  /**
   * @description: 挂载组件完成时
   * @return {*}
   */
  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]}'`;
      if (!isNullOrEmpty(keyFieldValues.value[drawers.value[i].code])) {
        sqlcmd += ` And ${drawers.value[i].code} = '${keyFieldValues.value[drawers.value[i].code]}'`;
      }
      const list = await getEntity({
        sqlcmd: sqlcmd,
@@ -154,7 +153,7 @@
   * @param {*} record
   * @return {*}
   */
  function createActions(record,index, item) {
  function createActions(record, index, item) {
    const params = {
      record,
      isUpdate: true,
@@ -167,6 +166,7 @@
      useFormData,
      crudColSlots: props.crudColSlots,
      data,
      name: item, //drawers列表里面的name,表示是哪一个实体,也就是高级表单中表格的名字
    };
    const actionItem = [
      {
@@ -239,12 +239,18 @@
    return validates;
  }
  /**
   * @description: 新增按钮方法
   * @param {*} index
   * @param {*} item
   * @return {*}
   */
  function handleCreate(index, item) {
    validate().then((res) => {
      const Keys = Object.getOwnPropertyNames(useFormData.value);
      let i;
      for (i = 0; i < Keys.length; i++) {
        others.value[objParams.value['pCode']] = objParams.value['IsID']
        keyFieldValues.value[objParams.value['pCode']] = objParams.value['IsID']
          ? res[Keys[i]]['ID']
          : res[Keys[i]][objParams.value['pCode']] == '0' ||
              isNullOrUnDef(res[Keys[i]][objParams.value['pCode']])
@@ -255,9 +261,9 @@
        isUpdate: false,
        ifSave: true,
        entityName: props.entityName,
        formJson: GetCrudForm(item, data), //getFormSchema(`${entityName.value}_Crud`),
        formJson: GetCrudForm(item, data), //获取增删改表单字段
        crudColSlots: props.crudColSlots,
        others: others.value,
        keyFieldValues: keyFieldValues.value,
      });
    });
  }
@@ -266,8 +272,9 @@
   * @description: 新增编辑返回成功方法
   * @param {*} d
   * @param {*} u
   * @param {*} item 页面上循环抽屉列表传入的实体名字,作为各表格相关方法的key,从而调用各表格相关的方法,如:useTables[item][1].setProps
   * @return {*}
   */
   */
  function handleSuccess(d, u, item) {
    if (!isNullOrUnDef(custImport.value)) {
      /* 自定义编辑方法,根据实体名去调用 */
@@ -286,7 +293,7 @@
   * @description: 弹出选择框选择成功后事件
   * @param {*} d
   * @param {*} u
   * @param {*} item
   * @param {*} item 页面上循环抽屉列表传入的实体名字,作为各表格相关方法的key,从而调用各表格相关的方法,如:useTables[item][1].getForm()
   * @return {*}
   */
  function handleItemSuccess(d, u, item) {
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-07-02 22:51:31
 * @LastEditTime: 2024-07-03 14:36:19
-->
<!--
 *                        _oo0oo_
@@ -125,6 +125,7 @@
  import { buildUUID } from '/@/utils/uuid';
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { isFunction } from 'xe-utils';
  const { t } = useI18n();
@@ -159,7 +160,7 @@
  const otherCards = ref([] as any[]);
  const isMounted = ref(false);
  const custImport = ref<any[]>([]);
  const others = ref<any>(null);
  const keyFieldValues = ref<any>(null);
  const data = ref<any>({});
  const useTables = ref<any>({});
  for (const i in objParams.value['drawers']) {
@@ -167,7 +168,7 @@
  }
  provide<Ref<any>>('objParams', objParams);
  provide<Ref<any>>('data', data);
  provide<Ref<any>>('others', others);
  provide<Ref<any>>('keyFieldValues', keyFieldValues);
  provide<Ref<{}>>('useFormData', useFormData);
  provide<Ref<any>>('baseCards', baseCards);
  provide<Ref<any>>('useTables', useTables);
@@ -200,38 +201,35 @@
   * @description: 异步全部提交方法
   * @return {*}
   */
  function submitAll() {
  async function submitAll() {
    try {
      validate().then((res) => {
        const Keys = Object.getOwnPropertyNames(useFormData.value);
        let i;
        let p = [] as Promise<any>[];
        for (i = 0; i < Keys.length; i++) {
          p.push(SaveEntity(res[Keys[i]], unref(isAllUpdate), baseCards.value[i]['entityName']));
        }
        Promise.all(p).then((action) => {
          // DeleteWhere(
          //   ` ${objParams.value.pCode} = '${others.value[objParams.value.pCode]}'`,
          //   entityName.value,
          // ).then((res) => {
          //   if (res.IsSuccessed) {
          //     data.value.forEach((item) => {
          //       item.ID = buildUUID();
          //     });
          //     AddListEntity(data.value, entityName.value).then((action) => {
          //       if (action.IsSuccessed) {
          //         cancel();
          //       }
          //     });
          //   }
          // });
          let where = `${objParams.value['drawers'][0]['code']} = '${others.value[objParams.value['drawers'][0]['code']]}'`;
          data.value[objParams.value['drawers'][0]['name']].forEach((item) => {
      const validates = await validate();
      const Keys = Object.getOwnPropertyNames(useFormData.value);
      let i;
      let p = [] as Promise<any>[];
      for (i = 0; i < Keys.length; i++) {
        p.push(
          SaveEntity(validates[Keys[i]], unref(isAllUpdate), baseCards.value[i]['entityName']),
        );
      }
      await Promise.all(p);
      if (
        !custImport.value['default']()[0].SubmitAll &&
        !isFunction(custImport.value['default']()[0].SubmitAll)
      ) {
        /* 默认提交 */
        objParams.value['drawers'].forEach((d) => {
          let where = `${d['code']} = '${keyFieldValues.value[d['code']]}'`;
          /* type: all-表示需要code的所有的值 */
          if(d['type'] == 'all'){
            where = `${d['code']} in (${data.value[d['keyName']].map(value => `'${value[d['code']]}'`).join(',')})`;
          }
          data.value[d['name']].map((item) => {
            item.ID = buildUUID();
          });
          AddAfterDelete(
            objParams.value['drawers'][0]['name'],
            data.value[objParams.value['drawers'][0]['name']],
            d['name'],
            data.value[d['name']],
            where,
          ).then((action) => {
            if (action.IsSuccessed) {
@@ -239,16 +237,10 @@
            }
          });
        });
      });
      // values.ID = params.RULE_ID;
      // const action = await SaveRule({ ...values, ...testValues });
      // if (action.IsSuccessed) {
      //   await DeleteRuleDtl(params.RULE_ID);
      //   const dtlAction = await SaveRuleDtl(data.value);
      //   if (dtlAction.IsSuccessed) {
      //     cancel();
      //   }
      // }
      } else {
        /* 如果自定义提交方法存在就用自定义提交 */
        custImport.value['default']()[0].SubmitAll(data);
      }
    } catch (error) {}
  }
  async function cancel() {
src/views/tigerprojects/system/lowcode/normal/index.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-24 18:49:29
 * @LastEditTime: 2024-07-03 08:52:44
-->
<template>
  <div>
@@ -75,13 +75,13 @@
  const custImport = ref<any>(null);
  const isMounted = ref(false);
  const buttons = ref([]);
  const others = ref<any>(null);
  const keyFieldValues = ref<any>(null);
  provide<Ref<any>>('objParams', objParams.value);
  provide<Ref<any[]>>('_columns', _columns);
  provide<Ref<any[]>>('_searchFormSchema', _searchFormSchema);
  provide<Ref<any[]>>('_crudFormSchema', _crudFormSchema);
  provide<Ref<string>>('isExistSql', isExistSql);
  provide<Ref<any>>('others', others);
  provide<Ref<any>>('keyFieldValues', keyFieldValues);
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -70,7 +70,7 @@
  const _crudFormSchema = inject('_crudFormSchema') as Ref<any[]>;
  const buttons = ref<[]>(await getRoleButtons(currentRoute.value.meta.menuCode as string));
  const isExistSql = inject('isExistSql') as Ref<string>;
  const others = inject('others') as Ref<Recordable[]>;
  const keyFieldValues = inject('keyFieldValues') as Ref<Recordable[]>;
  const entityName = ref(objParams['ID']);
  const go = useGo();
  const [registerDrawer, { openDrawer }] = useDrawer();
@@ -84,11 +84,7 @@
  const EntityCustFunction = ref([
    {
      ActionItem(params, data, ...args) {},
      EditOperation(data, d, u) {},
      GetBaseColumns(type: string | undefined) {},
      GetSearchForm(type: string | undefined) {},
      GetCrudForm(type: string | undefined, ...args) {},
      OthersValues(val, id) {},
      KeyFieldValues(val, id) {},
    } as EntityCustFunctionType,
  ]);
  /* 动态import实体名.ts的自定义方法 */
@@ -98,18 +94,14 @@
  const [
    {
      ActionItem: nActionItem,
      EditOperation,
      GetBaseColumns,
      GetSearchForm,
      GetCrudForm,
      OthersValues,
      KeyFieldValues,
    },
  ] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
    : custImport.value['default']();
  others.value = isNullOrUnDef(OthersValues)
    keyFieldValues.value = isNullOrUnDef(KeyFieldValues)
    ? {}
    : OthersValues(objParams['CODE'], objParams['ID']);
    : KeyFieldValues(objParams['CODE'], objParams['ID']);
  const [registerTable, { getForm, reload, setProps }] = useTable({
    title: '列表信息',
    api: getListByPage,
src/views/tigerprojects/system/lowcode/normalDrawer.vue
@@ -108,8 +108,8 @@
        ...data.record,
      });
    } else {
      if (!isNullOrUnDef(data?.others)) {
        setFieldsValue(data?.others);
      if (!isNullOrUnDef(data?.keyFieldValues)) {
        setFieldsValue(data?.keyFieldValues);
      }
    }
  });