diff --git a/src/api/infra/outerApiHis/index.ts b/src/api/infra/outerApiHis/index.ts new file mode 100644 index 000000000..b786bdcd7 --- /dev/null +++ b/src/api/infra/outerApiHis/index.ts @@ -0,0 +1,58 @@ +import request from '@/config/axios' + +export interface OuterApiHisVO { + id: number + number: string + type: string + times: number + content: string + result: string +} + +// 查询第三方接口调用记录列表 +export const getOuterApiHisPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/infra/outer-api-his/senior', data }) + } else { + return await request.get({ url: `/infra/outer-api-his/page`, params }) + } +} + +// 查询第三方接口调用记录详情 +export const getOuterApiHis = async (id: number) => { + return await request.get({ url: `/infra/outer-api-his/get?id=` + id }) +} + +// 新增第三方接口调用记录 +export const createOuterApiHis = async (data: OuterApiHisVO) => { + return await request.post({ url: `/infra/outer-api-his/create`, data }) +} + +// 修改第三方接口调用记录 +export const updateOuterApiHis = async (data: OuterApiHisVO) => { + return await request.put({ url: `/infra/outer-api-his/update`, data }) +} + +// 删除第三方接口调用记录 +export const deleteOuterApiHis = async (id: number) => { + return await request.delete({ url: `/infra/outer-api-his/delete?id=` + id }) +} + +// 导出第三方接口调用记录 Excel +export const exportOuterApiHis = async (params) => { + return await request.download({ url: `/infra/outer-api-his/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/infra/outer-api-his/get-import-template' }) +} + +//重试 +export const retry = (id: number) => { + return request.get({ + url: '/wms/outer/retry?id=' + id + }) +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 59e2c45b9..1db5931f7 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -127,6 +127,7 @@ export enum DICT_TYPE { INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type', INFRA_CODEGEN_SCENE = 'infra_codegen_scene', INFRA_FILE_STORAGE = 'infra_file_storage', + INFRA_OUTER_API_TYPE = 'outer_api_type', // ========== BPM 模块 ========== BPM_MODEL_CATEGORY = 'bpm_model_category', diff --git a/src/views/infra/apiMqHis/apiMqHis.data.ts b/src/views/infra/apiMqHis/apiMqHis.data.ts index 0e42019b5..52fcd7c3d 100644 --- a/src/views/infra/apiMqHis/apiMqHis.data.ts +++ b/src/views/infra/apiMqHis/apiMqHis.data.ts @@ -26,9 +26,9 @@ export const ApiMqHis = useCrudSchemas(reactive([ field: 'type', sort: 'custom', isSearch: true, - form: { - component: 'SelectV2' - } + form: { + component: 'SelectV2' + } }, { label: '执行次数', diff --git a/src/views/infra/outerApiHis/index.vue b/src/views/infra/outerApiHis/index.vue new file mode 100644 index 000000000..2751182d7 --- /dev/null +++ b/src/views/infra/outerApiHis/index.vue @@ -0,0 +1,254 @@ + + + diff --git a/src/views/infra/outerApiHis/outerApiHis.data.ts b/src/views/infra/outerApiHis/outerApiHis.data.ts new file mode 100644 index 000000000..c9867f7d8 --- /dev/null +++ b/src/views/infra/outerApiHis/outerApiHis.data.ts @@ -0,0 +1,82 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const OuterApiHisRules = reactive({ + type: [required], + times: [required], +}) + +export const OuterApiHis = useCrudSchemas(reactive([ + { + label: 'ID', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '编号', + field: 'number', + sort: 'custom', + isSearch: true, + }, + { + label: '类型', + field: 'type', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.INFRA_OUTER_API_TYPE, + dictClass: 'string', + form: { + component: 'SelectV2' + }, + }, + { + label: '执行次数', + field: 'times', + sort: 'custom', + form: { + component: 'InputNumber', + value: 1 + }, + search: { + component: 'InputNumber', + value: 1 + } + }, + { + label: '内容', + field: 'content', + sort: 'custom', + }, + { + label: '结果', + field: 'result', + sort: 'custom', + isSearch: true, + }, + { + label: '是否成功', + field: 'success', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))