From ec763e1cb7dca873caf4afbc0dfde047b51753d3 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 17 十月 2025 17:26:54 +0800
Subject: [PATCH] 2025.10.17
---
src/views/underwaymix/UnderwayMixMode.vue | 150 ++++++++++++++++++-------------------------------
1 files changed, 56 insertions(+), 94 deletions(-)
diff --git a/src/views/underwaymix/UnderwayMixMode.vue b/src/views/underwaymix/UnderwayMixMode.vue
index 8c82db3..de55333 100644
--- a/src/views/underwaymix/UnderwayMixMode.vue
+++ b/src/views/underwaymix/UnderwayMixMode.vue
@@ -57,7 +57,7 @@
v-model="selectedPollutionDegree"
multiple
clearable
- placeholder="閫夋嫨鑳屾櫙"
+ placeholder="閫夋嫨姹℃煋鑳屾櫙"
size="small"
style="width: 300px"
>
@@ -128,13 +128,13 @@
prop="zone"
label="鍖哄煙"
align="center"
- width="50"
+ width="60"
/>
<el-table-column
prop="pollutionDegree"
label="姹℃煋鑳屾櫙"
align="center"
- width="70"
+ width="66"
/>
</el-table>
@@ -154,8 +154,17 @@
class="el-button-custom"
size="small"
@click="handleMixClick"
+ :disabled="selectedfusionData.length < 2"
>
{{ '铻嶅悎鍒嗘瀽' }}
+ </el-button>
+ <el-button
+ type="primary"
+ class="el-button-custom"
+ size="small"
+ @click="underwayMixDialogVisible = true"
+ >
+ {{ '铻嶅悎绠$悊' }}
</el-button>
<!-- <CheckButton
active-text="铻嶅悎鍒嗘瀽"
@@ -179,12 +188,21 @@
<!-- </el-row> -->
</el-col>
</el-row>
- <GridStyleTool
- :gridCtrls="gridCtrls"
- @show-underway="handleUnderwayClick"
- @on-delete="handleFusionDelete"
- ></GridStyleTool>
</el-row>
+ <GridStyleTool
+ class="style-tool"
+ :gridCtrls="gridCtrls"
+ @show-underway="handleUnderwayClick"
+ @on-delete="handleFusionDelete"
+ ></GridStyleTool>
+ <!-- <el-row class="m-t-2">
+ <FactorLegend class="m-t-2" @change="handleLegendTypeChange"></FactorLegend>
+ </el-row> -->
+ <UnderwayMixManage
+ :groupId="groupId"
+ v-model="underwayMixDialogVisible"
+ @onUpdated="fetchFusionData"
+ ></UnderwayMixManage>
<!-- </div> -->
</template>
@@ -193,12 +211,14 @@
import moment from 'moment';
import gridApi from '@/api/gridApi';
import { SatelliteGrid } from '@/model/SatelliteGrid';
-import GridStyleTool from './component/GridStyleTool.vue';
import { useGridStore } from '@/stores/grid-info';
import { TYPE0 } from '@/constant/device-type';
import { defaultOptions } from '@/constant/radio-options';
import { useMessageBox } from '@/composables/messageBox';
import { useCloned } from '@vueuse/core';
+
+import GridStyleTool from './component/GridStyleTool.vue';
+import UnderwayMixManage from './component/UnderwayMixManage.vue';
const gridStore = useGridStore();
@@ -209,7 +229,7 @@
const props = defineProps({
groupId: {
type: Number,
- default: 3
+ default: import.meta.env.VITE_DATA_MODE == 'jingan' ? 2 : 3
}
});
const show = ref(true);
@@ -217,14 +237,18 @@
// 鐩戞祴鍥犲瓙鐨勭被鍨嬬紪鍙�
const factorType = ref(defaultOptions(TYPE0));
satelliteGrid.setShowFactorType(toRaw(factorType.value));
+// const factor = computed(()=>{
+
+// })
function handleFactorTypeChange(e, item) {
factorType.value = item;
- console.log(toRaw(factorType.value));
+ // console.log(toRaw(factorType.value));
satelliteGrid.setShowFactorType(toRaw(factorType.value));
}
const mission = ref(undefined);
+const underwayMixDialogVisible = ref(false);
const gridCellList = ref(undefined);
const fusionData = ref(undefined);
@@ -392,38 +416,8 @@
.finally(() => (fusionLoading.value = false));
}
-// 妫�鏌ヨ蛋鑸暟鎹槸鍚﹀拰100绫崇綉鏍煎凡铻嶅悎
-// function checkUnderwayFusionResult() {
-// const time = moment(mission.value.startTime).format('YYYY-MM-DD HH:mm:ss');
-// gridApi.fetchGridData(props.groupId, time, 3).then((res) => {
-// if (res.data.length > 0) {
-// fusionData.value = res.data[0];
-// } else {
-// fusionData.value = undefined;
-// }
-// });
-// }
-
function prepareGrid(gridInfo) {
- satelliteGrid.gridPrepare(gridInfo, function (polygon) {
- // const originOption = polygon.getOptions();
- // //榧犳爣绉诲叆浜嬩欢
- // polygon.on('mouseover', () => {
- // polygon.setOptions({
- // //淇敼澶氳竟褰㈠睘鎬х殑鏂规硶
- // strokeWeight: 2,
- // strokeColor: 'red'
- // });
- // });
- // //榧犳爣绉诲嚭浜嬩欢
- // polygon.on('mouseout', () => {
- // // polygon.setOptions({
- // // strokeWeight: originOption.strokeWeight,
- // // strokeColor: originOption.strokeColor
- // // });
- // polygon.setOptions(originOption);
- // });
- });
+ satelliteGrid.gridPrepare(gridInfo);
}
watch(
@@ -461,7 +455,7 @@
tag: d.id,
data: gdd,
extData: {
- name: `璧拌埅缃戞牸 - ${d.mixDataId}`,
+ name: `璧拌埅缃戞牸 - ${d.missionCode}`,
type: 0
}
});
@@ -484,59 +478,17 @@
let mixTag;
function handleMixClick() {
- // mixActive.value = !mixActive.value;
const tags = selectedfusionData.value.map((v) => v.id);
satelliteGrid.changeVisibility({
showGridViews: false,
showDataTxt: false,
showRankTxt: false
});
- // if (mixActive.value) {
gridApi.mixUnderwayGridData(props.groupId, tags).then((res) => {
mixTag = satelliteGrid.mixGrid2({ tags, gridDataDetailList: res.data });
satelliteGrid.setDefaultGridClickEvent([mixTag]);
gridCtrls.value = [satelliteGrid];
});
-
- // satelliteGrid.setGridEvent([mixTag], 'click', (gridCell, gridDataDetail) => {
- // gridStore.selectedGridCellAndDataDetail = {
- // gridCell,
- // gridDataDetail
- // };
- // });
- // gridCtrls.value = [satelliteGrid];
- // } else {
- // satelliteGrid.changeVisibility({
- // tags,
- // showGridViews: true
- // });
- // }
-}
-
-let heatTag;
-const heatMapSearchLength = 4;
-function handleHeatMapClick() {
- heatActive.value = !heatActive.value;
- satelliteGrid.changeVisibility({
- showGridViews: false,
- showDataTxt: false,
- showRankTxt: false
- });
- if (heatActive.value) {
- const data = satelliteGrid.gridDataDetailMap.get(mixTag);
- gridApi
- .buildUnderwayHeatmap(props.groupId, data, heatMapSearchLength)
- .then((res) => {
- heatTag = satelliteGrid.drawHeatGrid2(mixTag, res.data);
- satelliteGrid.setDefaultGridClickEvent([heatTag]);
- gridCtrls.value = [satelliteGrid];
- });
- } else {
- satelliteGrid.changeVisibility({
- tags: [mixTag],
- showGridViews: true
- });
- }
}
function handleHeatMapSearchClick() {
@@ -564,7 +516,7 @@
} else {
const d = fusionDataList.value.find((v) => v.id == dataId);
const mission = missionStore.missionList.find((v) => {
- return v.missionCode == d.mixDataId;
+ return v.missionCode == d.missionCode;
});
mapLine.hideLine(mission.missionCode);
done();
@@ -573,14 +525,17 @@
function handleFusionDelete(index, tag) {
const f = selectedfusionData.value.find((v) => v.id == tag);
if (f) {
- // const i = selectedfusionData.value.indexOf(f);
- // selectedfusionData.value.splice(i, 1);
+ const i = selectedfusionData.value.indexOf(f);
+ selectedfusionData.value.splice(i, 1);
+ lastSelectedfusionData.value = useCloned(
+ selectedfusionData.value
+ ).cloned.value;
tableRef.value.toggleRowSelection(f, false);
}
}
function handleSelectionChange(val) {
- console.log(val);
+ // console.log(val);
const deleted = lastSelectedfusionData.value.filter((v) => {
return !val.find((t) => t.id == v.id);
@@ -590,7 +545,8 @@
return !lastSelectedfusionData.value.find((t) => t.id == v.id);
});
- if (val.length > 4) {
+ // 鍘婚櫎閫夋嫨涓婇檺璀﹀憡
+ if (false && val.length > 4) {
useMessageBox({
confirmMsg: '鏈�澶氬厑璁稿悓鏃跺睍绀�4娆¤蛋鑸褰�',
confirmTitle: '璧拌埅璁板綍閫夋嫨杩囧璀﹀憡'
@@ -616,7 +572,7 @@
tag: d.id,
data: gdd,
extData: {
- name: `璧拌埅缃戞牸 - ${d.mixDataId}`,
+ name: `璧拌埅缃戞牸 - ${d.missionCode}`,
type: 0
}
});
@@ -640,7 +596,7 @@
tag: d.id,
data: gdd,
extData: {
- name: `璧拌埅缃戞牸 - ${d.mixDataId}`,
+ name: `璧拌埅缃戞牸 - ${d.missionCode}`,
type: 0
}
});
@@ -660,7 +616,7 @@
}
});
- lastSelectedfusionData.value = useCloned(val).cloned.value
+ lastSelectedfusionData.value = useCloned(val).cloned.value;
selectedfusionData.value = val;
}
@@ -717,7 +673,7 @@
if (isUnmounted.value) return Promise.resolve();
const d = fusionDataList.value.find((v) => v.id == dataId);
const mission = missionStore.missionList.find((v) => {
- return v.missionCode == d.mixDataId;
+ return v.missionCode == d.missionCode;
});
if (factorDataMap.has(mission.missionCode)) {
@@ -745,6 +701,12 @@
}
</script>
<style scoped>
+.style-tool {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
:deep(.el-table) {
--el-table-bg-color: transparent;
--el-table-row-hover-bg-color: var(--select_color);
--
Gitblit v1.9.3