|
@@ -11,10 +11,42 @@
|
|
|
<div class="table-operator" style="margin-bottom: 8px;">
|
|
|
<a-row>
|
|
|
<a-col :md="16">
|
|
|
- <a-date-picker
|
|
|
+ <!-- <a-date-picker
|
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
|
@change="onChange"
|
|
|
- v-model="searchDay"/>
|
|
|
+ v-model="searchDay"/>-->
|
|
|
+ <a-select default-value="1" v-model="searchDay" style="width: 120px" @change="onChange">
|
|
|
+ <a-select-option value="1">
|
|
|
+ 5分钟
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="2">
|
|
|
+ 15分钟
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="3">
|
|
|
+ 1小时
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="4">
|
|
|
+ 3小时
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="5">
|
|
|
+ 6小时
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="6">
|
|
|
+ 12小时
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="7">
|
|
|
+ 24小时
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="8">
|
|
|
+ 2天
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="9">
|
|
|
+ 7天
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="10">
|
|
|
+ 30天
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
<a-button
|
|
|
style="margin-left: 8px"
|
|
|
v-if="$auth('remote-opc-logs-export')"
|
|
@@ -35,11 +67,11 @@
|
|
|
<detail-list-item term="描述">{{ model.description }}</detail-list-item>
|
|
|
<detail-list-item term="系数">{{ model.ratio }}</detail-list-item>
|
|
|
<detail-list-item term="单位">{{ model.unit }}</detail-list-item>
|
|
|
- <!-- <detail-list-item term="备注">{{ model.remark }}</detail-list-item>-->
|
|
|
+ <!-- <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
|
|
|
<detail-list-item term="年">{{ model.year }}</detail-list-item>
|
|
|
<detail-list-item term="月">{{ model.month }}</detail-list-item>
|
|
|
<detail-list-item term="日">{{ model.day }}</detail-list-item>
|
|
|
- <!-- <detail-list-item term="时">{{ model.hour }}</detail-list-item>
|
|
|
+ <detail-list-item term="时">{{ model.hour }}</detail-list-item>
|
|
|
<detail-list-item term="实时数值">{{ model.result }}</detail-list-item>
|
|
|
<detail-list-item term="创建人">{{ model.createdUserId }}</detail-list-item>
|
|
|
<detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>
|
|
@@ -49,7 +81,7 @@
|
|
|
<div style="width: 100%">
|
|
|
<div id="container"></div>
|
|
|
</div>
|
|
|
- <a-divider orientation="left">数组明细</a-divider>
|
|
|
+ <a-divider orientation="left">数据明细</a-divider>
|
|
|
<div>
|
|
|
<a-table
|
|
|
bordered
|
|
@@ -66,8 +98,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { Chart } from '@antv/g2'
|
|
|
-import { exportRemoteOpcLogOneDay, queryRemoteOpcLogByDTO } from '@/api/remote/opc-log'
|
|
|
import DetailList from '@/components/tools/DetailList'
|
|
|
+import { queryInfluxDBHistory, exportInfluxDBHistory } from '@/api/influxDB/influxDB'
|
|
|
const DetailListItem = DetailList.Item
|
|
|
|
|
|
export default {
|
|
@@ -124,31 +156,12 @@ export default {
|
|
|
this.map = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REMOTE_OPC)
|
|
|
},
|
|
|
methods: {
|
|
|
- base (record, param) {
|
|
|
+ base (record) {
|
|
|
this.visible = true
|
|
|
this.confirmLoading = true
|
|
|
this.modalTitle = '详情'
|
|
|
- if (!this.BaseTool.Object.isBlank(record)) {
|
|
|
- this.model = record
|
|
|
- if (this.model.dataJsonStr == null) {
|
|
|
- this.$message.info('无数据')
|
|
|
- }
|
|
|
- this.chartsData = JSON.parse(this.model.dataJsonStr)
|
|
|
- this.getCharts(this.chartsData)
|
|
|
- this.confirmLoading = false
|
|
|
- } else {
|
|
|
- queryRemoteOpcLogByDTO(param).then((res) => {
|
|
|
- this.model = res.data
|
|
|
- if (this.model.dataJsonStr == null) {
|
|
|
- this.$message.info('无数据')
|
|
|
- }
|
|
|
- this.chartsData = JSON.parse(this.model.dataJsonStr)
|
|
|
- this.getCharts(this.chartsData)
|
|
|
- this.confirmLoading = false
|
|
|
- }).catch(() => {
|
|
|
- this.confirmLoading = false
|
|
|
- })
|
|
|
- }
|
|
|
+ this.model = record
|
|
|
+ this.onChange(1)
|
|
|
},
|
|
|
getCharts (data) {
|
|
|
this.chart && this.chart.destroy()// 防止点击搜索按钮新增一个
|
|
@@ -194,14 +207,12 @@ export default {
|
|
|
this.chart.point().position('time*value')
|
|
|
this.chart.render()
|
|
|
},
|
|
|
- onChange (date, dateString) {
|
|
|
+ onChange (value) {
|
|
|
this.confirmLoading = true
|
|
|
- const param = {}
|
|
|
- param.positionNum = this.model.positionNum
|
|
|
- param.year = date.format(this.BaseTool.Date.PICKER_NORM_YEAR)
|
|
|
- param.month = date.format(this.BaseTool.Date.PICKER_NORM_MONTH_ONE)
|
|
|
- param.day = date.format(this.BaseTool.Date.PICKER_NORM_DAY_ONE)
|
|
|
- queryRemoteOpcLogByDTO(param).then((res) => {
|
|
|
+ const parameter = {}
|
|
|
+ parameter.id = this.model.id
|
|
|
+ parameter.type = value
|
|
|
+ queryInfluxDBHistory(parameter).then(res => {
|
|
|
this.model = res.data
|
|
|
if (this.model.dataJsonStr == null) {
|
|
|
this.$message.info('无数据')
|
|
@@ -215,7 +226,7 @@ export default {
|
|
|
},
|
|
|
doExport () {
|
|
|
this.confirmLoading = true
|
|
|
- exportRemoteOpcLogOneDay(this.model).then(file => {
|
|
|
+ exportInfluxDBHistory(this.model).then(file => {
|
|
|
this.BaseTool.UPLOAD.downLoadExportExcel(file)
|
|
|
this.confirmLoading = false
|
|
|
})
|