export default {
  beforeExecute: (formData) => {
    console.log('进入beforeExecute方法中', formData);
    formData.id=33
    return true;
  },
  callbackFunction: (data, customData, formKey) => {
    console.info('进入callbackFunction方法中', data, customData, formKey);
    const datas = [data];
    return datas;
  },
  mount: ($this) => {
    console.info("进入mount方法中",$this);
  },
  rowDoubleClick: (row, column) => {
  },
  onContextMenu: (row, column) => {
    const operateColumnTpl = [];
    operateColumnTpl.push({
      type: 'Button',
      props: {
        type: 'component',
        action: 'custom',
        className: 'primary rightButton',
        value: '测试',
        // icon: buttonItem.icon || 'plus',
        dialogProps: {
          title: '测试',
          eqform: true,
          // url: item.url,
          type: 'tpl',
          href: '/form',
          loadMode: 'component',
          prefix: 'queryParam',
          // customData: buttonItem.customData || {},
          // formKey: buttonItem.formKey,
          width: 550,
          height: 275,
          actionType: 'update',
        },
      },
    },
    {
      type: 'Button',
      props: {
        type: 'component',
        action: 'custom',
        className: 'primary rightButton',
        value: '测试1',
        // icon: buttonItem.icon || 'plus',
        dialogProps: {
          title: '测试1',
          eqform: true,
          // url: item.url,
          type: 'tpl',
          href: '/form',
          loadMode: 'component',
          prefix: 'queryParam',
          // customData: buttonItem.customData || {},
          // formKey: buttonItem.formKey,
          width: 550,
          height: 275,
          actionType: 'update',
        },
      },
    },
    {
      type: 'Button',
      props: {
        type: 'ajax',
        action: 'delete',
        className: 'rightButton',
        condition: '',
        value: '删除',
        felation: 'table',
        isRefreshTable: true,
        isDownloadBtn: false,
        icon: 'minus-circle',
        confirm: '是否确定删除本条数据？',
        isLinkTableData: true,
        // isLinkTableDataKey:'delete',
        ajaxProps: {
          code: '',
          // data:{aaa:"1"},
          // otherData:[{"type":"datasource","name":"actionType","value":"actionType","defaultInputType":"datasource","defaultValue":""}],
          prefix: 'test',
          url: 'test.action',
          host: '/base',
        },
      },
    },
    );
    console.log(operateColumnTpl, 'operateColumnTpl');
    return operateColumnTpl;
  },
  formatDate: (cellValue, row, index, formatKey, h, ...args) => {
    // console.info("formatDate::::",args)

  },
  // 复制功能
  copyIconFun: (cellValue, row, index) => {
    console.info('onCellIcon::::', cellValue);
  },
  formatFunction: (cellValue, row, index, formatKey, h, arg) => {

  },
  formatDealId: (cellValue, row, index, formatKey, h, arg) => {
    const operateColumnTpl = [{
      type: 'sdpButton',
      props: {
        type: 'component',
        xtype: 'text',
        action: 'custom',
        className: 'primary rightButton',
        value: cellValue,
        dialogProps: {
          title: '交易流水号',
          eqform: true,
          type: 'tpl',
          href: '/dcs/cashFlowManager/detail',
          loadMode: 'component',
          prefix: 'queryParam',
          customData: row || {},
          // formKey: '333',
          width: 640,
          height: 610,
          actionType: 'update',
        },
      },
    }];
    return h('sdp-dynamic', {
      props: { json: operateColumnTpl, '@data': row || {}},
      key: '23444',
    });
    // return <span style={{ cursor: 'pointer', color: '#017BFF' }} onClick={handleClick}>{cellValue}</span>
  },
  formatToHtml: (cellValue, row, index, formatKey, h, arg) => {
    return h('div', { domProps: { innerHTML: cellValue }});
  },
  formatToDetail: (cellValue, row, index, formatKey, h, arg) => {
    const handleClick=()=>{
      Eui.service.router.push({
        path:'/7026/pos/forexSpotSingleCurrencyPosition/detail',
        query:{
          extraParams:JSON.stringify(row)
        }
      })
    }
    return <i class="el-icon-document" style={{ cursor: 'pointer', color: '#017BFF' }}  onClick={handleClick}></i> 
  },
  // 外汇持仓 明细账户
  formatForAccount:(cellValue, row, index, formatKey, h, arg)=>{
    const operateColumnTpl = [{
      type: 'sdpButton',
      props: {
        type: 'component',
        xtype: 'text',
        action: 'custom',
        className: 'primary no-padding-btn',
        value: cellValue.replace(/<[^>]+>/g, ''),
        dialogProps: {
          title: '账户详情',
          eqform: true,
          type: 'tpl',
          href: '/pos/forexSpotSingleCurrencyPosition/detailDialog',
          loadMode: 'component',
          prefix: 'queryParam',
          customData: row || {},
          width: 640,
          height: 480,
          actionType: 'update',
        },
      },
    }];
    return h('sdp-dynamic', {
      props: { json: operateColumnTpl, '@data': row || {}},
    });
  },
  // 外汇持仓 原始流水号
  formatForBizukidtop:(cellValue, row, index, formatKey, h, arg)=>{
    const operateColumnTpl = [{
      type: 'sdpButton',
      props: {
        type: 'component',
        xtype: 'text',
        action: 'custom',
        className: 'primary no-padding-btn',
        value: cellValue.replace(/<[^>]+>/g, ''),
        dialogProps: {
          title: row.Product,
          eqform: true,
          type: 'tpl',
          href: '/pos/forexSpotSingleCurrencyPosition/originDialog',
          loadMode: 'component',
          prefix: 'queryParam',
          customData: row || {},
          width: 640,
          height: 610,
          actionType: 'update',
        },
      },
    }];
    return h('sdp-dynamic', {
      props: { json: operateColumnTpl, '@data': row || {}},
    });
  },
  // 外汇持仓 外汇即期货币对头寸 历史头寸
  historyNative:()=>{
    Eui.service.router.push({
      path:'/7027/pos/historyPos',
      query:{
        scriptId:'FxSpotPairPosition'
      }
    })
  }
};

