wzp
2025-05-09 ef6a2fb3b547190f35b3baf99280eaead42b4f57
ruoyi-ui/src/views/system/callbacklog/index.vue
@@ -48,8 +48,8 @@
    </el-form>
    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button
      <el-col :span="1.5">
        <!-- <el-button
          type="primary"
          plain
          icon="el-icon-plus"
@@ -78,8 +78,9 @@
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:callbacklog:remove']"
        >删除</el-button>
      </el-col> -->
        >删除</el-button> -->
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
@@ -89,6 +90,16 @@
          @click="handleExport"
          v-hasPermi="['system:callbacklog:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-s-promotion"
          size="mini"
          :disabled="multiple"
          @click="handleBatchRetry"
        >批量重试</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
@@ -116,24 +127,17 @@
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:callbacklog:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:callbacklog:remove']"
          >删除</el-button>
            icon="el-icon-s-promotion"
            @click="handleRetry(scope.row)"
            v-hasPermi="['system:callbacklog:retry']"
          >重试回调</el-button>
        </template>
      </el-table-column> -->
      </el-table-column>
    </el-table>
    
    <pagination
@@ -181,7 +185,7 @@
</template>
<script>
import { listCallbacklog, getCallbacklog, delCallbacklog, addCallbacklog, updateCallbacklog } from "@/api/system/callbacklog";
import { listCallbacklog, getCallbacklog, delCallbacklog, addCallbacklog, updateCallbacklog, retryCallbacklog } from "@/api/system/callbacklog";
export default {
  name: "Callbacklog",
@@ -328,6 +332,40 @@
      this.download('system/callbacklog/export', {
        ...this.queryParams
      }, `callbacklog_${new Date().getTime()}.xlsx`)
    },
    /** 触发单个回调重试 */
    handleRetry(row) {
      const id = row.id;
      this.$modal.confirm('是否确认重试该回调记录?').then(function() {
        // 创建带有超时设置的请求配置
        const config = {
          timeout: 60000  // 设置60秒超时
        };
        return retryCallbacklog(id, config);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("触发重试成功");
      }).catch((error) => {
        // 添加错误处理
        if (error.message.includes('timeout')) {
          this.$modal.msgError("请求超时,请稍后重试");
        } else {
          this.$modal.msgError("重试失败:" + error.message);
        }
      });
    },
    /** 批量触发回调重试 */
    handleBatchRetry() {
      if (this.ids.length === 0) {
        this.$modal.msgError("请选择需要重试的记录");
        return;
      }
      this.$modal.confirm('是否确认重试选中的' + this.ids.length + '条回调记录?').then(() => {
        return retryCallbacklog(this.ids.join(','));
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("批量重试成功");
      }).catch(() => {});
    }
  }
};