<template>
  <div class="budget-table-container">
    <el-table :data="budgetDefinitionData" style="width: 100%">
      <el-table-column prop="serialNumber" label="序号" width="80" />
      <el-table-column prop="subjectName" label="预算科目名称" width="200">
        <template #default="scope">
          <span :style="{ color: scope.row.subjectFlag === '2' ? 'red' : '' }">
            {{ scope.row.subjectName }}
          </span>
        </template>
      </el-table-column>
      <el-table-column prop="subjectDefinition" label="预算科目定义" min-width="380">
        <template #default="scope">
          <div style="white-space: pre-line">
            {{ scope.row.subjectDefinition }}
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

// 响应式数据
const budgetDefinitionData = ref([]);

// 暴露方法给父组件
defineExpose({
  budgetDefinitionData
});
</script>

<style scoped>
.budget-table-container {
  padding: 20px;
}
</style>
