测试bug修改

This commit is contained in:
GGJ
2024-10-21 09:09:56 +08:00
parent 7670da7f9f
commit 9ec4a8676c
7 changed files with 33 additions and 35 deletions

View File

@@ -1,14 +1,4 @@
export let color = [ export let color = [ '#07CCCA','#00BFF5', '#FFBF00', '#77DA63', '#D5FF6B', '#Ff6600', '#FF9100', '#5B6E96', '#66FFCC', '#B3B3B3']
'#07CCCA',
'#00BFF5',
'#FFBF00',
'#77DA63',
'#D5FF6B',
'#Ff6600',
'#FF9100',
'#5B6E96',
'#66FFCC',
'#B3B3B3'
]
export const gradeColor3 = ['#339966', '#FFCC33', '#CC0000'] export const gradeColor3 = ['#339966', '#FFCC33', '#CC0000']
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900','#996600','#CC0000'] export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900','#996600','#CC0000']

View File

@@ -1,20 +1,16 @@
import { install$2 } from 'echarts/types/dist/shared'
export const yMethod = (arr: any) => { export const yMethod = (arr: any) => {
let interval = 0
let maxValue = 0 let maxValue = 0
let minValue = 0 let minValue = 0
let max = 0 let max = 0
let min = 0 let min = 0
maxValue = Math.max(...arr) maxValue = Math.max(...arr)
minValue = Math.min(...arr) minValue = Math.min(...arr)
if (maxValue > 1000 ||minValue < -1000) {
if (maxValue > 1000) {
max = Math.ceil(maxValue / 100) * 100 max = Math.ceil(maxValue / 100) * 100
if (minValue == 0) { if (minValue == 0) {
min = 0 min = 0
} else { } else {
min = (Math.floor(minValue / 100) - 1) * 100 min = (Math.floor(minValue / 100) ) * 100
} }
} else { } else {
max = Math.ceil(maxValue / 10) * 10 max = Math.ceil(maxValue / 10) * 10
@@ -26,6 +22,5 @@ export const yMethod = (arr: any) => {
} else if (max == 0 && minValue > -1 && minValue < 0) { } else if (max == 0 && minValue > -1 && minValue < 0) {
min = -1 min = -1
} }
return [min, max]
return [min, max, interval]
} }

View File

@@ -95,6 +95,8 @@ export default class TableStore {
} }
this.table.loadCallback && this.table.loadCallback() this.table.loadCallback && this.table.loadCallback()
this.table.loading = false this.table.loading = false
}).catch(() => {
this.table.loading = false
}) })
} }

View File

