|
|
@@ -37,13 +37,21 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <chart_temp :id="info.id"></chart_temp>
|
|
|
+ <!-- <chart_temp :id="info.id"></chart_temp>
|
|
|
<chart_speed :id="info.id"></chart_speed>
|
|
|
<chart_pressure :id="info.id"></chart_pressure>
|
|
|
<runningDialog
|
|
|
ref="runningDialog"
|
|
|
:id="info.id"
|
|
|
@succeed="getRealData"
|
|
|
+ ></runningDialog> -->
|
|
|
+ <chart_temp :id="id"></chart_temp>
|
|
|
+ <chart_speed :id="id"></chart_speed>
|
|
|
+ <chart_pressure :id="id"></chart_pressure>
|
|
|
+ <runningDialog
|
|
|
+ ref="runningDialog"
|
|
|
+ :id="id"
|
|
|
+ @succeed="getRealData"
|
|
|
></runningDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -53,15 +61,19 @@
|
|
|
import chart_speed from './components/chart_speed.vue';
|
|
|
import chart_temp from './components/chart_temp.vue';
|
|
|
import runningDialog from '../components/runningDialog.vue';
|
|
|
- // import { getRealData } from '@/api/ledgerAssets/equipment.js';
|
|
|
+ import { getRealData } from '@/api/ledgerAssets/equipment.js';
|
|
|
// import mqtt from '../mixins/mqtt.js';
|
|
|
// import { debounce } from 'lodash';
|
|
|
export default {
|
|
|
// mixins: [mqtt],
|
|
|
props: {
|
|
|
- info: {
|
|
|
- type: Object,
|
|
|
- default: {}
|
|
|
+ // info: {
|
|
|
+ // type: Object,
|
|
|
+ // default: {}
|
|
|
+ // },
|
|
|
+ id: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -92,9 +104,17 @@
|
|
|
computed: {
|
|
|
// mqtt topic
|
|
|
TOPIC() {
|
|
|
- if (this.info.iotId) {
|
|
|
+ // if (this.info.iotId) {
|
|
|
+ // return {
|
|
|
+ // topic: `/${this.topIc_type}/${this.info.iotId}`,
|
|
|
+ // qos: 0
|
|
|
+ // };
|
|
|
+ // } else {
|
|
|
+ // return null;
|
|
|
+ // }
|
|
|
+ if (this.id) {
|
|
|
return {
|
|
|
- topic: `/${this.topIc_type}/${this.info.iotId}`,
|
|
|
+ topic: `/${this.topIc_type}/${this.id}`,
|
|
|
qos: 0
|
|
|
};
|
|
|
} else {
|
|
|
@@ -105,7 +125,7 @@
|
|
|
created() {
|
|
|
this.getRealData();
|
|
|
if (this.TOPIC) {
|
|
|
- this.mqttInit();
|
|
|
+ // this.mqttInit();
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -350,12 +370,24 @@
|
|
|
async getRealData() {
|
|
|
// await getRealData(this.info.id).then((res) => {
|
|
|
// let data = res.data;
|
|
|
- // console.log("实时数据", data);
|
|
|
+ // console.log('实时数据', data);
|
|
|
// for (const item of data) {
|
|
|
// this.$set(this.realData, item.identifier, item);
|
|
|
// }
|
|
|
// });
|
|
|
- this.initGauge();
|
|
|
+ await getRealData(this.id).then((res) => {
|
|
|
+ let data = res;
|
|
|
+ console.log('实时数据', data);
|
|
|
+ for (const item of data) {
|
|
|
+ this.$set(this.realData, item.identifier, item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.initGauge();
|
|
|
+ });
|
|
|
+ }, 3000);
|
|
|
},
|
|
|
// mqtt处理数据
|
|
|
initMqttData(items) {
|