Ben Lin
2024-07-31 08d4018e84039c5a9d400790704fa931afdc861b
模板变量维护更新
已修改12个文件
已添加1个文件
741 ■■■■ 文件已修改
src/api/tigerapi/model/basModel.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/system.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM.ts 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts 321 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/baseForm.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/high/edit/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/mainTable.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normalDrawer.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/setting/pageDetail.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/tsk/tsk_job/index.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/model/basModel.ts
@@ -123,7 +123,7 @@
 * @return {*}
 */
export interface EntityCustFunctionType {
  CreateAction: (type: string) => {};
  CreateAction: (type: string, ...args) => {};
  ActionItem: (params: Recordable<any>, data, ...args) => ActionItem[];
  EditOperation: (data: Ref<any[]>, d, u, item: string | undefined) => void;
  OpenSelectItem: (openItemModal: Fn, ...args) => void;
@@ -153,6 +153,7 @@
  CustFunc: (param: CustModalParams) => void | any;
  SubmitAll: (data: Ref<any[]>, keyFieldValues: Ref<{}>, ...args) => void | any;
  CustInitData: (data: Ref<any[]>, keyFieldValues: Ref<{}>, type: string) => void | any;
  CustEditEnd: ({ record, index, key, value }: Recordable, type, ...args) => void | any;
  GetCustData: () => {};
  GetRightMenuList: (node: EventDataNode, ...args) => ContextMenuItem[];
  GetNewRow: (type: string) => {};
src/api/tigerapi/system.ts
@@ -780,9 +780,9 @@
export async function SaveEntity<T>(params: T, isUpdate: boolean, entityName: string, ...args) {
  let data;
  /* é’ˆå¯¹æ¨¡æ¿åœ°å€åšæ›¿æ¢ï¼Œç‰¹æ®Šå¤„理 */
  if(params['TEMP_PATH']){
    params['TEMP_PATH'] = params['TEMP_PATH'].toString().replace('/','//');
  }
  // if(params['TEMP_PATH']){
  //   params['TEMP_PATH'] = params['TEMP_PATH'].toString().replace('/','//');
  // }
  if (isUpdate) {
    data = await defHttp.post(
      { url: Api.UpdateEntity, params: genAction(entityName, params) },
src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
/*
 * @Description: ç‰©æ–™ç›¸å…³
 * @Author: Ben Lin
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-30 11:09:14
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
function _default() {
  const ActionColumn: BasicColumn = {
    width: 80,
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
    fixed: undefined,
  };
  /**
   * @description: ä¸€äº›è‡ªå®šä¹‰æ–¹æ³•
   * @return {*}
   */
  const methods = {
    /**
     * @description: èŽ·å–æ–°å¢žæŒ‰é’®çš„è¡Œä¸º
     * @return {*}
     */
    CreateAction: (type: string) => {
      return {
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
    },
    /**
     * @description: æ“ä½œå­—段自定义按钮
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      return data;
    },
    /**
     * @description: é€‰æ‹©è¿‡ç¨‹å˜é‡å¼¹å‡ºé€‰æ‹©æ¡†æˆåŠŸè¿”å›žèµ‹å€¼æ–¹æ³•
     * @param {*} d
     * @param {*} u
     * @return {*}
     */
    GetSelectSuccess: (d, u, type) => {
      let result = {};
      switch (type) {
        case 'BAS_LABEL_TEMP':
          result = {
            PROD_CODE: d.values['val'],
          };
          break;
        default:
          result = {
            ITEM_CODE: d.values['val'],
          };
          break;
      }
      return result;
    },
    OpenSelectItem: (openItemModal: Fn, ...args) => {
      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',
        searchInfo: { TABLE_NAME: 'BAS_ITEM' },
      });
    },
    GetUseForm: () => {
      return {};
    },
  };
  return [methods, ActionColumn];
}
export default _default;
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-28 10:51:56
 * @LastEditTime: 2024-07-31 08:26:33
 */
import { ActionItem, BasicColumn } from '/@/components/Table';
@@ -40,6 +40,18 @@
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      data.map((x) => {
        if (
          (x.name == 'Delete' || x.name == 'Edit') &&
          (params['record']['VAR_CODE'] == 'PV-WorkOrder-Plan' ||
            params['record']['VAR_CODE'] == 'PV-CUSTOMER' ||
            params['record']['VAR_CODE'] == 'PV-ITEM' ||
            params['record']['VAR_CODE'] == 'PV-SN')
        ) {
          x.disabled = true;
          x.tooltip = '删除';
        }
      });
      return data;
    },
    /**
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
@@ -4,13 +4,13 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-29 23:38:12
 * @LastEditTime: 2024-07-31 22:23:50
 */
import { DeleteLabelTemplate } from '/@/api/tigerapi/mes/label';
import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { useWebSocketStore } from '/@/store/modules/websocket';
import { buildUUID } from '/@/utils/uuid';
function _default() {
  const ActionColumn: BasicColumn = {
@@ -30,40 +30,45 @@
     * @description: èŽ·å–æ–°å¢žæŒ‰é’®çš„è¡Œä¸º
     * @return {*}
     */
    CreateAction: (type: string) => {
    CreateAction: (type: string, ...args) => {
      return {
        action: 'go', //drawer(打开左侧抽屉框) | go(跳转到新的页面) | edit(如果是表格可编辑页面就是自定义方法)
        url: 'BAS_LABEL_VAR/High',
        params: {
          CODE: '0',
          ID: buildUUID(),
          Name: 'BAS_LABEL_VAR', //实体名
          Title: '新增模板', //标题
          pCode: 'LABEL_CODE', //主信息关键字段CODE
          IsID: true, //是否带过去侧边框的是ID,false就是CODE,true是ID
          colSlots: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
          drawers: [
            {
              name: 'BAS_LABEL_VAR', //实体名
              code: 'LABEL_ID', //传递过去高级表单页面的关键字段名
              type: 'one', //one-表示需要code的一个值,默认是这个
              keyName: 'BAS_LABEL_VAR', //关键表名(实体名)
              order: 'VAR_NAME', //排序
              showTbButton: false, //是否显示工具栏按钮
              FnName: '', //自定义方法名
            },
            {
              name: 'BAS_LABEL_VAR_WO', //实体名
              code: 'LABEL_ID', //传递过去高级表单页面的关键字段名
              type: 'one', //all-表示需要code的所有的值
              keyName: 'BAS_LABEL_VAR_WO', //关键表名(实体名)
              order: '',
              showTbButton: true, //是否显示工具栏按钮
              FnName: 'AddRow', //自定义方法名
            },
          ], //drawers是右边弹出增改侧框的名字列表,及按钮的执行方法
        },
        action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面)
      };
      // const colSlots = args[0];
      // return {
      //   action: 'go', //drawer(打开左侧抽屉框) | go(跳转到新的页面) | edit(如果是表格可编辑页面就是自定义方法)
      //   url: 'BAS_LABEL_VAR/High',
      //   params: {
      //     CODE: '0',
      //     ID: buildUUID(),
      //     Name: 'BAS_LABEL_VAR', //实体名
      //     Title: '新增模板', //标题
      //     pCode: 'LABEL_CODE', //主信息关键字段CODE
      //     IsID: true, //是否带过去侧边框的是ID,false就是CODE,true是ID
      //     colSlots: colSlots,
      //     colSlotsInHigh: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
      //     drawers: [
      //       {
      //         name: 'BAS_LABEL_VAR', //实体名
      //         code: 'LABEL_ID', //传递过去高级表单页面的关键字段名
      //         type: 'one', //one-表示需要code的一个值,默认是这个
      //         keyName: 'BAS_LABEL_VAR', //关键表名(实体名)
      //         order: 'VAR_NAME', //排序
      //         showTbButton: false, //是否显示工具栏按钮
      //         FnName: '', //自定义方法名
      //       },
      //       {
      //         name: 'BAS_LABEL_VAR_WO', //实体名
      //         code: 'LABEL_ID', //传递过去高级表单页面的关键字段名
      //         type: 'one', //all-表示需要code的所有的值
      //         keyName: 'BAS_LABEL_VAR_WO', //关键表名(实体名)
      //         order: '',
      //         showTbButton: true, //是否显示工具栏按钮
      //         FnName: 'AddRow', //自定义方法名
      //       },
      //     ], //drawers是右边弹出增改侧框的名字列表,及按钮的执行方法
      //   },
      // };
    },
    /**
     * @description: æ“ä½œå­—段自定义按钮
@@ -71,9 +76,13 @@
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      data.map((x) => {
        if (x.name == 'Edit') {
        if (x.name == 'goDetail') {
          x.onClick = goDetail.bind(null, args[5], params);
          x.tooltip = '模板变量';
        }
        if (x.name == 'Delete') {
          x.popConfirm.confirm = Del.bind(null, args, params);
          x.tooltip = '删除';
        }
      });
      return data;
@@ -113,7 +122,8 @@
      Title: `编辑模板${params['record']['LABEL_CODE']}的变量`,
      pCode: 'LABEL_CODE',
      IsID: true,
      colSlots: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
      colSlots: params['colSlots'].value, //['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
      colSlotsInHigh: ['BAS_LABEL_VAR1add', 'BAS_LABEL_VAR2add'],
      drawers: [
        {
          name: 'BAS_LABEL_VAR',
@@ -149,6 +159,21 @@
    );
  }
  /**
   * @description: è‡ªå®šä¹‰åˆ é™¤æ–¹æ³•
   * @param {Fn} args
   * @param {*} params
   * @return {*}
   */
  function Del(args: Fn[], params: {}) {
    const reload = args[1];
    DeleteLabelTemplate(params['record']['ID']).then((action) => {
      if (action.IsSuccessed) {
        reload();
      }
    });
  }
  return [methods, ActionColumn];
}
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts
@@ -4,29 +4,35 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-29 23:10:18
 * @LastEditTime: 2024-07-31 23:07:14
 */
import { Tag, Tooltip } from 'ant-design-vue';
import { ActionItem, BasicColumn, FormSchema, useTable } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
import { h, Ref, unref } from 'vue';
import { h, ref, Ref, unref } from 'vue';
import { AddAfterDelete, getEntity, GetEnum } from '/@/api/tigerapi/system';
import { useLocale } from '/@/locales/useLocale';
import { useDrawer } from '/@/components/Drawer';
import { formatTime } from '/@/utils/dateUtil';
import { custDel, EditOperation, Search } from '../data';
import { buildUUID } from '/@/utils/uuid';
import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel';
import { useModal } from '/@/components/Modal';
import { SaveLabelTemplate } from '/@/api/tigerapi/mes/label';
import { BAS_LABEL_TEMP, BAS_LABEL_VAR, BAS_LABEL_VAR_WO, BasLabelTempInput } from '/@/api/tigerapi/model/mesModel';
import {
  BAS_LABEL_TEMP,
  BAS_LABEL_VAR,
  BAS_LABEL_VAR_WO,
  BasLabelTempInput,
} from '/@/api/tigerapi/model/mesModel';
import { useUserStore } from '/@/store/modules/user';
import { uploadApi } from '/@/api/sys/upload';
import { useWebSocketStore } from '/@/store/modules/websocket';
const { getLocale } = useLocale();
const { t } = useI18n();
let newRow = {};
function _default() {
  const ActionColumn: BasicColumn = {
    width: 80,
@@ -74,14 +80,14 @@
     * @description: é«˜çº§è¡¨å•和详情页面返回主页面的url
     * @return {*}
     */
    GetHomeUrl: () => {
      return `/BAS_LABEL_TEMP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_LABEL_TEMP', colSlots: [], crudColSlots: [] }))}`;
    GetHomeUrl: (params: {}) => {
      return `/BAS_LABEL_TEMP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_LABEL_TEMP', colSlots: params['colSlots'], crudColSlots: [] }))}`;
    },
    /**
     * @description: èŽ·å–ä¸»ä¿¡æ¯
     * @return {*}
     */
    GetBaseForm: () => {
    GetBaseForm: (type, ...args) => {
      return [
        {
          field: 'LABEL_CODE',
@@ -92,6 +98,7 @@
          colProps: {
            span: 8,
          },
          dynamicDisabled: true,
        },
        {
          label: '标签模板名称',
@@ -118,17 +125,43 @@
            valueField: 'Value',
          },
        },
        {
          field: 'TEMP_PATH',
          label: '标签模板相对路径',
          component: 'Upload',
          isexist: 'N',
          show: true,
          required: true,
          colProps: {
            span: 8,
          },
        },
        // {
        //   field: 'TEMP_PATH',
        //   label: '标签模板相对路径',
        //   component: 'Upload',
        //   isexist: 'N',
        //   show: true,
        //   required: true,
        //   colProps: {
        //     span: 8,
        //   },
        //   componentProps: ({ formModel }) => {
        //     return {
        //       resultField: 'data3.url',
        //       multiple: false,
        //       uploadParams: { entityName: type },
        //       api: (file, progress) => {
        //         console.log(formModel);
        //         return new Promise((resolve) => {
        //           uploadApi(file, progress).then((uploadApiResponse) => {
        //             const webSocketStore = useWebSocketStore();
        //             if (webSocketStore.GetSocketState == 1) {
        //               webSocketStore.sendMessage(
        //                 `wsSubStrings ${formModel['ID']}_#_${uploadApiResponse.data.url}`,
        //               );
        //             }
        //             resolve({
        //               code: 200,
        //               data3: {
        //                 url: uploadApiResponse.data.url,
        //               },
        //             });
        //           });
        //         });
        //       },
        //     };
        //   },
        // },
        {
          field: 'PROD_CODE',
          label: '产品编码',
@@ -172,7 +205,16 @@
          field: 'REMARK',
          component: 'Input',
          colProps: {
            span: 24,
            span: 8,
          },
        },
        {
          label: '标签模板相对路径',
          field: 'TEMP_PATH',
          required: true,
          component: 'Input',
          colProps: {
            span: 16,
          },
        },
        {
@@ -307,14 +349,7 @@
      let values = {};
      switch (type) {
        case 'BAS_LABEL_VAR_WO':
          values = {
            ID: buildUUID(),
            LABEL_ID: '',
            VAR_NAME: '',
            VAR_TYPE: '',
            VAR_VALUE: '',
            REMARK: '',
          };
          values = newRow;
          break;
      }
      return values;
@@ -378,7 +413,7 @@
        BAS_LABEL_VAR: useTable({
          title: '列表信息',
          dataSource: data.value['BAS_LABEL_VAR'],
          columns: GetBaseColumns('BAS_LABEL_VAR', args[0]),
          columns: GetBaseColumns('BAS_LABEL_VAR', args[0], data),
          maxHeight: 520,
          formConfig: {
            labelWidth: 140,
@@ -404,8 +439,8 @@
        BAS_LABEL_VAR_WO: useTable({
          title: '列表信息',
          dataSource: data.value['BAS_LABEL_VAR_WO'],
          columns: baseColumns['BAS_LABEL_VAR_WO'],
          maxHeight: 550,
          columns: GetBaseColumns('BAS_LABEL_VAR_WO', args[0], data),
          scroll: { y: 500 },
          formConfig: {
            labelWidth: 140,
            schemas: searchForms['BAS_LABEL_VAR_WO'],
@@ -425,6 +460,62 @@
          }, //自定义操作列
        }),
      };
    },
    /**
     * @description: è‡ªå®šä¹‰åˆå§‹åŒ–方法
     * @param {Ref} data
     * @param {Ref} keyFieldValues
     * @param {string} type
     * @param {any} useTables
     * @return {*}
     */
    CustInitData: (data: Ref<any[]>, keyFieldValues: Ref<{}>, type: string, useTables: any) => {
      if (type == 'BAS_LABEL_VAR_WO') {
        if (data.value['BAS_LABEL_VAR_WO'].length > 0) {
          /* åˆå§‹åŒ–数据,行转列 */
          let varwos: any[] = [];
          const map = new Map<string, any>();
          data.value['BAS_LABEL_VAR_WO'].map((curr) => {
            if (!map.has(curr.WORK_ORDER)) {
              const newObj = {};
              newObj['WORK_ORDER'] = curr.WORK_ORDER;
              map.set(curr.WORK_ORDER, newObj);
            }
            const acc = map.get(curr.WORK_ORDER);
            Object.keys(curr).forEach((key) => {
              if (key != 'VAR_NAME' && key != 'VAR_VALUE') {
                acc[key] = curr[key];
              } else if (key == 'VAR_NAME') {
                acc[`DEFAULT_VALUE_${curr.VAR_NAME}`] = curr.DEFAULT_VALUE;
                acc[`VAR_N_${curr.VAR_NAME}`] = curr.VAR_VALUE;
              }
            });
            // varwos.push(acc);
          });
          map.forEach((x) => {
            varwos.push(x);
          });
          data.value['BAS_LABEL_VAR_WO'] = varwos;
        }
        useTables[type][1].setProps({
          dataSource: data.value['BAS_LABEL_VAR_WO'],
          columns: GetBaseColumns('BAS_LABEL_VAR_WO', null, data),
          scroll: { y: 500 },
          useSearchForm: false,
          showTableSetting: false,
          bordered: true,
          canResize: true,
          showIndexColumn: false,
          actionColumn: {
            width: 130,
            title: '操作',
            dataIndex: 'action',
            slots: { customRender: 'action' },
            fixed: 'right',
          },
        });
        useTables[type][1].reload();
      }
    },
    /**
     * @description: æäº¤æ‰€æœ‰
@@ -454,7 +545,7 @@
          TEMP_PATH: label.TEMP_PATH[0],
          CUST_CODE: label.CUST_CODE,
          PROD_CODE: label.PROD_CODE,
          REMARK: ''
          REMARK: '',
        } as unknown as BAS_LABEL_TEMP,
        LabelVars: {} as unknown as BAS_LABEL_VAR[],
        LabelVarWos: {} as unknown as BAS_LABEL_VAR_WO[],
@@ -468,11 +559,45 @@
        data.value[d['name']].map((item) => {
          item.ID = buildUUID();
        });
        if(d.name == 'BAS_LABEL_VAR'){
          input.LabelVars =  data.value[d['name']];
        if (d.name == 'BAS_LABEL_VAR') {
          input.LabelVars = data.value[d['name']];
        }
        if(d.name == 'BAS_LABEL_VAR_WO'){
          input.LabelVarWos =  data.value[d['name']];
        if (d.name == 'BAS_LABEL_VAR_WO') {
          let varwos: any[] = [];
          data.value[d['name']].map((curr) => {
            const vKeys: any[] = [];
            Object.keys(curr).forEach((key) => {
              if (key.startsWith('VAR_N_')) {
                vKeys.push(key);
              }
              // if (key.startsWith('VAR_N_')) {
              //   acc['VAR_NAME'] = key.replace('VAR_N_', '');
              //   acc['VAR_VALUE'] = curr[key];
              // } else if (key.startsWith('DEFAULT_VALUE_')) {
              //   acc['DEFAULT_VALUE'] = curr[key]; acc[key] = curr[key];
              // }
            });
            vKeys.forEach((k) => {
              let acc = {};
              Object.keys(curr).forEach((key) => {
                if (key == k) {
                  acc['VAR_NAME'] = key.replace('VAR_N_', '');
                  acc['VAR_VALUE'] = curr[key];
                } else if (key == `DEFAULT_VALUE_${k.replace('VAR_N_', '')}`) {
                  acc['DEFAULT_VALUE'] = curr[key];
                } else if (
                  !key.startsWith('VAR_N_') &&
                  !key.startsWith('DEFAULT_VALUE_') &&
                  key != 'DEFAULT_VALUE'
                ) {
                  acc[key] = curr[key];
                }
              });
              acc['ID'] = buildUUID();
              varwos.push(acc);
            });
          });
          input.LabelVarWos = varwos;
        }
      });
      SaveLabelTemplate(input).then((action) => {
@@ -505,6 +630,60 @@
            }
          });
        // break;
      }
    },
    /**
     * @description: ç¼–辑单元格完成后自定义方法
     * @param {Recordable} param1
     * @param {*} type
     * @param {any} useTables
     * @return {*}
     */
    CustEditEnd: ({ record, index, key, value }: Recordable, type, ...args) => {
      console.log(key, value);
      const useTables = args[0];
      const data = args[1];
      let varWodata: any[] = [];
      if (
        (record['VAR_TYPE'] == 1 && record['VAR_VALUE'] != 'PV-WorkOrder-Plan') ||
        record['VAR_TYPE'] != 1
      ) {
        data.value['BAS_LABEL_VAR_WO'].forEach((x) => {
          let acc: any = {};
          Object.keys(x).map((key) => {
            if (key != `VAR_N_${record['VAR_NAME']}`) {
              acc[key] = x[key];
            }
          });
          varWodata.push(acc);
        });
        data.value['BAS_LABEL_VAR_WO'] = varWodata;
      } else {
        varWodata = data.value['BAS_LABEL_VAR_WO'];
      }
      switch (type) {
        case 'BAS_LABEL_VAR':
          useTables['BAS_LABEL_VAR_WO'][1].setProps({
            dataSource: varWodata,
            columns: GetBaseColumns('BAS_LABEL_VAR_WO', null, data),
            scroll: { y: 500 },
            useSearchForm: false,
            showTableSetting: false,
            bordered: true,
            canResize: true,
            showIndexColumn: false,
            actionColumn: {
              width: 130,
              title: '操作',
              dataIndex: 'action',
              slots: { customRender: 'action' },
              fixed: 'right',
            },
          });
          useTables['BAS_LABEL_VAR_WO'][1].reload();
          break;
        default:
          break;
      }
    },
  };
@@ -546,7 +725,7 @@
   * @param {string} type
   * @return {*}
   */
  function GetBaseColumns(type: string, emit) {
  function GetBaseColumns(type: string, emit, data: Ref<{}>) {
    columns = [
      {
        dataIndex: 'LABEL_ID',
@@ -671,6 +850,68 @@
          ],
        ] as BasicColumn[];
        break;
      case 'BAS_LABEL_VAR_WO':
        const _columns = [
          {
            dataIndex: 'LABEL_ID',
            title: '标签模板ID',
            ifShow: false,
            sorter: true,
            resizable: true,
          },
          {
            title: '工单号',
            dataIndex: 'WORK_ORDER',
            width: 280,
            edit: true,
            editRule: true,
            // editable: true,
            ifShow: true,
          },
        ] as BasicColumn[];
        newRow = {
          ID: buildUUID(),
          LABEL_ID:
            data.value['BAS_LABEL_VAR'].length > 0 ? data.value['BAS_LABEL_VAR'][0].LABEL_ID : '',
          WORK_ORDER: '',
        };
        data.value['BAS_LABEL_VAR'].map((x) => {
          if (x.VAR_TYPE == 1 && x.VAR_VALUE == 'PV-WorkOrder-Plan') {
            newRow[`${x.VAR_NAME}_DEFAULT_VALUE`] = '';
            newRow[x.VAR_NAME] = '';
            _columns.push(
              {
                title: `(变量)${x.VAR_NAME}默认值`,
                dataIndex: `DEFAULT_VALUE_${x.VAR_NAME}`,
                width: 280,
                edit: true,
                editRule: true,
                resizable: true,
                ifShow: true,
              },
              {
                title: `(变量)${x.VAR_NAME}`,
                dataIndex: `VAR_N_${x.VAR_NAME}`,
                width: 280,
                edit: true,
                editRule: true,
                resizable: true,
                ifShow: true,
              },
            );
          }
        });
        _columns.push({
          title: `备注`,
          dataIndex: 'REMARK',
          width: 280,
          edit: true,
          editRule: true,
          resizable: true,
          ifShow: true,
        });
        columns = _columns;
        break;
    }
    return columns;
  }
@@ -694,7 +935,7 @@
        dataIndex: 'WORK_ORDER',
        edit: true,
        editRule: true,
        editable: true,
        // editable: true,
        ifShow: true,
      },
      {
@@ -702,7 +943,7 @@
        title: '变量名称',
        edit: true,
        editRule: true,
        editable: true,
        // editable: true,
        ifShow: true,
        sorter: true,
        resizable: true,
@@ -713,7 +954,7 @@
        title: '变量值',
        edit: true,
        editRule: true,
        editable: true,
        // editable: true,
        ifShow: true,
        sorter: true,
        resizable: true,
src/views/tigerprojects/system/lowcode/high/baseForm.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-23 17:21:29
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-29 16:25:07
 * @LastEditTime: 2024-07-31 11:19:14
-->
<template>
  <a-card
@@ -47,9 +47,9 @@
  const custImport = ref<any[]>(await import(`../entityts/${props.entityName}.ts`));
  const [{ GetBaseForm, GetBaseCards, GetUseModals }] = custImport.value['default']();
  const formSchemas = ref({
    BaseForm: GetBaseForm(),
    BaseForm: GetBaseForm(props.entityName),
  });
  const colSlots = ref<any[]>(objParams.value['colSlots']);
  const colSlots = ref<any[]>(objParams.value['colSlotsInHigh']);
  const useModals = ref<any>(GetUseModals());
  //弹出框或高级页面多表单结构
src/views/tigerprojects/system/lowcode/high/edit/editdtl.vue
@@ -6,7 +6,16 @@
      class="!mt-5"
      v-for="(item, index) in drawers"
    >
      <BasicTable @register="useTables[item.name]">
      <BasicTable
        @register="useTables[item.name]"
        :beforeEditSubmit="
          ({ record, index, key, value }) =>
            beforeEditSubmit({ record, index, key, value }, item.name)
        "
        @edit-end="
          ({ record, index, key, value }) => handleEditEnd({ record, index, key, value }, item.name)
        "
      >
        <template #toolbar>
          <a-button
            v-if="item.showTbButton"
@@ -18,6 +27,7 @@
          >
            {{ d['FUNC_NAME'] }}
          </a-button>
          <a-button v-if="item.showTbButton" @click="openImg" type="primary"> é¢„览 </a-button>
        </template>
        <template #action="{ record }">
          <TableAction :actions="createActions(record, index, item)" />
@@ -60,6 +70,9 @@
  import { getRoleButtons } from '/@/api/sys/menu';
  import { GenerateActionButton } from '../../data';
  import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
  import { useWebSocketStore } from '/@/store/modules/websocket';
  import { useTabs } from '/@/hooks/web/useTabs';
  import { createImgPreview } from '/@/components/Preview';
  const { t } = useI18n();
  const ACard = Card;
@@ -95,6 +108,8 @@
      GetUseDrawers() {},
      CustInitData(data: Ref<any[]>, keyFieldValues: Ref<{}>, type: string) {},
      GetNewRow(type: string) {},
      CreateAction(type: string, ...args) {},
      CustEditEnd({ record, index, key, value }: Recordable, type, ...args) {},
    } as EntityCustFunctionType,
  ]);
  /* åŠ¨æ€import实体名.ts的自定义方法 */
@@ -114,6 +129,7 @@
      CreateAction,
      CustFunc,
      GetNewRow,
      CustEditEnd,
    },
  ] = isNullOrUnDef(custImport.value['default'])
    ? EntityCustFunction.value
@@ -124,27 +140,40 @@
  const useTables = GetUseTables(data, emit); //高级表单中各个表格(Table)的useTable方法实现列表
  const useDrawers = GetUseDrawers(); //高级表单中各个表格(Table)的右侧边框(Drawer)的useDrawer方法实现列表
  _useTables.value = useTables; //把useTable的列表响应到从主页面注入的_useTables,这样主页面能拿到useTable的结果,从而可以使用各个表格的内置方法
  // watch(
  //   () => props.dataSource,
  //   (newVal, oldVal) => {
  //     nextTick(() => {
  //       setProps({
  //         dataSource: [],
  //       });
  //       data.value = newVal;
  //       setProps({
  //         dataSource: data,
  //       });
  //     });
  //   },
  //   { deep: true, immediate: true },
  // );
  const webSocketStore = useWebSocketStore();
  const { refreshPage } = useTabs();
  watch(
    () => webSocketStore.socketMessage,
    (newVal, oldVal) => {
      console.log(oldVal, newVal);
      /* å¦‚果监听到的值不一样,则刷新页面 */
      if (
        newVal != oldVal &&
        !isNullOrEmpty(oldVal) &&
        newVal['Data'] == 'Content' &&
        newVal['IsSuccessed']
      ) {
        // init().then(() => {
        //   refreshPage();
        // });
      }
    },
    { deep: true, immediate: true },
  );
  /**
   * @description: æŒ‚载组件完成时
   * @return {*}
   */
  onMounted(async () => {
    init();
  });
  /**
   * @description: åˆå§‹åŒ–数据
   * @return {*}
   */
  async function init() {
    for (const i in drawers.value) {
      let sqlcmd = ' 1 =1 ';
      if (!isNullOrEmpty(keyFieldValues.value[drawers.value[i].code])) {
@@ -169,7 +198,7 @@
        data.value[drawers.value[i].name] = list.Data.Items;
        // è‡ªå®šä¹‰åˆå§‹åŒ–数据
        if (CustInitData && isFunction(CustInitData)) {
          CustInitData(data, keyFieldValues, drawers.value[i].name);
          CustInitData(data, keyFieldValues, drawers.value[i].name, useTables);
        }
        useTables[drawers.value[i].name][1].setProps({
          dataSource: [],
@@ -181,7 +210,18 @@
        emit('gettables', useTables);
      }
    }
  });
  }
  const imgList = [
    'http://localhost:8800/files/Template/10位批次条码.png',
  ];
  function openImg() {
    const onImgLoad = ({ index, url, dom }) => {
      console.log(`第${index + 1}张图片已加载,URL为:${url}`, dom);
    };
    // å¯ä»¥ä½¿ç”¨createImgPreview返回的 PreviewActions æ¥æŽ§åˆ¶é¢„览逻辑,实现类似幻灯片、自动旋转之类的骚操作
    createImgPreview({ imageList: imgList, defaultWidth: 700, rememberState: true, onImgLoad });
  }
  /**
   * @description: ç”Ÿæˆåˆ—表中操作项的按钮
@@ -313,6 +353,7 @@
            FnName: item.FnName,
            data: data,
          };
          /* è‡ªå®šä¹‰æ–¹æ³• */
          CustFunc(params);
          useTables[item.name][1].setProps({
            dataSource: [],
@@ -423,4 +464,37 @@
        });
    } catch (e) {}
  }
  /**
   * @description: å•元格编辑完成后事件
   * @param {*} record
   * @param {*} index
   * @param {*} key
   * @param {*} value
   * @param {*} name
   * @return {*}
   */
  function handleEditEnd({ record, index, key, value }: Recordable, name) {
    console.log(record, index, key, value);
    data.value[name][index] = record;
    /* å•元格编辑完成后如果有自定义方法,就调用 */
    if (CustEditEnd && isFunction(CustEditEnd)) {
      CustEditEnd({ record, index, key, value }, name, useTables, data);
    }
    return false;
  }
  /**
   * @description: å•元格提交事件
   * @param {*} record
   * @param {*} index
   * @param {*} key
   * @param {*} value
   * @param {*} name
   * @return {*}
   */
  async function beforeEditSubmit({ record, index, key, value }, name) {
    console.log('单元格数据正在准备提交', { record, index, key, value });
    return true;
  }
</script>
src/views/tigerprojects/system/lowcode/high/edit/index.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-18 15:09:48
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-29 21:26:39
 * @LastEditTime: 2024-07-31 09:25:38
-->
<template>
  <PageWrapper
@@ -117,7 +117,7 @@
  const titleInfo = ref({}); //getTitle(objParams.value.Name);
  const isAllUpdate = ref(objParams.value.CODE != '0');
  const globSetting = useGlobSetting();
  const formSchemas = ref({}); //弹出框或高级页面多表单结构
  const colSlots = ref<any>(objParams.value.colSlots);
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const useFormData = ref({});
  const useTableData = ref({});
@@ -150,7 +150,7 @@
    if (!isNullOrUnDef(custImport.value)) {
      const [{ GetHomeUrl }] = custImport.value['default']();
      // æœ¬ä¾‹çš„æ•ˆæžœæ—¶ç‚¹å‡»è¿”回始终跳转到账号列表页,实际应用时可返回上一页
      go(GetHomeUrl(entityName.value));
      go(GetHomeUrl({ colSlots: colSlots.value }));
    }
  }
@@ -178,7 +178,7 @@
  const currTableName = ref('');
  const currRecordId = ref('');
  /**
   * @description: æ‰“开弹框
   * @description: è¡¨æ ¼å†…打开弹框事件
   * @param {*} d
   * @return {*}
   */
@@ -195,18 +195,21 @@
  }
  /**
   * @description:
   * @description: è¡¨æ ¼å†…打开弹框事件返回
   * @param {*} d
   * @param {*} u
   * @return {*}
   */
  function handleCustSuccess(d, u) {
    let currRecord = {};
    const _data = data.value[currTableName.value].map((x) => {
      if (x.ID == currRecordId.value) {
        x.VAR_VALUE = d.values.val;
        currRecord = x;
      }
      return x;
    });
    const [{ CustEditEnd }] = custImport.value['default']();
    data.value[currTableName.value] = [];
    useTables.value[currTableName.value][1].setProps({
      dataSource: [],
@@ -216,6 +219,10 @@
      dataSource: data.value[currTableName.value],
    });
    useTables.value[currTableName.value][1].reload();
    /* å•元格编辑完成后如果有自定义方法,就调用 */
    if(CustEditEnd && isFunction(CustEditEnd)){
      CustEditEnd({record:currRecord},currTableName.value, useTables.value, data);
    }
  }
  /**
src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -25,7 +25,7 @@
          preIcon="search|svg"
        />
        <GeneralModal
          @register="registerItemAdd"
          @register="useModalInTableForm[item]"
          @success="(d, u) => handleItemSuccess(d, u, item)"
        />
      </template>
@@ -89,8 +89,7 @@
  import { GenerateActionButton, initRoute, OpenCustModal } from '../data';
  import LogicFlow from '@logicflow/core';
  import { isFunction } from 'xe-utils';
import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
import { values } from 'lodash-es';
  import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
  const { t } = useI18n();
  const { currentRoute } = useRouter();
@@ -110,7 +109,6 @@
  const entityName = ref(objParams.value['ID']);
  const go = useGo();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerRv, { openModal: openRvModal, closeModal: RvcloseModal }] = useModal();
  const [registerCust, { openModal: openCustModal }] = useModal();
  const cType = ref('');
@@ -157,9 +155,14 @@
  const dtlSlots = ref<any[]>([]);
  const useformdata = GetUseForm && isFunction(GetUseForm) ? GetUseForm() : {};
  const useFormData = ref<any>(useformdata);
  /* è¡¨å•中插槽渲染按钮打开模态框useModal方法 */
  /* è‡ªå®šä¹‰æ¨¡æ€çª—口中表单中插槽渲染按钮打开模态框useModal方法 */
  const modals = GetUseModals && isFunction(GetUseModals) ? GetUseModals() : { useModalData: {} };
  const useModalData = ref(modals['useModalData']);
  /* è¡¨æ ¼å†…的插槽渲染的弹出选择框列表 */
  const useModalInTableForm = ref<any>({});
  colSlots.value.map((x) => {
    useModalInTableForm.value[x] = useModal();
  });
  /* èŽ·å–è‡ªå®šä¹‰æ•°æ® */
  const custData = GetCustData && isFunction(GetCustData) ? GetCustData() : { isCustEl: {} };
  const isCustEl = ref(custData['isCustEl']);
