|
|
@@ -51,19 +51,6 @@
|
|
|
end-placeholder="结束日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
- <!-- <el-date-picker
|
|
|
- type="date"
|
|
|
- v-model="times"
|
|
|
- size="small"
|
|
|
- :clearable="false"
|
|
|
- style="width:180px;"
|
|
|
- format="yyyy年MM月dd日"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- value-format="timestamp"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker> -->
|
|
|
<el-button
|
|
|
style="margin-left:8px;"
|
|
|
icon="el-icon-search"
|
|
|
@@ -72,6 +59,25 @@
|
|
|
@click="get_has_records"
|
|
|
>查询</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-arrow-left"
|
|
|
+ type="primary"
|
|
|
+ style="margin-left: 5px;"
|
|
|
+ size="mini"
|
|
|
+ v-debounce="handle_time_left"
|
|
|
+ >前一天</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-arrow-right"
|
|
|
+ style="margin-left: 5px;"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ v-debounce="handle_time_right"
|
|
|
+ >后一天</el-button
|
|
|
+ >
|
|
|
+ <el-button style="margin-left: 5px;" type="primary" size="mini" @click="localtion_history"
|
|
|
+ >历史数据</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
style="margin-left:8px;"
|
|
|
type="primary"
|
|
|
@@ -277,106 +283,6 @@ export default {
|
|
|
/**曲线数据*/
|
|
|
one_curve: {},
|
|
|
two_curve: {},
|
|
|
- // one_curve: {
|
|
|
- // name: '21.J1',
|
|
|
- // unit: 'N',
|
|
|
- // time: 1673020800,
|
|
|
- // title: '转换阻力峰值统计图',
|
|
|
- // curve_data: [
|
|
|
- // {
|
|
|
- // name: '定扳反转换阻力峰值',
|
|
|
- // color: '#a8ff78',
|
|
|
- // data: [
|
|
|
- // [1673079611000, 11],
|
|
|
- // [1673086811000, 21],
|
|
|
- // [1673090411000, 17],
|
|
|
- // [1673094020000, 14],
|
|
|
- // ],
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '反扳定转换阻力峰值',
|
|
|
- // color: '#FFE000',
|
|
|
- // data: [
|
|
|
- // [1673079611000, -18],
|
|
|
- // [1673086811000, -7],
|
|
|
- // [1673090411000, -15],
|
|
|
- // [1673094020000, -12],
|
|
|
- // ],
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // line: [
|
|
|
- // {
|
|
|
- // name: '定扳反预警线',
|
|
|
- // value: 10,
|
|
|
- // color: 'yellow',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '定扳反告警线',
|
|
|
- // value: 26,
|
|
|
- // color: 'red',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '反扳定预警线',
|
|
|
- // value: -10,
|
|
|
- // color: 'yellow',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '反扳定告警线',
|
|
|
- // value: -16,
|
|
|
- // color: 'red',
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // },
|
|
|
- // two_curve: {
|
|
|
- // name: '21.J1',
|
|
|
- // unit: 'N',
|
|
|
- // time: 1673020800,
|
|
|
- // title: '定反位锁闭力值统计图',
|
|
|
- // curve_data: [
|
|
|
- // {
|
|
|
- // name: '定位锁闭力值',
|
|
|
- // color: '#a8ff78',
|
|
|
- // data: [
|
|
|
- // [1673079611000, 11],
|
|
|
- // [1673086811000, 7],
|
|
|
- // [1673090411000, 17],
|
|
|
- // [1673094020000, 14],
|
|
|
- // ],
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '反位锁闭力值',
|
|
|
- // color: '#FFE000',
|
|
|
- // data: [
|
|
|
- // [1673079611000, -18],
|
|
|
- // [1673086811000, -7],
|
|
|
- // [1673090411000, -15],
|
|
|
- // [1673094020000, -12],
|
|
|
- // ],
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // line: [
|
|
|
- // {
|
|
|
- // name: '定位锁闭力预警线',
|
|
|
- // value: 10,
|
|
|
- // color: 'yellow',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '定位锁闭力告警线',
|
|
|
- // value: 16,
|
|
|
- // color: 'red',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '反位锁闭力预警线',
|
|
|
- // value: -10,
|
|
|
- // color: 'yellow',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name: '反位锁闭力告警线',
|
|
|
- // value: -16,
|
|
|
- // color: 'red',
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // },
|
|
|
/**转换阻力报警值设置*/
|
|
|
convert_resist: {
|
|
|
enable: false,
|
|
|
@@ -416,6 +322,44 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 前往历史数据
|
|
|
+ localtion_history() {
|
|
|
+ if (!this.send_data.mo || !this.send_data.mp)
|
|
|
+ return this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ showClose: true,
|
|
|
+ duration: 1500,
|
|
|
+ message: '请选择重要信息',
|
|
|
+ })
|
|
|
+ let route_data = {
|
|
|
+ name: 'force',
|
|
|
+ query: {
|
|
|
+ tag: this.click_id,
|
|
|
+ time: this.times[0] / 1000,
|
|
|
+ endtime: this.times[1] / 1000 + 24 * 60 * 60 - 1,
|
|
|
+ title: this.send_data.name,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ this.$router.push(route_data)
|
|
|
+ this.$store.state.defaultActive = '/layout/force'
|
|
|
+ this.$store.commit('handle_save_defaultActive', '/layout/force')
|
|
|
+ },
|
|
|
+ // 前一天
|
|
|
+ handle_time_left() {
|
|
|
+ let start_time = this.times[0] - 24 * 60 * 60 * 1000
|
|
|
+ let end_time = this.times[1] - 24 * 60 * 60 * 1000
|
|
|
+ this.times = [start_time, end_time]
|
|
|
+ if (!this.click_id) return
|
|
|
+ return this.get_has_records()
|
|
|
+ },
|
|
|
+ // 后一天
|
|
|
+ handle_time_right() {
|
|
|
+ let start_time = this.times[0] + 24 * 60 * 60 * 1000
|
|
|
+ let end_time = this.times[1] + 24 * 60 * 60 * 1000
|
|
|
+ this.times = [start_time, end_time]
|
|
|
+ if (!this.click_id) return
|
|
|
+ return this.get_has_records()
|
|
|
+ },
|
|
|
// 导出Image
|
|
|
export_img() {
|
|
|
if (!this.send_data.mo || !this.send_data.mp)
|
|
|
@@ -655,7 +599,6 @@ export default {
|
|
|
myCharts = this.$echarts.init(document.getElementById('one'))
|
|
|
}
|
|
|
let option = curveStatisticalOption(this.one_curve)
|
|
|
- console.log(1, option)
|
|
|
myCharts.setOption(option, true)
|
|
|
window.addEventListener('resize', () => {
|
|
|
myCharts.resize()
|
|
|
@@ -674,7 +617,6 @@ export default {
|
|
|
myCharts = this.$echarts.init(document.getElementById('two'))
|
|
|
}
|
|
|
let option = curveStatisticalOption(this.two_curve)
|
|
|
- console.log(2, option)
|
|
|
myCharts.setOption(option, true)
|
|
|
window.addEventListener('resize', () => {
|
|
|
myCharts.resize()
|
|
|
@@ -711,11 +653,54 @@ export default {
|
|
|
this.draw_position_curve()
|
|
|
this.draw_invert_curve()
|
|
|
},
|
|
|
+ // 判断URL中是否有参数
|
|
|
+ url_is_query() {
|
|
|
+ if (this.$route.query.tag) {
|
|
|
+ let query = this.$route.query
|
|
|
+ return this.format_query(query)
|
|
|
+ }
|
|
|
+ return this.get_time()
|
|
|
+ },
|
|
|
+ // 解析query
|
|
|
+ format_query(query) {
|
|
|
+ let tag = query.tag.split('.')
|
|
|
+ let title = query.title
|
|
|
+ if (tag.length == 3) {
|
|
|
+ tag.splice(-1, 1)
|
|
|
+ }
|
|
|
+ this.send_data.mo = tag[0]
|
|
|
+ this.send_data.mp = tag[1]
|
|
|
+ this.send_data.name = title
|
|
|
+ this.click_id = query.tag
|
|
|
+ let start_time = null,
|
|
|
+ end_time = null
|
|
|
+ if (query.time && query.endtime) {
|
|
|
+ start_time = this.$dayjs(query.time * 1000).format('YYYY-MM-DD 00:00:00')
|
|
|
+ end_time = this.$dayjs(query.endtime * 1000).format('YYYY-MM-DD 00:00:00')
|
|
|
+ start_time = this.$dayjs(start_time).valueOf()
|
|
|
+ end_time = this.$dayjs(end_time).valueOf()
|
|
|
+ } else {
|
|
|
+ return this.get_time()
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ if (title.includes('.')) {
|
|
|
+ let target_search = title.split('.')
|
|
|
+ this.search_data = target_search[0]
|
|
|
+ } else {
|
|
|
+ this.search_data = title
|
|
|
+ }
|
|
|
+ }, 300)
|
|
|
+ this.times = [start_time, end_time]
|
|
|
+ setTimeout(() => {
|
|
|
+ return this.get_curve_data()
|
|
|
+ }, 100)
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.get_time()
|
|
|
+ this.url_is_query()
|
|
|
},
|
|
|
activated() {
|
|
|
+ this.url_is_query()
|
|
|
if (this.click_id) {
|
|
|
this.res_time = +new Date()
|
|
|
} else {
|