-
All Date
+
All Data
@@ -36,7 +36,7 @@
ref="scrollContainerRef"
direction="verticle"
:scrollContainer="getScrollContainer"
- class="date-list has-search"
+ class="data-list has-search"
:class="{
'show-search': searchPlacementVisible
}"
@@ -79,63 +79,31 @@
-
-
+
+
-
- {{ item.stationName }}
-
-
-
-
-
-
- {{ item.stationType }}
-
-
-
- {{ item.altitude }}
-
-
-
-
-
- {{ Number(item.lon).toFixed(6) }} {{ Number(item.lat).toFixed(6) }}
-
-
-
-
-
- {{ item.status }}
-
-
-
- {{ item.signal }}
-
-
-
-
+
-
+
-
-
+
+
-
Focus Date
+
Focus Data
@@ -146,59 +114,33 @@
-
-
-
+
+
+
-
-
- {{ item.stationName }}
-
-
-
-
-
-
- {{ item.stationType }}
-
-
-
- {{ item.altitude }}
-
-
-
-
-
- {{ Number(item.lon).toFixed(6) }} {{ Number(item.lat).toFixed(6) }}
-
-
-
-
-
- {{ item.status }}
-
-
-
- {{ item.signal }}
-
-
-
-
-
-
+
+
-
+
-
@@ -207,6 +149,7 @@
import Map from './components/Map.vue'
import MapMarker from './components/MapMarker.vue'
import MapPane from './components/MapPane.vue'
+import DataListItem from './components/DataListItem.vue'
import ScrollContainer from '@/components/ScrollContainer/index.vue'
import { getAction } from '../../api/manage'
import { cloneDeep } from 'lodash'
@@ -216,17 +159,19 @@ export default {
Map,
MapMarker,
MapPane,
- ScrollContainer
+ ScrollContainer,
+ DataListItem
},
data() {
return {
activeKey: '1',
- isGettingDateList: false,
- isGettingFollowedDateList: false,
+ isGettingDataList: false,
+ isGettingFollowedDataList: false,
- dateList: [],
- followedDateList: [], // 关注
+ dataList: [], // 左侧All Data 列表
+ followedDataList: [], // 关注
+ markerList: [], // 地图上标记点列表
searchPlacementVisible: false, // 搜索栏占位是否显示
@@ -255,10 +200,11 @@ export default {
// 获取站点列表
async getStationList() {
try {
- this.isGettingDateList = true
+ this.isGettingDataList = true
const res = await getAction('/jeecg-station-operation/stationOperation/findList')
- this.dateList = res
- this.originalDateList = cloneDeep(res)
+ this.originalDataList = res // 保留初始版本
+ this.dataList = cloneDeep(res)
+ this.markerList = cloneDeep(res)
this.$nextTick(() => {
this.$refs.scrollContainerRef.checkScrollEnd()
@@ -266,16 +212,16 @@ export default {
} catch (error) {
console.error(error)
} finally {
- this.isGettingDateList = false
+ this.isGettingDataList = false
}
},
// 获取已关注站点列表
async getFollowedStationList() {
try {
- this.isGettingFollowedDateList = true
+ this.isGettingFollowedDataList = true
const res = await getAction('/jeecg-station-operation/sysUserFocusStation/findList')
- this.followedDateList = res
+ this.followedDataList = res
const scrollContainer2Ref = this.$refs.scrollContainer2Ref
if (scrollContainer2Ref) {
@@ -286,7 +232,7 @@ export default {
} catch (error) {
console.error(error)
} finally {
- this.isGettingFollowedDateList = false
+ this.isGettingFollowedDataList = false
}
},
@@ -300,22 +246,22 @@ export default {
}
},
- // 获取 台站树列表
+ // 获取 台站树列表
async getStationTree() {
try {
const { success, result, message } = await getAction('/stationOperation/findTree')
- if(success) {
- result.forEach(item => item.stationCode = item.code)
+ if (success) {
+ result.forEach(item => (item.stationCode = item.code))
this.treeData = result
- }
- else {
+ } else {
this.$message.error(message)
}
} catch (error) {
- console.error(error);
+ console.error(error)
}
},
+ // 显示搜索栏
handleShowSearch() {
if (this.filterVisible) {
this.searchVisible = true
@@ -343,14 +289,14 @@ export default {
}
},
- // 左侧 All Date 筛选
+ // 左侧 All Data 筛选
onFilterChange() {
- this.dateList = this.originalDateList.filter(dateItem => {
+ this.dataList = this.originalDataList.filter(dataItem => {
const filterSearchText =
!this.filter.searchText ||
- -1 !== dateItem.stationName.toLowerCase().indexOf(this.filter.searchText.toLowerCase())
- const filterStatus = !this.filter.status || this.filter.status == dateItem.status
- const filterType = !this.filter.stationType || this.filter.type == dateItem.stationType
+ -1 !== dataItem.stationName.toLowerCase().indexOf(this.filter.searchText.toLowerCase())
+ const filterStatus = !this.filter.status || this.filter.status == dataItem.status
+ const filterType = !this.filter.stationType || this.filter.type == dataItem.stationType
return filterSearchText && filterStatus && filterType
})
@@ -360,6 +306,32 @@ export default {
})
},
+ // 定位台站
+ locateFacility(stationItem) {
+ const find = this.markerList.find(
+ markerItem => markerItem.stationId == stationItem.stationId && markerItem.stationType == stationItem.stationType
+ )
+ if (!find) {
+ // 如果未显示,则不定位
+ return
+ }
+ const { lon, lat } = stationItem
+ this.$refs.map.panTo([lon, lat])
+ },
+
+ // 修改地图上的marker列表
+ onChangeMarker(markerList) {
+ this.markerList = markerList
+ },
+
+ /**
+ * 根据类型筛选地图上的marker列表
+ * @param {Array
} typeList
+ */
+ onChangeMarkerByType(typeList) {
+ this.markerList = this.originalDataList.filter(item => typeList.includes(item.stationType))
+ },
+
getScrollContainer() {
return this.$refs.customScrollContainerRef.$el
},
@@ -374,7 +346,7 @@ export default {
.station-operation {
position: relative;
height: 100%;
- .date-container {
+ .data-container {
position: absolute;
left: 0;
top: 0;
@@ -419,7 +391,7 @@ export default {
position: relative;
}
&.ant-motion-collapse-legacy {
- .date-list {
+ .data-list {
overflow: hidden;
}
}
@@ -505,7 +477,7 @@ export default {
}
// 左侧列表内容
- .date-list {
+ .data-list {
width: 100%;
margin-right: 2px;
padding: 2px 0 10px 7px;
@@ -530,7 +502,7 @@ export default {
}
&.has-search {
- .date-list-content {
+ .data-list-content {
transition: height 0.3s ease-in-out;
height: 100%;
overflow: auto;
@@ -542,76 +514,11 @@ export default {
height: @searchHeight;
}
- .date-list-content {
+ .data-list-content {
height: calc(100% - @searchHeight);
}
}
- &-item {
- width: 322px;
- &-title {
- height: 25px;
- line-height: 25px;
- font-family: Arial;
- font-size: 14px;
- color: #fff;
- font-weight: bold;
- position: relative;
- padding-left: 8px;
- margin-bottom: 0;
- }
-
- &-container {
- display: flex;
- }
-
- &-content {
- width: 100%;
- min-height: 80px;
- padding: 10px 10px 10px 14px;
- flex: 1;
- color: #6ebad0;
- background: url(~@/assets/images/station-operation/date-item-bg.png) center no-repeat;
- background-size: 100% 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
-
- .date-list-item-children {
- display: flex;
- justify-content: space-between;
-
- .date-list-item-child {
- color: #fff;
-
- &:nth-child(2n + 1) {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- &:nth-child(2n) {
- width: 110px;
- flex-shrink: 0;
- margin-left: 5px;
- }
-
- label {
- color: #6ebad0;
- font-family: Arial;
- }
-
- span {
- margin-left: 10px;
- &.green {
- color: #0cff00;
- }
- }
- }
- }
- }
- }
-
.shadow {
position: absolute;
bottom: 0;