|
@@ -20,7 +20,7 @@
|
|
|
:pagination="pagination"
|
|
|
class="tableW"
|
|
|
@change="pageChange"
|
|
|
- :scroll="{ y: 800 }"
|
|
|
+ :scroll="{ y: 700 }"
|
|
|
></a-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -32,16 +32,37 @@ import CustomHeader from '/@/components/vent/customHeader.vue';
|
|
|
import { getHydrology } from '../common.api';
|
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { columns, pagination } from '../common.data';
|
|
|
+import { columns } from '../common.data';
|
|
|
+interface sensorInfo {
|
|
|
+ reserviorName: String;
|
|
|
+ damBodyId: String;
|
|
|
+ s: String;
|
|
|
+ t: String;
|
|
|
+ pointUnit: String;
|
|
|
+ pointName: String;
|
|
|
+ v: String;
|
|
|
+ pointTypeName: String;
|
|
|
+ dambodyName: String;
|
|
|
+ pointType: String;
|
|
|
+ propertyId: String;
|
|
|
+}
|
|
|
const { hasPermission } = usePermission();
|
|
|
-let router = useRouter();
|
|
|
-let tableData = ref([]);
|
|
|
+const router = useRouter();
|
|
|
+const tableData = ref<sensorInfo[]>([]);
|
|
|
+
|
|
|
//分页切换
|
|
|
-let pageChange = (val) => {
|
|
|
+const pageChange = (val) => {
|
|
|
+ console.log(val, 'val');
|
|
|
pagination.current = val.current;
|
|
|
pagination.pageSize = val.pageSize;
|
|
|
getListData();
|
|
|
};
|
|
|
+const pagination = reactive({
|
|
|
+ current: 1, // 当前页码
|
|
|
+ pageSize: 20, // 每页显示条数
|
|
|
+ total: 0, // 总条目数,后端返回
|
|
|
+ showTotal: (total) => `共 ${total} 条`, // 分页右下角显示信息
|
|
|
+});
|
|
|
//返回首页
|
|
|
function getBack() {
|
|
|
router.push('/monitorChannel/monitor-alarm-home');
|
|
@@ -51,11 +72,10 @@ async function getListData() {
|
|
|
pageIndex: pagination.current,
|
|
|
pageSize: pagination.pageSize,
|
|
|
};
|
|
|
- const res = await getHydrology(params);
|
|
|
- if (res?.result) {
|
|
|
- const parsedResult = JSON.parse(res.result);
|
|
|
- tableData.value = parsedResult?.data || []; // 默认空数组防undefined
|
|
|
- pagination.total = parsedResult.total; // 更新总条数
|
|
|
+ const res = await getHydrology({ ...params });
|
|
|
+ if (res.success) {
|
|
|
+ tableData.value = res.data;
|
|
|
+ pagination.total = res.count;
|
|
|
}
|
|
|
}
|
|
|
onMounted(() => {
|