2023-01-14 21:02:18 +08:00
|
|
|
<template>
|
|
|
|
<a-card :bordered="false">
|
|
|
|
<div class="table-page-search-wrapper">
|
2023-05-07 11:44:57 +08:00
|
|
|
<a-form layout="inline" v-if="showSearch">
|
2023-01-14 21:02:18 +08:00
|
|
|
<a-row :gutter="48">
|
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
<a-form-item label="组名称">
|
2023-01-14 20:00:14 +08:00
|
|
|
<a-select v-model="queryParam.groupName" placeholder="请输入组名称" @change="value => handleChange(value)" allowClear>
|
2023-01-14 21:02:18 +08:00
|
|
|
<a-select-option v-for="item in groupNameList" :value="item" :key="item">{{ item }}</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
<a-form-item label="场景名称">
|
2023-01-14 20:00:14 +08:00
|
|
|
<a-select v-model="queryParam.sceneName" placeholder="请选择场景名称" allowClear>
|
2023-01-14 21:02:18 +08:00
|
|
|
<a-select-option v-for="item in sceneList" :value="item.sceneName" :key="item.sceneName"> {{ item.sceneName }}</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<template v-if="advanced">
|
|
|
|
<a-col :md="8" :sm="24">
|
2023-01-14 19:57:27 +08:00
|
|
|
<a-form-item label="业务编号">
|
2023-01-14 20:00:14 +08:00
|
|
|
<a-input v-model="queryParam.bizNo" placeholder="请输入业务编号" allowClear/>
|
2023-01-14 21:02:18 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
<a-form-item label="业务id">
|
2023-05-04 18:46:34 +08:00
|
|
|
<a-input v-model="queryParam.idempotentId" placeholder="请输入业务id" allowClear/>
|
2023-01-14 21:02:18 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
</template>
|
|
|
|
<a-col :md="!advanced && 8 || 24" :sm="24">
|
|
|
|
<span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
|
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
|
|
|
<a @click="toggleAdvanced" style="margin-left: 8px">
|
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
2023-05-07 11:44:57 +08:00
|
|
|
</div >
|
2023-01-14 21:02:18 +08:00
|
|
|
|
|
|
|
<s-table
|
|
|
|
ref="table"
|
|
|
|
size="default"
|
|
|
|
rowKey="key"
|
|
|
|
:columns="columns"
|
|
|
|
:data="loadData"
|
|
|
|
:alert="options.alert"
|
|
|
|
:rowSelection="options.rowSelection"
|
2023-04-29 18:42:54 +08:00
|
|
|
:scroll="{ x: 2000 }"
|
2023-01-14 21:02:18 +08:00
|
|
|
>
|
|
|
|
<span slot="serial" slot-scope="text, record, index">
|
|
|
|
{{ index + 1 }}
|
|
|
|
</span>
|
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
|
<template>
|
|
|
|
<a @click="handleInfo(record)">详情</a>
|
|
|
|
</template>
|
|
|
|
</span>
|
|
|
|
</s-table>
|
|
|
|
</a-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import ATextarea from 'ant-design-vue/es/input/TextArea'
|
|
|
|
import AInput from 'ant-design-vue/es/input/Input'
|
|
|
|
import { getAllGroupNameList, getRetryTaskLogPage, getSceneList } from '@/api/manage'
|
|
|
|
|
|
|
|
import { STable } from '@/components'
|
|
|
|
import moment from 'moment'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'RetryTaskLog',
|
|
|
|
components: {
|
|
|
|
AInput,
|
|
|
|
ATextarea,
|
|
|
|
STable
|
|
|
|
},
|
2023-05-07 11:44:57 +08:00
|
|
|
props: {
|
|
|
|
showSearch: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
}
|
|
|
|
// groupName: {
|
|
|
|
// type: String,
|
|
|
|
// default: ''
|
|
|
|
// },
|
|
|
|
// uniqueId: {
|
|
|
|
// type: String,
|
|
|
|
// default: ''
|
|
|
|
// }
|
|
|
|
},
|
2023-01-14 21:02:18 +08:00
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
record: '',
|
|
|
|
mdl: {},
|
|
|
|
// 高级搜索 展开/关闭
|
|
|
|
advanced: false,
|
|
|
|
// 查询参数
|
|
|
|
queryParam: {},
|
|
|
|
retryStatus: {
|
|
|
|
'0': '重试中',
|
|
|
|
'1': '重试完成',
|
|
|
|
'2': '最大次数'
|
|
|
|
},
|
|
|
|
// 表头
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
title: '#',
|
2023-04-29 18:42:54 +08:00
|
|
|
scopedSlots: { customRender: 'serial' },
|
2023-05-07 11:44:57 +08:00
|
|
|
width: '5%'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'uniqueId',
|
|
|
|
dataIndex: 'uniqueId',
|
|
|
|
width: '5%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '组名称',
|
|
|
|
dataIndex: 'groupName',
|
2023-05-07 11:44:57 +08:00
|
|
|
ellipsis: true,
|
|
|
|
width: '10%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '场景id',
|
|
|
|
dataIndex: 'sceneName',
|
2023-05-07 11:44:57 +08:00
|
|
|
ellipsis: true,
|
|
|
|
width: '10%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
2023-05-04 18:46:34 +08:00
|
|
|
title: '幂等id',
|
2023-05-07 11:44:57 +08:00
|
|
|
dataIndex: 'idempotentId',
|
|
|
|
width: '10%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '业务编号',
|
|
|
|
dataIndex: 'bizNo',
|
2023-05-07 11:44:57 +08:00
|
|
|
ellipsis: true,
|
|
|
|
width: '10%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '重试状态',
|
|
|
|
dataIndex: 'retryStatus',
|
2023-05-07 11:44:57 +08:00
|
|
|
customRender: (text) => this.retryStatus[text],
|
|
|
|
width: '5%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '失败原因',
|
2023-05-07 11:44:57 +08:00
|
|
|
dataIndex: 'errorMessage',
|
|
|
|
width: '25%'
|
2023-01-14 21:02:18 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '触发时间',
|
|
|
|
dataIndex: 'createDt',
|
|
|
|
sorter: true,
|
|
|
|
customRender: (text) => moment(text).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
ellipsis: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '操作',
|
|
|
|
dataIndex: 'action',
|
2023-04-29 18:42:54 +08:00
|
|
|
fixed: 'right',
|
2023-01-14 21:02:18 +08:00
|
|
|
width: '150px',
|
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
|
}
|
|
|
|
],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
|
loadData: parameter => {
|
2023-05-07 11:44:57 +08:00
|
|
|
if (this.groupName !== '' && this.uniqueId !== '') {
|
|
|
|
parameter['groupName'] = this.groupName
|
|
|
|
parameter['uniqueId'] = this.uniqueId
|
|
|
|
}
|
|
|
|
console.log('this.uniqueId', this.uniqueId)
|
2023-01-14 21:02:18 +08:00
|
|
|
console.log('loadData.parameter', parameter)
|
|
|
|
return getRetryTaskLogPage(Object.assign(parameter, this.queryParam))
|
|
|
|
.then(res => {
|
|
|
|
return res
|
|
|
|
})
|
|
|
|
},
|
|
|
|
selectedRowKeys: [],
|
|
|
|
selectedRows: [],
|
|
|
|
|
|
|
|
// custom table alert & rowSelection
|
|
|
|
options: {
|
|
|
|
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
|
rowSelection: {
|
|
|
|
selectedRowKeys: this.selectedRowKeys,
|
|
|
|
onChange: this.onSelectChange
|
|
|
|
}
|
|
|
|
},
|
|
|
|
optionAlertShow: false,
|
|
|
|
groupNameList: [],
|
2023-05-07 11:44:57 +08:00
|
|
|
sceneList: [],
|
|
|
|
groupName: '',
|
|
|
|
uniqueId: ''
|
2023-01-14 21:02:18 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
getAllGroupNameList().then(res => {
|
|
|
|
this.groupNameList = res.data
|
|
|
|
})
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleNew () {
|
|
|
|
this.$router.push('/form/basic-config')
|
|
|
|
},
|
2023-05-07 11:44:57 +08:00
|
|
|
refreshTable (v) {
|
|
|
|
this.groupName = v.groupName
|
|
|
|
this.uniqueId = v.uniqueId
|
|
|
|
this.$refs.table.refresh(true)
|
|
|
|
},
|
2023-01-14 21:02:18 +08:00
|
|
|
handleChange (value) {
|
|
|
|
getSceneList({ 'groupName': value }).then(res => {
|
|
|
|
this.sceneList = res.data
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toggleAdvanced () {
|
|
|
|
this.advanced = !this.advanced
|
|
|
|
},
|
|
|
|
handleInfo (record) {
|
|
|
|
this.$router.push({ path: '/retry-log/info', query: { id: record.id } })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|