Browse Source

mq日志和重试

syhx
ljlong_2630 2 months ago
parent
commit
87636d39b7
  1. 1
      src/api/infra/apiErrorLog/index.ts
  2. 15
      src/api/infra/apiMqError/index.ts
  3. 12
      src/utils/disposition/defaultButtons.ts
  4. 33
      src/views/infra/apiMqError/apiMqError.data.ts
  5. 18
      src/views/infra/apiMqError/index.vue
  6. 15
      src/views/infra/apiMqHis/apiMqHis.data.ts

1
src/api/infra/apiErrorLog/index.ts

@ -46,3 +46,4 @@ export const exportApiErrorLog = (params) => {
params
})
}

15
src/api/infra/apiMqError/index.ts

@ -53,3 +53,18 @@ export const exportApiMqError = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/infra/api-mq-error/get-import-template' })
}
export const retryTable = (id: number) => {
return request.get({
url: '/wms/apimqerror/retryTable?id=' + id
})
}
export const retryInterface = (id: number) => {
return request.get({
url: '/wms/apimqerror/retryInterface?id=' + id
})
}

12
src/utils/disposition/defaultButtons.ts

@ -1404,6 +1404,18 @@ export function outBtn(option: any) {
hasPermi: ''
})
}
// 主列表-重试
export function retryBtn(option: any) {
return __defaultBtnOption(option, {
label: '重试',
name: 'retry',
hide: false,
type: 'danger',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则
function __defaultBtnOption(option: any, specific: any) {
return {

33
src/views/infra/apiMqError/apiMqError.data.ts

@ -11,7 +11,7 @@ export const ApiMqErrorRules = reactive({
export const ApiMqError = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
label: '业务编号',
field: 'number',
sort: 'custom',
isSearch: true
@ -48,6 +48,19 @@ export const ApiMqError = useCrudSchemas(reactive<CrudSchema[]>([
value: 0
}
},
{
label: '错误信息',
field: 'errorMsg',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
// {
// label: '是否可用',
// field: 'available',
@ -108,13 +121,13 @@ export const ApiMqError = useCrudSchemas(reactive<CrudSchema[]>([
// value: 0
// }
// },
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

18
src/views/infra/apiMqError/index.vue

@ -135,6 +135,7 @@ const buttonBaseClick = (val, item) => {
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:apiMqError:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:apiMqError:delete'}), //
defaultButtons.retryBtn(null), //
]
// -
@ -143,6 +144,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'retry') { //
handleRetry(row)
}
}
@ -235,6 +238,21 @@ const searchFormClick = (searchData) => {
getList() //
}
const handleRetry = (row) => {
if(row.type == "interface:method"){
ApiMqErrorApi.retryInterface(row.id).then(res => {
message.success(t('common.retrySuccess'))
getList()
})
}else if(row.type == "table"){
ApiMqErrorApi.retryTable(row.id).then(res => {
message.success(t('common.retrySuccess'))
getList()
})
}
}
/** 初始化 **/
onMounted(async () => {
getList()

15
src/views/infra/apiMqHis/apiMqHis.data.ts

@ -16,7 +16,7 @@ export const ApiMqHis = useCrudSchemas(reactive<CrudSchema[]>([
// isForm: false
// },
{
label: '编号',
label: '业务编号',
field: 'number',
sort: 'custom',
isSearch: true
@ -40,6 +40,19 @@ export const ApiMqHis = useCrudSchemas(reactive<CrudSchema[]>([
value: 0
}
},
{
label: '执行数据',
field: 'content',
sort: 'custom',
isSearch: true,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
},
value: 0
}
},
// {
// label: '是否可用',
// field: 'available',

Loading…
Cancel
Save