Ben Lin
2024-07-25 cdd0a28197fb9b432a45bbf9ebc0cfd8db939125
src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts
@@ -4,10 +4,12 @@
 * @version:
 * @Date: 2024-06-19 20:34:27
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-03 08:52:24
 * @LastEditTime: 2024-07-24 23:02:47
 */
import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
import { ActionItem, BasicColumn } from '/@/components/Table';
import { useWebSocketStore } from '/@/store/modules/websocket';
function _default() {
  const ActionColumn: BasicColumn = {
@@ -37,16 +39,30 @@
     * @return {*}
     */
    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
      return [
        ...data,
        ...[
          {
            icon: 'clarity:info-standard-line',
            tooltip: '模板变量',
            onClick: goDetail.bind(null, args[5], params),
          },
        ],
      ];
      data.map((x) => {
        if (x.name == 'goDetail') {
          x.onClick = goDetail.bind(null, args[5], params);
          x.tooltip = '模板变量';
        }
      });
      return data;
    },
    GetUseForm: () => {
      return {};
    },
    /**
     * @description: 自定义方法
     * @param {string} type
     * @param {array} args
     * @return {*}
     */
    CustFunc: (param: CustModalParams) => {
      const webSocketStore = useWebSocketStore();
      if (webSocketStore.GetSocketState == 1) {
        webSocketStore.sendMessage(
          `wsSubStrings ${param.values['ID']}_#_${param.values['TEMP_PATH']}`
        );
      }
    },
  };
@@ -71,8 +87,12 @@
      detailName: `模板[${params['record'].LABEL_NAME}]`,
      keyFieldValues: { LABEL_ID: params['record'].ID },
      colSlots: ['BAS_LABEL_PV1add'],
      SessionName: 'BAS_LABEL_VAR_update',
    };
    go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`);
    // 将对象转换为JSON字符串并保存到sessionStorage
    sessionStorage.removeItem(`${id.SessionName}_params`);
    sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id)));
    go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`);
  }
  return [methods, ActionColumn];