// /**分页查询接口重试日志 */
import request from '@/utils/request';

import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE } from '@/config/serviceSettings.js';

const serviceName = UPCLOUD_RDC_TMS_MAINDATA_SERVICE;

// //分页查询接口重试日志 GET
export const mainTableInfoUrl = serviceName + '/messageSendLog/page';




export const retry = (context, data) => {
  let confirmLoading = false;

  return new Promise((resolve) => {
    context.$confirm({
      title: '是否重试消息!',
      confirmLoading,
      onOk(clear) {
        confirmLoading = true;
        context.mx_confirmLoading = true;
        return request({
          url: serviceName + '/messageSendLog/retry',
          method: 'post',
          data
        })
          .then((response) => {
            if (response.success) {
              clear();
              context.$refs.mainTable.reload();
              context.$message.success(response.message)

            } else {
              context.$exception(response);
            }
            return resolve(response);
          })
          .finally((error) => {
            context.mx_confirmLoading = false;
            confirmLoading = false;
          });
      },
    });
  });
};



