联调cvt执行算法 修改测试bug
This commit is contained in:
@@ -12,15 +12,16 @@
|
||||
执行日期:
|
||||
<el-date-picker
|
||||
v-model="time"
|
||||
type="daterange"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
:picker-options="pickerOptions"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
<el-button type="primary" @click="handleClose">执 行</el-button>
|
||||
<el-button type="primary" @click="execute">执 行</el-button>
|
||||
</div>
|
||||
<el-input placeholder="输入关键字检索" v-model="filterText" style="margin-bottom: 10px" clearable>
|
||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||
@@ -56,12 +57,14 @@
|
||||
<script>
|
||||
import api from '@/api/harmonic/onlineData'
|
||||
import { dicData } from '@/assets/commjs/dictypeData'
|
||||
import { measurementPointExecutorByHour } from '@/api/CVT/index.js'
|
||||
export default {
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
time: [new Date(), new Date()],
|
||||
time: [],
|
||||
// value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
|
||||
dialogVisible: false,
|
||||
checkedarr: [],
|
||||
fiveData: [],
|
||||
@@ -79,7 +82,14 @@ export default {
|
||||
scale: null
|
||||
},
|
||||
filterText: '',
|
||||
fiveData: []
|
||||
fiveData: [],
|
||||
fatherID: [],
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now() - 8.64e6
|
||||
// 或者return time.getTime() > Date.now();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -100,8 +110,23 @@ export default {
|
||||
this.chuli()
|
||||
}
|
||||
})
|
||||
// 获取年份
|
||||
const year = new Date().getFullYear()
|
||||
// 获取月份(注意:getMonth 返回值是 0 - 11,所以要加 1),并确保是两位数
|
||||
const month = String(new Date().getMonth() + 1).padStart(2, '0')
|
||||
// 获取日期,并确保是两位数
|
||||
const day = String(new Date().getDate()).padStart(2, '0')
|
||||
// 获取小时,并确保是两位数
|
||||
const hours = String(new Date().getHours()).padStart(2, '0')
|
||||
// 获取分钟,并确保是两位数
|
||||
const minutes = String(new Date().getMinutes()).padStart(2, '0')
|
||||
// 获取秒数,并确保是两位数
|
||||
const seconds = String(new Date().getSeconds()).padStart(2, '0')
|
||||
|
||||
this.time = [`${year}-${month}-${day} 00:00:00`, `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`]
|
||||
},
|
||||
chuli() {
|
||||
this.fatherID = []
|
||||
var data = this.fiveData
|
||||
var arr = []
|
||||
data.forEach(item => {
|
||||
@@ -128,8 +153,10 @@ export default {
|
||||
if (arr[0].children[0].children[0].children.length > 0) {
|
||||
arr.forEach(m => {
|
||||
m.icon = 'el-icon-menu'
|
||||
this.fatherID.push(m.id)
|
||||
m.children.forEach(n => {
|
||||
n.icon = 'el-icon-share'
|
||||
this.fatherID.push(n.id)
|
||||
n.children.forEach(d => {
|
||||
d.icon = 'el-icon-s-flag'
|
||||
d.children.forEach((f, i) => {
|
||||
@@ -148,8 +175,10 @@ export default {
|
||||
} else if (arr[0].children[0].children[0].children.length == 0) {
|
||||
arr.forEach(m => {
|
||||
m.icon = 'el-icon-menu'
|
||||
this.fatherID.push(m.id)
|
||||
m.children.forEach(n => {
|
||||
n.icon = 'el-icon-share'
|
||||
this.fatherID.push(n.id)
|
||||
n.children.forEach((d, i) => {
|
||||
d.icon = 'el-icon-warning'
|
||||
d.name = i + 1 + '_' + d.name
|
||||
@@ -169,9 +198,7 @@ export default {
|
||||
|
||||
window.sessionStorage.setItem('tree', this.tree)
|
||||
this.expandID.push(this.currentNode)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.menuTree.setCurrentKey(this.currentNode)
|
||||
})
|
||||
|
||||
//初始化触发默认点击方法
|
||||
//alert('初始1')
|
||||
this.$emit('chushiData', this.currentNode, this.treeMenuData)
|
||||
@@ -179,6 +206,7 @@ export default {
|
||||
|
||||
renderContent(h, { node, data, store }) {
|
||||
this.onlinename = node.label
|
||||
|
||||
return (
|
||||
<span style="flex: 1; display: flex; align-items: center; justify-content: space-between; padding-right: 8px;">
|
||||
<span class="span-ellipsis">
|
||||
@@ -191,11 +219,28 @@ export default {
|
||||
</span>
|
||||
)
|
||||
},
|
||||
// 执行算法
|
||||
async execute() {
|
||||
if (this.$refs.menuTree.getCheckedKeys().length == 0) return this.$message.error('请选择监测点!')
|
||||
|
||||
let data = {
|
||||
beginTime: this.time[0],
|
||||
dataDate: '',
|
||||
endTime: this.time[1],
|
||||
fullChain: false,
|
||||
idList: this.$refs.menuTree.getCheckedKeys().filter(item => !this.fatherID.includes(item)),
|
||||
repair: true,
|
||||
tagNames: ['dataHarmRateVCvt']
|
||||
}
|
||||
await measurementPointExecutorByHour(data)
|
||||
this.$message.success('算法执行成功!')
|
||||
this.handleClose()
|
||||
},
|
||||
|
||||
// 关闭弹窗
|
||||
handleClose() {
|
||||
console.log(this.time)
|
||||
|
||||
this.dialogVisible = false
|
||||
this.$emit('close')
|
||||
},
|
||||
// 过滤树节点
|
||||
filterNode(value, data, node) {
|
||||
|
||||
Reference in New Issue
Block a user