Ben Lin
2024-12-30 2e9c878dab8b83a5acbfb2caf934a66394b60d98
一些优化
已修改8个文件
188 ■■■■ 文件已修改
src/views/components/GeneralCrudModal.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/GeneralModal.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/ImportExcelModal.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/composition/Config.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/GeneralCrudModal.vue
@@ -8,6 +8,13 @@
    @ok="handleSubmit"
  >
    <div>
      <a-alert
        v-if="showAlert"
        :message="message"
        :description="description"
        type="info"
        show-icon
      />
      <BasicTable @register="registerTable" @edit-change="onEditChange">
        <template #toolbar>
          <a-button @click="openImg" type="primary"> 预览 </a-button>
@@ -41,7 +48,9 @@
  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
  import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
  import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel';
  import { Alert } from 'ant-design-vue';
  const AAlert = Alert;
  const { t } = useI18n();
  const title = ref('');
  const tableName = ref('');
@@ -53,6 +62,9 @@
  const entityName = ref('');
  const ctype = ref('');
  const others = ref({});
  const showAlert = ref(false);
  const message = ref('');
  const description = ref('');
  //列表
  const ItemColumns = ref([] as BasicColumn[]);
@@ -120,8 +132,9 @@
        }
      }
    });
    if(isNullOrEmpty(path)){
      path = dataSource.filter((q) => isNullOrEmpty(q.WORK_ORDER) || isNullOrEmpty(q.PROD_CODE))[0].LABEL_VIEW_PATH;
    if (isNullOrEmpty(path)) {
      path = dataSource.filter((q) => isNullOrEmpty(q.WORK_ORDER) || isNullOrEmpty(q.PROD_CODE))[0]
        .LABEL_VIEW_PATH;
    }
    createImgPreview({
      imageList: [path],
@@ -151,6 +164,9 @@
    entityName.value = data?.entityName;
    ctype.value = data?.ctype;
    others.value = data?.others;
    showAlert.value = data?.alertConfig.showAlert;
    message.value = data?.alertConfig.message;
    description.value = data?.alertConfig.description;
    // getForm().resetFields();
    /* 动态import实体名.ts的自定义方法 */
    try {
@@ -184,7 +200,7 @@
          try {
            const data = cloneDeep(record.editValueRefs);
            console.log(data);
            //TODO 此处将数据提交给服务器保存
            const [{ CustFunc }] = isNullOrUnDef(custImport.value['default'])
              ? EntityCustFunction.value
              : custImport.value['default']();
src/views/components/GeneralModal.vue
@@ -1,7 +1,7 @@
<template>
  <BasicModal
    width="800px"
    :height="450"
    width="1200px"
    :height="700"
    v-bind="$attrs"
    @register="register"
    :title="title"
@@ -51,9 +51,10 @@
      labelWidth: 120,
      schemas: schemas,
    },
    size: 'small',
    useSearchForm: true,
    showTableSetting: false,
    scroll: { y: 350 },
    scroll: { y: 550 },
    canResize: false,
    rowKey: rowKey,
    rowSelection: {
src/views/components/ImportExcelModal.vue
@@ -136,13 +136,34 @@
      EntityJson: JSON.stringify(tableListRef.value[0].dataSource),
      CheckJson: checkJson.value,
      where: where.value,
      typeFullName: typeFullName.value
      typeFullName: typeFullName.value,
    });
    if (res.IsSuccessed) {
      tableListRef.value[0].dataSource = res.Data;
      err.value = '';
    } else {
      tableListRef.value = [];
      tableListRef.value = [
        {
          title: '列表信息',
          columns: [
            {
              title: '字段1',
              dataIndex: 'field1',
              width: 200,
              sorter: true,
              resizable: true,
            },
            {
              title: '字段2',
              dataIndex: 'field2',
              width: 200,
              sorter: true,
              resizable: true,
            },
          ],
          dataSource: [],
        },
      ];
      createMessage.error('导入失败' + res.Message);
      err.value = res.Message;
    }
@@ -171,7 +192,10 @@
        title: () => h('span', t('导入信息')),
        content: () => h('span', t('确认有修改的数据是否正确,有异常的数据无法导入')),
        onOk: async () => {
          const apiAction = await ImportExcel(entityName.value, tableListRef.value[0]['dataSource'] as any[]);
          const apiAction = await ImportExcel(
            entityName.value,
            tableListRef.value[0]['dataSource'] as any[],
          );
          if (apiAction.IsSuccessed) {
            closeModal();
            createMessage.success(t('导入成功'));
src/views/tigerprojects/system/lowcode/composition/Config.vue
@@ -39,13 +39,13 @@
    v-show="showOtherTable[item]"
    class="mt-1"
  >
  <div :style="custTableStyle" >
    <BasicTable @register="useTables[item][0]" v-if="showOtherTable[item]">
      <template #action="{ record }">
        <TableAction :actions="createActions(record, item)" />
      </template>
    </BasicTable>
  </div>
    <div :style="custTableStyle">
      <BasicTable @register="useTables[item][0]" v-if="showOtherTable[item]">
        <template #action="{ record }">
          <TableAction :actions="createActions(record, item)" />
        </template>
      </BasicTable>
    </div>
    <normalDrawer @register="useDrawers[item][0]" @success="(d, u) => EditSuccess(d, u, item)" />
    <GeneralCrudModal @register="useModalsCrud[item][0]"></GeneralCrudModal>
  </Card>
@@ -134,11 +134,12 @@
    useModalsCrud.value[x] = useModal();
  });
  const custTableStyle = ref({
    height: window.screen.width == 1366? '350px': '450px'
    height: window.screen.width == 1366 ? '350px' : '450px',
  });
  /* 注入选中节点数据 */
  const selectedNodes = inject('selectedNodes') as Ref<any>;
  const mainRecord = ref(objParams.value.record);
  watch(
    () => selectedNodes.value,
    (newVal, oldVal) => {
@@ -242,6 +243,7 @@
      // useModalData,
      // useFormData,
      crudColSlots: objParams.value['crudColSlots'][name],
      mainRecord: mainRecord.value,
    };
    const actionItem = [
@@ -295,7 +297,7 @@
  /**
   * @description: 点击打开弹出选择列表框
   * @param {*} item
   * @param {*} item slot名字
   * @return {*}
   */
  function SelectItemInForm(item) {
@@ -306,6 +308,7 @@
      useModalsCrudInForm.value[item][1].openModal,
      record,
      objParams.value['CODE'],
      mainRecord.value,
    );
  }
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
@@ -135,6 +135,14 @@
              span: 12,
            },
          },
          {
            field: 'LABEL_NAME',
            component: 'Input',
            label: '模板名称',
            colProps: {
              span: 12,
            },
          },
        ],
        ItemColumns: [
          {
src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
@@ -51,29 +51,31 @@
          action = {
            action: 'importModal', //drawer(打开左侧抽屉框) | go(跳转到新的页面) | modal(打开模态窗口) | importModal(打开导入模态窗口)
            params: {
              tmpHeader: ['工单号', '计划日期', '计划数量'], /* 下载模板的标题字段 */
              filename: '工单计划模板.xlsx', /* 下载模板的文件名 */
              entityName: 'BIZ_MES_WO_BATCH', /* 导入表的表名 */
              checkJson: ['ORDER_NO', 'PLAN_DATE', 'PLAN_QTY'], /* 导入表需要检查的字段列表 */
              where: ['ORDER_NO'], /* 导入表需要查询的字段列表 */
              typeFullName:'Tiger.IBusiness.MES.IImportWoPlan,Tiger.IBusiness.MES', /* 导入的方法全名,通用导入用这个:Tiger.IBusiness.ICommonImportExcel,Tiger.IBusiness */
              baseColumns: [ /* 导入时界面显示数据的字段 */
              tmpHeader: ['工单号', '计划日期', '计划数量'] /* 下载模板的标题字段 */,
              filename: '工单计划模板.xlsx' /* 下载模板的文件名 */,
              entityName: 'BIZ_MES_WO_BATCH' /* 导入表的表名 */,
              checkJson: ['ORDER_NO', 'PLAN_DATE', 'PLAN_QTY'] /* 导入表需要检查的字段列表 */,
              where: ['ORDER_NO'] /* 导入表需要查询的字段列表 */,
              typeFullName:
                'Tiger.IBusiness.MES.IImportWoPlan,Tiger.IBusiness.MES' /* 导入的方法全名,通用导入用这个:Tiger.IBusiness.ICommonImportExcel,Tiger.IBusiness */,
              baseColumns: [
                /* 导入时界面显示数据的字段 */
                {
                  title: '工单号',
                  dataIndex: 'ORDER_NO',
                  ifShow: true,
                  width: 180,
                },
                {
                  title: '工单批次号',
                  dataIndex: 'BATCH_NO',
                  ifShow: true,
                  width: 180,
                  // customRender: ({ record }) => {
                  //   record.BATCH_NO = record.ORDER_NO+'-01'
                  //   return record.BATCH_NO
                  // },
                },
                // {
                //   title: '工单批次号',
                //   dataIndex: 'BATCH_NO',
                //   ifShow: true,
                //   width: 180,
                //   // customRender: ({ record }) => {
                //   //   record.BATCH_NO = record.ORDER_NO+'-01'
                //   //   return record.BATCH_NO
                //   // },
                // },
                {
                  title: '计划日期',
                  dataIndex: 'PLAN_DATE',
@@ -84,18 +86,18 @@
                  title: '计划数量',
                  dataIndex: 'PLAN_QTY',
                  ifShow: true,
                  width: 180,
                  width: 100,
                },
                {
                  title: '处理方式',
                  dataIndex: 'VALIDATION_TYPE',
                  ifShow: true,
                  width: 180,
                  width: 100,
                  customRender: ({ record }) => {
                    const status = record.VALIDATION_TYPE;
                    var text = '';
                    var color = 'green';
                    if (status == '数据异常') {
                    if (status == '异常') {
                      color = 'red';
                      text = status;
                    } else if (status == '修改') {
@@ -111,7 +113,18 @@
                  title: '处理结果',
                  dataIndex: 'VALIDATION_RESULT',
                  ifShow: true,
                  width: 180,
                  width: 280,
                  customRender: ({ record }) => {
                    const status = record.VALIDATION_TYPE;
                    var text = record.VALIDATION_RESULT;
                    var color = 'green';
                    if (status == '异常') {
                      color = 'red';
                    } else if (status == '修改') {
                      color = 'yellow';
                    }
                    return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text));
                  },
                },
              ],
            },
@@ -346,7 +359,7 @@
     */
    GetTitle: () => {
      return {
        importTitle: '工单计划导入', /* 打开模态窗口显示的标题 */
        importTitle: '工单计划导入' /* 打开模态窗口显示的标题 */,
      };
    },
  };
@@ -489,8 +502,7 @@
      Name: 'WoRouteBinding',
      CODE: params['record'].ORDER_NO,
      Title: `工单[${params['record'].ORDER_NO}]工艺绑定`,
      colSlots:
        params['colSlots'].value /* 表格内的查询表单字段的插槽列表,一般用于弹出选择框按钮 */,
      colSlots: params['colSlots'].value /* 表格内的查询表单字段的插槽列表,一般用于弹出选择框按钮 */,
      crudColSlots: {
        BAS_PKG_DTL: ['BAS_LABEL_TEMP1add'],
        ItemCode: ['BAS_CODE_RULE1add'],
@@ -499,6 +511,7 @@
        'BAS_PKG_DTL',
        'ItemCode',
      ] /* 自定义显示列表的表名,跟上面增删改的表名一致,有多个就放列表中 */,
      record: params['record'],
      dense: true,
      pageTitle: `工单工艺绑定`,
      pageContent: `这里是管理工单的工艺绑定,一个工单可以绑定一个工艺路线,并可以保存为客户专用的工艺路线`,
src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts
@@ -359,6 +359,11 @@
          ItemColumns: TemplateBasColumn, //弹出框中表格字段结构
          schemas: [], //查询条件字段结构
          others: { WORK_ORDER: OrderNo }, //需要带到弹出窗口中的数据
          alertConfig: {
            showAlert: false,
            message: '销售订单备注',
            description: '',
          },
          searchInfo: {
            TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称
            LabelId: record.LABEL_CODE, //模板ID
@@ -1854,6 +1859,7 @@
    const openCrudModal = args[0];
    // const OrderNo = args[2];
    const ProdCode = args[2];
    const WoRecord = args[4];
    openCrudModal(true, {
      isUpdate: true, //是否更新操作
      entityName: 'ProdRouteBinding', //是哪个页面
@@ -1863,6 +1869,11 @@
      ItemColumns: TemplateBasColumn, //弹出框中表格字段结构
      schemas: [], //查询条件字段结构
      others: { WORK_ORDER: '', PROD_CODE: ProdCode }, //需要带到弹出窗口中的数据
      alertConfig: {
        showAlert: false,
        message: '销售订单备注',
        description: WoRecord.SALES_REMARK,
      },
      searchInfo: {
        TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称
        LabelId: params['record'].LABEL_ID, //模板ID
src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts
@@ -439,9 +439,11 @@
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      let config = {};
      const openCrudModal = args[1];
      const record = args[2];
      const record = args[2]; //带过来的记录
      const OrderNo = args[3];
      switch (args[0]) {
      const WoRecord = args[4];
      /* args[0]是界面上的slot名字,根据slot名字来写不同的逻辑实现 */
      switch (args[0]) {
        case 'scanadd':
          config = ruleModalCfg;
          break;
@@ -458,6 +460,7 @@
          config = pkgModalCfg;
          break;
      }
      /* 如果slot是'labeladd',打开增删改模态窗口,可编辑行 */
      if (args[0] == 'labeladd') {
        openCrudModal(true, {
          isUpdate: true, //是否更新操作
@@ -467,7 +470,12 @@
          width: '1024px', //弹出框宽度
          ItemColumns: TemplateBasColumn, //弹出框中表格字段结构
          schemas: [], //查询条件字段结构
          others: { WORK_ORDER: OrderNo }, //需要带到弹出窗口中的数据
          others: { WORK_ORDER: OrderNo}, //需要带到弹出窗口中的数据
          alertConfig: {
            showAlert: true,
            message: '销售订单备注',
            description: WoRecord.SALES_REMARK,
          },  /* 在弹出窗口最上位置显示提醒信息,显示销售订单备注 */
          searchInfo: {
            TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称
            LabelId: record.LABEL_CODE, //模板ID
@@ -1183,6 +1191,14 @@
          span: 12,
        },
      },
      {
        field: 'LABEL_NAME',
        component: 'Input',
        label: '模板名称',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
@@ -1871,6 +1887,7 @@
  function handleTemplate(args, params: Recordable) {
    const openCrudModal = args[0];
    const OrderNo = args[2];
    const WoRecord = params['mainRecord'];
    openCrudModal(true, {
      isUpdate: true, //是否更新操作
      entityName: 'WoRouteBinding', //是哪个页面
@@ -1880,6 +1897,11 @@
      ItemColumns: TemplateBasColumn, //弹出框中表格字段结构
      schemas: [], //查询条件字段结构
      others: { WORK_ORDER: OrderNo }, //需要带到弹出窗口中的数据
      alertConfig: {
        showAlert: true,
        message: '销售订单备注',
        description: WoRecord.SALES_REMARK,
      }, /* 在弹出窗口最上位置显示提醒信息,显示销售订单备注 */
      searchInfo: {
        TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称
        LabelId: params['record'].LABEL_ID, //模板ID