|
@@ -20,15 +20,22 @@
|
|
|
</div>
|
|
|
<div class="machine-list">
|
|
|
<div class="list-container-title">
|
|
|
- {{ $t("screen.machineList") }}<span v-if="loading" style="font-size: 10px;color: #fefefe;margin-left: 10px">{{
|
|
|
- $t("common.loading")
|
|
|
- }}</span>
|
|
|
+ {{ $t("screen.machineList") }}
|
|
|
+ <span v-if="loading" style="font-size: 10px;color: #fefefe;margin-left: 10px">
|
|
|
+ {{
|
|
|
+ $t("common.loading")
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div class="content-list infinite-list-wrapper"
|
|
|
v-infinite-scroll="loadMachine"
|
|
|
:infinite-scroll-disabled="disabled"
|
|
|
>
|
|
|
- <div v-for="item in machineList" class="list-item" :key="item.id" @click="handleMachineClick(item)">
|
|
|
+ <div v-for="item in machineList"
|
|
|
+ :class="{'list-item':true,'selected-item': selectMachine && item.id===selectMachine.id}"
|
|
|
+ :key="item.id" @click="handleMachineClick(item)">
|
|
|
+ <i class="machine-status"
|
|
|
+ :style="{backgroundColor: MachineStatus[item.status].color }"/>
|
|
|
{{ item.name }}({{ item.machineNum }})
|
|
|
</div>
|
|
|
<p v-if="noMore" class="no-more" style="margin-top: auto">{{ $t("common.noMore") }}</p>
|
|
@@ -109,6 +116,7 @@ import MachineIndex from "@/views/cons/screen/MachineIndex.vue";
|
|
|
import PileHoleDetail from "@/views/cons/screen/PileHoleDetail.vue";
|
|
|
import {copyObj} from "@/utils";
|
|
|
import pileMachine from "./img/pile-machine.svg"
|
|
|
+import {MachineStatus} from "@/utils/EnumConst";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -129,6 +137,9 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
+ MachineStatus() {
|
|
|
+ return MachineStatus
|
|
|
+ },
|
|
|
noMore() {
|
|
|
return this.count >= 100
|
|
|
},
|
|
@@ -143,7 +154,7 @@ export default {
|
|
|
searchVal(val) {
|
|
|
this.searchValOnchange()
|
|
|
},
|
|
|
- machineOriList(val) {
|
|
|
+ onlineMachine(val) {
|
|
|
val && this.addMachineMarker()
|
|
|
}
|
|
|
},
|
|
@@ -262,7 +273,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
addMachineMarker() {
|
|
|
- this.machineOriList.forEach(item => {
|
|
|
+ this.onlineMachine.forEach(item => {
|
|
|
let marker = new BDLayers.Lib.Overlays.Marker(`marker${item.id}`, [item.lng, item.lat], {
|
|
|
symbol: {
|
|
|
'textName': `${item.name}`,
|
|
@@ -333,6 +344,17 @@ export default {
|
|
|
},
|
|
|
handleClick(e) {
|
|
|
},
|
|
|
+ handleMachineClick(item) {
|
|
|
+ if (item.status === MachineStatus.offline.code) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.selectMachine && this.selectMachine.id === item.id) {
|
|
|
+ this.locationClose()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.locationMachine(item)
|
|
|
+ this.selectMachine = item
|
|
|
+ },
|
|
|
locationMachine(selectMachine) {
|
|
|
this.mapIns.flyToPoint([selectMachine.lng, selectMachine.lat], {duration: 1000})
|
|
|
},
|