<template>
<PageTemplate :title="variable.title" @backClick="goBack" :confirmLoading="variable.confirmLoading" :isShowPageFooter="false" :is-many-block="true" :main-slot-padding-bottom="true">
<!-- 主体信息 -->
<Description @register="register" class="mt-4" />
<template #otherBlock>
<FormCard :title="t('public.describe.shipmentDetail')" headerStyle="DefaultGradientStyle">
<BasicTable @register="registerTable">
</BasicTable>
</FormCard>
</template>
</PageTemplate>
</template>
<script setup lang="ts">
import { defineEmits, defineExpose, reactive } from 'vue';
import { listTransShipmentApi} from '@/api/tms/transShipment/transShipment.api';
import { useI18n } from '@/hooks/web/useI18n';
import { Description, useDescription } from "@/components/Description";
import {detailColumns, detailSchema} from "./data";
import { detailColSpan } from "@/enums/common/commonEnum";
import PageTemplate from '@/components/PageTemplate/index.vue'
import { CurrentPageEnum } from "@/enums/common/commonEnum";
import {getTransSchedulerApi} from "@/api/tms/transScheduler/transScheduler.api";
import {BasicTable, useTable} from "@/components/Table";
import FormCard from "@/components/FormCard/index.vue";
// 定义国际化
const { t } = useI18n();
// 定义可触发事件
const emit = defineEmits(['goBack'])
// 定义变量
const variable = reactive<any>({
title: "",
confirmLoading: false
});
const pageFunction = (params) => {
params.schedulerNo= variable.fatherParam.schedulerNo
return listTransShipmentApi(params)
}
const [registerTable, { reload, getForm,setTableData}] = useTable({
api: pageFunction,
striped: true,
useSearchForm: false,
rowKey: 'id',
bordered: true,
showIndexColumn: true,
clickToRowSelect: true,
columns:detailColumns,
showTableSetting: false,
size:"small",
canResize: false,
tableSetting: {
fullScreen: false,
},
});
/** 初始化函数 **/
const init = async (param) => {
variable.title = t('public.describe.transSchedulerDetail')
variable.fatherParam=param
const data = await getTransSchedulerApi(param.id);//查询数据
setDescProps({ data: data })
await reload()
}
/** 定义详情 **/
const [register, { setDescProps }] = useDescription({
schema: detailSchema,
column: detailColSpan,
});
/** 返回模块主页 */
function goBack() {
emit('goBack', CurrentPageEnum.MAIN, { isReload: false })
}
/** 定义暴露的函数 **/
defineExpose({
init
})
</script>
<style scoped>
</style>
4.公司里面的详情页
最新推荐文章于 2024-10-06 10:25:19 发布