|
@@ -15,7 +15,7 @@
|
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
|
@change="onChange"
|
|
|
v-model="searchDay"/>-->
|
|
|
- <a-select v-model="searchDay" style="width: 120px" @change="onChange">
|
|
|
+<!-- <a-select v-model="searchDay" style="width: 120px" @change="onChange">
|
|
|
<a-select-option :value="parseInt('1')">
|
|
|
5分钟
|
|
|
</a-select-option>
|
|
@@ -49,7 +49,28 @@
|
|
|
<a-select-option value="11">
|
|
|
一年
|
|
|
</a-select-option>
|
|
|
- </a-select>
|
|
|
+ </a-select>-->
|
|
|
+ <a-date-picker
|
|
|
+ style="margin-left: 8px"
|
|
|
+ :format="monthFormat"
|
|
|
+ showTime
|
|
|
+ v-model="startTime"
|
|
|
+ placeholder="开始月份"
|
|
|
+ @change="onStartChange" />
|
|
|
+ <a-date-picker
|
|
|
+ style="margin-left: 8px"
|
|
|
+ :format="monthFormat"
|
|
|
+ showTime
|
|
|
+ v-model="endTime"
|
|
|
+ placeholder="结束月份"
|
|
|
+ @change="onEndChange" />
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 8px"
|
|
|
+ v-if="$auth('remote-opc-logs-export')"
|
|
|
+ type="primary"
|
|
|
+ :loading="confirmLoading"
|
|
|
+ @click="doSelect">查询
|
|
|
+ </a-button>
|
|
|
<a-button
|
|
|
style="margin-left: 8px"
|
|
|
v-if="$auth('remote-opc-logs-export')"
|
|
@@ -118,6 +139,9 @@ export default {
|
|
|
mdl: {},
|
|
|
modalTitle: null,
|
|
|
searchDay: 1,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ monthFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
map: {},
|
|
|
visible: false,
|
|
|
// 下拉框map
|
|
@@ -172,10 +196,10 @@ export default {
|
|
|
methods: {
|
|
|
base (record) {
|
|
|
this.visible = true
|
|
|
- this.confirmLoading = true
|
|
|
+ this.confirmLoading = false
|
|
|
this.modalTitle = '详情'
|
|
|
this.model = record
|
|
|
- this.onChange(1)
|
|
|
+ // this.onChange(1)
|
|
|
},
|
|
|
getCharts () {
|
|
|
// this.chart && this.chart.destroy()// 防止点击搜索按钮新增一个
|
|
@@ -226,13 +250,25 @@ export default {
|
|
|
this.chart.point().position('time*value')
|
|
|
this.chart.render()
|
|
|
},
|
|
|
- onChange (value) {
|
|
|
+ onStartChange (date, dateString) {
|
|
|
+ this.startTime = this.BaseTool.Date.formatter(dateString, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
|
|
|
+ },
|
|
|
+ onEndChange (date, dateString) {
|
|
|
+ this.endTime = this.BaseTool.Date.formatter(dateString, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
|
|
|
+ },
|
|
|
+ doSelect () {
|
|
|
+ if (this.startTime == null) {
|
|
|
+ this.$message.error('请选择查询开始时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.endTime == null) {
|
|
|
+ this.$message.error('请选择查询截止时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.confirmLoading = true
|
|
|
- this.searchDay = value
|
|
|
- const parameter = {}
|
|
|
- parameter.id = this.model.id
|
|
|
- parameter.type = value
|
|
|
- queryInfluxDBHistory(parameter).then(res => {
|
|
|
+ this.model.startTime = this.startTime
|
|
|
+ this.model.endTime = this.endTime
|
|
|
+ queryInfluxDBHistory(this.model).then(res => {
|
|
|
this.model = res.data
|
|
|
if (this.model.dataJsonStr == null) {
|
|
|
this.$message.info('无数据')
|
|
@@ -247,7 +283,17 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
doExport () {
|
|
|
+ if (this.startTime == null) {
|
|
|
+ this.$message.error('请选择查询开始时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.endTime == null) {
|
|
|
+ this.$message.error('请选择查询截止时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.confirmLoading = true
|
|
|
+ this.model.startTime = this.startTime
|
|
|
+ this.model.endTime = this.endTime
|
|
|
exportInfluxDBHistory(this.model).then(file => {
|
|
|
this.BaseTool.UPLOAD.downLoadExportExcel(file)
|
|
|
this.confirmLoading = false
|