|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="device-analysis">
|
|
|
<div style="height: 55px;display: flex;flex-direction: column;justify-content: flex-end;padding: 0 16px;">
|
|
|
- <el-select size="mini" v-model="collectEntityId" placeholder="请选择">
|
|
|
+ <el-select size="mini" v-model="collectEntityId" :disabled="!selectOptions || selectOptions.length <= 0" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in selectOptions"
|
|
|
:key="item.value"
|
|
@@ -11,7 +11,7 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
|
|
|
- <div class="charts-outer">
|
|
|
+ <div v-if="selectOptions && selectOptions.length > 0" class="charts-outer">
|
|
|
<div class="charts-inner">
|
|
|
<jg-chart :_height="chartHeight" :option="optionToday"/>
|
|
|
<div class="chart-right-text">
|
|
@@ -85,13 +85,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div v-else style="flex: 1" v-loading="true" element-loading-background="inherit"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { currentCollectEntity } from '@/api/CollectEntity'
|
|
|
-import JgChart from '@/components/JgChart/index'
|
|
|
+import { findEntityByAcqId } from '@/api/CollectEntity'
|
|
|
+import JgChart from '@/components/JgChart'
|
|
|
import { findDuration } from '@/api/DeviceRunRecord'
|
|
|
+import { mapState } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: 'DeviceAnalysis',
|
|
@@ -353,6 +355,11 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapState({
|
|
|
+ acquisitionStationId: state => state.company.acquisitionStationId,
|
|
|
+ }),
|
|
|
+ },
|
|
|
watch: {
|
|
|
collectEntityId: {
|
|
|
handler() {
|
|
@@ -362,7 +369,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getCollectEntity() {
|
|
|
- currentCollectEntity().then(res => {
|
|
|
+ const params = {
|
|
|
+ acquisitionStationId: this.acquisitionStationId
|
|
|
+ }
|
|
|
+ findEntityByAcqId(params).then(res => {
|
|
|
if (res && res.code === '200') {
|
|
|
const selectOptions = []
|
|
|
for (const item of res.data) {
|
|
@@ -429,6 +439,8 @@ export default {
|
|
|
.device-analysis {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
|
|
|
.charts-outer {
|
|
|
flex: 1;
|