tableD.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <el-table :data="tableData" border stripe height="335" style="overflow-y: auto;">
  3. <el-table-column prop="time" label="时间" width="100">
  4. <template #default="scope">
  5. {{ scope.row.time ? scope.row.time.slice(10, 19) : '' }}
  6. </template>
  7. </el-table-column>
  8. <el-table-column prop="name" label="事件"></el-table-column>
  9. <el-table-column prop="deviceName" label="设备" width="200"></el-table-column>
  10. <el-table-column prop="statue" label="状态" width="100">
  11. <template #default="scope">
  12. <span v-if="scope.row.statue !=1">自动恢复</span>
  13. <el-button type="text" style="color: #409eff" @click.prevent="Update(scope.row)" v-if="scope.row.statue == 1">
  14. 确定
  15. </el-button>
  16. </template>
  17. </el-table-column>
  18. </el-table>
  19. </template>
  20. <script setup>
  21. import { defineComponent, onMounted, ref, watch } from 'vue'
  22. const props = defineProps({
  23. data: {
  24. type: Object,
  25. default: null,
  26. },
  27. });
  28. const tableData = ref(props.data)
  29. </script>
  30. <style lang="scss" scoped>
  31. </style>