Browse Source

任务:YT-182,执行失败和执行成功的代码重写

syhx
ljlong_2630 2 months ago
parent
commit
b156026a1c
  1. 55
      src/api/infra/apiMqDetail/index.ts
  2. 55
      src/api/infra/apiMqError/index.ts
  3. 54
      src/api/infra/apiMqHis/index.ts
  4. 53
      src/api/infra/apiMqMain/index.ts
  5. 81
      src/views/infra/apiMqError/apiMqError.data.ts
  6. 54
      src/views/infra/apiMqError/index.vue
  7. 63
      src/views/infra/apiMqHis/apiMqHis.data.ts
  8. 81
      src/views/infra/apiMqHis/index.vue

55
src/api/infra/apiMqDetail/index.ts

@ -1,55 +0,0 @@
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' })
}

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

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface ApiMqErrorVO {
id: number
number: string
type: string
content: string
times: number
available: string
departmentCode: string
extraProperties: string
siteId: string
concurrencyStamp: number
}
// 查询mq执行异常记录列表
export const getApiMqErrorPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/infra/api-mq-error/senior', data })
} else {
return await request.get({ url: `/infra/api-mq-error/page`, params })
}
}
// 查询mq执行异常记录详情
export const getApiMqError = async (id: number) => {
return await request.get({ url: `/infra/api-mq-error/get?id=` + id })
}
// 新增mq执行异常记录
export const createApiMqError = async (data: ApiMqErrorVO) => {
return await request.post({ url: `/infra/api-mq-error/create`, data })
}
// 修改mq执行异常记录
export const updateApiMqError = async (data: ApiMqErrorVO) => {
return await request.put({ url: `/infra/api-mq-error/update`, data })
}
// 删除mq执行异常记录
export const deleteApiMqError = async (id: number) => {
return await request.delete({ url: `/infra/api-mq-error/delete?id=` + id })
}
// 导出mq执行异常记录 Excel
export const exportApiMqError = async (params) => {
return await request.download({ url: `/infra/api-mq-error/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/infra/api-mq-error/get-import-template' })
}

54
src/api/infra/apiMqHis/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface ApiMqHisVO {
id: number
number: string
type: string
times: number
available: string
departmentCode: string
extraProperties: string
siteId: string
concurrencyStamp: number
}
// 查询mq执行历史记录列表
export const getApiMqHisPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/infra/api-mq-his/senior', data })
} else {
return await request.get({ url: `/infra/api-mq-his/page`, params })
}
}
// 查询mq执行历史记录详情
export const getApiMqHis = async (id: number) => {
return await request.get({ url: `/infra/api-mq-his/get?id=` + id })
}
// 新增mq执行历史记录
export const createApiMqHis = async (data: ApiMqHisVO) => {
return await request.post({ url: `/infra/api-mq-his/create`, data })
}
// 修改mq执行历史记录
export const updateApiMqHis = async (data: ApiMqHisVO) => {
return await request.put({ url: `/infra/api-mq-his/update`, data })
}
// 删除mq执行历史记录
export const deleteApiMqHis = async (id: number) => {
return await request.delete({ url: `/infra/api-mq-his/delete?id=` + id })
}
// 导出mq执行历史记录 Excel
export const exportApiMqHis = async (params) => {
return await request.download({ url: `/infra/api-mq-his/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/infra/api-mq-his/get-import-template' })
}

53
src/api/infra/apiMqMain/index.ts

@ -1,53 +0,0 @@
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' })
}

81
src/views/infra/apiMqMain/apiMqMain.data.ts → src/views/infra/apiMqError/apiMqError.data.ts

@ -2,16 +2,16 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const ApiMqMainRules = reactive({ export const ApiMqErrorRules = reactive({
number: [required], number: [required],
type: [required], type: [required],
times: [required] times: [required]
}) })
export const ApiMqMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ApiMqError = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '业务编号', label: '编号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true
@ -21,37 +21,50 @@ export const ApiMqMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: { form: {
component: 'SelectV2' component: 'SelectV2'
} }
}, },
{ {
label: '执行次数', label: '内容',
field: 'times', field: 'content',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: { form: {
component: 'InputNumber', component: 'Editor',
value: 0 componentProps: {
valueHtml: '',
height: 200
}
} }
}, },
{ {
label: '是否可用', label: '执行次数',
field: 'available', field: 'times',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
form: { form: {
component: 'Switch', component: 'InputNumber',
value: 'TRUE', value: 0
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
} }
}, },
// { // {
// 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: '部门', // label: '部门',
// field: 'departmentCode', // field: 'departmentCode',
// sort: 'custom', // sort: 'custom',
@ -73,17 +86,27 @@ export const ApiMqMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false isForm: false
}, },
// // {
// // label: '扩展属性',
// // field: 'extraProperties',
// // sort: 'custom',
// // isSearch: true
// // },
// // {
// // label: '地点ID',
// // field: 'siteId',
// // sort: 'custom',
// // isSearch: true
// // },
// { // {
// label: '扩展属性', // label: '乐观锁',
// field: 'extraProperties', // field: 'concurrencyStamp',
// sort: 'custom', // sort: 'custom',
// isSearch: true // isSearch: true,
// }, // form: {
// { // component: 'InputNumber',
// label: '地点ID', // value: 0
// field: 'siteId', // }
// sort: 'custom',
// isSearch: true
// }, // },
// { // {
// label: '操作', // label: '操作',

