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 params
}) })
} }

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

@ -53,3 +53,18 @@ export const exportApiMqError = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/infra/api-mq-error/get-import-template' }) 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: '' 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) { function __defaultBtnOption(option: any, specific: any) {
return { return {

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

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

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

@ -135,6 +135,7 @@ const buttonBaseClick = (val, item) => {
const butttondata = [ const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:apiMqError:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'wms:apiMqError:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:apiMqError:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:apiMqError:delete'}), //
defaultButtons.retryBtn(null), //
] ]
// - // -
@ -143,6 +144,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'retry') { //
handleRetry(row)
} }
} }
@ -235,6 +238,21 @@ const searchFormClick = (searchData) => {
getList() // 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 () => { onMounted(async () => {
getList() getList()

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

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

Loading…
Cancel
Save