Commit 472dd37d authored by wends's avatar wends

add 方波

parent c4cb43aa
...@@ -49,6 +49,10 @@ export default { ...@@ -49,6 +49,10 @@ export default {
format: { format: {
type: String, type: String,
default: 'HH:mm:ss' default: 'HH:mm:ss'
},
step: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -92,7 +96,9 @@ export default { ...@@ -92,7 +96,9 @@ export default {
}, },
series: [{ series: [{
name: this.title, name: this.title,
data: series data: series,
type: 'line',
step: this.step ? 'start' : this.step
}] }]
}) })
}, },
...@@ -114,6 +120,7 @@ export default { ...@@ -114,6 +120,7 @@ export default {
series: [{ series: [{
name: this.title, name: this.title,
type: 'line', type: 'line',
step: this.step ? 'start' : this.step,
data: [] data: []
}] }]
} }
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
<e-line <e-line
v-if="propertyList.length" v-if="propertyList.length"
:id="'line-' + property.propertyCode" :id="'line-' + property.propertyCode"
:step="property.propertyType === 4"
:title="property.propertyName" :title="property.propertyName"
:line-data="property.data" :line-data="property.data"
:description="property.propertyUnit" :description="property.propertyUnit"
...@@ -168,11 +169,12 @@ export default { ...@@ -168,11 +169,12 @@ export default {
if (newVal !== null) { if (newVal !== null) {
const property = this.propertyList.find(v => v.propertyCode === newVal) const property = this.propertyList.find(v => v.propertyCode === newVal)
if (property) { if (property) {
const { propertyCode, propertyName, propertyUnit } = property const { propertyCode, propertyName, propertyType, propertyUnit } = property
this.property = { this.property = {
propertyCode, propertyCode,
propertyName, propertyName,
propertyUnit, propertyUnit,
propertyType,
data: [...this.getChartData(this.activeProperty)] data: [...this.getChartData(this.activeProperty)]
} }
} }
...@@ -230,6 +232,8 @@ export default { ...@@ -230,6 +232,8 @@ export default {
this.activeProperty = this.propertyList[0].propertyCode this.activeProperty = this.propertyList[0].propertyCode
} }
this.getDeviceInstanceDetail(this.form.deviceInstance) this.getDeviceInstanceDetail(this.form.deviceInstance)
const { dataMode, deviceInstance } = this.form
this.getPropertyDetail(dataMode, deviceInstance)
return [{ return [{
modelId: this.form.dataMode, modelId: this.form.dataMode,
deviceId: this.form.deviceInstance, deviceId: this.form.deviceInstance,
...@@ -238,7 +242,9 @@ export default { ...@@ -238,7 +242,9 @@ export default {
}) })
.then(params => getModelInstanceChart(params)) .then(params => getModelInstanceChart(params))
.then(res => { .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)] this.property.data = [...this.getChartData(this.activeProperty)]
return [{ return [{
modelId: this.form.dataMode, modelId: this.form.dataMode,
...@@ -252,7 +258,9 @@ export default { ...@@ -252,7 +258,9 @@ export default {
this.timer = setInterval(async() => { this.timer = setInterval(async() => {
await this.getPropertyDetail(dataMode, deviceInstance) await this.getPropertyDetail(dataMode, deviceInstance)
const chartData = await getModelInstanceChart(params) 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.property.data = [...this.getChartData(this.activeProperty)]
}, this.form.refresh * 1000) }, this.form.refresh * 1000)
}) })
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
v-if="propertyList.length" v-if="propertyList.length"
:id="'line-' + property.propertyCode" :id="'line-' + property.propertyCode"
:title="property.propertyName" :title="property.propertyName"
:step="property.propertyType === 4"
:line-data="property.data" :line-data="property.data"
:description="property.propertyUnit" :description="property.propertyUnit"
:config="lineConfig" :config="lineConfig"
...@@ -155,6 +156,7 @@ export default { ...@@ -155,6 +156,7 @@ export default {
property: { property: {
propertyCode: null, propertyCode: null,
propertyName: null, propertyName: null,
propertyType: null,
propertyUnit: null, propertyUnit: null,
data: [] data: []
}, },
...@@ -210,11 +212,12 @@ export default { ...@@ -210,11 +212,12 @@ export default {
if (newVal) { if (newVal) {
const property = this.propertyList.find(v => v.propertyCode === newVal) const property = this.propertyList.find(v => v.propertyCode === newVal)
if (property) { if (property) {
const { propertyCode, propertyName, propertyUnit } = property const { propertyCode, propertyName, propertyType, propertyUnit } = property
this.property = { this.property = {
propertyCode, propertyCode,
propertyName, propertyName,
propertyUnit, propertyUnit,
propertyType,
data: [...this.getChartData(this.activeProperty)] data: [...this.getChartData(this.activeProperty)]
} }
} }
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<el-table-column <el-table-column
prop="onlineUpdateTime" prop="onlineUpdateTime"
label="在线状态更新时间" label="在线状态更新时间"
min-width="150px" min-width="155px"
:formatter="$moment" :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