Ben Lin
2024-06-11 5d3661fd40aa5fe0f669edb18b1c2aed458fb4e8
低代码更新,工单更新
已删除1个文件
已修改12个文件
已添加2个文件
1813 ■■■■ 文件已修改
src/api/tigerapi/model/mesModel.ts 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/system.ts 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/default/menu/index.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/CustModal.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/bizMesWo.ts 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/data.ts 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue 147 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/data.ts 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/index.vue 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/data.ts 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/index.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/normalDrawer.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/setting/pageDetail.vue 432 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/model/mesModel.ts
@@ -232,6 +232,39 @@
};
export type MesWslistPageParams = BasicPageParams & MES_WORKSHOPParams;
export interface BIZ_MES_WO_BATCH {
  ID: string;
  CREATE_TIME: Date;
  CREATE_USER: string;
  UPDATE_TIME: Date;
  UPDATE_USER: string;
  GHOST_ROW: boolean;
  AUTH_ORG: string;
  AUTH_PROD: string;
  AUTH_WH: string;
  ORDER_NO: string;
  STATUS: number;
  ITEM_CODE: string;
  CUST_CODE: string;
  FACTORY: string;
  WS_CODE: string;
  ACT_LINE: string;
  ACT_START_TIME: Date;
  ACT_END_TIME: Date;
  STD_WORKER_QTY: number;
  ACT_WORKER_QTY: number;
  RELEASE_TIME: Date;
  RELEASE_USER: string;
  PLAN_QTY: number;
  INPUT_QTY: number;
  OUTPUT_QTY: number;
  SCRAP_QTY: number;
  STOCK_IN_QTY: number;
  UPH: number;
  UPPH: number;
  REMARK: string;
}
export type OperPageListGetResultModel = BasicFetchResult<OperListItem>;
export type CheckRulePageListGetResultModel = BasicFetchResult<CheckRuleListItem>;
export type MeslinePageListGetResultModel = BasicFetchResult<MeslineListItem>;
src/api/tigerapi/system.ts
@@ -673,7 +673,11 @@
  );
};
/* é€šç”¨æŸ¥è¯¢åˆ†é¡µ */
/**
 * @description: é€šç”¨æŸ¥è¯¢åˆ†é¡µ
 * @param {T} params
 * @return {*}
 */
