|
@@ -4,7 +4,7 @@
|
|
|
:visible="visible"
|
|
|
:confirm-loading="confirmLoading"
|
|
|
:footer="null"
|
|
|
- :width="800"
|
|
|
+ :width="1200"
|
|
|
@cancel="handleCancel"
|
|
|
>
|
|
|
<div class="chart">
|
|
@@ -13,17 +13,28 @@
|
|
|
<a-form :form="form">
|
|
|
<a-row type="flex" justify="end">
|
|
|
<a-col :span="10">
|
|
|
- <a-form-item label="开始时间" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
+ <a-form-item label="查询时间" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
<a-date-picker
|
|
|
:format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
|
|
|
- v-model="queryParam.searchStartTime" />
|
|
|
+ v-model="queryParam.createdTimeEnd" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="10">
|
|
|
- <a-form-item label="结束时间" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-date-picker
|
|
|
- :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
|
|
|
- v-model="queryParam.searchEndTime" />
|
|
|
+ <a-form-item label="时间跨度" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
+ <a-select default-value="1" v-model="queryParam.searchType" style="width: 120px">
|
|
|
+ <a-select-option value="1">
|
|
|
+ 10分钟
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="2">
|
|
|
+ 20分钟
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="3">
|
|
|
+ 30分钟
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="4">
|
|
|
+ 60分钟
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="3">
|
|
@@ -44,6 +55,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { Chart } from '@antv/g2'
|
|
|
+import { queryRemoteOpcLog } from '@/api/remote/opc-log'
|
|
|
|
|
|
export default {
|
|
|
data () {
|
|
@@ -52,8 +64,9 @@ export default {
|
|
|
visible: false,
|
|
|
confirmLoading: false,
|
|
|
queryParam: {},
|
|
|
+ remoteOpc: null,
|
|
|
+ positionNum: null,
|
|
|
chart1: null,
|
|
|
- dataList1: [],
|
|
|
dataList: [
|
|
|
{ time: '2009/7/20 0:00', value: 32, type: 'aa' },
|
|
|
{ time: '2009/7/20 1:00', value: 8, type: 'bb' },
|
|
@@ -74,14 +87,35 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- base () {
|
|
|
+ base (remoteOpc) {
|
|
|
this.visible = true
|
|
|
- this.$nextTick(() => {
|
|
|
+ this.remoteOpc = remoteOpc
|
|
|
+ /* this.$nextTick(() => {
|
|
|
this.createChart(this.dataList)
|
|
|
- })
|
|
|
+ }) */
|
|
|
},
|
|
|
getInfo () {
|
|
|
-
|
|
|
+ this.queryParam.createdTimeEnd = this.queryParam.createdTimeEnd ? this.BaseTool.Date.formatter(this.queryParam.createdTimeEnd, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN) : null
|
|
|
+ this.queryParam.positionNum = this.remoteOpc.positionNum
|
|
|
+ if (this.queryParam.createdTimeEnd == null) {
|
|
|
+ this.$message.error('请选择查询时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.queryParam.searchType == null) {
|
|
|
+ this.$message.error('请选择时间跨度')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ queryRemoteOpcLog(this.queryParam)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data == null || res.data.length === 0) {
|
|
|
+ this.$message.error('无数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const data = []
|
|
|
+ res.data.filter(item => data.push({ time: item.createdTime, value: item.result, type: this.remoteOpc.sbName }))
|
|
|
+ this.dataList = data
|
|
|
+ this.createChart(this.dataList)
|
|
|
+ })
|
|
|
},
|
|
|
createChart (data) {
|
|
|
this.chart1 && this.chart1.destroy()
|