张诺
2025-07-25 77bb73aaef8f85d961b373731a05361cbe6921de
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<template>
  <el-dialog
    v-model="visible"
    :title="title"
    :width="width"
    :destroy-on-close="true"
    @close="handleClose"
    class="dialog-table"
  >
    <div class="dialog-table-content">
      <div class="table-wrapper">
        <ETable
          :columns="columns"
          :table-data="tableData"
          :loading="loadings"
          :show-selection="false"
          :show-operations="false"
          :height="height"
          :style="{ minHeight: height }"
        />
      </div>
    </div>
  </el-dialog>
</template>
 
<script setup>
import { computed } from 'vue'
import ETable from '@/components/Table/ETable.vue'
 
const props = defineProps({
  modelValue: Boolean,
  title: String,
  width: String,
  tableData: Array,
  columns: Array,
  loading: Boolean,
  height: [String, Number]
})
const loadings = computed(() => props.loading || 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;
    }
  }
}
 
.dialog-table-content {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}
 
.table-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}
 
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background-color: #ffffff;
  border-radius: 6px;
  border: 1px dashed #d9d9d9;
}
 
.pagination-wrapper {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  padding: 16px 0;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  
  :deep(.el-pagination) {
    --el-pagination-font-size: 14px;
    --el-pagination-bg-color: #ffffff;
    --el-pagination-text-color: #606266;
    --el-pagination-border-radius: 4px;
    
    .btn-prev,
    .btn-next {
      background-color: #f5f7fa;
      color: #606266;
      
      &:hover {
        color: #409eff;
      }
      
      &:disabled {
        color: #c0c4cc;
        background-color: #f5f7fa;
      }
    }
    
    .el-pager li {
      background-color: #f5f7fa;
      color: #606266;
      
      &:hover {
        color: #409eff;
      }
      
      &.is-active {
        background-color: #409eff;
        color: #ffffff;
      }
    }
    
    .el-pagination__sizes .el-select .el-input__wrapper {
      background-color: #f5f7fa;
    }
    
    .el-pagination__jump .el-input__wrapper {
      background-color: #f5f7fa;
    }
  }
}
 
/* 响应式设计 */
@media (max-width: 768px) {
  .pagination-wrapper {
    :deep(.el-pagination) {
      .el-pagination__sizes,
      .el-pagination__jump {
        display: none;
      }
    }
  }
}
</style>