Ben Lin
2024-06-26 af10c85c8f71ccdf2f60989a067804dd8b3aa667
产品工艺路线更新
已修改10个文件
已添加1个文件
1126 ■■■■ 文件已修改
src/api/tigerapi/model/basModel.ts 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/Config.vue 446 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/LeftTree.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/index.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts 412 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/mainTable.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/model/basModel.ts
@@ -109,7 +109,9 @@
export interface EntityCustFunctionType {
  CreateAction: (fnName: string) => {};
  ActionItem: (params: Recordable<any>, data, ...args) => ActionItem[];
  EditeOperation: (data: Ref<any[]>, d, u) => void;
  EditOperation: (data: Ref<any[]>, d, u) => void;
  OpenSelectItem: (openItemModal: Fn, ...args) => void;
  GetSelectSuccess: (d, u, ...args) => {};
  GetHomeUrl: () => string;
  GetBaseColumns: () => [];
  GetSearchForm: () => [];
@@ -117,4 +119,8 @@
  GetBaseForm: () => [];
  GetBaseCards: () => [];
  OthersValues: (val: string, id: string) => {}
  GetTitle: () => {};
  GetCrudColSlots: () => [];
  nodeChange: ({}) => void,
  CreateIcon: (params: Recordable<any>) => string;
}
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-20 12:13:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-25 00:07:08
 * @LastEditTime: 2024-06-26 16:00:06
-->
<template>
  <Card title="添加工艺">
@@ -29,11 +29,12 @@
  import { useTabs } from '/@/hooks/web/useTabs';
  import { useMessage } from '/@/hooks/web/useMessage';
  const objParams = inject('objParams') as Ref<any>;
  const custImport = ref<any[]>(await import(`../entityts/${objParams.value['Name']}.ts`));
  const [{ EditeOperation, GetBaseColumns, GetSearchForm, GetCrudForm, OthersValues }] =
    custImport.value['default']();
  const { refreshPage } = useTabs();
  const { createErrorModal } = useMessage();
  // const props = defineProps({
  //   prodCode: { type: String },
  // });
  const { t } = useI18n();
  const [register, { openModal }] = useModal();
  interface NavItem {
@@ -43,7 +44,6 @@
    url: string;
    action: string;
  }
  const Prod_Code = inject('prodCode') as Ref<string>;
  // watch(
  //   () => Prod_Code,