@@ -298,7 +301,7 @@
      });
    } else {
      const [{ CreateAction }] = custImport.value['default']();
      const result = CreateAction(fnName);
      const result = CreateAction(entityName.value, colSlots.value);
      switch (result.action) {
        case 'go':
          // å°†å¯¹è±¡è½¬æ¢ä¸ºJSON字符串并保存到sessionStorage
@@ -330,7 +333,7 @@
   * @return {*}
   */
  function handleSuccess(d, u) {
    if(CustFunc && isFunction(CustFunc)){
    if (CustFunc && isFunction(CustFunc)) {
      CustFunc({
        values: d,
      });
@@ -353,7 +356,7 @@
      )
        .then((m) => {
          const [{ GetSelectSuccess: GetSelectSuccess2 }] = m.default();
          getForm().setFieldsValue(GetSelectSuccess2(d, u));
          getForm().setFieldsValue(GetSelectSuccess2(d, u, objParams.value['ID']));
        })
        .catch(() => {
          getForm().setFieldsValue({
@@ -376,10 +379,10 @@
      )
        .then((m) => {
          const [{ OpenSelectItem }] = m.default();
          OpenSelectItem(openItemModal);
          OpenSelectItem(useModalInTableForm.value[item][1].openModal);
        })
        .catch(() => {
          openItemModal(true, {
          useModalInTableForm.value[item][1].openModal(true, {
            title: '物料列表',
            schemas: [
              {
@@ -419,7 +422,7 @@
   * @description: å¼¹å‡ºæ¡†ç¡®å®šè¿”回
   * @param {*} d
   * @return {*}
   */
   */
  function custSuccess(d) {
    reload();
  }
@@ -428,8 +431,10 @@
   * @description: å¼¹å‡ºæ¡†å–消返回
   * @param {*} reload
   * @return {*}
   */
  function custCancel() {reload();}
   */
  function custCancel() {
    reload();
  }
  /**
   * @description: å„表单内弹出选择框选择成功后方法
@@ -445,11 +450,11 @@
      selectVals.value = values; //保存弹出框选择的结果
      let _val = {};
      d.returnFieldName.map((x) => {
          _val[x] = values[x];
        });
        _val[x] = values[x];
      });
      useFormData.value[item][1].setFieldsValue(_val);
      /* é’ˆå¯¹å·¥å•的方法 */
      if (d.returnFieldName.filter((x) => x == 'ROUTE_CODE') && item == 'prodinfo' ) {
      if (d.returnFieldName.filter((x) => x == 'ROUTE_CODE') && item == 'prodinfo') {
        routeData.value = {
          nodes: [],
          edges: [],
src/views/tigerprojects/system/lowcode/normalDrawer.vue
@@ -68,6 +68,7 @@
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { isFunction } from 'xe-utils';
  import { useUserStore } from '/@/store/modules/user';
  const emit = defineEmits(['success', 'register']);
  const { t } = useI18n();
@@ -128,6 +129,7 @@
      setDrawerProps({ confirmLoading: true });
      // TODO custom api
      if (!unref(ifSave)) {
        values.AUTH_ORG = useUserStore().getUserInfo.orgCode;
        //保存
        SaveEntity(
          values,
src/views/tigerprojects/system/lowcode/setting/pageDetail.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-05-30 22:00:44
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-23 15:17:45
 * @LastEditTime: 2024-07-30 11:00:14
-->
<!-- eslint-disable prettier/prettier -->
<template>
@@ -668,7 +668,7 @@
            _json['label'] = '1';
            _json['defaultValue'] = values[`PSelect${firstField}`];
            _json['component'] = 'Input';
            _json['colProps'] = { span: 4 };
            _json['colProps'] = { span: 1 };
            _json['ifShow'] = true;
            _json['colSlot'] = `${firstField}add`;
          }
src/views/tigerprojects/tsk/tsk_job/index.vue
@@ -10,24 +10,28 @@
            {
              icon: 'clarity:info-standard-line',
              tooltip: '查看任务详情',
              onClick: handleView.bind(null, record),
              onClick: __VLS_ctx.handleView.bind(null, record),
              name: undefined
            },
            {
              //立即开始
              tooltip: '立即开始',
              icon: 'start|svg',
              onClick: handleStart.bind(null, record),
              onClick: __VLS_ctx.handleStart.bind(null, record),
              name: undefined
            },
            {
              //停止运行
              tooltip: '停止运行',
              icon: 'stop|svg',
              onClick: handleStop.bind(null, record),
              onClick: __VLS_ctx.handleStop.bind(null, record),
              name: undefined
            },
            {
              tooltip: '编辑',
              icon: 'clarity:note-edit-line',
              onClick: handleEdit.bind(null, record),
              onClick: __VLS_ctx.handleEdit.bind(null, record),
              name: undefined
            },
            {
              tooltip: '删除',
@@ -36,8 +40,9 @@
              popConfirm: {
                title: '是否确认删除?',
                placement: 'left',
                confirm: handleDelete.bind(null, record),
                confirm: __VLS_ctx.handleDelete.bind(null, record),
              },
              name: undefined
            },
          ]"
        />