<template> <div class="ZiJinFenXi"> <el-table :data="tableData" :span-method="arraySpanMethod" border style="width: 100%" > <el-table-column type='index' label="序号" width="180"> <template #default="{ $index }"> <span>{{ $index }}</span> </template> </el-table-column> <el-table-column prop="nodeName" label="项目阶段" width="180" /> <el-table-column prop="fillTime" label="月份" /> <el-table-column prop="plannedFundsMonth" label="计划资金(万元)" /> <el-table-column prop="actualUseFunds" label="投入资金(万元)" /> <!-- <el-table-column prop="amount3" sortable label="资金偏差度" /> --> <el-table-column prop="capitalDescription" label="原因分析" /> </el-table> </div> </template> <script setup name="ZiJinFenXi"> import { ref, inject } from 'vue' import {selectHomeInfoByProjectNo} from '@/api/gcpjApi' // const getProjectInfo = inject('getProjectInfo') // const projectInfo = getProjectInfo() const getProjectInfo = sessionStorage.getItem('getProjectInfo') const tableData = ref([]) const arraySpanMethod = ({ row, column, rowIndex, columnIndex, }) => { if (rowIndex === 0) { if ([0, 2].includes(columnIndex)) { return [0, 0] } else if (columnIndex === 1) { return [1, 3] } } } async function selectHomeInfoByProjectNoD(P) { let {data}=await selectHomeInfoByProjectNo(P) console.log(data,'selectHomeInfoByProjectNo'); tableData.value=data } selectHomeInfoByProjectNoD(getProjectInfo) </script> <style lang="scss" scoped></style>