JINGYJ 2 months ago
commit 2a00c4d689

@ -17,8 +17,25 @@
// )
);
/* 引入 Element Plus 样式 */
@use "element-plus/theme-chalk/src/index.scss" as *;
.el-button.is-text:not(.is-disabled):hover {
background-color: transparent;
}
.el-button.is-text:not(.is-disabled):hover {
background-color: transparent;
}
.el-button:hover {
color: white;
background-color: transparent;
outline: none;
}
/* 表格 */
.ds_table {
position: relative;

@ -6,34 +6,21 @@
// .appearance-monitor-right {
// display: flex;
// }
.pagination-container {
margin-top: 20px;
.appearance-monitor-search-box {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 12px;
margin: 16px 0;
}
:deep(.el-pagination__total) {
color: #606266;
margin-right: 10px;
.right-panel{
.el-scrollbar__view {
background: transparent !important;
height: 600px;
}
:deep(.el-pagination__sizes .el-select__inner) {
background: #002a5c;
color: white;
border: 1px solid #409eff;
}
:deep(.el-pagination__item),
:deep(.el-pagination__button) {
background: #002a5c;
color: white;
border: 1px solid #409eff;
margin-right: 5px;
}
:deep(.el-pagination__item.is-active) {
background: #409eff;
color: white;
}
.appearance-monitor-left {
.monitor-left-top {
box-sizing: border-box;

@ -6,25 +6,11 @@
<video src=""></video>
</div>
<div class="monitor-left-bottom">
<swiper
ref="swiperRef"
:modules="modules"
:slides-per-view="4"
:space-between="10"
navigation
:scrollbar="{ draggable: false }"
:centered-slides="false"
:observer="true"
:observeParents="true"
@swiper="onSwiper"
@slideChange="onSlideChange"
>
<swiper-slide
v-for="(image, index) in images"
:key="index"
@click="handleSlideClick(index)"
:class="{ 'active-slide': activeIndex === index }"
>
<swiper ref="swiperRef" :modules="modules" :slides-per-view="4" :space-between="10" navigation
:scrollbar="{ draggable: false }" :centered-slides="false" :observer="true" :observeParents="true"
@swiper="onSwiper" @slideChange="onSlideChange">
<swiper-slide v-for="(image, index) in images" :key="index" @click="handleSlideClick(index)"
:class="{ 'active-slide': activeIndex === index }">
<img :src="image" alt="Slide" />
</swiper-slide>
</swiper>
@ -42,57 +28,48 @@
</ContentHeader>
</div>
<!-- 表格区域 -->
<el-table
:data="tableData"
stripe
style="width: 100%; margin-top: 20px"
class="custom-table"
>
<el-table-column prop="carNo" label="车号" width="80"></el-table-column>
<el-table-column
prop="carType"
label="车型"
width="60"
></el-table-column>
<el-table-column
prop="carriageNo"
label="车厢号"
width="80"
></el-table-column>
<el-table-column
prop="warnType"
label="告警类型"
width="80"
></el-table-column>
<el-table-column
prop="faultType"
label="故障类型"
width="120"
></el-table-column>
<el-table-column prop="level" label="等级" width="60"></el-table-column>
<el-table-column
prop="review"
label="复核"
width="60"
></el-table-column>
<el-table-column prop="time" label="时间" width="120"></el-table-column>
</el-table>
<!-- 搜索区域 -->
<div class="px-[16px]">
<!-- 分页区域 -->
<div class="pagination-container">
<el-pagination
:page-sizes="[100, 200, 300, 400]"
layout="total, sizes, prev, pager, next, jumper"
:total="400"
/>
<div class="appearance-monitor-search-box">
<el-select v-model="searchForm.name" placeholder="列车号" class="custom-select">
<el-option label="A" value="deviceA"></el-option>
<el-option label="B" value="deviceB"></el-option>
</el-select>
<el-select v-model="searchForm.deviceId" placeholder="车厢号" class="custom-select">
<el-option label="ID-001" value="id001"></el-option>
<el-option label="ID-002" value="id002"></el-option>
</el-select>
<el-select v-model="searchForm.faultType" placeholder="故障类型" class="custom-select">
<el-option label="类型1" value="id001"></el-option>
<el-option label="类型2" value="id002"></el-option>
</el-select>
<el-button type="primary" @click="handleQuery" class="basic-btn query-btn">
<span class="icon"></span> 查询
</el-button>
<el-button @click="handleReset" class="basic-btn reset-btn">
<span class="icon"></span> 重置
</el-button>
</div>
<!-- 右侧表格区域 -->
<div class="right-panel w-[768px]">
<div class="bg-transparent baseTable_wrap">
<template v-if="pagination.total > 0">
<BaseTable class="bg-transparent baseTable_box" :total="pagination.total" :pageSize="pagination.pageSize"
:dataSource="listData" :isFixedPagination="true" :columns="columns" :page="pagination.currentPage"
@change="handleTableChange">
</BaseTable>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import ContentHeader from "@/components/ContentHeader.vue";
import { computed, onMounted, onUnmounted, ref } from "vue";
import { BaseTable } from "@/components/CustomTable";
import { Swiper, SwiperSlide } from "swiper/vue";
import { Navigation, Scrollbar } from "swiper/modules";
import "swiper/css";
@ -100,58 +77,100 @@ import 'swiper/scss';
import 'swiper/scss/navigation';
const modules = [Navigation, Scrollbar];
//
const searchForm = ref({
trainNo: "all",
carriageNo: "all",
faultType: "all",
});
//
const tableData = ref([
// const currentRow = ref<Record<string, any>>({});
const columns = [
{
carNo: "CA1001",
carType: "C64",
carriageNo: "101",
warnType: "车辆损坏",
faultType: "搭扣未搭",
level: "1",
review: "是",
time: "2025-02-05 14:33",
label: "车号",
property: "carNo",
width: 80,
},
{
carNo: "CA1002",
carType: "C64",
carriageNo: "101",
warnType: "车辆损坏",
faultType: "搭扣未搭",
level: "1",
review: "是",
time: "2025-02-12 15:33",
label: "车型",
property: "carType",
width: 80,
},
// ...
]);
{
label: "车厢号",
property: "carriageNo",
width: 80,
},
{
label: "告警类型",
property: "warnType",
width: 120,
},
{
label: "故障类型",
property: "faultType",
width: 120,
},
{
label: "等级",
property: "level",
width: 60,
},
{
label: "复核",
property: "review",
width: 60,
},
{
label: "时间",
property: "date"
}
]
const total = ref(66);
const pagination = ref({ currentPage: 1, pageSize: 10, total: 0 });
//
const handleSearch = () => {
console.log("搜索参数", searchForm.value);
const listData = ref([]);
//
const searchForm = reactive({
trainNo: "",
carriageNo: "",
faultType: "",
});
const dataLoading = ref(true);
const getList = async () => {
const { currentPage, pageSize } = pagination.value;
const res = await fetch('/api/getPoleMonitorList', {
method: 'POST',
body: JSON.stringify({ ...searchForm, page: currentPage, pageSize })
})
const { data } = await res.json()
console.log(data, 'getList_data')
listData.value = data.list;
console.log(data.list);
pagination.value = {
...pagination.value,
total: data.total
};
dataLoading.value = false;
};
//
const handleQuery = () => {
getList()
};
//
const handleReset = () => {
searchForm.value = {
trainNo: "all",
carriageNo: "all",
faultType: "all",
};
searchForm.trainNo = '';
// deviceId.value = '';
getList()
};
//
const handlePageChange = (page) => {
console.log("当前页码", page);
};
function handleTableChange(record) {
console.log("handleTableChange_record", record);
pagination.value = {
...pagination.value,
currentPage: record.page,
pageSize: record.pageSize
};
getList();
}
const images = ref([
'https://picsum.photos/300/200?random=1',
'https://picsum.photos/300/200?random=2',
@ -176,6 +195,10 @@ const onSwiper = (swiper) => {
const onSlideChange = () => {
console.log("slide change");
};
onMounted(() => {
getList();
});
// // Swiper
// const handleResize = () => {
// if (swiperRef.value) {

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2025-03-06 15:15:01
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2025-03-12 11:43:32
* @LastEditTime: 2025-03-12 13:30:24
* @FilePath: \vite-ai\data-dashboard\src\views\dashboard\PoleMonitor.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -21,15 +21,15 @@
</div>
<!-- 搜索区域 -->
<div class="pole-monitor-search-box">
<el-select v-model="formData.name" placeholder="列车号" class="custom-select">
<el-select v-model="searchForm.name" placeholder="列车号" class="custom-select">
<el-option label="A" value="deviceA"></el-option>
<el-option label="B" value="deviceB"></el-option>
</el-select>
<el-select v-model="formData.deviceId" placeholder="车厢号" class="custom-select">
<el-select v-model="searchForm.deviceId" placeholder="车厢号" class="custom-select">
<el-option label="ID-001" value="id001"></el-option>
<el-option label="ID-002" value="id002"></el-option>
</el-select>
<el-select v-model="formData.faultType" placeholder="故障类型" class="custom-select">
<el-select v-model="searchForm.faultType" placeholder="故障类型" class="custom-select">
<el-option label="类型1" value="id001"></el-option>
<el-option label="类型2" value="id002"></el-option>
</el-select>
@ -91,12 +91,6 @@ defineOptions({
name: "PoleMonitorIndex"
});
const modules = [Navigation, Scrollbar];
//
const searchForm = ref({
trainNo: 'all',
carriageNo: 'all',
faultType: 'all'
});
const images = ref([
'https://picsum.photos/300/200?random=1',
'https://picsum.photos/300/200?random=2',
@ -119,7 +113,7 @@ const onSlideChange = () => {
console.log("slide change");
};
const currentRow = ref<Record<string, any>>({});
// const currentRow = ref<Record<string, any>>({});
const columns = [
{
label: "车号",
@ -167,7 +161,7 @@ const pagination = ref({ currentPage: 1, pageSize: 10, total: 0 });
const listData = ref([]);
const formData = reactive({
const searchForm = reactive({
name: "",
status: "",
faultType: "",
@ -179,7 +173,7 @@ const getList = async () => {
const { currentPage, pageSize } = pagination.value;
const res = await fetch('/api/getPoleMonitorList', {
method: 'POST',
body: JSON.stringify({ ...formData, page: currentPage, pageSize })
body: JSON.stringify({ ...searchForm, page: currentPage, pageSize })
})
const { data } = await res.json()
console.log(data, 'getList_data')
@ -199,8 +193,9 @@ const handleQuery = () => {
//
const handleReset = () => {
formData.name = '';
searchForm.name = '';
// deviceId.value = '';
getList()
};
function handleTableChange(record) {

Loading…
Cancel
Save