export async function getListByPage<T>(params: T) {
  const Keys = Object.getOwnPropertyNames(params);
  let sqlcmd = '1=1 ';
@@ -687,7 +691,8 @@
      Keys[k] != 'TABLE_NAME' &&
      Keys[k] != 'order' &&
      Keys[k] != 'field' &&
      Keys[k] != '0'
      Keys[k] != '0' &&
      !Keys[k].toString().endsWith('PSelect_0')
    ) {
      if (!isNullOrEmpty(params[Keys[k]].length) && isTimeType(params[Keys[k]][0])) {
        sqlcmd += ` And ${Keys[k]} > '${params[Keys[k]][0]}'`;
src/layouts/default/menu/index.vue
@@ -15,10 +15,11 @@
  import { useSplitMenu } from './useLayoutMenu';
  import { openWindow } from '/@/utils';
  import { propTypes } from '/@/utils/propTypes';
  import { isUrl } from '/@/utils/is';
  import { isNullOrUnDef, isUrl } from '/@/utils/is';
  import { useRootSetting } from '/@/hooks/setting/useRootSetting';
  import { useAppInject } from '/@/hooks/web/useAppInject';
  import { useDesign } from '/@/hooks/web/useDesign';
import { getEntity } from '/@/api/tigerapi/system';
  export default defineComponent({
    name: 'LayoutMenu',
@@ -110,10 +111,30 @@
       * @param menu
       */
      function handleMenuClick(path: string) {
       function handleMenuClick(path: string) {
        if (path.split('/').length > 1 && path.split('/')[2] == 'LC') {
          const id = { ID: path.split('/')[1] };
          getEntity({
          sqlcmd: `ASSEMBLY_NAME ='${path.split('/')[1]}'`,
          entityName: 'SYS_LOW_CODE',
        }).then((data) => {
          var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
          let colSlots = [] as string[];
          for (const i in searchForms) {
            if(!isNullOrUnDef(searchForms[i]['colSlot'])){
              colSlots.push('form-'+searchForms[i]['colSlot']);
            }
          }
          var _cruds = JSON.parse(data.Data.Items[0].FORM_JSON);
          let crudColSlots = [] as string[];
          for (const i in _cruds) {
            if(!isNullOrUnDef(_cruds[i]['colSlot'])){
              crudColSlots.push(_cruds[i]['colSlot']);
            }
          }
          const id = { ID: path.split('/')[1], colSlots: colSlots, crudColSlots: crudColSlots };
          go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify(id))}`);
          });
        } else {
          go(path);
        }
src/views/components/CustModal.vue
@@ -1,3 +1,11 @@
<!--
 * @Description: è‡ªå®šä¹‰å¼¹å‡ºæ¡†ï¼Œå¯ä»¥è‡ªå®šä¹‰å¤šä¸ªè¡¨å•
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-05 15:46:07
 * @LastEditors: your name
 * @LastEditTime: 2024-06-10 23:48:05
-->
<template>
  <BasicModal
    v-bind="$attrs"
@@ -42,6 +50,7 @@
  const title = ref('');
  const width = ref('');
  const FnName = ref({});
  const mValues = ref<Recordable>({});
  const initFnName = ref({});
  const dtlSlots = ref([] as any[]);
  const formSchema = ref([] as FormSchema[]);
@@ -71,13 +80,14 @@
    formElName.value = data?.formElName; //弹框中表单名字数组
    useFormData.value = data?.formEl; //弹框中表单实例数组
    FnName.value = data?.fnName; //保存数据方法
    mValues.value = data?.values; //主表单传过来的数据
    //循环表单名数组,操作各表单字段
    formElName.value.forEach((name) => {
      if (!isNullOrUnDef(useFormData.value[name])) {
        useFormData.value[name][1].resetFields();
        if (unref(isUpdate)) {
          useFormData.value[name][1].setFieldsValue({
            ...data,
            ...mValues.value,
          });
        }
      }
@@ -85,7 +95,13 @@
    //初始化方法自定义
    if (!isNullOrEmpty(data?.initFnName)) {
      initFnName.value = data?.initFnName;
      custFunction(unref(isUpdate.value), initFnName.value[cType.value], cType.value);
      custFunction(
        unref(isUpdate.value),
        initFnName.value[cType.value],
        cType.value,
        mValues.value,
        data?.others,
      );
    }
  });
@@ -97,7 +113,10 @@
  //   { deep: true },
  // );
  /* å¼¹æ¡†ç¡®å®šæŒ‰é’®æ–¹æ³• */
  /**
   * @description: å¼¹æ¡†ç¡®å®šæŒ‰é’®æ–¹æ³•
   * @return {*}
   */
  async function handleSuccess() {
    try {
      var values = {} as any;
@@ -109,6 +128,7 @@
      }
      setModalProps({ confirmLoading: true });
      //调用自定义保存方法保存数据
      values['mValues'] = mValues.value;
      const action = await custFunction(values, FnName.value[cType.value], cType.value);
      if (action as boolean) {
        closeModal();
src/views/components/bizMesWo.ts
@@ -1,3 +1,11 @@
/*
 * @Description: å·¥å•自定义方法ts
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-05 16:10:24
 * @LastEditors: your name
 * @LastEditTime: 2024-06-10 23:49:39
 */
/* å·¥å•相关自定义方法 */
import { FunctionType } from '/@/api/tigerapi/model/systemModel';
import { GetEnum, SaveEntity, getEntity } from '/@/api/tigerapi/system';
@@ -6,11 +14,27 @@
import { useI18n } from '/@/hooks/web/useI18n';
import { uploadApi } from '/@/api/sys/upload';
import { useLocale } from '/@/locales/useLocale';
import { unref } from 'vue';
import { ref, unref } from 'vue';
import { BIZ_MES_WO_BATCH } from '/@/api/tigerapi/model/mesModel';
import { buildUUID } from '/@/utils/uuid';
import LogicFlow from '@logicflow/core';
import { BpmnElement } from '@logicflow/extension';
import { getRouteData } from '/@/api/tigerapi/mes/router';
import customEdge from '/@/components/FlowChart/src/customEdge';
import actionRect from '/@/components/FlowChart/src/actionRect';
import TestNode from '/@/components/FlowChart/src/TestNode';
import CollectNode from '/@/components/FlowChart/src/CollectNode';
import AssemblyNode from '/@/components/FlowChart/src/AssemblyNode';
import PackingNode from '/@/components/FlowChart/src/PackingNode';
import RepairNode from '/@/components/FlowChart/src/RepairNode';
const { t } = useI18n();
const { getLocale } = useLocale();
/* è‡ªå®šä¹‰æ–¹æ³• */
/**
 * @description: è‡ªå®šä¹‰æ–¹æ³•
 * @return {*}
 */
export const getWoFns: Record<string, FunctionType> = {
  handleSubmit: async (e, ...args) => {
    const values = await args[0][0].validate();
@@ -49,29 +73,150 @@
      }
    });
  },
  //工单配置保存方法
  /**
   * @description: å·¥å•配置保存方法
   * @param {*} e
   * @param {array} args
   * @return {*}
   */
  SaveCofig: (e, ...args) => {
    return new Promise((resolve, reject) => {
      try {
        const xx = e['prodinfo'];
        resolve(true);
        const form = e['prodinfo'];
        const wo = e['mValues'];
        wo.ROUTE_STATUS = 1;
        SaveEntity(wo, true, 'BIZ_MES_WO').then((action) => {
          if (action.IsSuccessed) {
            resolve(true);
          } else {
            reject(false);
          }
        });
      } catch {
        reject(false);
      } finally {
        args[0][0]({ confirmLoading: false });
      }
    });
  },
  //工单下发保存方法
  /**
   * @description: å·¥å•下发保存方法
   * @param {*} e
   * @param {array} args
   * @return {*}
   */
  SaveWoBatch: (e, ...args) => {
    return new Promise((resolve, reject) => {
      try {
        const xx = e['forminfo'];
        const form = e['forminfo'];
        const wo = e['mValues'];
        wo.ROUTE_CODE = form.ROUTE_CODE;
        wo.STATUS = 2;
        const woBatch: BIZ_MES_WO_BATCH = {
          ID: buildUUID(),
          CREATE_TIME: new Date(),
          CREATE_USER: useUserStore().getUserInfo.userId as string,
          UPDATE_TIME: new Date(),
          UPDATE_USER: useUserStore().getUserInfo.userId as string,
          GHOST_ROW: false,
          AUTH_ORG: '',
          AUTH_PROD: useUserStore().getUserInfo.prodCode as string,
          AUTH_WH: '',
          ORDER_NO: wo.ORDER_NO,
          STATUS: wo.STATUS,
          ITEM_CODE: wo.ITEM_CODE,
          CUST_CODE: wo.CUST_CODE,
          FACTORY: wo.FACTORY,
          WS_CODE: wo.WS_CODE,
          ACT_LINE: form.PLAN_LINE,
          STD_WORKER_QTY: wo.STD_WORKER_QTY,
          ACT_WORKER_QTY: wo.ACT_WORKER_QTY,
          RELEASE_TIME: new Date(),
          RELEASE_USER: useUserStore().getUserInfo.userId as string,
          PLAN_QTY: wo.PLAN_QTY,
          INPUT_QTY: wo.INPUT_QTY,
          OUTPUT_QTY: wo.OUTPUT_QTY,
          SCRAP_QTY: wo.SCRAP_QTY,
          STOCK_IN_QTY: wo.STOCK_IN_QTY,
          UPH: wo.UPH,
          UPPH: wo.UPPH,
          REMARK: wo.REMARK,
          ACT_START_TIME: wo.ACT_START_TIME,
          ACT_END_TIME: wo.ACT_END_TIME,
        };
        SaveEntity(woBatch, false, 'BIZ_MES_WO_BATCH').then((action) => {
          if (action.IsSuccessed) {
            SaveEntity(wo, true, 'BIZ_MES_WO').then((action) => {
              if (action.IsSuccessed) {
                resolve(true);
              } else {
                reject(false);
              }
            });
          } else {
            reject(false);
          }
        });
      } catch {
        reject(false);
      }
    });
  },
  initRoute: async (e, ...args) => {
    const _data = await getRouteData(args[0][0].ROUTE_CODE);
    args[0][1] = ref({
      nodes: [],
      edges: [],
    });
    return new Promise((resolve, reject) => {
      try {
        LogicFlow.use(BpmnElement);
        const lf = new LogicFlow({
          container: document.querySelector('#lfContainer'),
          edgeGenerator: (sourceNode) => {
            // console.log('a');
            // èµ·å§‹èŠ‚ç‚¹ç±»åž‹ rect æ—¶ä½¿ç”¨ è‡ªå®šä¹‰çš„è¾¹ custom-edge
            if (sourceNode.properties.isReturn) return 'custom-edge';
            // if (sourceNode.type === 'rect') return 'custom-edge';
            // return 'custom-edge';
          },
        });
        lf.register(customEdge);
        lf.register(actionRect);
        lf.register(TestNode);
        lf.register(CollectNode);
        lf.register(AssemblyNode);
        lf.register(PackingNode);
        lf.register(RepairNode);
        lf.render({});
        //通过工艺路线ID获取图形数据,并渲染
        console.log('组件已挂载', _data);
        //工艺路线全信息,包括Node、Edge和Act
        // routeConfig.routeData = _data.Data;
        if (_data.Data != null) {
          //工艺路线主信息
          const currRoute = _data.Data.route;
          _data.Data.nodes.forEach((n) => {
            n.node.properties = JSON.parse(n.node.properties);
            args[0][1].value.nodes.push(n.node);
          });
          console.log('111', args[0][1]);
          _data.Data.edges.forEach((e) => {
            e.edge.properties = JSON.parse(e.edge.properties);
            args[0][1].value.edges.push(e.edge);
          });
          _data.Data.acts.forEach((act) => {
            act.node.properties = JSON.parse(act.node.properties);
            args[0][1].value.nodes.push(act.node);
          });
          console.log('init', unref(lf).getGraphData(), JSON.parse(JSON.stringify(args[0][1])));
          lf.render(args[0][1].value);
          // lf.graphModel.resize(500, 400);
          lf.graphModel.fitView();
          lf.graphModel.translateCenter();
        }
        resolve(true);
      } catch {
        reject(false);
      } finally {
        args[0][0]({ confirmLoading: false });
      }
    });
  },
@@ -306,7 +451,12 @@
  },
];
//工艺路线弹框返回
/**
 * @description: å·¥è‰ºè·¯çº¿å¼¹æ¡†è¿”回
 * @param {*} d
 * @param {*} u
 * @return {*}
 */
export function woGetSelectSuccess(d, u) {
  return {
    ROUTE_CODE: d.values['val'],
@@ -314,7 +464,14 @@
  };
}
/* è‡ªå®šä¹‰æ¨¡æ€æ¡†æ‰“开方法 */
/**
 * @description: è‡ªå®šä¹‰æ¨¡æ€æ¡†æ‰“开方法
 * @param {Fn} openModal
 * @param {string} slotName
 * @param {Fn} others
 * @param {array} args
 * @return {*}
 */
export function woCustFn(openModal: Fn, slotName: string, others: Fn[], ...args) {
  switch (slotName) {
    case 'add':
src/views/components/data.ts
@@ -1,3 +1,11 @@
/*
 * @Description: è‡ªå®šä¹‰å¼¹å‡ºæ¡†è¯·æ•°æ®
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-05 15:50:59
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-10 23:55:12
 */
import {
  getWoFns,
  woGetSelectSuccess,
@@ -60,7 +68,13 @@
  return _formSchema;
}
/* å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸ */
/**
 * @description: å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸ
 * @param {*} d
 * @param {*} u
 * @param {string} entityName
 * @return {*}
 */
export function GetSelectSuccess(d, u, entityName: string) {
  let data = {};
  switch (entityName) {
@@ -77,7 +91,10 @@
  return data;
}
/* æ‰“开弹出选择框 */
/**
 * @description: æ‰“开弹出选择框
 * @return {*}
 */
export function OpenSelectItem(
  openItemModal: Fn,
  entityName: string,
src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts
@@ -55,7 +55,7 @@
    sorter: true,
    resizable: true,
    customRender: ({ record }) => {
      const status = record.STATUS;
      const status = record.ROUTE_STATUS;
      let text = '';
      let color = '';
      switch (status) {
src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue
@@ -1,3 +1,11 @@
<!--
 * @Description: å·¥å•管理页面
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-05-25 00:27:00
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-10 23:54:01
-->
<template>
  <div>
    <BasicTable @register="registerTable">
@@ -110,7 +118,7 @@
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useModal } from '/@/components/Modal';
  import { getListByPage } from '/@/api/tigerapi/system';
  import { SaveEntity, getListByPage } from '/@/api/tigerapi/system';
  import { GetSelectSuccess, OpenSelectItem, getFormSchema } from '/@/views/components/data';
  import LogicFlow from '@logicflow/core';
  import { getRouteData } from '/@/api/tigerapi/mes/router';
@@ -121,7 +129,7 @@
  import PackingNode from '/@/components/FlowChart/src/PackingNode';
  import RepairNode from '/@/components/FlowChart/src/RepairNode';
  import customEdge from '/@/components/FlowChart/src/customEdge';
  import { Snapshot, BpmnElement, Menu, DndPanel, SelectionSelect } from '@logicflow/extension';
  import { BpmnElement } from '@logicflow/extension';
  const { t } = useI18n();
  const ASteps = Steps;
@@ -131,7 +139,7 @@
  const mtitle = ref('工单列表');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const { createMessage } = useMessage();
  const { createMessage, createErrorModal } = useMessage();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const compState = reactive({
    absolute: false,
@@ -171,7 +179,6 @@
  const formSchema = ref([] as FormSchema[]);
  const woSchema = ref([] as FormSchema[]);
  const prodSchema = ref([] as FormSchema[]);
  const rotSchema = ref([] as FormSchema[]);
  const isCustEl = ref({
    forminfo: false,
    woinfo: false,
@@ -262,6 +269,7 @@
    woSchema.value = getFormSchema('woinfo');
    prodSchema.value = getFormSchema('prodinfo');
    // rotSchema.value = getFormSchema('rotinfo');
    //工艺路线渲染图初始化
    if (lfInstance.value != null) {
      routeData.value = {
        nodes: [],
@@ -270,6 +278,7 @@
      const lf = unref(lfInstance)!;
      lf.render({});
    }
    selectVals.value['ROUTE_CODE'] = record.ROUTE_CODE;
    openCustModal(true, {
      isUpdate: true,
      ctype: cType,
@@ -279,13 +288,27 @@
      formElName: ['woinfo', 'prodinfo', 'rotinfo'], //表单插槽名称,支持多个表单
      RowKey: '',
      fnName: { BIZ_MES_WO_Config: 'SaveCofig' }, //保存方法名
      initFnName: {}, //初始化方法名
      initFnName: { BIZ_MES_WO_Config: 'initRoute' }, //初始化方法名
      isCustEl: isCustEl.value,
      ...record,
      others: routeData.value,
      values: record, //表单记录
    });
  }
  //下发
  /**
   * @description: ä¸‹å‘
   * @param {*} record
   * @return {*}
   */
  function handleRelease(record: Recordable) {
    if (record.STATUS == 2) {
      createErrorModal({
        title: t('警告'),
        content: t('工单已经下发,不能再下发!'),
        getContainer: () => document.body,
      });
      return;
    }
    cType.value = 'BIZ_MES_WO';
    dtlSlots.value = [
      {
@@ -307,20 +330,70 @@
      fnName: { BIZ_MES_WO: 'SaveWoBatch' }, //保存方法名
      initFnName: {}, //初始化方法名
      isCustEl: isCustEl.value,
      ...record,
      values: record, //表单记录
    });
  }
  function custSuccess(d) {
    reload();
  /**
   * @description: å–消下发
   * @param {*} record
   * @return {*}
   */
  function handleUnRelease(record: Recordable) {
    if (record.STATUS == 0) {
      createErrorModal({
        title: t('警告'),
        content: t('工单是初始化状态,不能取消下发!'),
        getContainer: () => document.body,
      });
      return;
    }
    record.STATUS = 0;
    SaveEntity(record, true, 'BIZ_MES_WO').then((action) => {
      if (action.IsSuccessed) {
        createMessage.success(t('已取消下发'));
        reload();
      } else {
        createMessage.success(t('取消下发操作失败'));
      }
    });
  }
  //取消下发
  function handleUnRelease(record: Recordable) {}
  //暂停
  function handlePause(record: Recordable) {}
  //删除
  function handlePause(record: Recordable) {
    if (record.STATUS == 0) {
      createErrorModal({
        title: t('警告'),
        content: t('工单是初始化状态,不能暂停!'),
        getContainer: () => document.body,
      });
      return;
    }
    if (record.STATUS == 5) {
      createErrorModal({
        title: t('警告'),
        content: t('工单是完成状态,不能暂停!'),
        getContainer: () => document.body,
      });
      return;
    }
    record.STATUS = 4;
    SaveEntity(record, true, 'BIZ_MES_WO').then((action) => {
      if (action.IsSuccessed) {
        createMessage.success(t('已暂停'));
        reload();
      } else {
        createMessage.success(t('暂停操作失败'));
      }
    });
  }
  /**
   * @description: åˆ é™¤
   * @param {*} record
   * @return {*}
   */
  function handleDelete(record: Recordable) {
    const apiAction = DeleteMesWo(record.ID);
    apiAction.then((action) => {
    DeleteMesWo(record.ID).then((action) => {
      if (action.IsSuccessed) {
        createMessage.success(t('已删除'));
        reload();
@@ -329,7 +402,20 @@
      }
    });
  }
  //点击打开物料列表框
  /**
   * @description: å¼¹å‡ºæ¡†ç¡®å®šè¿”回
   * @param {*} d
   * @return {*}
   */
  function custSuccess(d) {
    reload();
  }
  /**
   * @description: ç‚¹å‡»æ‰“开物料列表框
   * @return {*}
   */
  function handleSelectItem() {
    openItemModal(true, {
      title: '物料列表',
@@ -364,28 +450,45 @@
    });
  }
  /**
   * @description: å¼¹å‡ºé€‰æ‹©ç‰©æ–™æ¡†è¿”回成功方法
   * @param {*} d
   * @param {*} u
   * @return {*}
   */
  function handleItemSuccess(d, u) {
    getForm().setFieldsValue({
      ITEM_CODE: d.values['val'],
    });
  }
  /* å„表单内弹出选择框选择成功后事件 */
  /**
   * @description: å„表单内弹出选择框选择成功后方法
   * @param {*} d
   * @param {*} u
   * @param {*} item
   * @return {*}
   */
  function handleEntSuccess(d, u, item) {
    var values = GetSelectSuccess(d, u, cType.value);
    selectVals.value = values; //保存弹出框选择的结果
    let _val = {};
    _val[d.returnFieldName] = values[d.returnFieldName];
    useFormData.value[item][1].setFieldsValue(_val);
    if (d.returnFieldName == 'ROUTE_CODE') {
    if (d.returnFieldName == 'ROUTE_CODE' && cType.value == 'BIZ_MES_WO_Config') {
      routeData.value = {
        nodes: [],
        edges: [],
      };
      init(selectVals.value['ID']);
      init(selectVals.value['ROUTE_CODE']);
    }
  }
  /* å¼¹å‡ºé€‰æ‹©æ¡† */
  /**
   * @description: å¼¹å‡ºé€‰æ‹©æ¡†
   * @param {*} item
   * @return {*}
   */
  function handleCustClick(item) {
    //打开自定义模态框
    OpenSelectItem(
@@ -393,7 +496,7 @@
      cType.value,
      item,
      [openRvModal],
      selectVals.value['ID'],
      selectVals.value['ROUTE_CODE'],
    ); //[openRvModal], selectVals.value['ID']这是自定义参数,按实际需求
  }
  function RvItemSuccess(d, u) {}
src/views/tigerprojects/system/lowcode/data.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,288 @@
/*
 * @Description: é€šç”¨ä½Žä»£ç å‘ˆçŽ°é¡µé¢ä¸»æ•°æ®
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-02 17:52:35
 * @LastEditors: your name
 * @LastEditTime: 2024-06-11 01:59:13
 */
import { ref } from 'vue';
import {
  DftGrpRelease,
  dftGrpActionItem,
  dftGrpOpenSelectItem,
  dftGrpGetSelectSuccess,
  dftGrpactionColumn,
} from './normal/basDefectGrp';
import { onChangeFns, rsGrpGetSelectSuccess, rsGrpOpenSelectItem } from './normal/basReasonGrp';
import { DeleteEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
import { isNullOrEmpty } from '/@/utils/is';
import { woCustFn, woformSchema } from '/@/views/components/bizMesWo';
import { useModal } from '/@/components/Modal';
const { t } = useI18n();
/**
 * @description: ä½Žä»£ç é¡µé¢èŽ·å–æ“ä½œå­—æ®µç»“æž„Json,如增加按钮及方法
 * @param {*} params
 * @param {array} args
 * @return {*}
 */
export function GetActionsData(params: {}, ...args: Fn[]) {
  let data = [
    {
      icon: 'clarity:note-edit-line',
      onClick: editRecord.bind(null, args[0], params),
    },
    {
      icon: 'ant-design:delete-outlined',
      color: 'error',
      popConfirm: {
        title: '是否确认删除?',
        placement: 'left',
        confirm: deleteRecord.bind(null, args[1], params),
      },
    },
  ] as ActionItem[];
  switch (params['entityName']) {
    case 'BAS_DEFECT_GRP':
      const _d = dftGrpActionItem;
      _d[0].onClick = DftGrpRelease.bind(null, args, params);
      data = [...data, ..._d];
      params.cType.value = 'BIZ_MES_WO';
      params.formSchemas.value[params.cType.value] = getFormSchema(params.cType.value);
      params.useFormData.value = {
        forminfo: args[3]({
          labelWidth: 120,
          schemas: params.formSchemas.value[params.cType.value],
          actionColOptions: {
            span: 24,
          },
          showActionButtonGroup: false,
        }),
      };
      break;
  }
  return data;
}
export function GetUseModalData(type: string) {
  let data = {};
  switch (type) {
    case 'BAS_DEFECT_GRP':
      data = {
        add: useModal(),
        set: useModal(),
        addRot: useModal(),
        setRot: useModal(),
      };
      break;
  }
  return data;
}
function editRecord(fn: Fn, params: {}) {
  fn(true, params);
}
function deleteRecord(fn: Fn, params: {}) {
  console.log(params['record']);
  //删除
  const apiAction = DeleteEntity(params['record'], params['entityName']);
  apiAction.then((action) => {
    if (action.IsSuccessed) {
      fn();
    }
  });
}
export function GetActionColumn(entityName: string) {
  let data: BasicColumn = {};
  switch (entityName) {
    case 'BAS_DEFECT_GRP':
      data = dftGrpactionColumn;
      break;
    default:
      data = {
        width: 80,
        title: '操作',
        dataIndex: 'action',
        slots: { customRender: 'action' },
        fixed: undefined,
      };
      break;
  }
  return data;
}
/* å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸ */
export function GetSelectSuccess(d, u, entityName: string) {
  let data = {};
  switch (entityName) {
    case 'BAS_DEFECT_GRP':
      data = dftGrpGetSelectSuccess(d, u);
      break;
    case 'BAS_REASON_GRP':
      data = rsGrpGetSelectSuccess(d, u);
      break;
    default:
      data = {
        ITEM_CODE: d.values['val'],
      };
      break;
  }
  return data;
}
/**
 * @description: æ‰“开弹出选择框
 * @param {Fn} openItemModal
 * @param {string} entityName
 * @return {*}
 */
export function OpenSelectItem(openItemModal: Fn, entityName: string) {
  switch (entityName) {
    case 'BAS_DEFECT_GRP':
      dftGrpOpenSelectItem(openItemModal);
      break;
    case 'BAS_REASON_GRP':
      rsGrpOpenSelectItem(openItemModal);
      break;
    default:
      openItemModal(true, {
        title: '物料列表',
        schemas: [
          {
            field: 'ITEM_CODE',
            component: 'Input',
            label: '物料编码',
            colProps: {
              span: 12,
            },
          },
        ],
        ItemColumns: [
          {
            title: t('物料编码'),
            dataIndex: 'ITEM_CODE',
            resizable: true,
            sorter: true,
            width: 200,
          },
          {
            title: t('物料名称'),
            dataIndex: 'ITEM_NAME',
            resizable: true,
            sorter: true,
            width: 180,
          },
        ],
        tableName: 'BAS_ITEM',
        rowKey: 'ITEM_CODE',
      });
      break;
  }
}
/**
 * @description: Select è‡ªå®šä¹‰onChange方法
 * @param {any} e
 * @param {string} fnName
 * @param {string} entityName
 * @return {*}
 */
export function custOnChange(e: any, fnName: string, entityName: string) {
  if (!isNullOrEmpty(fnName)) {
    switch (entityName) {
      case 'BAS_REASON':
        onChangeFns[fnName](e);
        break;
      default:
        break;
        (e) => {};
    }
  } else {
    (e) => {};
  }
}
/**
 * @description: æ‰“开自定义弹出框方法
 * @return {*}
 */
export function OpenCustModal(
  openItemModal: Fn,
  entityName: string,
  slotName: string,
  others: Fn[],
  ...args
) {
  switch (entityName) {
    case 'BIZ_MES_WO':
    case 'BIZ_MES_WO_Config': //根据带入的名称打开不同的实体列表
      woCustFn(openItemModal, slotName, others, args);
      break;
    default: //默认打开物料列表
      openItemModal(true, {
        title: '物料列表',
        schemas: [
          {
            field: 'ITEM_CODE',
            component: 'Input',
            label: '物料编码',
            colProps: {
              span: 12,
            },
          },
        ],
        ItemColumns: [
          {
            title: t('物料编码'),
            dataIndex: 'ITEM_CODE',
            resizable: true,
            sorter: true,
            width: 200,
          },
          {
            title: t('物料名称'),
            dataIndex: 'ITEM_NAME',
            resizable: true,
            sorter: true,
            width: 180,
          },
        ],
        tableName: 'BAS_ITEM',
        rowKey: 'ITEM_CODE',
      });
      break;
  }
}
/**
 * @description: èŽ·å–è‡ªå®šä¹‰å¼¹å‡ºæ¡†ä¸­è¡¨å•çš„ç»“æž„
 * @param {string} type
 * @return {*}
 */
export function getFormSchema(type: string) {
  let _formSchema = [] as FormSchema[];
  switch (type) {
    case 'BIZ_MES_WO':
      _formSchema = woformSchema;
      break;
    // case 'woinfo':
    //   _formSchema = woCfgformSchema;
    //   break;
    // case 'prodinfo':
    //   _formSchema = prodCfgformSchema;
    //   break;
    // case 'xxinfo':
    //   _formSchema = xxCfgformSchema;
    // break;
    default:
      break;
      (e) => {};
  }
  return _formSchema;
}
src/views/tigerprojects/system/lowcode/high/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,294 @@
<!--
 * @Description: ä½Žä»£ç é«˜çº§å‘ˆçŽ°é¡µé¢
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: your name
 * @LastEditTime: 2024-06-11 02:02:14
-->
<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"
        />
        <NormalModal @register="registerItemAdd" @success="(d, u) => handleItemSuccess(d, u, item)" />
      </template>
    </BasicTable>
    <normalDrawer @register="registerDrawer" @success="handleSuccess" />
    <CustModal
      @register="registerCust"
      @success="custSuccess"
      :type="cType"
      :detailSlots="dtlSlots"
    >
      <!-- ç”¨æ’槽自定义多表单 -->
      <template #[item.name] v-for="item in dtlSlots" :key="item.name">
        <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
          <!-- ç”¨æ’槽自定义弹出选择框 -->
          <template #[name]="{ field }" v-for="name in item.slots" :key="name">
            <a-button
              class="mt-1 ml-1"
              size="small"
              @click="handleCustClick(field)"
              :preIcon="item.preIcons[name]"
            />
            <NormalModal
              @register="useModalData[name][0]"
              @success="(d, u) => handleEntSuccess(d, u, item.name)"
            />
          </template>
        </BasicForm>
        <!-- è‡ªå®šä¹‰å†…容 -->
      </template>
    </CustModal>
  </div>
</template>
<script lang="ts" setup>
  import { h, onMounted, ref, unref } from 'vue';
  import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table';
  import { useDrawer } from '/@/components/Drawer';
  import normalDrawer from './normalDrawer.vue';
  import NormalModal from '/@/views/components/NormalModal.vue';
  import { GetEnum, getEntity, getListByPage } from '/@/api/tigerapi/system';
  import { useGlobSetting } from '/@/hooks/setting';
  import { useRoute } from 'vue-router';
  import { Tag, Tooltip } from 'ant-design-vue';
  import CustModal from '/@/views/components/CustModal.vue';
  import { BasicForm, FormActionType, useForm } from '/@/components/Form/index';
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
  import {
    GetActionColumn,
    GetActionsData,
    OpenSelectItem,
    GetSelectSuccess,
    custOnChange,
    getFormSchema,
    OpenCustModal,
    GetUseModalData,
  } from './data';
  import { useModal } from '/@/components/Modal';
  import { useLocale } from '/@/locales/useLocale';
  const { getLocale } = useLocale();
  const route = useRoute();
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  const entityName = ref(objParams.value.ID);
  const globSetting = useGlobSetting();
  const _columns = ref([]);
  const _searchFormSchema = ref([]);
  const _crudFormSchema = ref([]);
  const formSchemas = ref({}); //弹出框多表单结构
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const useFormData = ref({});
  const colSlots = ref<any>(objParams.value.colSlots); //按钮插槽
  const crudColSlots = ref<any>(objParams.value.crudColSlots);
  const cType = ref('');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerTable, { getForm, reload }] = useTable({
    title: '列表信息',
    api: getListByPage,
    searchInfo: { TABLE_NAME: objParams.value.ID },
    columns: _columns as unknown as BasicColumn[],
    formConfig: {
      labelWidth: 140,
      schemas: _searchFormSchema as unknown as FormSchema[],
    },
    useSearchForm: true,
    showTableSetting: true,
    bordered: true,
    canResize: true,
    showIndexColumn: false,
    actionColumn: GetActionColumn(objParams.value.ID), //自定义操作列
  });
  /* ç”Ÿæˆåˆ—表中操作项的按钮 */
  function createActions(record) {
    return GetActionsData(
      {
        record,
        isUpdate: true,
        entityName: objParams.value.ID,
        formJson: _crudFormSchema.value,
        cType,
        dtlSlots,
        formSchemas,
        useModalData,
        useFormData,
        crudColSlots,
      },
      openDrawer,
      reload,
      openCustomModal,
      useForm,
      useModal,
    );
  }
  function handleCreate() {
    openDrawer(true, {
      isUpdate: false,
      entityName: objParams.value.ID,
      formJson: _crudFormSchema.value,
      crudColSlots,
    });
  }
  function handleSuccess() {
    reload();
  }
  onMounted(async () => {
    /* ç”¨json获取列 */
    // _searchFormSchema.value = await fetchJson(
    //   `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Searchform.json`,
    // );
    // var objs = await fetchJson(
    //   `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Baseform.json`,
    // );
    // for (const i in objs) {
    //   if (!isNullOrEmpty(objs[i].customRender)) {
    //     const func = new Function(objs[i].customRender)();
    //     objs[i].customRender = ({ record }) => {
    //       let texts = func(record);
    //       return h(Tooltip, { title: texts.text }, () =>
    //         h(Tag, { color: texts.color }, () => texts.text),
    //       );
    //     };
    //   }
    // }
    // _columns.value = objs;
    //获取表单中插槽渲染的按钮点击弹出模态窗口的实例
    useModalData.value = GetUseModalData(objParams.value.ID);
    const data = await getEntity({
      sqlcmd: "ASSEMBLY_NAME ='" + objParams.value.ID + "'",
      entityName: 'SYS_LOW_CODE',
    });
    var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
    for (const i in searchForms) {
      if (
        !isNullOrEmpty(searchForms[i].componentProps) &&
        !isNullOrEmpty(searchForms[i].componentProps.api) &&
        searchForms[i].componentProps.api == 'GetEnum'
      ) {
        searchForms[i].componentProps.api = GetEnum;
        searchForms[
          i
        ].componentProps.params.name = `${objParams.value.ID}+${searchForms[i].field}s`;
        searchForms[i].componentProps.labelField = unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name';
      }
      if (
        !isNullOrEmpty(searchForms[i].componentProps) &&
        !isNullOrEmpty(searchForms[i].componentProps.api) &&
        searchForms[i].componentProps.api == 'getEntity'
      ) {
        searchForms[i].componentProps.api = getEntity;
        searchForms[i].componentProps.resultField = 'Data.Items';
      }
      onChangeConfig(searchForms[i]);
    }
    _searchFormSchema.value = searchForms;
    var _cruds = JSON.parse(data.Data.Items[0].FORM_JSON);
    for (const i in _cruds) {
      if (
        !isNullOrEmpty(_cruds[i].componentProps) &&
        !isNullOrEmpty(_cruds[i].componentProps.api) &&
        _cruds[i].componentProps.api == 'GetEnum'
      ) {
        _cruds[i].componentProps.api = GetEnum;
        _cruds[i].componentProps.params.name = `${objParams.value.ID}+${_cruds[i].field}s`;
        _cruds[i].componentProps.labelField = unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name';
      }
      if (
        !isNullOrEmpty(_cruds[i].componentProps) &&
        !isNullOrEmpty(_cruds[i].componentProps.api) &&
        _cruds[i].componentProps.api == 'getEntity'
      ) {
        _cruds[i].componentProps.api = getEntity;
        _cruds[i].componentProps.resultField = 'Data.Items';
      }
      onChangeConfig(_cruds[i]);
    }
    _crudFormSchema.value = _cruds;
    var objs = JSON.parse(data.Data.Items[0].BASE_FORM_JSON);
    for (const i in objs) {
      if (!isNullOrEmpty(objs[i].customRender)) {
        const func = new Function(objs[i].customRender)();
        objs[i].customRender = ({ record }) => {
          let texts = func(record);
          return h(Tooltip, { title: texts.text }, () =>
            h(Tag, { color: texts.color }, () => texts.text),
          );
        };
      }
    }
    _columns.value = objs;
  });
  /* å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸåŽäº‹ä»¶ */
  function handleItemSuccess(d, u, item) {
    getForm().setFieldsValue(GetSelectSuccess(d, u, getForm().getFieldsValue()[`${item.replace(/form-/,'').replace(/add/,'')}PSelect_0`]));
  }
  /* å¼¹å‡ºé€‰æ‹©æ¡† */
  function handleSelectItem(item) {
    OpenSelectItem(openItemModal, getForm().getFieldsValue()[`${item.replace(/form-/,'').replace(/add/,'')}PSelect_0`]);
  }
  /* Select è‡ªå®šä¹‰onChange方法 */
  function onChangeConfig(obj: any) {
    if (obj.component == 'Select') {
      var options = obj.componentProps.options;
      var onChange = obj.componentProps.onChange;
      obj.componentProps = ({ schema, tableAction, formActionType, formModel }) => {
        return {
          options: options,
          onChange: (e) => custOnChange(e, onChange, objParams.value.ID),
        };
      };
    }
  }
  //弹出框确定返回
  function custSuccess(d) {
    reload();
  }
  /* å„表单内弹出选择框选择成功后方法 */
  function handleEntSuccess(d, u, item) {
    var values = GetSelectSuccess(d, u, cType.value);
    selectVals.value = values; //保存弹出框选择的结果
    let _val = {};
    _val[d.returnFieldName] = values[d.returnFieldName];
    useFormData.value[item][1].setFieldsValue(_val);
  }
  /* æ‰“开自定义模态框 */
  function handleCustClick(item) {
    OpenCustModal(
      useModalData.value[item][1].openModal, //带入openModal方法
      cType.value,
      item,
      [],
      // selectVals.value['ROUTE_CODE'],
    ); //[openRvModal], selectVals.value['ID']这是自定义参数,按实际需求
  }
</script>
src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts
@@ -1,18 +1,49 @@
import { ActionItem, BasicColumn } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getFormSchema } from '/@/views/components/data';
import { ref } from 'vue';
const { t } = useI18n();
const { notification } = useMessage();
const { notification, createErrorModal } = useMessage();
/* è‡ªå®šä¹‰æŒ‰é’®æ–¹æ³• */
export function DftGrpRelease(reload: Fn, params: {}) {
export function DftGrpRelease(args: Fn[], params: {}) {
  console.log('点击了下发按钮');
  notification.success({
    message: '点击了下发按钮',
    description: `${params.entityName}`,
    duration: 3,
  // notification.success({
  //   message: '点击了下发按钮',
  //   description: `${params.entityName}`,
  //   duration: 3,
  // });
  // reload();
  // if (params.STATUS == 2) {
  //   createErrorModal({
  //     title: t('警告'),
  //     content: t('工单已经下发,不能再下发!'),
  //     getContainer: () => document.body,
  //   });
  //   return;
  // }
  params.dtlSlots.value = [
    {
      name: 'forminfo',
      slots: ['add', 'set'],
      preIcons: { add: 'search|svg', set: 'config|svg' }, //如果是多个表单,增加多个插槽。slots是弹出框按钮的插槽,preIcons是插槽对应的按钮图标
      title: '下发配置',
    },
  ];
  args[2](true, {
    isUpdate: true, //是否更新操作
    ctype: params.cType.value, //是哪个页面
    title: '工单下发', //标题
    width: '900px', //弹出框宽度
    formEl: params.useFormData.value,
    formElName: ['forminfo'], //表单插槽名称
    RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //插槽的弹出框选择的code
    fnName: { BIZ_MES_WO: 'SaveWoBatch' }, //保存方法名
    initFnName: {}, //初始化方法名
    values: params.record, //表单记录
  });
  reload();
}
export const dftGrpactionColumn: BasicColumn = {
src/views/tigerprojects/system/lowcode/normal/data.ts
ÎļþÒÑɾ³ý
src/views/tigerprojects/system/lowcode/normal/index.vue
@@ -1,3 +1,11 @@
<!--
 * @Description: ä½Žä»£ç å‘ˆçŽ°é¡µé¢
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: your name
 * @LastEditTime: 2024-06-11 01:27:02
-->
<template>
  <div>
    <BasicTable @register="registerTable">
@@ -7,18 +15,45 @@
      <template #action="{ record }">
        <TableAction :actions="createActions(record)" />
      </template>
      <template #form-add="{ field }">
      <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"
          @click="handleSelectItem(item)"
          preIcon="search|svg"
        />
        <NormalModal @register="registerItemAdd" @success="handleItemSuccess" />
        <NormalModal @register="registerItemAdd" @success="(d, u) => handleItemSuccess(d, u, item)" />
      </template>
    </BasicTable>
    <normalDrawer @register="registerDrawer" @success="handleSuccess" />
    <CustModal
      @register="registerCust"
      @success="custSuccess"
      :type="cType"
      :detailSlots="dtlSlots"
    >
      <!-- ç”¨æ’槽自定义多表单 -->
      <template #[item.name] v-for="item in dtlSlots" :key="item.name">
        <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
          <!-- ç”¨æ’槽自定义弹出选择框 -->
          <template #[name]="{ field }" v-for="name in item.slots" :key="name">
            <a-button
              class="mt-1 ml-1"
              size="small"
              @click="handleCustClick(field)"
              :preIcon="item.preIcons[name]"
            />
            <NormalModal
              @register="useModalData[name][0]"
              @success="(d, u) => handleEntSuccess(d, u, item.name)"
            />
          </template>
        </BasicForm>
        <!-- è‡ªå®šä¹‰å†…容 -->
      </template>
    </CustModal>
  </div>
</template>
<script lang="ts" setup>
@@ -31,14 +66,19 @@
  import { useGlobSetting } from '/@/hooks/setting';
  import { useRoute } from 'vue-router';
  import { Tag, Tooltip } from 'ant-design-vue';
  import { isNullOrEmpty } from '/@/utils/is';
  import CustModal from '/@/views/components/CustModal.vue';
  import { BasicForm, FormActionType, useForm } from '/@/components/Form/index';
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
  import {
    GetActionColumn,
    GetActionsData,
    OpenSelectItem,
    GetSelectSuccess,
    custOnChange,
  } from './data';
    getFormSchema,
    OpenCustModal,
    GetUseModalData,
  } from '../data';
  import { useModal } from '/@/components/Modal';
  import { useLocale } from '/@/locales/useLocale';
@@ -50,6 +90,16 @@
  const _columns = ref([]);
  const _searchFormSchema = ref([]);
  const _crudFormSchema = ref([]);
  const formSchemas = ref({}); //弹出框多表单结构
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const useFormData = ref({});
  const colSlots = ref<any>(objParams.value.colSlots); //按钮插槽
  const crudColSlots = ref<any>(objParams.value.crudColSlots);
  const cType = ref('');
  const dtlSlots = ref([] as any[]);
  const selectVals = ref({});
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerTable, { getForm, reload }] = useTable({
@@ -68,7 +118,6 @@
    showIndexColumn: false,
    actionColumn: GetActionColumn(objParams.value.ID), //自定义操作列
  });
  /* ç”Ÿæˆåˆ—表中操作项的按钮 */
  function createActions(record) {
    return GetActionsData(
@@ -77,9 +126,18 @@
        isUpdate: true,
        entityName: objParams.value.ID,
        formJson: _crudFormSchema.value,
        cType,
        dtlSlots,
        formSchemas,
        useModalData,
        useFormData,
        crudColSlots,
      },
      openDrawer,
      reload,
      openCustomModal,
      useForm,
      useModal,
    );
  }
@@ -88,6 +146,7 @@
      isUpdate: false,
      entityName: objParams.value.ID,
      formJson: _crudFormSchema.value,
      crudColSlots,
    });
  }
@@ -115,6 +174,9 @@
    //   }
    // }
    // _columns.value = objs;
    //获取表单中插槽渲染的按钮点击弹出模态窗口的实例
    useModalData.value = GetUseModalData(objParams.value.ID);
    const data = await getEntity({
      sqlcmd: "ASSEMBLY_NAME ='" + objParams.value.ID + "'",
      entityName: 'SYS_LOW_CODE',
@@ -182,13 +244,13 @@
  });
  /* å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸåŽäº‹ä»¶ */
  function handleItemSuccess(d, u) {
    getForm().setFieldsValue(GetSelectSuccess(d, u, getForm().getFieldsValue()['0']));
  function handleItemSuccess(d, u, item) {
    getForm().setFieldsValue(GetSelectSuccess(d, u, getForm().getFieldsValue()[`${item.replace(/form-/,'').replace(/add/,'')}PSelect_0`]));
  }
  /* å¼¹å‡ºé€‰æ‹©æ¡† */
  function handleSelectItem() {
    OpenSelectItem(openItemModal, getForm().getFieldsValue()['0']);
  function handleSelectItem(item) {
    OpenSelectItem(openItemModal, getForm().getFieldsValue()[`${item.replace(/form-/,'').replace(/add/,'')}PSelect_0`]);
  }
  /* Select è‡ªå®šä¹‰onChange方法 */
@@ -204,4 +266,29 @@
      };
    }
  }
  //弹出框确定返回
  function custSuccess(d) {
    reload();
  }
  /* å„表单内弹出选择框选择成功后方法 */
  function handleEntSuccess(d, u, item) {
    var values = GetSelectSuccess(d, u, cType.value);
    selectVals.value = values; //保存弹出框选择的结果
    let _val = {};
    _val[d.returnFieldName] = values[d.returnFieldName];
    useFormData.value[item][1].setFieldsValue(_val);
  }
  /* æ‰“开自定义模态框 */
  function handleCustClick(item) {
    OpenCustModal(
      useModalData.value[item][1].openModal, //带入openModal方法
      cType.value,
      item,
      [],
      // selectVals.value['ROUTE_CODE'],
    ); //[openRvModal], selectVals.value['ID']这是自定义参数,按实际需求
  }
</script>
src/views/tigerprojects/system/lowcode/normal/normalDrawer.vue
@@ -1,3 +1,11 @@
<!--
 * @Description: file content
 * @Author: your name
 * @version:
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: your name
 * @LastEditTime: 2024-06-11 01:11:06
-->
<template>
  <BasicDrawer
    v-bind="$attrs"
@@ -7,7 +15,18 @@
    width="600px"
    @ok="handleSubmit"
  >
    <BasicForm @register="registerForm" />
    <BasicForm @register="registerForm" >
      <template #[item]="{ field }" v-for="item in crudColSlots" :key="item">
        <a-button
          v-if="field"
          class="mt-1 ml-1"
          size="small"
          @click="handleSelectItem(item)"
          preIcon="search|svg"
        />
        <NormalModal @register="registerItemAdd" @success="(d, u) => handleItemSuccess(d, u, item)" />
      </template>
    </BasicForm>
  </BasicDrawer>
</template>
<script lang="ts" setup>
@@ -15,14 +34,19 @@
  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
  import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
  import { useGlobSetting } from '/@/hooks/setting';
  import NormalModal from '/@/views/components/NormalModal.vue';
  import { SaveEntity, fetchJson } from '/@/api/tigerapi/system';
  import { useModal } from '/@/components/Modal';
import { GetSelectSuccess, OpenSelectItem } from '../data';
  const emit = defineEmits(['success', 'register']);
  const globSetting = useGlobSetting();
  const isUpdate = ref(true);
  const entityName = ref('');
  const formSchema = ref([]);
  const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
  const crudColSlots = ref<any>([]);
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerForm, { resetFields, setFieldsValue, getFieldsValue, validate }] = useForm({
    labelWidth: 140,
    schemas: formSchema as unknown as FormSchema[],
    actionColOptions: {
@@ -40,6 +64,7 @@
    //   }_addEditform.json`,
    // );
    formSchema.value = data?.formJson;
    crudColSlots.value = data?.crudColSlots;
    resetFields();
    setDrawerProps({ confirmLoading: false });
@@ -70,4 +95,20 @@
      setDrawerProps({ confirmLoading: false });
    }
  }
  /**
   * @description: å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸåŽäº‹ä»¶
   * @param {*} d
   * @param {*} u
   * @param {*} item
   * @return {*}
   */
  function handleItemSuccess(d, u, item) {
    setFieldsValue(GetSelectSuccess(d, u, getFieldsValue()[`${item.replace(/add/,'')}PSelect_0`]));
  }
  /* å¼¹å‡ºé€‰æ‹©æ¡† */
  function handleSelectItem(item) {
    OpenSelectItem(openItemModal, getFieldsValue()[`${item.replace(/add/,'')}PSelect_0`]);
  }
</script>
src/views/tigerprojects/system/lowcode/setting/pageDetail.vue
@@ -1,3 +1,12 @@
<!--
 * @Description: ä½Žä»£ç ç”Ÿæˆé¡µé¢
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-05-30 22:00:44
 * @LastEditors: your name
 * @LastEditTime: 2024-06-11 01:50:33
-->
<!-- eslint-disable prettier/prettier -->
<template>
  <PageWrapper
    class="high-form"
@@ -74,6 +83,15 @@
          <a-input v-model:value="model[field]" />
        </template>
        <template #[item]="{ model, field }" v-for="item in searchValueFieldSlots" :key="item">
          <a-input v-model:value="model[field]" />
        </template>
        <template #[item]="{ model, field }" v-for="item in searchOptionsSlots" :key="item">
          <a-input v-model:value="model[field]" />
        </template>
        <template #[item]="{ model, field }" v-for="item in searchOnChangeSlots" :key="item">
          <a-input v-model:value="model[field]" />
        </template>
        <template #[item]="{ model, field }" v-for="item in searchPOptionsSlots" :key="item">
          <a-input v-model:value="model[field]" />
        </template>
      </BasicForm>
@@ -225,6 +243,9 @@
        <template #[item]="{ model, field }" v-for="item in crudOnChangeSlots" :key="item">
          <a-input v-model:value="model[field]" />
        </template>
        <template #[item]="{ model, field }" v-for="item in crudPOptionsSlots" :key="item">
          <a-input v-model:value="model[field]" />
        </template>
      </BasicForm>
    </a-card>
@@ -343,6 +364,9 @@
  const searchResultFieldSlots = ref([] as string[]);
  const searchLabelFieldSlots = ref([] as string[]);
  const searchValueFieldSlots = ref([] as string[]);
  const searchOptionsSlots = ref([] as string[]);
  const searchOnChangeSlots = ref([] as string[]);
  const searchPOptionsSlots = ref([] as string[]);
  /* ä¸»è¡¨ */
  const MainEntName = ref('');
  const mainSelectVals = ref({} as { [key: string]: any });
@@ -368,6 +392,7 @@
  const crudValueFieldSlots = ref([] as string[]);
  const crudOptionsSlots = ref([] as string[]);
  const crudOnChangeSlots = ref([] as string[]);
  const crudPOptionsSlots = ref([] as string[]);
  const options = ref<SelectTypes['options']>([
    {
@@ -407,18 +432,24 @@
      label: '弹出选择框',
    },
  ]);
  /**
   * @description: å®žä¾‹ç»„件挂载时
   * @return {*}
   */
  onMounted(() => {
    if (unref(objParams.value.Update) == '1') {
      getEntity({
        sqlcmd: "ID ='" + objParams.value.ID + "'",
        entityName: 'SYS_LOW_CODE',
      }).then((data) => {
        /* æŸ¥è¯¢åŠ è½½ */
        var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
        SearchEntName.value = data.Data.Items[0].SEARCH_ASSY_NAME;
        setFieldsValue({ ASSEMBLY_NAME: data.Data.Items[0].SEARCH_ASSY_NAME });
        searchForms = searchForms.filter((item) => !item['field'].toString().startsWith(SearchEntName.value) && !item['field'].toString().endsWith('PSelect_0'));
        for (const i in searchForms) {
          if (searchForms[i]['field'] != '0') {
            condAdd();
          condAdd();
            if (searchForms[i]['component'] == 'ApiSelect') {
              addApiSelectOption(`${SearchEntName.value}${Number(i) + 1}a`, 'search');
              setFieldsValue({
@@ -435,59 +466,79 @@
                  searchForms[i]['componentProps']['valueField'],
              });
            }
            if (searchForms[i]['component'] == 'Select') {
              addSelectOption(`${SearchEntName.value}${Number(i) + 1}a`, 'search');
              setFieldsValue({
                [`XSelect${SearchEntName.value}${Number(i) + 1}a`]: JSON.stringify(
                  searchForms[i]['componentProps']['options'],
                ),
                [`XOnChange${SearchEntName.value}${Number(i) + 1}a`]:
                  searchForms[i]['componentProps']['onChange'],
              });
            }
            setFieldsValue({
              [`${SearchEntName.value}${Number(i) + 1}a`]: searchForms[i]['field'],
              [`InputNumber${Number(i) + 1}`]: searchForms[i]['colProps'].span,
              [`Switch${Number(i) + 1}`]: searchForms[i]['ifShow'],
            });
            objInputs.value[`${SearchEntName.value}${Number(i) + 1}a`] = searchForms[i]['label'];
            searchSelectVals.value[`${SearchEntName.value}${Number(i) + 1}a`] = searchForms[i][
              'comp'
            ]
              ? searchForms[i]['comp']
              : searchForms[i]['component'];
          }
            searchSelectVals.value[`${SearchEntName.value}${Number(i) + 1}a`] = searchForms[i]['comp']? searchForms[i]['comp']: searchForms[i]['component'];
            if(searchForms[i]['comp']){
              addPopSelectOption(`${SearchEntName.value}${Number(i) + 1}a`, 'search');
              setFieldsValue({
                [`PSelect${SearchEntName.value}${Number(i) + 1}a`]: searchForms[i]['entityName'],
              });
            }
        }
        /* å¢žåˆ æ”¹åŠ è½½ */
        var crudForms = JSON.parse(data.Data.Items[0].FORM_JSON);
        CrudEntName.value = data.Data.Items[0].CRUD_ASSY_NAME;
        setFieldsValueCrud({ crudAssemblyName: data.Data.Items[0].CRUD_ASSY_NAME });
        crudForms = crudForms.filter((item) => !item['field'].toString().startsWith(CrudEntName.value) && !item['field'].toString().endsWith('PSelect_0'));
        for (const i in crudForms) {
          crudCondAdd();
          if (crudForms[i]['component'] == 'ApiSelect') {
            addApiSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
            if (crudForms[i]['component'] == 'ApiSelect') {
              addApiSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
              setFieldsValueCrud({
                [`ApiSelect${CrudEntName.value}${Number(i) + 1}a`]:
                  crudForms[i]['componentProps']['api'],
                [`Params${CrudEntName.value}${Number(i) + 1}a`]: JSON.stringify(
                  crudForms[i]['componentProps']['params'],
                ),
                [`Result${CrudEntName.value}${Number(i) + 1}a`]:
                  crudForms[i]['componentProps']['resultField'],
                [`Label${CrudEntName.value}${Number(i) + 1}a`]:
                  crudForms[i]['componentProps']['labelField'],
                [`Value${CrudEntName.value}${Number(i) + 1}a`]:
                  crudForms[i]['componentProps']['valueField'],
              });
            }
            if (crudForms[i]['component'] == 'Select') {
              addSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
              setFieldsValueCrud({
                [`XSelect${CrudEntName.value}${Number(i) + 1}a`]: JSON.stringify(
                  crudForms[i]['componentProps']['options'],
                ),
                [`XOnChange${CrudEntName.value}${Number(i) + 1}a`]:
                  crudForms[i]['componentProps']['onChange'],
              });
            }
            setFieldsValueCrud({
              [`ApiSelect${CrudEntName.value}${Number(i) + 1}a`]:
                crudForms[i]['componentProps']['api'],
              [`Params${CrudEntName.value}${Number(i) + 1}a`]: JSON.stringify(
                crudForms[i]['componentProps']['params'],
              ),
              [`Result${CrudEntName.value}${Number(i) + 1}a`]:
                crudForms[i]['componentProps']['resultField'],
              [`Label${CrudEntName.value}${Number(i) + 1}a`]:
                crudForms[i]['componentProps']['labelField'],
              [`Value${CrudEntName.value}${Number(i) + 1}a`]:
                crudForms[i]['componentProps']['valueField'],
              [`${CrudEntName.value}${Number(i) + 1}a`]: crudForms[i]['field'],
              [`InputNumber${Number(i) + 1}`]: crudForms[i]['colProps'].span,
              [`Switch${Number(i) + 1}`]: crudForms[i]['show'],
              [`rSwitch${Number(i) + 1}`]: crudForms[i]['required'],
            });
          }
          if (crudForms[i]['component'] == 'Select') {
            addSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
            setFieldsValueCrud({
              [`XSelect${CrudEntName.value}${Number(i) + 1}a`]: JSON.stringify(
                crudForms[i]['componentProps']['options'],
              ),
              [`XOnChange${CrudEntName.value}${Number(i) + 1}a`]:
                crudForms[i]['componentProps']['onChange'],
            });
          }
          setFieldsValueCrud({
            [`${CrudEntName.value}${Number(i) + 1}a`]: crudForms[i]['field'],
            [`InputNumber${Number(i) + 1}`]: crudForms[i]['colProps'].span,
            [`Switch${Number(i) + 1}`]: crudForms[i]['show'],
            [`rSwitch${Number(i) + 1}`]: crudForms[i]['required'],
          });
          crudInputs.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['label'];
          crudSelectVals.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['component'];
            crudInputs.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['label'];
            crudSelectVals.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['comp']? crudForms[i]['comp']: crudForms[i]['component'];
            if(crudForms[i]['comp']){
              addPopSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
              setFieldsValueCrud({
                [`PSelect${CrudEntName.value}${Number(i) + 1}a`]: crudForms[i]['entityName'],
              });
            }
        }
        /* ä¸»è¡¨åŠ è½½ */
        var objs = JSON.parse(data.Data.Items[0].BASE_FORM_JSON);
        MainEntName.value = data.Data.Items[0].ASSEMBLY_NAME;
        setFieldsValueMain({ MainAssemblyName: MainEntName.value });
@@ -506,6 +557,10 @@
    }
  });
  /**
   * @description: å…¨éƒ¨æäº¤
   * @return {*}
   */
  async function submitAll() {
    try {
      const [values, crudvalues, mainvalues] = await Promise.all([
@@ -519,9 +574,11 @@
      var searchjsons = [];
      var _json = {};
      var _n = 0;
      let firstField = '';
      for (const k in Keys) {
        console.log(`${k}:${Keys[k]}`);
        if (Keys[k].toString().startsWith(getFieldsValue().ASSEMBLY_NAME)) {
          firstField = Keys[k];
          _json['field'] = isNullOrEmpty(values[Keys[k]]) ? '' : values[Keys[k]];
          _json['label'] = objInputs.value[Keys[k]];
          _json['defaultValue'] = '';
@@ -533,6 +590,12 @@
              resultField: values[`Result${Keys[k]}`],
              labelField: values[`Label${Keys[k]}`],
              valueField: values[`Value${Keys[k]}`],
            };
          }
          if (searchSelectVals.value[Keys[k]] == 'Select') {
            _json['componentProps'] = {
              options: JSON.parse(values[`XSelect${Keys[k]}`]),
              onChange: values[`XOnChange${Keys[k]}`],
            };
          }
          _n = _n + 4;
@@ -550,15 +613,16 @@
          if (_json['component'] == 'PoPSelect') {
            _json['component'] = 'Input';
            _json['comp'] = 'PoPSelect';
            _json['entityName'] = values[`PSelect${firstField}`];
            searchjsons.push(_json);
            _json = {};
            _json['field'] = '0';
            _json['field'] = `${firstField}PSelect_0`;
            _json['label'] = '1';
            _json['defaultValue'] = '';
            _json['defaultValue'] = values[`PSelect${firstField}`];
            _json['component'] = 'Input';
            _json['colProps'] = { span: 4 };
            _json['ifShow'] = true;
            _json['colSlot'] = 'add';
            _json['colSlot'] = `${firstField}add`;
          }
          searchjsons.push(_json);
          _json = {};
@@ -612,9 +676,11 @@
      var cjsons = [];
      var cjson = {};
      var c = 0;
      let cfirstField = '';
      for (const k in cKeys) {
        console.log(`${k}:${cKeys[k]}`);
        if (cKeys[k].toString().startsWith(getFieldsValueCrud().crudAssemblyName)) {
          cfirstField = cKeys[k];
          cjson['field'] = isNullOrEmpty(crudvalues[cKeys[k]]) ? '' : crudvalues[cKeys[k]];
          cjson['label'] = isNullOrEmpty(crudInputs.value[cKeys[k]])
            ? ''
@@ -654,6 +720,21 @@
          c++;
        }
        if (!isNullOrEmpty(cjson) && c == 6) {
          //如果是弹出选择框
          if (cjson['component'] == 'PoPSelect') {
            cjson['component'] = 'Input';
            cjson['comp'] = 'PoPSelect';
            cjson['entityName'] = crudvalues[`PSelect${cfirstField}`];
            cjsons.push(cjson);
            cjson = {};
            cjson['field'] = `${cfirstField}PSelect_0`;
            cjson['label'] = '1';
            cjson['defaultValue'] = crudvalues[`PSelect${cfirstField}`];
            cjson['component'] = 'Input';
            cjson['colProps'] = { span: 4 };
            cjson['ifShow'] = true;
            cjson['colSlot'] = `${cfirstField}add`;
          }
          cjsons.push(cjson);
          c = 0;
          cjson = {};
@@ -691,7 +772,10 @@
  }
  function handleEdit(record: Recordable) {}
  /**
   * @description: æŸ¥è¯¢é…ç½®ç±»åé€‰æ‹©æŒ‰é’®æ–¹æ³•
   * @return {*}
   */
  function handleSelecNew() {
    openNewModal(true, {
      data: 'content',
@@ -699,6 +783,10 @@
    });
  }
  /**
   * @description: ä¸»è¡¨é…ç½®ç±»åé€‰æ‹©æŒ‰é’®æ–¹æ³•
   * @return {*}
   */
  function mainSelectAssy() {
    openMainModal(true, {
      data: 'content',
@@ -706,6 +794,10 @@
    });
  }
  /**
   * @description: å¢žåˆ æ”¹é…ç½®ç±»åé€‰æ‹©æŒ‰é’®æ–¹æ³•
   * @return {*}
   */
  function handleSelectCrud() {
    openCrudModal(true, {
      data: 'content',
@@ -713,6 +805,12 @@
    });
  }
  /**
   * @description: é€‰æ‹©ç±»åå¼¹å‡ºæ¡†è¿”回成功方法
   * @param {*} d
   * @param {*} u
   * @return {*}
   */
  async function mainAssySuccess(d, u) {
    setFieldsValueMain({
      MainAssemblyName: d.values['val'],
@@ -748,6 +846,15 @@
    crudProperties.value = data.items;
    CrudEntName.value = d.values['val'];
  }
  /* é€‰æ‹©ç±»åå¼¹å‡ºæ¡†è¿”回成功方法 End */
  /**
   * @description: é…ç½®å­—段选择改变后事件方法
   * @param {*} value
   * @param {*} option
   * @param {*} field
   * @return {*}
   */
  function change(value, option, field) {
    console.log(value, option, field);
    objInputs.value[field] = option.label;
@@ -760,34 +867,78 @@
    console.log(value, option, field);
    crudInputs.value[field] = option.label;
  }
  /* æŸ¥è¯¢ç»„件选择事件 */
  /* é…ç½®å­—段选择改变后事件方法 End */
  /**
   * @description: æŸ¥è¯¢ç»„件选择事件
   * @param {*} value
   * @param {*} option
   * @param {*} field
   * @return {*}
   */
  function searchOnChange(value, option, field) {
    console.log(value, option, field);
    if (value == 'ApiSelect') {
      addApiSelectOption(field, 'search');
      delSelectOption(field, 'search');
      delPSelectOption(field, 'search');
    } else {
      delApiSelectOption(field, 'search');
    }
    // if (value == 'PoPSelect') {}
    if (value == 'Select') {
      addSelectOption(field, 'search');
      delApiSelectOption(field, 'search');
      delPSelectOption(field, 'search');
    } else {
      delSelectOption(field, 'search');
    }
    if (value == 'PoPSelect') {
      addPopSelectOption(field, 'search');
      delApiSelectOption(field, 'search');
      delSelectOption(field, 'search');
    } else {
      delPSelectOption(field, 'search');
    }
  }
  /* å¢žåˆ æ”¹ç»„件选择事件 */
  /**
   * @description: å¢žåˆ æ”¹ç»„件选择事件
   * @param {*} value
   * @param {*} option
   * @param {*} field
   * @return {*}
   */
  function componentChange(value, option, field) {
    console.log(value, option, field);
    if (value == 'ApiSelect') {
      addApiSelectOption(field, 'crud');
      delSelectOption(field, 'crud');
      delPSelectOption(field, 'crud');
    } else {
      delApiSelectOption(field, 'crud');
    }
    if (value == 'Select') {
      addSelectOption(field, 'crud');
      delApiSelectOption(field, 'crud');
      delPSelectOption(field, 'crud');
    } else {
      delSelectOption(field, 'crud');
    }
    // if (value == 'PoPSelect') {}
    if (value == 'PoPSelect') {
      addPopSelectOption(field, 'crud');
      delApiSelectOption(field, 'crud');
      delSelectOption(field, 'crud');
    } else {
      delPSelectOption(field, 'crud');
    }
  }
  /**
   * @description: é€‰æ‹©äº†ApiSelect组件选项后,增加相应的输入项
   * @param {*} field
   * @param {*} type
   * @return {*}
   */
  function addApiSelectOption(field: string, type: string) {
    const appendData: FormSchema[] = [
      {
@@ -838,7 +989,11 @@
    }
  }
  /* å¢žåˆ æ”¹ApiSelect插槽数据添加 */
  /**
   * @description: å¢žåˆ æ”¹ApiSelect插槽数据添加
   * @param {*} field
   * @return {*}
   */
  function crudSlotsPush(field: string) {
    crudApiSlots.value.push(`Api${field}`);
    crudParamsSlots.value.push(`Params_${field}`);
@@ -846,7 +1001,12 @@
    crudLabelFieldSlots.value.push(`LabelField${field}`);
    crudValueFieldSlots.value.push(`ValueField${field}`);
  }
  /* æŸ¥è¯¢ApiSelect插槽数据添加 */
  /**
   * @description: æŸ¥è¯¢ApiSelect插槽数据添加
   * @param {*} field
   * @return {*}
   */
  function searchSlotsPush(field: string) {
    searchApiSlots.value.push(`Api${field}`);
    searchParamsSlots.value.push(`Params_${field}`);
@@ -855,6 +1015,12 @@
    searchValueFieldSlots.value.push(`ValueField${field}`);
  }
  /**
   * @description: å–消ApiSelect组件后删除添加的输入项
   * @param {*} field
   * @param {*} type
   * @return {*}
   */
  function delApiSelectOption(field: string, type: string) {
    const removeData: string[] = [
      `ApiSelect${field}`,
@@ -879,7 +1045,11 @@
    }
  }
  /* å¢žåˆ æ”¹æ’槽删除项 */
  /**
   * @description: å¢žåˆ æ”¹æ’槽删除项
   * @param {*} field
   * @return {*}
   */
  function crudSlotsSplice(field: string) {
    crudApiSlots.value = crudApiSlots.value.filter((item) => item !== `Api${field}`);
    crudParamsSlots.value = crudParamsSlots.value.filter((item) => item !== `Params_${field}`);
@@ -893,7 +1063,12 @@
      (item) => item !== `ValueField${field}`,
    );
  }
  /* å¢žåˆ æ”¹æ’槽删除项 */
  /**
   * @description: å¢žåˆ æ”¹æ’槽删除项
   * @param {*} field
   * @return {*}
   */
  function searchSlotsSplice(field: string) {
    searchApiSlots.value = searchApiSlots.value.filter((item) => item !== `Api${field}`);
    searchParamsSlots.value = searchParamsSlots.value.filter((item) => item !== `Params_${field}`);
@@ -908,6 +1083,10 @@
    );
  }
  /**
   * @description: ä¸‹æ‹‰æ¡†Select添加选项
   * @return {*}
   */
  function addSelectOption(field: string, type: string) {
    const appendData: FormSchema[] = [
      {
@@ -928,7 +1107,7 @@
    switch (type) {
      case 'search':
        appendSchemaByField(appendData, '');
        // searchSelSlotsPush(field);
        searchSelSlotsPush(field);
        break;
      case 'crud':
        appendSchemaByFieldCrud(appendData, '');
@@ -937,13 +1116,19 @@
    }
  }
  /**
   * @description: å–消Select组件后删除添加的输入项
   * @param {*} field
   * @param {*} type
   * @return {*}
   */
  function delSelectOption(field: string, type: string) {
    const removeData: string[] = [`XSelect${field}`, `XOnChange${field}`];
    switch (type) {
      case 'search':
        //if (!isNullOrEmpty(getFieldsValue()[`XSelect${field}`])) {
        removeSchemaByField(removeData);
        // searchSelSlotsSplice(field);
        searchSelSlotsSplice(field);
        //}
        break;
      case 'crud':
@@ -955,16 +1140,129 @@
    }
  }
  /* å¢žåˆ æ”¹Select插槽数据添加 */
  /**
   * @description: æŸ¥è¯¢Select插槽数据添加
   * @param {*} field
   * @return {*}
   */
  function searchSelSlotsPush(field: string) {
    searchOptionsSlots.value.push(`Select_${field}`);
    searchOptionsSlots.value.push(`OnChange_${field}`);
  }
  /**
   * @description: æŸ¥è¯¢æ’槽删除项
   * @param {*} field
   * @return {*}
   */
  function searchSelSlotsSplice(field: string) {
    searchOptionsSlots.value = searchOptionsSlots.value.filter(
      (item) => item !== `Select_${field}`,
    );
    searchOptionsSlots.value = searchOptionsSlots.value.filter(
      (item) => item !== `OnChange_${field}`,
    );
  }
  /**
   * @description: å¢žåˆ æ”¹Select插槽数据添加
   * @param {*} field
   * @return {*}
   */
  function crudSelSlotsPush(field: string) {
    crudOptionsSlots.value.push(`Select_${field}`);
    crudOnChangeSlots.value.push(`OnChange_${field}`);
  }
  /* å¢žåˆ æ”¹æ’槽删除项 */
  /**
   * @description: å¢žåˆ æ”¹æ’槽删除项
   * @return {*}
   */
  function crudSelSlotsSplice(field: string) {
    crudOptionsSlots.value = crudOptionsSlots.value.filter((item) => item !== `Select_${field}`);
    crudOnChangeSlots.value = crudOnChangeSlots.value.filter((item) => item !== `Select_${field}`);
    crudOnChangeSlots.value = crudOnChangeSlots.value.filter(
      (item) => item !== `OnChange_${field}`,
    );
  }
  /**
   * @description: å¼¹å‡ºé€‰æ‹©æ¡†PopSelect添加选项
   * @param {*} field
   * @param {*} type
   * @return {*}
   */
  function addPopSelectOption(field: string, type: string) {
    const appendData: FormSchema[] = [
      {
        field: `PSelect${field}`,
        component: 'Input',
        label: `defaultValue`,
        slot: `PSelect_${field}`,
        colProps: { span: 24 },
      },
    ];
    switch (type) {
      case 'search':
        appendSchemaByField(appendData, '');
        searchPSelSlotsPush(field);
        break;
      case 'crud':
        appendSchemaByFieldCrud(appendData, '');
        crudPSelSlotsPush(field);
        break;
    }
  }
  /**
   * @description: æŸ¥è¯¢PopSelect插槽数据添加
   * @param {*} field
   * @return {*}
   */
  function searchPSelSlotsPush(field: string) {
    searchPOptionsSlots.value.push(`PSelect_${field}`);
  }
  /**
   * @description: å¢žåˆ æ”¹PopSelect插槽数据添加
   * @param {*} field
   * @return {*}
   */
  function crudPSelSlotsPush(field: string) {
    crudPOptionsSlots.value.push(`PSelect_${field}`);
  }
  function delPSelectOption(field: string, type: string) {
    const removeData: string[] = [`PSelect${field}`];
    switch (type) {
      case 'search':
        removeSchemaByField(removeData);
        searchPSelSlotsSplice(field);
        break;
      case 'crud':
        removeSchemaByFieldCrud(removeData);
        crudPSelSlotsSplice(field);
        break;
    }
  }
  /**
   * @description: æŸ¥è¯¢æ’槽删除项
   * @param {*} field
   * @return {*}
   */
  function searchPSelSlotsSplice(field: string) {
    searchPOptionsSlots.value = searchPOptionsSlots.value.filter(
      (item) => item !== `PSelect_${field}`,
    );
  }
  /**
   * @description: å¢žåˆ æ”¹æ’槽删除项
   * @param {*} field
   * @return {*}
   */
  function crudPSelSlotsSplice(field: string) {
    crudPOptionsSlots.value = crudPOptionsSlots.value.filter((item) => item !== `PSelect_${field}`);
  }
  const n = ref(1);
@@ -1027,9 +1325,15 @@
    if (searchSlots.value.length == 0) {
      n.value = 1;
    }
    delApiSelectOption(`${CrudEntName.value}${field}a`, 'search');
    delSelectOption(`${CrudEntName.value}${field}a`, 'search');
    delPSelectOption(`${CrudEntName.value}${field}a`, 'search');
  }
  /* ä¸»è¡¨é…ç½® */
  /**
   * @description: ä¸»è¡¨é…ç½®
   * @return {*}
   */
  function mainCondAdd() {
    appendSchemaByFieldMain(
      [
@@ -1113,7 +1417,10 @@
    }
  }
  /* å¢žåˆ æ”¹é…ç½® */
  /**
   * @description: å¢žåˆ æ”¹é…ç½®
   * @return {*}
   */
  function crudCondAdd() {
    appendSchemaByFieldCrud(
      [
@@ -1179,6 +1486,8 @@
      j.value = 1;
    }
    delApiSelectOption(`${CrudEntName.value}${field}a`, 'crud');
    delSelectOption(`${CrudEntName.value}${field}a`, 'crud');
    delPSelectOption(`${CrudEntName.value}${field}a`, 'crud');
  }
  function goBack() {
@@ -1189,6 +1498,7 @@
<style lang="less" scoped>
  .high-form {
    padding-bottom: 48px;
  }</style
>: { values: any[]; }: any: { values: any[]; }: any: { values: any[]; }: any: any: any: any: any:
  }
</style>
: { values: any[]; }: any: { values: any[]; }: any: { values: any[]; }: any: any: any: any: any:
any: any