联调cvt执行算法 修改测试bug

This commit is contained in:
GGJ
2025-03-10 11:29:46 +08:00
parent 15e1be00af
commit 52a0b67f96
10 changed files with 113 additions and 143 deletions

View File

@@ -20,7 +20,7 @@ export function queryPage(data) {
return request({ return request({
url: '/device-boot/cvt/queryPage', url: '/device-boot/cvt/queryPage',
method: 'post', method: 'post',
data data
}) })
} }
// 修改cvt系数 // 修改cvt系数
@@ -47,3 +47,11 @@ export function queryByLineId(data) {
params: data params: data
}) })
} }
// 执行算法
export function measurementPointExecutorByHour(data) {
return request({
url: '/prepare-boot/executor/measurementPointExecutorByHour',
method: 'post',
data
})
}

View File

@@ -12,15 +12,16 @@
执行日期: 执行日期:
<el-date-picker <el-date-picker
v-model="time" v-model="time"
type="daterange" type="datetimerange"
range-separator="" range-separator=""
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd" format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
></el-date-picker> ></el-date-picker>
</div> </div>
<el-button type="primary" @click="handleClose"> </el-button> <el-button type="primary" @click="execute"> </el-button>
</div> </div>
<el-input placeholder="输入关键字检索" v-model="filterText" style="margin-bottom: 10px" clearable> <el-input placeholder="输入关键字检索" v-model="filterText" style="margin-bottom: 10px" clearable>
<i slot="prefix" class="el-input__icon el-icon-search"></i> <i slot="prefix" class="el-input__icon el-icon-search"></i>
@@ -56,12 +57,14 @@
<script> <script>
import api from '@/api/harmonic/onlineData' import api from '@/api/harmonic/onlineData'
import { dicData } from '@/assets/commjs/dictypeData' import { dicData } from '@/assets/commjs/dictypeData'
import { measurementPointExecutorByHour } from '@/api/CVT/index.js'
export default { export default {
components: {}, components: {},
props: {}, props: {},
data() { data() {
return { return {
time: [new Date(), new Date()], time: [],
// value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
dialogVisible: false, dialogVisible: false,
checkedarr: [], checkedarr: [],
fiveData: [], fiveData: [],
@@ -79,7 +82,14 @@ export default {
scale: null scale: null
}, },
filterText: '', 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() 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() { chuli() {
this.fatherID = []
var data = this.fiveData var data = this.fiveData
var arr = [] var arr = []
data.forEach(item => { data.forEach(item => {
@@ -128,8 +153,10 @@ export default {
if (arr[0].children[0].children[0].children.length > 0) { if (arr[0].children[0].children[0].children.length > 0) {
arr.forEach(m => { arr.forEach(m => {
m.icon = 'el-icon-menu' m.icon = 'el-icon-menu'
this.fatherID.push(m.id)
m.children.forEach(n => { m.children.forEach(n => {
n.icon = 'el-icon-share' n.icon = 'el-icon-share'
this.fatherID.push(n.id)
n.children.forEach(d => { n.children.forEach(d => {
d.icon = 'el-icon-s-flag' d.icon = 'el-icon-s-flag'
d.children.forEach((f, i) => { d.children.forEach((f, i) => {
@@ -148,8 +175,10 @@ export default {
} else if (arr[0].children[0].children[0].children.length == 0) { } else if (arr[0].children[0].children[0].children.length == 0) {
arr.forEach(m => { arr.forEach(m => {
m.icon = 'el-icon-menu' m.icon = 'el-icon-menu'
this.fatherID.push(m.id)
m.children.forEach(n => { m.children.forEach(n => {
n.icon = 'el-icon-share' n.icon = 'el-icon-share'
this.fatherID.push(n.id)
n.children.forEach((d, i) => { n.children.forEach((d, i) => {
d.icon = 'el-icon-warning' d.icon = 'el-icon-warning'
d.name = i + 1 + '_' + d.name d.name = i + 1 + '_' + d.name
@@ -169,9 +198,7 @@ export default {
window.sessionStorage.setItem('tree', this.tree) window.sessionStorage.setItem('tree', this.tree)
this.expandID.push(this.currentNode) this.expandID.push(this.currentNode)
this.$nextTick(() => {
this.$refs.menuTree.setCurrentKey(this.currentNode)
})
//初始化触发默认点击方法 //初始化触发默认点击方法
//alert('初始1') //alert('初始1')
this.$emit('chushiData', this.currentNode, this.treeMenuData) this.$emit('chushiData', this.currentNode, this.treeMenuData)
@@ -179,6 +206,7 @@ export default {
renderContent(h, { node, data, store }) { renderContent(h, { node, data, store }) {
this.onlinename = node.label this.onlinename = node.label
return ( return (
<span style="flex: 1; display: flex; align-items: center; justify-content: space-between; padding-right: 8px;"> <span style="flex: 1; display: flex; align-items: center; justify-content: space-between; padding-right: 8px;">
<span class="span-ellipsis"> <span class="span-ellipsis">
@@ -191,11 +219,28 @@ export default {
</span> </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() { handleClose() {
console.log(this.time)
this.dialogVisible = false this.dialogVisible = false
this.$emit('close')
}, },
// 过滤树节点 // 过滤树节点
filterNode(value, data, node) { filterNode(value, data, node) {

View File

@@ -5,7 +5,7 @@
<timeindex :id="1" ref="fff" :interval="3"></timeindex> <timeindex :id="1" ref="fff" :interval="3"></timeindex>
</el-form-item> --> </el-form-item> -->
<el-form-item label="筛选:" class="ml10"> <el-form-item label="筛选:" class="ml10">
<el-input v-model="form.searchValue" placeholder="输入关键字搜索" style="width: 100%" clearable /> <el-input v-model.trim="form.searchValue" placeholder="输入关键字搜索" style="width: 100%" clearable />
</el-form-item> </el-form-item>
<el-form-item class="ml10"> <el-form-item class="ml10">
@@ -218,10 +218,19 @@ export default {
id: '' id: ''
}) })
let data = this.tables.filter(item => item.id == this.radioId) let data = this.tables.filter(item => item.id == this.radioId)
this.tables = this.tables.filter(item => {
// 将 a 和 b 属性的值转换为字符串,然后检查是否包含目标值转换后的字符串
return (
String(item.cvtName).includes(String(this.form.searchValue)) ||
String(item.cvtModel).includes(String(this.form.searchValue))
)
})
data.length > 0 data.length > 0
? this.$refs.tableRef.setRadioRow(data[0]) ? this.$refs.tableRef.setRadioRow(data[0])
: this.$refs.tableRef.setRadioRow(this.tables[0]) : this.$refs.tableRef.setRadioRow(this.tables[0])
this.isLoading = false this.isLoading = false
}).catch(() => {
this.isLoading = false
}) })
}, },

View File

@@ -5,7 +5,7 @@
<timeindex :id="1" ref="fff" :interval="3"></timeindex> <timeindex :id="1" ref="fff" :interval="3"></timeindex>
</el-form-item> --> </el-form-item> -->
<el-form-item label="筛选:" class="ml10"> <el-form-item label="筛选:" class="ml10">
<el-input v-model="form.searchValue" clearable placeholder="输入关键字搜索" style="width: 100%" /> <el-input v-model.trim="form.searchValue" clearable placeholder="输入关键字搜索" style="width: 100%" />
</el-form-item> </el-form-item>
<el-form-item class="ml10"> <el-form-item class="ml10">
@@ -23,7 +23,6 @@
:row-config="{ isCurrent: true, isHover: true }" :row-config="{ isCurrent: true, isHover: true }"
size="mini" size="mini"
ref="classification" ref="classification"
style="width: 100%" style="width: 100%"
header-cell-class-name="table_header" header-cell-class-name="table_header"
> >
@@ -58,12 +57,12 @@
</vxe-table-column> </vxe-table-column>
</vxe-table> </vxe-table>
</div> </div>
<!-- 新增修改 --> <!-- 新增修改 -->
<forms ref="formRef" @querfromdata="querfromdata" @showForm="showForm = false" v-if="showForm" /> <forms ref="formRef" @querfromdata="querfromdata" @showForm="showForm = false" v-if="showForm" />
<!-- 执行算法 --> <!-- 执行算法 -->
<algorithm ref="algorithmRef" /> <algorithm ref="algorithmRef" v-if="showAlgorithm" @close="showAlgorithm = false" />
<!-- <el-pagination <!-- <el-pagination
background background
align="right" align="right"
@@ -89,6 +88,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
showAlgorithm: false,
form: { form: {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
@@ -183,7 +183,10 @@ export default {
}, },
// 执行算法 // 执行算法
handleAlgorithm() { handleAlgorithm() {
this.$refs.algorithmRef.open() this.showAlgorithm = true
setTimeout(() => {
this.$refs.algorithmRef.open()
}, 100)
}, },
// 绑定监测点 // 绑定监测点
handleBind(index, row) { handleBind(index, row) {

View File

@@ -9,13 +9,13 @@
> >
<el-form ref="form" :inline="true" :model="form" label-width="auto" :rules="rules" class="form"> <el-form ref="form" :inline="true" :model="form" label-width="auto" :rules="rules" class="form">
<el-form-item label="CVT名称:" prop="cvtName" style="width: 49%"> <el-form-item label="CVT名称:" prop="cvtName" style="width: 49%">
<el-input v-model="form.cvtName" placeholder="请输入CVT名称" /> <el-input v-model.trim="form.cvtName" placeholder="请输入CVT名称" />
</el-form-item> </el-form-item>
<el-form-item label="CVT型号:" prop="cvtModel" style="width: 49%"> <el-form-item label="CVT型号:" prop="cvtModel" style="width: 49%">
<el-input v-model="form.cvtModel" placeholder="请输入CVT型号" /> <el-input v-model.trim="form.cvtModel" placeholder="请输入CVT型号" />
</el-form-item> </el-form-item>
<el-form-item v-for="item in frequency" :label="`${item}次:`" :prop="`h${item}`"> <el-form-item v-for="item in frequency" :label="`${item}次:`" :prop="`h${item}`">
<el-input type="number" v-model="form[`h${item}`]" @input="handleInput($event, `h${item}`)" /> <el-input type="number" v-model.trim="form[`h${item}`]" @input="handleInput($event, `h${item}`)" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="2次:" prop="h2"> <!-- <el-form-item label="2次:" prop="h2">

View File

@@ -542,19 +542,8 @@ export default {
month = '0' + month month = '0' + month
} }
this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.form.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.form.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.form.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.form.searchBeginTime = this.$refs.fff.timeValue[0] this.form.searchBeginTime = this.$refs.fff.timeValue[0]
this.form.searchEndTime = this.$refs.fff.timeValue[1] this.form.searchEndTime = this.$refs.fff.timeValue[1]
@@ -938,7 +927,7 @@ export default {
myChart2.clear(option) myChart2.clear(option)
myChart2.setOption(option) myChart2.setOption(option)
window.echartsArr.push(myChart2) window.echartsArr.push(myChart2)
setTimeout(function () { setTimeout(function () {
myChart2.resize() myChart2.resize()
}, 0) }, 0)
@@ -976,19 +965,8 @@ window.echartsArr.push(myChart2)
month = '0' + month month = '0' + month
} }
this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.form.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.form.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.form.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.form.searchBeginTime = this.$refs.fff.timeValue[0] this.form.searchBeginTime = this.$refs.fff.timeValue[0]
this.form.searchEndTime = this.$refs.fff.timeValue[1] this.form.searchEndTime = this.$refs.fff.timeValue[1]
@@ -1320,7 +1298,7 @@ window.echartsArr.push(myChart2)
] ]
} }
option && myChart2.setOption(option, true) option && myChart2.setOption(option, true)
window.echartsArr.push(myChart2) window.echartsArr.push(myChart2)
setTimeout(function () { setTimeout(function () {
myChart2.resize() myChart2.resize()
}, 0) }, 0)
@@ -1349,19 +1327,8 @@ window.echartsArr.push(myChart2)
month = '0' + month month = '0' + month
} }
this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.form.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.form.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.form.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.form.searchBeginTime = this.$refs.fff.timeValue[0] this.form.searchBeginTime = this.$refs.fff.timeValue[0]
this.form.searchEndTime = this.$refs.fff.timeValue[1] this.form.searchEndTime = this.$refs.fff.timeValue[1]
@@ -1545,7 +1512,7 @@ window.echartsArr.push(myChart2)
} }
option && myChart2.setOption(option, true) option && myChart2.setOption(option, true)
window.echartsArr.push(myChart2) window.echartsArr.push(myChart2)
setTimeout(function () { setTimeout(function () {
myChart2.resize() myChart2.resize()
}, 0) }, 0)
@@ -1571,19 +1538,8 @@ window.echartsArr.push(myChart2)
month = '0' + month month = '0' + month
} }
this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.form.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.form.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.form.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.form.searchBeginTime = this.$refs.fff.timeValue[0] this.form.searchBeginTime = this.$refs.fff.timeValue[0]
this.form.searchEndTime = this.$refs.fff.timeValue[1] this.form.searchEndTime = this.$refs.fff.timeValue[1]
@@ -1768,7 +1724,7 @@ window.echartsArr.push(myChart2)
} }
option && myChart2.setOption(option, true) option && myChart2.setOption(option, true)
window.echartsArr.push(myChart2) window.echartsArr.push(myChart2)
setTimeout(function () { setTimeout(function () {
myChart2.resize() myChart2.resize()
}, 0) }, 0)
@@ -1796,19 +1752,8 @@ window.echartsArr.push(myChart2)
month = '0' + month month = '0' + month
} }
this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.form.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.form.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.form.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.form.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.form.searchBeginTime = this.$refs.fff.timeValue[0] this.form.searchBeginTime = this.$refs.fff.timeValue[0]
this.form.searchEndTime = this.$refs.fff.timeValue[1] this.form.searchEndTime = this.$refs.fff.timeValue[1]
@@ -2030,7 +1975,7 @@ window.echartsArr.push(myChart2)
] ]
} }
option && myChart2.setOption(option, true) option && myChart2.setOption(option, true)
window.echartsArr.push(myChart2) window.echartsArr.push(myChart2)
setTimeout(function () { setTimeout(function () {
myChart2.resize() myChart2.resize()
}, 0) }, 0)

View File

@@ -805,19 +805,9 @@ export default {
month = '0' + month month = '0' + month
} }
this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.formData.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.formData.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.formData.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.formData.searchBeginTime = this.$refs.timelist.timeValue[0] this.formData.searchBeginTime = this.$refs.timelist.timeValue[0]
this.formData.searchEndTime = this.$refs.timelist.timeValue[1] this.formData.searchEndTime = this.$refs.timelist.timeValue[1]

View File

@@ -676,19 +676,9 @@ export default {
month = '0' + month month = '0' + month
} }
this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.formData.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.formData.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.formData.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.formData.searchBeginTime = this.$refs.fkf.timeValue[0] this.formData.searchBeginTime = this.$refs.fkf.timeValue[0]
this.formData.searchEndTime = this.$refs.fkf.timeValue[1] this.formData.searchEndTime = this.$refs.fkf.timeValue[1]

View File

@@ -910,19 +910,9 @@ export default {
month = '0' + month month = '0' + month
} }
this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.formData.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.formData.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.formData.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.formData.searchBeginTime = this.$refs.fyf.timeValue[0] this.formData.searchBeginTime = this.$refs.fyf.timeValue[0]
this.formData.searchEndTime = this.$refs.fyf.timeValue[1] this.formData.searchEndTime = this.$refs.fyf.timeValue[1]

View File

@@ -657,19 +657,9 @@ export default {
month = '0' + month month = '0' + month
} }
this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2] this.formData.searchBeginTime = str1[0] + '-' + month + '-' + str1[2]
if (
month == 1 || this.formData.searchEndTime = str2[0] + '-' + month + '-' + new Date(str2[0], month, 0).getDate()
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12
) {
this.formData.searchEndTime = str2[0] + '-' + month + '-31'
} else {
this.formData.searchEndTime = str2[0] + '-' + month + '-30'
}
} else { } else {
this.formData.searchBeginTime = this.$refs.timepg.timeValue[0] this.formData.searchBeginTime = this.$refs.timepg.timeValue[0]
this.formData.searchEndTime = this.$refs.timepg.timeValue[1] this.formData.searchEndTime = this.$refs.timepg.timeValue[1]