@@ -80,7 +80,7 @@
@@ -108,31 +108,31 @@ const mapChartRef = ref
(null);
const indicators = ref([
{
id: '1',
- name: '在建项目',
+ name: '光伏项目',
value: '28',
unit: '个',
iconPath: '/assets/demo/beUnder.png'
},
{
id: '2',
- name: '合同总额',
+ name: '风电项目',
value: '288.88',
- unit: '亿元',
- iconPath: '/assets/demo/contract.png'
+ unit: '个',
+ iconPath: '/src/assets/images/contract.png'
},
{
id: '3',
- name: '总容量',
+ name: '光伏系统总容量',
value: '158.88',
- unit: '个',
- iconPath: '/assets/demo/totalCapacity.png'
+ unit: 'MW',
+ iconPath: '/src/assets/images/totalCapacity.png'
},
{
id: '4',
- name: '今日施工',
+ name: '风电项目总容量',
value: '18',
- unit: '个',
- iconPath: '/assets/demo/todayConstruction.png'
+ unit: 'MW',
+ iconPath: '/src/assets/images/todayConstruction.png'
}
]);
@@ -255,7 +255,7 @@ const scrollToProject = (index: number) => {
// 计算滚动条应该移动到的位置
// 确保当前项目居中显示
const totalProjects = projectAttendanceData.value.length;
- const visiblePercentage = 15; // 与dataZoom的end值保持一致
+ const visiblePercentage = 20; // 与dataZoom的end值保持一致
const itemPercentage = 100 / totalProjects; // 每个项目所占总宽度的百分比
// 计算新的start值,使当前项目尽量居中显示
@@ -273,28 +273,6 @@ const scrollToProject = (index: number) => {
}
};
-/**
- * 开始自动滚动
- */
-const startScroll = () => {
- if (scrollInterval.value) return;
-
- scrollInterval.value = window.setInterval(() => {
- currentScrollIndex.value++;
- scrollToProject(currentScrollIndex.value);
- }, scrollSpeed);
-};
-
-/**
- * 停止自动滚动
- */
-const stopScroll = () => {
- if (scrollInterval.value) {
- clearInterval(scrollInterval.value);
- scrollInterval.value = null;
- }
-};
-
/**
* 获取项目出勤率统计数据 - 保持项目出勤率图表功能
*/
@@ -367,10 +345,10 @@ const getKeyIndexData = async () => {
const { data, code } = res;
if (code === 200) {
// 更新指标数据,使用接口返回的指定字段
- indicators.value[0].value = data.ongoingProject || 0;
- indicators.value[1].value = data.totalContractAmount || 0;
- indicators.value[2].value = data.totalCapacity || 0;
- indicators.value[3].value = data.todayProject || 0;
+ indicators.value[0].value = data.photovoltaicCount || 0;
+ indicators.value[1].value = data.windElectricityCount || 0;
+ indicators.value[2].value = data.photovoltaicTotalCapacity || 0;
+ indicators.value[3].value = data.windElectricityTotalCapacity || 0;
}
};
@@ -593,17 +571,9 @@ const initAttendanceChart = () => {
attendanceChart.setOption(option);
- // 添加鼠标悬浮事件监听
+ // 移除自动滚动功能,保留其他事件监听
if (attendanceChartRef.value) {
- // 鼠标进入图表区域时停止滚动
- attendanceChartRef.value.addEventListener('mouseenter', () => {
- stopScroll();
- });
-
- // 鼠标离开图表区域时重新开始滚动
- attendanceChartRef.value.addEventListener('mouseleave', () => {
- startScroll();
- });
+ // 保留其他可能需要的事件监听器
}
// 添加窗口大小变化时的图表更新
@@ -619,11 +589,7 @@ const initAttendanceChart = () => {
onUnmounted(() => {
window.removeEventListener('resize', handleResize);
- // 移除鼠标事件监听
- if (attendanceChartRef.value) {
- attendanceChartRef.value.removeEventListener('mouseenter', stopScroll);
- attendanceChartRef.value.removeEventListener('mouseleave', startScroll);
- }
+ // 移除鼠标事件监听(已在上面移除添加的事件监听)
});
};
@@ -652,9 +618,6 @@ onMounted(async () => {
// 再初始化图表
initAttendanceChart();
-
- // 图表初始化后自动开始滚动
- startScroll();
});
onUnmounted(() => {
@@ -667,9 +630,6 @@ onUnmounted(() => {
attendanceChart.dispose();
attendanceChart = null;
}
-
- // 清理滚动计时器
- stopScroll();
});
@@ -879,10 +839,8 @@ onUnmounted(() => {
text-shadow: 0px 1.24px 6.21px rgba(0, 200, 83, 0.5);
}
-/* 点阵地图样式 */
.people_map {
width: 100%;
- height: 120px;
margin-top: 8px;
background: rgba(10, 24, 45, 0.5);
border: 1px solid rgba(29, 214, 255, 0.1);
diff --git a/src/views/equipment/equipmentGPS.vue b/src/views/equipment/equipmentGPS.vue
index f5ad8ff..dec63bf 100644
--- a/src/views/equipment/equipmentGPS.vue
+++ b/src/views/equipment/equipmentGPS.vue
@@ -71,15 +71,17 @@ let data = [
const getTrajectoryData = async () => {
try {
// 从URL参数中获取clientId、projectId和userId
- const { clientId, projectId, userId } = route.query;
+ const { clientId, projectId, userId, gpsType } = route.query;
- if (!clientId || !projectId || !userId) {
+ if (!projectId || !userId || !gpsType) {
ElMessage.warning('缺少必要参数,请检查传入的参数');
return;
}
loading.value = true;
- const res = await getFootNote({ clientId, projectId, userId });
+ // 确保gpsType转换为数字类型,以便正确传递给后端
+ const gpsTypeNum = parseInt(gpsType, 10);
+ const res = await getFootNote({ clientId, projectId, userId, gpsType: gpsTypeNum });
if (res && res.code === 200 && res.data && res.data.length > 0) {
data = res.data;
diff --git a/src/views/equipment/index.vue b/src/views/equipment/index.vue
index 786b163..0c76152 100644
--- a/src/views/equipment/index.vue
+++ b/src/views/equipment/index.vue
@@ -22,7 +22,7 @@
-
+
修改
- {{ viewAllButtonText }}
+
+ {{ currentGpsType === 0 ? '显示用户数据' : '显示设备数据' }}
+
+
+
+ {{ viewAllButtonText }}
@@ -102,7 +107,7 @@
type="primary"
icon="Location"
v-hasPermi="['gps:equipmentSon:getList']"
- @click="handleGoToEmptyPage(scope.row.userId, scope.row.projectId, scope.row.clientId)"
+ @click="handleGoToEmptyPage(scope.row.userId, scope.row.projectId, scope.row.clientId, scope.row.gpsType)"
:disabled="!scope.row.userId || !scope.row.projectId"
>
@@ -189,7 +194,7 @@
type="primary"
icon="Location"
v-hasPermi="['gps:equipmentSon:getList']"
- @click="handleGoToEmptyPage(scope.row.userId, scope.row.projectId, currentHistoryClientId)"
+ @click="handleGoToEmptyPage(scope.row.userId, scope.row.projectId, currentHistoryClientId, currentGpsType)"
>
@@ -301,6 +306,9 @@ const initFormData: EquipmentForm = {
remark: undefined
};
+// 当前GPS类型 (0:设备数据, 1:用户数据)
+const currentGpsType = ref(0);
+
// 页面数据
const data = reactive>({
form: { ...initFormData },
@@ -317,6 +325,7 @@ const data = reactive>({
creationTime: undefined,
lastAccessedTime: undefined,
registered: undefined,
+ gpsType: 0, // 默认显示设备数据
params: {}
},
rules: {
@@ -385,6 +394,15 @@ const formatDateTime = (timestamp: any): string => {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
+/** 切换GPS数据类型 */
+const toggleGpsType = () => {
+ currentGpsType.value = currentGpsType.value === 0 ? 1 : 0;
+ queryParams.value.gpsType = currentGpsType.value;
+ queryParams.value.pageNum = 1;
+ getList();
+ proxy?.$modal.msgSuccess(`已切换到${currentGpsType.value === 0 ? '设备数据' : '用户数据'}模式`);
+};
+
/** 获取设备列表 */
const getList = async () => {
loading.value = true;
@@ -397,6 +415,9 @@ const getList = async () => {
queryParams.value.projectId = undefined;
}
+ // 确保gpsType参数正确设置
+ queryParams.value.gpsType = currentGpsType.value;
+
const res = await listEquipment(queryParams.value);
equipmentList.value = res.rows as ExtendedEquipmentVO[];
total.value = res.total;
@@ -490,16 +511,24 @@ const handleViewAll = () => {
getList();
};
-const handleGoToEmptyPage = (userId: any, projectId: any, clientId: any) => {
- console.log('userId:', userId, 'projectId:', projectId, 'clientId:', clientId);
+const handleGoToEmptyPage = (userId: any, projectId: any, clientId: any, gpsType: number) => {
+ console.log('userId:', userId, 'projectId:', projectId, 'clientId:', clientId, 'gpsType:', gpsType);
+
+ const queryParams: any = {
+ userId: userId,
+ projectId: projectId,
+ gpsType: gpsType,
+ clientId: clientId
+ };
+
+ // 当gpsType为0时传入clientId,为1时不传入
+ if (gpsType === 1 && clientId) {
+ queryParams.clientId = '';
+ }
router.push({
path: './equipmentGPS',
- query: {
- userId: userId,
- projectId: projectId,
- clientId: clientId
- }
+ query: queryParams
});
};
diff --git a/src/views/gis2D/index2.vue b/src/views/gis2D/index2.vue
deleted file mode 100644
index 9a0f449..0000000
--- a/src/views/gis2D/index2.vue
+++ /dev/null
@@ -1,628 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/largeScreen/index.vue b/src/views/largeScreen/index.vue
index 43428c8..8672163 100644
--- a/src/views/largeScreen/index.vue
+++ b/src/views/largeScreen/index.vue
@@ -1,4 +1,4 @@
-ID
+
@@ -21,7 +21,6 @@ import leftPage from './components/leftPage.vue';
import centerPage from './components/centerPage.vue';
import rightPage from './components/rightPage.vue';
// import '@/assets/styles/element.scss';
-