-
-
- 国省道:
- {{ nationalRoadMileage }}km
-
-
-
-
农村公路:
-
{{ ruralRoadMileage }}km
+
+
+
+ {{ item.name }}
+ {{ item.value }}
+
@@ -58,6 +65,12 @@
import { ref, watch } from 'vue';
import BaseDialog from '../component/baseDialog.vue';
import { request } from '@/utils/request';
+import selectedIcon from '../../../assets/xiangying/选中bg@2x.png';
+import unselectedIcon from '../../../assets/xiangying/未选中bg@2x.png';
+
+// 引入图标
+import IconNational from '../../../assets/xiangying/国省道icon.png';
+import IconRuralRoad from '../../../assets/xiangying/农村公路icon.png';
const props = defineProps({
visible: {
@@ -72,6 +85,23 @@ const emit = defineEmits(['update:visible', 'close']);
const nationalRoadMileage = ref(345);
const ruralRoadMileage = ref(4333);
+// 里程数据
+const mileageData = ref([
+ { name: '国省道', value: 345, icon: IconNational, type: 'national' },
+ { name: '农村公路', value: 4333, icon: IconRuralRoad, type: 'rural' },
+]);
+
+// 当前选中卡片类型
+const cardType = ref('0');
+
+// 点击卡片
+const handleClick = (index, item) => {
+ cardType.value = index + '';
+ // 可以在这里添加筛选逻辑
+ currentPage.value = 1;
+ fetchData();
+};
+
// 筛选表单
const filterForm = ref({
district: '',
@@ -157,8 +187,13 @@ const fetchStatsData = async () => {
});
if (res.code === '00000' && res.data) {
- nationalRoadMileage.value = res.data.nationalRoadMileage || 345;
- ruralRoadMileage.value = res.data.ruralRoadMileage || 4333;
+ const nationalVal = res.data.nationalRoadMileage || 345;
+ const ruralVal = res.data.ruralRoadMileage || 4333;
+ nationalRoadMileage.value = nationalVal;
+ ruralRoadMileage.value = ruralVal;
+ // 同步更新 mileageData
+ mileageData.value[0].value = nationalVal;
+ mileageData.value[1].value = ruralVal;
}
} catch (error) {
console.error('获取巡查里程统计数据失败:', error);
@@ -212,43 +247,47 @@ watch(
.stats-cards {
display: flex;
gap: 16px;
+ width: 700px;
margin-bottom: 16px;
padding: 0 4px;
- .stats-card {
+
+ .stat-card {
display: flex;
+ flex: 1;
align-items: center;
gap: 8px;
padding: 10px 16px;
- background: linear-gradient(135deg, rgba(64, 169, 255, 0.15) 0%, rgba(24, 144, 255, 0.1) 100%);
- border: 1px solid rgba(64, 169, 255, 0.3);
- border-radius: 6px;
+ cursor: pointer;
+ transition: all 0.3s ease;
- .stats-icon {
- width: 20px;
- height: 20px;
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
+ .stat-icon {
+ width: 32px;
+ height: 32px;
- &.road-icon {
- background-image: url('data:image/svg+xml;utf8,
');
- }
-
- &.rural-icon {
- background-image: url('data:image/svg+xml;utf8,
');
+ img {
+ width: 100%;
+ height: 100%;
+ object-fit: contain;
}
}
- .stats-label {
- font-size: 14px;
- color: rgba(255, 255, 255, 0.8);
- }
+ .stat-content {
+ display: flex;
+ align-items: center;
+ gap: 4px;
- .stats-value {
- font-size: 16px;
- font-weight: 600;
- color: #40a9ff;
+ .stat-label {
+ margin-right: 10px;
+ font-size: 14px;
+ color: rgba(255, 255, 255, 0.8);
+ }
+
+ .stat-value {
+ font-size: 16px;
+ font-weight: 600;
+ color: #40a9ff;
+ }
}
}
}
diff --git a/packages/screen/src/views/RiskWarning/component/baseDialog.vue b/packages/screen/src/views/RiskWarning/component/baseDialog.vue
index 1a75d68..8e93913 100644
--- a/packages/screen/src/views/RiskWarning/component/baseDialog.vue
+++ b/packages/screen/src/views/RiskWarning/component/baseDialog.vue
@@ -216,8 +216,9 @@ const headerCellStyle = () => {
const cellStyle = () => {
return {
- backgroundColor: '#16334E',
+ backgroundColor: '#17375E',
color: 'rgba(255, 255, 255, 0.85)',
+ borderBottom: '2px solid #142D47',
fontSize: '13px',
textAlign: 'center',
padding: '5px 0px',
@@ -243,7 +244,7 @@ const cellStyle = () => {
}
.base-dialog {
- // width: 80vw;
+ min-width: 600px;
max-height: 80vh;
position: relative;
background: #16334e;
diff --git a/packages/screen/src/views/RiskWarning/component/index.js b/packages/screen/src/views/RiskWarning/component/index.js
index fd5d133..ac37a80 100644
--- a/packages/screen/src/views/RiskWarning/component/index.js
+++ b/packages/screen/src/views/RiskWarning/component/index.js
@@ -120,8 +120,10 @@ export const pointTypeOptions = [
// 影响点等级选项
export const pointLevelOptions = [
{ label: '全部', value: '' },
- { label: '一般隐患', value: 'normal' },
- { label: '重大隐患', value: 'serious' },
+ { label: '低风险', value: '低风险' },
+ { label: '中风险', value: '中风险' },
+ { label: '较高风险', value: '较高风险' },
+ { label: '高风险', value: '高风险' },
];
// 是否回应选项
diff --git a/packages/screen/src/views/RiskWarning/index.vue b/packages/screen/src/views/RiskWarning/index.vue
index d718454..b3e3eb6 100644
--- a/packages/screen/src/views/RiskWarning/index.vue
+++ b/packages/screen/src/views/RiskWarning/index.vue
@@ -48,6 +48,9 @@
@openClearanceSituation="openDialog('clearanceSituation')"
@openControlSituation="openDialog('controlSituation')"
@update:dateRange="updateDateRange"
+ @openPatrolMileage="openDialog('patrolMileage')"
+ @openPatrolSituation="openDialog('patrolSituation')"
+ @update:filterForm="updateFilterForm"
>
@@ -197,6 +200,7 @@