Ben Lin
2024-11-25 6e6fec028ffc9a27b3c8d30eb484cd361a119d76
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts
@@ -4,7 +4,7 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-08-20 14:59:13
 * @LastEditTime: 2024-10-22 11:40:44
 */
import { Tag, Tooltip } from 'ant-design-vue';
@@ -26,6 +26,7 @@
  BasLabelTempInput,
} from '/@/api/tigerapi/model/mesModel';
import { useUserStore } from '/@/store/modules/user';
import { cloneDeep } from 'lodash-es';
const { getLocale } = useLocale();
@@ -166,7 +167,7 @@
          component: 'Input',
          isexist: 'N',
          show: true,
          required: true,
          // required: true,
          colProps: {
            span: 7,
          },
@@ -346,6 +347,15 @@
    GetNewRow: (type: string) => {
      let values = {};
      switch (type) {
        case 'BAS_LABEL_VAR':
          values = {
            VAR_NAME: '',
            VAR_TYPE: '',
            VAR_VALUE: '',
            BARCODE_RULE: '',
            REMARK: '',
          };
          break;
        case 'BAS_LABEL_VAR_WO':
          values = newRow;
          break;
@@ -380,7 +390,7 @@
    GetBaseCards: (type: string) => {
      return [
        {
          name: 'BaseForm',
          name: 'BaseForm', //第一个卡片名称必需是BaseForm
          slots: [],
          preIcons: {},
          title: '模板信息',
@@ -397,7 +407,7 @@
        {
          BAS_LABEL_VAR: useDrawer(),
        },
        { BAS_LABEL_VAR_WO: useDrawer() },
        // { BAS_LABEL_VAR_WO: useDrawer() },
      ];
    },
    /**
@@ -427,13 +437,13 @@
          // rowSelection: {
          //   type: 'radio', //'checkbox'
          // },
          // actionColumn: {
          //   width: 130,
          //   title: '操作',
          //   dataIndex: 'action',
          //   slots: { customRender: 'action' },
          //   fixed: 'right',
          // }, //自定义操作列
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          }, //自定义操作列
        }),
        BAS_LABEL_VAR_WO: useTable({
          title: '列表信息',
@@ -546,8 +556,8 @@
          PROD_CODE: label.PROD_CODE,
          REMARK: '',
        } as unknown as BAS_LABEL_TEMP,
        LabelVars: {} as unknown as BAS_LABEL_VAR[],
        LabelVarWos: {} as unknown as BAS_LABEL_VAR_WO[],
        LabelVars: [] as unknown as BAS_LABEL_VAR[],
        LabelVarWos: [] as unknown as BAS_LABEL_VAR_WO[],
      };
      drawers.forEach((d) => {
        let where = `${d['code']} = '${keyFieldValues.value[d['code']]}'`;
@@ -716,6 +726,27 @@
        }
      });
    },
    /**
     * @desc 保存方法
     */
    SaveRow: (param: CustModalParams) => {
      return new Promise((resolve, reject) => {
        try {
          param.data.value[param.cType] = param.data.value[param.cType].map((d) => {
            if (d.ID == param.values['ID']) {
              d.VAR_NAME = param.values['VAR_NAME'];
              d.VAR_TYPE = param.values['VAR_TYPE'];
              d.VAR_VALUE = param.values['VAR_VALUE'];
              d.BARCODE_RULE = param.values['BARCODE_RULE'];
              d.REMARK = param.values['REMARK'];
            }
            return d;
          });
        } catch {
          reject(false);
        }
      });
    },
  };
  let columns: BasicColumn[] = [];
@@ -738,13 +769,14 @@
        title: '变量名称',
        ifShow: true,
        sorter: true,
        editRow: true,
        resizable: true,
        customRender: () => {},
      },
      {
        dataIndex: 'VAR_TYPE',
        title: '变量类型',
        edit: true,
        editRow: true,
        editRule: true,
        ifShow: true,
        sorter: true,
@@ -759,7 +791,10 @@
            valueField: 'Value',
            onChange: (e, v) => {
              if (e == 1 || e == 4) {
                const where = e == 1? { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 0}: { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 1};
                const where =
                  e == 1
                    ? { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 0 }
                    : { TABLE_NAME: 'BAS_LABEL_PV', VAR_TYPE: 1 };
                emit('opencust', {
                  data: column.record,
                  name: 'BAS_LABEL_VAR',
@@ -837,7 +872,7 @@
            {
              dataIndex: 'VAR_VALUE',
              title: '变量值',
              edit: true,
              editRow: true,
              // editable: true,
              editRule: true,
              ifShow: (column) => true,
@@ -848,7 +883,7 @@
              dataIndex: 'BARCODE_RULE',
              title: '条码生成规则',
              ifShow: true,
              edit: true,
              editRow: true,
              editRule: true,
              sorter: true,
              resizable: true,
@@ -867,6 +902,7 @@
              dataIndex: 'REMARK',
              title: '备注',
              ifShow: true,
              editRow: true,
              sorter: true,
              resizable: true,
            },