zhang_12370
2025-07-23 ba07ace535232e5ea77cf0a89cd1c079895e1441
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
  <el-dialog
    v-model="visible"
    :title="title"
    :width="width"
    :destroy-on-close="true"
    @close="handleClose"
    class="dialog-table"
  >
    <ETable
      :columns="columns"
      :table-data="tableData"
      :loading="loading"
      :show-selection="false"
      :show-operations="false"
    />
  </el-dialog>
</template>
 
<script setup>
import { computed } from 'vue'
import ETable from '@/components/Table/ETable.vue'
 
const props = defineProps({
  // 弹窗控制
  modelValue: {
    type: Boolean,
    default: false
  },
  title: {
    type: String,
    default: '数据表格'
  },
  width: {
    type: String,
    default: '80%'
  },
  
  // 表格数据
  tableData: {
    type: Array,
    default: () => []
  },
  columns: {
    type: Array,
    default: () => []
  },
  loading: {
    type: Boolean,
    default: false
  }
})
 
const emit = defineEmits(['update:modelValue'])
 
// 弹窗显示控制
const visible = computed({
  get: () => props.modelValue,
  set: (value) => emit('update:modelValue', value)
})
 
// 关闭弹窗
const handleClose = () => {
  emit('update:modelValue', false)
}
</script>
 
<style lang="scss" scoped>
.dialog-table {
  :deep(.el-dialog) {
    background-color: #f8f9fa;
  }
  
  :deep(.el-dialog__header) {
    background-color: #f1f3f4;
    border-bottom: 1px solid #e4e7ed;
    padding: 20px 24px 16px;
    
    .el-dialog__title {
      color: #303133;
      font-weight: 600;
    }
  }
  
  :deep(.el-dialog__body) {
    background-color: #f8f9fa;
    padding: 20px 24px;
    
    .el-table {
      background-color: #ffffff;
      border-radius: 6px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    }
    
    .el-table th.el-table__cell {
      background-color: #fafbfc;
      color: #606266;
      font-weight: 600;
      border-bottom: 1px solid #ebeef5;
    }
    
    .el-table td.el-table__cell {
      background-color: #ffffff;
      border-bottom: 1px solid #f5f7fa;
    }
    
    .el-table__row:hover > td {
      background-color: #f8f9fa !important;
    }
  }
}
</style>