import ReportsApis from "../../apis";
export default (function (_ref) {
  var projectId = _ref.projectId,
      formatMessage = _ref.formatMessage,
      intlPrefix = _ref.intlPrefix;
  return {
    selection: false,
    autoQuery: false,
    paging: true,
    transport: {
      read: function read(_ref2) {
        var data = _ref2.data;

        var _ref3 = data || {},
            pipelineIds = _ref3.pipelineIds,
            startTime = _ref3.startTime,
            endTime = _ref3.endTime;

        return {
          url: ReportsApis.getPipelineDurationTable(projectId, startTime, endTime),
          method: 'post',
          data: pipelineIds || []
        };
      }
    },
    fields: [{
      name: 'status',
      label: formatMessage({
        id: 'status'
      })
    }, {
      name: 'viewId',
      label: formatMessage({
        id: "".concat(intlPrefix, ".number")
      })
    }, {
      name: 'pipelineName',
      label: formatMessage({
        id: "".concat(intlPrefix, ".name")
      })
    }, {
      name: 'stageRecordVOS',
      label: formatMessage({
        id: "".concat(intlPrefix, ".stage")
      })
    }, {
      name: 'appServiceName',
      label: formatMessage({
        id: "".concat(intlPrefix, ".appService")
      })
    }, {
      name: 'createdDate',
      label: formatMessage({
        id: "".concat(intlPrefix, ".startTime")
      })
    }, {
      name: 'durationSeconds',
      label: formatMessage({
        id: "".concat(intlPrefix, ".execute")
      })
    }, {
      name: 'iamUserDTO',
      label: formatMessage({
        id: "".concat(intlPrefix, ".trigger")
      })
    }]
  };
});