From 4f1d7c5deb72caa49d06d568176786c823adc00c Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Sun, 29 Sep 2024 11:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=9AYT-182=EF=BC=8Cmq?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/apiMqDetail/index.ts | 55 ++++ src/api/infra/apiMqMain/index.ts | 53 ++++ .../infra/apiMqDetail/apiMqDetail.data.ts | 103 +++++++ src/views/infra/apiMqDetail/index.vue | 244 ++++++++++++++++ src/views/infra/apiMqMain/apiMqMain.data.ts | 97 +++++++ src/views/infra/apiMqMain/index.vue | 263 ++++++++++++++++++ 6 files changed, 815 insertions(+) create mode 100644 src/api/infra/apiMqDetail/index.ts create mode 100644 src/api/infra/apiMqMain/index.ts create mode 100644 src/views/infra/apiMqDetail/apiMqDetail.data.ts create mode 100644 src/views/infra/apiMqDetail/index.vue create mode 100644 src/views/infra/apiMqMain/apiMqMain.data.ts create mode 100644 src/views/infra/apiMqMain/index.vue diff --git a/src/api/infra/apiMqDetail/index.ts b/src/api/infra/apiMqDetail/index.ts new file mode 100644 index 000000000..dc76f3616 --- /dev/null +++ b/src/api/infra/apiMqDetail/index.ts @@ -0,0 +1,55 @@ +import request from '@/config/axios' + +export interface ApiMqDetailVO { + id: number + masterId: number + number: string + type: string + content: string + times: number + available: string + departmentCode: string + extraProperties: string + siteId: string +} + +// 查询mq执行记录子列表 +export const getApiMqDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/infra/api-mq-detail/senior', data }) + } else { + return await request.get({ url: `/infra/api-mq-detail/page`, params }) + } +} + +// 查询mq执行记录子详情 +export const getApiMqDetail = async (id: number) => { + return await request.get({ url: `/infra/api-mq-detail/get?id=` + id }) +} + +// 新增mq执行记录子 +export const createApiMqDetail = async (data: ApiMqDetailVO) => { + return await request.post({ url: `/infra/api-mq-detail/create`, data }) +} + +// 修改mq执行记录子 +export const updateApiMqDetail = async (data: ApiMqDetailVO) => { + return await request.put({ url: `/infra/api-mq-detail/update`, data }) +} + +// 删除mq执行记录子 +export const deleteApiMqDetail = async (id: number) => { + return await request.delete({ url: `/infra/api-mq-detail/delete?id=` + id }) +} + +// 导出mq执行记录子 Excel +export const exportApiMqDetail = async (params) => { + return await request.download({ url: `/infra/api-mq-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/infra/api-mq-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/infra/apiMqMain/index.ts b/src/api/infra/apiMqMain/index.ts new file mode 100644 index 000000000..1f8d2de80 --- /dev/null +++ b/src/api/infra/apiMqMain/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface ApiMqMainVO { + id: number + number: string + type: string + times: number + available: string + departmentCode: string + extraProperties: string + siteId: string +} + +// 查询mq执行记录主列表 +export const getApiMqMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/infra/api-mq-main/senior', data }) + } else { + return await request.get({ url: `/infra/api-mq-main/page`, params }) + } +} + +// 查询mq执行记录主详情 +export const getApiMqMain = async (id: number) => { + return await request.get({ url: `/infra/api-mq-main/get?id=` + id }) +} + +// 新增mq执行记录主 +export const createApiMqMain = async (data: ApiMqMainVO) => { + return await request.post({ url: `/infra/api-mq-main/create`, data }) +} + +// 修改mq执行记录主 +export const updateApiMqMain = async (data: ApiMqMainVO) => { + return await request.put({ url: `/infra/api-mq-main/update`, data }) +} + +// 删除mq执行记录主 +export const deleteApiMqMain = async (id: number) => { + return await request.delete({ url: `/infra/api-mq-main/delete?id=` + id }) +} + +// 导出mq执行记录主 Excel +export const exportApiMqMain = async (params) => { + return await request.download({ url: `/infra/api-mq-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/infra/api-mq-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/infra/apiMqDetail/apiMqDetail.data.ts b/src/views/infra/apiMqDetail/apiMqDetail.data.ts new file mode 100644 index 000000000..75b51568e --- /dev/null +++ b/src/views/infra/apiMqDetail/apiMqDetail.data.ts @@ -0,0 +1,103 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ApiMqDetailRules = reactive({ + masterId: [required], + number: [required], + type: [required], + times: [required] +}) + +export const ApiMqDetail = useCrudSchemas(reactive([ + + { + label: '主业务编号编号', + field: 'number', + sort: 'custom', + isSearch: true + }, + { + label: '类型', + field: 'type', + sort: 'custom', + isSearch: true, + form: { + component: 'SelectV2' + } + }, + { + label: '内容', + field: 'content', + sort: 'custom', + isSearch: true, + form: { + component: 'Editor', + componentProps: { + valueHtml: '', + height: 200 + } + } + }, + { + label: '执行次数(默认1)', + field: 'times', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true + }, + // { + // label: '部门', + // field: 'departmentCode', + // sort: 'custom', + // isSearch: true + // }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false + }, + // { + // label: '扩展属性', + // field: 'extraProperties', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '地点ID', + // field: 'siteId', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } +])) diff --git a/src/views/infra/apiMqDetail/index.vue b/src/views/infra/apiMqDetail/index.vue new file mode 100644 index 000000000..6b84fb9a7 --- /dev/null +++ b/src/views/infra/apiMqDetail/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/infra/apiMqMain/apiMqMain.data.ts b/src/views/infra/apiMqMain/apiMqMain.data.ts new file mode 100644 index 000000000..97ba03ed6 --- /dev/null +++ b/src/views/infra/apiMqMain/apiMqMain.data.ts @@ -0,0 +1,97 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ApiMqMainRules = reactive({ + number: [required], + type: [required], + times: [required] +}) + +export const ApiMqMain = useCrudSchemas(reactive([ + + { + label: '业务编号', + field: 'number', + sort: 'custom', + isSearch: true + }, + { + label: '类型', + field: 'type', + sort: 'custom', + isSearch: true, + form: { + component: 'SelectV2' + } + }, + { + label: '执行次数', + field: 'times', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + // { + // label: '部门', + // field: 'departmentCode', + // sort: 'custom', + // isSearch: true + // }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false + }, + // { + // label: '扩展属性', + // field: 'extraProperties', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '地点ID', + // field: 'siteId', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } +])) diff --git a/src/views/infra/apiMqMain/index.vue b/src/views/infra/apiMqMain/index.vue new file mode 100644 index 000000000..14547b46c --- /dev/null +++ b/src/views/infra/apiMqMain/index.vue @@ -0,0 +1,263 @@ + + +