feiyu02
2025-01-03 4f1fb28dad6a4df83752dc9b60f504764f8e3dcb
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
<template>
  <el-row class="wrap">
    <BaseCard size="medium" direction="left">
      <template #content>
        <SatelliteSearchBar
          :loading="loading"
          @search="onSearch"
        ></SatelliteSearchBar>
        <el-button
          type="primary"
          class="el-button-custom"
          size="small"
          @click="handleRankClick"
        >
          {{ rankVisible ? '隐藏排名' : '显示排名' }}
        </el-button>
        <el-button
          type="primary"
          class="el-button-custom"
          size="small"
          @click="handleDataClick"
        >
          {{ dataVisible ? '隐藏数据' : '显示数据' }}
        </el-button>
        <el-button
          type="primary"
          class="el-button-custom"
          size="small"
          @click="handleColorClick"
        >
          {{ isStandardColor ? '绘制对比色' : '绘制标准色' }}
        </el-button>
        <el-table
          :data="gridDataList"
          table-layout="fixed"
          size="small"
          :show-overflow-tooltip="true"
          border
          height="50vh"
          row-class-name="t-row-normal"
          cell-class-name="t-cell"
          header-row-class-name="t-header-row"
          header-cell-class-name="t-header-cell"
          :highlight-current-row="true"
          @row-click="handleRowClick"
        >
          <el-table-column
            type="index"
            label="序号"
            align="center"
            width="50"
          />
          <!-- <el-table-column type="expand">
            <template #default="props">
              
            </template>
          </el-table-column> -->
          <el-table-column
            prop="dataTime"
            label="时间"
            align="center"
            :formatter="timeFormatter"
            width="150"
          />
          <el-table-column
            prop="type"
            label="数据类型"
            align="center"
            :formatter="dataTypeFormatter"
            width="150"
          />
        </el-table>
      </template>
 
      <template #footer> </template>
    </BaseCard>
  </el-row>
</template>
<script setup>
import { ref } from 'vue';
import moment from 'moment';
import SatelliteSearchBar from './SatelliteSearchBar.vue';
// import { useFetchData } from '@/composables/fetchData';
// import gridApi from '@/api/gridApi';
// import SatelliteProxy from '../SatelliteProxy';
 
// eslint-disable-next-line no-unused-vars
function timeFormatter(row, col, cellValue, index) {
  return moment(cellValue).format('YYYY-MM-DD');
}
 
// eslint-disable-next-line no-unused-vars
function dataTypeFormatter(row, col, cellValue, index) {
  switch (cellValue) {
    case 0:
      return '原始数据';
    case 1:
      return '融合数据';
    default:
      return '-';
  }
}
 
defineProps({
  loading: Boolean,
  gridDataList: {
    type: Array,
    default: () => []
  }
});
 
const rankVisible = ref(true);
const dataVisible = ref(true);
const isStandardColor = ref(true)
 
const emits = defineEmits(['search', 'rowClick', 'showRank', 'showData', 'changeColor']);
 
// 查询网格信息和遥感数据组
function onSearch(options) {
  emits('search', options);
}
 
function handleRankClick() {
  rankVisible.value = !rankVisible.value
  emits('showRank', rankVisible.value);
}
 
function handleDataClick() {
  dataVisible.value = !dataVisible.value
  emits('showData', dataVisible.value);
}
 
function handleColorClick() {
  isStandardColor.value = !isStandardColor.value
  emits('changeColor', isStandardColor.value);
}
 
function handleRowClick(row, col, event) {
  emits('rowClick', row);
}
</script>
<style scoped>
:deep(.el-table) {
  --el-table-bg-color: transparent;
  --el-table-row-hover-bg-color: var(--select_color);
  --el-table-current-row-bg-color: var(--select_color);
  /* --el-table-current-row-bg-color: #7dff5d96; */
  --el-table-text-color: var(--font-color);
}
 
:deep(.t-row-normal) {
  cursor: pointer;
  background-color: transparent !important;
}
 
:deep(.t-cell) {
  /* background: red !important; */
  /* height: 40px;
  border: 1px solid black; */
}
 
:deep(.t-header-row) {
}
 
:deep(.t-header-cell) {
  background-color: var(--bg-color-2) !important;
  /* text-align: center !important; */
  color: white !important;
}
</style>