|
@@ -5,11 +5,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div ref="scrollRef" class="table__content_list" :class="`table__content_list_${type}`">
|
|
<div ref="scrollRef" class="table__content_list" :class="`table__content_list_${type}`">
|
|
|
<!-- 🔥 修复:空数据时依然渲染一行 -->
|
|
<!-- 🔥 修复:空数据时依然渲染一行 -->
|
|
|
- <div class="table__content_list_row" v-if="tableList.length === 0">
|
|
|
|
|
|
|
+ <div class="table__content_list_row" v-if="data.length === 0">
|
|
|
<div class="empty-text" :style="{ flexBasis: '100%' }"> 暂无数据 </div>
|
|
<div class="empty-text" :style="{ flexBasis: '100%' }"> 暂无数据 </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="table__content_list_row" v-else v-for="(item, index) in tableList" :key="`svvhbct-${index}`">
|
|
|
|
|
|
|
+ <div class="table__content_list_row" v-else v-for="(item, index) in data" :key="`svvhbct-${index}`">
|
|
|
<div v-for="(t, i) in columns" :key="`svvhbctr-${i}`" :style="{ flexBasis }" :class="`table__content__list_item_${type}`">
|
|
<div v-for="(t, i) in columns" :key="`svvhbctr-${i}`" :style="{ flexBasis }" :class="`table__content__list_item_${type}`">
|
|
|
<slot :name="t.prop" :scope="item">
|
|
<slot :name="t.prop" :scope="item">
|
|
|
<span>
|
|
<span>
|
|
@@ -53,13 +53,6 @@ if (props.autoScroll) {
|
|
|
useAutoScroll(scrollRef);
|
|
useAutoScroll(scrollRef);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 🔥 核心修复:安全获取 gateArray,永远不会报错/空白
|
|
|
|
|
-const tableList = computed(() => {
|
|
|
|
|
- const gateControl = _.get(props, 'data.data.gate_control', []);
|
|
|
|
|
- const firstItem = gateControl[0] || {};
|
|
|
|
|
- return firstItem.gateArray || []; // 不存在就返回空数组
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
const getStatusClass = (status) => {
|
|
const getStatusClass = (status) => {
|
|
|
switch (status) {
|
|
switch (status) {
|
|
|
case 1:
|
|
case 1:
|