@@ -141,6 +141,7 @@ const tableStore = new TableStore({
tableStore.table.params.type = 0 tableStore.table.params.type = 0
provide('tableStore', tableStore) provide('tableStore', tableStore)
const nodeClick = async (e: anyObj) => { const nodeClick = async (e: anyObj) => {
console.log("🚀 ~ nodeClick ~ e:", e)
if (e.level == 2) { if (e.level == 2) {
loading.value = false loading.value = false
tableStore.table.params.deviceId = e.id tableStore.table.params.deviceId = e.id

View File

@@ -5,7 +5,7 @@
<el-form-item label=""> <el-form-item label="">
<el-page-header @back="$emit('close')"> <el-page-header @back="$emit('close')">
<template #content> <template #content>
<span class="text-large font-600 mr-3">{{ props.detail.name }}</span> <!-- <span class="text-large font-600 mr-3"></span> -->
</template> </template>
</el-page-header> </el-page-header>
</el-form-item> </el-form-item>
@@ -121,7 +121,9 @@ const init = () => {
}) })
let [min, max] = yMethod(arr.map((item: any) => item.statisticalData.toFixed(2))) let [min, max] = yMethod(arr.map((item: any) => item.statisticalData.toFixed(2)))
echartsData.value = { echartsData.value = {
options: { options: {
grid: { grid: {
top: '50px', top: '50px',
left: '10px', left: '10px',
@@ -157,6 +159,9 @@ const init = () => {
} }
}) })
}, },
title: {
text: props.detail.name?.split('(')[0],
},
tooltip: { tooltip: {
axisPointer: { axisPointer: {
type: 'cross', type: 'cross',
@@ -189,7 +194,7 @@ const init = () => {
min: min, min: min,
max: max, max: max,
// interval:interval, // interval:interval,
// min: 134, // min: 134,
// max: 500, // max: 500,
// min: Math.ceil( // min: Math.ceil(
@@ -219,7 +224,7 @@ const init = () => {
// return a - b // return a - b
// })[0] // })[0]
// )) / 5, // )) / 5,
}, },

View File

@@ -27,7 +27,7 @@
<span>{{ node.label }}</span> <span>{{ node.label }}</span>
</div> </div>
<div class="right"> <div class="right">
<a :style="{ marginRight: '0.5rem' }" v-if="data.children"> <a :style="{ marginRight: '0.5rem' }" v-if="data?.children">
<el-icon :style="{ color: '#0000FF' }"> <el-icon :style="{ color: '#0000FF' }">
<Plus @click.stop="add(node, data)" /> <Plus @click.stop="add(node, data)" />
</el-icon> </el-icon>
@@ -142,10 +142,11 @@ const treeData = ref({})
const getTreeList = () => { const getTreeList = () => {
getSchemeTree().then(res => { getSchemeTree().then(res => {
let arr: any[] = [] let arr: any[] = []
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
item.icon = 'el-icon-Menu' item.icon = 'el-icon-Menu'
item.color = config.getColorVal('elementUiPrimary') item.color = config.getColorVal('elementUiPrimary')
item.children.forEach((item2: any) => { item?.children.forEach((item2: any) => {
item2.icon = 'el-icon-Document' item2.icon = 'el-icon-Document'
item2.color = config.getColorVal('elementUiPrimary') item2.color = config.getColorVal('elementUiPrimary')
arr.push(item2) arr.push(item2)
@@ -156,7 +157,7 @@ const getTreeList = () => {
if (arr.length) { if (arr.length) {
treRef.value.setCurrentKey(id.value || arr[0].id) treRef.value.setCurrentKey(id.value || arr[0].id)
let list= id.value ? arr.find((item: any) => item.id == id.value) : arr[0] let list = id.value ? arr.find((item: any) => item.id == id.value) : arr[0]
// 注册父组件事件 // 注册父组件事件
emit('init', { emit('init', {
level: 2, level: 2,
@@ -188,7 +189,7 @@ const getPlanData = (row: any) => {
const add = (node: any, data: any) => { const add = (node: any, data: any) => {
planId.value = data.id planId.value = data.id
//添加测试项 //添加测试项
if (data.children) { if (data?.children) {
dialogRef.value.detailsType("tree") dialogRef.value.detailsType("tree")
handleOpen(2, planId.value) handleOpen(2, planId.value)
} }
@@ -199,7 +200,7 @@ const edit = async (node: Node, data: any) => {
await getTestRecordInfo(planId.value) await getTestRecordInfo(planId.value)
.then(res => { .then(res => {
//修改方案 //修改方案
if (data.children) { if (data?.children) {
dialogRef.value.detailsType("") dialogRef.value.detailsType("")
dialogRef.value.details(res.data) dialogRef.value.details(res.data)
handleOpen(1, planId.value) handleOpen(1, planId.value)
@@ -241,14 +242,14 @@ const del = (node: Node, data: any) => {
//取消删除 //取消删除
const cancelDel = () => { } const cancelDel = () => { }
const clickNode = (e: anyObj) => { const clickNode = (e: anyObj) => {
e.children ? (planId.value = e.id) : (planId.value = e.pid) e?.children ? (planId.value = e.id) : (planId.value = e.pid)
id.value = e.id id.value = e.id
emit('nodeChange', e) emit('nodeChange', e)
} }
const setCheckedNode = (e: anyObj) => { const setCheckedNode = (e: anyObj) => {
console.log("🚀 ~ setCheckedNode ~ e:", e) console.log("🚀 ~ setCheckedNode ~ e:", e)
id.value=e id.value = e
treRef.value.setCurrentKey(e) treRef.value.setCurrentKey(e)
} }
watch( watch(

View File

@@ -248,15 +248,18 @@ const handleClickTabs = async () => {
historyDevId.value = activeName.value historyDevId.value = activeName.value
schemeTreeRef.value.setCheckedNode(activeName.value) schemeTreeRef.value.setCheckedNode(activeName.value)
setTimeout(() => { setTimeout(() => {
init(true) init(true)
}, 100); }, 100);
} }
const nodeClick = async (e: anyObj) => { const nodeClick = async (e: anyObj) => {
console.log("🚀 ~ nodeClick ~ e:", e) if (e == undefined) {
loading.value = true return
}
console.log(123);
deviceData.value = [] deviceData.value = []
historyDevId.value = e.children && e.children.length != 0 ? e.children[0].id : e.id historyDevId.value = e?.children && e?.children.length != 0 ? e?.children[0].id : e?.id
let id = e.pid ? e.pid : e.id let id = e?.pid ? e?.pid : e?.id
//查询测试项信息 //查询测试项信息
await getTestRecordInfo(id) await getTestRecordInfo(id)
@@ -277,6 +280,7 @@ const nodeClick = async (e: anyObj) => {
schemeTreeRef.value.getPlanData(deviceData.value) schemeTreeRef.value.getPlanData(deviceData.value)
await setTimeout(() => { await setTimeout(() => {
loading.value = true
init(true) init(true)
}, 100); }, 100);