方案测试项bug修改
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 测试项信息&数据绑定页面 -->
|
||||
{{ popupType }}
|
||||
<el-tabs type="border-card" v-model="activeName" v-if="popupType != 0 && popupType != 1">
|
||||
<el-tab-pane label="测试项信息" :name="0">
|
||||
<el-form
|
||||
@@ -193,7 +192,7 @@ const emit = defineEmits(['onSubmit'])
|
||||
//表单数据
|
||||
const form = ref({})
|
||||
//测试项数据
|
||||
const form1 = ref({})
|
||||
const form1: any = ref({})
|
||||
//折叠面板初始值
|
||||
const activeTab = ref(0)
|
||||
//tab初始值
|
||||
@@ -223,9 +222,6 @@ const initForm = () => {
|
||||
form.value = {
|
||||
itemName: '', //方案名称
|
||||
describe: '' //方案描述
|
||||
//测试项数据
|
||||
// records: [
|
||||
// ]
|
||||
}
|
||||
//测试项数据
|
||||
form1.value = {
|
||||
@@ -392,6 +388,17 @@ const popupType: any = ref(null)
|
||||
const planId: any = ref('')
|
||||
//回显方案、测试项操作
|
||||
const details = (val: any) => {
|
||||
console.log(val, '回显方案测试项操作66666')
|
||||
if (val.records && val.records.length != 0) {
|
||||
form.value = {
|
||||
describe: val.describe,
|
||||
itemName: val.itemName
|
||||
}
|
||||
} else {
|
||||
form1.value = val
|
||||
}
|
||||
|
||||
return
|
||||
//修改方案回显
|
||||
if (popupType.value == 1) {
|
||||
form.value = JSON.parse(JSON.stringify(val))
|
||||
@@ -491,7 +498,7 @@ const close = () => {
|
||||
const submit = () => {
|
||||
//新增方案
|
||||
if (popupType.value == 0) {
|
||||
ruleFormRef1.value.validate(valid => {
|
||||
ruleFormRef1.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
const subForm = {
|
||||
itemName: form.value.itemName,
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, watch, defineProps, defineEmits, inject, onMounted } from 'vue'
|
||||
import { getSchemeTree } from '@/api/cs-device-boot/planData'
|
||||
import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||
import { ElTree } from 'element-plus'
|
||||
@@ -188,16 +188,24 @@ const add = (node: any, data: any) => {
|
||||
}
|
||||
/** 编辑树节点 */
|
||||
const edit = async (node: Node, data: any) => {
|
||||
console.log(data, '????????????')
|
||||
planId.value = data.id
|
||||
//修改方案
|
||||
if (data.children) {
|
||||
await handleOpen(1, planId.value)
|
||||
}
|
||||
//修改测试项
|
||||
else {
|
||||
monitorId.value = data.id
|
||||
await handleOpen(3, planId.value)
|
||||
}
|
||||
await getTestRecordInfo(planId.value)
|
||||
.then(res => {
|
||||
console.log(res, '++++++++++++++++++++195========>')
|
||||
//修改方案
|
||||
if (data.children) {
|
||||
dialogRef.value.details(res.data)
|
||||
handleOpen(1, planId.value)
|
||||
}
|
||||
//修改测试项
|
||||
else {
|
||||
monitorId.value = data.id
|
||||
dialogRef.value.details(res.data.records[0])
|
||||
handleOpen(3, planId.value)
|
||||
}
|
||||
})
|
||||
.catch(e => {})
|
||||
}
|
||||
/** 删除树节点 */
|
||||
const del = (node: Node, data: any) => {
|
||||
|
||||
@@ -186,7 +186,7 @@ const voltageLevelList = dictData.getBasicData('Dev_Voltage')
|
||||
const volConTypeList = dictData.getBasicData('Dev_Connect')
|
||||
//值类型
|
||||
const pageHeight = mainHeight(20)
|
||||
const loading = ref(true)
|
||||
const loading = ref(false)
|
||||
const searchForm = ref({})
|
||||
const typeOptions = [
|
||||
{
|
||||
@@ -245,6 +245,7 @@ const nodeClick = async (e: anyObj) => {
|
||||
deviceData.value = []
|
||||
historyDevId.value = e.children && e.children.length != 0 ? e.children[0].id : e.id
|
||||
let id = e.pid ? e.pid : e.id
|
||||
|
||||
//查询测试项信息
|
||||
await getTestRecordInfo(id)
|
||||
.then(res => {
|
||||
@@ -269,7 +270,15 @@ const nodeClick = async (e: anyObj) => {
|
||||
})
|
||||
}
|
||||
const dialogRef = ref()
|
||||
const dailogForm = ref()
|
||||
const handleOpen = (val: any) => {
|
||||
console.log(deviceData.value, '++++++++')
|
||||
deviceData.value.records.map((item: any) => {
|
||||
if (item.id == activeName.value) {
|
||||
dailogForm.value = item
|
||||
}
|
||||
})
|
||||
dialogRef.value.details(dailogForm.value)
|
||||
// deviceData.value.records[0].id
|
||||
let ids = ''
|
||||
if (val == 3) {
|
||||
@@ -291,7 +300,7 @@ const refreshTree = () => {
|
||||
const range = (start: any, end: any, step: any) => {
|
||||
return Array.from({ length: (end - start) / step + 1 }, (_, i) => start + i * step)
|
||||
}
|
||||
const init = async () => {
|
||||
const init = () => {
|
||||
//调用子组件的方法切换的时候tree的节点也变化
|
||||
console.log(activeName.value, '000000')
|
||||
let list: any = []
|
||||
@@ -312,7 +321,6 @@ const init = async () => {
|
||||
'cadetblue'
|
||||
]
|
||||
if (historyDevId.value && legendDictList.value && legendDictList.value.selectedList) {
|
||||
loading.value = true
|
||||
// 选择指标的时候切换legend内容和data数据
|
||||
legendDictList.value?.selectedList?.map((item: any) => {
|
||||
if (item.dataType == searchForm.value.index) {
|
||||
@@ -321,7 +329,7 @@ const init = async () => {
|
||||
})
|
||||
|
||||
//选择的指标使用方法处理
|
||||
await formatCountOptions([searchForm.value.index])
|
||||
formatCountOptions([searchForm.value.index])
|
||||
//查询历史趋势
|
||||
historyDataList.value = []
|
||||
let middleTitle = ''
|
||||
@@ -363,7 +371,8 @@ const init = async () => {
|
||||
|
||||
getHistoryTrend(obj)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
console.log(res, '+++++++++3666')
|
||||
if (res.code === 'A0000') {
|
||||
historyDataList.value = res.data
|
||||
echartsData.value = null
|
||||
//icon图标替换legend图例
|
||||
|
||||
Reference in New Issue
Block a user