4.公司里面的详情页

<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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值