function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import getTablePostData from "../../../utils/getTablePostData";
var mapping = {
  deployMethod: {
    value: 'deployMethod'
  },
  deployObject: {
    value: 'deployObject'
  }
};
export { mapping };
export default (function (intlPrefix, formatMessage, projectId, envOptions, deployTypeDs, deployResultDs, pipelineOptions, deployModeDs) {
  return {
    autoQuery: true,
    selection: false,
    transport: {
      read: function read(_ref) {
        var data = _ref.data;
        var postData = {
          param: [],
          searchParam: _objectSpread(_objectSpread({}, data), {}, {
            env: data.env ? String(data.env) : null
          })
        };
        return {
          url: "/devops/v1/projects/".concat(projectId, "/deploy_record/paging"),
          method: 'get'
        };
      }
    },
    fields: [{
      name: 'deployId',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".number")
      })
    }, {
      name: mapping.deployMethod.value,
      type: 'string',
      label: '部署方式&载体'
    }, {
      name: mapping.deployObject.value,
      type: 'string',
      label: '部署对象'
    }, {
      name: 'deployType',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".type")
      })
    }, {
      name: 'envName',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".env")
      })
    }, {
      name: 'deployTime',
      type: 'dateTime',
      label: formatMessage({
        id: "".concat(intlPrefix, ".time")
      })
    }, {
      name: 'deployResult',
      type: 'string',
      label: '执行结果'
    }, {
      name: 'pipelineTriggerType',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".pipeline.type")
      })
    }, {
      name: 'deployCreatedBy',
      type: 'string'
    }, {
      name: 'pipelineName',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".pipeline.name")
      })
    }, {
      name: 'executeUser',
      label: '执行'
    }, {
      name: 'instanceName',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".instance")
      })
    }, {
      name: 'appServiceName',
      type: 'string',
      label: formatMessage({
        id: 'appService'
      })
    }, {
      name: 'userImage',
      type: 'string'
    }, {
      name: 'realName',
      type: 'string'
    }, {
      name: 'deploySourceVO',
      label: formatMessage({
        id: "".concat(intlPrefix, ".source.deploy")
      })
    }],
    queryFields: [{
      name: 'deploy_type',
      type: 'string',
      textField: 'text',
      valueField: 'value',
      label: formatMessage({
        id: "".concat(intlPrefix, ".type")
      }),
      options: deployTypeDs
    }, {
      name: 'deploy_mode',
      type: 'string',
      textField: 'text',
      valueField: 'value',
      label: '部署方式',
      options: deployModeDs
    }, {
      name: 'deploy_payload_name',
      type: 'string',
      label: '部署载体名称'
    }, {
      name: 'deploy_result',
      type: 'string',
      textField: 'text',
      valueField: 'value',
      label: '执行结果',
      options: deployResultDs
    }, {
      name: 'deploy_object_name',
      type: 'string',
      label: '部署对象名称'
    }, {
      name: 'deploy_object_version',
      type: 'string',
      label: '部署版本'
    }]
  };
});