Kaynağa Gözat

数据查询增加小数位和量程

zhoupeng 1 yıl önce
ebeveyn
işleme
6b11dca5be

+ 2 - 3
industry-admin/src/views/device/deviceLedger/spanLedger.vue

@@ -1,6 +1,6 @@
 <template>
     <div @click="click(source.id)">
-        <el-tag :type="type">{{ source.deviceName }}</el-tag>
+        <el-button size="mini" plain round>{{ source.deviceName }}</el-button>
     </div>
 </template>
 
@@ -22,12 +22,11 @@ export default {
     },
     data() {
         return {
-            type: 'info'
+            type: ''
         }
     },
     methods: {
         click(data) {
-            this.type = 'success'
             this.acceptData(data)
         }
     }

+ 19 - 6
industry-admin/src/views/source/dataQuery/index.vue

@@ -125,15 +125,22 @@ export default {
             chartForm: {
                 itemListTitile: '',
                 idList: [],
-                decimalPlaces: 0,
+                //趋势类型
                 trendType: 0,
-                range: null,
+                //频率值
                 frequencyValue: 1,
+                //频率类型
                 frequencyType: 0,
+                //时间值
                 timeValue: 60,
+                //时间类型
                 timeType: 0,
                 startTime: null,
-                endTime: null
+                endTime: null,
+                //小数位数
+                decimalPlaces: 2,
+                //量程
+                range: null,
             },
             chooseStartTime: null,
             chooseEndTime: null,
@@ -388,18 +395,22 @@ export default {
                     }
                     seriesData.push(b)
                 }
-                // let decimalPlaces = this.chartForm.decimalPlaces
+                let decimalPlaces = parseInt(this.chartForm.decimalPlaces)
                 this.tooltip.formatter = function (params, ticket, callback) {
                     let b = '<div style="display:inline;">'
                     for (let a of params) {
                         b += '<div><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + a.color + ';"></span><span style="color:' + a.color + '">'
-                            + a.name + '    ' + a.seriesName + ': ' + a.data + '</span></div>'
+                            + a.name + '    ' + a.seriesName + ': ' + a.data.substring(0, a.data.indexOf(".") + 1 + decimalPlaces) + '</span></div>'
                     }
                     b += '</div>'
                     return b
                 }
                 this.legend.data = legendData
                 this.xAxis.data = data[0].dataTimeList
+                this.yAxis[0].max = null
+                if (this.chartForm.range) {
+                    this.yAxis[0].max = parseInt(this.chartForm.range)
+                }
                 this.series = seriesData
                 this.chart.setOption({
                     backgroundColor: this.backgroundColor,
@@ -500,7 +511,9 @@ export default {
                         this.series[i].data = arr.splice(num)
                     }
                     //更新统计图
-                    this.chart.setOption({ xAxis: this.xAxis, series: this.series });
+                    if (this.chart) {
+                        this.chart.setOption({ xAxis: this.xAxis, series: this.series })
+                    }
                 }
             })
         },

+ 1 - 1
industry-admin/src/views/source/itemGroup/item.vue

@@ -257,7 +257,7 @@ export default {
                 return
             }
             let filterList = arr.filter(v => {
-                return v.itemName.indexOf(value) !== -1
+                return v.itemReadName.indexOf(value) !== -1
             })
             this.tableData = filterList
         },