|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="ApiMqMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search :schema="ApiMqHis.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -11,7 +11,7 @@ |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="ApiMqMain.allSchemas" |
|
|
|
:allSchemas="ApiMqHis.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
@ -27,9 +27,9 @@ |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
|
<template #number="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '业务编号', row.number)"> |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
<template #code="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
|
<span>{{ row.code }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
@ -42,46 +42,31 @@ |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
:rules="ApiMqMainRules" |
|
|
|
:formAllSchemas="ApiMqMain.allSchemas" |
|
|
|
:searchTableParams="searchTableParams" |
|
|
|
:tableAllSchemas="ApiMqDetail.allSchemas" |
|
|
|
:tableFormRules="ApiMqDetailRules" |
|
|
|
:apiUpdate="ApiMqMainApi.updateApiMqMain" |
|
|
|
:apiCreate="ApiMqMainApi.createApiMqMain" |
|
|
|
:isBusiness="true" |
|
|
|
:rules="ApiMqHisRules" |
|
|
|
:formAllSchemas="ApiMqHis.allSchemas" |
|
|
|
:apiUpdate="ApiMqHisApi.updateApiMqHis" |
|
|
|
:apiCreate="ApiMqHisApi.createApiMqHis" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="ApiMqMain.allSchemas" /> |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:allSchemas="ApiMqMain.allSchemas" |
|
|
|
:detailAllSchemas="ApiMqDetail.allSchemas" |
|
|
|
:detailAllSchemasRules="ApiMqDetailRules" |
|
|
|
:searchTableParams="searchTableParams" |
|
|
|
:apiPage="ApiMqDetailApi.getApiMqDetailPage" |
|
|
|
/> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="ApiMqHis.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<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> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { ApiMqMain,ApiMqMainRules } from './apiMqMain.data' |
|
|
|
import * as ApiMqMainApi from '@/api/infra/apiMqMain' |
|
|
|
import { ApiMqDetail,ApiMqDetailRules } from '../apiMqDetail/apiMqDetail.data' |
|
|
|
import * as ApiMqDetailApi from '@/api/infra/apiMqDetail' |
|
|
|
import { ApiMqHis,ApiMqHisRules } from './apiMqHis.data' |
|
|
|
import * as ApiMqHisApi from '@/api/infra/apiMqHis' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
|
|
defineOptions({ name: 'ApiMqMain' }) |
|
|
|
defineOptions({ name: 'ApiMqHis' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
@ -89,7 +74,7 @@ const { t } = useI18n() // 国际化 |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
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) => { |
|
|
@ -100,17 +85,13 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 查询列表页面参数设置 |
|
|
|
const searchTableParams = ref([ |
|
|
|
]) |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: ApiMqMainApi.getApiMqMainPage // 分页接口 |
|
|
|
getListApi: ApiMqHisApi.getApiMqHisPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
@ -118,9 +99,9 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
// defaultButtons.defaultAddBtn({hasPermi:'infra:api-mq-main:create'}), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'infra:api-mq-main:import'}), // 导入 |
|
|
|
// defaultButtons.defaultExportBtn({hasPermi:'infra:api-mq-main:export'}), // 导出 |
|
|
|
// defaultButtons.defaultAddBtn({hasPermi:'wms:apiMqHis:create'}), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:apiMqHis:import'}), // 导入 |
|
|
|
// defaultButtons.defaultExportBtn({hasPermi:'wms:apiMqHis:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -152,8 +133,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'infra:api-mq-main:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'infra:api-mq-main:delete'}), // 删除 |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'wms:apiMqHis:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:apiMqHis:delete'}), // 删除 |
|
|
|
] |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
@ -173,7 +154,7 @@ const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
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'; |
|
|
|
}); |
|
|
|
if(isHave){ |
|
|
@ -185,10 +166,10 @@ const formsSuccess = async (formType,data) => { |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (formType === 'create') { |
|
|
|
await ApiMqMainApi.createApiMqMain(data) |
|
|
|
await ApiMqHisApi.createApiMqHis(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await ApiMqMainApi.updateApiMqMain(data) |
|
|
|
await ApiMqHisApi.updateApiMqHis(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
@ -198,7 +179,7 @@ const formsSuccess = async (formType,data) => { |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
|
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 ApiMqMainApi.deleteApiMqMain(id) |
|
|
|
await ApiMqHisApi.deleteApiMqHis(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
@ -222,8 +203,8 @@ const handleExport = async () => { |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await ApiMqMainApi.exportApiMqMain(tableObject.params) |
|
|
|
download.excel(data, 'mq执行记录主.xlsx') |
|
|
|
const data = await ApiMqHisApi.exportApiMqHis(tableObject.params) |
|
|
|
download.excel(data, 'mq执行历史记录.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -238,7 +219,7 @@ const handleImport = () => { |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: 'mq执行记录主导入模版.xlsx' |
|
|
|
templateTitle: 'mq执行历史记录导入模版.xlsx' |
|
|
|
}) |
|
|
|
// 导入成功之后 |
|
|
|
const importSuccess = () => { |
|
|
@ -257,7 +238,7 @@ const searchFormClick = (searchData) => { |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await ApiMqMainApi.importTemplate() |
|
|
|
importTemplateData.templateUrl = await ApiMqHisApi.importTemplate() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |