alerts rmssoh met 模块增加日期限制提醒的功能
This commit is contained in:
parent
1300030e03
commit
5f7f43f60f
22
src/views/statistics/commom.js
Normal file
22
src/views/statistics/commom.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const compareDate = function (start, end) {
|
||||
if (start == null || start.length==0 || end == null || end.length ==0) {
|
||||
return 0
|
||||
}
|
||||
var arr=start.split("-");
|
||||
var starttime=new Date(arr[0],parseInt(arr[1]-1),arr[2]);
|
||||
var starttimes=starttime.getTime();
|
||||
|
||||
var arrs=end.split("-");
|
||||
var endtime=new Date(arrs[0],parseInt(arrs[1]-1),arrs[2]);
|
||||
var endtimes=endtime.getTime();
|
||||
|
||||
var intervalTime = endtimes-starttimes;//两个日期相差的毫秒数 一天86400000毫秒
|
||||
var Inter_Days = ((intervalTime).toFixed(2)/86400000)+1;//加1,是让同一天的两个日期返回一天
|
||||
|
||||
return Inter_Days;
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
compareDate
|
||||
}
|
|
@ -90,6 +90,7 @@ const columns = [
|
|||
dataIndex: 'aveWindSpeed',
|
||||
}
|
||||
]
|
||||
import { compareDate } from "../../commom"
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
|
||||
|
@ -122,25 +123,30 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
searchQueryData() {
|
||||
this.isImmediate = false
|
||||
this.queryParam = {
|
||||
startTime: "2023-01-01",
|
||||
endTime: "2023-07-10",
|
||||
stationIds: [209, 210]
|
||||
}
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.ipagination.current = res.result.current
|
||||
this.ipagination.pageSize = res.result.size
|
||||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
|
||||
if (days <= 10) {
|
||||
this.isImmediate = false
|
||||
// this.queryParam = {
|
||||
// startTime: "2023-01-01",
|
||||
// endTime: "2023-07-10",
|
||||
// stationIds: [209, 210]
|
||||
// }
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
})
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.ipagination.current = res.result.current
|
||||
this.ipagination.pageSize = res.result.size
|
||||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.info("Maximum timespan duration is 10 days. Please, change start or end date.")
|
||||
}
|
||||
},
|
||||
findStationList() {
|
||||
getAction(this.url.findStationList, { menuName: '' }).then((res) => {
|
||||
|
|
|
@ -74,6 +74,7 @@ const columns = [
|
|||
dataIndex: 'alertText',
|
||||
}
|
||||
]
|
||||
import { compareDate } from "../../commom"
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
|
||||
|
@ -106,25 +107,30 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
searchQueryData() {
|
||||
this.isImmediate = false
|
||||
this.queryParam = {
|
||||
startTime: "2023-01-01",
|
||||
endTime: "2023-07-10",
|
||||
stationIds: [209, 210]
|
||||
}
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.ipagination.current = res.result.current
|
||||
this.ipagination.pageSize = res.result.size
|
||||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
|
||||
if (days <= 10) {
|
||||
this.isImmediate = false
|
||||
// this.queryParam = {
|
||||
// startTime: "2023-01-01",
|
||||
// endTime: "2023-07-10",
|
||||
// stationIds: [209, 210]
|
||||
// }
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
})
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.ipagination.current = res.result.current
|
||||
this.ipagination.pageSize = res.result.size
|
||||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.info("Maximum timespan duration is 10 days. Please, change start or end date.")
|
||||
}
|
||||
},
|
||||
findStationList() {
|
||||
getAction(this.url.findStationList, { menuName: '' }).then((res) => {
|
||||
|
|
|
@ -70,6 +70,7 @@ const columns = [
|
|||
dataIndex: 'sohId',
|
||||
}
|
||||
]
|
||||
import { compareDate } from "../../commom"
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
|
||||
|
@ -102,25 +103,30 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
searchQueryData() {
|
||||
this.isImmediate = false
|
||||
this.queryParam = {
|
||||
startTime: "2023-01-01",
|
||||
endTime: "2023-07-10",
|
||||
stationIds: [209, 210]
|
||||
}
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.ipagination.current = res.result.current
|
||||
this.ipagination.pageSize = res.result.size
|
||||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
|
||||
if (days <= 10) {
|
||||
this.isImmediate = false
|
||||
// this.queryParam = {
|
||||
// startTime: "2023-01-01",
|
||||
// endTime: "2023-07-10",
|
||||
// stationIds: [209, 210]
|
||||
// }
|
||||
let params = {
|
||||
...this.queryParam,
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
})
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.ipagination.current = res.result.current
|
||||
this.ipagination.pageSize = res.result.size
|
||||
this.ipagination.total = res.result.total
|
||||
this.dataSource = res.result.records
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.info("Maximum timespan duration is 10 days. Please, change start or end date.")
|
||||
}
|
||||
},
|
||||
findStationList() {
|
||||
getAction(this.url.findStationList, { menuName: '' }).then((res) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user