54
src/views/infra/apiMqDetail/index.vue → src/views/infra/apiMqError/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="ApiMqDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="ApiMqError.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -11,7 +11,7 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ApiMqDetail.allSchemas" :allSchemas="ApiMqError.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -42,31 +42,31 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:rules="ApiMqDetailRules" :rules="ApiMqErrorRules"
:formAllSchemas="ApiMqDetail.allSchemas" :formAllSchemas="ApiMqError.allSchemas"
:apiUpdate="ApiMqDetailApi.updateApiMqDetail" :apiUpdate="ApiMqErrorApi.updateApiMqError"
:apiCreate="ApiMqDetailApi.createApiMqDetail" :apiCreate="ApiMqErrorApi.createApiMqError"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ApiMqDetail.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="ApiMqError.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/infra/api-mq-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/infra/api-mq-error/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ApiMqDetail,ApiMqDetailRules } from './apiMqDetail.data' import { ApiMqError,ApiMqErrorRules } from './apiMqError.data'
import * as ApiMqDetailApi from '@/api/infra/apiMqDetail' import * as ApiMqErrorApi from '@/api/infra/apiMqError'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ApiMqDetail' }) defineOptions({ name: 'ApiMqError' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -74,7 +74,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ApiMqDetail.allSchemas.tableColumns) const tableColumns = ref(ApiMqError.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -91,7 +91,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ApiMqDetailApi.getApiMqDetailPage // getListApi: ApiMqErrorApi.getApiMqErrorPage //
}) })
// //
@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'infra:api-mq-detail:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:apiMqError:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'infra:api-mq-detail:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:apiMqError:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'infra:api-mq-detail:export'}), // // defaultButtons.defaultExportBtn({hasPermi:'wms:apiMqError:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'infra:api-mq-detail:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'wms:apiMqError:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'infra:api-mq-detail:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:apiMqError:delete'}), //
] ]
// - // -
@ -154,7 +154,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =ApiMqDetail.allSchemas.formSchema.some(function (item) { var isHave =ApiMqError.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if(isHave){
@ -166,10 +166,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await ApiMqDetailApi.createApiMqDetail(data) await ApiMqErrorApi.createApiMqError(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await ApiMqDetailApi.updateApiMqDetail(data) await ApiMqErrorApi.updateApiMqError(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -179,7 +179,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicApiMqDetail') detailRef.value.openDetail(row, titleName, titleValue, 'basicApiMqError')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -188,7 +188,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await ApiMqDetailApi.deleteApiMqDetail(id) await ApiMqErrorApi.deleteApiMqError(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -203,8 +203,8 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await ApiMqDetailApi.exportApiMqDetail(tableObject.params) const data = await ApiMqErrorApi.exportApiMqError(tableObject.params)
download.excel(data, 'mq执行记录.xlsx') download.excel(data, 'mq执行异常记录.xlsx')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -219,7 +219,7 @@ const handleImport = () => {
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: 'mq执行记录导入模版.xlsx' templateTitle: 'mq执行异常记录导入模版.xlsx'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
@ -238,7 +238,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ApiMqDetailApi.importTemplate() importTemplateData.templateUrl = await ApiMqErrorApi.importTemplate()
}) })
</script> </script>

63
src/views/infra/apiMqDetail/apiMqDetail.data.ts → src/views/infra/apiMqHis/apiMqHis.data.ts

@ -2,17 +2,21 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const ApiMqDetailRules = reactive({ export const ApiMqHisRules = reactive({
masterId: [required],
number: [required], number: [required],
type: [required], type: [required],
times: [required] times: [required]
}) })
export const ApiMqDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const ApiMqHis = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '编号',
// field: 'id',
// sort: 'custom',
// isForm: false
// },
{ {
label: '主业务编号编号', label: '编号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true
@ -27,20 +31,7 @@ export const ApiMqDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '内容', label: '执行次数',
field: 'content',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '执行次数(默认1)',
field: 'times', field: 'times',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
@ -49,14 +40,22 @@ export const ApiMqDetail = useCrudSchemas(reactive<CrudSchema[]>([
value: 0 value: 0
} }
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true // isSearch: true,
}, // form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
// { // {
// label: '部门', // label: '部门',
// field: 'departmentCode', // field: 'departmentCode',
@ -92,6 +91,16 @@ export const ApiMqDetail = useCrudSchemas(reactive<CrudSchema[]>([
// isSearch: true // isSearch: true
// }, // },
// { // {
// label: '乐观锁',
// field: 'concurrencyStamp',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
// {
// label: '操作', // label: '操作',
// field: 'action', // field: 'action',
// isForm: false, // isForm: false,

81
src/views/infra/apiMqMain/index.vue → src/views/infra/apiMqHis/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="ApiMqMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="ApiMqHis.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -11,7 +11,7 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ApiMqMain.allSchemas" :allSchemas="ApiMqHis.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #number="{row}"> <template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '业务编号', row.number)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.number }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
@ -42,46 +42,31 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:rules="ApiMqMainRules" :rules="ApiMqHisRules"
:formAllSchemas="ApiMqMain.allSchemas" :formAllSchemas="ApiMqHis.allSchemas"
:searchTableParams="searchTableParams" :apiUpdate="ApiMqHisApi.updateApiMqHis"
:tableAllSchemas="ApiMqDetail.allSchemas" :apiCreate="ApiMqHisApi.createApiMqHis"
:tableFormRules="ApiMqDetailRules"
:apiUpdate="ApiMqMainApi.updateApiMqMain"
:apiCreate="ApiMqMainApi.createApiMqMain"
:isBusiness="true"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ApiMqMain.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="ApiMqHis.allSchemas" />
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ApiMqMain.allSchemas"
:detailAllSchemas="ApiMqDetail.allSchemas"
:detailAllSchemasRules="ApiMqDetailRules"
:searchTableParams="searchTableParams"
:apiPage="ApiMqDetailApi.getApiMqDetailPage"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/infra/api-mq-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/infra/api-mq-his/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ApiMqMain,ApiMqMainRules } from './apiMqMain.data' import { ApiMqHis,ApiMqHisRules } from './apiMqHis.data'
import * as ApiMqMainApi from '@/api/infra/apiMqMain' import * as ApiMqHisApi from '@/api/infra/apiMqHis'
import { ApiMqDetail,ApiMqDetailRules } from '../apiMqDetail/apiMqDetail.data'
import * as ApiMqDetailApi from '@/api/infra/apiMqDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ApiMqMain' }) defineOptions({ name: 'ApiMqHis' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -89,7 +74,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref([...ApiMqMain.allSchemas.tableColumns,...ApiMqDetail.allSchemas.tableMainColumns]) const tableColumns = ref(ApiMqHis.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -100,17 +85,13 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
} }
//
const searchTableParams = ref([
])
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ApiMqMainApi.getApiMqMainPage // getListApi: ApiMqHisApi.getApiMqHisPage //
}) })
// //
@ -118,9 +99,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'infra:api-mq-main:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:apiMqHis:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'infra:api-mq-main:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:apiMqHis:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'infra:api-mq-main:export'}), // // defaultButtons.defaultExportBtn({hasPermi:'wms:apiMqHis:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -152,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'infra:api-mq-main:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'wms:apiMqHis:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'infra:api-mq-main:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:apiMqHis:delete'}), //
] ]
// - // -
@ -173,7 +154,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =ApiMqMain.allSchemas.formSchema.some(function (item) { var isHave =ApiMqHis.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if(isHave){
@ -185,10 +166,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await ApiMqMainApi.createApiMqMain(data) await ApiMqHisApi.createApiMqHis(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await ApiMqMainApi.updateApiMqMain(data) await ApiMqHisApi.updateApiMqHis(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -198,7 +179,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicApiMqMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicApiMqHis')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -207,7 +188,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await ApiMqMainApi.deleteApiMqMain(id) await ApiMqHisApi.deleteApiMqHis(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -222,8 +203,8 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await ApiMqMainApi.exportApiMqMain(tableObject.params) const data = await ApiMqHisApi.exportApiMqHis(tableObject.params)
download.excel(data, 'mq执行记录.xlsx') download.excel(data, 'mq执行历史记录.xlsx')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -238,7 +219,7 @@ const handleImport = () => {
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: 'mq执行记录导入模版.xlsx' templateTitle: 'mq执行历史记录导入模版.xlsx'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
@ -257,7 +238,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ApiMqMainApi.importTemplate() importTemplateData.templateUrl = await ApiMqHisApi.importTemplate()
}) })
</script> </script>
Loading…
Cancel
Save