@@ -71,42 +71,6 @@
      url: '/addCustomer',
      action: 'addCustomer',
    },
    // {
    //   title: '销售出库单',
    //   icon: 'Out|svg',
    //   color: '#e18525',
    //   url: '/saleoutorder',
    // },
    // {
    //   title: '完工入库单',
    //   icon: 'In|svg',
    //   color: '#3fb27f',
    //   url: '/finishedwarehouse',
    // },
    // {
    //   title: '生产退料单',
    //   icon: 'materialret|svg',
    //   color: '#4daf1bc9',
    //   url: '/materialret',
    // },
    // {
    //   title: '盘点单',
    //   icon: 'inventory|svg',
    //   color: '#00d8ff',
    //   url: '/inventory',
    // },
    // {
    //   title: '调拨单',
    //   icon: 'transfer|svg',
    //   color: '#00d8ff',
    //   url: '/transfer',
    // },
    // {
    //   title: '实时库存',
    //   icon: 'WmsItem|svg',
    //   color: '#00d8ff',
    //   url: '/WmsItem',
    // },
  ];
  function changeItem(action) {
    openModal(true, {
@@ -152,7 +116,7 @@
   * @return {*}
   */
  async function handleSuccess(d, u) {
    if (isNullOrEmpty(Prod_Code.value)) {
    if (isNullOrEmpty(objParams.value['CODE'])) {
      createErrorModal({
        title: t('sys.api.errorTip'),
        content: '产品为空,不能添加工艺路线,请点击左侧选择产品',
@@ -163,9 +127,9 @@
    var i;
    for (i = 0; i < codes.length; i++) {
      if (d.which == 'addRoute') {
        await RouteToProd({ rotId: codes[i], prodCode: Prod_Code.value });
        await RouteToProd({ rotId: codes[i], prodCode: objParams.value['CODE'] });
      } else {
        await RouteToCust({ rotId: codes[i], prodCode: Prod_Code.value, custCode: '' });
        await RouteToCust({ rotId: codes[i], prodCode: objParams.value['CODE'], custCode: '' });
      }
    }
src/views/tigerprojects/system/lowcode/composition/Config.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-24 23:44:31
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-25 21:34:33
 * @LastEditTime: 2024-06-26 18:45:42
-->
<template>
  <Card title="行为配置">
@@ -27,209 +27,50 @@
</template>
<script lang="ts" setup>
  import { Ref, inject, nextTick, onMounted, ref, unref, watch } from 'vue';
  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { Card } from 'ant-design-vue';
  import { useModal } from '/@/components/Modal';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import { useUserStore } from '/@/store/modules/user';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { GetEnum, getEntity } from '/@/api/tigerapi/system';
  import { useLocale } from '/@/locales/useLocale';
  import { isNullOrEmpty } from '/@/utils/is';
  import { isNullOrUnDef } from '/@/utils/is';
  import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
  const { t } = useI18n();
  const { getLocale } = useLocale();
  const emit = defineEmits(['success', 'register']);
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const Prod_Code = inject('prodCode') as Ref<string>;
  const ACT_ID = inject('actionCode') as Ref<string>;
  const Cust_Code = inject('custCode') as Ref<string>;
  const crudColSlots = ref<any>([
    'scanadd',
    'assyadd',
    'testadd',
    'auditadd',
    'printadd',
    'pkgadd',
  const objParams = inject('objParams') as Ref<any>;
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
      ActionItem(params, data, ...args) {},
      EditOperation(data, d, u) {},
      GetBaseColumns() {},
      GetSearchForm() {},
      GetCrudForm() {},
      GetCrudColSlots(val, id) {},
      OpenSelectItem(openItemModal: Fn, ...args) {},
      GetSelectSuccess(d, u, ...args) {},
      nodeChange(params: {
        resetFields: any;
        setFieldsValue: any;
        objParams: Ref<any>;
        selectedNodes: Ref<any[]>;
      }) {},
    } as EntityCustFunctionType,
  ]);
  /* åŠ¨æ€import实体名.ts的自定义方法 */
  try {
    custImport.value = await import(`../entityts/${objParams.value['Name']}.ts`);
  } catch (e) {}
  const [{ GetCrudForm, GetCrudColSlots, nodeChange, OpenSelectItem, GetSelectSuccess }] =
    isNullOrUnDef(custImport.value['default'])
      ? EntityCustFunction.value
      : custImport.value['default']();
  const crudColSlots = ref<any>(GetCrudColSlots());
  const isNormal = (type: number) => type === 0;
  const isScan = (type: number) => type === 1;
  const isAssy = (type: number) => type === 2;
  const isTest = (type: number) => type === 3;
  const isAudit = (type: number) => type === 4;
  const isPrint = (type: number) => type === 5;
  const isPackage = (type: number) => type === 6;
  const formSchema: FormSchema[] = [
    {
      field: 'PROD_CODE',
      label: '产品编码',
      component: 'Input',
      dynamicDisabled: ({ values }) => {
        return true;
      },
      colProps: { span: 12 },
    },
    {
      field: 'ID',
      label: 'ID',
      component: 'Input',
      show: false,
    },
    {
      field: 'CUST_CODE',
      label: '客户编码',
      component: 'Input',
      dynamicDisabled: ({ values }) => {
        return true;
      },
      colProps: { span: 12 },
    },
    {
      field: 'ACT_TYPE',
      label: '行为类型',
      component: 'ApiSelect',
      colProps: { span: 12 },
      defaultValue: 0,
      componentProps: {
        api: GetEnum,
        params: { name: 'MES_PROD_ACTION+ACT_TYPEs' },
        resultField: 'Data',
        labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
        valueField: 'Value',
        // onChange: (e, v) => {
        //   alert(e)
        //   console.log('ApiSelect====>:', e, v);
        // },
      },
    },
    {
      field: 'IS_ACTIVE',
      label: '是否启用',
      required: true,
      component: 'Select',
      colProps: { span: 12 },
      componentProps: {
        options: [
          {
            label: '是',
            value: 'Y',
            key: 'Y',
          },
          {
            label: '否',
            value: 'N',
            key: 'N',
          },
        ],
      },
    },
    {
      field: 'RULE_CODE',
      label: '扫码验证',
      component: 'Input',
      colProps: { span: 10 },
      ifShow: ({ values }) => isScan(values.ACT_TYPE),
    },
    {
      field: '0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isScan(values.ACT_TYPE),
      colSlot: 'scanadd',
    },
    {
      field: 'ITEM_CODE',
      label: '组装上料',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isAssy(values.ACT_TYPE),
    },
    {
      field: '00',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isAssy(values.ACT_TYPE),
      colSlot: 'assyadd',
    },
    {
      field: 'TEST_CODE',
      label: '产品测试',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isTest(values.ACT_TYPE),
    },
    {
      field: 'test0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isTest(values.ACT_TYPE),
      colSlot: 'testadd',
    },
    {
      field: 'SAPL_CODE',
      label: '产品抽检',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isAudit(values.ACT_TYPE),
    },
    {
      field: 'audit0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isAudit(values.ACT_TYPE),
      colSlot: 'auditadd',
    },
    {
      field: 'LABEL_CODE',
      label: '标签打印',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isPrint(values.ACT_TYPE),
    },
    {
      field: 'print0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isPrint(values.ACT_TYPE),
      colSlot: 'printadd',
    },
    {
      field: 'pkgRULE_CODE',
      label: '包装规则',
      colProps: { span: 10 },
      component: 'Input',
      ifShow: ({ values }) => isPackage(values.ACT_TYPE),
    },
    {
      field: 'pkg0',
      label: '1',
      defaultValue: '',
      component: 'Input',
      colProps: { span: 2, pull: 1 },
      ifShow: ({ values }) => isPackage(values.ACT_TYPE),
      colSlot: 'pkgadd',
    },
    {
      field: 'REMARK',
      label: '备注',
      component: 'Input',
      colProps: { span: 12 },
    },
  ];
  const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
    labelWidth: 120,
    schemas: formSchema,
    schemas: GetCrudForm(),
    actionColOptions: {
      offset: 8,
      span: 24,
@@ -241,46 +82,28 @@
    submitButtonOptions: {
      text: '提交',
    },
    submitFunc: customSubmitFunc,
  });
  /* æ³¨å…¥é€‰ä¸­èŠ‚ç‚¹æ•°æ® */
  const selectedNodes = inject('selectedNodes') as Ref<any>;
  watch(
  () => ACT_ID.value,
  (newVal, oldVal) => {
    () => selectedNodes.value,
    (newVal, oldVal) => {
      nextTick(() => {
        getActType();
        /* èŠ‚ç‚¹åˆ‡æ¢äº‹ä»¶ */
        nodeChange({ resetFields, setFieldsValue, objParams, selectedNodes });
      });
  },
  { deep: true, immediate: true },
);
    },
    { deep: true, immediate: true },
  );
  onMounted(() => {
    getActType();
    /* èŠ‚ç‚¹åˆ‡æ¢äº‹ä»¶ */
    nodeChange({ resetFields, setFieldsValue, objParams, selectedNodes });
  });
  function getActType() {
    resetFields();
    let sqlcmd = ' 1=1 ';
    if (!isNullOrEmpty(Prod_Code.value)) {
      sqlcmd += `And PROD_CODE = '${Prod_Code.value}'`;
    }
    if (!isNullOrEmpty(Cust_Code.value)) {
      sqlcmd += `And CUST_CODE = '${Cust_Code.value}'`;
    }
    if (!isNullOrEmpty(ACT_ID.value)) {
      sqlcmd += `And ACT_ID = '${ACT_ID.value}'`;
    }
    getEntity({
      sqlcmd: sqlcmd,
      entityName: 'MES_PROD_ACTION',
    }).then((res) => {
      setFieldsValue({
        PROD_CODE: Prod_Code.value,
        ACT_TYPE: res.Data.Items[0].ACT_TYPE
      });
    });
  }
  async function handleSubmit() {
  async function customSubmitFunc() {
    // try {
    //   const values = await validate();
    //   setDrawerProps({ confirmLoading: true });
@@ -303,163 +126,13 @@
    // }
  }
  const itemCodeModalCfg = {
    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',
    searchInfo: { TABLE_NAME: 'BAS_ITEM' },
  };
  const ruleModalCfg = {
    title: '规则列表',
    schemas: [
      {
        field: 'RULE_CODE',
        component: 'Input',
        label: '规则编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('规则编码'),
        dataIndex: 'RULE_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('规则名称'),
        dataIndex: 'RULE_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_CODE_RULE',
    rowKey: 'RULE_CODE',
    searchInfo: { TABLE_NAME: 'BAS_CODE_RULE' },
  };
  const printModalCfg = {
    title: '打印模板列表',
    schemas: [
      {
        field: 'LABEL_CODE',
        component: 'Input',
        label: '模板编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('模板编码'),
        dataIndex: 'LABEL_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('模板名称'),
        dataIndex: 'LABEL_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_LABEL_TEMP',
    rowKey: 'LABEL_CODE',
    searchInfo: { TABLE_NAME: 'BAS_LABEL_TEMP' },
  };
  const pkgModalCfg = {
    title: '包装规则列表',
    schemas: [
      {
        field: 'RULE_CODE',
        component: 'Input',
        label: '包装规则编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('包装规则编码'),
        dataIndex: 'RULE_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('包装规则名称'),
        dataIndex: 'RULE_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_PKG_RULE',
    rowKey: 'RULE_CODE',
    searchInfo: { TABLE_NAME: 'BAS_PKG_RULE' },
  };
  /**
   * @description: ç‚¹å‡»æ‰“开弹出选择列表框
   * @param {*} item
   * @return {*}
   */
  function handleSelectItem(item) {
    let config = {};
    switch (item) {
      case 'scanadd':
        config = ruleModalCfg;
        break;
      case 'assyadd':
        config = itemCodeModalCfg;
        break;
      case 'testadd':
        config = itemCodeModalCfg;
        break;
      case 'printadd':
        config = printModalCfg;
        break;
      case 'pkgadd':
        config = pkgModalCfg;
        break;
    }
    openItemModal(true, config);
    OpenSelectItem(openItemModal, item);
  }
  /**
@@ -470,29 +143,6 @@
   * @return {*}
   */
  function handleItemSuccess(d, u, item) {
    let value = {};
    switch (item) {
      case 'scanadd':
        value = {
          RULE_CODE: d.values['val'],
        };
        break;
      case 'assyadd':
        value = {
          ITEM_CODE: d.values['val'],
        };
        break;
      case 'printadd':
        value = {
          LABEL_CODE: d.values['val'],
        };
        break;
      case 'pkgadd':
        value = {
          pkgRULE_CODE: d.values['val'],
        };
        break;
    }
    setFieldsValue(value);
    setFieldsValue(GetSelectSuccess(d, u, item));
  }
</script>
src/views/tigerprojects/system/lowcode/composition/LeftTree.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
<!--
 * @Description: ç»„合页面左侧树形
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-26 15:31:43
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-26 18:48:09
-->
<template>
  <GeneralTree
    @select="handleSelect"
    @UnSelect="UnSelect"
    :title="title"
    :treeData="treeData"
    :create-icon="createIcon"
    :fieldNames="fieldNames"
  /><!--
      add
      @handle-add="handleAdd" -->
</template>
<script lang="ts" setup>
  import { Ref, inject, onMounted, ref } from 'vue';
  import { isNullOrUnDef } from '/@/utils/is';
  import GeneralTree from '/@/views/components/GeneralTree.vue';
  import { TreeItem } from '/@/components/TigerTree';
  import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
  const objParams = inject('objParams') as Ref<any>;
  const nodeType = inject('nodeType') as Ref<any>;
  const selectedNodes = inject('selectedNodes') as Ref<any>;
  const custImport = ref<any[]>([]);
  const EntityCustFunction = ref([
    {
      CreateIcon(params: Recordable<any>) {},
    } as EntityCustFunctionType,
  ]);
  /* åŠ¨æ€import实体名.ts的自定义方法 */
  try {
    custImport.value = await import(`../entityts/${objParams.value['Name']}.ts`);
  } catch (e) {}
  const [{ CreateIcon }] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
    : custImport.value['default']();
  const treeData = ref<TreeItem[]>([]);
  const title = ref('');
  const fieldNames = ref({});
  onMounted(async () => {
    await fetch(objParams.value['Name']);
  });
  /**
   * @description: æ ‘形节点图标
   * @param {*} params
   * @param {*} type
   * @return {*}
   */
  function createIcon(params: Recordable<any>) {
    return CreateIcon(params);
  }
  /**
   * @description: èŽ·å–æ ‘å½¢æ•°æ®
   * @param {*} type
   * @return {*}
   */
  async function fetch(type: string) {
    if (!isNullOrUnDef(custImport.value)) {
      const [{ fetchTreeData }] = custImport.value['default']();
      //根据type获取树形数据
      const data = await fetchTreeData(type, objParams.value['CODE']);
      title.value = data.title;
      treeData.value = data.treeData;
      fieldNames.value = data.fieldNames;
    }
  }
  function handleSelect(Id = '', info) {
    // searchInfo.Id = Id;
    nodeType.value = info.selectedNodes[0].type;
    selectedNodes.value = info.selectedNodes;
    // prodCode.value =rotType.value=='Product'? info.selectedNodes[0].code: prodCode.value;
    // actionCode.value = rotType.value == 'Action' ? info.selectedNodes[0].code : actionCode.value;
    // custCode.value = rotType.value == 'Customer' ? info.selectedNodes[0].code : custCode.value;
    // reload();
  }
  /**
   * @description: å–消选择时事件返回方法
   * @param {*} node
   * @return {*}
   */
  function UnSelect(node) {
    nodeType.value = '';
    // reload();
  }
</script>
src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -8,22 +8,15 @@
    :content="pageContent"
    @back="goBack"
  >
    <GeneralTree
      class="w-1/4 xl:w-1/5"
      v-if="isMounted"
      @select="handleSelect"
      @UnSelect="UnSelect"
      :title="title"
      :treeData="treeData"
      :create-icon="createIcon"
      :fieldNames="fieldNames"
    /><!--
      add
      @handle-add="handleAdd" -->
    <div class="w-3/4 xl:w-4/5 p-5">
      <CarGridNav v-if="entityName == 'ProdRouteBinding' && rotType == 'Product'" />
      <Config v-if="entityName == 'ProdRouteBinding' && rotType == 'Action'" />
    </div>
    <Suspense class="w-1/4 xl:w-1/5">
      <LeftTree />
    </Suspense>
    <Suspense>
      <div class="w-3/4 xl:w-4/5 p-5">
        <CarGridNav v-if="entityName == 'ProdRouteBinding' && nodeType == 'Product'" />
        <Config v-if="entityName == 'ProdRouteBinding' && nodeType == 'Action'" />
      </div>
    </Suspense>
    <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable">
      <template #toolbar>
        <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> æ–°å¢ž </a-button>
@@ -65,18 +58,17 @@
</template>
<script lang="ts" setup>
  import { PageWrapper } from '@/components/Page';
  import GeneralTree from '/@/views/components/GeneralTree.vue';
  import { useModal } from '@/components/Modal';
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import CarGridNav from './CarGridNav.vue';
  import Config from './Config.vue';
  import LeftTree from './LeftTree.vue';
  import CustModal from '/@/views/components/CustModal.vue';
  import { OpenCustModal } from '../data';
  import { Ref, onMounted, provide, reactive, ref } from 'vue';
  import { useRoute } from 'vue-router';
  import { useDrawer } from '/@/components/Drawer';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { TreeItem } from '/@/components/TigerTree';
  import { useTabs } from '/@/hooks/web/useTabs';
  import { isNullOrUnDef } from '/@/utils/is';
  import { useGo } from '/@/hooks/web/usePage';
@@ -99,41 +91,22 @@
  const baseCards = ref([] as any[]);
  const otherCards = ref([] as any[]);
  const searchInfo = reactive<Recordable>({});
  const treeData = ref<TreeItem[]>([]);
  const title = ref('');
  const fieldNames = ref({});
  const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense);
  const pageTitle = ref(objParams.value.pageTitle);
  const pageContent = ref(objParams.value.pageContent);
  const prodCode = ref(objParams.value.CODE);
  const actionCode = ref('');
  const custCode = ref('');
  const rotType = ref('');
  const nodeType = ref('');
  const selectedNodes = ref([]);
  const isMounted = ref(false);
  const custImport = ref<any>(null);
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerDrawer, { openDrawer }] = useDrawer();
  provide<Ref<string>>('prodCode', prodCode);
  provide<Ref<string>>('actionCode', actionCode);
  provide<Ref<string>>('custCode', custCode);
  provide<Ref<string>>('nodeType', nodeType);
  provide<Ref<any>>('objParams', objParams);
  provide<Ref<any>>('selectedNodes', selectedNodes);
  setTitle(objParams.value.Title); //设置标签页标题
  /**
   * @description: èŽ·å–æ ‘å½¢æ•°æ®
   * @param {*} type
   * @return {*}
   */
  async function fetch(type: string) {
    if (!isNullOrUnDef(custImport.value)) {
      const [{ fetchTreeData }] = custImport.value['default']();
      //根据type获取树形数据
      const data = await fetchTreeData(type, objParams.value.CODE);
      title.value = data.title;
      treeData.value = data.treeData;
      fieldNames.value = data.fieldNames;
    }
  }
  /**
   * @description: é¡µé¢å·¦ä¾§ç‚¹å‡»è¿”回链接时的操作
@@ -151,50 +124,14 @@
  //   console.log('handleAdd');
  // }
  /**
   * @description: æ ‘形节点图标
   * @param {*} params
   * @param {*} type
   * @return {*}
   */
  function createIcon(params: Recordable<any>) {
    if (isNullOrUnDef(custImport.value)) {
      return '';
    } else {
      const [{ CreateIcon }] = custImport.value['default']();
      return CreateIcon(params);
    }
  }
  onMounted(async () => {
    isMounted.value = false;
    /* åŠ¨æ€import实体名.ts的自定义方法 */
    try {
      custImport.value = await import(`../entityts/${entityName.value}.ts`);
      await fetch(entityName.value);
      isMounted.value = true;
    } catch (e) {}
  });
  function handleSelect(deptId = '', info) {
    searchInfo.deptId = deptId;
    rotType.value = info.selectedNodes[0].type;
    // prodCode.value =rotType.value=='Product'? info.selectedNodes[0].code: prodCode.value;
    actionCode.value = rotType.value == 'Action' ? info.selectedNodes[0].code : actionCode.value;
    custCode.value = rotType.value == 'Customer' ? info.selectedNodes[0].code : custCode.value;
    // reload();
  }
  /**
   * @description: å–消选择时事件返回方法
   * @param {*} node
   * @return {*}
   */
  function UnSelect(node) {
    prodCode.value = '';
    rotType.value = '';
    // reload();
  }
  /**
   * @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-06-25 11:28:25
 * @LastEditTime: 2024-06-26 18:33:05
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -85,7 +85,7 @@
     * @param {Fn} openItemModal
     * @return {*}
     */    
    OpenSelectItem: (openItemModal: Fn) => {
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      openItemModal(true, {
        title: '物料列表',
        schemas: [
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-22 23:40:02
 * @LastEditTime: 2024-06-26 18:33:09
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -49,7 +49,7 @@
        VAR_VALUE: d.values['val'],
      };
    },
    OpenSelectItem:(openItemModal: Fn) => {
    OpenSelectItem:(openItemModal: Fn, ...args) => {
        openItemModal(true, {
          title: '过程变量列表',
          schemas: [
src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
@@ -75,7 +75,7 @@
        RSNG_CODE: d.values['val'],
      };
    },
    OpenSelectItem:(openItemModal: Fn) => {
    OpenSelectItem:(openItemModal: Fn, ...args) => {
      openItemModal(true, {
        title: '不良原因组列表',
        schemas: [
src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
@@ -4,13 +4,26 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-25 18:30:51
 * @LastEditTime: 2024-06-26 18:41:16
 */
import { Ref, unref } from 'vue';
import { GetRoutePTree } from '/@/api/tigerapi/mes/router';
import { convertToTree } from '/@/api/tigerapi/system';
import { GetEnum, convertToTree, getEntity } from '/@/api/tigerapi/system';
import { useLocale } from '/@/locales/useLocale';
import { isNullOrEmpty } from '/@/utils/is';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const { getLocale } = useLocale();
function _default() {
  const isNormal = (type: number) => type === 0;
  const isScan = (type: number) => type === 1;
  const isAssy = (type: number) => type === 2;
  const isTest = (type: number) => type === 3;
  const isAudit = (type: number) => type === 4;
  const isPrint = (type: number) => type === 5;
  const isPackage = (type: number) => type === 6;
  const methods = {
    /**
     * @description: èŽ·å–æ ‘å½¢å›¾æ ‡
@@ -41,7 +54,7 @@
    /**
     * @description: é«˜çº§è¡¨å•和详情页面返回主页面的url
     * @return {*}
     */
     */
    GetHomeUrl: () => {
      return `/V_BAS_PROD/LC/${encodeURI(JSON.stringify({ ID: 'V_BAS_PROD', colSlots: [], crudColSlots: [] }))}`;
    },
@@ -58,6 +71,399 @@
      data.fieldNames = { key: 'id', title: 'name' };
      return data;
    },
    GetCrudForm: () => {
      return [
        {
          field: 'PROD_CODE',
          label: '产品编码',
          component: 'Input',
          dynamicDisabled: ({ values }) => {
            return true;
          },
          colProps: { span: 12 },
        },
        {
          field: 'ID',
          label: 'ID',
          component: 'Input',
          show: false,
        },
        {
          field: 'CUST_CODE',
          label: '客户编码',
          component: 'Input',
          dynamicDisabled: ({ values }) => {
            return true;
          },
          colProps: { span: 12 },
        },
        {
          field: 'ACT_TYPE',
          label: '行为类型',
          component: 'ApiSelect',
          colProps: { span: 12 },
          defaultValue: 0,
          componentProps: {
            api: GetEnum,
            params: { name: 'MES_PROD_ACTION+ACT_TYPEs' },
            resultField: 'Data',
            labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
            valueField: 'Value',
            // onChange: (e, v) => {
            //   alert(e)
            //   console.log('ApiSelect====>:', e, v);
            // },
          },
        },
        {
          field: 'IS_ACTIVE',
          label: '是否启用',
          required: true,
          component: 'Select',
          colProps: { span: 12 },
          componentProps: {
            options: [
              {
                label: '是',
                value: 'Y',
                key: 'Y',
              },
              {
                label: '否',
                value: 'N',
                key: 'N',
              },
            ],
          },
        },
        {
          field: 'RULE_CODE',
          label: '扫码验证',
          component: 'Input',
          colProps: { span: 10 },
          ifShow: ({ values }) => isScan(values.ACT_TYPE),
        },
        {
          field: '0',
          label: '1',
          defaultValue: '',
          component: 'Input',
          colProps: { span: 2, pull: 1 },
          ifShow: ({ values }) => isScan(values.ACT_TYPE),
          colSlot: 'scanadd',
        },
        {
          field: 'ITEM_CODE',
          label: '组装上料',
          colProps: { span: 10 },
          component: 'Input',
          ifShow: ({ values }) => isAssy(values.ACT_TYPE),
        },
        {
          field: '00',
          label: '1',
          defaultValue: '',
          component: 'Input',
          colProps: { span: 2, pull: 1 },
          ifShow: ({ values }) => isAssy(values.ACT_TYPE),
          colSlot: 'assyadd',
        },
        {
          field: 'TEST_CODE',
          label: '产品测试',
          colProps: { span: 10 },
          component: 'Input',
          ifShow: ({ values }) => isTest(values.ACT_TYPE),
        },
        {
          field: 'test0',
          label: '1',
          defaultValue: '',
          component: 'Input',
          colProps: { span: 2, pull: 1 },
          ifShow: ({ values }) => isTest(values.ACT_TYPE),
          colSlot: 'testadd',
        },
        {
          field: 'SAPL_CODE',
          label: '产品抽检',
          colProps: { span: 10 },
          component: 'Input',
          ifShow: ({ values }) => isAudit(values.ACT_TYPE),
        },
        {
          field: 'audit0',
          label: '1',
          defaultValue: '',
          component: 'Input',
          colProps: { span: 2, pull: 1 },
          ifShow: ({ values }) => isAudit(values.ACT_TYPE),
          colSlot: 'auditadd',
        },
        {
          field: 'LABEL_CODE',
          label: '标签打印',
          colProps: { span: 10 },
          component: 'Input',
          ifShow: ({ values }) => isPrint(values.ACT_TYPE),
        },
        {
          field: 'print0',
          label: '1',
          defaultValue: '',
          component: 'Input',
          colProps: { span: 2, pull: 1 },
          ifShow: ({ values }) => isPrint(values.ACT_TYPE),
          colSlot: 'printadd',
        },
        {
          field: 'pkgRULE_CODE',
          label: '包装规则',
          colProps: { span: 10 },
          component: 'Input',
          ifShow: ({ values }) => isPackage(values.ACT_TYPE),
        },
        {
          field: 'pkg0',
          label: '1',
          defaultValue: '',
          component: 'Input',
          colProps: { span: 2, pull: 1 },
          ifShow: ({ values }) => isPackage(values.ACT_TYPE),
          colSlot: 'pkgadd',
        },
        {
          field: 'REMARK',
          label: '备注',
          component: 'Input',
          colProps: { span: 12 },
        },
      ];
    },
    /**
     * @description: èŽ·å–è¡¨å•ä¸­çš„å­—æ®µæ’æ§½åˆ—è¡¨
     * @return {*}
     */
    GetCrudColSlots: () => {
      return ['scanadd', 'assyadd', 'testadd', 'auditadd', 'printadd', 'pkgadd'];
    },
    nodeChange: (params: {
      resetFields: any;
      setFieldsValue: any;
      objParams: Ref<any>;
      selectedNodes: Ref<any[]>;
    }) => {
      params['resetFields']();
      let sqlcmd = ' 1=1 ';
      if (!isNullOrEmpty(params['objParams'].value['CODE'])) {
        sqlcmd += `And PROD_CODE = '${params['objParams'].value['CODE']}'`;
      }
      // if (!isNullOrEmpty(Cust_Code.value)) {
      //   sqlcmd += `And CUST_CODE = '${Cust_Code.value}'`;
      // }
      if (!isNullOrEmpty(params['selectedNodes'].value[0].code)) {
        sqlcmd += `And ACT_ID = '${params['selectedNodes'].value[0].code}'`;
      }
      getEntity({
        sqlcmd: sqlcmd,
        entityName: 'MES_PROD_ACTION',
      }).then((res) => {
        params['setFieldsValue']({
          PROD_CODE: params['objParams'].value['CODE'],
          ACT_TYPE: res.Data.Items[0].ACT_TYPE,
        });
      });
    },
    /**
     * @description: å¼¹å‡ºé€‰æ‹©æ¡†æ‰“开方法
     * @param {Fn} openItemModal
     * @return {*}
     */
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      let config = {};
      switch (args[0]) {
        case 'scanadd':
          config = ruleModalCfg;
          break;
        case 'assyadd':
          config = itemCodeModalCfg;
          break;
        case 'testadd':
          config = itemCodeModalCfg;
          break;
        case 'printadd':
          config = printModalCfg;
          break;
        case 'pkgadd':
          config = pkgModalCfg;
          break;
      }
      openItemModal(true, config);
    },
    /**
     * @description: å¼¹å‡ºé€‰æ‹©æ¡†é€‰æ‹©æˆåŠŸè¿”å›ž
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
    GetSelectSuccess: (d, u, ...args) => {
      let value = {};
      switch (args[0]) {
        case 'scanadd':
          value = {
            RULE_CODE: d.values['val'],
          };
          break;
        case 'assyadd':
          value = {
            ITEM_CODE: d.values['val'],
          };
          break;
        case 'printadd':
          value = {
            LABEL_CODE: d.values['val'],
          };
          break;
        case 'pkgadd':
          value = {
            pkgRULE_CODE: d.values['val'],
          };
          break;
      }
      return value;
    },
  };
  const itemCodeModalCfg = {
    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',
    searchInfo: { TABLE_NAME: 'BAS_ITEM' },
  };
  const ruleModalCfg = {
    title: '规则列表',
    schemas: [
      {
        field: 'RULE_CODE',
        component: 'Input',
        label: '规则编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('规则编码'),
        dataIndex: 'RULE_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('规则名称'),
        dataIndex: 'RULE_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_CODE_RULE',
    rowKey: 'RULE_CODE',
    searchInfo: { TABLE_NAME: 'BAS_CODE_RULE' },
  };
  const printModalCfg = {
    title: '打印模板列表',
    schemas: [
      {
        field: 'LABEL_CODE',
        component: 'Input',
        label: '模板编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('模板编码'),
        dataIndex: 'LABEL_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('模板名称'),
        dataIndex: 'LABEL_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_LABEL_TEMP',
    rowKey: 'LABEL_CODE',
    searchInfo: { TABLE_NAME: 'BAS_LABEL_TEMP' },
  };
  const pkgModalCfg = {
    title: '包装规则列表',
    schemas: [
      {
        field: 'RULE_CODE',
        component: 'Input',
        label: '包装规则编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('包装规则编码'),
        dataIndex: 'RULE_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('包装规则名称'),
        dataIndex: 'RULE_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_PKG_RULE',
    rowKey: 'RULE_CODE',
    searchInfo: { TABLE_NAME: 'BAS_PKG_RULE' },
  };
  return [methods];
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-26 02:57:35
 * @LastEditTime: 2024-06-26 18:33:23
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -87,7 +87,7 @@
     * @param {Fn} openItemModal
     * @return {*}
     */    
    OpenSelectItem: (openItemModal: Fn) => {
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      openItemModal(true, {
        title: '物料列表',
        schemas: [
src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -84,7 +84,7 @@
  const EntityCustFunction = ref([
    {
      ActionItem(params, data, ...args) {},
      EditeOperation(data, d, u) {},
      EditOperation(data, d, u) {},
      GetBaseColumns() {},
      GetSearchForm() {},
      GetCrudForm() {},
@@ -98,7 +98,7 @@
  const [
    {
      ActionItem: nActionItem,
      EditeOperation,
      EditOperation,
      GetBaseColumns,
      GetSearchForm,
      GetCrudForm,