测试bug修改
This commit is contained in:
@@ -1,14 +1,4 @@
|
||||
export let color = [
|
||||
'#07CCCA',
|
||||
'#00BFF5',
|
||||
'#FFBF00',
|
||||
'#77DA63',
|
||||
'#D5FF6B',
|
||||
'#Ff6600',
|
||||
'#FF9100',
|
||||
'#5B6E96',
|
||||
'#66FFCC',
|
||||
'#B3B3B3'
|
||||
]
|
||||
export let color = [ '#07CCCA','#00BFF5', '#FFBF00', '#77DA63', '#D5FF6B', '#Ff6600', '#FF9100', '#5B6E96', '#66FFCC', '#B3B3B3']
|
||||
export const gradeColor3 = ['#339966', '#FFCC33', '#CC0000']
|
||||
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900','#996600','#CC0000']
|
||||
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
import { install$2 } from 'echarts/types/dist/shared'
|
||||
|
||||
export const yMethod = (arr: any) => {
|
||||
let interval = 0
|
||||
let maxValue = 0
|
||||
let minValue = 0
|
||||
let max = 0
|
||||
let min = 0
|
||||
maxValue = Math.max(...arr)
|
||||
minValue = Math.min(...arr)
|
||||
|
||||
if (maxValue > 1000) {
|
||||
if (maxValue > 1000 ||minValue < -1000) {
|
||||
max = Math.ceil(maxValue / 100) * 100
|
||||
if (minValue == 0) {
|
||||
min = 0
|
||||
} else {
|
||||
min = (Math.floor(minValue / 100) - 1) * 100
|
||||
min = (Math.floor(minValue / 100) ) * 100
|
||||
}
|
||||
} else {
|
||||
max = Math.ceil(maxValue / 10) * 10
|
||||
@@ -26,6 +22,5 @@ export const yMethod = (arr: any) => {
|
||||
} else if (max == 0 && minValue > -1 && minValue < 0) {
|
||||
min = -1
|
||||
}
|
||||
|
||||
return [min, max, interval]
|
||||
return [min, max]
|
||||
}
|
||||
|
||||
@@ -95,6 +95,8 @@ export default class TableStore {
|
||||
}
|
||||
this.table.loadCallback && this.table.loadCallback()
|
||||
this.table.loading = false
|
||||
}).catch(() => {
|
||||
this.table.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ const tableStore = new TableStore({
|
||||
tableStore.table.params.type = 0
|
||||
provide('tableStore', tableStore)
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
if (e.level == 2) {
|
||||
loading.value = false
|
||||
tableStore.table.params.deviceId = e.id
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-form-item label="">
|
||||
<el-page-header @back="$emit('close')">
|
||||
<template #content>
|
||||
<span class="text-large font-600 mr-3">{{ props.detail.name }}</span>
|
||||
<!-- <span class="text-large font-600 mr-3"></span> -->
|
||||
</template>
|
||||
</el-page-header>
|
||||
</el-form-item>
|
||||
@@ -121,7 +121,9 @@ const init = () => {
|
||||
})
|
||||
let [min, max] = yMethod(arr.map((item: any) => item.statisticalData.toFixed(2)))
|
||||
echartsData.value = {
|
||||
|
||||
options: {
|
||||
|
||||
grid: {
|
||||
top: '50px',
|
||||
left: '10px',
|
||||
@@ -157,6 +159,9 @@ const init = () => {
|
||||
}
|
||||
})
|
||||
},
|
||||
title: {
|
||||
text: props.detail.name?.split('(')[0],
|
||||
},
|
||||
tooltip: {
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
@@ -189,7 +194,7 @@ const init = () => {
|
||||
min: min,
|
||||
max: max,
|
||||
// interval:interval,
|
||||
|
||||
|
||||
// min: 134,
|
||||
// max: 500,
|
||||
// min: Math.ceil(
|
||||
@@ -219,7 +224,7 @@ const init = () => {
|
||||
// return a - b
|
||||
// })[0]
|
||||
// )) / 5,
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<span>{{ node.label }}</span>
|
||||
</div>
|
||||
<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' }">
|
||||
<Plus @click.stop="add(node, data)" />
|
||||
</el-icon>
|
||||
@@ -142,10 +142,11 @@ const treeData = ref({})
|
||||
const getTreeList = () => {
|
||||
getSchemeTree().then(res => {
|
||||
let arr: any[] = []
|
||||
|
||||
res.data.forEach((item: any) => {
|
||||
item.icon = 'el-icon-Menu'
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
item.children.forEach((item2: any) => {
|
||||
item?.children.forEach((item2: any) => {
|
||||
item2.icon = 'el-icon-Document'
|
||||
item2.color = config.getColorVal('elementUiPrimary')
|
||||
arr.push(item2)
|
||||
@@ -156,7 +157,7 @@ const getTreeList = () => {
|
||||
if (arr.length) {
|
||||
|
||||
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', {
|
||||
level: 2,
|
||||
@@ -188,7 +189,7 @@ const getPlanData = (row: any) => {
|
||||
const add = (node: any, data: any) => {
|
||||
planId.value = data.id
|
||||
//添加测试项
|
||||
if (data.children) {
|
||||
if (data?.children) {
|
||||
dialogRef.value.detailsType("tree")
|
||||
handleOpen(2, planId.value)
|
||||
}
|
||||
@@ -199,7 +200,7 @@ const edit = async (node: Node, data: any) => {
|
||||
await getTestRecordInfo(planId.value)
|
||||
.then(res => {
|
||||
//修改方案
|
||||
if (data.children) {
|
||||
if (data?.children) {
|
||||
dialogRef.value.detailsType("")
|
||||
dialogRef.value.details(res.data)
|
||||
handleOpen(1, planId.value)
|
||||
@@ -241,14 +242,14 @@ const del = (node: Node, data: any) => {
|
||||
//取消删除
|
||||
const cancelDel = () => { }
|
||||
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
|
||||
|
||||
emit('nodeChange', e)
|
||||
}
|
||||
const setCheckedNode = (e: anyObj) => {
|
||||
console.log("🚀 ~ setCheckedNode ~ e:", e)
|
||||
id.value=e
|
||||
id.value = e
|
||||
treRef.value.setCurrentKey(e)
|
||||
}
|
||||
watch(
|
||||
|
||||
@@ -248,15 +248,18 @@ const handleClickTabs = async () => {
|
||||
historyDevId.value = activeName.value
|
||||
schemeTreeRef.value.setCheckedNode(activeName.value)
|
||||
setTimeout(() => {
|
||||
init(true)
|
||||
init(true)
|
||||
}, 100);
|
||||
}
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
loading.value = true
|
||||
if (e == undefined) {
|
||||
return
|
||||
}
|
||||
console.log(123);
|
||||
|
||||
deviceData.value = []
|
||||
historyDevId.value = e.children && e.children.length != 0 ? e.children[0].id : e.id
|
||||
let id = e.pid ? e.pid : e.id
|
||||
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)
|
||||
@@ -277,6 +280,7 @@ const nodeClick = async (e: anyObj) => {
|
||||
|
||||
schemeTreeRef.value.getPlanData(deviceData.value)
|
||||
await setTimeout(() => {
|
||||
loading.value = true
|
||||
init(true)
|
||||
}, 100);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user