| | |
| | | }); |
| | | }, |
| | | |
| | | mixUnderwayGridData(groupId, dataIdList) { |
| | | return $http |
| | | .post(`air/satellite/product/underway/mix`, dataIdList, { |
| | | params: { |
| | | groupId |
| | | } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | buildUnderwayHeatmap(groupId, gridDataDetailList, searchLength) { |
| | | return $http |
| | | .post( |
| | |
| | | { |
| | | params: { |
| | | groupId: groupId, |
| | | searchLength: 4 |
| | | searchLength: searchLength |
| | | } |
| | | } |
| | | ) |
| | |
| | | import axios from 'axios'; |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | const debug = false; |
| | | const debug = true; |
| | | |
| | | let ip1 = 'http://47.100.191.150:9029/'; |
| | | // console.log(import.meta.env); |
| | |
| | | } |
| | | |
| | | if (debug) { |
| | | // ip1 = 'http://192.168.0.110:8084/'; |
| | | ip1 = 'http://locahost:8084/'; |
| | | ip1 = 'http://192.168.0.110:8084/'; |
| | | // ip1 = 'http://locahost:8084/'; |
| | | } |
| | | |
| | | const $http = axios.create({ |
| | |
| | | CoreMenu: typeof import('./components/core/CoreMenu.vue')['default'] |
| | | DataSummary: typeof import('./components/monitor/DataSummary.vue')['default'] |
| | | DataTable: typeof import('./components/monitor/DataTable.vue')['default'] |
| | | DescriptionsList: typeof import('./components/list/DescriptionsList.vue')['default'] |
| | | DescriptionsListItem: typeof import('./components/list/DescriptionsListItem.vue')['default'] |
| | | DeviceCreate: typeof import('./components/device/DeviceCreate.vue')['default'] |
| | | DeviceManage: typeof import('./components/device/DeviceManage.vue')['default'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | |
| | | ElSwitch: typeof import('element-plus/es')['ElSwitch'] |
| | | ElTable: typeof import('element-plus/es')['ElTable'] |
| | | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
| | | ElTabPane: typeof import('element-plus/es')['ElTabPane'] |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | FactorCheckbox: typeof import('./components/monitor/FactorCheckbox.vue')['default'] |
| | | FactorLegend: typeof import('./components/monitor/FactorLegend.vue')['default'] |
| | |
| | | {{ checkValue ? activeText : inactiveText }} |
| | | </el-button> --> |
| | | <el-checkbox |
| | | v-model="checkValue" |
| | | ref="checkboxRef" |
| | | :disabled="loading" |
| | | :model-value="modelValue" |
| | | @update:model-value="(e) => emits('update:modelValue', e)" |
| | | @change="handleChange" |
| | | border |
| | | size="small" |
| | | >{{ activeText }}</el-checkbox |
| | | > |
| | | <template #default> |
| | | <el-space> |
| | | <el-icon v-if="loading" class="is-loading" color="#00fff2"><Loading /></el-icon> |
| | | {{ activeText }} |
| | | </el-space> |
| | | </template> |
| | | </el-checkbox> |
| | | </template> |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted, watch } from 'vue'; |
| | | // import $ from 'jquery'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { |
| | | type: Boolean |
| | | }, |
| | | loading: { |
| | | type: Boolean |
| | | }, |
| | | defaultValue: { |
| | | type: Boolean |
| | | }, |
| | |
| | | } |
| | | }); |
| | | |
| | | const emits = defineEmits(['change']); |
| | | const emits = defineEmits(['change', 'update:modelValue']); |
| | | |
| | | const checkboxRef = ref(); |
| | | const checkValue = ref(false); |
| | | |
| | | watch( |
| | |
| | | { immediate: true } |
| | | ); |
| | | |
| | | watch( |
| | | () => props.loading, |
| | | (nV, oV) => { |
| | | if (nV != oV) { |
| | | // setTimeout(() => { |
| | | // const e1 = checkboxRef.value.$el.querySelector('.el-checkbox__input'); |
| | | // console.log(e1); |
| | | |
| | | // // e1.classList.toggle('is-disabled'); |
| | | // e1.classList.toggle('checkbox__input_none'); |
| | | // const e2 = checkboxRef.value.$el.querySelector('.el-checkbox__label'); |
| | | // console.log(e2); |
| | | // e2.classList.toggle('checkbox__label_nopadding'); |
| | | // }, 500); |
| | | |
| | | // if (props.id) { |
| | | // console.log( |
| | | // checkboxRef.value.$el.querySelector('.el-checkbox__input').classList |
| | | // ); |
| | | // console.log( |
| | | // checkboxRef.value.$el.querySelector('.el-checkbox__label').classList |
| | | // ); |
| | | // } |
| | | } |
| | | } |
| | | ); |
| | | |
| | | onMounted(() => { |
| | | if (props.id) { |
| | | console.log( |
| | | checkboxRef.value.$el.querySelector('.el-checkbox__input').classList |
| | | ); |
| | | console.log( |
| | | checkboxRef.value.$el.querySelector('.el-checkbox__label').classList |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | function handleChange(value) { |
| | | emits('change', value); |
| | | } |
| | |
| | | <style scoped> |
| | | .el-checkbox { |
| | | --el-checkbox-text-color: white; |
| | | /*--main-color: #00fff2;*/ |
| | | --main-color: #23dad1; |
| | | --el-checkbox-checked-text-color: var(--main-color); |
| | | --el-checkbox-checked-input-border-color: var(--main-color); |
| | |
| | | .el-checkbox__input.is-disabled + span.el-checkbox__label { |
| | | color: var(--el-color-primary); |
| | | } |
| | | |
| | | :deep(.checkbox__input_none) { |
| | | display: none !important; |
| | | } |
| | | |
| | | :deep(.checkbox__label_nopadding) { |
| | | padding-left: 0px; |
| | | } |
| | | </style> |
| | |
| | | width="300px" |
| | | > |
| | | <template #default> |
| | | <el-form |
| | | :inline="false" |
| | | ref="formRef" |
| | | label-position="right" |
| | | label-width="100px" |
| | | > |
| | | <el-form-item label="ç½æ ¼ç¼å·ï¼"> |
| | | <div> |
| | | {{ data.cellIndex }} |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="ç»çº¬åº¦ï¼"> |
| | | <div> |
| | | {{ data.longitude + ', ' + data.latitude }} |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="PM2.5ï¼"> |
| | | <div> |
| | | {{ data.pm25 + ' μg/m³' }} |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="åè³èå´ï¼"> |
| | | <div>/</div> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div v-if="data"> |
| | | <DescriptionsList> |
| | | <DescriptionsListItem |
| | | label="ç½æ ¼ç¼å·" |
| | | :content="data.gridCell.cellIndex" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="ç»çº¬åº¦" |
| | | :content="data.gridCell.longitude + ', ' + data.gridCell.latitude" |
| | | /> |
| | | <DescriptionsListItem label="åè³èå´" content="/" /> |
| | | </DescriptionsList> |
| | | |
| | | <el-tabs v-model="activeName" > |
| | | <el-tab-pane label="ç½æ ¼æ°æ®" name="first"> |
| | | <DescriptionsList> |
| | | <DescriptionsListItem |
| | | label="VOC" |
| | | :content="data.gridDataDetail.voc + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="H2S" |
| | | :content="data.gridDataDetail.h2s + ' μg/m³'" |
| | | /> |
| | | <!-- <DescriptionsListItem label="NO" :content="data.gridDataDetail.no + ' μg/m³'" /> --> |
| | | <DescriptionsListItem |
| | | label="NO2" |
| | | :content="data.gridDataDetail.no2 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="CO" |
| | | :content="data.gridDataDetail.co + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="SO2" |
| | | :content="data.gridDataDetail.so2 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="O3" |
| | | :content="data.gridDataDetail.o3 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="PM25" |
| | | :content="data.gridDataDetail.pm25 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="PM10" |
| | | :content="data.gridDataDetail.pm10 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="温度" |
| | | :content="data.gridDataDetail.temperature + ' â'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="湿度" |
| | | :content="data.gridDataDetail.humidity + ' %'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="é£é" |
| | | :content="data.gridDataDetail.windSpeed + ' m/s'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="é£å" |
| | | :content="data.gridDataDetail.windDirection + ' °'" |
| | | /> |
| | | </DescriptionsList> |
| | | </el-tab-pane> |
| | | <template v-if="data.gridDataDetail.mixData"> |
| | | <el-tab-pane |
| | | v-for="(d, i) in data.gridDataDetail.originDataList" |
| | | :key="i" |
| | | :label="d.dataId" |
| | | :name="`origin-${i}`" |
| | | > |
| | | <DescriptionsList> |
| | | <DescriptionsListItem label="VOC" :content="d.voc + ' μg/m³'" /> |
| | | <DescriptionsListItem label="H2S" :content="d.h2s + ' μg/m³'" /> |
| | | <!-- <DescriptionsListItem label="NO" :content="d.no + ' μg/m³'" /> --> |
| | | <DescriptionsListItem label="NO2" :content="d.no2 + ' μg/m³'" /> |
| | | <DescriptionsListItem label="CO" :content="d.co + ' μg/m³'" /> |
| | | <DescriptionsListItem label="SO2" :content="d.so2 + ' μg/m³'" /> |
| | | <DescriptionsListItem label="O3" :content="d.o3 + ' μg/m³'" /> |
| | | <DescriptionsListItem |
| | | label="PM25" |
| | | :content="d.pm25 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="PM10" |
| | | :content="d.pm10 + ' μg/m³'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="温度" |
| | | :content="d.temperature + ' â'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="湿度" |
| | | :content="d.humidity + ' %'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="é£é" |
| | | :content="d.windSpeed + ' m/s'" |
| | | /> |
| | | <DescriptionsListItem |
| | | label="é£å" |
| | | :content="d.windDirection + ' °'" |
| | | /> |
| | | </DescriptionsList> |
| | | </el-tab-pane> |
| | | </template> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | <template #footer> </template> |
| | | </CardDialog> |
| | |
| | | |
| | | const dialogVisible = ref(false); |
| | | |
| | | const activeName = ref('first'); |
| | | |
| | | const data = computed(() => { |
| | | if (gridStore.selectedGridCellAndDataDetail) { |
| | | // const { gridCell, gridDataDetail } = |
| | | // gridStore.selectedGridCellAndDataDetail; |
| | | // const res = []; |
| | | // // å¦æç½æ ¼æ°æ®ä¸ºèåæ°æ®ï¼åéè¦åæ¥å±ç¤ºåºåå§æ°æ® |
| | | // if (gridDataDetail.mixData) { |
| | | // } |
| | | return { |
| | | cellIndex: gridStore.selectedGridCellAndDataDetail.gridCell.cellIndex, |
| | | longitude: gridStore.selectedGridCellAndDataDetail.gridCell.longitude, |
| | | latitude: gridStore.selectedGridCellAndDataDetail.gridCell.latitude, |
| | | pm25: gridStore.selectedGridCellAndDataDetail.gridDataDetail.pm25 |
| | | gridCell: gridStore.selectedGridCellAndDataDetail.gridCell, |
| | | gridDataDetail: gridStore.selectedGridCellAndDataDetail.gridDataDetail, |
| | | extData: gridStore.selectedGridCellAndDataDetail.extData |
| | | }; |
| | | // console.log(gridStore.selectedGridCellAndDataDetail); |
| | | |
| | | // return undefined; |
| | | // return gridStore.selectedGridCellAndDataDetail; |
| | | } else { |
| | | return { |
| | | cellIndex: '/', |
| | | longitude: '/', |
| | | latitude: '/', |
| | | pm25: '/' |
| | | }; |
| | | return undefined; |
| | | } |
| | | }); |
| | | |
| | |
| | | { deep: true } |
| | | ); |
| | | </script> |
| | | <style scoped> |
| | | :deep(.el-tabs__item){ |
| | | color: rgba(221, 221, 221, 0.806); |
| | | } |
| | | :deep(.is-active){ |
| | | color: #f0ff1d; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="title-wrapper"> |
| | | <div v-if="title" class="fy-h2">{{ title }}</div> |
| | | <slot name="extra"></slot> |
| | | </div> |
| | | <table> |
| | | <tbody> |
| | | <slot></slot> |
| | | </tbody> |
| | | </table> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | title: String |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title-wrapper { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | table { |
| | | width: 100%; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <tr> |
| | | <td v-if="label" class="td-1">{{ label }}</td> |
| | | <td v-else class="td-1"><slot name="label"></slot></td> |
| | | <td v-if="content" class="td-2">{{ content }}</td> |
| | | <td v-else class="td-2"><slot name="content"></slot></td> |
| | | </tr> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | label: String, |
| | | content: String |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | tr { |
| | | font-size: var(--el-font-size-small); |
| | | } |
| | | td { |
| | | border: 1px solid rgba(255, 255, 255, 0.616); |
| | | padding: 2px 6px; |
| | | } |
| | | .td-1 { |
| | | width: 68px; |
| | | background-color: var(--bg-color-2); |
| | | color: white; |
| | | } |
| | | |
| | | .td-2 { |
| | | color: white; |
| | | /* background-color: var(--el-fill-color-light); */ |
| | | } |
| | | </style> |
| | |
| | | ', ' + |
| | | color[3] + |
| | | ')'; |
| | | const { scale = 1, unit = '' } = factorUnit[name]; |
| | | legendList.push({ |
| | | color: bgColor, |
| | | min: r[0], |
| | | max: nextR ? nextR[0] : undefined, |
| | | unit: factorUnit[name] ? factorUnit[name].unit : '' |
| | | min: r[0] * scale, |
| | | max: nextR ? nextR[0] * scale : undefined, |
| | | unit: unit |
| | | }); |
| | | } |
| | | |
| | |
| | | emits: ['change'], |
| | | data() { |
| | | return { |
| | | radio: defaultOptions(TYPE0) |
| | | radio: defaultOptions(TYPE0).value |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('change', value); |
| | | const item = this.options.find((v) => v.value == value); |
| | | this.$emit('change', item.value, item); |
| | | // todo å°å¾3då¾å忢å±ç¤ºçæµå å |
| | | } |
| | | } |
| | |
| | | ]; |
| | | |
| | | // é»è®¤é项 PM2.5 |
| | | export const default1 = option1[3].value; |
| | | export const default1 = option1[3]; |
| | |
| | | ]; |
| | | |
| | | // é»è®¤é项 PM2.5 |
| | | export const default1 = option1[5].value; |
| | | export const default1 = option1[5]; |
| | | |
| | | export const option2 = [ |
| | | { |
| | |
| | | ]; |
| | | |
| | | // é»è®¤é项 温度 |
| | | export const default2 = option2[0].value; |
| | | export const default2 = option2[0]; |
| | |
| | | import './assets/main.css'; |
| | | import './lib/jquery-3.5.1.min'; |
| | | // import './lib/jquery-3.5.1.min'; |
| | | |
| | | import { createApp } from 'vue'; |
| | | import { createPinia } from 'pinia'; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | function getGridDataDetailFactorValue(gdd, factorName) { |
| | | let value; |
| | | switch (factorName) { |
| | | case 'VOC': |
| | | value = gdd.voc; |
| | | break; |
| | | case 'H2S': |
| | | value = gdd.h2s; |
| | | break; |
| | | case 'NO': |
| | | value = gdd.no; |
| | | break; |
| | | case 'NO2': |
| | | value = gdd.no2; |
| | | break; |
| | | case 'CO': |
| | | value = gdd.co; |
| | | break; |
| | | case 'SO2': |
| | | value = gdd.so2; |
| | | break; |
| | | case 'O3': |
| | | value = gdd.o3; |
| | | break; |
| | | case 'PM25': |
| | | value = gdd.pm25; |
| | | break; |
| | | case 'PM10': |
| | | value = gdd.pm10; |
| | | break; |
| | | case 'TEMPERATURE': |
| | | value = gdd.temperature; |
| | | break; |
| | | case 'HUMIDITY': |
| | | value = gdd.humidity; |
| | | break; |
| | | case 'WIND_SPEED': |
| | | value = gdd.windSpeed; |
| | | break; |
| | | case 'WIND_DIRECTION': |
| | | value = gdd.windDirection; |
| | | break; |
| | | default: |
| | | value = gdd.pm25; |
| | | break; |
| | | } |
| | | return Math.round(value * 10) / 10; |
| | | } |
| | | |
| | | export { getGridDataDetailFactorValue }; |
| | |
| | | _legend_r: { |
| | | NO: [0, 100, 200, 700, 1200, 2340], |
| | | NO2: [0, 100, 200, 700, 1200, 2340], |
| | | CO: [0, 5, 10, 35, 60, 90], |
| | | CO: [0, 5000, 10000, 35000, 60000, 90000], |
| | | H2S: [0, 150, 500, 650, 800, 1600], |
| | | SO2: [0, 150, 500, 650, 800, 1600], |
| | | O3: [0, 160, 200, 300, 400, 800], |
| | |
| | | // } |
| | | // max = parseInt(key) |
| | | // } |
| | | if (name == 'CO') { |
| | | min *= 1000; |
| | | max *= 1000; |
| | | } |
| | | |
| | | return [min, max]; |
| | | }, |
| | |
| | | for (let i = 0; i < range.length; i++) { |
| | | const d = range[i]; |
| | | let d1 = d; |
| | | if (name == 'CO') { |
| | | d1 *= 1000; |
| | | } |
| | | if (data >= d1) { |
| | | selected = i; |
| | | } else { |
| | |
| | | for (let i = 0; i < range.length; i++) { |
| | | const d = range[i]; |
| | | let d1 = d; |
| | | if (name == 'CO') { |
| | | d1 *= 1000; |
| | | } |
| | | if (data >= d1) { |
| | | selected = i; |
| | | } else { |
| | |
| | | import calculate from '@/utils/map/calculate'; |
| | | import gridMapUtil from '@/utils/map/grid'; |
| | | import { map, onMapMounted } from '@/utils/map/index_old'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | import { getGridDataDetailFactorValue } from '@/model/GridDataDetail'; |
| | | import { useGridStore } from '@/stores/grid-info'; |
| | | |
| | | const gridStore = useGridStore(); |
| | | |
| | | /** |
| | | * 嫿饿µç½æ ¼ç®¡ç |
| | |
| | | constructor(name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | gridGroupId; |
| | | |
| | | // é»è®¤å°å¾ç½æ ¼ç¸å
³å¯¹è±¡ |
| | | mapViews; |
| | | |
| | |
| | | firstEvent; |
| | | |
| | | events = new Map(); |
| | | |
| | | selectedFactorType; |
| | | |
| | | setShowFactorType(e) { |
| | | this.selectedFactorType = e; |
| | | this.changeGridColor({ factorName: e.name }); |
| | | this.changeText({ factorName: e.name }); |
| | | } |
| | | |
| | | // ç»å¶åºå¿è¾¹ç |
| | | drawDistrict(districtName, isNew) { |
| | |
| | | const data = gridDataDetail.map((v, i) => { |
| | | return { |
| | | lnglat_GD: points[i], |
| | | // data: v.pm25 ? (v.pm25 + 'μg/m³') : '' |
| | | data: v.pm25 ? v.pm25 : '' |
| | | data: getGridDataDetailFactorValue(v, this.selectedFactorType.name) |
| | | }; |
| | | }); |
| | | // return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'bottom'); |
| | |
| | | anchor: 'top-center', |
| | | type: 'data', |
| | | isCustomColor, |
| | | useColor |
| | | useColor, |
| | | factorName: this.selectedFactorType.name |
| | | }); |
| | | } |
| | | |
| | | changeText({ tags = [], factorName, isCustomColor, useColor, type }) { |
| | | let { _mapViewsList, _gridDataDetailList } = this._getMapViews(...tags); |
| | | if (_mapViewsList.length == _gridDataDetailList.length) { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.dataTxt) { |
| | | let dataList = []; |
| | | if (type == 'data' || type == undefined) { |
| | | dataList.push({ |
| | | type: 'data', |
| | | data: _gridDataDetailList[i].map((v) => { |
| | | return { |
| | | data: getGridDataDetailFactorValue( |
| | | v, |
| | | factorName ? factorName : this.selectedFactorType.name |
| | | ) |
| | | }; |
| | | }) |
| | | }); |
| | | } |
| | | if (type == 'rank' || type == undefined) { |
| | | dataList.push({ |
| | | type: 'rank', |
| | | data: _gridDataDetailList[i].map((v) => { |
| | | return { |
| | | data: v.rank ? v.rank : '' |
| | | }; |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | dataList.forEach((d) => { |
| | | gridMapUtil.changeGridText({ |
| | | points: d.data, |
| | | textViews: d.type == 'data' ? v.dataTxt : v.rankTxt, |
| | | type: d.type, |
| | | isCustomColor, |
| | | useColor, |
| | | factorName: factorName ? factorName : this.selectedFactorType.name |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // ç»å¶çæµæ°æ®æåææ¬ |
| | |
| | | const data = gridDataDetail.map((v, i) => { |
| | | return { |
| | | lnglat_GD: points[i], |
| | | // data: v.pm25 ? ('æå: ' + v.rank) : '' |
| | | data: v.pm25 ? v.rank : '' |
| | | data: v.rank ? v.rank : '' |
| | | }; |
| | | }); |
| | | // return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'top'); |
| | |
| | | points: data, |
| | | textViews, |
| | | anchor: 'bottom-center', |
| | | type: 'rank' |
| | | type: 'rank', |
| | | factorName: this.selectedFactorType.name |
| | | }); |
| | | } |
| | | |
| | |
| | | // æ ¹æ®ç»å¶é¢è²æ¹å¼ç»å¶ç½æ ¼ |
| | | let resGridViews; |
| | | if (customColor) { |
| | | resGridViews = gridMapUtil.drawGridColorCustom(res, gridDataDetail); |
| | | resGridViews = gridMapUtil.drawGridColorCustom( |
| | | res, |
| | | gridDataDetail, |
| | | this.selectedFactorType.name |
| | | ); |
| | | } else { |
| | | resGridViews = gridMapUtil.drawGridColor( |
| | | res, |
| | | gridDataDetail, |
| | | 'PM25', |
| | | this.selectedFactorType.name, |
| | | style |
| | | ); |
| | | } |
| | |
| | | } |
| | | |
| | | deleteTagGrid(tags) { |
| | | this.changeVisibility({ tags, showGridViews: false }); |
| | | this.changeVisibility({ |
| | | tags, |
| | | showGridViews: false, |
| | | showDataTxt: false, |
| | | showRankTxt: false |
| | | }); |
| | | tags.forEach((t) => { |
| | | this.mapViewsMap.delete(t); |
| | | this.gridDataDetailMap.delete(t); |
| | |
| | | if (showGridViews) { |
| | | // map.add(this.mapViews.lastGridViews); |
| | | _mapViewsList.forEach((v) => { |
| | | if (v.lastGridViews) map.add(v.lastGridViews); |
| | | if (v.lastGridViews) { |
| | | map.add(v.lastGridViews); |
| | | v.show = true; |
| | | } |
| | | }); |
| | | } else { |
| | | // map.remove(this.mapViews.lastGridViews); |
| | | _mapViewsList.forEach((v) => { |
| | | if (v.lastGridViews) map.remove(v.lastGridViews); |
| | | if (v.lastGridViews) { |
| | | map.remove(v.lastGridViews); |
| | | v.show = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | if (showDataTxt) { |
| | | // map.add(this.mapViews.dataTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | if (v.dataTxt) map.add(v.dataTxt); |
| | | if (v.dataTxt) { |
| | | map.add(v.dataTxt); |
| | | v.show = true; |
| | | } |
| | | }); |
| | | } else { |
| | | // map.remove(this.mapViews.dataTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | if (v.dataTxt) map.remove(v.dataTxt); |
| | | if (v.dataTxt) { |
| | | map.remove(v.dataTxt); |
| | | v.show = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | if (showRankTxt) { |
| | | // map.add(this.mapViews.rankTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | if (v.rankTxt) map.add(v.rankTxt); |
| | | if (v.rankTxt) { |
| | | map.add(v.rankTxt); |
| | | v.show = true; |
| | | } |
| | | }); |
| | | } else { |
| | | // map.remove(this.mapViews.rankTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | if (v.rankTxt) map.remove(v.rankTxt); |
| | | if (v.rankTxt) { |
| | | map.remove(v.rankTxt); |
| | | v.show = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | changeGridColor({ |
| | | tag, |
| | | tags = [], |
| | | factorName, |
| | | useCustomColor, |
| | | opacity, |
| | | zIndex, |
| | | isMixGridHighlight |
| | | }) { |
| | | let { _mapViewsList, _gridDataDetailList } = this._getMapViews(tag); |
| | | let { _mapViewsList, _gridDataDetailList } = this._getMapViews(...tags); |
| | | if (_mapViewsList.length == _gridDataDetailList.length) { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.lastGridViews) { |
| | | if (useCustomColor != undefined) v.useCustomColor = useCustomColor; |
| | | const lastGridDataDetail = _gridDataDetailList[i]; |
| | | if (useCustomColor) { |
| | | if (v.useCustomColor) { |
| | | gridMapUtil.drawGridColorCustom( |
| | | v.lastGridViews, |
| | | lastGridDataDetail |
| | | lastGridDataDetail, |
| | | factorName ? factorName : this.selectedFactorType.name |
| | | ); |
| | | } else { |
| | | gridMapUtil.drawGridColor( |
| | | v.lastGridViews, |
| | | lastGridDataDetail, |
| | | 'PM25', |
| | | factorName ? factorName : this.selectedFactorType.name, |
| | | { opacity, zIndex, isMixGridHighlight } |
| | | ); |
| | | } |
| | |
| | | (v) => v.cellId == cellIndex |
| | | ); |
| | | polygon.on(name, (e) => { |
| | | event(gridCell, gridDataDetail); |
| | | event({ gridCell, gridDataDetail, polygon, extData: v.extData }); |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | setDefaultGridClickEvent(tags) { |
| | | this.setGridEvent( |
| | | tags, |
| | | 'click', |
| | | ({ gridCell, gridDataDetail, extData }) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail, |
| | | extData |
| | | }; |
| | | } |
| | | ); |
| | | |
| | | //é¼ æ ç§»å
¥äºä»¶ |
| | | this.setGridEvent(tags, 'mouseover', ({ polygon }) => { |
| | | const ext = polygon.getExtData(); |
| | | const originOption = polygon.getOptions(); |
| | | ext.originOption = originOption; |
| | | polygon.setOptions({ |
| | | strokeWeight: 2, |
| | | strokeColor: 'red' |
| | | }); |
| | | polygon.setExtData(ext); |
| | | }); |
| | | |
| | | //é¼ æ ç§»åºäºä»¶ |
| | | this.setGridEvent(tags, 'mouseout', ({ polygon }) => { |
| | | const ext = polygon.getExtData(); |
| | | polygon.setOptions(ext.originOption); |
| | | }); |
| | | } |
| | | |
| | |
| | | * éå çç½æ ¼è¿è¡çæµæ°æ®åå¼è®¡ç®å¹¶éæ°è®¡ç®å¯¹åºé¢è²ï¼å½¢ææ°çä¸ç»èåç½æ ¼ |
| | | * @param {Array} tags éè¦èåçç½æ ¼æ ç¾ï¼å½ä¸ºç©ºæ¶ï¼é»è®¤èåææç½æ ¼ |
| | | */ |
| | | mixGrid(tags, isMixGridHighlight) { |
| | | mixGrid({ tags, isMixGridHighlight = true }) { |
| | | tags.sort((a, b) => { |
| | | return a < b ? -1 : 1; |
| | | }); |
| | |
| | | tags: [mixTag], |
| | | showGridViews: true |
| | | }); |
| | | this.changeGridColor({ tag: mixTag, isMixGridHighlight }); |
| | | this.changeGridColor({ tags: [mixTag], isMixGridHighlight }); |
| | | } else { |
| | | // const mixMapViews = this._createNewMapViews(); |
| | | // æ ¹æ®æ ç¾tagï¼è·å对åºå¤ç»ç½æ ¼æ°æ® |
| | |
| | | if (count > 1) { |
| | | v.res.gridStyle = { |
| | | strokeWeight: 2, |
| | | strokeColor: 'blue' |
| | | strokeColor: '#23dad1' |
| | | }; |
| | | } |
| | | resGridDataDetail.push(v.res); |
| | |
| | | data: resGridDataDetail, |
| | | grid: { |
| | | style: { |
| | | isMixGridHighlight: |
| | | isMixGridHighlight == undefined ? true : isMixGridHighlight |
| | | isMixGridHighlight |
| | | } |
| | | }, |
| | | extData: { |
| | | name: `èµ°èªèå - ${mixTag}`, |
| | | type: 1 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return mixTag; |
| | | } |
| | | |
| | | mixGrid2({ tags, isMixGridHighlight = true, gridDataDetailList }) { |
| | | tags.sort((a, b) => { |
| | | return a < b ? -1 : 1; |
| | | }); |
| | | const mixTag = tags.join('-'); |
| | | if (this.mapViewsMap.has(mixTag)) { |
| | | this.changeVisibility({ |
| | | tags: [mixTag], |
| | | showGridViews: true |
| | | }); |
| | | this.changeGridColor({ tags: [mixTag], isMixGridHighlight }); |
| | | } else { |
| | | gridDataDetailList.forEach((gdd) => { |
| | | // ç½æ ¼æ°æ®æ¯èåçï¼å±ç¤ºé«äº®çæ ·å¼ |
| | | if (gdd.mixData) { |
| | | gdd.gridStyle = { |
| | | strokeWeight: 2, |
| | | strokeColor: '#23dad1' |
| | | }; |
| | | } |
| | | }); |
| | | this.drawTagGrid({ |
| | | tag: mixTag, |
| | | data: gridDataDetailList, |
| | | grid: { |
| | | style: { |
| | | isMixGridHighlight |
| | | } |
| | | }, |
| | | extData: { |
| | |
| | | }), |
| | | gridPoints: JSON.parse(JSON.stringify(this.mapViews.gridPoints)), |
| | | points: JSON.parse(JSON.stringify(this.mapViews.points)), |
| | | extData |
| | | extData, |
| | | show: true |
| | | }; |
| | | } |
| | | } |
| | |
| | | import { map } from './index_old'; |
| | | import calculate from './calculate'; |
| | | import { Legend } from '@/model/Legend'; |
| | | import { getGridDataDetailFactorValue } from '@/model/GridDataDetail'; |
| | | import { getHexColor, getColorBetweenTwoColors } from '../color'; |
| | | |
| | | /** |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * ææ¬æ è®° |
| | | * å¯ä¿®æ¹position |
| | | */ |
| | | function textMaker({ position, text, anchor, type, color }) { |
| | | function textMakerStyle({ type, color }) { |
| | | let style = {}; |
| | | if (type == 'data') { |
| | | style = { |
| | |
| | | 'margin-bottom': '4px' |
| | | }; |
| | | } |
| | | return style; |
| | | } |
| | | |
| | | /** |
| | | * ææ¬æ è®° |
| | | * å¯ä¿®æ¹position |
| | | */ |
| | | function textMaker({ position, text, anchor, type, color }) { |
| | | let style = textMakerStyle({ type, color }); |
| | | // eslint-disable-next-line no-undef |
| | | return new AMap.Text({ |
| | | text: text, |
| | |
| | | return gridViews; |
| | | }, |
| | | |
| | | drawGridText({ points, textViews, anchor, type, isCustomColor, useColor }) { |
| | | drawGridText({ |
| | | points, |
| | | textViews, |
| | | anchor, |
| | | type, |
| | | isCustomColor, |
| | | useColor, |
| | | factorName = 'PM25' |
| | | }) { |
| | | let colorList = []; |
| | | if (useColor) { |
| | | colorList = calGridColor({ |
| | | factorName: 'PM25', |
| | | factorName, |
| | | data: points.map((p) => p.data), |
| | | isCustomColor: isCustomColor |
| | | }); |
| | |
| | | }); |
| | | // map.add(_textViews); |
| | | return { textViews: _textViews }; |
| | | }, |
| | | |
| | | changeGridText({ |
| | | points, |
| | | textViews, |
| | | type, |
| | | isCustomColor, |
| | | useColor, |
| | | factorName = 'PM25' |
| | | }) { |
| | | let colorList = []; |
| | | if (useColor) { |
| | | colorList = calGridColor({ |
| | | factorName, |
| | | data: points.map((p) => p.data), |
| | | isCustomColor: isCustomColor |
| | | }); |
| | | } |
| | | if (textViews) { |
| | | textViews.forEach((t, i) => { |
| | | t.setText(points[i].data); |
| | | t.setStyle( |
| | | textMakerStyle({ type, color: useColor ? colorList[i] : 'white' }) |
| | | ); |
| | | }); |
| | | } |
| | | return { textViews }; |
| | | }, |
| | | |
| | | drawGridTextLabel(points, textViews, labelsLayer, direction) { |
| | |
| | | const res = []; |
| | | // éå嫿饿µæ°æ®æ°ç» |
| | | gridDataDetail.forEach((d, i) => { |
| | | if (d.pm25) { |
| | | const data = getGridDataDetailFactorValue(d, factorName); |
| | | if (data) { |
| | | const grid = gridViews[i]; |
| | | |
| | | // æ ¹æ®é¥æµæ°æ®è®¡ç®ç½æ ¼é¢è² |
| | | const data = d.pm25; |
| | | const { color, nextColor, range, nextRange } = |
| | | Legend.getStandardColorAndNext(factorName, data); |
| | | const ratio = (data - range) / (nextRange - range); |
| | |
| | | return res; |
| | | }, |
| | | |
| | | drawGridColorCustom(gridViews, gridDataDetail) { |
| | | |
| | | drawGridColorCustom(gridViews, gridDataDetail, factorName) { |
| | | var max, min; |
| | | gridDataDetail.forEach((t) => { |
| | | if (!t.pm25) return; |
| | | if (!max || t.pm25 > max) { |
| | | max = t.pm25; |
| | | const data = getGridDataDetailFactorValue(t, factorName); |
| | | if (!data) return; |
| | | if (!max || data > max) { |
| | | max = data; |
| | | } |
| | | if (!min || t.pm25 < min) { |
| | | min = t.pm25; |
| | | if (!min || data < min) { |
| | | min = data; |
| | | } |
| | | }); |
| | | const res = []; |
| | | // éå嫿饿µæ°æ®æ°ç» |
| | | gridDataDetail.forEach((d, i) => { |
| | | if (d.pm25) { |
| | | const data = getGridDataDetailFactorValue(d, factorName); |
| | | if (data) { |
| | | const grid = gridViews[i]; |
| | | |
| | | // æ ¹æ®é¥æµæ°æ®è®¡ç®ç½æ ¼é¢è² |
| | | const data = d.pm25; |
| | | const { color, nextColor, range, nextRange } = |
| | | Legend.getCustomColorAndNext(data, min, max); |
| | | const ratio = (data - range) / (nextRange - range); |
| | |
| | | ratio |
| | | ); |
| | | grid.setOptions({ |
| | | fillColor: _color, //å¤è¾¹å½¢å¡«å
é¢è² |
| | | fillColor: _color //å¤è¾¹å½¢å¡«å
é¢è² |
| | | // fillOpacity: style.opacity ? style.opacity : color[3] == 0 ? 0 : 1 |
| | | }); |
| | | |
| | |
| | | // çæµè®¾å¤ç¼å· |
| | | deviceCode: '', |
| | | // çæµå åçç±»åç¼å· |
| | | factorType: defaultOptions(TYPE0), |
| | | factorType: defaultOptions(TYPE0).value, |
| | | // çæµæ°æ® |
| | | factorDatas: new FactorDatas(), |
| | | // å³å®ç»å¶3Då¾å½¢æ¶æ¯å¦ä¸åå¾ååå¹¶ |
| | |
| | | deviceType: TYPE0, |
| | | deviceCode: '', |
| | | // çæµå åçç±»åç¼å· |
| | | factorType: defaultOptions(TYPE0), |
| | | factorType: defaultOptions(TYPE0).value, |
| | | // æ°è·åççæµæ°æ® |
| | | factorDatas: new FactorDatas(), |
| | | // å
¨é¨çæµæ°æ® |
| | |
| | | <template> |
| | | <!-- <div class="p-events-none m-t-2"> --> |
| | | <el-row justify="space-between"> |
| | | <el-row class="m-t-2"> |
| | | <FactorRadio @change="handleFactorTypeChange"></FactorRadio> |
| | | </el-row> |
| | | <el-row class="m-t-2" justify="space-between"> |
| | | <el-row class="wrap"> |
| | | <el-col span="2"> |
| | | <el-row> |
| | | <BaseCard v-show="show" size="medium" direction="left"> |
| | | <template #content> |
| | | <el-row> |
| | | <!-- <el-row> --> |
| | | <BaseCard v-show="show" size="medium" direction="left"> |
| | | <template #content> |
| | | <!-- <el-row> |
| | | <el-form :inline="true"> |
| | | <!-- <el-form-item label="èµ°èªèå"> |
| | | <el-select |
| | | v-model="selectedfusionData" |
| | | multiple |
| | | clearable |
| | | @change="handleChange" |
| | | placeholder="鿩任å¡" |
| | | size="small" |
| | | style="width: 160px" |
| | | :loading="fusionLoading" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in fusionDataList" |
| | | :key="i" |
| | | :label="s.mixDataId" |
| | | :value="i" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | :disabled=" |
| | | !gridCellList || selectedfusionData.length == 0 |
| | | " |
| | | @click="handleFusionClick" |
| | | > |
| | | {{ 'å å èµ°èª' }} |
| | | </el-button> |
| | | </el-form-item> --> |
| | | |
| | | </el-form> |
| | | </el-row> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <span>èååæ</span> |
| | | </el-row> |
| | | <el-form :inline="false"> |
| | | <el-form-item label="æ¶æ®µçé"> |
| | | <el-select |
| | | v-model="selectedTimeSection" |
| | | multiple |
| | | clearable |
| | | placeholder="éæ©æ¶æ®µ" |
| | | size="small" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="(v, i) in timeSectionList" |
| | | :key="i" |
| | | :label="v" |
| | | :value="v" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åºåçé"> |
| | | <el-select |
| | | v-model="selectedZone" |
| | | multiple |
| | | clearable |
| | | placeholder="éæ©åºå" |
| | | size="small" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="(v, i) in zoneList" |
| | | :key="i" |
| | | :label="v" |
| | | :value="v" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="èæ¯çé"> |
| | | <el-select |
| | | v-model="selectedPollutionDegree" |
| | | multiple |
| | | clearable |
| | | placeholder="éæ©èæ¯" |
| | | size="small" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="(v, i) in pollutionDegreeList" |
| | | :key="i" |
| | | :label="v" |
| | | :value="v" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div v-if="!gridCellList"> |
| | | <el-icon class="is-loading"><Loading /></el-icon> |
| | | ç½æ ¼ä¿¡æ¯å è½½ä¸... |
| | | </div> |
| | | <el-table |
| | | ref="tableRef" |
| | | :data="showFusionDataList" |
| | | table-layout="fixed" |
| | | size="default" |
| | | :show-overflow-tooltip="true" |
| | | border |
| | | height="50vh" |
| | | row-class-name="t-row-normal" |
| | | cell-class-name="t-cell" |
| | | header-row-class-name="t-header-row" |
| | | header-cell-class-name="t-header-cell" |
| | | :highlight-current-row="false" |
| | | @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange" |
| | | </el-row> --> |
| | | <el-row justify="space-between"> |
| | | <span>èååæ</span> |
| | | </el-row> |
| | | <el-form :inline="false"> |
| | | <el-form-item label="æ¶æ®µçé"> |
| | | <el-select |
| | | v-model="selectedTimeSection" |
| | | multiple |
| | | clearable |
| | | placeholder="éæ©æ¶æ®µ" |
| | | size="small" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="(v, i) in timeSectionList" |
| | | :key="i" |
| | | :label="v.label" |
| | | :value="v.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åºåçé"> |
| | | <el-select |
| | | v-model="selectedZone" |
| | | multiple |
| | | clearable |
| | | placeholder="éæ©åºå" |
| | | size="small" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="(v, i) in zoneList" |
| | | :key="i" |
| | | :label="v.label" |
| | | :value="v.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="èæ¯çé"> |
| | | <el-select |
| | | v-model="selectedPollutionDegree" |
| | | multiple |
| | | clearable |
| | | placeholder="éæ©èæ¯" |
| | | size="small" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="(v, i) in pollutionDegreeList" |
| | | :key="i" |
| | | :label="v.label" |
| | | :value="v.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-space v-if="!gridCellList"> |
| | | <el-icon class="is-loading"><Loading /></el-icon> |
| | | <el-text type="info">ç½æ ¼ä¿¡æ¯å è½½ä¸...</el-text> |
| | | </el-space> |
| | | <el-table |
| | | ref="tableRef" |
| | | :data="showFusionDataList" |
| | | table-layout="fixed" |
| | | size="small" |
| | | :show-overflow-tooltip="true" |
| | | border |
| | | height="45vh" |
| | | row-class-name="t-row-normal" |
| | | cell-class-name="t-cell" |
| | | header-row-class-name="t-header-row" |
| | | header-cell-class-name="t-header-cell" |
| | | :highlight-current-row="false" |
| | | @row-click="handleRowClick" |
| | | @select="handleSelectionChange" |
| | | @select-all="handleSelectionChange" |
| | | > |
| | | <el-table-column width="40" v-if="!gridCellList"> |
| | | <template #default> |
| | | <el-icon class="is-loading"><Loading /></el-icon> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-else |
| | | type="selection" |
| | | :selectable="selectable" |
| | | width="40" |
| | | > |
| | | <el-table-column width="40" v-if="!gridCellList"> |
| | | <template #default> |
| | | <el-icon class="is-loading"><Loading /></el-icon> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-else |
| | | type="selection" |
| | | :selectable="selectable" |
| | | width="40" |
| | | /> |
| | | <!-- <el-table-column |
| | | <!-- <template #header> |
| | | <span>éæ©</span> |
| | | </template> --> |
| | | </el-table-column> |
| | | <!-- <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | width="30" |
| | | /> --> |
| | | <el-table-column |
| | | prop="dataTime" |
| | | label="æ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="missionCode" |
| | | label="ä»»å¡ç¼å·" |
| | | align="center" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | prop="zone" |
| | | label="åºå" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | prop="pollutionDegree" |
| | | label="污æèæ¯" |
| | | align="center" |
| | | width="70" |
| | | /> |
| | | </el-table> |
| | | <el-table-column |
| | | prop="dataTime" |
| | | label="æ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | prop="missionCode" |
| | | label="ä»»å¡ç¼å·" |
| | | align="center" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | prop="zone" |
| | | label="åºå" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | prop="pollutionDegree" |
| | | label="污æèæ¯" |
| | | align="center" |
| | | width="70" |
| | | /> |
| | | </el-table> |
| | | |
| | | <div class="m-t-8">æä½</div> |
| | | <el-space class="m-t-8 m-b-8"> |
| | | <!-- <el-button |
| | | <div class="m-t-8">æä½</div> |
| | | <el-space class="m-t-8 m-b-8"> |
| | | <!-- <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | |
| | | > |
| | | {{ 'å å èµ°èª' }} |
| | | </el-button> --> |
| | | <CheckButton |
| | | active-text="èååæ" |
| | | :default-value="false" |
| | | @change="handleMixClick" |
| | | > |
| | | </CheckButton> |
| | | </el-space> |
| | | </template> |
| | | <template #footer> </template> |
| | | </BaseCard> |
| | | </el-row> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="handleMixClick" |
| | | > |
| | | {{ 'èååæ' }} |
| | | </el-button> |
| | | <!-- <CheckButton |
| | | active-text="èååæ" |
| | | :default-value="false" |
| | | @change="handleMixClick" |
| | | > |
| | | </CheckButton> --> |
| | | </el-space> |
| | | </template> |
| | | <template #footer> </template> |
| | | </BaseCard> |
| | | <!-- </el-row> --> |
| | | </el-col> |
| | | <el-col span="2"> |
| | | <el-row> |
| | | <CardButton |
| | | name="èµ°èªèå" |
| | | direction="right" |
| | | @click="() => (show = !show)" |
| | | ></CardButton> |
| | | </el-row> |
| | | <!-- <el-row> --> |
| | | <CardButton |
| | | name="èµ°èªèå" |
| | | direction="right" |
| | | @click="() => (show = !show)" |
| | | ></CardButton> |
| | | <!-- </el-row> --> |
| | | </el-col> |
| | | </el-row> |
| | | <GridStyleTool |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted, watch, computed } from 'vue'; |
| | | import { ref, toRaw, onMounted, onUnmounted, watch, computed } from 'vue'; |
| | | 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'; |
| | | |
| | | const gridStore = useGridStore(); |
| | | |
| | |
| | | }); |
| | | const show = ref(true); |
| | | |
| | | // çæµå åçç±»åç¼å· |
| | | const factorType = ref(defaultOptions(TYPE0)); |
| | | satelliteGrid.setShowFactorType(toRaw(factorType.value)); |
| | | |
| | | function handleFactorTypeChange(e, item) { |
| | | factorType.value = item; |
| | | console.log(toRaw(factorType.value)); |
| | | satelliteGrid.setShowFactorType(toRaw(factorType.value)); |
| | | } |
| | | |
| | | const mission = ref(undefined); |
| | | |
| | | const gridCellList = ref(undefined); |
| | |
| | | const fusionLoading = ref(false); |
| | | const fusionDataList = ref([]); |
| | | const selectedfusionData = ref([]); |
| | | const tableRef = ref() |
| | | const tableRef = ref(); |
| | | const selectable = (row) => gridCellList.value; |
| | | |
| | | const gridDataDetailMap = new Map(); |
| | |
| | | const hour = moment(e.dayTimePeriodStart).hour(); |
| | | const t = e.dayTimePeriod; |
| | | const option = { |
| | | label: `${t} ${moment(e.dayTimePeriodStart).format('HH:mm')} - ${moment(e.dayTimePeriodEnd).format('HH:mm')}`, |
| | | value: t, |
| | | index: hour |
| | | }; |
| | | if (res.indexOf(option) == -1) { |
| | | if (!res.find((v) => v.label == option.label)) { |
| | | res.push(option); |
| | | } |
| | | }); |
| | |
| | | |
| | | res = res.map((v) => { |
| | | const count = rMap.get(v.value); |
| | | return `${v.value} (${count})`; |
| | | v.label = `${v.label} (${count ? count : 0})`; |
| | | return v; |
| | | }); |
| | | return res; |
| | | }); |
| | |
| | | let res = []; |
| | | fusionDataList.value.forEach((e) => { |
| | | const t = e.zone; |
| | | if (res.indexOf(t) == -1) { |
| | | res.push(t); |
| | | const option = { |
| | | label: t, |
| | | value: t |
| | | }; |
| | | if (!res.find((v) => v.label == option.label)) { |
| | | res.push(option); |
| | | } |
| | | }); |
| | | const rMap = new Map(); |
| | |
| | | }); |
| | | |
| | | res = res.map((v) => { |
| | | const count = rMap.get(v); |
| | | return `${v} (${count})`; |
| | | const count = rMap.get(v.value); |
| | | v.label = `${v.label} (${count ? count : 0})`; |
| | | return v; |
| | | }); |
| | | return res; |
| | | }); |
| | |
| | | fusionDataList.value.forEach((e) => { |
| | | const t = e.pollutionDegree; |
| | | const option = { |
| | | label: t, |
| | | value: t, |
| | | index: e.pollutionDegreeIndex |
| | | }; |
| | | if (res.indexOf(option) == -1) { |
| | | if (!res.find((v) => v.label == option.label)) { |
| | | res.push(option); |
| | | } |
| | | }); |
| | |
| | | |
| | | res = res.map((v) => { |
| | | const count = rMap.get(v.value); |
| | | return `${v.value} (${count})`; |
| | | v.label = `${v.label} (${count ? count : 0})`; |
| | | return v; |
| | | }); |
| | | return res; |
| | | }); |
| | |
| | | // } |
| | | |
| | | function prepareGrid(gridInfo) { |
| | | satelliteGrid.gridPrepare(gridInfo, (polygon) => { |
| | | //é¼ æ ç§»å
¥äºä»¶ |
| | | polygon.on('mouseover', () => { |
| | | polygon.setOptions({ |
| | | //ä¿®æ¹å¤è¾¹å½¢å±æ§çæ¹æ³ |
| | | strokeWeight: 2, |
| | | strokeColor: 'red' |
| | | }); |
| | | }); |
| | | //é¼ æ ç§»åºäºä»¶ |
| | | polygon.on('mouseout', () => { |
| | | polygon.setOptions({ |
| | | strokeWeight: 1, |
| | | strokeColor: 'white' |
| | | }); |
| | | }); |
| | | 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.setGridEvent('click', (gridCell, gridDataDetail) => { |
| | | // // const polygon = e.target |
| | | // // const { gridCell } = polygon.getExtData(); |
| | | // // const cellIndex = gridCell.cellIndex; |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // }); |
| | | } |
| | | |
| | | // watch(mission, (nV, oV) => { |
| | | // if (nV != oV) { |
| | | // checkUnderwayFusionResult(); |
| | | // search(nV); |
| | | // } |
| | | // }); |
| | | |
| | | watch( |
| | | () => props.groupId, |
| | | (nV, oV) => { |
| | | if (nV != oV) { |
| | | satelliteGrid.gridGroupId = nV; |
| | | gridApi.fetchGridCell(nV).then((res) => { |
| | | gridCellList.value = res.data; |
| | | prepareGrid(gridCellList.value); |
| | |
| | | type: 0 |
| | | } |
| | | }); |
| | | satelliteGrid.setGridEvent( |
| | | [d.id], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | satelliteGrid.setDefaultGridClickEvent([d.id]); |
| | | // satelliteGrid.setGridEvent( |
| | | // [d.id], |
| | | // 'click', |
| | | // (gridCell, gridDataDetail) => { |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // } |
| | | // ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | // gridCtrls.value = Array.from(satelliteGrid.mapViewsMap); |
| | | // console.log(gridCtrls.value); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | |
| | | let mixTag; |
| | | function handleMixClick() { |
| | | mixActive.value = !mixActive.value; |
| | | // mixActive.value = !mixActive.value; |
| | | const tags = selectedfusionData.value.map((v) => v.id); |
| | | satelliteGrid.changeVisibility({ |
| | | showGridViews: false, |
| | | showDataTxt: false, |
| | | showRankTxt: false |
| | | }); |
| | | if (mixActive.value) { |
| | | mixTag = satelliteGrid.mixGrid(tags); |
| | | satelliteGrid.setGridEvent( |
| | | [mixTag], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | // if (mixActive.value) { |
| | | gridApi.mixUnderwayGridData(props.groupId, tags).then((res) => { |
| | | mixTag = satelliteGrid.mixGrid2({ tags, gridDataDetailList: res.data }); |
| | | satelliteGrid.setDefaultGridClickEvent([mixTag]); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | } else { |
| | | satelliteGrid.changeVisibility({ |
| | | tags, |
| | | showGridViews: true |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 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({ |
| | |
| | | showRankTxt: false |
| | | }); |
| | | if (heatActive.value) { |
| | | // heatTag = satelliteGrid.drawHeatGrid(mixTag); |
| | | // satelliteGrid.setGridEvent( |
| | | // [heatTag], |
| | | // 'click', |
| | | // (gridCell, gridDataDetail) => { |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // } |
| | | // ); |
| | | // gridCtrls.value = [satelliteGrid]; |
| | | |
| | | const data = satelliteGrid.gridDataDetailMap.get(mixTag); |
| | | gridApi.buildUnderwayHeatmap(3, data, 10).then((res) => { |
| | | heatTag = satelliteGrid.drawHeatGrid2(mixTag, res.data); |
| | | satelliteGrid.setGridEvent( |
| | | [heatTag], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | }); |
| | | 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], |
| | |
| | | console.log(res); |
| | | } |
| | | |
| | | function handleUnderwayClick({ isShow, dataId }) { |
| | | function handleUnderwayClick({ isShow, dataId, done }) { |
| | | underwayVisible.value = !underwayVisible.value; |
| | | |
| | | if (isShow) { |
| | | draw(dataId); |
| | | draw(dataId).finally(() => done()); |
| | | } else { |
| | | const d = fusionDataList.value.find((v) => v.id == dataId); |
| | | const mission = missionStore.missionList.find((v) => { |
| | | return v.missionCode == d.mixDataId; |
| | | }); |
| | | mapLine.hideLine(mission.missionCode); |
| | | done(); |
| | | } |
| | | } |
| | | function handleFusionDelete(index, tag) { |
| | |
| | | if (f) { |
| | | // const i = selectedfusionData.value.indexOf(f); |
| | | // selectedfusionData.value.splice(i, 1); |
| | | tableRef.value.toggleRowSelection(f, false) |
| | | tableRef.value.toggleRowSelection(f, false); |
| | | } |
| | | } |
| | | |
| | | function handleSelectionChange(val) { |
| | | console.log(val); |
| | | |
| | | const deleted = selectedfusionData.value.filter((v) => { |
| | | return val.indexOf(v) == -1; |
| | | return !val.find((t) => t.id == v.id); |
| | | }); |
| | | const deletedIdList = deleted.map((d) => d.id); |
| | | const added = val.filter((v) => { |
| | | return selectedfusionData.value.indexOf(v) == -1; |
| | | return !selectedfusionData.value.find((t) => t.id == v.id); |
| | | }); |
| | | |
| | | if (val.length > 4) { |
| | | useMessageBox({ |
| | | confirmMsg: 'æå¤å
è®¸åæ¶å±ç¤º4次走èªè®°å½', |
| | | confirmTitle: 'èµ°èªè®°å½éæ©è¿å¤è¦å' |
| | | }); |
| | | added.forEach((a) => { |
| | | tableRef.value.toggleRowSelection(a, false); |
| | | }); |
| | | return; |
| | | } |
| | | // const addedIdList = added.map(d=>d.id) |
| | | |
| | | if (deletedIdList.length > 0) { |
| | |
| | | |
| | | added.forEach((i) => { |
| | | const d = i; |
| | | gridApi.fetchGridDataDetail(d.id, d.groupId).then((res) => { |
| | | gridDataDetailMap.set(d.id, res.data); |
| | | const gdd = res.data; |
| | | if (gridDataDetailMap.has(d.id)) { |
| | | const gdd = gridDataDetailMap.get(d.id); |
| | | satelliteGrid.drawTagGrid({ |
| | | tag: d.id, |
| | | data: gdd, |
| | |
| | | type: 0 |
| | | } |
| | | }); |
| | | satelliteGrid.setGridEvent( |
| | | [d.id], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | satelliteGrid.setDefaultGridClickEvent([d.id]); |
| | | // satelliteGrid.setGridEvent( |
| | | // [d.id], |
| | | // 'click', |
| | | // (gridCell, gridDataDetail) => { |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // } |
| | | // ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | }); |
| | | } else { |
| | | gridApi.fetchGridDataDetail(d.id, d.groupId).then((res) => { |
| | | gridDataDetailMap.set(d.id, res.data); |
| | | const gdd = res.data; |
| | | satelliteGrid.drawTagGrid({ |
| | | tag: d.id, |
| | | data: gdd, |
| | | extData: { |
| | | name: `èµ°èªç½æ ¼ - ${d.mixDataId}`, |
| | | type: 0 |
| | | } |
| | | }); |
| | | satelliteGrid.setDefaultGridClickEvent([d.id]); |
| | | // satelliteGrid.setGridEvent( |
| | | // [d.id], |
| | | // 'click', |
| | | // (gridCell, gridDataDetail) => { |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // } |
| | | // ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | selectedfusionData.value = val; |
| | | selectedfusionData.value = useCloned(val).cloned.value; |
| | | } |
| | | |
| | | /**èµ°èªè½¨è¿¹*******************************************************************/ |
| | |
| | | const drawMode = ref(0); |
| | | // çæµæ°æ® |
| | | const factorDataMap = new Map(); |
| | | // pm2.5 |
| | | const factorType = 6; |
| | | |
| | | function fetchMission() { |
| | | missionLoading.value = true; |
| | |
| | | } |
| | | |
| | | function draw(dataId) { |
| | | if (isUnmounted.value) return; |
| | | |
| | | // selectedfusionData.value.forEach((i) => { |
| | | // const d = fusionDataList.value[i]; |
| | | |
| | | // const mission = missionStore.missionList.find((v) => { |
| | | // return v.missionCode == d.mixDataId; |
| | | // }); |
| | | |
| | | // if (factorDataMap.has(mission.missionCode)) { |
| | | // const fd = factorDataMap.get(mission.missionCode); |
| | | // drawLine(mission.missionCode, fd); |
| | | // } else { |
| | | // search(mission).then((res) => { |
| | | // const fd = new FactorDatas(); |
| | | // fd.setData(res.data, drawMode.value, () => { |
| | | // fd.refreshHeight(factorType.value); |
| | | // factorDataMap.set(mission.missionCode, fd); |
| | | // drawLine(mission.missionCode, fd); |
| | | // }); |
| | | // }); |
| | | // } |
| | | // }); |
| | | |
| | | 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; |
| | |
| | | |
| | | if (factorDataMap.has(mission.missionCode)) { |
| | | const fd = factorDataMap.get(mission.missionCode); |
| | | drawLine(mission.missionCode, fd); |
| | | fd.refreshHeight(factorType.value.value); |
| | | return Promise.resolve(drawLine(mission.missionCode, fd)); |
| | | } else { |
| | | search(mission).then((res) => { |
| | | return search(mission).then((res) => { |
| | | const fd = new FactorDatas(); |
| | | fd.setData(res.data, drawMode.value, () => { |
| | | fd.refreshHeight(factorType.value); |
| | | fd.refreshHeight(factorType.value.value); |
| | | factorDataMap.set(mission.missionCode, fd); |
| | | drawLine(mission.missionCode, fd); |
| | | }); |
| | |
| | | |
| | | function drawLine(missionCode, fd) { |
| | | // å·æ°å¾ä¾ |
| | | const factor = fd.factor[factorType]; |
| | | const factor = fd.factor[factorType.value.value]; |
| | | sector.clearSector(); |
| | | fd.refreshHeight(factorType); |
| | | fd.refreshHeight(factorType.value.value); |
| | | mapLine.drawTagLine(missionCode, fd, factor); |
| | | } |
| | | </script> |
| | |
| | | type="primary" |
| | | icon="Close" |
| | | circle |
| | | size="small" |
| | | @click="handleCloseClick(i, t, value)" |
| | | /> |
| | | <!-- <el-icon><Close /></el-icon> --> |
| | |
| | | <!-- <el-text>{{ g.name }}</el-text> --> |
| | | <!-- <div class="m-t-8">ç½æ ¼è¦ç´ </div> --> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <!-- <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="gridLoading = !gridLoading" |
| | | > |
| | | {{ 'èååæ' }} |
| | | </el-button> --> |
| | | <CheckButton |
| | | :loading="gridLoading" |
| | | v-model="value.show" |
| | | active-text="æ¾ç¤ºç½æ ¼" |
| | | inactive-text="éèç½æ ¼" |
| | | :default-value="true" |
| | | @change="(e) => handleGridClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="rankLoading" |
| | | v-model="value.showRank" |
| | | active-text="æ¾ç¤ºæå" |
| | | inactive-text="éèæå" |
| | | :default-value="false" |
| | |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="dataLoading" |
| | | v-model="value.showData" |
| | | active-text="æ¾ç¤ºæ°æ®" |
| | | inactive-text="éèæ°æ®" |
| | | :default-value="false" |
| | |
| | | </el-row> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <CheckButton |
| | | :loading="colorLoading" |
| | | v-model="value.showCustomColor" |
| | | active-text="ç»å¶å¯¹æ¯è²" |
| | | inactive-text="ç»å¶æ åè²" |
| | | :default-value="false" |
| | |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="heatMapLoading" |
| | | v-model="value.showHeatMap" |
| | | active-text="é£é©çåå¾" |
| | | inactive-text="é£é©çåå¾" |
| | | :default-value="false" |
| | |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="underwayLoading" |
| | | v-if="value.extData.type == 0" |
| | | v-model="value.showUnderway" |
| | | active-text="æ¾ç¤ºèµ°èªè½¨è¿¹" |
| | | inactive-text="éèèµ°èªè½¨è¿¹" |
| | | :default-value="false" |
| | |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="highlightLoading" |
| | | v-if="value.extData.type == 1" |
| | | v-model="value.highlightFusionGrid" |
| | | active-text="é«äº®èåç½æ ¼" |
| | | :default-value="true" |
| | | @change="(e) => handleHighlightGridClick(e, i, value)" |
| | |
| | | } |
| | | }); |
| | | |
| | | const gridLoading = ref(false); |
| | | const rankLoading = ref(false); |
| | | const dataLoading = ref(false); |
| | | const colorLoading = ref(false); |
| | | const heatMapLoading = ref(false); |
| | | const underwayLoading = ref(false); |
| | | const highlightLoading = ref(false); |
| | | |
| | | const emits = defineEmits(['showUnderway', 'onDelete']); |
| | | |
| | | const gridCtrlList = computed(() => { |
| | |
| | | return { |
| | | tag: v[0], |
| | | extData: v[1].extData, |
| | | show: v[1].show, |
| | | opacityValue: 1 |
| | | }; |
| | | }) |
| | |
| | | |
| | | const show = ref(true); |
| | | |
| | | // const gridVisible = ref(false); |
| | | // const rankVisible = ref(false); |
| | | // const dataVisible = ref(false); |
| | | // const isStandardColor = ref(true); |
| | | // const isOpacity = ref(false); |
| | | // const opacityValue = ref(0.7); |
| | | |
| | | // const emits = defineEmits([ |
| | | // 'showRank', |
| | | // 'showData', |
| | | // 'changeColor', |
| | | // 'changeOpacity' |
| | | // ]); |
| | | function handleCloseClick(index, t, value) { |
| | | const key = value.tag; |
| | | toRaw(props.gridCtrls[index]).deleteTagGrid([key]); |
| | | gridCtrlList.value[index].views.splice(t, 1) |
| | | emits('onDelete', index, key) |
| | | gridCtrlList.value[index].views.splice(t, 1); |
| | | emits('onDelete', index, key); |
| | | } |
| | | |
| | | function handleGridClick(e, index, value) { |
| | | gridLoading.value = true; |
| | | const key = value.tag; |
| | | toRaw(props.gridCtrls[index]).changeVisibility({ |
| | | tags: [key], |
| | | showGridViews: e |
| | | }); |
| | | gridLoading.value = false; |
| | | } |
| | | |
| | | function handleRankClick(e, index, value) { |
| | | rankLoading.value = true; |
| | | const key = value.tag; |
| | | toRaw(props.gridCtrls[index]).changeVisibility({ |
| | | tags: [key], |
| | | showRankTxt: e |
| | | }); |
| | | rankLoading.value = false; |
| | | } |
| | | |
| | | function handleDataClick(e, index, value) { |
| | | dataLoading.value = true; |
| | | const key = value.tag; |
| | | toRaw(props.gridCtrls[index]).changeVisibility({ |
| | | tags: [key], |
| | | showDataTxt: e |
| | | }); |
| | | dataLoading.value = false; |
| | | } |
| | | |
| | | function handleColorClick(e, index, value) { |
| | | colorLoading.value = true; |
| | | const key = value.tag; |
| | | toRaw(props.gridCtrls[index]).changeGridColor({ |
| | | tag: key, |
| | | tags: [key], |
| | | useCustomColor: e |
| | | }); |
| | | colorLoading.value = false; |
| | | } |
| | | |
| | | function handleOpacityChange(e, index, value) { |
| | | console.log(e, index, value); |
| | | |
| | | const key = value.tag; |
| | | // value.opacityValue = e; |
| | | toRaw(props.gridCtrls[index]).changeGridOpacity({ |
| | |
| | | } |
| | | |
| | | function handleUnderwayClick(e, index, value) { |
| | | underwayLoading.value = true; |
| | | emits('showUnderway', { |
| | | isShow: e, |
| | | dataId: value.tag |
| | | dataId: value.tag, |
| | | done: () => (underwayLoading.value = false) |
| | | }); |
| | | } |
| | | |
| | | function handleHighlightGridClick(e, index, value) { |
| | | toRaw(props.gridCtrls[index]).mixGrid(value.tag.split('-'), e); |
| | | highlightLoading.value = true; |
| | | toRaw(props.gridCtrls[index]).mixGrid({ |
| | | tags: value.tag.split('-'), |
| | | isMixGridHighlight: e |
| | | }); |
| | | highlightLoading.value = false; |
| | | } |
| | | |
| | | let heatTag; |
| | | const heatMapSearchLength = 4; |
| | | function handleHeatMapClick(e, index, value) { |
| | | heatMapLoading.value = true; |
| | | const _satelliteGrid = toRaw(props.gridCtrls[index]); |
| | | _satelliteGrid.changeVisibility({ |
| | | showGridViews: false, |
| | |
| | | }); |
| | | if (e) { |
| | | const data = _satelliteGrid.gridDataDetailMap.get(value.tag); |
| | | gridApi.buildUnderwayHeatmap(3, data).then((res) => { |
| | | heatTag = _satelliteGrid.drawHeatGrid2(value.tag, res.data); |
| | | _satelliteGrid.setGridEvent( |
| | | [heatTag], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | }); |
| | | gridApi |
| | | .buildUnderwayHeatmap(_satelliteGrid.gridGroupId, data, heatMapSearchLength) |
| | | .then((res) => { |
| | | heatTag = _satelliteGrid.drawHeatGrid2(value.tag, res.data); |
| | | _satelliteGrid.setDefaultGridClickEvent([heatTag]); |
| | | // _satelliteGrid.setGridEvent( |
| | | // [heatTag], |
| | | // 'click', |
| | | // (gridCell, gridDataDetail) => { |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // } |
| | | // ); |
| | | }) |
| | | .finally(() => (heatMapLoading.value = false)); |
| | | } else { |
| | | _satelliteGrid.changeVisibility({ |
| | | tags: [value.tag], |
| | | showGridViews: true |
| | | }); |
| | | heatMapLoading.value = false; |
| | | } |
| | | } |
| | | </script> |