bmTable.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <el-table :data="listData" v-loading="loading" border style="margin-top:10px" max-height="450" @selection-change="handleSelectionChange">
  3. <el-table-column type="selection" width="55" align="center" v-if="selection"/>
  4. <el-table-column label="对象类型" width="200">
  5. <template #default="scope">
  6. {{biz_type.find(p=>p.value == scope.row.bizObj.objType).label}}
  7. </template>
  8. </el-table-column>
  9. <el-table-column label="业务对象">
  10. <template #default="scope">
  11. {{scope.row.bizObj.objName}}
  12. </template>
  13. </el-table-column>
  14. <el-table-column label="应用编码/对象实例" width="200">
  15. <template #default="scope">
  16. {{scope.row.bizObj.objAddr}}
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="操作" width="100" align="center">
  20. <template #default="scope">
  21. <slot name="action" :row="scope.row"/>
  22. </template>
  23. </el-table-column>
  24. </el-table>
  25. </template>
  26. <script setup lang="ts">
  27. const {proxy} = getCurrentInstance()
  28. const {biz_type} = proxy.useDict('biz_type');
  29. const props = defineProps(['listData', 'loading','selection'])
  30. // 多选框选中数据
  31. function handleSelectionChange(selection) {
  32. let ids = selection.map(item => item.bizObj.objId);
  33. proxy.$emit('selectObj',ids)
  34. }
  35. </script>
  36. <style scoped lang="scss">
  37. </style>