Ben Lin
2025-03-05 abbc201b41a1a25a19ccf7cff8df633dadcf5d88
src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts
@@ -4,20 +4,17 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-02 19:43:08
 * @LastEditTime: 2024-07-04 11:22:58
 */
import { Ref, h, unref } from 'vue';
import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
import { ActionItem, BasicColumn, FormSchema, useTable } from '/@/components/Table';
import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
import { buildUUID } from '/@/utils/uuid';
import { useUserStore } from '/@/store/modules/user';
import { formatToDateTime } from '/@/utils/dateUtil';
import { Tag } from 'ant-design-vue';
import { useLocale } from '/@/locales/useLocale';
import { useDrawer } from '/@/components/Drawer';
import { EditOperation, Search } from '../data';
import { EditOperation, Search, custDel } from '../data';
const { getLocale } = useLocale();
function _default() {
@@ -40,9 +37,19 @@
        if (item['ID'] == d.ID)
          return {
            ...item,
            INS_CODE: d.INS_CODE,
            INS_NAME: d.INS_NAME,
            STD_CODE: d.STD_CODE,
            STD_NAME: d.STD_NAME,
            STD_TYPE: d.STD_TYPE,
            CTGY_CODE: d.CTGY_CODE,
            IS_NECESSARY: d.IS_NECESSARY,
            IS_JUDGE: d.IS_JUDGE,
            INS_TOOL: d.INS_TOOL,
            QNTV_UNIT: d.QNTV_UNIT,
            QNTV_TIMES: d.QNTV_TIMES,
            QNTV_DEVIATION: d.QNTV_DEVIATION,
            QNTV_UPPER: d.QNTV_UPPER,
            QNTV_LOWER: d.QNTV_LOWER,
            QLTV_LIST: d.QLTV_LIST,
            REMARK: d.REMARK,
          };
        return item;
@@ -53,7 +60,7 @@
     * @description: 获取新增按钮的行为
     * @return {*}
     */
    CreateAction: (fnName: string) => {
    CreateAction: (type: string) => {
      return {
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
@@ -64,7 +71,7 @@
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      if (!isNullOrUnDef(data[1])) {
        data[1].popConfirm.confirm = Del.bind(null, args, params);
        data[1].popConfirm.confirm = custDel.bind(null, args, params);
      }
      return data;
    },
@@ -180,7 +187,7 @@
            submitFunc: () => Search('QMS_INS_ITEM', data, args[0]), //自定义查询提交按钮的方法,触发查询提交事件
          },
          useSearchForm: true,
          showTableSetting: true,
          showTableSetting: false,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
@@ -215,8 +222,14 @@
      }
      return data;
    },
    OthersValues: (val: string, id: string) => {
      return { TECH_STD: val };
    /**
     * @description: 一些其他的字段值,一般是增删改是带入的关键字段值
     * @param {string} val
     * @param {string} id
     * @return {*}
     */
    KeyFieldValues: (val: string, id: string) => {
      return { STD_CODE: val };
    },
    /**
     * @description: 获取标题信息
@@ -232,33 +245,12 @@
        },
      };
    },
    GetUseForm: () => {
      return {};
    },
  };
  /**
   * @description: 自定义删除方法
   * @param {Fn} args
   * @param {*} params
   * @return {*}
   */
  function Del(args: Fn[], params: {}) {
    if (!isNullOrEmpty(params['data'])) {
      var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']);
      params['data'].value = _data;
      args[6]({
        dataSource: [],
      });
      args[6]({
        dataSource: params['data'],
      });
      args[1]();
    } else {
      DeleteEntity(params['record'], params['entityName']).then((action) => {
        if (action.IsSuccessed) {
          args[1]();
        }
      });
    }
  }
  /* 以下是内部方法,不export */
  const baseColumns = {
    QMS_INS_ITEM: [
@@ -296,8 +288,12 @@
        },
      },
      {
        title: '检验标准编码',
        title: '技术要求',
        dataIndex: 'TECH_STD',
      },
      {
        title: '检验标准编码',
        dataIndex: 'STD_CODE',
      },
      {
        title: '是否必检',
@@ -419,7 +415,7 @@
      },
      {
        label: '检验标准',
        field: 'TECH_STD',
        field: 'STD_CODE',
        component: 'ApiSelect',
        colProps: {
          span: 24,
@@ -452,6 +448,60 @@
        },
      },
      {
        label: '是否必检',
        field: 'IS_NECESSARY',
        component: 'Select',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          options: [
            {
              label: '是',
              value: 'Y',
              key: 'Y',
            },
            {
              label: '否',
              value: 'N',
              key: 'N',
            },
          ],
        },
      },
      {
        label: '是否判定结果',
        field: 'IS_JUDGE',
        component: 'Select',
        required: true,
        colProps: {
          span: 24,
        },
        componentProps: {
          options: [
            {
              label: '是',
              value: 'Y',
              key: 'Y',
            },
            {
              label: '否',
              value: 'N',
              key: 'N',
            },
          ],
        },
      },
      {
        label: '技术要求',
        field: 'TECH_STD',
        component: 'Input',
        colProps: {
          span: 24,
        },
      },
      {
        label: '备注',
        field: 'REMARK',
        component: 'Input',