From 7f016fe82a31469e267007bab032b19df3512ee3 Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Fri, 15 Nov 2024 12:45:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=BA=E5=BC=95=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/outerApiHis/index.ts | 58 ++++ src/utils/dict.ts | 1 + src/views/infra/apiMqHis/apiMqHis.data.ts | 6 +- src/views/infra/outerApiHis/index.vue | 254 ++++++++++++++++++ .../infra/outerApiHis/outerApiHis.data.ts | 82 ++++++ 5 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 src/api/infra/outerApiHis/index.ts create mode 100644 src/views/infra/outerApiHis/index.vue create mode 100644 src/views/infra/outerApiHis/outerApiHis.data.ts 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' + } + } +]))