Commit 472dd37d authored by wends's avatar wends

add 方波

parent c4cb43aa
......@@ -49,6 +49,10 @@ export default {
format: {
type: String,
default: 'HH:mm:ss'
},
step: {
type: Boolean,
default: false
}
},
data() {
......@@ -92,7 +96,9 @@ export default {
},
series: [{
name: this.title,
data: series
data: series,
type: 'line',
step: this.step ? 'start' : this.step
}]
})
},
......@@ -114,6 +120,7 @@ export default {
series: [{
name: this.title,
type: 'line',
step: this.step ? 'start' : this.step,
data: []
}]
}
......
......@@ -93,6 +93,7 @@
<e-line
v-if="propertyList.length"
:id="'line-' + property.propertyCode"
:step="property.propertyType === 4"
:title="property.propertyName"
:line-data="property.data"
:description="property.propertyUnit"
......@@ -168,11 +169,12 @@ export default {
if (newVal !== null) {
const property = this.propertyList.find(v => v.propertyCode === newVal)
if (property) {
const { propertyCode, propertyName, propertyUnit } = property
const { propertyCode, propertyName, propertyType, propertyUnit } = property
this.property = {
propertyCode,
propertyName,
propertyUnit,
propertyType,
data: [...this.getChartData(this.activeProperty)]
}
}
......@@ -230,6 +232,8 @@ export default {
this.activeProperty = this.propertyList[0].propertyCode
}
this.getDeviceInstanceDetail(this.form.deviceInstance)
const { dataMode, deviceInstance } = this.form
this.getPropertyDetail(dataMode, deviceInstance)
return [{
modelId: this.form.dataMode,
deviceId: this.form.deviceInstance,
......@@ -238,7 +242,9 @@ export default {
})
.then(params => getModelInstanceChart(params))
.then(res => {
this.tableData = res.data[0].dataList
this.tableData = res.data[0].dataList.sort((a, b) => {
return (a > b) ? 1 : -1
})
this.property.data = [...this.getChartData(this.activeProperty)]
return [{
modelId: this.form.dataMode,
......@@ -252,7 +258,9 @@ export default {
this.timer = setInterval(async() => {
await this.getPropertyDetail(dataMode, deviceInstance)
const chartData = await getModelInstanceChart(params)
this.tableData = chartData.data[0].dataList
this.tableData = chartData.data[0].dataList.sort((a, b) => {
return (a > b) ? 1 : -1
})
this.property.data = [...this.getChartData(this.activeProperty)]
}, this.form.refresh * 1000)
})
......
......@@ -63,6 +63,7 @@
v-if="propertyList.length"
:id="'line-' + property.propertyCode"
:title="property.propertyName"
:step="property.propertyType === 4"
:line-data="property.data"
:description="property.propertyUnit"
:config="lineConfig"
......@@ -155,6 +156,7 @@ export default {
property: {
propertyCode: null,
propertyName: null,
propertyType: null,
propertyUnit: null,
data: []
},
......@@ -210,11 +212,12 @@ export default {
if (newVal) {
const property = this.propertyList.find(v => v.propertyCode === newVal)
if (property) {
const { propertyCode, propertyName, propertyUnit } = property
const { propertyCode, propertyName, propertyType, propertyUnit } = property
this.property = {
propertyCode,
propertyName,
propertyUnit,
propertyType,
data: [...this.getChartData(this.activeProperty)]
}
}
......
......@@ -102,7 +102,7 @@
<el-table-column
prop="onlineUpdateTime"
label="在线状态更新时间"
min-width="150px"
min-width="155px"
:formatter="$moment"
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment